1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package gmail provides access to the Gmail API.
8//
9// For product documentation, see: https://developers.google.com/gmail/api/
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/gmail/v1"
16//   ...
17//   ctx := context.Background()
18//   gmailService, err := gmail.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
27//
28//   gmailService, err := gmail.NewService(ctx, option.WithScopes(gmail.GmailSettingsSharingScope))
29//
30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
31//
32//   gmailService, err := gmail.NewService(ctx, option.WithAPIKey("AIza..."))
33//
34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
35//
36//   config := &oauth2.Config{...}
37//   // ...
38//   token, err := config.Exchange(ctx, ...)
39//   gmailService, err := gmail.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
40//
41// See https://godoc.org/google.golang.org/api/option/ for details on options.
42package gmail // import "google.golang.org/api/gmail/v1"
43
44import (
45	"bytes"
46	"context"
47	"encoding/json"
48	"errors"
49	"fmt"
50	"io"
51	"net/http"
52	"net/url"
53	"strconv"
54	"strings"
55
56	googleapi "google.golang.org/api/googleapi"
57	gensupport "google.golang.org/api/internal/gensupport"
58	option "google.golang.org/api/option"
59	internaloption "google.golang.org/api/option/internaloption"
60	htransport "google.golang.org/api/transport/http"
61)
62
63// Always reference these packages, just in case the auto-generated code
64// below doesn't.
65var _ = bytes.NewBuffer
66var _ = strconv.Itoa
67var _ = fmt.Sprintf
68var _ = json.NewDecoder
69var _ = io.Copy
70var _ = url.Parse
71var _ = gensupport.MarshalJSON
72var _ = googleapi.Version
73var _ = errors.New
74var _ = strings.Replace
75var _ = context.Canceled
76var _ = internaloption.WithDefaultEndpoint
77
78const apiId = "gmail:v1"
79const apiName = "gmail"
80const apiVersion = "v1"
81const basePath = "https://www.googleapis.com/"
82const mtlsBasePath = "https://www.mtls.googleapis.com/"
83
84// OAuth2 scopes used by this API.
85const (
86	// Read, compose, send, and permanently delete all your email from Gmail
87	MailGoogleComScope = "https://mail.google.com/"
88
89	// Manage drafts and send emails when you interact with the add-on
90	GmailAddonsCurrentActionComposeScope = "https://www.googleapis.com/auth/gmail.addons.current.action.compose"
91
92	// View your email messages when you interact with the add-on
93	GmailAddonsCurrentMessageActionScope = "https://www.googleapis.com/auth/gmail.addons.current.message.action"
94
95	// View your email message metadata when the add-on is running
96	GmailAddonsCurrentMessageMetadataScope = "https://www.googleapis.com/auth/gmail.addons.current.message.metadata"
97
98	// View your email messages when the add-on is running
99	GmailAddonsCurrentMessageReadonlyScope = "https://www.googleapis.com/auth/gmail.addons.current.message.readonly"
100
101	// Manage drafts and send emails
102	GmailComposeScope = "https://www.googleapis.com/auth/gmail.compose"
103
104	// Insert mail into your mailbox
105	GmailInsertScope = "https://www.googleapis.com/auth/gmail.insert"
106
107	// Manage mailbox labels
108	GmailLabelsScope = "https://www.googleapis.com/auth/gmail.labels"
109
110	// View your email message metadata such as labels and headers, but not
111	// the email body
112	GmailMetadataScope = "https://www.googleapis.com/auth/gmail.metadata"
113
114	// View and modify but not delete your email
115	GmailModifyScope = "https://www.googleapis.com/auth/gmail.modify"
116
117	// View your email messages and settings
118	GmailReadonlyScope = "https://www.googleapis.com/auth/gmail.readonly"
119
120	// Send email on your behalf
121	GmailSendScope = "https://www.googleapis.com/auth/gmail.send"
122
123	// Manage your basic mail settings
124	GmailSettingsBasicScope = "https://www.googleapis.com/auth/gmail.settings.basic"
125
126	// Manage your sensitive mail settings, including who can manage your
127	// mail
128	GmailSettingsSharingScope = "https://www.googleapis.com/auth/gmail.settings.sharing"
129)
130
131// NewService creates a new Service.
132func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
133	scopesOption := option.WithScopes(
134		"https://mail.google.com/",
135		"https://www.googleapis.com/auth/gmail.addons.current.action.compose",
136		"https://www.googleapis.com/auth/gmail.addons.current.message.action",
137		"https://www.googleapis.com/auth/gmail.addons.current.message.metadata",
138		"https://www.googleapis.com/auth/gmail.addons.current.message.readonly",
139		"https://www.googleapis.com/auth/gmail.compose",
140		"https://www.googleapis.com/auth/gmail.insert",
141		"https://www.googleapis.com/auth/gmail.labels",
142		"https://www.googleapis.com/auth/gmail.metadata",
143		"https://www.googleapis.com/auth/gmail.modify",
144		"https://www.googleapis.com/auth/gmail.readonly",
145		"https://www.googleapis.com/auth/gmail.send",
146		"https://www.googleapis.com/auth/gmail.settings.basic",
147		"https://www.googleapis.com/auth/gmail.settings.sharing",
148	)
149	// NOTE: prepend, so we don't override user-specified scopes.
150	opts = append([]option.ClientOption{scopesOption}, opts...)
151	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
152	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
153	client, endpoint, err := htransport.NewClient(ctx, opts...)
154	if err != nil {
155		return nil, err
156	}
157	s, err := New(client)
158	if err != nil {
159		return nil, err
160	}
161	if endpoint != "" {
162		s.BasePath = endpoint
163	}
164	return s, nil
165}
166
167// New creates a new Service. It uses the provided http.Client for requests.
168//
169// Deprecated: please use NewService instead.
170// To provide a custom HTTP client, use option.WithHTTPClient.
171// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
172func New(client *http.Client) (*Service, error) {
173	if client == nil {
174		return nil, errors.New("client is nil")
175	}
176	s := &Service{client: client, BasePath: basePath}
177	s.Users = NewUsersService(s)
178	return s, nil
179}
180
181type Service struct {
182	client    *http.Client
183	BasePath  string // API endpoint base URL
184	UserAgent string // optional additional User-Agent fragment
185
186	Users *UsersService
187}
188
189func (s *Service) userAgent() string {
190	if s.UserAgent == "" {
191		return googleapi.UserAgent
192	}
193	return googleapi.UserAgent + " " + s.UserAgent
194}
195
196func NewUsersService(s *Service) *UsersService {
197	rs := &UsersService{s: s}
198	rs.Drafts = NewUsersDraftsService(s)
199	rs.History = NewUsersHistoryService(s)
200	rs.Labels = NewUsersLabelsService(s)
201	rs.Messages = NewUsersMessagesService(s)
202	rs.Settings = NewUsersSettingsService(s)
203	rs.Threads = NewUsersThreadsService(s)
204	return rs
205}
206
207type UsersService struct {
208	s *Service
209
210	Drafts *UsersDraftsService
211
212	History *UsersHistoryService
213
214	Labels *UsersLabelsService
215
216	Messages *UsersMessagesService
217
218	Settings *UsersSettingsService
219
220	Threads *UsersThreadsService
221}
222
223func NewUsersDraftsService(s *Service) *UsersDraftsService {
224	rs := &UsersDraftsService{s: s}
225	return rs
226}
227
228type UsersDraftsService struct {
229	s *Service
230}
231
232func NewUsersHistoryService(s *Service) *UsersHistoryService {
233	rs := &UsersHistoryService{s: s}
234	return rs
235}
236
237type UsersHistoryService struct {
238	s *Service
239}
240
241func NewUsersLabelsService(s *Service) *UsersLabelsService {
242	rs := &UsersLabelsService{s: s}
243	return rs
244}
245
246type UsersLabelsService struct {
247	s *Service
248}
249
250func NewUsersMessagesService(s *Service) *UsersMessagesService {
251	rs := &UsersMessagesService{s: s}
252	rs.Attachments = NewUsersMessagesAttachmentsService(s)
253	return rs
254}
255
256type UsersMessagesService struct {
257	s *Service
258
259	Attachments *UsersMessagesAttachmentsService
260}
261
262func NewUsersMessagesAttachmentsService(s *Service) *UsersMessagesAttachmentsService {
263	rs := &UsersMessagesAttachmentsService{s: s}
264	return rs
265}
266
267type UsersMessagesAttachmentsService struct {
268	s *Service
269}
270
271func NewUsersSettingsService(s *Service) *UsersSettingsService {
272	rs := &UsersSettingsService{s: s}
273	rs.Delegates = NewUsersSettingsDelegatesService(s)
274	rs.Filters = NewUsersSettingsFiltersService(s)
275	rs.ForwardingAddresses = NewUsersSettingsForwardingAddressesService(s)
276	rs.SendAs = NewUsersSettingsSendAsService(s)
277	return rs
278}
279
280type UsersSettingsService struct {
281	s *Service
282
283	Delegates *UsersSettingsDelegatesService
284
285	Filters *UsersSettingsFiltersService
286
287	ForwardingAddresses *UsersSettingsForwardingAddressesService
288
289	SendAs *UsersSettingsSendAsService
290}
291
292func NewUsersSettingsDelegatesService(s *Service) *UsersSettingsDelegatesService {
293	rs := &UsersSettingsDelegatesService{s: s}
294	return rs
295}
296
297type UsersSettingsDelegatesService struct {
298	s *Service
299}
300
301func NewUsersSettingsFiltersService(s *Service) *UsersSettingsFiltersService {
302	rs := &UsersSettingsFiltersService{s: s}
303	return rs
304}
305
306type UsersSettingsFiltersService struct {
307	s *Service
308}
309
310func NewUsersSettingsForwardingAddressesService(s *Service) *UsersSettingsForwardingAddressesService {
311	rs := &UsersSettingsForwardingAddressesService{s: s}
312	return rs
313}
314
315type UsersSettingsForwardingAddressesService struct {
316	s *Service
317}
318
319func NewUsersSettingsSendAsService(s *Service) *UsersSettingsSendAsService {
320	rs := &UsersSettingsSendAsService{s: s}
321	rs.SmimeInfo = NewUsersSettingsSendAsSmimeInfoService(s)
322	return rs
323}
324
325type UsersSettingsSendAsService struct {
326	s *Service
327
328	SmimeInfo *UsersSettingsSendAsSmimeInfoService
329}
330
331func NewUsersSettingsSendAsSmimeInfoService(s *Service) *UsersSettingsSendAsSmimeInfoService {
332	rs := &UsersSettingsSendAsSmimeInfoService{s: s}
333	return rs
334}
335
336type UsersSettingsSendAsSmimeInfoService struct {
337	s *Service
338}
339
340func NewUsersThreadsService(s *Service) *UsersThreadsService {
341	rs := &UsersThreadsService{s: s}
342	return rs
343}
344
345type UsersThreadsService struct {
346	s *Service
347}
348
349// AutoForwarding: Auto-forwarding settings for an account.
350type AutoForwarding struct {
351	// Disposition: The state that a message should be left in after it has
352	// been forwarded.
353	//
354	// Possible values:
355	//   "dispositionUnspecified" - Unspecified disposition.
356	//   "leaveInInbox" - Leave the message in the `INBOX`.
357	//   "archive" - Archive the message.
358	//   "trash" - Move the message to the `TRASH`.
359	//   "markRead" - Leave the message in the `INBOX` and mark it as read.
360	Disposition string `json:"disposition,omitempty"`
361
362	// EmailAddress: Email address to which all incoming messages are
363	// forwarded.  This email
364	// address must be a verified member of the forwarding addresses.
365	EmailAddress string `json:"emailAddress,omitempty"`
366
367	// Enabled: Whether all incoming mail is automatically forwarded to
368	// another address.
369	Enabled bool `json:"enabled,omitempty"`
370
371	// ServerResponse contains the HTTP response code and headers from the
372	// server.
373	googleapi.ServerResponse `json:"-"`
374
375	// ForceSendFields is a list of field names (e.g. "Disposition") to
376	// unconditionally include in API requests. By default, fields with
377	// empty values are omitted from API requests. However, any non-pointer,
378	// non-interface field appearing in ForceSendFields will be sent to the
379	// server regardless of whether the field is empty or not. This may be
380	// used to include empty fields in Patch requests.
381	ForceSendFields []string `json:"-"`
382
383	// NullFields is a list of field names (e.g. "Disposition") to include
384	// in API requests with the JSON null value. By default, fields with
385	// empty values are omitted from API requests. However, any field with
386	// an empty value appearing in NullFields will be sent to the server as
387	// null. It is an error if a field in this list has a non-empty value.
388	// This may be used to include null fields in Patch requests.
389	NullFields []string `json:"-"`
390}
391
392func (s *AutoForwarding) MarshalJSON() ([]byte, error) {
393	type NoMethod AutoForwarding
394	raw := NoMethod(*s)
395	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
396}
397
398type BatchDeleteMessagesRequest struct {
399	// Ids: The IDs of the messages to delete.
400	Ids []string `json:"ids,omitempty"`
401
402	// ForceSendFields is a list of field names (e.g. "Ids") to
403	// unconditionally include in API requests. By default, fields with
404	// empty values are omitted from API requests. However, any non-pointer,
405	// non-interface field appearing in ForceSendFields will be sent to the
406	// server regardless of whether the field is empty or not. This may be
407	// used to include empty fields in Patch requests.
408	ForceSendFields []string `json:"-"`
409
410	// NullFields is a list of field names (e.g. "Ids") to include in API
411	// requests with the JSON null value. By default, fields with empty
412	// values are omitted from API requests. However, any field with an
413	// empty value appearing in NullFields will be sent to the server as
414	// null. It is an error if a field in this list has a non-empty value.
415	// This may be used to include null fields in Patch requests.
416	NullFields []string `json:"-"`
417}
418
419func (s *BatchDeleteMessagesRequest) MarshalJSON() ([]byte, error) {
420	type NoMethod BatchDeleteMessagesRequest
421	raw := NoMethod(*s)
422	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
423}
424
425type BatchModifyMessagesRequest struct {
426	// AddLabelIds: A list of label IDs to add to messages.
427	AddLabelIds []string `json:"addLabelIds,omitempty"`
428
429	// Ids: The IDs of the messages to modify. There is a limit of 1000 ids
430	// per
431	// request.
432	Ids []string `json:"ids,omitempty"`
433
434	// RemoveLabelIds: A list of label IDs to remove from messages.
435	RemoveLabelIds []string `json:"removeLabelIds,omitempty"`
436
437	// ForceSendFields is a list of field names (e.g. "AddLabelIds") to
438	// unconditionally include in API requests. By default, fields with
439	// empty values are omitted from API requests. However, any non-pointer,
440	// non-interface field appearing in ForceSendFields will be sent to the
441	// server regardless of whether the field is empty or not. This may be
442	// used to include empty fields in Patch requests.
443	ForceSendFields []string `json:"-"`
444
445	// NullFields is a list of field names (e.g. "AddLabelIds") to include
446	// in API requests with the JSON null value. By default, fields with
447	// empty values are omitted from API requests. However, any field with
448	// an empty value appearing in NullFields will be sent to the server as
449	// null. It is an error if a field in this list has a non-empty value.
450	// This may be used to include null fields in Patch requests.
451	NullFields []string `json:"-"`
452}
453
454func (s *BatchModifyMessagesRequest) MarshalJSON() ([]byte, error) {
455	type NoMethod BatchModifyMessagesRequest
456	raw := NoMethod(*s)
457	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
458}
459
460// Delegate: Settings for a delegate. Delegates can read, send, and
461// delete messages, as
462// well as view and add contacts, for the delegator's account. See
463// <a href="https://support.google.com/mail/answer/138350">"Set up
464// mail delegation"</a> for more information about delegates.
465type Delegate struct {
466	// DelegateEmail: The email address of the delegate.
467	DelegateEmail string `json:"delegateEmail,omitempty"`
468
469	// VerificationStatus: Indicates whether this address has been verified
470	// and can act as a delegate
471	// for the account.  Read-only.
472	//
473	// Possible values:
474	//   "verificationStatusUnspecified" - Unspecified verification status.
475	//   "accepted" - The address can act a delegate for the account.
476	//   "pending" - A verification request was mailed to the address, and
477	// the owner has not
478	// yet accepted it.
479	//   "rejected" - A verification request was mailed to the address, and
480	// the owner rejected
481	// it.
482	//   "expired" - A verification request was mailed to the address, and
483	// it expired without
484	// verification.
485	VerificationStatus string `json:"verificationStatus,omitempty"`
486
487	// ServerResponse contains the HTTP response code and headers from the
488	// server.
489	googleapi.ServerResponse `json:"-"`
490
491	// ForceSendFields is a list of field names (e.g. "DelegateEmail") to
492	// unconditionally include in API requests. By default, fields with
493	// empty values are omitted from API requests. However, any non-pointer,
494	// non-interface field appearing in ForceSendFields will be sent to the
495	// server regardless of whether the field is empty or not. This may be
496	// used to include empty fields in Patch requests.
497	ForceSendFields []string `json:"-"`
498
499	// NullFields is a list of field names (e.g. "DelegateEmail") to include
500	// in API requests with the JSON null value. By default, fields with
501	// empty values are omitted from API requests. However, any field with
502	// an empty value appearing in NullFields will be sent to the server as
503	// null. It is an error if a field in this list has a non-empty value.
504	// This may be used to include null fields in Patch requests.
505	NullFields []string `json:"-"`
506}
507
508func (s *Delegate) MarshalJSON() ([]byte, error) {
509	type NoMethod Delegate
510	raw := NoMethod(*s)
511	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
512}
513
514// Draft: A draft email in the user's mailbox.
515type Draft struct {
516	// Id: The immutable ID of the draft.
517	Id string `json:"id,omitempty"`
518
519	// Message: The message content of the draft.
520	Message *Message `json:"message,omitempty"`
521
522	// ServerResponse contains the HTTP response code and headers from the
523	// server.
524	googleapi.ServerResponse `json:"-"`
525
526	// ForceSendFields is a list of field names (e.g. "Id") to
527	// unconditionally include in API requests. By default, fields with
528	// empty values are omitted from API requests. However, any non-pointer,
529	// non-interface field appearing in ForceSendFields will be sent to the
530	// server regardless of whether the field is empty or not. This may be
531	// used to include empty fields in Patch requests.
532	ForceSendFields []string `json:"-"`
533
534	// NullFields is a list of field names (e.g. "Id") to include in API
535	// requests with the JSON null value. By default, fields with empty
536	// values are omitted from API requests. However, any field with an
537	// empty value appearing in NullFields will be sent to the server as
538	// null. It is an error if a field in this list has a non-empty value.
539	// This may be used to include null fields in Patch requests.
540	NullFields []string `json:"-"`
541}
542
543func (s *Draft) MarshalJSON() ([]byte, error) {
544	type NoMethod Draft
545	raw := NoMethod(*s)
546	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
547}
548
549// Filter: Resource definition for Gmail filters. Filters apply to
550// specific messages
551// instead of an entire email thread.
552type Filter struct {
553	// Action: Action that the filter performs.
554	Action *FilterAction `json:"action,omitempty"`
555
556	// Criteria: Matching criteria for the filter.
557	Criteria *FilterCriteria `json:"criteria,omitempty"`
558
559	// Id: The server assigned ID of the filter.
560	Id string `json:"id,omitempty"`
561
562	// ServerResponse contains the HTTP response code and headers from the
563	// server.
564	googleapi.ServerResponse `json:"-"`
565
566	// ForceSendFields is a list of field names (e.g. "Action") to
567	// unconditionally include in API requests. By default, fields with
568	// empty values are omitted from API requests. However, any non-pointer,
569	// non-interface field appearing in ForceSendFields will be sent to the
570	// server regardless of whether the field is empty or not. This may be
571	// used to include empty fields in Patch requests.
572	ForceSendFields []string `json:"-"`
573
574	// NullFields is a list of field names (e.g. "Action") to include in API
575	// requests with the JSON null value. By default, fields with empty
576	// values are omitted from API requests. However, any field with an
577	// empty value appearing in NullFields will be sent to the server as
578	// null. It is an error if a field in this list has a non-empty value.
579	// This may be used to include null fields in Patch requests.
580	NullFields []string `json:"-"`
581}
582
583func (s *Filter) MarshalJSON() ([]byte, error) {
584	type NoMethod Filter
585	raw := NoMethod(*s)
586	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
587}
588
589// FilterAction: A set of actions to perform on a message.
590type FilterAction struct {
591	// AddLabelIds: List of labels to add to the message.
592	AddLabelIds []string `json:"addLabelIds,omitempty"`
593
594	// Forward: Email address that the message should be forwarded to.
595	Forward string `json:"forward,omitempty"`
596
597	// RemoveLabelIds: List of labels to remove from the message.
598	RemoveLabelIds []string `json:"removeLabelIds,omitempty"`
599
600	// ForceSendFields is a list of field names (e.g. "AddLabelIds") to
601	// unconditionally include in API requests. By default, fields with
602	// empty values are omitted from API requests. However, any non-pointer,
603	// non-interface field appearing in ForceSendFields will be sent to the
604	// server regardless of whether the field is empty or not. This may be
605	// used to include empty fields in Patch requests.
606	ForceSendFields []string `json:"-"`
607
608	// NullFields is a list of field names (e.g. "AddLabelIds") to include
609	// in API requests with the JSON null value. By default, fields with
610	// empty values are omitted from API requests. However, any field with
611	// an empty value appearing in NullFields will be sent to the server as
612	// null. It is an error if a field in this list has a non-empty value.
613	// This may be used to include null fields in Patch requests.
614	NullFields []string `json:"-"`
615}
616
617func (s *FilterAction) MarshalJSON() ([]byte, error) {
618	type NoMethod FilterAction
619	raw := NoMethod(*s)
620	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
621}
622
623// FilterCriteria: Message matching criteria.
624type FilterCriteria struct {
625	// ExcludeChats: Whether the response should exclude chats.
626	ExcludeChats bool `json:"excludeChats,omitempty"`
627
628	// From: The sender's display name or email address.
629	From string `json:"from,omitempty"`
630
631	// HasAttachment: Whether the message has any attachment.
632	HasAttachment bool `json:"hasAttachment,omitempty"`
633
634	// NegatedQuery: Only return messages not matching the specified query.
635	// Supports the same
636	// query format as the Gmail search box. For
637	// example,
638	// <code>"from:someuser@example.com
639	// rfc822msgid:<somemsgid@example.com>
640	// is:unread"</code>.
641	NegatedQuery string `json:"negatedQuery,omitempty"`
642
643	// Query: Only return messages matching the specified query. Supports
644	// the same
645	// query format as the Gmail search box. For
646	// example,
647	// <code>"from:someuser@example.com
648	// rfc822msgid:<somemsgid@example.com>
649	// is:unread"</code>.
650	Query string `json:"query,omitempty"`
651
652	// Size: The size of the entire RFC822 message in bytes, including all
653	// headers and
654	// attachments.
655	Size int64 `json:"size,omitempty"`
656
657	// SizeComparison: How the message size in bytes should be in relation
658	// to the size field.
659	//
660	// Possible values:
661	//   "unspecified"
662	//   "smaller" - Find messages smaller than the given size.
663	//   "larger" - Find messages larger than the given size.
664	SizeComparison string `json:"sizeComparison,omitempty"`
665
666	// Subject: Case-insensitive phrase found in the message's subject.
667	// Trailing and
668	// leading whitespace are be trimmed and adjacent spaces are collapsed.
669	Subject string `json:"subject,omitempty"`
670
671	// To: The recipient's display name or email address. Includes
672	// recipients in the
673	// "to", "cc", and "bcc" header fields. You can use simply the local
674	// part of
675	// the email address. For example, "example" and "example@" both
676	// match
677	// "example@gmail.com". This field is case-insensitive.
678	To string `json:"to,omitempty"`
679
680	// ForceSendFields is a list of field names (e.g. "ExcludeChats") to
681	// unconditionally include in API requests. By default, fields with
682	// empty values are omitted from API requests. However, any non-pointer,
683	// non-interface field appearing in ForceSendFields will be sent to the
684	// server regardless of whether the field is empty or not. This may be
685	// used to include empty fields in Patch requests.
686	ForceSendFields []string `json:"-"`
687
688	// NullFields is a list of field names (e.g. "ExcludeChats") to include
689	// in API requests with the JSON null value. By default, fields with
690	// empty values are omitted from API requests. However, any field with
691	// an empty value appearing in NullFields will be sent to the server as
692	// null. It is an error if a field in this list has a non-empty value.
693	// This may be used to include null fields in Patch requests.
694	NullFields []string `json:"-"`
695}
696
697func (s *FilterCriteria) MarshalJSON() ([]byte, error) {
698	type NoMethod FilterCriteria
699	raw := NoMethod(*s)
700	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
701}
702
703// ForwardingAddress: Settings for a forwarding address.
704type ForwardingAddress struct {
705	// ForwardingEmail: An email address to which messages can be forwarded.
706	ForwardingEmail string `json:"forwardingEmail,omitempty"`
707
708	// VerificationStatus: Indicates whether this address has been verified
709	// and is usable for
710	// forwarding.  Read-only.
711	//
712	// Possible values:
713	//   "verificationStatusUnspecified" - Unspecified verification status.
714	//   "accepted" - The address is ready to use for forwarding.
715	//   "pending" - The address is awaiting verification by the owner.
716	VerificationStatus string `json:"verificationStatus,omitempty"`
717
718	// ServerResponse contains the HTTP response code and headers from the
719	// server.
720	googleapi.ServerResponse `json:"-"`
721
722	// ForceSendFields is a list of field names (e.g. "ForwardingEmail") to
723	// unconditionally include in API requests. By default, fields with
724	// empty values are omitted from API requests. However, any non-pointer,
725	// non-interface field appearing in ForceSendFields will be sent to the
726	// server regardless of whether the field is empty or not. This may be
727	// used to include empty fields in Patch requests.
728	ForceSendFields []string `json:"-"`
729
730	// NullFields is a list of field names (e.g. "ForwardingEmail") to
731	// include in API requests with the JSON null value. By default, fields
732	// with empty values are omitted from API requests. However, any field
733	// with an empty value appearing in NullFields will be sent to the
734	// server as null. It is an error if a field in this list has a
735	// non-empty value. This may be used to include null fields in Patch
736	// requests.
737	NullFields []string `json:"-"`
738}
739
740func (s *ForwardingAddress) MarshalJSON() ([]byte, error) {
741	type NoMethod ForwardingAddress
742	raw := NoMethod(*s)
743	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
744}
745
746// History: A record of a change to the user's mailbox. Each history
747// change may affect
748// multiple messages in multiple ways.
749type History struct {
750	// Id: The mailbox sequence ID.
751	Id uint64 `json:"id,omitempty,string"`
752
753	// LabelsAdded: Labels added to messages in this history record.
754	LabelsAdded []*HistoryLabelAdded `json:"labelsAdded,omitempty"`
755
756	// LabelsRemoved: Labels removed from messages in this history record.
757	LabelsRemoved []*HistoryLabelRemoved `json:"labelsRemoved,omitempty"`
758
759	// Messages: List of messages changed in this history record.  The
760	// fields for specific
761	// change types, such as <code>messagesAdded</code> may duplicate
762	// messages in
763	// this field.  We recommend using the specific change-type fields
764	// instead
765	// of this.
766	Messages []*Message `json:"messages,omitempty"`
767
768	// MessagesAdded: Messages added to the mailbox in this history record.
769	MessagesAdded []*HistoryMessageAdded `json:"messagesAdded,omitempty"`
770
771	// MessagesDeleted: Messages deleted (not Trashed) from the mailbox in
772	// this history record.
773	MessagesDeleted []*HistoryMessageDeleted `json:"messagesDeleted,omitempty"`
774
775	// ForceSendFields is a list of field names (e.g. "Id") to
776	// unconditionally include in API requests. By default, fields with
777	// empty values are omitted from API requests. However, any non-pointer,
778	// non-interface field appearing in ForceSendFields will be sent to the
779	// server regardless of whether the field is empty or not. This may be
780	// used to include empty fields in Patch requests.
781	ForceSendFields []string `json:"-"`
782
783	// NullFields is a list of field names (e.g. "Id") to include in API
784	// requests with the JSON null value. By default, fields with empty
785	// values are omitted from API requests. However, any field with an
786	// empty value appearing in NullFields will be sent to the server as
787	// null. It is an error if a field in this list has a non-empty value.
788	// This may be used to include null fields in Patch requests.
789	NullFields []string `json:"-"`
790}
791
792func (s *History) MarshalJSON() ([]byte, error) {
793	type NoMethod History
794	raw := NoMethod(*s)
795	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
796}
797
798type HistoryLabelAdded struct {
799	// LabelIds: Label IDs added to the message.
800	LabelIds []string `json:"labelIds,omitempty"`
801
802	Message *Message `json:"message,omitempty"`
803
804	// ForceSendFields is a list of field names (e.g. "LabelIds") to
805	// unconditionally include in API requests. By default, fields with
806	// empty values are omitted from API requests. However, any non-pointer,
807	// non-interface field appearing in ForceSendFields will be sent to the
808	// server regardless of whether the field is empty or not. This may be
809	// used to include empty fields in Patch requests.
810	ForceSendFields []string `json:"-"`
811
812	// NullFields is a list of field names (e.g. "LabelIds") to include in
813	// API requests with the JSON null value. By default, fields with empty
814	// values are omitted from API requests. However, any field with an
815	// empty value appearing in NullFields will be sent to the server as
816	// null. It is an error if a field in this list has a non-empty value.
817	// This may be used to include null fields in Patch requests.
818	NullFields []string `json:"-"`
819}
820
821func (s *HistoryLabelAdded) MarshalJSON() ([]byte, error) {
822	type NoMethod HistoryLabelAdded
823	raw := NoMethod(*s)
824	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
825}
826
827type HistoryLabelRemoved struct {
828	// LabelIds: Label IDs removed from the message.
829	LabelIds []string `json:"labelIds,omitempty"`
830
831	Message *Message `json:"message,omitempty"`
832
833	// ForceSendFields is a list of field names (e.g. "LabelIds") to
834	// unconditionally include in API requests. By default, fields with
835	// empty values are omitted from API requests. However, any non-pointer,
836	// non-interface field appearing in ForceSendFields will be sent to the
837	// server regardless of whether the field is empty or not. This may be
838	// used to include empty fields in Patch requests.
839	ForceSendFields []string `json:"-"`
840
841	// NullFields is a list of field names (e.g. "LabelIds") to include in
842	// API requests with the JSON null value. By default, fields with empty
843	// values are omitted from API requests. However, any field with an
844	// empty value appearing in NullFields will be sent to the server as
845	// null. It is an error if a field in this list has a non-empty value.
846	// This may be used to include null fields in Patch requests.
847	NullFields []string `json:"-"`
848}
849
850func (s *HistoryLabelRemoved) MarshalJSON() ([]byte, error) {
851	type NoMethod HistoryLabelRemoved
852	raw := NoMethod(*s)
853	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
854}
855
856type HistoryMessageAdded struct {
857	Message *Message `json:"message,omitempty"`
858
859	// ForceSendFields is a list of field names (e.g. "Message") to
860	// unconditionally include in API requests. By default, fields with
861	// empty values are omitted from API requests. However, any non-pointer,
862	// non-interface field appearing in ForceSendFields will be sent to the
863	// server regardless of whether the field is empty or not. This may be
864	// used to include empty fields in Patch requests.
865	ForceSendFields []string `json:"-"`
866
867	// NullFields is a list of field names (e.g. "Message") to include in
868	// API requests with the JSON null value. By default, fields with empty
869	// values are omitted from API requests. However, any field with an
870	// empty value appearing in NullFields will be sent to the server as
871	// null. It is an error if a field in this list has a non-empty value.
872	// This may be used to include null fields in Patch requests.
873	NullFields []string `json:"-"`
874}
875
876func (s *HistoryMessageAdded) MarshalJSON() ([]byte, error) {
877	type NoMethod HistoryMessageAdded
878	raw := NoMethod(*s)
879	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
880}
881
882type HistoryMessageDeleted struct {
883	Message *Message `json:"message,omitempty"`
884
885	// ForceSendFields is a list of field names (e.g. "Message") to
886	// unconditionally include in API requests. By default, fields with
887	// empty values are omitted from API requests. However, any non-pointer,
888	// non-interface field appearing in ForceSendFields will be sent to the
889	// server regardless of whether the field is empty or not. This may be
890	// used to include empty fields in Patch requests.
891	ForceSendFields []string `json:"-"`
892
893	// NullFields is a list of field names (e.g. "Message") to include in
894	// API requests with the JSON null value. By default, fields with empty
895	// values are omitted from API requests. However, any field with an
896	// empty value appearing in NullFields will be sent to the server as
897	// null. It is an error if a field in this list has a non-empty value.
898	// This may be used to include null fields in Patch requests.
899	NullFields []string `json:"-"`
900}
901
902func (s *HistoryMessageDeleted) MarshalJSON() ([]byte, error) {
903	type NoMethod HistoryMessageDeleted
904	raw := NoMethod(*s)
905	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
906}
907
908// ImapSettings: IMAP settings for an account.
909type ImapSettings struct {
910	// AutoExpunge: If this value is true, Gmail will immediately expunge a
911	// message when it is
912	// marked as deleted in IMAP.  Otherwise, Gmail will wait for an update
913	// from
914	// the client before expunging messages marked as deleted.
915	AutoExpunge bool `json:"autoExpunge,omitempty"`
916
917	// Enabled: Whether IMAP is enabled for the account.
918	Enabled bool `json:"enabled,omitempty"`
919
920	// ExpungeBehavior: The action that will be executed on a message when
921	// it is marked as deleted
922	// and expunged from the last visible IMAP folder.
923	//
924	// Possible values:
925	//   "expungeBehaviorUnspecified" - Unspecified behavior.
926	//   "archive" - Archive messages marked as deleted.
927	//   "trash" - Move messages marked as deleted to the trash.
928	//   "deleteForever" - Immediately and permanently delete messages
929	// marked as deleted.  The
930	// expunged messages cannot be recovered.
931	ExpungeBehavior string `json:"expungeBehavior,omitempty"`
932
933	// MaxFolderSize: An optional limit on the number of messages that an
934	// IMAP folder may
935	// contain.  Legal values are 0, 1000, 2000, 5000 or 10000.  A value of
936	// zero
937	// is interpreted to mean that there is no limit.
938	MaxFolderSize int64 `json:"maxFolderSize,omitempty"`
939
940	// ServerResponse contains the HTTP response code and headers from the
941	// server.
942	googleapi.ServerResponse `json:"-"`
943
944	// ForceSendFields is a list of field names (e.g. "AutoExpunge") to
945	// unconditionally include in API requests. By default, fields with
946	// empty values are omitted from API requests. However, any non-pointer,
947	// non-interface field appearing in ForceSendFields will be sent to the
948	// server regardless of whether the field is empty or not. This may be
949	// used to include empty fields in Patch requests.
950	ForceSendFields []string `json:"-"`
951
952	// NullFields is a list of field names (e.g. "AutoExpunge") to include
953	// in API requests with the JSON null value. By default, fields with
954	// empty values are omitted from API requests. However, any field with
955	// an empty value appearing in NullFields will be sent to the server as
956	// null. It is an error if a field in this list has a non-empty value.
957	// This may be used to include null fields in Patch requests.
958	NullFields []string `json:"-"`
959}
960
961func (s *ImapSettings) MarshalJSON() ([]byte, error) {
962	type NoMethod ImapSettings
963	raw := NoMethod(*s)
964	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
965}
966
967// Label: Labels are used to categorize messages and threads within
968// the
969// user's mailbox.
970type Label struct {
971	// Color: The color to assign to the label. Color is only available for
972	// labels that
973	// have their <code>type</code> set to <code>user</code>.
974	// @mutable gmail.users.labels.create gmail.users.labels.update
975	Color *LabelColor `json:"color,omitempty"`
976
977	// Id: The immutable ID of the label.
978	Id string `json:"id,omitempty"`
979
980	// LabelListVisibility: The visibility of the label in the label list in
981	// the Gmail web interface.
982	// @mutable gmail.users.labels.create gmail.users.labels.update
983	//
984	// Possible values:
985	//   "labelShow"
986	//   "labelShowIfUnread"
987	//   "labelHide"
988	LabelListVisibility string `json:"labelListVisibility,omitempty"`
989
990	// MessageListVisibility: The visibility of the label in the message
991	// list in the
992	// Gmail web interface.
993	// @mutable gmail.users.labels.create gmail.users.labels.update
994	//
995	// Possible values:
996	//   "show"
997	//   "hide"
998	MessageListVisibility string `json:"messageListVisibility,omitempty"`
999
1000	// MessagesTotal: The total number of messages with the label.
1001	MessagesTotal int64 `json:"messagesTotal,omitempty"`
1002
1003	// MessagesUnread: The number of unread messages with the label.
1004	MessagesUnread int64 `json:"messagesUnread,omitempty"`
1005
1006	// Name: The display name of the label.
1007	// @mutable gmail.users.labels.create gmail.users.labels.update
1008	Name string `json:"name,omitempty"`
1009
1010	// ThreadsTotal: The total number of threads with the label.
1011	ThreadsTotal int64 `json:"threadsTotal,omitempty"`
1012
1013	// ThreadsUnread: The number of unread threads with the label.
1014	ThreadsUnread int64 `json:"threadsUnread,omitempty"`
1015
1016	// Type: The owner type for the label. User labels are created by the
1017	// user and
1018	// can be modified and deleted by the user and can be applied to
1019	// any
1020	// message or thread. System labels are internally created and cannot
1021	// be
1022	// added, modified, or deleted. System labels may be able to be applied
1023	// to or
1024	// removed from messages and threads under some circumstances but this
1025	// is
1026	// not guaranteed. For example, users can apply and remove
1027	// the
1028	// <code>INBOX</code> and <code>UNREAD</code> labels from messages
1029	// and
1030	// threads, but cannot apply or remove the <code>DRAFTS</code>
1031	// or
1032	// <code>SENT</code> labels from messages or threads.
1033	//
1034	// Possible values:
1035	//   "system"
1036	//   "user"
1037	Type string `json:"type,omitempty"`
1038
1039	// ServerResponse contains the HTTP response code and headers from the
1040	// server.
1041	googleapi.ServerResponse `json:"-"`
1042
1043	// ForceSendFields is a list of field names (e.g. "Color") to
1044	// unconditionally include in API requests. By default, fields with
1045	// empty values are omitted from API requests. However, any non-pointer,
1046	// non-interface field appearing in ForceSendFields will be sent to the
1047	// server regardless of whether the field is empty or not. This may be
1048	// used to include empty fields in Patch requests.
1049	ForceSendFields []string `json:"-"`
1050
1051	// NullFields is a list of field names (e.g. "Color") to include in API
1052	// requests with the JSON null value. By default, fields with empty
1053	// values are omitted from API requests. However, any field with an
1054	// empty value appearing in NullFields will be sent to the server as
1055	// null. It is an error if a field in this list has a non-empty value.
1056	// This may be used to include null fields in Patch requests.
1057	NullFields []string `json:"-"`
1058}
1059
1060func (s *Label) MarshalJSON() ([]byte, error) {
1061	type NoMethod Label
1062	raw := NoMethod(*s)
1063	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1064}
1065
1066type LabelColor struct {
1067	// BackgroundColor: The background color represented as hex string
1068	// #RRGGBB (ex #000000).
1069	// This field is required in order to set the color of a label.
1070	// Only the following predefined set of color values are
1071	// allowed:
1072	// <br/>
1073	// # 000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3,
1074	// #ffffff,
1075	//
1076	// # fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2,
1077	// #f691b3,
1078	//
1079	// # f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5,
1080	// #fcdee8,
1081	//
1082	// # efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1,
1083	// #fbc8d9,
1084	//
1085	// # e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8,
1086	// #f7a7c0,
1087	//
1088	// # cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce,
1089	// #e07798,
1090	//
1091	// # ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b,
1092	// #b65775,
1093	//
1094	// # 822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d,
1095	// #83334c
1096	//
1097	// # 464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e,
1098	// #e3d7ff,
1099	//
1100	// # 711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706,
1101	// #ffdeb5,
1102	//
1103	// # 594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e,
1104	// #a2dcc1,
1105	//
1106	// # c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537,
1107	// #ffad46,
1108	//
1109	// # 662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765
1110	//
1111	// @mutable gmail.users.labels.create gmail.users.labels.update
1112	BackgroundColor string `json:"backgroundColor,omitempty"`
1113
1114	// TextColor: The text color of the label, represented as hex
1115	// string.
1116	// This field is required in order to set the color of a label.
1117	// Only the following predefined set of color values are
1118	// allowed:
1119	// <br/>
1120	// # 000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3,
1121	// #ffffff,
1122	//
1123	// # fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2,
1124	// #f691b3,
1125	//
1126	// # f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5,
1127	// #fcdee8,
1128	//
1129	// # efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1,
1130	// #fbc8d9,
1131	//
1132	// # e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8,
1133	// #f7a7c0,
1134	//
1135	// # cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce,
1136	// #e07798,
1137	//
1138	// # ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b,
1139	// #b65775,
1140	//
1141	// # 822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d,
1142	// #83334c
1143	//
1144	// # 464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e,
1145	// #e3d7ff,
1146	//
1147	// # 711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706,
1148	// #ffdeb5,
1149	//
1150	// # 594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e,
1151	// #a2dcc1,
1152	//
1153	// # c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537,
1154	// #ffad46,
1155	//
1156	// # 662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765
1157	//
1158	// @mutable gmail.users.labels.create gmail.users.labels.update
1159	TextColor string `json:"textColor,omitempty"`
1160
1161	// ForceSendFields is a list of field names (e.g. "BackgroundColor") to
1162	// unconditionally include in API requests. By default, fields with
1163	// empty values are omitted from API requests. However, any non-pointer,
1164	// non-interface field appearing in ForceSendFields will be sent to the
1165	// server regardless of whether the field is empty or not. This may be
1166	// used to include empty fields in Patch requests.
1167	ForceSendFields []string `json:"-"`
1168
1169	// NullFields is a list of field names (e.g. "BackgroundColor") to
1170	// include in API requests with the JSON null value. By default, fields
1171	// with empty values are omitted from API requests. However, any field
1172	// with an empty value appearing in NullFields will be sent to the
1173	// server as null. It is an error if a field in this list has a
1174	// non-empty value. This may be used to include null fields in Patch
1175	// requests.
1176	NullFields []string `json:"-"`
1177}
1178
1179func (s *LabelColor) MarshalJSON() ([]byte, error) {
1180	type NoMethod LabelColor
1181	raw := NoMethod(*s)
1182	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1183}
1184
1185// LanguageSettings: Language settings for an account. These settings
1186// correspond to
1187// the <a
1188// href="https://support.google.com/mail/answer/17091">"Language
1189// settings
1190// "</a> feature in the web interface.
1191type LanguageSettings struct {
1192	// DisplayLanguage: The language to display Gmail in, formatted as an
1193	// <a
1194	// href="https://www.w3.org/International/articles/language-tags/">RFC
1195	// 3066
1196	// Language Tag</a> (for example <code>en-GB</code>, <code>fr</code>
1197	// or
1198	// <code>ja</code> for British English, French, or Japanese
1199	// respectively).
1200	//
1201	// The set of languages supported by Gmail evolves over time, so please
1202	// refer
1203	// to the "Language" dropdown in the
1204	// <a href="https://mail.google.com/mail/u/0/#settings/general">Gmail
1205	// settings
1206	// </a> for all available options, as described in the
1207	// <a href="https://support.google.com/mail/answer/17091">language
1208	// settings
1209	// help article</a>. A table of sample values is also provided in the
1210	// <a
1211	// href="/gmail/api/guides/language_settings#display_language">Managing
1212	// L
1213	// anguage Settings guide</a>
1214	//
1215	// Not all Gmail clients can display the same set of languages. In the
1216	// case
1217	// that a user's display language is not available for use on a
1218	// particular
1219	// client, said client automatically chooses to display in the
1220	// closest
1221	// supported variant (or a reasonable default).
1222	DisplayLanguage string `json:"displayLanguage,omitempty"`
1223
1224	// ServerResponse contains the HTTP response code and headers from the
1225	// server.
1226	googleapi.ServerResponse `json:"-"`
1227
1228	// ForceSendFields is a list of field names (e.g. "DisplayLanguage") to
1229	// unconditionally include in API requests. By default, fields with
1230	// empty values are omitted from API requests. However, any non-pointer,
1231	// non-interface field appearing in ForceSendFields will be sent to the
1232	// server regardless of whether the field is empty or not. This may be
1233	// used to include empty fields in Patch requests.
1234	ForceSendFields []string `json:"-"`
1235
1236	// NullFields is a list of field names (e.g. "DisplayLanguage") to
1237	// include in API requests with the JSON null value. By default, fields
1238	// with empty values are omitted from API requests. However, any field
1239	// with an empty value appearing in NullFields will be sent to the
1240	// server as null. It is an error if a field in this list has a
1241	// non-empty value. This may be used to include null fields in Patch
1242	// requests.
1243	NullFields []string `json:"-"`
1244}
1245
1246func (s *LanguageSettings) MarshalJSON() ([]byte, error) {
1247	type NoMethod LanguageSettings
1248	raw := NoMethod(*s)
1249	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1250}
1251
1252// ListDelegatesResponse: Response for the ListDelegates method.
1253type ListDelegatesResponse struct {
1254	// Delegates: List of the user's delegates (with any verification
1255	// status).
1256	Delegates []*Delegate `json:"delegates,omitempty"`
1257
1258	// ServerResponse contains the HTTP response code and headers from the
1259	// server.
1260	googleapi.ServerResponse `json:"-"`
1261
1262	// ForceSendFields is a list of field names (e.g. "Delegates") to
1263	// unconditionally include in API requests. By default, fields with
1264	// empty values are omitted from API requests. However, any non-pointer,
1265	// non-interface field appearing in ForceSendFields will be sent to the
1266	// server regardless of whether the field is empty or not. This may be
1267	// used to include empty fields in Patch requests.
1268	ForceSendFields []string `json:"-"`
1269
1270	// NullFields is a list of field names (e.g. "Delegates") to include in
1271	// API requests with the JSON null value. By default, fields with empty
1272	// values are omitted from API requests. However, any field with an
1273	// empty value appearing in NullFields will be sent to the server as
1274	// null. It is an error if a field in this list has a non-empty value.
1275	// This may be used to include null fields in Patch requests.
1276	NullFields []string `json:"-"`
1277}
1278
1279func (s *ListDelegatesResponse) MarshalJSON() ([]byte, error) {
1280	type NoMethod ListDelegatesResponse
1281	raw := NoMethod(*s)
1282	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1283}
1284
1285type ListDraftsResponse struct {
1286	// Drafts: List of drafts. Note that the <code>Message</code> property
1287	// in each
1288	// <code>Draft</code> resource only contains an <code>id</code> and
1289	// a
1290	// <code>threadId</code>. The
1291	// <a
1292	// href="/gmail/api/v1/reference/users/messages/get">messages.get</a>
1293	// met
1294	// hod can fetch additional message details.
1295	Drafts []*Draft `json:"drafts,omitempty"`
1296
1297	// NextPageToken: Token to retrieve the next page of results in the
1298	// list.
1299	NextPageToken string `json:"nextPageToken,omitempty"`
1300
1301	// ResultSizeEstimate: Estimated total number of results.
1302	ResultSizeEstimate int64 `json:"resultSizeEstimate,omitempty"`
1303
1304	// ServerResponse contains the HTTP response code and headers from the
1305	// server.
1306	googleapi.ServerResponse `json:"-"`
1307
1308	// ForceSendFields is a list of field names (e.g. "Drafts") to
1309	// unconditionally include in API requests. By default, fields with
1310	// empty values are omitted from API requests. However, any non-pointer,
1311	// non-interface field appearing in ForceSendFields will be sent to the
1312	// server regardless of whether the field is empty or not. This may be
1313	// used to include empty fields in Patch requests.
1314	ForceSendFields []string `json:"-"`
1315
1316	// NullFields is a list of field names (e.g. "Drafts") to include in API
1317	// requests with the JSON null value. By default, fields with empty
1318	// values are omitted from API requests. However, any field with an
1319	// empty value appearing in NullFields will be sent to the server as
1320	// null. It is an error if a field in this list has a non-empty value.
1321	// This may be used to include null fields in Patch requests.
1322	NullFields []string `json:"-"`
1323}
1324
1325func (s *ListDraftsResponse) MarshalJSON() ([]byte, error) {
1326	type NoMethod ListDraftsResponse
1327	raw := NoMethod(*s)
1328	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1329}
1330
1331// ListFiltersResponse: Response for the ListFilters method.
1332type ListFiltersResponse struct {
1333	// Filter: List of a user's filters.
1334	Filter []*Filter `json:"filter,omitempty"`
1335
1336	// ServerResponse contains the HTTP response code and headers from the
1337	// server.
1338	googleapi.ServerResponse `json:"-"`
1339
1340	// ForceSendFields is a list of field names (e.g. "Filter") to
1341	// unconditionally include in API requests. By default, fields with
1342	// empty values are omitted from API requests. However, any non-pointer,
1343	// non-interface field appearing in ForceSendFields will be sent to the
1344	// server regardless of whether the field is empty or not. This may be
1345	// used to include empty fields in Patch requests.
1346	ForceSendFields []string `json:"-"`
1347
1348	// NullFields is a list of field names (e.g. "Filter") to include in API
1349	// requests with the JSON null value. By default, fields with empty
1350	// values are omitted from API requests. However, any field with an
1351	// empty value appearing in NullFields will be sent to the server as
1352	// null. It is an error if a field in this list has a non-empty value.
1353	// This may be used to include null fields in Patch requests.
1354	NullFields []string `json:"-"`
1355}
1356
1357func (s *ListFiltersResponse) MarshalJSON() ([]byte, error) {
1358	type NoMethod ListFiltersResponse
1359	raw := NoMethod(*s)
1360	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1361}
1362
1363// ListForwardingAddressesResponse: Response for the
1364// ListForwardingAddresses method.
1365type ListForwardingAddressesResponse struct {
1366	// ForwardingAddresses: List of addresses that may be used for
1367	// forwarding.
1368	ForwardingAddresses []*ForwardingAddress `json:"forwardingAddresses,omitempty"`
1369
1370	// ServerResponse contains the HTTP response code and headers from the
1371	// server.
1372	googleapi.ServerResponse `json:"-"`
1373
1374	// ForceSendFields is a list of field names (e.g. "ForwardingAddresses")
1375	// to unconditionally include in API requests. By default, fields with
1376	// empty values are omitted from API requests. However, any non-pointer,
1377	// non-interface field appearing in ForceSendFields will be sent to the
1378	// server regardless of whether the field is empty or not. This may be
1379	// used to include empty fields in Patch requests.
1380	ForceSendFields []string `json:"-"`
1381
1382	// NullFields is a list of field names (e.g. "ForwardingAddresses") to
1383	// include in API requests with the JSON null value. By default, fields
1384	// with empty values are omitted from API requests. However, any field
1385	// with an empty value appearing in NullFields will be sent to the
1386	// server as null. It is an error if a field in this list has a
1387	// non-empty value. This may be used to include null fields in Patch
1388	// requests.
1389	NullFields []string `json:"-"`
1390}
1391
1392func (s *ListForwardingAddressesResponse) MarshalJSON() ([]byte, error) {
1393	type NoMethod ListForwardingAddressesResponse
1394	raw := NoMethod(*s)
1395	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1396}
1397
1398type ListHistoryResponse struct {
1399	// History: List of history records.  Any <code>messages</code>
1400	// contained in the
1401	// response will typically only have <code>id</code>
1402	// and
1403	// <code>threadId</code> fields populated.
1404	History []*History `json:"history,omitempty"`
1405
1406	// HistoryId: The ID of the mailbox's current history record.
1407	HistoryId uint64 `json:"historyId,omitempty,string"`
1408
1409	// NextPageToken: Page token to retrieve the next page of results in the
1410	// list.
1411	NextPageToken string `json:"nextPageToken,omitempty"`
1412
1413	// ServerResponse contains the HTTP response code and headers from the
1414	// server.
1415	googleapi.ServerResponse `json:"-"`
1416
1417	// ForceSendFields is a list of field names (e.g. "History") to
1418	// unconditionally include in API requests. By default, fields with
1419	// empty values are omitted from API requests. However, any non-pointer,
1420	// non-interface field appearing in ForceSendFields will be sent to the
1421	// server regardless of whether the field is empty or not. This may be
1422	// used to include empty fields in Patch requests.
1423	ForceSendFields []string `json:"-"`
1424
1425	// NullFields is a list of field names (e.g. "History") to include in
1426	// API requests with the JSON null value. By default, fields with empty
1427	// values are omitted from API requests. However, any field with an
1428	// empty value appearing in NullFields will be sent to the server as
1429	// null. It is an error if a field in this list has a non-empty value.
1430	// This may be used to include null fields in Patch requests.
1431	NullFields []string `json:"-"`
1432}
1433
1434func (s *ListHistoryResponse) MarshalJSON() ([]byte, error) {
1435	type NoMethod ListHistoryResponse
1436	raw := NoMethod(*s)
1437	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1438}
1439
1440type ListLabelsResponse struct {
1441	// Labels: List of labels. Note that each label resource only contains
1442	// an
1443	// <code>id</code>, <code>name</code>,
1444	// <code>messageListVisibility</code>,
1445	// <code>labelListVisibility</code>, and <code>type</code>. The
1446	// <a href="/gmail/api/v1/reference/users/labels/get">labels.get</a>
1447	// method
1448	// can fetch additional label details.
1449	Labels []*Label `json:"labels,omitempty"`
1450
1451	// ServerResponse contains the HTTP response code and headers from the
1452	// server.
1453	googleapi.ServerResponse `json:"-"`
1454
1455	// ForceSendFields is a list of field names (e.g. "Labels") to
1456	// unconditionally include in API requests. By default, fields with
1457	// empty values are omitted from API requests. However, any non-pointer,
1458	// non-interface field appearing in ForceSendFields will be sent to the
1459	// server regardless of whether the field is empty or not. This may be
1460	// used to include empty fields in Patch requests.
1461	ForceSendFields []string `json:"-"`
1462
1463	// NullFields is a list of field names (e.g. "Labels") to include in API
1464	// requests with the JSON null value. By default, fields with empty
1465	// values are omitted from API requests. However, any field with an
1466	// empty value appearing in NullFields will be sent to the server as
1467	// null. It is an error if a field in this list has a non-empty value.
1468	// This may be used to include null fields in Patch requests.
1469	NullFields []string `json:"-"`
1470}
1471
1472func (s *ListLabelsResponse) MarshalJSON() ([]byte, error) {
1473	type NoMethod ListLabelsResponse
1474	raw := NoMethod(*s)
1475	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1476}
1477
1478type ListMessagesResponse struct {
1479	// Messages: List of messages. Note that each message resource contains
1480	// only an
1481	// <code>id</code> and a <code>threadId</code>. Additional message
1482	// details can
1483	// be fetched using the
1484	// <a
1485	// href="/gmail/api/v1/reference/users/messages/get">messages.get</a>
1486	// met
1487	// hod.
1488	Messages []*Message `json:"messages,omitempty"`
1489
1490	// NextPageToken: Token to retrieve the next page of results in the
1491	// list.
1492	NextPageToken string `json:"nextPageToken,omitempty"`
1493
1494	// ResultSizeEstimate: Estimated total number of results.
1495	ResultSizeEstimate int64 `json:"resultSizeEstimate,omitempty"`
1496
1497	// ServerResponse contains the HTTP response code and headers from the
1498	// server.
1499	googleapi.ServerResponse `json:"-"`
1500
1501	// ForceSendFields is a list of field names (e.g. "Messages") to
1502	// unconditionally include in API requests. By default, fields with
1503	// empty values are omitted from API requests. However, any non-pointer,
1504	// non-interface field appearing in ForceSendFields will be sent to the
1505	// server regardless of whether the field is empty or not. This may be
1506	// used to include empty fields in Patch requests.
1507	ForceSendFields []string `json:"-"`
1508
1509	// NullFields is a list of field names (e.g. "Messages") to include in
1510	// API requests with the JSON null value. By default, fields with empty
1511	// values are omitted from API requests. However, any field with an
1512	// empty value appearing in NullFields will be sent to the server as
1513	// null. It is an error if a field in this list has a non-empty value.
1514	// This may be used to include null fields in Patch requests.
1515	NullFields []string `json:"-"`
1516}
1517
1518func (s *ListMessagesResponse) MarshalJSON() ([]byte, error) {
1519	type NoMethod ListMessagesResponse
1520	raw := NoMethod(*s)
1521	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1522}
1523
1524// ListSendAsResponse: Response for the ListSendAs method.
1525type ListSendAsResponse struct {
1526	// SendAs: List of send-as aliases.
1527	SendAs []*SendAs `json:"sendAs,omitempty"`
1528
1529	// ServerResponse contains the HTTP response code and headers from the
1530	// server.
1531	googleapi.ServerResponse `json:"-"`
1532
1533	// ForceSendFields is a list of field names (e.g. "SendAs") to
1534	// unconditionally include in API requests. By default, fields with
1535	// empty values are omitted from API requests. However, any non-pointer,
1536	// non-interface field appearing in ForceSendFields will be sent to the
1537	// server regardless of whether the field is empty or not. This may be
1538	// used to include empty fields in Patch requests.
1539	ForceSendFields []string `json:"-"`
1540
1541	// NullFields is a list of field names (e.g. "SendAs") to include in API
1542	// requests with the JSON null value. By default, fields with empty
1543	// values are omitted from API requests. However, any field with an
1544	// empty value appearing in NullFields will be sent to the server as
1545	// null. It is an error if a field in this list has a non-empty value.
1546	// This may be used to include null fields in Patch requests.
1547	NullFields []string `json:"-"`
1548}
1549
1550func (s *ListSendAsResponse) MarshalJSON() ([]byte, error) {
1551	type NoMethod ListSendAsResponse
1552	raw := NoMethod(*s)
1553	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1554}
1555
1556type ListSmimeInfoResponse struct {
1557	// SmimeInfo: List of SmimeInfo.
1558	SmimeInfo []*SmimeInfo `json:"smimeInfo,omitempty"`
1559
1560	// ServerResponse contains the HTTP response code and headers from the
1561	// server.
1562	googleapi.ServerResponse `json:"-"`
1563
1564	// ForceSendFields is a list of field names (e.g. "SmimeInfo") to
1565	// unconditionally include in API requests. By default, fields with
1566	// empty values are omitted from API requests. However, any non-pointer,
1567	// non-interface field appearing in ForceSendFields will be sent to the
1568	// server regardless of whether the field is empty or not. This may be
1569	// used to include empty fields in Patch requests.
1570	ForceSendFields []string `json:"-"`
1571
1572	// NullFields is a list of field names (e.g. "SmimeInfo") to include in
1573	// API requests with the JSON null value. By default, fields with empty
1574	// values are omitted from API requests. However, any field with an
1575	// empty value appearing in NullFields will be sent to the server as
1576	// null. It is an error if a field in this list has a non-empty value.
1577	// This may be used to include null fields in Patch requests.
1578	NullFields []string `json:"-"`
1579}
1580
1581func (s *ListSmimeInfoResponse) MarshalJSON() ([]byte, error) {
1582	type NoMethod ListSmimeInfoResponse
1583	raw := NoMethod(*s)
1584	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1585}
1586
1587type ListThreadsResponse struct {
1588	// NextPageToken: Page token to retrieve the next page of results in the
1589	// list.
1590	NextPageToken string `json:"nextPageToken,omitempty"`
1591
1592	// ResultSizeEstimate: Estimated total number of results.
1593	ResultSizeEstimate int64 `json:"resultSizeEstimate,omitempty"`
1594
1595	// Threads: List of threads. Note that each thread resource does not
1596	// contain a list of
1597	// <code>messages</code>. The list of <code>messages</code> for a given
1598	// thread
1599	// can be fetched using the
1600	// <a href="/gmail/api/v1/reference/users/threads/get">threads.get</a>
1601	// method.
1602	Threads []*Thread `json:"threads,omitempty"`
1603
1604	// ServerResponse contains the HTTP response code and headers from the
1605	// server.
1606	googleapi.ServerResponse `json:"-"`
1607
1608	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1609	// unconditionally include in API requests. By default, fields with
1610	// empty values are omitted from API requests. However, any non-pointer,
1611	// non-interface field appearing in ForceSendFields will be sent to the
1612	// server regardless of whether the field is empty or not. This may be
1613	// used to include empty fields in Patch requests.
1614	ForceSendFields []string `json:"-"`
1615
1616	// NullFields is a list of field names (e.g. "NextPageToken") to include
1617	// in API requests with the JSON null value. By default, fields with
1618	// empty values are omitted from API requests. However, any field with
1619	// an empty value appearing in NullFields will be sent to the server as
1620	// null. It is an error if a field in this list has a non-empty value.
1621	// This may be used to include null fields in Patch requests.
1622	NullFields []string `json:"-"`
1623}
1624
1625func (s *ListThreadsResponse) MarshalJSON() ([]byte, error) {
1626	type NoMethod ListThreadsResponse
1627	raw := NoMethod(*s)
1628	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1629}
1630
1631// Message: An email message.
1632type Message struct {
1633	// HistoryId: The ID of the last history record that modified this
1634	// message.
1635	HistoryId uint64 `json:"historyId,omitempty,string"`
1636
1637	// Id: The immutable ID of the message.
1638	Id string `json:"id,omitempty"`
1639
1640	// InternalDate: The internal message creation timestamp (epoch ms),
1641	// which determines
1642	// ordering in the inbox.  For normal SMTP-received email, this
1643	// represents the
1644	// time the message was originally accepted by Google, which is more
1645	// reliable
1646	// than the <code>Date</code> header. However, for API-migrated mail, it
1647	// can
1648	// be configured by client to be based on the <code>Date</code> header.
1649	InternalDate int64 `json:"internalDate,omitempty,string"`
1650
1651	// LabelIds: List of IDs of labels applied to this message.
1652	// @mutable gmail.users.messages.insert gmail.users.messages.modify
1653	LabelIds []string `json:"labelIds,omitempty"`
1654
1655	// Payload: The parsed email structure in the message parts.
1656	Payload *MessagePart `json:"payload,omitempty"`
1657
1658	// Raw: The entire email message in an RFC 2822 formatted and
1659	// base64url
1660	// encoded string. Returned in <code>messages.get</code>
1661	// and
1662	// <code>drafts.get</code> responses when the
1663	// <code>format=RAW</code>
1664	// parameter is supplied.
1665	// @mutable gmail.users.messages.insert
1666	// gmail.users.messages.send
1667	// @mutable gmail.users.drafts.create gmail.users.drafts.update
1668	Raw string `json:"raw,omitempty"`
1669
1670	// SizeEstimate: Estimated size in bytes of the message.
1671	SizeEstimate int64 `json:"sizeEstimate,omitempty"`
1672
1673	// Snippet: A short part of the message text.
1674	Snippet string `json:"snippet,omitempty"`
1675
1676	// ThreadId: The ID of the thread the message belongs to. To add a
1677	// message or draft to
1678	// a thread, the following criteria must be met:
1679	// <ol><li>The requested <code>threadId</code> must be specified on
1680	// the
1681	// <code>Message</code> or <code>Draft.Message</code> you supply with
1682	// your
1683	// request.</li>
1684	// <li>The <code>References</code> and <code>In-Reply-To</code> headers
1685	// must
1686	// be set in compliance with the
1687	// <a href="https://tools.ietf.org/html/rfc2822">RFC 2822</a>
1688	// standard.</li>
1689	// <li>The <code>Subject</code> headers must match.
1690	// @mutable gmail.users.messages.insert
1691	// gmail.users.messages.send
1692	// @mutable gmail.users.drafts.create gmail.users.drafts.update
1693	ThreadId string `json:"threadId,omitempty"`
1694
1695	// ServerResponse contains the HTTP response code and headers from the
1696	// server.
1697	googleapi.ServerResponse `json:"-"`
1698
1699	// ForceSendFields is a list of field names (e.g. "HistoryId") to
1700	// unconditionally include in API requests. By default, fields with
1701	// empty values are omitted from API requests. However, any non-pointer,
1702	// non-interface field appearing in ForceSendFields will be sent to the
1703	// server regardless of whether the field is empty or not. This may be
1704	// used to include empty fields in Patch requests.
1705	ForceSendFields []string `json:"-"`
1706
1707	// NullFields is a list of field names (e.g. "HistoryId") to include in
1708	// API requests with the JSON null value. By default, fields with empty
1709	// values are omitted from API requests. However, any field with an
1710	// empty value appearing in NullFields will be sent to the server as
1711	// null. It is an error if a field in this list has a non-empty value.
1712	// This may be used to include null fields in Patch requests.
1713	NullFields []string `json:"-"`
1714}
1715
1716func (s *Message) MarshalJSON() ([]byte, error) {
1717	type NoMethod Message
1718	raw := NoMethod(*s)
1719	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1720}
1721
1722// MessagePart: A single MIME message part.
1723type MessagePart struct {
1724	// Body: The message part body for this part, which may be empty
1725	// for
1726	// container MIME message parts.
1727	Body *MessagePartBody `json:"body,omitempty"`
1728
1729	// Filename: The filename of the attachment. Only present if this
1730	// message part
1731	// represents an attachment.
1732	Filename string `json:"filename,omitempty"`
1733
1734	// Headers: List of headers on this message part. For the top-level
1735	// message part,
1736	// representing the entire message payload, it will contain the
1737	// standard
1738	// RFC 2822 email headers such as <code>To</code>, <code>From</code>,
1739	// and
1740	// <code>Subject</code>.
1741	Headers []*MessagePartHeader `json:"headers,omitempty"`
1742
1743	// MimeType: The MIME type of the message part.
1744	MimeType string `json:"mimeType,omitempty"`
1745
1746	// PartId: The immutable ID of the message part.
1747	PartId string `json:"partId,omitempty"`
1748
1749	// Parts: The child MIME message parts of this part. This only applies
1750	// to container
1751	// MIME message parts, for example <code>multipart/*</code>. For
1752	// non-
1753	// container MIME message part types, such as <code>text/plain</code>,
1754	// this
1755	// field is empty. For more information, see
1756	// <a href="http://www.ietf.org/rfc/rfc1521.txt">RFC 1521</a>.
1757	Parts []*MessagePart `json:"parts,omitempty"`
1758
1759	// ForceSendFields is a list of field names (e.g. "Body") to
1760	// unconditionally include in API requests. By default, fields with
1761	// empty values are omitted from API requests. However, any non-pointer,
1762	// non-interface field appearing in ForceSendFields will be sent to the
1763	// server regardless of whether the field is empty or not. This may be
1764	// used to include empty fields in Patch requests.
1765	ForceSendFields []string `json:"-"`
1766
1767	// NullFields is a list of field names (e.g. "Body") to include in API
1768	// requests with the JSON null value. By default, fields with empty
1769	// values are omitted from API requests. However, any field with an
1770	// empty value appearing in NullFields will be sent to the server as
1771	// null. It is an error if a field in this list has a non-empty value.
1772	// This may be used to include null fields in Patch requests.
1773	NullFields []string `json:"-"`
1774}
1775
1776func (s *MessagePart) MarshalJSON() ([]byte, error) {
1777	type NoMethod MessagePart
1778	raw := NoMethod(*s)
1779	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1780}
1781
1782// MessagePartBody: The body of a single MIME message part.
1783type MessagePartBody struct {
1784	// AttachmentId: When present, contains the ID of an external attachment
1785	// that can be
1786	// retrieved in a separate <code>messages.attachments.get</code>
1787	// request.
1788	// When not present, the entire content of the message part body
1789	// is
1790	// contained in the data field.
1791	AttachmentId string `json:"attachmentId,omitempty"`
1792
1793	// Data: The body data of a MIME message part as a base64url encoded
1794	// string.
1795	// May be empty for MIME container
1796	// types that have no message body or when the body data is sent as
1797	// a
1798	// separate attachment. An attachment ID is present if the body data
1799	// is
1800	// contained in a separate attachment.
1801	Data string `json:"data,omitempty"`
1802
1803	// Size: Number of bytes for the message part data (encoding
1804	// notwithstanding).
1805	Size int64 `json:"size,omitempty"`
1806
1807	// ServerResponse contains the HTTP response code and headers from the
1808	// server.
1809	googleapi.ServerResponse `json:"-"`
1810
1811	// ForceSendFields is a list of field names (e.g. "AttachmentId") to
1812	// unconditionally include in API requests. By default, fields with
1813	// empty values are omitted from API requests. However, any non-pointer,
1814	// non-interface field appearing in ForceSendFields will be sent to the
1815	// server regardless of whether the field is empty or not. This may be
1816	// used to include empty fields in Patch requests.
1817	ForceSendFields []string `json:"-"`
1818
1819	// NullFields is a list of field names (e.g. "AttachmentId") to include
1820	// in API requests with the JSON null value. By default, fields with
1821	// empty values are omitted from API requests. However, any field with
1822	// an empty value appearing in NullFields will be sent to the server as
1823	// null. It is an error if a field in this list has a non-empty value.
1824	// This may be used to include null fields in Patch requests.
1825	NullFields []string `json:"-"`
1826}
1827
1828func (s *MessagePartBody) MarshalJSON() ([]byte, error) {
1829	type NoMethod MessagePartBody
1830	raw := NoMethod(*s)
1831	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1832}
1833
1834type MessagePartHeader struct {
1835	// Name: The name of the header before the <code>:</code> separator.
1836	// For
1837	// example, <code>To</code>.
1838	Name string `json:"name,omitempty"`
1839
1840	// Value: The value of the header after the <code>:</code> separator.
1841	// For example,
1842	// <code>someuser@example.com</code>.
1843	Value string `json:"value,omitempty"`
1844
1845	// ForceSendFields is a list of field names (e.g. "Name") to
1846	// unconditionally include in API requests. By default, fields with
1847	// empty values are omitted from API requests. However, any non-pointer,
1848	// non-interface field appearing in ForceSendFields will be sent to the
1849	// server regardless of whether the field is empty or not. This may be
1850	// used to include empty fields in Patch requests.
1851	ForceSendFields []string `json:"-"`
1852
1853	// NullFields is a list of field names (e.g. "Name") to include in API
1854	// requests with the JSON null value. By default, fields with empty
1855	// values are omitted from API requests. However, any field with an
1856	// empty value appearing in NullFields will be sent to the server as
1857	// null. It is an error if a field in this list has a non-empty value.
1858	// This may be used to include null fields in Patch requests.
1859	NullFields []string `json:"-"`
1860}
1861
1862func (s *MessagePartHeader) MarshalJSON() ([]byte, error) {
1863	type NoMethod MessagePartHeader
1864	raw := NoMethod(*s)
1865	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1866}
1867
1868type ModifyMessageRequest struct {
1869	// AddLabelIds: A list of IDs of labels to add to this message.
1870	AddLabelIds []string `json:"addLabelIds,omitempty"`
1871
1872	// RemoveLabelIds: A list IDs of labels to remove from this message.
1873	RemoveLabelIds []string `json:"removeLabelIds,omitempty"`
1874
1875	// ForceSendFields is a list of field names (e.g. "AddLabelIds") to
1876	// unconditionally include in API requests. By default, fields with
1877	// empty values are omitted from API requests. However, any non-pointer,
1878	// non-interface field appearing in ForceSendFields will be sent to the
1879	// server regardless of whether the field is empty or not. This may be
1880	// used to include empty fields in Patch requests.
1881	ForceSendFields []string `json:"-"`
1882
1883	// NullFields is a list of field names (e.g. "AddLabelIds") to include
1884	// in API requests with the JSON null value. By default, fields with
1885	// empty values are omitted from API requests. However, any field with
1886	// an empty value appearing in NullFields will be sent to the server as
1887	// null. It is an error if a field in this list has a non-empty value.
1888	// This may be used to include null fields in Patch requests.
1889	NullFields []string `json:"-"`
1890}
1891
1892func (s *ModifyMessageRequest) MarshalJSON() ([]byte, error) {
1893	type NoMethod ModifyMessageRequest
1894	raw := NoMethod(*s)
1895	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1896}
1897
1898type ModifyThreadRequest struct {
1899	// AddLabelIds: A list of IDs of labels to add to this thread.
1900	AddLabelIds []string `json:"addLabelIds,omitempty"`
1901
1902	// RemoveLabelIds: A list of IDs of labels to remove from this thread.
1903	RemoveLabelIds []string `json:"removeLabelIds,omitempty"`
1904
1905	// ForceSendFields is a list of field names (e.g. "AddLabelIds") to
1906	// unconditionally include in API requests. By default, fields with
1907	// empty values are omitted from API requests. However, any non-pointer,
1908	// non-interface field appearing in ForceSendFields will be sent to the
1909	// server regardless of whether the field is empty or not. This may be
1910	// used to include empty fields in Patch requests.
1911	ForceSendFields []string `json:"-"`
1912
1913	// NullFields is a list of field names (e.g. "AddLabelIds") to include
1914	// in API requests with the JSON null value. By default, fields with
1915	// empty values are omitted from API requests. However, any field with
1916	// an empty value appearing in NullFields will be sent to the server as
1917	// null. It is an error if a field in this list has a non-empty value.
1918	// This may be used to include null fields in Patch requests.
1919	NullFields []string `json:"-"`
1920}
1921
1922func (s *ModifyThreadRequest) MarshalJSON() ([]byte, error) {
1923	type NoMethod ModifyThreadRequest
1924	raw := NoMethod(*s)
1925	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1926}
1927
1928// PopSettings: POP settings for an account.
1929type PopSettings struct {
1930	// AccessWindow: The range of messages which are accessible via POP.
1931	//
1932	// Possible values:
1933	//   "accessWindowUnspecified" - Unspecified range.
1934	//   "disabled" - Indicates that no messages are accessible via POP.
1935	//   "fromNowOn" - Indicates that unfetched messages received after some
1936	// past point in
1937	// time are accessible via POP.
1938	//   "allMail" - Indicates that all unfetched messages are accessible
1939	// via POP.
1940	AccessWindow string `json:"accessWindow,omitempty"`
1941
1942	// Disposition: The action that will be executed on a message after it
1943	// has been fetched via
1944	// POP.
1945	//
1946	// Possible values:
1947	//   "dispositionUnspecified" - Unspecified disposition.
1948	//   "leaveInInbox" - Leave the message in the <code>INBOX</code>.
1949	//   "archive" - Archive the message.
1950	//   "trash" - Move the message to the <code>TRASH</code>.
1951	//   "markRead" - Leave the message in the <code>INBOX</code> and mark
1952	// it as read.
1953	Disposition string `json:"disposition,omitempty"`
1954
1955	// ServerResponse contains the HTTP response code and headers from the
1956	// server.
1957	googleapi.ServerResponse `json:"-"`
1958
1959	// ForceSendFields is a list of field names (e.g. "AccessWindow") to
1960	// unconditionally include in API requests. By default, fields with
1961	// empty values are omitted from API requests. However, any non-pointer,
1962	// non-interface field appearing in ForceSendFields will be sent to the
1963	// server regardless of whether the field is empty or not. This may be
1964	// used to include empty fields in Patch requests.
1965	ForceSendFields []string `json:"-"`
1966
1967	// NullFields is a list of field names (e.g. "AccessWindow") to include
1968	// in API requests with the JSON null value. By default, fields with
1969	// empty values are omitted from API requests. However, any field with
1970	// an empty value appearing in NullFields will be sent to the server as
1971	// null. It is an error if a field in this list has a non-empty value.
1972	// This may be used to include null fields in Patch requests.
1973	NullFields []string `json:"-"`
1974}
1975
1976func (s *PopSettings) MarshalJSON() ([]byte, error) {
1977	type NoMethod PopSettings
1978	raw := NoMethod(*s)
1979	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1980}
1981
1982// Profile: Profile for a Gmail user.
1983type Profile struct {
1984	// EmailAddress: The user's email address.
1985	EmailAddress string `json:"emailAddress,omitempty"`
1986
1987	// HistoryId: The ID of the mailbox's current history record.
1988	HistoryId uint64 `json:"historyId,omitempty,string"`
1989
1990	// MessagesTotal: The total number of messages in the mailbox.
1991	MessagesTotal int64 `json:"messagesTotal,omitempty"`
1992
1993	// ThreadsTotal: The total number of threads in the mailbox.
1994	ThreadsTotal int64 `json:"threadsTotal,omitempty"`
1995
1996	// ServerResponse contains the HTTP response code and headers from the
1997	// server.
1998	googleapi.ServerResponse `json:"-"`
1999
2000	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
2001	// unconditionally include in API requests. By default, fields with
2002	// empty values are omitted from API requests. However, any non-pointer,
2003	// non-interface field appearing in ForceSendFields will be sent to the
2004	// server regardless of whether the field is empty or not. This may be
2005	// used to include empty fields in Patch requests.
2006	ForceSendFields []string `json:"-"`
2007
2008	// NullFields is a list of field names (e.g. "EmailAddress") to include
2009	// in API requests with the JSON null value. By default, fields with
2010	// empty values are omitted from API requests. However, any field with
2011	// an empty value appearing in NullFields will be sent to the server as
2012	// null. It is an error if a field in this list has a non-empty value.
2013	// This may be used to include null fields in Patch requests.
2014	NullFields []string `json:"-"`
2015}
2016
2017func (s *Profile) MarshalJSON() ([]byte, error) {
2018	type NoMethod Profile
2019	raw := NoMethod(*s)
2020	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2021}
2022
2023// SendAs: Settings associated with a send-as alias, which can be either
2024// the primary
2025// login address associated with the account or a custom "from"
2026// address.
2027// Send-as aliases correspond to the
2028// <a href="https://support.google.com/mail/answer/22370">"Send Mail
2029// As"</a>
2030// feature in the web interface.
2031type SendAs struct {
2032	// DisplayName: A name that appears in the "From:" header for mail sent
2033	// using this alias.
2034	// For custom "from" addresses, when this is empty, Gmail will populate
2035	// the
2036	// "From:" header with the name that is used for the primary
2037	// address
2038	// associated with the account.
2039	// If the admin has disabled the ability for users to update their
2040	// name
2041	// format, requests to update this field for the primary login will
2042	// silently
2043	// fail.
2044	DisplayName string `json:"displayName,omitempty"`
2045
2046	// IsDefault: Whether this address is selected as the default "From:"
2047	// address in
2048	// situations such as composing a new message or sending a
2049	// vacation
2050	// auto-reply.  Every Gmail account has exactly one default send-as
2051	// address,
2052	// so the only legal value that clients may write to this field
2053	// is
2054	// <code>true</code>.  Changing this from <code>false</code>
2055	// to
2056	// <code>true</code> for an address will result in this field
2057	// becoming
2058	// <code>false</code> for the other previous default address.
2059	IsDefault bool `json:"isDefault,omitempty"`
2060
2061	// IsPrimary: Whether this address is the primary address used to login
2062	// to the account.
2063	// Every Gmail account has exactly one primary address, and it cannot
2064	// be
2065	// deleted from the collection of send-as aliases.  This field is
2066	// read-only.
2067	IsPrimary bool `json:"isPrimary,omitempty"`
2068
2069	// ReplyToAddress: An optional email address that is included in a
2070	// "Reply-To:" header for mail
2071	// sent using this alias.  If this is empty, Gmail will not generate
2072	// a
2073	// "Reply-To:" header.
2074	ReplyToAddress string `json:"replyToAddress,omitempty"`
2075
2076	// SendAsEmail: The email address that appears in the "From:" header for
2077	// mail sent using
2078	// this alias.  This is read-only for all operations except create.
2079	SendAsEmail string `json:"sendAsEmail,omitempty"`
2080
2081	// Signature: An optional HTML signature that is included in messages
2082	// composed with this
2083	// alias in the Gmail web UI.
2084	Signature string `json:"signature,omitempty"`
2085
2086	// SmtpMsa: An optional SMTP service that will be used as an outbound
2087	// relay for mail
2088	// sent using this alias.  If this is empty, outbound mail will be
2089	// sent
2090	// directly from Gmail's servers to the destination SMTP service.
2091	// This
2092	// setting only applies to custom "from" aliases.
2093	SmtpMsa *SmtpMsa `json:"smtpMsa,omitempty"`
2094
2095	// TreatAsAlias: Whether Gmail should <a
2096	// href="https://support.google.com/a/answer/1710338">
2097	// treat this address as an alias</a> for the user's primary email
2098	// address.
2099	// This setting only applies to custom "from" aliases.
2100	TreatAsAlias bool `json:"treatAsAlias,omitempty"`
2101
2102	// VerificationStatus: Indicates whether this address has been verified
2103	// for use as a send-as
2104	// alias.  Read-only.  This setting only applies to custom "from"
2105	// aliases.
2106	//
2107	// Possible values:
2108	//   "verificationStatusUnspecified" - Unspecified verification status.
2109	//   "accepted" - The address is ready to use as a send-as alias.
2110	//   "pending" - The address is awaiting verification by the owner.
2111	VerificationStatus string `json:"verificationStatus,omitempty"`
2112
2113	// ServerResponse contains the HTTP response code and headers from the
2114	// server.
2115	googleapi.ServerResponse `json:"-"`
2116
2117	// ForceSendFields is a list of field names (e.g. "DisplayName") to
2118	// unconditionally include in API requests. By default, fields with
2119	// empty values are omitted from API requests. However, any non-pointer,
2120	// non-interface field appearing in ForceSendFields will be sent to the
2121	// server regardless of whether the field is empty or not. This may be
2122	// used to include empty fields in Patch requests.
2123	ForceSendFields []string `json:"-"`
2124
2125	// NullFields is a list of field names (e.g. "DisplayName") to include
2126	// in API requests with the JSON null value. By default, fields with
2127	// empty values are omitted from API requests. However, any field with
2128	// an empty value appearing in NullFields will be sent to the server as
2129	// null. It is an error if a field in this list has a non-empty value.
2130	// This may be used to include null fields in Patch requests.
2131	NullFields []string `json:"-"`
2132}
2133
2134func (s *SendAs) MarshalJSON() ([]byte, error) {
2135	type NoMethod SendAs
2136	raw := NoMethod(*s)
2137	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2138}
2139
2140// SmimeInfo: An S/MIME email config.
2141type SmimeInfo struct {
2142	// EncryptedKeyPassword: Encrypted key password, when key is encrypted.
2143	EncryptedKeyPassword string `json:"encryptedKeyPassword,omitempty"`
2144
2145	// Expiration: When the certificate expires (in milliseconds since
2146	// epoch).
2147	Expiration int64 `json:"expiration,omitempty,string"`
2148
2149	// Id: The immutable ID for the SmimeInfo.
2150	Id string `json:"id,omitempty"`
2151
2152	// IsDefault: Whether this SmimeInfo is the default one for this user's
2153	// send-as address.
2154	IsDefault bool `json:"isDefault,omitempty"`
2155
2156	// IssuerCn: The S/MIME certificate issuer's common name.
2157	IssuerCn string `json:"issuerCn,omitempty"`
2158
2159	// Pem: PEM formatted X509 concatenated certificate string (standard
2160	// base64
2161	// encoding).  Format used for returning key, which includes public
2162	// key
2163	// as well as certificate chain (not private key).
2164	Pem string `json:"pem,omitempty"`
2165
2166	// Pkcs12: PKCS#12 format containing a single private/public key pair
2167	// and
2168	// certificate chain.  This format is only accepted from client
2169	// for creating a new SmimeInfo and is never returned, because
2170	// the
2171	// private key is not intended to be exported.  PKCS#12 may be
2172	// encrypted,
2173	// in which case encryptedKeyPassword should be set appropriately.
2174	Pkcs12 string `json:"pkcs12,omitempty"`
2175
2176	// ServerResponse contains the HTTP response code and headers from the
2177	// server.
2178	googleapi.ServerResponse `json:"-"`
2179
2180	// ForceSendFields is a list of field names (e.g.
2181	// "EncryptedKeyPassword") to unconditionally include in API requests.
2182	// By default, fields with empty values are omitted from API requests.
2183	// However, any non-pointer, non-interface field appearing in
2184	// ForceSendFields will be sent to the server regardless of whether the
2185	// field is empty or not. This may be used to include empty fields in
2186	// Patch requests.
2187	ForceSendFields []string `json:"-"`
2188
2189	// NullFields is a list of field names (e.g. "EncryptedKeyPassword") to
2190	// include in API requests with the JSON null value. By default, fields
2191	// with empty values are omitted from API requests. However, any field
2192	// with an empty value appearing in NullFields will be sent to the
2193	// server as null. It is an error if a field in this list has a
2194	// non-empty value. This may be used to include null fields in Patch
2195	// requests.
2196	NullFields []string `json:"-"`
2197}
2198
2199func (s *SmimeInfo) MarshalJSON() ([]byte, error) {
2200	type NoMethod SmimeInfo
2201	raw := NoMethod(*s)
2202	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2203}
2204
2205// SmtpMsa: Configuration for communication with an SMTP service.
2206type SmtpMsa struct {
2207	// Host: The hostname of the SMTP service.  Required.
2208	Host string `json:"host,omitempty"`
2209
2210	// Password: The password that will be used for authentication with the
2211	// SMTP service.
2212	// This is a write-only field that can be specified in requests to
2213	// create or
2214	// update SendAs settings; it is never populated in responses.
2215	Password string `json:"password,omitempty"`
2216
2217	// Port: The port of the SMTP service.  Required.
2218	Port int64 `json:"port,omitempty"`
2219
2220	// SecurityMode: The protocol that will be used to secure communication
2221	// with the SMTP
2222	// service.  Required.
2223	//
2224	// Possible values:
2225	//   "securityModeUnspecified" - Unspecified security mode.
2226	//   "none" - Communication with the remote SMTP service is unsecured.
2227	// Requires port
2228	// 25.
2229	//   "ssl" - Communication with the remote SMTP service is secured using
2230	// SSL.
2231	//   "starttls" - Communication with the remote SMTP service is secured
2232	// using STARTTLS.
2233	SecurityMode string `json:"securityMode,omitempty"`
2234
2235	// Username: The username that will be used for authentication with the
2236	// SMTP service.
2237	// This is a write-only field that can be specified in requests to
2238	// create or
2239	// update SendAs settings; it is never populated in responses.
2240	Username string `json:"username,omitempty"`
2241
2242	// ForceSendFields is a list of field names (e.g. "Host") to
2243	// unconditionally include in API requests. By default, fields with
2244	// empty values are omitted from API requests. However, any non-pointer,
2245	// non-interface field appearing in ForceSendFields will be sent to the
2246	// server regardless of whether the field is empty or not. This may be
2247	// used to include empty fields in Patch requests.
2248	ForceSendFields []string `json:"-"`
2249
2250	// NullFields is a list of field names (e.g. "Host") to include in API
2251	// requests with the JSON null value. By default, fields with empty
2252	// values are omitted from API requests. However, any field with an
2253	// empty value appearing in NullFields will be sent to the server as
2254	// null. It is an error if a field in this list has a non-empty value.
2255	// This may be used to include null fields in Patch requests.
2256	NullFields []string `json:"-"`
2257}
2258
2259func (s *SmtpMsa) MarshalJSON() ([]byte, error) {
2260	type NoMethod SmtpMsa
2261	raw := NoMethod(*s)
2262	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2263}
2264
2265// Thread: A collection of messages representing a conversation.
2266type Thread struct {
2267	// HistoryId: The ID of the last history record that modified this
2268	// thread.
2269	HistoryId uint64 `json:"historyId,omitempty,string"`
2270
2271	// Id: The unique ID of the thread.
2272	Id string `json:"id,omitempty"`
2273
2274	// Messages: The list of messages in the thread.
2275	Messages []*Message `json:"messages,omitempty"`
2276
2277	// Snippet: A short part of the message text.
2278	Snippet string `json:"snippet,omitempty"`
2279
2280	// ServerResponse contains the HTTP response code and headers from the
2281	// server.
2282	googleapi.ServerResponse `json:"-"`
2283
2284	// ForceSendFields is a list of field names (e.g. "HistoryId") to
2285	// unconditionally include in API requests. By default, fields with
2286	// empty values are omitted from API requests. However, any non-pointer,
2287	// non-interface field appearing in ForceSendFields will be sent to the
2288	// server regardless of whether the field is empty or not. This may be
2289	// used to include empty fields in Patch requests.
2290	ForceSendFields []string `json:"-"`
2291
2292	// NullFields is a list of field names (e.g. "HistoryId") to include in
2293	// API requests with the JSON null value. By default, fields with empty
2294	// values are omitted from API requests. However, any field with an
2295	// empty value appearing in NullFields will be sent to the server as
2296	// null. It is an error if a field in this list has a non-empty value.
2297	// This may be used to include null fields in Patch requests.
2298	NullFields []string `json:"-"`
2299}
2300
2301func (s *Thread) MarshalJSON() ([]byte, error) {
2302	type NoMethod Thread
2303	raw := NoMethod(*s)
2304	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2305}
2306
2307// VacationSettings: Vacation auto-reply settings for an account.  These
2308// settings correspond to
2309// the <a
2310// href="https://support.google.com/mail/answer/25922">"Vacation
2311// responde
2312// r"</a> feature in the web interface.
2313type VacationSettings struct {
2314	// EnableAutoReply: Flag that controls whether Gmail automatically
2315	// replies to messages.
2316	EnableAutoReply bool `json:"enableAutoReply,omitempty"`
2317
2318	// EndTime: An optional end time for sending auto-replies (epoch
2319	// ms).
2320	// When this is specified, Gmail will automatically reply only to
2321	// messages
2322	// that it receives before the end time.  If both <code>startTime</code>
2323	// and
2324	// <code>endTime</code> are specified, <code>startTime</code> must
2325	// precede
2326	// <code>endTime</code>.
2327	EndTime int64 `json:"endTime,omitempty,string"`
2328
2329	// ResponseBodyHtml: Response body in HTML format.  Gmail will sanitize
2330	// the HTML before
2331	// storing it. If both <code>response_body_plain_text</code>
2332	// and
2333	// <code>response_body_html</code> are
2334	// specified,
2335	// <code>response_body_html</code> will be used.
2336	ResponseBodyHtml string `json:"responseBodyHtml,omitempty"`
2337
2338	// ResponseBodyPlainText: Response body in plain text format. If
2339	// both
2340	// <code>response_body_plain_text</code> and
2341	// <code>response_body_html</code>
2342	// are specified, <code>response_body_html</code> will be used.
2343	ResponseBodyPlainText string `json:"responseBodyPlainText,omitempty"`
2344
2345	// ResponseSubject: Optional text to prepend to the subject line in
2346	// vacation responses.  In
2347	// order to enable auto-replies, either the response subject or the
2348	// response
2349	// body must be nonempty.
2350	ResponseSubject string `json:"responseSubject,omitempty"`
2351
2352	// RestrictToContacts: Flag that determines whether responses are sent
2353	// to recipients who are not
2354	// in the user's list of contacts.
2355	RestrictToContacts bool `json:"restrictToContacts,omitempty"`
2356
2357	// RestrictToDomain: Flag that determines whether responses are sent to
2358	// recipients who are
2359	// outside of the user's domain. This feature is only available for G
2360	// Suite
2361	// users.
2362	RestrictToDomain bool `json:"restrictToDomain,omitempty"`
2363
2364	// StartTime: An optional start time for sending auto-replies (epoch
2365	// ms).
2366	// When this is specified, Gmail will automatically reply only to
2367	// messages
2368	// that it receives after the start time.  If both
2369	// <code>startTime</code> and
2370	// <code>endTime</code> are specified, <code>startTime</code> must
2371	// precede
2372	// <code>endTime</code>.
2373	StartTime int64 `json:"startTime,omitempty,string"`
2374
2375	// ServerResponse contains the HTTP response code and headers from the
2376	// server.
2377	googleapi.ServerResponse `json:"-"`
2378
2379	// ForceSendFields is a list of field names (e.g. "EnableAutoReply") to
2380	// unconditionally include in API requests. By default, fields with
2381	// empty values are omitted from API requests. However, any non-pointer,
2382	// non-interface field appearing in ForceSendFields will be sent to the
2383	// server regardless of whether the field is empty or not. This may be
2384	// used to include empty fields in Patch requests.
2385	ForceSendFields []string `json:"-"`
2386
2387	// NullFields is a list of field names (e.g. "EnableAutoReply") to
2388	// include in API requests with the JSON null value. By default, fields
2389	// with empty values are omitted from API requests. However, any field
2390	// with an empty value appearing in NullFields will be sent to the
2391	// server as null. It is an error if a field in this list has a
2392	// non-empty value. This may be used to include null fields in Patch
2393	// requests.
2394	NullFields []string `json:"-"`
2395}
2396
2397func (s *VacationSettings) MarshalJSON() ([]byte, error) {
2398	type NoMethod VacationSettings
2399	raw := NoMethod(*s)
2400	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2401}
2402
2403// WatchRequest: Set up or update a new push notification watch on this
2404// user's mailbox.
2405type WatchRequest struct {
2406	// LabelFilterAction: Filtering behavior of labelIds list specified.
2407	//
2408	// Possible values:
2409	//   "include" - Only get push notifications for message changes
2410	// relating to labelIds
2411	// specified.
2412	//   "exclude" - Get push notifications for all message changes except
2413	// those relating
2414	// to labelIds specified.
2415	LabelFilterAction string `json:"labelFilterAction,omitempty"`
2416
2417	// LabelIds: List of label_ids to restrict notifications about.  By
2418	// default,
2419	// if unspecified, all changes are pushed out.  If specified
2420	// then
2421	// dictates which labels are required for a push notification to
2422	// be generated.
2423	LabelIds []string `json:"labelIds,omitempty"`
2424
2425	// TopicName: A fully qualified Google Cloud Pub/Sub API topic name to
2426	// publish the
2427	// events to. This topic name **must** already exist in Cloud Pub/Sub
2428	// and
2429	// you **must** have already granted gmail "publish" permission on
2430	// it.
2431	// For example,
2432	// "projects/my-project-identifier/topics/my-topic-name"
2433	// (using the Cloud Pub/Sub "v1" topic naming format).
2434	//
2435	// Note that the "my-project-identifier" portion must exactly match
2436	// your
2437	// Google developer project id (the one executing this watch request).
2438	TopicName string `json:"topicName,omitempty"`
2439
2440	// ForceSendFields is a list of field names (e.g. "LabelFilterAction")
2441	// to unconditionally include in API requests. By default, fields with
2442	// empty values are omitted from API requests. However, any non-pointer,
2443	// non-interface field appearing in ForceSendFields will be sent to the
2444	// server regardless of whether the field is empty or not. This may be
2445	// used to include empty fields in Patch requests.
2446	ForceSendFields []string `json:"-"`
2447
2448	// NullFields is a list of field names (e.g. "LabelFilterAction") to
2449	// include in API requests with the JSON null value. By default, fields
2450	// with empty values are omitted from API requests. However, any field
2451	// with an empty value appearing in NullFields will be sent to the
2452	// server as null. It is an error if a field in this list has a
2453	// non-empty value. This may be used to include null fields in Patch
2454	// requests.
2455	NullFields []string `json:"-"`
2456}
2457
2458func (s *WatchRequest) MarshalJSON() ([]byte, error) {
2459	type NoMethod WatchRequest
2460	raw := NoMethod(*s)
2461	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2462}
2463
2464// WatchResponse: Push notification watch response.
2465type WatchResponse struct {
2466	// Expiration: When Gmail will stop sending notifications for mailbox
2467	// updates
2468	// (epoch millis). Call <code>watch</code> again before this time to
2469	// renew
2470	// the watch.
2471	Expiration int64 `json:"expiration,omitempty,string"`
2472
2473	// HistoryId: The ID of the mailbox's current history record.
2474	HistoryId uint64 `json:"historyId,omitempty,string"`
2475
2476	// ServerResponse contains the HTTP response code and headers from the
2477	// server.
2478	googleapi.ServerResponse `json:"-"`
2479
2480	// ForceSendFields is a list of field names (e.g. "Expiration") to
2481	// unconditionally include in API requests. By default, fields with
2482	// empty values are omitted from API requests. However, any non-pointer,
2483	// non-interface field appearing in ForceSendFields will be sent to the
2484	// server regardless of whether the field is empty or not. This may be
2485	// used to include empty fields in Patch requests.
2486	ForceSendFields []string `json:"-"`
2487
2488	// NullFields is a list of field names (e.g. "Expiration") to include in
2489	// API requests with the JSON null value. By default, fields with empty
2490	// values are omitted from API requests. However, any field with an
2491	// empty value appearing in NullFields will be sent to the server as
2492	// null. It is an error if a field in this list has a non-empty value.
2493	// This may be used to include null fields in Patch requests.
2494	NullFields []string `json:"-"`
2495}
2496
2497func (s *WatchResponse) MarshalJSON() ([]byte, error) {
2498	type NoMethod WatchResponse
2499	raw := NoMethod(*s)
2500	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2501}
2502
2503// method id "gmail.users.getProfile":
2504
2505type UsersGetProfileCall struct {
2506	s            *Service
2507	userId       string
2508	urlParams_   gensupport.URLParams
2509	ifNoneMatch_ string
2510	ctx_         context.Context
2511	header_      http.Header
2512}
2513
2514// GetProfile: Gets the current user's Gmail profile.
2515func (r *UsersService) GetProfile(userId string) *UsersGetProfileCall {
2516	c := &UsersGetProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2517	c.userId = userId
2518	return c
2519}
2520
2521// Fields allows partial responses to be retrieved. See
2522// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2523// for more information.
2524func (c *UsersGetProfileCall) Fields(s ...googleapi.Field) *UsersGetProfileCall {
2525	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2526	return c
2527}
2528
2529// IfNoneMatch sets the optional parameter which makes the operation
2530// fail if the object's ETag matches the given value. This is useful for
2531// getting updates only after the object has changed since the last
2532// request. Use googleapi.IsNotModified to check whether the response
2533// error from Do is the result of In-None-Match.
2534func (c *UsersGetProfileCall) IfNoneMatch(entityTag string) *UsersGetProfileCall {
2535	c.ifNoneMatch_ = entityTag
2536	return c
2537}
2538
2539// Context sets the context to be used in this call's Do method. Any
2540// pending HTTP request will be aborted if the provided context is
2541// canceled.
2542func (c *UsersGetProfileCall) Context(ctx context.Context) *UsersGetProfileCall {
2543	c.ctx_ = ctx
2544	return c
2545}
2546
2547// Header returns an http.Header that can be modified by the caller to
2548// add HTTP headers to the request.
2549func (c *UsersGetProfileCall) Header() http.Header {
2550	if c.header_ == nil {
2551		c.header_ = make(http.Header)
2552	}
2553	return c.header_
2554}
2555
2556func (c *UsersGetProfileCall) doRequest(alt string) (*http.Response, error) {
2557	reqHeaders := make(http.Header)
2558	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
2559	for k, v := range c.header_ {
2560		reqHeaders[k] = v
2561	}
2562	reqHeaders.Set("User-Agent", c.s.userAgent())
2563	if c.ifNoneMatch_ != "" {
2564		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2565	}
2566	var body io.Reader = nil
2567	c.urlParams_.Set("alt", alt)
2568	c.urlParams_.Set("prettyPrint", "false")
2569	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/profile")
2570	urls += "?" + c.urlParams_.Encode()
2571	req, err := http.NewRequest("GET", urls, body)
2572	if err != nil {
2573		return nil, err
2574	}
2575	req.Header = reqHeaders
2576	googleapi.Expand(req.URL, map[string]string{
2577		"userId": c.userId,
2578	})
2579	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2580}
2581
2582// Do executes the "gmail.users.getProfile" call.
2583// Exactly one of *Profile or error will be non-nil. Any non-2xx status
2584// code is an error. Response headers are in either
2585// *Profile.ServerResponse.Header or (if a response was returned at all)
2586// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2587// check whether the returned error was because http.StatusNotModified
2588// was returned.
2589func (c *UsersGetProfileCall) Do(opts ...googleapi.CallOption) (*Profile, error) {
2590	gensupport.SetOptions(c.urlParams_, opts...)
2591	res, err := c.doRequest("json")
2592	if res != nil && res.StatusCode == http.StatusNotModified {
2593		if res.Body != nil {
2594			res.Body.Close()
2595		}
2596		return nil, &googleapi.Error{
2597			Code:   res.StatusCode,
2598			Header: res.Header,
2599		}
2600	}
2601	if err != nil {
2602		return nil, err
2603	}
2604	defer googleapi.CloseBody(res)
2605	if err := googleapi.CheckResponse(res); err != nil {
2606		return nil, err
2607	}
2608	ret := &Profile{
2609		ServerResponse: googleapi.ServerResponse{
2610			Header:         res.Header,
2611			HTTPStatusCode: res.StatusCode,
2612		},
2613	}
2614	target := &ret
2615	if err := gensupport.DecodeResponse(target, res); err != nil {
2616		return nil, err
2617	}
2618	return ret, nil
2619	// {
2620	//   "description": "Gets the current user's Gmail profile.",
2621	//   "flatPath": "gmail/v1/users/{userId}/profile",
2622	//   "httpMethod": "GET",
2623	//   "id": "gmail.users.getProfile",
2624	//   "parameterOrder": [
2625	//     "userId"
2626	//   ],
2627	//   "parameters": {
2628	//     "userId": {
2629	//       "default": "me",
2630	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
2631	//       "location": "path",
2632	//       "required": true,
2633	//       "type": "string"
2634	//     }
2635	//   },
2636	//   "path": "gmail/v1/users/{userId}/profile",
2637	//   "response": {
2638	//     "$ref": "Profile"
2639	//   },
2640	//   "scopes": [
2641	//     "https://mail.google.com/",
2642	//     "https://www.googleapis.com/auth/gmail.compose",
2643	//     "https://www.googleapis.com/auth/gmail.metadata",
2644	//     "https://www.googleapis.com/auth/gmail.modify",
2645	//     "https://www.googleapis.com/auth/gmail.readonly"
2646	//   ]
2647	// }
2648
2649}
2650
2651// method id "gmail.users.stop":
2652
2653type UsersStopCall struct {
2654	s          *Service
2655	userId     string
2656	urlParams_ gensupport.URLParams
2657	ctx_       context.Context
2658	header_    http.Header
2659}
2660
2661// Stop: Stop receiving push notifications for the given user mailbox.
2662func (r *UsersService) Stop(userId string) *UsersStopCall {
2663	c := &UsersStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2664	c.userId = userId
2665	return c
2666}
2667
2668// Fields allows partial responses to be retrieved. See
2669// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2670// for more information.
2671func (c *UsersStopCall) Fields(s ...googleapi.Field) *UsersStopCall {
2672	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2673	return c
2674}
2675
2676// Context sets the context to be used in this call's Do method. Any
2677// pending HTTP request will be aborted if the provided context is
2678// canceled.
2679func (c *UsersStopCall) Context(ctx context.Context) *UsersStopCall {
2680	c.ctx_ = ctx
2681	return c
2682}
2683
2684// Header returns an http.Header that can be modified by the caller to
2685// add HTTP headers to the request.
2686func (c *UsersStopCall) Header() http.Header {
2687	if c.header_ == nil {
2688		c.header_ = make(http.Header)
2689	}
2690	return c.header_
2691}
2692
2693func (c *UsersStopCall) doRequest(alt string) (*http.Response, error) {
2694	reqHeaders := make(http.Header)
2695	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
2696	for k, v := range c.header_ {
2697		reqHeaders[k] = v
2698	}
2699	reqHeaders.Set("User-Agent", c.s.userAgent())
2700	var body io.Reader = nil
2701	c.urlParams_.Set("alt", alt)
2702	c.urlParams_.Set("prettyPrint", "false")
2703	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/stop")
2704	urls += "?" + c.urlParams_.Encode()
2705	req, err := http.NewRequest("POST", urls, body)
2706	if err != nil {
2707		return nil, err
2708	}
2709	req.Header = reqHeaders
2710	googleapi.Expand(req.URL, map[string]string{
2711		"userId": c.userId,
2712	})
2713	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2714}
2715
2716// Do executes the "gmail.users.stop" call.
2717func (c *UsersStopCall) Do(opts ...googleapi.CallOption) error {
2718	gensupport.SetOptions(c.urlParams_, opts...)
2719	res, err := c.doRequest("json")
2720	if err != nil {
2721		return err
2722	}
2723	defer googleapi.CloseBody(res)
2724	if err := googleapi.CheckResponse(res); err != nil {
2725		return err
2726	}
2727	return nil
2728	// {
2729	//   "description": "Stop receiving push notifications for the given user mailbox.",
2730	//   "flatPath": "gmail/v1/users/{userId}/stop",
2731	//   "httpMethod": "POST",
2732	//   "id": "gmail.users.stop",
2733	//   "parameterOrder": [
2734	//     "userId"
2735	//   ],
2736	//   "parameters": {
2737	//     "userId": {
2738	//       "default": "me",
2739	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
2740	//       "location": "path",
2741	//       "required": true,
2742	//       "type": "string"
2743	//     }
2744	//   },
2745	//   "path": "gmail/v1/users/{userId}/stop",
2746	//   "scopes": [
2747	//     "https://mail.google.com/",
2748	//     "https://www.googleapis.com/auth/gmail.metadata",
2749	//     "https://www.googleapis.com/auth/gmail.modify",
2750	//     "https://www.googleapis.com/auth/gmail.readonly"
2751	//   ]
2752	// }
2753
2754}
2755
2756// method id "gmail.users.watch":
2757
2758type UsersWatchCall struct {
2759	s            *Service
2760	userId       string
2761	watchrequest *WatchRequest
2762	urlParams_   gensupport.URLParams
2763	ctx_         context.Context
2764	header_      http.Header
2765}
2766
2767// Watch: Set up or update a push notification watch on the given user
2768// mailbox.
2769func (r *UsersService) Watch(userId string, watchrequest *WatchRequest) *UsersWatchCall {
2770	c := &UsersWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2771	c.userId = userId
2772	c.watchrequest = watchrequest
2773	return c
2774}
2775
2776// Fields allows partial responses to be retrieved. See
2777// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2778// for more information.
2779func (c *UsersWatchCall) Fields(s ...googleapi.Field) *UsersWatchCall {
2780	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2781	return c
2782}
2783
2784// Context sets the context to be used in this call's Do method. Any
2785// pending HTTP request will be aborted if the provided context is
2786// canceled.
2787func (c *UsersWatchCall) Context(ctx context.Context) *UsersWatchCall {
2788	c.ctx_ = ctx
2789	return c
2790}
2791
2792// Header returns an http.Header that can be modified by the caller to
2793// add HTTP headers to the request.
2794func (c *UsersWatchCall) Header() http.Header {
2795	if c.header_ == nil {
2796		c.header_ = make(http.Header)
2797	}
2798	return c.header_
2799}
2800
2801func (c *UsersWatchCall) doRequest(alt string) (*http.Response, error) {
2802	reqHeaders := make(http.Header)
2803	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
2804	for k, v := range c.header_ {
2805		reqHeaders[k] = v
2806	}
2807	reqHeaders.Set("User-Agent", c.s.userAgent())
2808	var body io.Reader = nil
2809	body, err := googleapi.WithoutDataWrapper.JSONReader(c.watchrequest)
2810	if err != nil {
2811		return nil, err
2812	}
2813	reqHeaders.Set("Content-Type", "application/json")
2814	c.urlParams_.Set("alt", alt)
2815	c.urlParams_.Set("prettyPrint", "false")
2816	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/watch")
2817	urls += "?" + c.urlParams_.Encode()
2818	req, err := http.NewRequest("POST", urls, body)
2819	if err != nil {
2820		return nil, err
2821	}
2822	req.Header = reqHeaders
2823	googleapi.Expand(req.URL, map[string]string{
2824		"userId": c.userId,
2825	})
2826	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2827}
2828
2829// Do executes the "gmail.users.watch" call.
2830// Exactly one of *WatchResponse or error will be non-nil. Any non-2xx
2831// status code is an error. Response headers are in either
2832// *WatchResponse.ServerResponse.Header or (if a response was returned
2833// at all) in error.(*googleapi.Error).Header. Use
2834// googleapi.IsNotModified to check whether the returned error was
2835// because http.StatusNotModified was returned.
2836func (c *UsersWatchCall) Do(opts ...googleapi.CallOption) (*WatchResponse, error) {
2837	gensupport.SetOptions(c.urlParams_, opts...)
2838	res, err := c.doRequest("json")
2839	if res != nil && res.StatusCode == http.StatusNotModified {
2840		if res.Body != nil {
2841			res.Body.Close()
2842		}
2843		return nil, &googleapi.Error{
2844			Code:   res.StatusCode,
2845			Header: res.Header,
2846		}
2847	}
2848	if err != nil {
2849		return nil, err
2850	}
2851	defer googleapi.CloseBody(res)
2852	if err := googleapi.CheckResponse(res); err != nil {
2853		return nil, err
2854	}
2855	ret := &WatchResponse{
2856		ServerResponse: googleapi.ServerResponse{
2857			Header:         res.Header,
2858			HTTPStatusCode: res.StatusCode,
2859		},
2860	}
2861	target := &ret
2862	if err := gensupport.DecodeResponse(target, res); err != nil {
2863		return nil, err
2864	}
2865	return ret, nil
2866	// {
2867	//   "description": "Set up or update a push notification watch on the given user mailbox.",
2868	//   "flatPath": "gmail/v1/users/{userId}/watch",
2869	//   "httpMethod": "POST",
2870	//   "id": "gmail.users.watch",
2871	//   "parameterOrder": [
2872	//     "userId"
2873	//   ],
2874	//   "parameters": {
2875	//     "userId": {
2876	//       "default": "me",
2877	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
2878	//       "location": "path",
2879	//       "required": true,
2880	//       "type": "string"
2881	//     }
2882	//   },
2883	//   "path": "gmail/v1/users/{userId}/watch",
2884	//   "request": {
2885	//     "$ref": "WatchRequest"
2886	//   },
2887	//   "response": {
2888	//     "$ref": "WatchResponse"
2889	//   },
2890	//   "scopes": [
2891	//     "https://mail.google.com/",
2892	//     "https://www.googleapis.com/auth/gmail.metadata",
2893	//     "https://www.googleapis.com/auth/gmail.modify",
2894	//     "https://www.googleapis.com/auth/gmail.readonly"
2895	//   ]
2896	// }
2897
2898}
2899
2900// method id "gmail.users.drafts.create":
2901
2902type UsersDraftsCreateCall struct {
2903	s          *Service
2904	userId     string
2905	draft      *Draft
2906	urlParams_ gensupport.URLParams
2907	mediaInfo_ *gensupport.MediaInfo
2908	ctx_       context.Context
2909	header_    http.Header
2910}
2911
2912// Create: Creates a new draft with the <code>DRAFT</code> label.
2913func (r *UsersDraftsService) Create(userId string, draft *Draft) *UsersDraftsCreateCall {
2914	c := &UsersDraftsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2915	c.userId = userId
2916	c.draft = draft
2917	return c
2918}
2919
2920// Media specifies the media to upload in one or more chunks. The chunk
2921// size may be controlled by supplying a MediaOption generated by
2922// googleapi.ChunkSize. The chunk size defaults to
2923// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
2924// upload request will be determined by sniffing the contents of r,
2925// unless a MediaOption generated by googleapi.ContentType is
2926// supplied.
2927// At most one of Media and ResumableMedia may be set.
2928func (c *UsersDraftsCreateCall) Media(r io.Reader, options ...googleapi.MediaOption) *UsersDraftsCreateCall {
2929	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
2930	return c
2931}
2932
2933// ResumableMedia specifies the media to upload in chunks and can be
2934// canceled with ctx.
2935//
2936// Deprecated: use Media instead.
2937//
2938// At most one of Media and ResumableMedia may be set. mediaType
2939// identifies the MIME media type of the upload, such as "image/png". If
2940// mediaType is "", it will be auto-detected. The provided ctx will
2941// supersede any context previously provided to the Context method.
2942func (c *UsersDraftsCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersDraftsCreateCall {
2943	c.ctx_ = ctx
2944	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
2945	return c
2946}
2947
2948// ProgressUpdater provides a callback function that will be called
2949// after every chunk. It should be a low-latency function in order to
2950// not slow down the upload operation. This should only be called when
2951// using ResumableMedia (as opposed to Media).
2952func (c *UsersDraftsCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersDraftsCreateCall {
2953	c.mediaInfo_.SetProgressUpdater(pu)
2954	return c
2955}
2956
2957// Fields allows partial responses to be retrieved. See
2958// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2959// for more information.
2960func (c *UsersDraftsCreateCall) Fields(s ...googleapi.Field) *UsersDraftsCreateCall {
2961	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2962	return c
2963}
2964
2965// Context sets the context to be used in this call's Do method. Any
2966// pending HTTP request will be aborted if the provided context is
2967// canceled.
2968// This context will supersede any context previously provided to the
2969// ResumableMedia method.
2970func (c *UsersDraftsCreateCall) Context(ctx context.Context) *UsersDraftsCreateCall {
2971	c.ctx_ = ctx
2972	return c
2973}
2974
2975// Header returns an http.Header that can be modified by the caller to
2976// add HTTP headers to the request.
2977func (c *UsersDraftsCreateCall) Header() http.Header {
2978	if c.header_ == nil {
2979		c.header_ = make(http.Header)
2980	}
2981	return c.header_
2982}
2983
2984func (c *UsersDraftsCreateCall) doRequest(alt string) (*http.Response, error) {
2985	reqHeaders := make(http.Header)
2986	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
2987	for k, v := range c.header_ {
2988		reqHeaders[k] = v
2989	}
2990	reqHeaders.Set("User-Agent", c.s.userAgent())
2991	var body io.Reader = nil
2992	body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft)
2993	if err != nil {
2994		return nil, err
2995	}
2996	reqHeaders.Set("Content-Type", "application/json")
2997	c.urlParams_.Set("alt", alt)
2998	c.urlParams_.Set("prettyPrint", "false")
2999	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts")
3000	if c.mediaInfo_ != nil {
3001		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/drafts")
3002		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
3003	}
3004	if body == nil {
3005		body = new(bytes.Buffer)
3006		reqHeaders.Set("Content-Type", "application/json")
3007	}
3008	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
3009	defer cleanup()
3010	urls += "?" + c.urlParams_.Encode()
3011	req, err := http.NewRequest("POST", urls, body)
3012	if err != nil {
3013		return nil, err
3014	}
3015	req.Header = reqHeaders
3016	req.GetBody = getBody
3017	googleapi.Expand(req.URL, map[string]string{
3018		"userId": c.userId,
3019	})
3020	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3021}
3022
3023// Do executes the "gmail.users.drafts.create" call.
3024// Exactly one of *Draft or error will be non-nil. Any non-2xx status
3025// code is an error. Response headers are in either
3026// *Draft.ServerResponse.Header or (if a response was returned at all)
3027// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3028// check whether the returned error was because http.StatusNotModified
3029// was returned.
3030func (c *UsersDraftsCreateCall) Do(opts ...googleapi.CallOption) (*Draft, error) {
3031	gensupport.SetOptions(c.urlParams_, opts...)
3032	res, err := c.doRequest("json")
3033	if res != nil && res.StatusCode == http.StatusNotModified {
3034		if res.Body != nil {
3035			res.Body.Close()
3036		}
3037		return nil, &googleapi.Error{
3038			Code:   res.StatusCode,
3039			Header: res.Header,
3040		}
3041	}
3042	if err != nil {
3043		return nil, err
3044	}
3045	defer googleapi.CloseBody(res)
3046	if err := googleapi.CheckResponse(res); err != nil {
3047		return nil, err
3048	}
3049	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
3050	if rx != nil {
3051		rx.Client = c.s.client
3052		rx.UserAgent = c.s.userAgent()
3053		ctx := c.ctx_
3054		if ctx == nil {
3055			ctx = context.TODO()
3056		}
3057		res, err = rx.Upload(ctx)
3058		if err != nil {
3059			return nil, err
3060		}
3061		defer res.Body.Close()
3062		if err := googleapi.CheckResponse(res); err != nil {
3063			return nil, err
3064		}
3065	}
3066	ret := &Draft{
3067		ServerResponse: googleapi.ServerResponse{
3068			Header:         res.Header,
3069			HTTPStatusCode: res.StatusCode,
3070		},
3071	}
3072	target := &ret
3073	if err := gensupport.DecodeResponse(target, res); err != nil {
3074		return nil, err
3075	}
3076	return ret, nil
3077	// {
3078	//   "description": "Creates a new draft with the \u003ccode\u003eDRAFT\u003c/code\u003e label.",
3079	//   "flatPath": "gmail/v1/users/{userId}/drafts",
3080	//   "httpMethod": "POST",
3081	//   "id": "gmail.users.drafts.create",
3082	//   "mediaUpload": {
3083	//     "accept": [
3084	//       "message/*"
3085	//     ],
3086	//     "maxSize": "36700160",
3087	//     "protocols": {
3088	//       "resumable": {
3089	//         "multipart": true,
3090	//         "path": "/resumable/upload/gmail/v1/users/{userId}/drafts"
3091	//       },
3092	//       "simple": {
3093	//         "multipart": true,
3094	//         "path": "/upload/gmail/v1/users/{userId}/drafts"
3095	//       }
3096	//     }
3097	//   },
3098	//   "parameterOrder": [
3099	//     "userId"
3100	//   ],
3101	//   "parameters": {
3102	//     "userId": {
3103	//       "default": "me",
3104	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
3105	//       "location": "path",
3106	//       "required": true,
3107	//       "type": "string"
3108	//     }
3109	//   },
3110	//   "path": "gmail/v1/users/{userId}/drafts",
3111	//   "request": {
3112	//     "$ref": "Draft"
3113	//   },
3114	//   "response": {
3115	//     "$ref": "Draft"
3116	//   },
3117	//   "scopes": [
3118	//     "https://mail.google.com/",
3119	//     "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
3120	//     "https://www.googleapis.com/auth/gmail.compose",
3121	//     "https://www.googleapis.com/auth/gmail.modify"
3122	//   ],
3123	//   "supportsMediaUpload": true
3124	// }
3125
3126}
3127
3128// method id "gmail.users.drafts.delete":
3129
3130type UsersDraftsDeleteCall struct {
3131	s          *Service
3132	userId     string
3133	id         string
3134	urlParams_ gensupport.URLParams
3135	ctx_       context.Context
3136	header_    http.Header
3137}
3138
3139// Delete: Immediately and permanently deletes the specified draft.
3140// Does not simply trash it.
3141func (r *UsersDraftsService) Delete(userId string, id string) *UsersDraftsDeleteCall {
3142	c := &UsersDraftsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3143	c.userId = userId
3144	c.id = id
3145	return c
3146}
3147
3148// Fields allows partial responses to be retrieved. See
3149// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3150// for more information.
3151func (c *UsersDraftsDeleteCall) Fields(s ...googleapi.Field) *UsersDraftsDeleteCall {
3152	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3153	return c
3154}
3155
3156// Context sets the context to be used in this call's Do method. Any
3157// pending HTTP request will be aborted if the provided context is
3158// canceled.
3159func (c *UsersDraftsDeleteCall) Context(ctx context.Context) *UsersDraftsDeleteCall {
3160	c.ctx_ = ctx
3161	return c
3162}
3163
3164// Header returns an http.Header that can be modified by the caller to
3165// add HTTP headers to the request.
3166func (c *UsersDraftsDeleteCall) Header() http.Header {
3167	if c.header_ == nil {
3168		c.header_ = make(http.Header)
3169	}
3170	return c.header_
3171}
3172
3173func (c *UsersDraftsDeleteCall) doRequest(alt string) (*http.Response, error) {
3174	reqHeaders := make(http.Header)
3175	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
3176	for k, v := range c.header_ {
3177		reqHeaders[k] = v
3178	}
3179	reqHeaders.Set("User-Agent", c.s.userAgent())
3180	var body io.Reader = nil
3181	c.urlParams_.Set("alt", alt)
3182	c.urlParams_.Set("prettyPrint", "false")
3183	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts/{id}")
3184	urls += "?" + c.urlParams_.Encode()
3185	req, err := http.NewRequest("DELETE", urls, body)
3186	if err != nil {
3187		return nil, err
3188	}
3189	req.Header = reqHeaders
3190	googleapi.Expand(req.URL, map[string]string{
3191		"userId": c.userId,
3192		"id":     c.id,
3193	})
3194	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3195}
3196
3197// Do executes the "gmail.users.drafts.delete" call.
3198func (c *UsersDraftsDeleteCall) Do(opts ...googleapi.CallOption) error {
3199	gensupport.SetOptions(c.urlParams_, opts...)
3200	res, err := c.doRequest("json")
3201	if err != nil {
3202		return err
3203	}
3204	defer googleapi.CloseBody(res)
3205	if err := googleapi.CheckResponse(res); err != nil {
3206		return err
3207	}
3208	return nil
3209	// {
3210	//   "description": "Immediately and permanently deletes the specified draft.\nDoes not simply trash it.",
3211	//   "flatPath": "gmail/v1/users/{userId}/drafts/{id}",
3212	//   "httpMethod": "DELETE",
3213	//   "id": "gmail.users.drafts.delete",
3214	//   "parameterOrder": [
3215	//     "userId",
3216	//     "id"
3217	//   ],
3218	//   "parameters": {
3219	//     "id": {
3220	//       "description": "The ID of the draft to delete.",
3221	//       "location": "path",
3222	//       "required": true,
3223	//       "type": "string"
3224	//     },
3225	//     "userId": {
3226	//       "default": "me",
3227	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
3228	//       "location": "path",
3229	//       "required": true,
3230	//       "type": "string"
3231	//     }
3232	//   },
3233	//   "path": "gmail/v1/users/{userId}/drafts/{id}",
3234	//   "scopes": [
3235	//     "https://mail.google.com/",
3236	//     "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
3237	//     "https://www.googleapis.com/auth/gmail.compose",
3238	//     "https://www.googleapis.com/auth/gmail.modify"
3239	//   ]
3240	// }
3241
3242}
3243
3244// method id "gmail.users.drafts.get":
3245
3246type UsersDraftsGetCall struct {
3247	s            *Service
3248	userId       string
3249	id           string
3250	urlParams_   gensupport.URLParams
3251	ifNoneMatch_ string
3252	ctx_         context.Context
3253	header_      http.Header
3254}
3255
3256// Get: Gets the specified draft.
3257func (r *UsersDraftsService) Get(userId string, id string) *UsersDraftsGetCall {
3258	c := &UsersDraftsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3259	c.userId = userId
3260	c.id = id
3261	return c
3262}
3263
3264// Format sets the optional parameter "format": The format to return the
3265// draft in.
3266//
3267// Possible values:
3268//   "minimal"
3269//   "full" (default)
3270//   "raw"
3271//   "metadata"
3272func (c *UsersDraftsGetCall) Format(format string) *UsersDraftsGetCall {
3273	c.urlParams_.Set("format", format)
3274	return c
3275}
3276
3277// Fields allows partial responses to be retrieved. See
3278// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3279// for more information.
3280func (c *UsersDraftsGetCall) Fields(s ...googleapi.Field) *UsersDraftsGetCall {
3281	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3282	return c
3283}
3284
3285// IfNoneMatch sets the optional parameter which makes the operation
3286// fail if the object's ETag matches the given value. This is useful for
3287// getting updates only after the object has changed since the last
3288// request. Use googleapi.IsNotModified to check whether the response
3289// error from Do is the result of In-None-Match.
3290func (c *UsersDraftsGetCall) IfNoneMatch(entityTag string) *UsersDraftsGetCall {
3291	c.ifNoneMatch_ = entityTag
3292	return c
3293}
3294
3295// Context sets the context to be used in this call's Do method. Any
3296// pending HTTP request will be aborted if the provided context is
3297// canceled.
3298func (c *UsersDraftsGetCall) Context(ctx context.Context) *UsersDraftsGetCall {
3299	c.ctx_ = ctx
3300	return c
3301}
3302
3303// Header returns an http.Header that can be modified by the caller to
3304// add HTTP headers to the request.
3305func (c *UsersDraftsGetCall) Header() http.Header {
3306	if c.header_ == nil {
3307		c.header_ = make(http.Header)
3308	}
3309	return c.header_
3310}
3311
3312func (c *UsersDraftsGetCall) doRequest(alt string) (*http.Response, error) {
3313	reqHeaders := make(http.Header)
3314	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
3315	for k, v := range c.header_ {
3316		reqHeaders[k] = v
3317	}
3318	reqHeaders.Set("User-Agent", c.s.userAgent())
3319	if c.ifNoneMatch_ != "" {
3320		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3321	}
3322	var body io.Reader = nil
3323	c.urlParams_.Set("alt", alt)
3324	c.urlParams_.Set("prettyPrint", "false")
3325	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts/{id}")
3326	urls += "?" + c.urlParams_.Encode()
3327	req, err := http.NewRequest("GET", urls, body)
3328	if err != nil {
3329		return nil, err
3330	}
3331	req.Header = reqHeaders
3332	googleapi.Expand(req.URL, map[string]string{
3333		"userId": c.userId,
3334		"id":     c.id,
3335	})
3336	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3337}
3338
3339// Do executes the "gmail.users.drafts.get" call.
3340// Exactly one of *Draft or error will be non-nil. Any non-2xx status
3341// code is an error. Response headers are in either
3342// *Draft.ServerResponse.Header or (if a response was returned at all)
3343// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3344// check whether the returned error was because http.StatusNotModified
3345// was returned.
3346func (c *UsersDraftsGetCall) Do(opts ...googleapi.CallOption) (*Draft, error) {
3347	gensupport.SetOptions(c.urlParams_, opts...)
3348	res, err := c.doRequest("json")
3349	if res != nil && res.StatusCode == http.StatusNotModified {
3350		if res.Body != nil {
3351			res.Body.Close()
3352		}
3353		return nil, &googleapi.Error{
3354			Code:   res.StatusCode,
3355			Header: res.Header,
3356		}
3357	}
3358	if err != nil {
3359		return nil, err
3360	}
3361	defer googleapi.CloseBody(res)
3362	if err := googleapi.CheckResponse(res); err != nil {
3363		return nil, err
3364	}
3365	ret := &Draft{
3366		ServerResponse: googleapi.ServerResponse{
3367			Header:         res.Header,
3368			HTTPStatusCode: res.StatusCode,
3369		},
3370	}
3371	target := &ret
3372	if err := gensupport.DecodeResponse(target, res); err != nil {
3373		return nil, err
3374	}
3375	return ret, nil
3376	// {
3377	//   "description": "Gets the specified draft.",
3378	//   "flatPath": "gmail/v1/users/{userId}/drafts/{id}",
3379	//   "httpMethod": "GET",
3380	//   "id": "gmail.users.drafts.get",
3381	//   "parameterOrder": [
3382	//     "userId",
3383	//     "id"
3384	//   ],
3385	//   "parameters": {
3386	//     "format": {
3387	//       "default": "full",
3388	//       "description": "The format to return the draft in.",
3389	//       "enum": [
3390	//         "minimal",
3391	//         "full",
3392	//         "raw",
3393	//         "metadata"
3394	//       ],
3395	//       "location": "query",
3396	//       "type": "string"
3397	//     },
3398	//     "id": {
3399	//       "description": "The ID of the draft to retrieve.",
3400	//       "location": "path",
3401	//       "required": true,
3402	//       "type": "string"
3403	//     },
3404	//     "userId": {
3405	//       "default": "me",
3406	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
3407	//       "location": "path",
3408	//       "required": true,
3409	//       "type": "string"
3410	//     }
3411	//   },
3412	//   "path": "gmail/v1/users/{userId}/drafts/{id}",
3413	//   "response": {
3414	//     "$ref": "Draft"
3415	//   },
3416	//   "scopes": [
3417	//     "https://mail.google.com/",
3418	//     "https://www.googleapis.com/auth/gmail.compose",
3419	//     "https://www.googleapis.com/auth/gmail.modify",
3420	//     "https://www.googleapis.com/auth/gmail.readonly"
3421	//   ]
3422	// }
3423
3424}
3425
3426// method id "gmail.users.drafts.list":
3427
3428type UsersDraftsListCall struct {
3429	s            *Service
3430	userId       string
3431	urlParams_   gensupport.URLParams
3432	ifNoneMatch_ string
3433	ctx_         context.Context
3434	header_      http.Header
3435}
3436
3437// List: Lists the drafts in the user's mailbox.
3438func (r *UsersDraftsService) List(userId string) *UsersDraftsListCall {
3439	c := &UsersDraftsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3440	c.userId = userId
3441	return c
3442}
3443
3444// IncludeSpamTrash sets the optional parameter "includeSpamTrash":
3445// Include drafts from <code>SPAM</code> and <code>TRASH</code>
3446// in the results.
3447func (c *UsersDraftsListCall) IncludeSpamTrash(includeSpamTrash bool) *UsersDraftsListCall {
3448	c.urlParams_.Set("includeSpamTrash", fmt.Sprint(includeSpamTrash))
3449	return c
3450}
3451
3452// MaxResults sets the optional parameter "maxResults": Maximum number
3453// of drafts to return.
3454func (c *UsersDraftsListCall) MaxResults(maxResults int64) *UsersDraftsListCall {
3455	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
3456	return c
3457}
3458
3459// PageToken sets the optional parameter "pageToken": Page token to
3460// retrieve a specific page of results in the list.
3461func (c *UsersDraftsListCall) PageToken(pageToken string) *UsersDraftsListCall {
3462	c.urlParams_.Set("pageToken", pageToken)
3463	return c
3464}
3465
3466// Q sets the optional parameter "q": Only return draft messages
3467// matching the specified query. Supports the same
3468// query format as the Gmail search box. For
3469// example,
3470// <code>"from:someuser@example.com
3471// rfc822msgid:<somemsgid@example.com>
3472// is:unread"</code>.
3473func (c *UsersDraftsListCall) Q(q string) *UsersDraftsListCall {
3474	c.urlParams_.Set("q", q)
3475	return c
3476}
3477
3478// Fields allows partial responses to be retrieved. See
3479// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3480// for more information.
3481func (c *UsersDraftsListCall) Fields(s ...googleapi.Field) *UsersDraftsListCall {
3482	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3483	return c
3484}
3485
3486// IfNoneMatch sets the optional parameter which makes the operation
3487// fail if the object's ETag matches the given value. This is useful for
3488// getting updates only after the object has changed since the last
3489// request. Use googleapi.IsNotModified to check whether the response
3490// error from Do is the result of In-None-Match.
3491func (c *UsersDraftsListCall) IfNoneMatch(entityTag string) *UsersDraftsListCall {
3492	c.ifNoneMatch_ = entityTag
3493	return c
3494}
3495
3496// Context sets the context to be used in this call's Do method. Any
3497// pending HTTP request will be aborted if the provided context is
3498// canceled.
3499func (c *UsersDraftsListCall) Context(ctx context.Context) *UsersDraftsListCall {
3500	c.ctx_ = ctx
3501	return c
3502}
3503
3504// Header returns an http.Header that can be modified by the caller to
3505// add HTTP headers to the request.
3506func (c *UsersDraftsListCall) Header() http.Header {
3507	if c.header_ == nil {
3508		c.header_ = make(http.Header)
3509	}
3510	return c.header_
3511}
3512
3513func (c *UsersDraftsListCall) doRequest(alt string) (*http.Response, error) {
3514	reqHeaders := make(http.Header)
3515	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
3516	for k, v := range c.header_ {
3517		reqHeaders[k] = v
3518	}
3519	reqHeaders.Set("User-Agent", c.s.userAgent())
3520	if c.ifNoneMatch_ != "" {
3521		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3522	}
3523	var body io.Reader = nil
3524	c.urlParams_.Set("alt", alt)
3525	c.urlParams_.Set("prettyPrint", "false")
3526	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts")
3527	urls += "?" + c.urlParams_.Encode()
3528	req, err := http.NewRequest("GET", urls, body)
3529	if err != nil {
3530		return nil, err
3531	}
3532	req.Header = reqHeaders
3533	googleapi.Expand(req.URL, map[string]string{
3534		"userId": c.userId,
3535	})
3536	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3537}
3538
3539// Do executes the "gmail.users.drafts.list" call.
3540// Exactly one of *ListDraftsResponse or error will be non-nil. Any
3541// non-2xx status code is an error. Response headers are in either
3542// *ListDraftsResponse.ServerResponse.Header or (if a response was
3543// returned at all) in error.(*googleapi.Error).Header. Use
3544// googleapi.IsNotModified to check whether the returned error was
3545// because http.StatusNotModified was returned.
3546func (c *UsersDraftsListCall) Do(opts ...googleapi.CallOption) (*ListDraftsResponse, error) {
3547	gensupport.SetOptions(c.urlParams_, opts...)
3548	res, err := c.doRequest("json")
3549	if res != nil && res.StatusCode == http.StatusNotModified {
3550		if res.Body != nil {
3551			res.Body.Close()
3552		}
3553		return nil, &googleapi.Error{
3554			Code:   res.StatusCode,
3555			Header: res.Header,
3556		}
3557	}
3558	if err != nil {
3559		return nil, err
3560	}
3561	defer googleapi.CloseBody(res)
3562	if err := googleapi.CheckResponse(res); err != nil {
3563		return nil, err
3564	}
3565	ret := &ListDraftsResponse{
3566		ServerResponse: googleapi.ServerResponse{
3567			Header:         res.Header,
3568			HTTPStatusCode: res.StatusCode,
3569		},
3570	}
3571	target := &ret
3572	if err := gensupport.DecodeResponse(target, res); err != nil {
3573		return nil, err
3574	}
3575	return ret, nil
3576	// {
3577	//   "description": "Lists the drafts in the user's mailbox.",
3578	//   "flatPath": "gmail/v1/users/{userId}/drafts",
3579	//   "httpMethod": "GET",
3580	//   "id": "gmail.users.drafts.list",
3581	//   "parameterOrder": [
3582	//     "userId"
3583	//   ],
3584	//   "parameters": {
3585	//     "includeSpamTrash": {
3586	//       "default": "false",
3587	//       "description": "Include drafts from \u003ccode\u003eSPAM\u003c/code\u003e and \u003ccode\u003eTRASH\u003c/code\u003e\nin the results.",
3588	//       "location": "query",
3589	//       "type": "boolean"
3590	//     },
3591	//     "maxResults": {
3592	//       "default": "100",
3593	//       "description": "Maximum number of drafts to return.",
3594	//       "format": "uint32",
3595	//       "location": "query",
3596	//       "type": "integer"
3597	//     },
3598	//     "pageToken": {
3599	//       "description": "Page token to retrieve a specific page of results in the list.",
3600	//       "location": "query",
3601	//       "type": "string"
3602	//     },
3603	//     "q": {
3604	//       "description": "Only return draft messages matching the specified query. Supports the same\nquery format as the Gmail search box. For example,\n\u003ccode\u003e\"from:someuser@example.com rfc822msgid:\u003csomemsgid@example.com\u003e\nis:unread\"\u003c/code\u003e.",
3605	//       "location": "query",
3606	//       "type": "string"
3607	//     },
3608	//     "userId": {
3609	//       "default": "me",
3610	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
3611	//       "location": "path",
3612	//       "required": true,
3613	//       "type": "string"
3614	//     }
3615	//   },
3616	//   "path": "gmail/v1/users/{userId}/drafts",
3617	//   "response": {
3618	//     "$ref": "ListDraftsResponse"
3619	//   },
3620	//   "scopes": [
3621	//     "https://mail.google.com/",
3622	//     "https://www.googleapis.com/auth/gmail.compose",
3623	//     "https://www.googleapis.com/auth/gmail.modify",
3624	//     "https://www.googleapis.com/auth/gmail.readonly"
3625	//   ]
3626	// }
3627
3628}
3629
3630// Pages invokes f for each page of results.
3631// A non-nil error returned from f will halt the iteration.
3632// The provided context supersedes any context provided to the Context method.
3633func (c *UsersDraftsListCall) Pages(ctx context.Context, f func(*ListDraftsResponse) error) error {
3634	c.ctx_ = ctx
3635	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3636	for {
3637		x, err := c.Do()
3638		if err != nil {
3639			return err
3640		}
3641		if err := f(x); err != nil {
3642			return err
3643		}
3644		if x.NextPageToken == "" {
3645			return nil
3646		}
3647		c.PageToken(x.NextPageToken)
3648	}
3649}
3650
3651// method id "gmail.users.drafts.send":
3652
3653type UsersDraftsSendCall struct {
3654	s          *Service
3655	userId     string
3656	draft      *Draft
3657	urlParams_ gensupport.URLParams
3658	mediaInfo_ *gensupport.MediaInfo
3659	ctx_       context.Context
3660	header_    http.Header
3661}
3662
3663// Send: Sends the specified, existing draft to the recipients in
3664// the
3665// <code>To</code>, <code>Cc</code>, and <code>Bcc</code> headers.
3666func (r *UsersDraftsService) Send(userId string, draft *Draft) *UsersDraftsSendCall {
3667	c := &UsersDraftsSendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3668	c.userId = userId
3669	c.draft = draft
3670	return c
3671}
3672
3673// Media specifies the media to upload in one or more chunks. The chunk
3674// size may be controlled by supplying a MediaOption generated by
3675// googleapi.ChunkSize. The chunk size defaults to
3676// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
3677// upload request will be determined by sniffing the contents of r,
3678// unless a MediaOption generated by googleapi.ContentType is
3679// supplied.
3680// At most one of Media and ResumableMedia may be set.
3681func (c *UsersDraftsSendCall) Media(r io.Reader, options ...googleapi.MediaOption) *UsersDraftsSendCall {
3682	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
3683	return c
3684}
3685
3686// ResumableMedia specifies the media to upload in chunks and can be
3687// canceled with ctx.
3688//
3689// Deprecated: use Media instead.
3690//
3691// At most one of Media and ResumableMedia may be set. mediaType
3692// identifies the MIME media type of the upload, such as "image/png". If
3693// mediaType is "", it will be auto-detected. The provided ctx will
3694// supersede any context previously provided to the Context method.
3695func (c *UsersDraftsSendCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersDraftsSendCall {
3696	c.ctx_ = ctx
3697	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
3698	return c
3699}
3700
3701// ProgressUpdater provides a callback function that will be called
3702// after every chunk. It should be a low-latency function in order to
3703// not slow down the upload operation. This should only be called when
3704// using ResumableMedia (as opposed to Media).
3705func (c *UsersDraftsSendCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersDraftsSendCall {
3706	c.mediaInfo_.SetProgressUpdater(pu)
3707	return c
3708}
3709
3710// Fields allows partial responses to be retrieved. See
3711// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3712// for more information.
3713func (c *UsersDraftsSendCall) Fields(s ...googleapi.Field) *UsersDraftsSendCall {
3714	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3715	return c
3716}
3717
3718// Context sets the context to be used in this call's Do method. Any
3719// pending HTTP request will be aborted if the provided context is
3720// canceled.
3721// This context will supersede any context previously provided to the
3722// ResumableMedia method.
3723func (c *UsersDraftsSendCall) Context(ctx context.Context) *UsersDraftsSendCall {
3724	c.ctx_ = ctx
3725	return c
3726}
3727
3728// Header returns an http.Header that can be modified by the caller to
3729// add HTTP headers to the request.
3730func (c *UsersDraftsSendCall) Header() http.Header {
3731	if c.header_ == nil {
3732		c.header_ = make(http.Header)
3733	}
3734	return c.header_
3735}
3736
3737func (c *UsersDraftsSendCall) doRequest(alt string) (*http.Response, error) {
3738	reqHeaders := make(http.Header)
3739	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
3740	for k, v := range c.header_ {
3741		reqHeaders[k] = v
3742	}
3743	reqHeaders.Set("User-Agent", c.s.userAgent())
3744	var body io.Reader = nil
3745	body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft)
3746	if err != nil {
3747		return nil, err
3748	}
3749	reqHeaders.Set("Content-Type", "application/json")
3750	c.urlParams_.Set("alt", alt)
3751	c.urlParams_.Set("prettyPrint", "false")
3752	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts/send")
3753	if c.mediaInfo_ != nil {
3754		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/drafts/send")
3755		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
3756	}
3757	if body == nil {
3758		body = new(bytes.Buffer)
3759		reqHeaders.Set("Content-Type", "application/json")
3760	}
3761	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
3762	defer cleanup()
3763	urls += "?" + c.urlParams_.Encode()
3764	req, err := http.NewRequest("POST", urls, body)
3765	if err != nil {
3766		return nil, err
3767	}
3768	req.Header = reqHeaders
3769	req.GetBody = getBody
3770	googleapi.Expand(req.URL, map[string]string{
3771		"userId": c.userId,
3772	})
3773	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3774}
3775
3776// Do executes the "gmail.users.drafts.send" call.
3777// Exactly one of *Message or error will be non-nil. Any non-2xx status
3778// code is an error. Response headers are in either
3779// *Message.ServerResponse.Header or (if a response was returned at all)
3780// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3781// check whether the returned error was because http.StatusNotModified
3782// was returned.
3783func (c *UsersDraftsSendCall) Do(opts ...googleapi.CallOption) (*Message, error) {
3784	gensupport.SetOptions(c.urlParams_, opts...)
3785	res, err := c.doRequest("json")
3786	if res != nil && res.StatusCode == http.StatusNotModified {
3787		if res.Body != nil {
3788			res.Body.Close()
3789		}
3790		return nil, &googleapi.Error{
3791			Code:   res.StatusCode,
3792			Header: res.Header,
3793		}
3794	}
3795	if err != nil {
3796		return nil, err
3797	}
3798	defer googleapi.CloseBody(res)
3799	if err := googleapi.CheckResponse(res); err != nil {
3800		return nil, err
3801	}
3802	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
3803	if rx != nil {
3804		rx.Client = c.s.client
3805		rx.UserAgent = c.s.userAgent()
3806		ctx := c.ctx_
3807		if ctx == nil {
3808			ctx = context.TODO()
3809		}
3810		res, err = rx.Upload(ctx)
3811		if err != nil {
3812			return nil, err
3813		}
3814		defer res.Body.Close()
3815		if err := googleapi.CheckResponse(res); err != nil {
3816			return nil, err
3817		}
3818	}
3819	ret := &Message{
3820		ServerResponse: googleapi.ServerResponse{
3821			Header:         res.Header,
3822			HTTPStatusCode: res.StatusCode,
3823		},
3824	}
3825	target := &ret
3826	if err := gensupport.DecodeResponse(target, res); err != nil {
3827		return nil, err
3828	}
3829	return ret, nil
3830	// {
3831	//   "description": "Sends the specified, existing draft to the recipients in the\n\u003ccode\u003eTo\u003c/code\u003e, \u003ccode\u003eCc\u003c/code\u003e, and \u003ccode\u003eBcc\u003c/code\u003e headers.",
3832	//   "flatPath": "gmail/v1/users/{userId}/drafts/send",
3833	//   "httpMethod": "POST",
3834	//   "id": "gmail.users.drafts.send",
3835	//   "mediaUpload": {
3836	//     "accept": [
3837	//       "message/*"
3838	//     ],
3839	//     "maxSize": "36700160",
3840	//     "protocols": {
3841	//       "resumable": {
3842	//         "multipart": true,
3843	//         "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/send"
3844	//       },
3845	//       "simple": {
3846	//         "multipart": true,
3847	//         "path": "/upload/gmail/v1/users/{userId}/drafts/send"
3848	//       }
3849	//     }
3850	//   },
3851	//   "parameterOrder": [
3852	//     "userId"
3853	//   ],
3854	//   "parameters": {
3855	//     "userId": {
3856	//       "default": "me",
3857	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
3858	//       "location": "path",
3859	//       "required": true,
3860	//       "type": "string"
3861	//     }
3862	//   },
3863	//   "path": "gmail/v1/users/{userId}/drafts/send",
3864	//   "request": {
3865	//     "$ref": "Draft"
3866	//   },
3867	//   "response": {
3868	//     "$ref": "Message"
3869	//   },
3870	//   "scopes": [
3871	//     "https://mail.google.com/",
3872	//     "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
3873	//     "https://www.googleapis.com/auth/gmail.compose",
3874	//     "https://www.googleapis.com/auth/gmail.modify"
3875	//   ],
3876	//   "supportsMediaUpload": true
3877	// }
3878
3879}
3880
3881// method id "gmail.users.drafts.update":
3882
3883type UsersDraftsUpdateCall struct {
3884	s          *Service
3885	userId     string
3886	id         string
3887	draft      *Draft
3888	urlParams_ gensupport.URLParams
3889	mediaInfo_ *gensupport.MediaInfo
3890	ctx_       context.Context
3891	header_    http.Header
3892}
3893
3894// Update: Replaces a draft's content.
3895func (r *UsersDraftsService) Update(userId string, id string, draft *Draft) *UsersDraftsUpdateCall {
3896	c := &UsersDraftsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3897	c.userId = userId
3898	c.id = id
3899	c.draft = draft
3900	return c
3901}
3902
3903// Media specifies the media to upload in one or more chunks. The chunk
3904// size may be controlled by supplying a MediaOption generated by
3905// googleapi.ChunkSize. The chunk size defaults to
3906// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
3907// upload request will be determined by sniffing the contents of r,
3908// unless a MediaOption generated by googleapi.ContentType is
3909// supplied.
3910// At most one of Media and ResumableMedia may be set.
3911func (c *UsersDraftsUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *UsersDraftsUpdateCall {
3912	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
3913	return c
3914}
3915
3916// ResumableMedia specifies the media to upload in chunks and can be
3917// canceled with ctx.
3918//
3919// Deprecated: use Media instead.
3920//
3921// At most one of Media and ResumableMedia may be set. mediaType
3922// identifies the MIME media type of the upload, such as "image/png". If
3923// mediaType is "", it will be auto-detected. The provided ctx will
3924// supersede any context previously provided to the Context method.
3925func (c *UsersDraftsUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersDraftsUpdateCall {
3926	c.ctx_ = ctx
3927	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
3928	return c
3929}
3930
3931// ProgressUpdater provides a callback function that will be called
3932// after every chunk. It should be a low-latency function in order to
3933// not slow down the upload operation. This should only be called when
3934// using ResumableMedia (as opposed to Media).
3935func (c *UsersDraftsUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersDraftsUpdateCall {
3936	c.mediaInfo_.SetProgressUpdater(pu)
3937	return c
3938}
3939
3940// Fields allows partial responses to be retrieved. See
3941// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3942// for more information.
3943func (c *UsersDraftsUpdateCall) Fields(s ...googleapi.Field) *UsersDraftsUpdateCall {
3944	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3945	return c
3946}
3947
3948// Context sets the context to be used in this call's Do method. Any
3949// pending HTTP request will be aborted if the provided context is
3950// canceled.
3951// This context will supersede any context previously provided to the
3952// ResumableMedia method.
3953func (c *UsersDraftsUpdateCall) Context(ctx context.Context) *UsersDraftsUpdateCall {
3954	c.ctx_ = ctx
3955	return c
3956}
3957
3958// Header returns an http.Header that can be modified by the caller to
3959// add HTTP headers to the request.
3960func (c *UsersDraftsUpdateCall) Header() http.Header {
3961	if c.header_ == nil {
3962		c.header_ = make(http.Header)
3963	}
3964	return c.header_
3965}
3966
3967func (c *UsersDraftsUpdateCall) doRequest(alt string) (*http.Response, error) {
3968	reqHeaders := make(http.Header)
3969	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
3970	for k, v := range c.header_ {
3971		reqHeaders[k] = v
3972	}
3973	reqHeaders.Set("User-Agent", c.s.userAgent())
3974	var body io.Reader = nil
3975	body, err := googleapi.WithoutDataWrapper.JSONReader(c.draft)
3976	if err != nil {
3977		return nil, err
3978	}
3979	reqHeaders.Set("Content-Type", "application/json")
3980	c.urlParams_.Set("alt", alt)
3981	c.urlParams_.Set("prettyPrint", "false")
3982	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/drafts/{id}")
3983	if c.mediaInfo_ != nil {
3984		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/drafts/{id}")
3985		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
3986	}
3987	if body == nil {
3988		body = new(bytes.Buffer)
3989		reqHeaders.Set("Content-Type", "application/json")
3990	}
3991	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
3992	defer cleanup()
3993	urls += "?" + c.urlParams_.Encode()
3994	req, err := http.NewRequest("PUT", urls, body)
3995	if err != nil {
3996		return nil, err
3997	}
3998	req.Header = reqHeaders
3999	req.GetBody = getBody
4000	googleapi.Expand(req.URL, map[string]string{
4001		"userId": c.userId,
4002		"id":     c.id,
4003	})
4004	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4005}
4006
4007// Do executes the "gmail.users.drafts.update" call.
4008// Exactly one of *Draft or error will be non-nil. Any non-2xx status
4009// code is an error. Response headers are in either
4010// *Draft.ServerResponse.Header or (if a response was returned at all)
4011// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4012// check whether the returned error was because http.StatusNotModified
4013// was returned.
4014func (c *UsersDraftsUpdateCall) Do(opts ...googleapi.CallOption) (*Draft, error) {
4015	gensupport.SetOptions(c.urlParams_, opts...)
4016	res, err := c.doRequest("json")
4017	if res != nil && res.StatusCode == http.StatusNotModified {
4018		if res.Body != nil {
4019			res.Body.Close()
4020		}
4021		return nil, &googleapi.Error{
4022			Code:   res.StatusCode,
4023			Header: res.Header,
4024		}
4025	}
4026	if err != nil {
4027		return nil, err
4028	}
4029	defer googleapi.CloseBody(res)
4030	if err := googleapi.CheckResponse(res); err != nil {
4031		return nil, err
4032	}
4033	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
4034	if rx != nil {
4035		rx.Client = c.s.client
4036		rx.UserAgent = c.s.userAgent()
4037		ctx := c.ctx_
4038		if ctx == nil {
4039			ctx = context.TODO()
4040		}
4041		res, err = rx.Upload(ctx)
4042		if err != nil {
4043			return nil, err
4044		}
4045		defer res.Body.Close()
4046		if err := googleapi.CheckResponse(res); err != nil {
4047			return nil, err
4048		}
4049	}
4050	ret := &Draft{
4051		ServerResponse: googleapi.ServerResponse{
4052			Header:         res.Header,
4053			HTTPStatusCode: res.StatusCode,
4054		},
4055	}
4056	target := &ret
4057	if err := gensupport.DecodeResponse(target, res); err != nil {
4058		return nil, err
4059	}
4060	return ret, nil
4061	// {
4062	//   "description": "Replaces a draft's content.",
4063	//   "flatPath": "gmail/v1/users/{userId}/drafts/{id}",
4064	//   "httpMethod": "PUT",
4065	//   "id": "gmail.users.drafts.update",
4066	//   "mediaUpload": {
4067	//     "accept": [
4068	//       "message/*"
4069	//     ],
4070	//     "maxSize": "36700160",
4071	//     "protocols": {
4072	//       "resumable": {
4073	//         "multipart": true,
4074	//         "path": "/resumable/upload/gmail/v1/users/{userId}/drafts/{id}"
4075	//       },
4076	//       "simple": {
4077	//         "multipart": true,
4078	//         "path": "/upload/gmail/v1/users/{userId}/drafts/{id}"
4079	//       }
4080	//     }
4081	//   },
4082	//   "parameterOrder": [
4083	//     "userId",
4084	//     "id"
4085	//   ],
4086	//   "parameters": {
4087	//     "id": {
4088	//       "description": "The ID of the draft to update.",
4089	//       "location": "path",
4090	//       "required": true,
4091	//       "type": "string"
4092	//     },
4093	//     "userId": {
4094	//       "default": "me",
4095	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
4096	//       "location": "path",
4097	//       "required": true,
4098	//       "type": "string"
4099	//     }
4100	//   },
4101	//   "path": "gmail/v1/users/{userId}/drafts/{id}",
4102	//   "request": {
4103	//     "$ref": "Draft"
4104	//   },
4105	//   "response": {
4106	//     "$ref": "Draft"
4107	//   },
4108	//   "scopes": [
4109	//     "https://mail.google.com/",
4110	//     "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
4111	//     "https://www.googleapis.com/auth/gmail.compose",
4112	//     "https://www.googleapis.com/auth/gmail.modify"
4113	//   ],
4114	//   "supportsMediaUpload": true
4115	// }
4116
4117}
4118
4119// method id "gmail.users.history.list":
4120
4121type UsersHistoryListCall struct {
4122	s            *Service
4123	userId       string
4124	urlParams_   gensupport.URLParams
4125	ifNoneMatch_ string
4126	ctx_         context.Context
4127	header_      http.Header
4128}
4129
4130// List: Lists the history of all changes to the given mailbox. History
4131// results are
4132// returned in chronological order (increasing <code>historyId</code>).
4133func (r *UsersHistoryService) List(userId string) *UsersHistoryListCall {
4134	c := &UsersHistoryListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4135	c.userId = userId
4136	return c
4137}
4138
4139// HistoryTypes sets the optional parameter "historyTypes": History
4140// types to be returned by the function
4141//
4142// Possible values:
4143//   "messageAdded"
4144//   "messageDeleted"
4145//   "labelAdded"
4146//   "labelRemoved"
4147func (c *UsersHistoryListCall) HistoryTypes(historyTypes ...string) *UsersHistoryListCall {
4148	c.urlParams_.SetMulti("historyTypes", append([]string{}, historyTypes...))
4149	return c
4150}
4151
4152// LabelId sets the optional parameter "labelId": Only return messages
4153// with a label matching the ID.
4154func (c *UsersHistoryListCall) LabelId(labelId string) *UsersHistoryListCall {
4155	c.urlParams_.Set("labelId", labelId)
4156	return c
4157}
4158
4159// MaxResults sets the optional parameter "maxResults": The maximum
4160// number of history records to return.
4161func (c *UsersHistoryListCall) MaxResults(maxResults int64) *UsersHistoryListCall {
4162	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
4163	return c
4164}
4165
4166// PageToken sets the optional parameter "pageToken": Page token to
4167// retrieve a specific page of results in the list.
4168func (c *UsersHistoryListCall) PageToken(pageToken string) *UsersHistoryListCall {
4169	c.urlParams_.Set("pageToken", pageToken)
4170	return c
4171}
4172
4173// StartHistoryId sets the optional parameter "startHistoryId":
4174// Required. Returns history records after the
4175// specified
4176// <code>startHistoryId</code>. The supplied
4177// <code>startHistoryId</code>
4178// should be obtained from the <code>historyId</code> of a message,
4179// thread, or
4180// previous <code>list</code> response. History IDs
4181// increase
4182// chronologically but are not contiguous with random gaps in between
4183// valid
4184// IDs. Supplying an invalid or out of date
4185// <code>startHistoryId</code>
4186// typically returns an <code>HTTP 404</code> error code.
4187// A
4188// <code>historyId</code> is typically valid for at least a week, but in
4189// some
4190// rare circumstances may be valid for only a few hours. If you receive
4191// an
4192// <code>HTTP 404</code> error response, your  application should
4193// perform a
4194// full sync. If you receive no <code>nextPageToken</code> in the
4195// response,
4196// there are no updates to retrieve and you can store the
4197// returned
4198// <code>historyId</code> for a future request.
4199func (c *UsersHistoryListCall) StartHistoryId(startHistoryId uint64) *UsersHistoryListCall {
4200	c.urlParams_.Set("startHistoryId", fmt.Sprint(startHistoryId))
4201	return c
4202}
4203
4204// Fields allows partial responses to be retrieved. See
4205// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4206// for more information.
4207func (c *UsersHistoryListCall) Fields(s ...googleapi.Field) *UsersHistoryListCall {
4208	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4209	return c
4210}
4211
4212// IfNoneMatch sets the optional parameter which makes the operation
4213// fail if the object's ETag matches the given value. This is useful for
4214// getting updates only after the object has changed since the last
4215// request. Use googleapi.IsNotModified to check whether the response
4216// error from Do is the result of In-None-Match.
4217func (c *UsersHistoryListCall) IfNoneMatch(entityTag string) *UsersHistoryListCall {
4218	c.ifNoneMatch_ = entityTag
4219	return c
4220}
4221
4222// Context sets the context to be used in this call's Do method. Any
4223// pending HTTP request will be aborted if the provided context is
4224// canceled.
4225func (c *UsersHistoryListCall) Context(ctx context.Context) *UsersHistoryListCall {
4226	c.ctx_ = ctx
4227	return c
4228}
4229
4230// Header returns an http.Header that can be modified by the caller to
4231// add HTTP headers to the request.
4232func (c *UsersHistoryListCall) Header() http.Header {
4233	if c.header_ == nil {
4234		c.header_ = make(http.Header)
4235	}
4236	return c.header_
4237}
4238
4239func (c *UsersHistoryListCall) doRequest(alt string) (*http.Response, error) {
4240	reqHeaders := make(http.Header)
4241	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
4242	for k, v := range c.header_ {
4243		reqHeaders[k] = v
4244	}
4245	reqHeaders.Set("User-Agent", c.s.userAgent())
4246	if c.ifNoneMatch_ != "" {
4247		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4248	}
4249	var body io.Reader = nil
4250	c.urlParams_.Set("alt", alt)
4251	c.urlParams_.Set("prettyPrint", "false")
4252	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/history")
4253	urls += "?" + c.urlParams_.Encode()
4254	req, err := http.NewRequest("GET", urls, body)
4255	if err != nil {
4256		return nil, err
4257	}
4258	req.Header = reqHeaders
4259	googleapi.Expand(req.URL, map[string]string{
4260		"userId": c.userId,
4261	})
4262	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4263}
4264
4265// Do executes the "gmail.users.history.list" call.
4266// Exactly one of *ListHistoryResponse or error will be non-nil. Any
4267// non-2xx status code is an error. Response headers are in either
4268// *ListHistoryResponse.ServerResponse.Header or (if a response was
4269// returned at all) in error.(*googleapi.Error).Header. Use
4270// googleapi.IsNotModified to check whether the returned error was
4271// because http.StatusNotModified was returned.
4272func (c *UsersHistoryListCall) Do(opts ...googleapi.CallOption) (*ListHistoryResponse, error) {
4273	gensupport.SetOptions(c.urlParams_, opts...)
4274	res, err := c.doRequest("json")
4275	if res != nil && res.StatusCode == http.StatusNotModified {
4276		if res.Body != nil {
4277			res.Body.Close()
4278		}
4279		return nil, &googleapi.Error{
4280			Code:   res.StatusCode,
4281			Header: res.Header,
4282		}
4283	}
4284	if err != nil {
4285		return nil, err
4286	}
4287	defer googleapi.CloseBody(res)
4288	if err := googleapi.CheckResponse(res); err != nil {
4289		return nil, err
4290	}
4291	ret := &ListHistoryResponse{
4292		ServerResponse: googleapi.ServerResponse{
4293			Header:         res.Header,
4294			HTTPStatusCode: res.StatusCode,
4295		},
4296	}
4297	target := &ret
4298	if err := gensupport.DecodeResponse(target, res); err != nil {
4299		return nil, err
4300	}
4301	return ret, nil
4302	// {
4303	//   "description": "Lists the history of all changes to the given mailbox. History results are\nreturned in chronological order (increasing \u003ccode\u003ehistoryId\u003c/code\u003e).",
4304	//   "flatPath": "gmail/v1/users/{userId}/history",
4305	//   "httpMethod": "GET",
4306	//   "id": "gmail.users.history.list",
4307	//   "parameterOrder": [
4308	//     "userId"
4309	//   ],
4310	//   "parameters": {
4311	//     "historyTypes": {
4312	//       "description": "History types to be returned by the function",
4313	//       "enum": [
4314	//         "messageAdded",
4315	//         "messageDeleted",
4316	//         "labelAdded",
4317	//         "labelRemoved"
4318	//       ],
4319	//       "location": "query",
4320	//       "repeated": true,
4321	//       "type": "string"
4322	//     },
4323	//     "labelId": {
4324	//       "description": "Only return messages with a label matching the ID.",
4325	//       "location": "query",
4326	//       "type": "string"
4327	//     },
4328	//     "maxResults": {
4329	//       "default": "100",
4330	//       "description": "The maximum number of history records to return.",
4331	//       "format": "uint32",
4332	//       "location": "query",
4333	//       "type": "integer"
4334	//     },
4335	//     "pageToken": {
4336	//       "description": "Page token to retrieve a specific page of results in the list.",
4337	//       "location": "query",
4338	//       "type": "string"
4339	//     },
4340	//     "startHistoryId": {
4341	//       "description": "Required. Returns history records after the specified\n\u003ccode\u003estartHistoryId\u003c/code\u003e. The supplied \u003ccode\u003estartHistoryId\u003c/code\u003e\nshould be obtained from the \u003ccode\u003ehistoryId\u003c/code\u003e of a message, thread, or\nprevious \u003ccode\u003elist\u003c/code\u003e response. History IDs increase\nchronologically but are not contiguous with random gaps in between valid\nIDs. Supplying an invalid or out of date \u003ccode\u003estartHistoryId\u003c/code\u003e\ntypically returns an \u003ccode\u003eHTTP 404\u003c/code\u003e error code. A\n\u003ccode\u003ehistoryId\u003c/code\u003e is typically valid for at least a week, but in some\nrare circumstances may be valid for only a few hours. If you receive an\n\u003ccode\u003eHTTP 404\u003c/code\u003e error response, your  application should perform a\nfull sync. If you receive no \u003ccode\u003enextPageToken\u003c/code\u003e in the response,\nthere are no updates to retrieve and you can store the returned\n\u003ccode\u003ehistoryId\u003c/code\u003e for a future request.",
4342	//       "format": "uint64",
4343	//       "location": "query",
4344	//       "type": "string"
4345	//     },
4346	//     "userId": {
4347	//       "default": "me",
4348	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
4349	//       "location": "path",
4350	//       "required": true,
4351	//       "type": "string"
4352	//     }
4353	//   },
4354	//   "path": "gmail/v1/users/{userId}/history",
4355	//   "response": {
4356	//     "$ref": "ListHistoryResponse"
4357	//   },
4358	//   "scopes": [
4359	//     "https://mail.google.com/",
4360	//     "https://www.googleapis.com/auth/gmail.metadata",
4361	//     "https://www.googleapis.com/auth/gmail.modify",
4362	//     "https://www.googleapis.com/auth/gmail.readonly"
4363	//   ]
4364	// }
4365
4366}
4367
4368// Pages invokes f for each page of results.
4369// A non-nil error returned from f will halt the iteration.
4370// The provided context supersedes any context provided to the Context method.
4371func (c *UsersHistoryListCall) Pages(ctx context.Context, f func(*ListHistoryResponse) error) error {
4372	c.ctx_ = ctx
4373	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4374	for {
4375		x, err := c.Do()
4376		if err != nil {
4377			return err
4378		}
4379		if err := f(x); err != nil {
4380			return err
4381		}
4382		if x.NextPageToken == "" {
4383			return nil
4384		}
4385		c.PageToken(x.NextPageToken)
4386	}
4387}
4388
4389// method id "gmail.users.labels.create":
4390
4391type UsersLabelsCreateCall struct {
4392	s          *Service
4393	userId     string
4394	label      *Label
4395	urlParams_ gensupport.URLParams
4396	ctx_       context.Context
4397	header_    http.Header
4398}
4399
4400// Create: Creates a new label.
4401func (r *UsersLabelsService) Create(userId string, label *Label) *UsersLabelsCreateCall {
4402	c := &UsersLabelsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4403	c.userId = userId
4404	c.label = label
4405	return c
4406}
4407
4408// Fields allows partial responses to be retrieved. See
4409// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4410// for more information.
4411func (c *UsersLabelsCreateCall) Fields(s ...googleapi.Field) *UsersLabelsCreateCall {
4412	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4413	return c
4414}
4415
4416// Context sets the context to be used in this call's Do method. Any
4417// pending HTTP request will be aborted if the provided context is
4418// canceled.
4419func (c *UsersLabelsCreateCall) Context(ctx context.Context) *UsersLabelsCreateCall {
4420	c.ctx_ = ctx
4421	return c
4422}
4423
4424// Header returns an http.Header that can be modified by the caller to
4425// add HTTP headers to the request.
4426func (c *UsersLabelsCreateCall) Header() http.Header {
4427	if c.header_ == nil {
4428		c.header_ = make(http.Header)
4429	}
4430	return c.header_
4431}
4432
4433func (c *UsersLabelsCreateCall) doRequest(alt string) (*http.Response, error) {
4434	reqHeaders := make(http.Header)
4435	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
4436	for k, v := range c.header_ {
4437		reqHeaders[k] = v
4438	}
4439	reqHeaders.Set("User-Agent", c.s.userAgent())
4440	var body io.Reader = nil
4441	body, err := googleapi.WithoutDataWrapper.JSONReader(c.label)
4442	if err != nil {
4443		return nil, err
4444	}
4445	reqHeaders.Set("Content-Type", "application/json")
4446	c.urlParams_.Set("alt", alt)
4447	c.urlParams_.Set("prettyPrint", "false")
4448	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels")
4449	urls += "?" + c.urlParams_.Encode()
4450	req, err := http.NewRequest("POST", urls, body)
4451	if err != nil {
4452		return nil, err
4453	}
4454	req.Header = reqHeaders
4455	googleapi.Expand(req.URL, map[string]string{
4456		"userId": c.userId,
4457	})
4458	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4459}
4460
4461// Do executes the "gmail.users.labels.create" call.
4462// Exactly one of *Label or error will be non-nil. Any non-2xx status
4463// code is an error. Response headers are in either
4464// *Label.ServerResponse.Header or (if a response was returned at all)
4465// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4466// check whether the returned error was because http.StatusNotModified
4467// was returned.
4468func (c *UsersLabelsCreateCall) Do(opts ...googleapi.CallOption) (*Label, error) {
4469	gensupport.SetOptions(c.urlParams_, opts...)
4470	res, err := c.doRequest("json")
4471	if res != nil && res.StatusCode == http.StatusNotModified {
4472		if res.Body != nil {
4473			res.Body.Close()
4474		}
4475		return nil, &googleapi.Error{
4476			Code:   res.StatusCode,
4477			Header: res.Header,
4478		}
4479	}
4480	if err != nil {
4481		return nil, err
4482	}
4483	defer googleapi.CloseBody(res)
4484	if err := googleapi.CheckResponse(res); err != nil {
4485		return nil, err
4486	}
4487	ret := &Label{
4488		ServerResponse: googleapi.ServerResponse{
4489			Header:         res.Header,
4490			HTTPStatusCode: res.StatusCode,
4491		},
4492	}
4493	target := &ret
4494	if err := gensupport.DecodeResponse(target, res); err != nil {
4495		return nil, err
4496	}
4497	return ret, nil
4498	// {
4499	//   "description": "Creates a new label.",
4500	//   "flatPath": "gmail/v1/users/{userId}/labels",
4501	//   "httpMethod": "POST",
4502	//   "id": "gmail.users.labels.create",
4503	//   "parameterOrder": [
4504	//     "userId"
4505	//   ],
4506	//   "parameters": {
4507	//     "userId": {
4508	//       "default": "me",
4509	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
4510	//       "location": "path",
4511	//       "required": true,
4512	//       "type": "string"
4513	//     }
4514	//   },
4515	//   "path": "gmail/v1/users/{userId}/labels",
4516	//   "request": {
4517	//     "$ref": "Label"
4518	//   },
4519	//   "response": {
4520	//     "$ref": "Label"
4521	//   },
4522	//   "scopes": [
4523	//     "https://mail.google.com/",
4524	//     "https://www.googleapis.com/auth/gmail.labels",
4525	//     "https://www.googleapis.com/auth/gmail.modify"
4526	//   ]
4527	// }
4528
4529}
4530
4531// method id "gmail.users.labels.delete":
4532
4533type UsersLabelsDeleteCall struct {
4534	s          *Service
4535	userId     string
4536	id         string
4537	urlParams_ gensupport.URLParams
4538	ctx_       context.Context
4539	header_    http.Header
4540}
4541
4542// Delete: Immediately and permanently deletes the specified label and
4543// removes it from
4544// any messages and threads that it is applied to.
4545func (r *UsersLabelsService) Delete(userId string, id string) *UsersLabelsDeleteCall {
4546	c := &UsersLabelsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4547	c.userId = userId
4548	c.id = id
4549	return c
4550}
4551
4552// Fields allows partial responses to be retrieved. See
4553// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4554// for more information.
4555func (c *UsersLabelsDeleteCall) Fields(s ...googleapi.Field) *UsersLabelsDeleteCall {
4556	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4557	return c
4558}
4559
4560// Context sets the context to be used in this call's Do method. Any
4561// pending HTTP request will be aborted if the provided context is
4562// canceled.
4563func (c *UsersLabelsDeleteCall) Context(ctx context.Context) *UsersLabelsDeleteCall {
4564	c.ctx_ = ctx
4565	return c
4566}
4567
4568// Header returns an http.Header that can be modified by the caller to
4569// add HTTP headers to the request.
4570func (c *UsersLabelsDeleteCall) Header() http.Header {
4571	if c.header_ == nil {
4572		c.header_ = make(http.Header)
4573	}
4574	return c.header_
4575}
4576
4577func (c *UsersLabelsDeleteCall) doRequest(alt string) (*http.Response, error) {
4578	reqHeaders := make(http.Header)
4579	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
4580	for k, v := range c.header_ {
4581		reqHeaders[k] = v
4582	}
4583	reqHeaders.Set("User-Agent", c.s.userAgent())
4584	var body io.Reader = nil
4585	c.urlParams_.Set("alt", alt)
4586	c.urlParams_.Set("prettyPrint", "false")
4587	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels/{id}")
4588	urls += "?" + c.urlParams_.Encode()
4589	req, err := http.NewRequest("DELETE", urls, body)
4590	if err != nil {
4591		return nil, err
4592	}
4593	req.Header = reqHeaders
4594	googleapi.Expand(req.URL, map[string]string{
4595		"userId": c.userId,
4596		"id":     c.id,
4597	})
4598	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4599}
4600
4601// Do executes the "gmail.users.labels.delete" call.
4602func (c *UsersLabelsDeleteCall) Do(opts ...googleapi.CallOption) error {
4603	gensupport.SetOptions(c.urlParams_, opts...)
4604	res, err := c.doRequest("json")
4605	if err != nil {
4606		return err
4607	}
4608	defer googleapi.CloseBody(res)
4609	if err := googleapi.CheckResponse(res); err != nil {
4610		return err
4611	}
4612	return nil
4613	// {
4614	//   "description": "Immediately and permanently deletes the specified label and removes it from\nany messages and threads that it is applied to.",
4615	//   "flatPath": "gmail/v1/users/{userId}/labels/{id}",
4616	//   "httpMethod": "DELETE",
4617	//   "id": "gmail.users.labels.delete",
4618	//   "parameterOrder": [
4619	//     "userId",
4620	//     "id"
4621	//   ],
4622	//   "parameters": {
4623	//     "id": {
4624	//       "description": "The ID of the label to delete.",
4625	//       "location": "path",
4626	//       "required": true,
4627	//       "type": "string"
4628	//     },
4629	//     "userId": {
4630	//       "default": "me",
4631	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
4632	//       "location": "path",
4633	//       "required": true,
4634	//       "type": "string"
4635	//     }
4636	//   },
4637	//   "path": "gmail/v1/users/{userId}/labels/{id}",
4638	//   "scopes": [
4639	//     "https://mail.google.com/",
4640	//     "https://www.googleapis.com/auth/gmail.labels",
4641	//     "https://www.googleapis.com/auth/gmail.modify"
4642	//   ]
4643	// }
4644
4645}
4646
4647// method id "gmail.users.labels.get":
4648
4649type UsersLabelsGetCall struct {
4650	s            *Service
4651	userId       string
4652	id           string
4653	urlParams_   gensupport.URLParams
4654	ifNoneMatch_ string
4655	ctx_         context.Context
4656	header_      http.Header
4657}
4658
4659// Get: Gets the specified label.
4660func (r *UsersLabelsService) Get(userId string, id string) *UsersLabelsGetCall {
4661	c := &UsersLabelsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4662	c.userId = userId
4663	c.id = id
4664	return c
4665}
4666
4667// Fields allows partial responses to be retrieved. See
4668// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4669// for more information.
4670func (c *UsersLabelsGetCall) Fields(s ...googleapi.Field) *UsersLabelsGetCall {
4671	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4672	return c
4673}
4674
4675// IfNoneMatch sets the optional parameter which makes the operation
4676// fail if the object's ETag matches the given value. This is useful for
4677// getting updates only after the object has changed since the last
4678// request. Use googleapi.IsNotModified to check whether the response
4679// error from Do is the result of In-None-Match.
4680func (c *UsersLabelsGetCall) IfNoneMatch(entityTag string) *UsersLabelsGetCall {
4681	c.ifNoneMatch_ = entityTag
4682	return c
4683}
4684
4685// Context sets the context to be used in this call's Do method. Any
4686// pending HTTP request will be aborted if the provided context is
4687// canceled.
4688func (c *UsersLabelsGetCall) Context(ctx context.Context) *UsersLabelsGetCall {
4689	c.ctx_ = ctx
4690	return c
4691}
4692
4693// Header returns an http.Header that can be modified by the caller to
4694// add HTTP headers to the request.
4695func (c *UsersLabelsGetCall) Header() http.Header {
4696	if c.header_ == nil {
4697		c.header_ = make(http.Header)
4698	}
4699	return c.header_
4700}
4701
4702func (c *UsersLabelsGetCall) doRequest(alt string) (*http.Response, error) {
4703	reqHeaders := make(http.Header)
4704	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
4705	for k, v := range c.header_ {
4706		reqHeaders[k] = v
4707	}
4708	reqHeaders.Set("User-Agent", c.s.userAgent())
4709	if c.ifNoneMatch_ != "" {
4710		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4711	}
4712	var body io.Reader = nil
4713	c.urlParams_.Set("alt", alt)
4714	c.urlParams_.Set("prettyPrint", "false")
4715	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels/{id}")
4716	urls += "?" + c.urlParams_.Encode()
4717	req, err := http.NewRequest("GET", urls, body)
4718	if err != nil {
4719		return nil, err
4720	}
4721	req.Header = reqHeaders
4722	googleapi.Expand(req.URL, map[string]string{
4723		"userId": c.userId,
4724		"id":     c.id,
4725	})
4726	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4727}
4728
4729// Do executes the "gmail.users.labels.get" call.
4730// Exactly one of *Label or error will be non-nil. Any non-2xx status
4731// code is an error. Response headers are in either
4732// *Label.ServerResponse.Header or (if a response was returned at all)
4733// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4734// check whether the returned error was because http.StatusNotModified
4735// was returned.
4736func (c *UsersLabelsGetCall) Do(opts ...googleapi.CallOption) (*Label, error) {
4737	gensupport.SetOptions(c.urlParams_, opts...)
4738	res, err := c.doRequest("json")
4739	if res != nil && res.StatusCode == http.StatusNotModified {
4740		if res.Body != nil {
4741			res.Body.Close()
4742		}
4743		return nil, &googleapi.Error{
4744			Code:   res.StatusCode,
4745			Header: res.Header,
4746		}
4747	}
4748	if err != nil {
4749		return nil, err
4750	}
4751	defer googleapi.CloseBody(res)
4752	if err := googleapi.CheckResponse(res); err != nil {
4753		return nil, err
4754	}
4755	ret := &Label{
4756		ServerResponse: googleapi.ServerResponse{
4757			Header:         res.Header,
4758			HTTPStatusCode: res.StatusCode,
4759		},
4760	}
4761	target := &ret
4762	if err := gensupport.DecodeResponse(target, res); err != nil {
4763		return nil, err
4764	}
4765	return ret, nil
4766	// {
4767	//   "description": "Gets the specified label.",
4768	//   "flatPath": "gmail/v1/users/{userId}/labels/{id}",
4769	//   "httpMethod": "GET",
4770	//   "id": "gmail.users.labels.get",
4771	//   "parameterOrder": [
4772	//     "userId",
4773	//     "id"
4774	//   ],
4775	//   "parameters": {
4776	//     "id": {
4777	//       "description": "The ID of the label to retrieve.",
4778	//       "location": "path",
4779	//       "required": true,
4780	//       "type": "string"
4781	//     },
4782	//     "userId": {
4783	//       "default": "me",
4784	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
4785	//       "location": "path",
4786	//       "required": true,
4787	//       "type": "string"
4788	//     }
4789	//   },
4790	//   "path": "gmail/v1/users/{userId}/labels/{id}",
4791	//   "response": {
4792	//     "$ref": "Label"
4793	//   },
4794	//   "scopes": [
4795	//     "https://mail.google.com/",
4796	//     "https://www.googleapis.com/auth/gmail.labels",
4797	//     "https://www.googleapis.com/auth/gmail.metadata",
4798	//     "https://www.googleapis.com/auth/gmail.modify",
4799	//     "https://www.googleapis.com/auth/gmail.readonly"
4800	//   ]
4801	// }
4802
4803}
4804
4805// method id "gmail.users.labels.list":
4806
4807type UsersLabelsListCall struct {
4808	s            *Service
4809	userId       string
4810	urlParams_   gensupport.URLParams
4811	ifNoneMatch_ string
4812	ctx_         context.Context
4813	header_      http.Header
4814}
4815
4816// List: Lists all labels in the user's mailbox.
4817func (r *UsersLabelsService) List(userId string) *UsersLabelsListCall {
4818	c := &UsersLabelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4819	c.userId = userId
4820	return c
4821}
4822
4823// Fields allows partial responses to be retrieved. See
4824// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4825// for more information.
4826func (c *UsersLabelsListCall) Fields(s ...googleapi.Field) *UsersLabelsListCall {
4827	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4828	return c
4829}
4830
4831// IfNoneMatch sets the optional parameter which makes the operation
4832// fail if the object's ETag matches the given value. This is useful for
4833// getting updates only after the object has changed since the last
4834// request. Use googleapi.IsNotModified to check whether the response
4835// error from Do is the result of In-None-Match.
4836func (c *UsersLabelsListCall) IfNoneMatch(entityTag string) *UsersLabelsListCall {
4837	c.ifNoneMatch_ = entityTag
4838	return c
4839}
4840
4841// Context sets the context to be used in this call's Do method. Any
4842// pending HTTP request will be aborted if the provided context is
4843// canceled.
4844func (c *UsersLabelsListCall) Context(ctx context.Context) *UsersLabelsListCall {
4845	c.ctx_ = ctx
4846	return c
4847}
4848
4849// Header returns an http.Header that can be modified by the caller to
4850// add HTTP headers to the request.
4851func (c *UsersLabelsListCall) Header() http.Header {
4852	if c.header_ == nil {
4853		c.header_ = make(http.Header)
4854	}
4855	return c.header_
4856}
4857
4858func (c *UsersLabelsListCall) doRequest(alt string) (*http.Response, error) {
4859	reqHeaders := make(http.Header)
4860	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
4861	for k, v := range c.header_ {
4862		reqHeaders[k] = v
4863	}
4864	reqHeaders.Set("User-Agent", c.s.userAgent())
4865	if c.ifNoneMatch_ != "" {
4866		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4867	}
4868	var body io.Reader = nil
4869	c.urlParams_.Set("alt", alt)
4870	c.urlParams_.Set("prettyPrint", "false")
4871	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels")
4872	urls += "?" + c.urlParams_.Encode()
4873	req, err := http.NewRequest("GET", urls, body)
4874	if err != nil {
4875		return nil, err
4876	}
4877	req.Header = reqHeaders
4878	googleapi.Expand(req.URL, map[string]string{
4879		"userId": c.userId,
4880	})
4881	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4882}
4883
4884// Do executes the "gmail.users.labels.list" call.
4885// Exactly one of *ListLabelsResponse or error will be non-nil. Any
4886// non-2xx status code is an error. Response headers are in either
4887// *ListLabelsResponse.ServerResponse.Header or (if a response was
4888// returned at all) in error.(*googleapi.Error).Header. Use
4889// googleapi.IsNotModified to check whether the returned error was
4890// because http.StatusNotModified was returned.
4891func (c *UsersLabelsListCall) Do(opts ...googleapi.CallOption) (*ListLabelsResponse, error) {
4892	gensupport.SetOptions(c.urlParams_, opts...)
4893	res, err := c.doRequest("json")
4894	if res != nil && res.StatusCode == http.StatusNotModified {
4895		if res.Body != nil {
4896			res.Body.Close()
4897		}
4898		return nil, &googleapi.Error{
4899			Code:   res.StatusCode,
4900			Header: res.Header,
4901		}
4902	}
4903	if err != nil {
4904		return nil, err
4905	}
4906	defer googleapi.CloseBody(res)
4907	if err := googleapi.CheckResponse(res); err != nil {
4908		return nil, err
4909	}
4910	ret := &ListLabelsResponse{
4911		ServerResponse: googleapi.ServerResponse{
4912			Header:         res.Header,
4913			HTTPStatusCode: res.StatusCode,
4914		},
4915	}
4916	target := &ret
4917	if err := gensupport.DecodeResponse(target, res); err != nil {
4918		return nil, err
4919	}
4920	return ret, nil
4921	// {
4922	//   "description": "Lists all labels in the user's mailbox.",
4923	//   "flatPath": "gmail/v1/users/{userId}/labels",
4924	//   "httpMethod": "GET",
4925	//   "id": "gmail.users.labels.list",
4926	//   "parameterOrder": [
4927	//     "userId"
4928	//   ],
4929	//   "parameters": {
4930	//     "userId": {
4931	//       "default": "me",
4932	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
4933	//       "location": "path",
4934	//       "required": true,
4935	//       "type": "string"
4936	//     }
4937	//   },
4938	//   "path": "gmail/v1/users/{userId}/labels",
4939	//   "response": {
4940	//     "$ref": "ListLabelsResponse"
4941	//   },
4942	//   "scopes": [
4943	//     "https://mail.google.com/",
4944	//     "https://www.googleapis.com/auth/gmail.labels",
4945	//     "https://www.googleapis.com/auth/gmail.metadata",
4946	//     "https://www.googleapis.com/auth/gmail.modify",
4947	//     "https://www.googleapis.com/auth/gmail.readonly"
4948	//   ]
4949	// }
4950
4951}
4952
4953// method id "gmail.users.labels.patch":
4954
4955type UsersLabelsPatchCall struct {
4956	s          *Service
4957	userId     string
4958	id         string
4959	label      *Label
4960	urlParams_ gensupport.URLParams
4961	ctx_       context.Context
4962	header_    http.Header
4963}
4964
4965// Patch: Patch the specified label.
4966func (r *UsersLabelsService) Patch(userId string, id string, label *Label) *UsersLabelsPatchCall {
4967	c := &UsersLabelsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4968	c.userId = userId
4969	c.id = id
4970	c.label = label
4971	return c
4972}
4973
4974// Fields allows partial responses to be retrieved. See
4975// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4976// for more information.
4977func (c *UsersLabelsPatchCall) Fields(s ...googleapi.Field) *UsersLabelsPatchCall {
4978	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4979	return c
4980}
4981
4982// Context sets the context to be used in this call's Do method. Any
4983// pending HTTP request will be aborted if the provided context is
4984// canceled.
4985func (c *UsersLabelsPatchCall) Context(ctx context.Context) *UsersLabelsPatchCall {
4986	c.ctx_ = ctx
4987	return c
4988}
4989
4990// Header returns an http.Header that can be modified by the caller to
4991// add HTTP headers to the request.
4992func (c *UsersLabelsPatchCall) Header() http.Header {
4993	if c.header_ == nil {
4994		c.header_ = make(http.Header)
4995	}
4996	return c.header_
4997}
4998
4999func (c *UsersLabelsPatchCall) doRequest(alt string) (*http.Response, error) {
5000	reqHeaders := make(http.Header)
5001	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
5002	for k, v := range c.header_ {
5003		reqHeaders[k] = v
5004	}
5005	reqHeaders.Set("User-Agent", c.s.userAgent())
5006	var body io.Reader = nil
5007	body, err := googleapi.WithoutDataWrapper.JSONReader(c.label)
5008	if err != nil {
5009		return nil, err
5010	}
5011	reqHeaders.Set("Content-Type", "application/json")
5012	c.urlParams_.Set("alt", alt)
5013	c.urlParams_.Set("prettyPrint", "false")
5014	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels/{id}")
5015	urls += "?" + c.urlParams_.Encode()
5016	req, err := http.NewRequest("PATCH", urls, body)
5017	if err != nil {
5018		return nil, err
5019	}
5020	req.Header = reqHeaders
5021	googleapi.Expand(req.URL, map[string]string{
5022		"userId": c.userId,
5023		"id":     c.id,
5024	})
5025	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5026}
5027
5028// Do executes the "gmail.users.labels.patch" call.
5029// Exactly one of *Label or error will be non-nil. Any non-2xx status
5030// code is an error. Response headers are in either
5031// *Label.ServerResponse.Header or (if a response was returned at all)
5032// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5033// check whether the returned error was because http.StatusNotModified
5034// was returned.
5035func (c *UsersLabelsPatchCall) Do(opts ...googleapi.CallOption) (*Label, error) {
5036	gensupport.SetOptions(c.urlParams_, opts...)
5037	res, err := c.doRequest("json")
5038	if res != nil && res.StatusCode == http.StatusNotModified {
5039		if res.Body != nil {
5040			res.Body.Close()
5041		}
5042		return nil, &googleapi.Error{
5043			Code:   res.StatusCode,
5044			Header: res.Header,
5045		}
5046	}
5047	if err != nil {
5048		return nil, err
5049	}
5050	defer googleapi.CloseBody(res)
5051	if err := googleapi.CheckResponse(res); err != nil {
5052		return nil, err
5053	}
5054	ret := &Label{
5055		ServerResponse: googleapi.ServerResponse{
5056			Header:         res.Header,
5057			HTTPStatusCode: res.StatusCode,
5058		},
5059	}
5060	target := &ret
5061	if err := gensupport.DecodeResponse(target, res); err != nil {
5062		return nil, err
5063	}
5064	return ret, nil
5065	// {
5066	//   "description": "Patch the specified label.",
5067	//   "flatPath": "gmail/v1/users/{userId}/labels/{id}",
5068	//   "httpMethod": "PATCH",
5069	//   "id": "gmail.users.labels.patch",
5070	//   "parameterOrder": [
5071	//     "userId",
5072	//     "id"
5073	//   ],
5074	//   "parameters": {
5075	//     "id": {
5076	//       "description": "The ID of the label to update.",
5077	//       "location": "path",
5078	//       "required": true,
5079	//       "type": "string"
5080	//     },
5081	//     "userId": {
5082	//       "default": "me",
5083	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
5084	//       "location": "path",
5085	//       "required": true,
5086	//       "type": "string"
5087	//     }
5088	//   },
5089	//   "path": "gmail/v1/users/{userId}/labels/{id}",
5090	//   "request": {
5091	//     "$ref": "Label"
5092	//   },
5093	//   "response": {
5094	//     "$ref": "Label"
5095	//   },
5096	//   "scopes": [
5097	//     "https://mail.google.com/",
5098	//     "https://www.googleapis.com/auth/gmail.labels",
5099	//     "https://www.googleapis.com/auth/gmail.modify"
5100	//   ]
5101	// }
5102
5103}
5104
5105// method id "gmail.users.labels.update":
5106
5107type UsersLabelsUpdateCall struct {
5108	s          *Service
5109	userId     string
5110	id         string
5111	label      *Label
5112	urlParams_ gensupport.URLParams
5113	ctx_       context.Context
5114	header_    http.Header
5115}
5116
5117// Update: Updates the specified label.
5118func (r *UsersLabelsService) Update(userId string, id string, label *Label) *UsersLabelsUpdateCall {
5119	c := &UsersLabelsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5120	c.userId = userId
5121	c.id = id
5122	c.label = label
5123	return c
5124}
5125
5126// Fields allows partial responses to be retrieved. See
5127// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5128// for more information.
5129func (c *UsersLabelsUpdateCall) Fields(s ...googleapi.Field) *UsersLabelsUpdateCall {
5130	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5131	return c
5132}
5133
5134// Context sets the context to be used in this call's Do method. Any
5135// pending HTTP request will be aborted if the provided context is
5136// canceled.
5137func (c *UsersLabelsUpdateCall) Context(ctx context.Context) *UsersLabelsUpdateCall {
5138	c.ctx_ = ctx
5139	return c
5140}
5141
5142// Header returns an http.Header that can be modified by the caller to
5143// add HTTP headers to the request.
5144func (c *UsersLabelsUpdateCall) Header() http.Header {
5145	if c.header_ == nil {
5146		c.header_ = make(http.Header)
5147	}
5148	return c.header_
5149}
5150
5151func (c *UsersLabelsUpdateCall) doRequest(alt string) (*http.Response, error) {
5152	reqHeaders := make(http.Header)
5153	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
5154	for k, v := range c.header_ {
5155		reqHeaders[k] = v
5156	}
5157	reqHeaders.Set("User-Agent", c.s.userAgent())
5158	var body io.Reader = nil
5159	body, err := googleapi.WithoutDataWrapper.JSONReader(c.label)
5160	if err != nil {
5161		return nil, err
5162	}
5163	reqHeaders.Set("Content-Type", "application/json")
5164	c.urlParams_.Set("alt", alt)
5165	c.urlParams_.Set("prettyPrint", "false")
5166	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/labels/{id}")
5167	urls += "?" + c.urlParams_.Encode()
5168	req, err := http.NewRequest("PUT", urls, body)
5169	if err != nil {
5170		return nil, err
5171	}
5172	req.Header = reqHeaders
5173	googleapi.Expand(req.URL, map[string]string{
5174		"userId": c.userId,
5175		"id":     c.id,
5176	})
5177	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5178}
5179
5180// Do executes the "gmail.users.labels.update" call.
5181// Exactly one of *Label or error will be non-nil. Any non-2xx status
5182// code is an error. Response headers are in either
5183// *Label.ServerResponse.Header or (if a response was returned at all)
5184// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5185// check whether the returned error was because http.StatusNotModified
5186// was returned.
5187func (c *UsersLabelsUpdateCall) Do(opts ...googleapi.CallOption) (*Label, error) {
5188	gensupport.SetOptions(c.urlParams_, opts...)
5189	res, err := c.doRequest("json")
5190	if res != nil && res.StatusCode == http.StatusNotModified {
5191		if res.Body != nil {
5192			res.Body.Close()
5193		}
5194		return nil, &googleapi.Error{
5195			Code:   res.StatusCode,
5196			Header: res.Header,
5197		}
5198	}
5199	if err != nil {
5200		return nil, err
5201	}
5202	defer googleapi.CloseBody(res)
5203	if err := googleapi.CheckResponse(res); err != nil {
5204		return nil, err
5205	}
5206	ret := &Label{
5207		ServerResponse: googleapi.ServerResponse{
5208			Header:         res.Header,
5209			HTTPStatusCode: res.StatusCode,
5210		},
5211	}
5212	target := &ret
5213	if err := gensupport.DecodeResponse(target, res); err != nil {
5214		return nil, err
5215	}
5216	return ret, nil
5217	// {
5218	//   "description": "Updates the specified label.",
5219	//   "flatPath": "gmail/v1/users/{userId}/labels/{id}",
5220	//   "httpMethod": "PUT",
5221	//   "id": "gmail.users.labels.update",
5222	//   "parameterOrder": [
5223	//     "userId",
5224	//     "id"
5225	//   ],
5226	//   "parameters": {
5227	//     "id": {
5228	//       "description": "The ID of the label to update.",
5229	//       "location": "path",
5230	//       "required": true,
5231	//       "type": "string"
5232	//     },
5233	//     "userId": {
5234	//       "default": "me",
5235	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
5236	//       "location": "path",
5237	//       "required": true,
5238	//       "type": "string"
5239	//     }
5240	//   },
5241	//   "path": "gmail/v1/users/{userId}/labels/{id}",
5242	//   "request": {
5243	//     "$ref": "Label"
5244	//   },
5245	//   "response": {
5246	//     "$ref": "Label"
5247	//   },
5248	//   "scopes": [
5249	//     "https://mail.google.com/",
5250	//     "https://www.googleapis.com/auth/gmail.labels",
5251	//     "https://www.googleapis.com/auth/gmail.modify"
5252	//   ]
5253	// }
5254
5255}
5256
5257// method id "gmail.users.messages.batchDelete":
5258
5259type UsersMessagesBatchDeleteCall struct {
5260	s                          *Service
5261	userId                     string
5262	batchdeletemessagesrequest *BatchDeleteMessagesRequest
5263	urlParams_                 gensupport.URLParams
5264	ctx_                       context.Context
5265	header_                    http.Header
5266}
5267
5268// BatchDelete: Deletes many messages by message ID.  Provides no
5269// guarantees that messages
5270// were not already deleted or even existed at all.
5271func (r *UsersMessagesService) BatchDelete(userId string, batchdeletemessagesrequest *BatchDeleteMessagesRequest) *UsersMessagesBatchDeleteCall {
5272	c := &UsersMessagesBatchDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5273	c.userId = userId
5274	c.batchdeletemessagesrequest = batchdeletemessagesrequest
5275	return c
5276}
5277
5278// Fields allows partial responses to be retrieved. See
5279// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5280// for more information.
5281func (c *UsersMessagesBatchDeleteCall) Fields(s ...googleapi.Field) *UsersMessagesBatchDeleteCall {
5282	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5283	return c
5284}
5285
5286// Context sets the context to be used in this call's Do method. Any
5287// pending HTTP request will be aborted if the provided context is
5288// canceled.
5289func (c *UsersMessagesBatchDeleteCall) Context(ctx context.Context) *UsersMessagesBatchDeleteCall {
5290	c.ctx_ = ctx
5291	return c
5292}
5293
5294// Header returns an http.Header that can be modified by the caller to
5295// add HTTP headers to the request.
5296func (c *UsersMessagesBatchDeleteCall) Header() http.Header {
5297	if c.header_ == nil {
5298		c.header_ = make(http.Header)
5299	}
5300	return c.header_
5301}
5302
5303func (c *UsersMessagesBatchDeleteCall) doRequest(alt string) (*http.Response, error) {
5304	reqHeaders := make(http.Header)
5305	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
5306	for k, v := range c.header_ {
5307		reqHeaders[k] = v
5308	}
5309	reqHeaders.Set("User-Agent", c.s.userAgent())
5310	var body io.Reader = nil
5311	body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchdeletemessagesrequest)
5312	if err != nil {
5313		return nil, err
5314	}
5315	reqHeaders.Set("Content-Type", "application/json")
5316	c.urlParams_.Set("alt", alt)
5317	c.urlParams_.Set("prettyPrint", "false")
5318	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/batchDelete")
5319	urls += "?" + c.urlParams_.Encode()
5320	req, err := http.NewRequest("POST", urls, body)
5321	if err != nil {
5322		return nil, err
5323	}
5324	req.Header = reqHeaders
5325	googleapi.Expand(req.URL, map[string]string{
5326		"userId": c.userId,
5327	})
5328	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5329}
5330
5331// Do executes the "gmail.users.messages.batchDelete" call.
5332func (c *UsersMessagesBatchDeleteCall) Do(opts ...googleapi.CallOption) error {
5333	gensupport.SetOptions(c.urlParams_, opts...)
5334	res, err := c.doRequest("json")
5335	if err != nil {
5336		return err
5337	}
5338	defer googleapi.CloseBody(res)
5339	if err := googleapi.CheckResponse(res); err != nil {
5340		return err
5341	}
5342	return nil
5343	// {
5344	//   "description": "Deletes many messages by message ID.  Provides no guarantees that messages\nwere not already deleted or even existed at all.",
5345	//   "flatPath": "gmail/v1/users/{userId}/messages/batchDelete",
5346	//   "httpMethod": "POST",
5347	//   "id": "gmail.users.messages.batchDelete",
5348	//   "parameterOrder": [
5349	//     "userId"
5350	//   ],
5351	//   "parameters": {
5352	//     "userId": {
5353	//       "default": "me",
5354	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
5355	//       "location": "path",
5356	//       "required": true,
5357	//       "type": "string"
5358	//     }
5359	//   },
5360	//   "path": "gmail/v1/users/{userId}/messages/batchDelete",
5361	//   "request": {
5362	//     "$ref": "BatchDeleteMessagesRequest"
5363	//   },
5364	//   "scopes": [
5365	//     "https://mail.google.com/"
5366	//   ]
5367	// }
5368
5369}
5370
5371// method id "gmail.users.messages.batchModify":
5372
5373type UsersMessagesBatchModifyCall struct {
5374	s                          *Service
5375	userId                     string
5376	batchmodifymessagesrequest *BatchModifyMessagesRequest
5377	urlParams_                 gensupport.URLParams
5378	ctx_                       context.Context
5379	header_                    http.Header
5380}
5381
5382// BatchModify: Modifies the labels on the specified messages.
5383func (r *UsersMessagesService) BatchModify(userId string, batchmodifymessagesrequest *BatchModifyMessagesRequest) *UsersMessagesBatchModifyCall {
5384	c := &UsersMessagesBatchModifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5385	c.userId = userId
5386	c.batchmodifymessagesrequest = batchmodifymessagesrequest
5387	return c
5388}
5389
5390// Fields allows partial responses to be retrieved. See
5391// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5392// for more information.
5393func (c *UsersMessagesBatchModifyCall) Fields(s ...googleapi.Field) *UsersMessagesBatchModifyCall {
5394	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5395	return c
5396}
5397
5398// Context sets the context to be used in this call's Do method. Any
5399// pending HTTP request will be aborted if the provided context is
5400// canceled.
5401func (c *UsersMessagesBatchModifyCall) Context(ctx context.Context) *UsersMessagesBatchModifyCall {
5402	c.ctx_ = ctx
5403	return c
5404}
5405
5406// Header returns an http.Header that can be modified by the caller to
5407// add HTTP headers to the request.
5408func (c *UsersMessagesBatchModifyCall) Header() http.Header {
5409	if c.header_ == nil {
5410		c.header_ = make(http.Header)
5411	}
5412	return c.header_
5413}
5414
5415func (c *UsersMessagesBatchModifyCall) doRequest(alt string) (*http.Response, error) {
5416	reqHeaders := make(http.Header)
5417	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
5418	for k, v := range c.header_ {
5419		reqHeaders[k] = v
5420	}
5421	reqHeaders.Set("User-Agent", c.s.userAgent())
5422	var body io.Reader = nil
5423	body, err := googleapi.WithoutDataWrapper.JSONReader(c.batchmodifymessagesrequest)
5424	if err != nil {
5425		return nil, err
5426	}
5427	reqHeaders.Set("Content-Type", "application/json")
5428	c.urlParams_.Set("alt", alt)
5429	c.urlParams_.Set("prettyPrint", "false")
5430	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/batchModify")
5431	urls += "?" + c.urlParams_.Encode()
5432	req, err := http.NewRequest("POST", urls, body)
5433	if err != nil {
5434		return nil, err
5435	}
5436	req.Header = reqHeaders
5437	googleapi.Expand(req.URL, map[string]string{
5438		"userId": c.userId,
5439	})
5440	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5441}
5442
5443// Do executes the "gmail.users.messages.batchModify" call.
5444func (c *UsersMessagesBatchModifyCall) Do(opts ...googleapi.CallOption) error {
5445	gensupport.SetOptions(c.urlParams_, opts...)
5446	res, err := c.doRequest("json")
5447	if err != nil {
5448		return err
5449	}
5450	defer googleapi.CloseBody(res)
5451	if err := googleapi.CheckResponse(res); err != nil {
5452		return err
5453	}
5454	return nil
5455	// {
5456	//   "description": "Modifies the labels on the specified messages.",
5457	//   "flatPath": "gmail/v1/users/{userId}/messages/batchModify",
5458	//   "httpMethod": "POST",
5459	//   "id": "gmail.users.messages.batchModify",
5460	//   "parameterOrder": [
5461	//     "userId"
5462	//   ],
5463	//   "parameters": {
5464	//     "userId": {
5465	//       "default": "me",
5466	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
5467	//       "location": "path",
5468	//       "required": true,
5469	//       "type": "string"
5470	//     }
5471	//   },
5472	//   "path": "gmail/v1/users/{userId}/messages/batchModify",
5473	//   "request": {
5474	//     "$ref": "BatchModifyMessagesRequest"
5475	//   },
5476	//   "scopes": [
5477	//     "https://mail.google.com/",
5478	//     "https://www.googleapis.com/auth/gmail.modify"
5479	//   ]
5480	// }
5481
5482}
5483
5484// method id "gmail.users.messages.delete":
5485
5486type UsersMessagesDeleteCall struct {
5487	s          *Service
5488	userId     string
5489	id         string
5490	urlParams_ gensupport.URLParams
5491	ctx_       context.Context
5492	header_    http.Header
5493}
5494
5495// Delete: Immediately and permanently deletes the specified message.
5496// This operation
5497// cannot be undone.  Prefer <code>messages.trash</code> instead.
5498func (r *UsersMessagesService) Delete(userId string, id string) *UsersMessagesDeleteCall {
5499	c := &UsersMessagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5500	c.userId = userId
5501	c.id = id
5502	return c
5503}
5504
5505// Fields allows partial responses to be retrieved. See
5506// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5507// for more information.
5508func (c *UsersMessagesDeleteCall) Fields(s ...googleapi.Field) *UsersMessagesDeleteCall {
5509	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5510	return c
5511}
5512
5513// Context sets the context to be used in this call's Do method. Any
5514// pending HTTP request will be aborted if the provided context is
5515// canceled.
5516func (c *UsersMessagesDeleteCall) Context(ctx context.Context) *UsersMessagesDeleteCall {
5517	c.ctx_ = ctx
5518	return c
5519}
5520
5521// Header returns an http.Header that can be modified by the caller to
5522// add HTTP headers to the request.
5523func (c *UsersMessagesDeleteCall) Header() http.Header {
5524	if c.header_ == nil {
5525		c.header_ = make(http.Header)
5526	}
5527	return c.header_
5528}
5529
5530func (c *UsersMessagesDeleteCall) doRequest(alt string) (*http.Response, error) {
5531	reqHeaders := make(http.Header)
5532	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
5533	for k, v := range c.header_ {
5534		reqHeaders[k] = v
5535	}
5536	reqHeaders.Set("User-Agent", c.s.userAgent())
5537	var body io.Reader = nil
5538	c.urlParams_.Set("alt", alt)
5539	c.urlParams_.Set("prettyPrint", "false")
5540	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}")
5541	urls += "?" + c.urlParams_.Encode()
5542	req, err := http.NewRequest("DELETE", urls, body)
5543	if err != nil {
5544		return nil, err
5545	}
5546	req.Header = reqHeaders
5547	googleapi.Expand(req.URL, map[string]string{
5548		"userId": c.userId,
5549		"id":     c.id,
5550	})
5551	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5552}
5553
5554// Do executes the "gmail.users.messages.delete" call.
5555func (c *UsersMessagesDeleteCall) Do(opts ...googleapi.CallOption) error {
5556	gensupport.SetOptions(c.urlParams_, opts...)
5557	res, err := c.doRequest("json")
5558	if err != nil {
5559		return err
5560	}
5561	defer googleapi.CloseBody(res)
5562	if err := googleapi.CheckResponse(res); err != nil {
5563		return err
5564	}
5565	return nil
5566	// {
5567	//   "description": "Immediately and permanently deletes the specified message. This operation\ncannot be undone.  Prefer \u003ccode\u003emessages.trash\u003c/code\u003e instead.",
5568	//   "flatPath": "gmail/v1/users/{userId}/messages/{id}",
5569	//   "httpMethod": "DELETE",
5570	//   "id": "gmail.users.messages.delete",
5571	//   "parameterOrder": [
5572	//     "userId",
5573	//     "id"
5574	//   ],
5575	//   "parameters": {
5576	//     "id": {
5577	//       "description": "The ID of the message to delete.",
5578	//       "location": "path",
5579	//       "required": true,
5580	//       "type": "string"
5581	//     },
5582	//     "userId": {
5583	//       "default": "me",
5584	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
5585	//       "location": "path",
5586	//       "required": true,
5587	//       "type": "string"
5588	//     }
5589	//   },
5590	//   "path": "gmail/v1/users/{userId}/messages/{id}",
5591	//   "scopes": [
5592	//     "https://mail.google.com/"
5593	//   ]
5594	// }
5595
5596}
5597
5598// method id "gmail.users.messages.get":
5599
5600type UsersMessagesGetCall struct {
5601	s            *Service
5602	userId       string
5603	id           string
5604	urlParams_   gensupport.URLParams
5605	ifNoneMatch_ string
5606	ctx_         context.Context
5607	header_      http.Header
5608}
5609
5610// Get: Gets the specified message.
5611func (r *UsersMessagesService) Get(userId string, id string) *UsersMessagesGetCall {
5612	c := &UsersMessagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5613	c.userId = userId
5614	c.id = id
5615	return c
5616}
5617
5618// Format sets the optional parameter "format": The format to return the
5619// message in.
5620//
5621// Possible values:
5622//   "minimal"
5623//   "full" (default)
5624//   "raw"
5625//   "metadata"
5626func (c *UsersMessagesGetCall) Format(format string) *UsersMessagesGetCall {
5627	c.urlParams_.Set("format", format)
5628	return c
5629}
5630
5631// MetadataHeaders sets the optional parameter "metadataHeaders": When
5632// given and format is METADATA, only include headers specified.
5633func (c *UsersMessagesGetCall) MetadataHeaders(metadataHeaders ...string) *UsersMessagesGetCall {
5634	c.urlParams_.SetMulti("metadataHeaders", append([]string{}, metadataHeaders...))
5635	return c
5636}
5637
5638// Fields allows partial responses to be retrieved. See
5639// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5640// for more information.
5641func (c *UsersMessagesGetCall) Fields(s ...googleapi.Field) *UsersMessagesGetCall {
5642	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5643	return c
5644}
5645
5646// IfNoneMatch sets the optional parameter which makes the operation
5647// fail if the object's ETag matches the given value. This is useful for
5648// getting updates only after the object has changed since the last
5649// request. Use googleapi.IsNotModified to check whether the response
5650// error from Do is the result of In-None-Match.
5651func (c *UsersMessagesGetCall) IfNoneMatch(entityTag string) *UsersMessagesGetCall {
5652	c.ifNoneMatch_ = entityTag
5653	return c
5654}
5655
5656// Context sets the context to be used in this call's Do method. Any
5657// pending HTTP request will be aborted if the provided context is
5658// canceled.
5659func (c *UsersMessagesGetCall) Context(ctx context.Context) *UsersMessagesGetCall {
5660	c.ctx_ = ctx
5661	return c
5662}
5663
5664// Header returns an http.Header that can be modified by the caller to
5665// add HTTP headers to the request.
5666func (c *UsersMessagesGetCall) Header() http.Header {
5667	if c.header_ == nil {
5668		c.header_ = make(http.Header)
5669	}
5670	return c.header_
5671}
5672
5673func (c *UsersMessagesGetCall) doRequest(alt string) (*http.Response, error) {
5674	reqHeaders := make(http.Header)
5675	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
5676	for k, v := range c.header_ {
5677		reqHeaders[k] = v
5678	}
5679	reqHeaders.Set("User-Agent", c.s.userAgent())
5680	if c.ifNoneMatch_ != "" {
5681		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5682	}
5683	var body io.Reader = nil
5684	c.urlParams_.Set("alt", alt)
5685	c.urlParams_.Set("prettyPrint", "false")
5686	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}")
5687	urls += "?" + c.urlParams_.Encode()
5688	req, err := http.NewRequest("GET", urls, body)
5689	if err != nil {
5690		return nil, err
5691	}
5692	req.Header = reqHeaders
5693	googleapi.Expand(req.URL, map[string]string{
5694		"userId": c.userId,
5695		"id":     c.id,
5696	})
5697	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5698}
5699
5700// Do executes the "gmail.users.messages.get" call.
5701// Exactly one of *Message or error will be non-nil. Any non-2xx status
5702// code is an error. Response headers are in either
5703// *Message.ServerResponse.Header or (if a response was returned at all)
5704// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5705// check whether the returned error was because http.StatusNotModified
5706// was returned.
5707func (c *UsersMessagesGetCall) Do(opts ...googleapi.CallOption) (*Message, error) {
5708	gensupport.SetOptions(c.urlParams_, opts...)
5709	res, err := c.doRequest("json")
5710	if res != nil && res.StatusCode == http.StatusNotModified {
5711		if res.Body != nil {
5712			res.Body.Close()
5713		}
5714		return nil, &googleapi.Error{
5715			Code:   res.StatusCode,
5716			Header: res.Header,
5717		}
5718	}
5719	if err != nil {
5720		return nil, err
5721	}
5722	defer googleapi.CloseBody(res)
5723	if err := googleapi.CheckResponse(res); err != nil {
5724		return nil, err
5725	}
5726	ret := &Message{
5727		ServerResponse: googleapi.ServerResponse{
5728			Header:         res.Header,
5729			HTTPStatusCode: res.StatusCode,
5730		},
5731	}
5732	target := &ret
5733	if err := gensupport.DecodeResponse(target, res); err != nil {
5734		return nil, err
5735	}
5736	return ret, nil
5737	// {
5738	//   "description": "Gets the specified message.",
5739	//   "flatPath": "gmail/v1/users/{userId}/messages/{id}",
5740	//   "httpMethod": "GET",
5741	//   "id": "gmail.users.messages.get",
5742	//   "parameterOrder": [
5743	//     "userId",
5744	//     "id"
5745	//   ],
5746	//   "parameters": {
5747	//     "format": {
5748	//       "default": "full",
5749	//       "description": "The format to return the message in.",
5750	//       "enum": [
5751	//         "minimal",
5752	//         "full",
5753	//         "raw",
5754	//         "metadata"
5755	//       ],
5756	//       "location": "query",
5757	//       "type": "string"
5758	//     },
5759	//     "id": {
5760	//       "description": "The ID of the message to retrieve.",
5761	//       "location": "path",
5762	//       "required": true,
5763	//       "type": "string"
5764	//     },
5765	//     "metadataHeaders": {
5766	//       "description": "When given and format is METADATA, only include headers specified.",
5767	//       "location": "query",
5768	//       "repeated": true,
5769	//       "type": "string"
5770	//     },
5771	//     "userId": {
5772	//       "default": "me",
5773	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
5774	//       "location": "path",
5775	//       "required": true,
5776	//       "type": "string"
5777	//     }
5778	//   },
5779	//   "path": "gmail/v1/users/{userId}/messages/{id}",
5780	//   "response": {
5781	//     "$ref": "Message"
5782	//   },
5783	//   "scopes": [
5784	//     "https://mail.google.com/",
5785	//     "https://www.googleapis.com/auth/gmail.addons.current.message.action",
5786	//     "https://www.googleapis.com/auth/gmail.addons.current.message.metadata",
5787	//     "https://www.googleapis.com/auth/gmail.addons.current.message.readonly",
5788	//     "https://www.googleapis.com/auth/gmail.metadata",
5789	//     "https://www.googleapis.com/auth/gmail.modify",
5790	//     "https://www.googleapis.com/auth/gmail.readonly"
5791	//   ]
5792	// }
5793
5794}
5795
5796// method id "gmail.users.messages.import":
5797
5798type UsersMessagesImportCall struct {
5799	s          *Service
5800	userId     string
5801	message    *Message
5802	urlParams_ gensupport.URLParams
5803	mediaInfo_ *gensupport.MediaInfo
5804	ctx_       context.Context
5805	header_    http.Header
5806}
5807
5808// Import: Imports a message into only this user's mailbox, with
5809// standard
5810// email delivery scanning and classification similar to receiving via
5811// SMTP.
5812// Does not send a message.
5813func (r *UsersMessagesService) Import(userId string, message *Message) *UsersMessagesImportCall {
5814	c := &UsersMessagesImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5815	c.userId = userId
5816	c.message = message
5817	return c
5818}
5819
5820// Deleted sets the optional parameter "deleted": Mark the email as
5821// permanently deleted (not TRASH) and
5822// only visible in
5823// <a href="http://support.google.com/vault/">Google Vault</a> to
5824// a Vault administrator. Only used for G Suite accounts.
5825func (c *UsersMessagesImportCall) Deleted(deleted bool) *UsersMessagesImportCall {
5826	c.urlParams_.Set("deleted", fmt.Sprint(deleted))
5827	return c
5828}
5829
5830// InternalDateSource sets the optional parameter "internalDateSource":
5831// Source for Gmail's internal date of the message.
5832//
5833// Possible values:
5834//   "receivedTime"
5835//   "dateHeader" (default)
5836func (c *UsersMessagesImportCall) InternalDateSource(internalDateSource string) *UsersMessagesImportCall {
5837	c.urlParams_.Set("internalDateSource", internalDateSource)
5838	return c
5839}
5840
5841// NeverMarkSpam sets the optional parameter "neverMarkSpam": Ignore the
5842// Gmail spam classifier decision and never mark
5843// this email as SPAM in the mailbox.
5844func (c *UsersMessagesImportCall) NeverMarkSpam(neverMarkSpam bool) *UsersMessagesImportCall {
5845	c.urlParams_.Set("neverMarkSpam", fmt.Sprint(neverMarkSpam))
5846	return c
5847}
5848
5849// ProcessForCalendar sets the optional parameter "processForCalendar":
5850// Process calendar invites in the email and add any extracted
5851// meetings to the Google Calendar for this user.
5852func (c *UsersMessagesImportCall) ProcessForCalendar(processForCalendar bool) *UsersMessagesImportCall {
5853	c.urlParams_.Set("processForCalendar", fmt.Sprint(processForCalendar))
5854	return c
5855}
5856
5857// Media specifies the media to upload in one or more chunks. The chunk
5858// size may be controlled by supplying a MediaOption generated by
5859// googleapi.ChunkSize. The chunk size defaults to
5860// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
5861// upload request will be determined by sniffing the contents of r,
5862// unless a MediaOption generated by googleapi.ContentType is
5863// supplied.
5864// At most one of Media and ResumableMedia may be set.
5865func (c *UsersMessagesImportCall) Media(r io.Reader, options ...googleapi.MediaOption) *UsersMessagesImportCall {
5866	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
5867	return c
5868}
5869
5870// ResumableMedia specifies the media to upload in chunks and can be
5871// canceled with ctx.
5872//
5873// Deprecated: use Media instead.
5874//
5875// At most one of Media and ResumableMedia may be set. mediaType
5876// identifies the MIME media type of the upload, such as "image/png". If
5877// mediaType is "", it will be auto-detected. The provided ctx will
5878// supersede any context previously provided to the Context method.
5879func (c *UsersMessagesImportCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersMessagesImportCall {
5880	c.ctx_ = ctx
5881	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
5882	return c
5883}
5884
5885// ProgressUpdater provides a callback function that will be called
5886// after every chunk. It should be a low-latency function in order to
5887// not slow down the upload operation. This should only be called when
5888// using ResumableMedia (as opposed to Media).
5889func (c *UsersMessagesImportCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersMessagesImportCall {
5890	c.mediaInfo_.SetProgressUpdater(pu)
5891	return c
5892}
5893
5894// Fields allows partial responses to be retrieved. See
5895// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5896// for more information.
5897func (c *UsersMessagesImportCall) Fields(s ...googleapi.Field) *UsersMessagesImportCall {
5898	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5899	return c
5900}
5901
5902// Context sets the context to be used in this call's Do method. Any
5903// pending HTTP request will be aborted if the provided context is
5904// canceled.
5905// This context will supersede any context previously provided to the
5906// ResumableMedia method.
5907func (c *UsersMessagesImportCall) Context(ctx context.Context) *UsersMessagesImportCall {
5908	c.ctx_ = ctx
5909	return c
5910}
5911
5912// Header returns an http.Header that can be modified by the caller to
5913// add HTTP headers to the request.
5914func (c *UsersMessagesImportCall) Header() http.Header {
5915	if c.header_ == nil {
5916		c.header_ = make(http.Header)
5917	}
5918	return c.header_
5919}
5920
5921func (c *UsersMessagesImportCall) doRequest(alt string) (*http.Response, error) {
5922	reqHeaders := make(http.Header)
5923	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
5924	for k, v := range c.header_ {
5925		reqHeaders[k] = v
5926	}
5927	reqHeaders.Set("User-Agent", c.s.userAgent())
5928	var body io.Reader = nil
5929	body, err := googleapi.WithoutDataWrapper.JSONReader(c.message)
5930	if err != nil {
5931		return nil, err
5932	}
5933	reqHeaders.Set("Content-Type", "application/json")
5934	c.urlParams_.Set("alt", alt)
5935	c.urlParams_.Set("prettyPrint", "false")
5936	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/import")
5937	if c.mediaInfo_ != nil {
5938		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/messages/import")
5939		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
5940	}
5941	if body == nil {
5942		body = new(bytes.Buffer)
5943		reqHeaders.Set("Content-Type", "application/json")
5944	}
5945	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
5946	defer cleanup()
5947	urls += "?" + c.urlParams_.Encode()
5948	req, err := http.NewRequest("POST", urls, body)
5949	if err != nil {
5950		return nil, err
5951	}
5952	req.Header = reqHeaders
5953	req.GetBody = getBody
5954	googleapi.Expand(req.URL, map[string]string{
5955		"userId": c.userId,
5956	})
5957	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5958}
5959
5960// Do executes the "gmail.users.messages.import" call.
5961// Exactly one of *Message or error will be non-nil. Any non-2xx status
5962// code is an error. Response headers are in either
5963// *Message.ServerResponse.Header or (if a response was returned at all)
5964// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5965// check whether the returned error was because http.StatusNotModified
5966// was returned.
5967func (c *UsersMessagesImportCall) Do(opts ...googleapi.CallOption) (*Message, error) {
5968	gensupport.SetOptions(c.urlParams_, opts...)
5969	res, err := c.doRequest("json")
5970	if res != nil && res.StatusCode == http.StatusNotModified {
5971		if res.Body != nil {
5972			res.Body.Close()
5973		}
5974		return nil, &googleapi.Error{
5975			Code:   res.StatusCode,
5976			Header: res.Header,
5977		}
5978	}
5979	if err != nil {
5980		return nil, err
5981	}
5982	defer googleapi.CloseBody(res)
5983	if err := googleapi.CheckResponse(res); err != nil {
5984		return nil, err
5985	}
5986	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
5987	if rx != nil {
5988		rx.Client = c.s.client
5989		rx.UserAgent = c.s.userAgent()
5990		ctx := c.ctx_
5991		if ctx == nil {
5992			ctx = context.TODO()
5993		}
5994		res, err = rx.Upload(ctx)
5995		if err != nil {
5996			return nil, err
5997		}
5998		defer res.Body.Close()
5999		if err := googleapi.CheckResponse(res); err != nil {
6000			return nil, err
6001		}
6002	}
6003	ret := &Message{
6004		ServerResponse: googleapi.ServerResponse{
6005			Header:         res.Header,
6006			HTTPStatusCode: res.StatusCode,
6007		},
6008	}
6009	target := &ret
6010	if err := gensupport.DecodeResponse(target, res); err != nil {
6011		return nil, err
6012	}
6013	return ret, nil
6014	// {
6015	//   "description": "Imports a message into only this user's mailbox, with standard\nemail delivery scanning and classification similar to receiving via SMTP.\nDoes not send a message.",
6016	//   "flatPath": "gmail/v1/users/{userId}/messages/import",
6017	//   "httpMethod": "POST",
6018	//   "id": "gmail.users.messages.import",
6019	//   "mediaUpload": {
6020	//     "accept": [
6021	//       "message/*"
6022	//     ],
6023	//     "maxSize": "52428800",
6024	//     "protocols": {
6025	//       "resumable": {
6026	//         "multipart": true,
6027	//         "path": "/resumable/upload/gmail/v1/users/{userId}/messages/import"
6028	//       },
6029	//       "simple": {
6030	//         "multipart": true,
6031	//         "path": "/upload/gmail/v1/users/{userId}/messages/import"
6032	//       }
6033	//     }
6034	//   },
6035	//   "parameterOrder": [
6036	//     "userId"
6037	//   ],
6038	//   "parameters": {
6039	//     "deleted": {
6040	//       "default": "false",
6041	//       "description": "Mark the email as permanently deleted (not TRASH) and\nonly visible in\n\u003ca href=\"http://support.google.com/vault/\"\u003eGoogle Vault\u003c/a\u003e to\na Vault administrator. Only used for G Suite accounts.",
6042	//       "location": "query",
6043	//       "type": "boolean"
6044	//     },
6045	//     "internalDateSource": {
6046	//       "default": "dateHeader",
6047	//       "description": "Source for Gmail's internal date of the message.",
6048	//       "enum": [
6049	//         "receivedTime",
6050	//         "dateHeader"
6051	//       ],
6052	//       "location": "query",
6053	//       "type": "string"
6054	//     },
6055	//     "neverMarkSpam": {
6056	//       "default": "false",
6057	//       "description": "Ignore the Gmail spam classifier decision and never mark\nthis email as SPAM in the mailbox.",
6058	//       "location": "query",
6059	//       "type": "boolean"
6060	//     },
6061	//     "processForCalendar": {
6062	//       "default": "false",
6063	//       "description": "Process calendar invites in the email and add any extracted\nmeetings to the Google Calendar for this user.",
6064	//       "location": "query",
6065	//       "type": "boolean"
6066	//     },
6067	//     "userId": {
6068	//       "default": "me",
6069	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
6070	//       "location": "path",
6071	//       "required": true,
6072	//       "type": "string"
6073	//     }
6074	//   },
6075	//   "path": "gmail/v1/users/{userId}/messages/import",
6076	//   "request": {
6077	//     "$ref": "Message"
6078	//   },
6079	//   "response": {
6080	//     "$ref": "Message"
6081	//   },
6082	//   "scopes": [
6083	//     "https://mail.google.com/",
6084	//     "https://www.googleapis.com/auth/gmail.insert",
6085	//     "https://www.googleapis.com/auth/gmail.modify"
6086	//   ],
6087	//   "supportsMediaUpload": true
6088	// }
6089
6090}
6091
6092// method id "gmail.users.messages.insert":
6093
6094type UsersMessagesInsertCall struct {
6095	s          *Service
6096	userId     string
6097	message    *Message
6098	urlParams_ gensupport.URLParams
6099	mediaInfo_ *gensupport.MediaInfo
6100	ctx_       context.Context
6101	header_    http.Header
6102}
6103
6104// Insert: Directly inserts a message into only this user's mailbox
6105// similar to
6106// <code>IMAP APPEND</code>, bypassing most scanning and
6107// classification.
6108// Does not send a message.
6109func (r *UsersMessagesService) Insert(userId string, message *Message) *UsersMessagesInsertCall {
6110	c := &UsersMessagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6111	c.userId = userId
6112	c.message = message
6113	return c
6114}
6115
6116// Deleted sets the optional parameter "deleted": Mark the email as
6117// permanently deleted (not TRASH) and
6118// only visible in
6119// <a href="http://support.google.com/vault/">Google Vault</a> to
6120// a Vault administrator. Only used for G Suite accounts.
6121func (c *UsersMessagesInsertCall) Deleted(deleted bool) *UsersMessagesInsertCall {
6122	c.urlParams_.Set("deleted", fmt.Sprint(deleted))
6123	return c
6124}
6125
6126// InternalDateSource sets the optional parameter "internalDateSource":
6127// Source for Gmail's internal date of the message.
6128//
6129// Possible values:
6130//   "receivedTime" (default)
6131//   "dateHeader"
6132func (c *UsersMessagesInsertCall) InternalDateSource(internalDateSource string) *UsersMessagesInsertCall {
6133	c.urlParams_.Set("internalDateSource", internalDateSource)
6134	return c
6135}
6136
6137// Media specifies the media to upload in one or more chunks. The chunk
6138// size may be controlled by supplying a MediaOption generated by
6139// googleapi.ChunkSize. The chunk size defaults to
6140// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
6141// upload request will be determined by sniffing the contents of r,
6142// unless a MediaOption generated by googleapi.ContentType is
6143// supplied.
6144// At most one of Media and ResumableMedia may be set.
6145func (c *UsersMessagesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *UsersMessagesInsertCall {
6146	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
6147	return c
6148}
6149
6150// ResumableMedia specifies the media to upload in chunks and can be
6151// canceled with ctx.
6152//
6153// Deprecated: use Media instead.
6154//
6155// At most one of Media and ResumableMedia may be set. mediaType
6156// identifies the MIME media type of the upload, such as "image/png". If
6157// mediaType is "", it will be auto-detected. The provided ctx will
6158// supersede any context previously provided to the Context method.
6159func (c *UsersMessagesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersMessagesInsertCall {
6160	c.ctx_ = ctx
6161	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
6162	return c
6163}
6164
6165// ProgressUpdater provides a callback function that will be called
6166// after every chunk. It should be a low-latency function in order to
6167// not slow down the upload operation. This should only be called when
6168// using ResumableMedia (as opposed to Media).
6169func (c *UsersMessagesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersMessagesInsertCall {
6170	c.mediaInfo_.SetProgressUpdater(pu)
6171	return c
6172}
6173
6174// Fields allows partial responses to be retrieved. See
6175// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6176// for more information.
6177func (c *UsersMessagesInsertCall) Fields(s ...googleapi.Field) *UsersMessagesInsertCall {
6178	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6179	return c
6180}
6181
6182// Context sets the context to be used in this call's Do method. Any
6183// pending HTTP request will be aborted if the provided context is
6184// canceled.
6185// This context will supersede any context previously provided to the
6186// ResumableMedia method.
6187func (c *UsersMessagesInsertCall) Context(ctx context.Context) *UsersMessagesInsertCall {
6188	c.ctx_ = ctx
6189	return c
6190}
6191
6192// Header returns an http.Header that can be modified by the caller to
6193// add HTTP headers to the request.
6194func (c *UsersMessagesInsertCall) Header() http.Header {
6195	if c.header_ == nil {
6196		c.header_ = make(http.Header)
6197	}
6198	return c.header_
6199}
6200
6201func (c *UsersMessagesInsertCall) doRequest(alt string) (*http.Response, error) {
6202	reqHeaders := make(http.Header)
6203	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
6204	for k, v := range c.header_ {
6205		reqHeaders[k] = v
6206	}
6207	reqHeaders.Set("User-Agent", c.s.userAgent())
6208	var body io.Reader = nil
6209	body, err := googleapi.WithoutDataWrapper.JSONReader(c.message)
6210	if err != nil {
6211		return nil, err
6212	}
6213	reqHeaders.Set("Content-Type", "application/json")
6214	c.urlParams_.Set("alt", alt)
6215	c.urlParams_.Set("prettyPrint", "false")
6216	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages")
6217	if c.mediaInfo_ != nil {
6218		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/messages")
6219		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
6220	}
6221	if body == nil {
6222		body = new(bytes.Buffer)
6223		reqHeaders.Set("Content-Type", "application/json")
6224	}
6225	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
6226	defer cleanup()
6227	urls += "?" + c.urlParams_.Encode()
6228	req, err := http.NewRequest("POST", urls, body)
6229	if err != nil {
6230		return nil, err
6231	}
6232	req.Header = reqHeaders
6233	req.GetBody = getBody
6234	googleapi.Expand(req.URL, map[string]string{
6235		"userId": c.userId,
6236	})
6237	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6238}
6239
6240// Do executes the "gmail.users.messages.insert" call.
6241// Exactly one of *Message or error will be non-nil. Any non-2xx status
6242// code is an error. Response headers are in either
6243// *Message.ServerResponse.Header or (if a response was returned at all)
6244// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6245// check whether the returned error was because http.StatusNotModified
6246// was returned.
6247func (c *UsersMessagesInsertCall) Do(opts ...googleapi.CallOption) (*Message, error) {
6248	gensupport.SetOptions(c.urlParams_, opts...)
6249	res, err := c.doRequest("json")
6250	if res != nil && res.StatusCode == http.StatusNotModified {
6251		if res.Body != nil {
6252			res.Body.Close()
6253		}
6254		return nil, &googleapi.Error{
6255			Code:   res.StatusCode,
6256			Header: res.Header,
6257		}
6258	}
6259	if err != nil {
6260		return nil, err
6261	}
6262	defer googleapi.CloseBody(res)
6263	if err := googleapi.CheckResponse(res); err != nil {
6264		return nil, err
6265	}
6266	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
6267	if rx != nil {
6268		rx.Client = c.s.client
6269		rx.UserAgent = c.s.userAgent()
6270		ctx := c.ctx_
6271		if ctx == nil {
6272			ctx = context.TODO()
6273		}
6274		res, err = rx.Upload(ctx)
6275		if err != nil {
6276			return nil, err
6277		}
6278		defer res.Body.Close()
6279		if err := googleapi.CheckResponse(res); err != nil {
6280			return nil, err
6281		}
6282	}
6283	ret := &Message{
6284		ServerResponse: googleapi.ServerResponse{
6285			Header:         res.Header,
6286			HTTPStatusCode: res.StatusCode,
6287		},
6288	}
6289	target := &ret
6290	if err := gensupport.DecodeResponse(target, res); err != nil {
6291		return nil, err
6292	}
6293	return ret, nil
6294	// {
6295	//   "description": "Directly inserts a message into only this user's mailbox similar to\n\u003ccode\u003eIMAP APPEND\u003c/code\u003e, bypassing most scanning and classification.\nDoes not send a message.",
6296	//   "flatPath": "gmail/v1/users/{userId}/messages",
6297	//   "httpMethod": "POST",
6298	//   "id": "gmail.users.messages.insert",
6299	//   "mediaUpload": {
6300	//     "accept": [
6301	//       "message/*"
6302	//     ],
6303	//     "maxSize": "52428800",
6304	//     "protocols": {
6305	//       "resumable": {
6306	//         "multipart": true,
6307	//         "path": "/resumable/upload/gmail/v1/users/{userId}/messages"
6308	//       },
6309	//       "simple": {
6310	//         "multipart": true,
6311	//         "path": "/upload/gmail/v1/users/{userId}/messages"
6312	//       }
6313	//     }
6314	//   },
6315	//   "parameterOrder": [
6316	//     "userId"
6317	//   ],
6318	//   "parameters": {
6319	//     "deleted": {
6320	//       "default": "false",
6321	//       "description": "Mark the email as permanently deleted (not TRASH) and\nonly visible in\n\u003ca href=\"http://support.google.com/vault/\"\u003eGoogle Vault\u003c/a\u003e to\na Vault administrator. Only used for G Suite accounts.",
6322	//       "location": "query",
6323	//       "type": "boolean"
6324	//     },
6325	//     "internalDateSource": {
6326	//       "default": "receivedTime",
6327	//       "description": "Source for Gmail's internal date of the message.",
6328	//       "enum": [
6329	//         "receivedTime",
6330	//         "dateHeader"
6331	//       ],
6332	//       "location": "query",
6333	//       "type": "string"
6334	//     },
6335	//     "userId": {
6336	//       "default": "me",
6337	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
6338	//       "location": "path",
6339	//       "required": true,
6340	//       "type": "string"
6341	//     }
6342	//   },
6343	//   "path": "gmail/v1/users/{userId}/messages",
6344	//   "request": {
6345	//     "$ref": "Message"
6346	//   },
6347	//   "response": {
6348	//     "$ref": "Message"
6349	//   },
6350	//   "scopes": [
6351	//     "https://mail.google.com/",
6352	//     "https://www.googleapis.com/auth/gmail.insert",
6353	//     "https://www.googleapis.com/auth/gmail.modify"
6354	//   ],
6355	//   "supportsMediaUpload": true
6356	// }
6357
6358}
6359
6360// method id "gmail.users.messages.list":
6361
6362type UsersMessagesListCall struct {
6363	s            *Service
6364	userId       string
6365	urlParams_   gensupport.URLParams
6366	ifNoneMatch_ string
6367	ctx_         context.Context
6368	header_      http.Header
6369}
6370
6371// List: Lists the messages in the user's mailbox.
6372func (r *UsersMessagesService) List(userId string) *UsersMessagesListCall {
6373	c := &UsersMessagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6374	c.userId = userId
6375	return c
6376}
6377
6378// IncludeSpamTrash sets the optional parameter "includeSpamTrash":
6379// Include messages from <code>SPAM</code> and <code>TRASH</code>
6380// in the results.
6381func (c *UsersMessagesListCall) IncludeSpamTrash(includeSpamTrash bool) *UsersMessagesListCall {
6382	c.urlParams_.Set("includeSpamTrash", fmt.Sprint(includeSpamTrash))
6383	return c
6384}
6385
6386// LabelIds sets the optional parameter "labelIds": Only return messages
6387// with labels that match all of the specified label IDs.
6388func (c *UsersMessagesListCall) LabelIds(labelIds ...string) *UsersMessagesListCall {
6389	c.urlParams_.SetMulti("labelIds", append([]string{}, labelIds...))
6390	return c
6391}
6392
6393// MaxResults sets the optional parameter "maxResults": Maximum number
6394// of messages to return.
6395func (c *UsersMessagesListCall) MaxResults(maxResults int64) *UsersMessagesListCall {
6396	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
6397	return c
6398}
6399
6400// PageToken sets the optional parameter "pageToken": Page token to
6401// retrieve a specific page of results in the list.
6402func (c *UsersMessagesListCall) PageToken(pageToken string) *UsersMessagesListCall {
6403	c.urlParams_.Set("pageToken", pageToken)
6404	return c
6405}
6406
6407// Q sets the optional parameter "q": Only return messages matching the
6408// specified query. Supports the same
6409// query format as the Gmail search box. For
6410// example,
6411// <code>"from:someuser@example.com
6412// rfc822msgid:&lt;somemsgid@example.com&gt;
6413// is:unread"</code>. Parameter cannot be used when accessing the
6414// api
6415// using the gmail.metadata scope.
6416func (c *UsersMessagesListCall) Q(q string) *UsersMessagesListCall {
6417	c.urlParams_.Set("q", q)
6418	return c
6419}
6420
6421// Fields allows partial responses to be retrieved. See
6422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6423// for more information.
6424func (c *UsersMessagesListCall) Fields(s ...googleapi.Field) *UsersMessagesListCall {
6425	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6426	return c
6427}
6428
6429// IfNoneMatch sets the optional parameter which makes the operation
6430// fail if the object's ETag matches the given value. This is useful for
6431// getting updates only after the object has changed since the last
6432// request. Use googleapi.IsNotModified to check whether the response
6433// error from Do is the result of In-None-Match.
6434func (c *UsersMessagesListCall) IfNoneMatch(entityTag string) *UsersMessagesListCall {
6435	c.ifNoneMatch_ = entityTag
6436	return c
6437}
6438
6439// Context sets the context to be used in this call's Do method. Any
6440// pending HTTP request will be aborted if the provided context is
6441// canceled.
6442func (c *UsersMessagesListCall) Context(ctx context.Context) *UsersMessagesListCall {
6443	c.ctx_ = ctx
6444	return c
6445}
6446
6447// Header returns an http.Header that can be modified by the caller to
6448// add HTTP headers to the request.
6449func (c *UsersMessagesListCall) Header() http.Header {
6450	if c.header_ == nil {
6451		c.header_ = make(http.Header)
6452	}
6453	return c.header_
6454}
6455
6456func (c *UsersMessagesListCall) doRequest(alt string) (*http.Response, error) {
6457	reqHeaders := make(http.Header)
6458	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
6459	for k, v := range c.header_ {
6460		reqHeaders[k] = v
6461	}
6462	reqHeaders.Set("User-Agent", c.s.userAgent())
6463	if c.ifNoneMatch_ != "" {
6464		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6465	}
6466	var body io.Reader = nil
6467	c.urlParams_.Set("alt", alt)
6468	c.urlParams_.Set("prettyPrint", "false")
6469	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages")
6470	urls += "?" + c.urlParams_.Encode()
6471	req, err := http.NewRequest("GET", urls, body)
6472	if err != nil {
6473		return nil, err
6474	}
6475	req.Header = reqHeaders
6476	googleapi.Expand(req.URL, map[string]string{
6477		"userId": c.userId,
6478	})
6479	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6480}
6481
6482// Do executes the "gmail.users.messages.list" call.
6483// Exactly one of *ListMessagesResponse or error will be non-nil. Any
6484// non-2xx status code is an error. Response headers are in either
6485// *ListMessagesResponse.ServerResponse.Header or (if a response was
6486// returned at all) in error.(*googleapi.Error).Header. Use
6487// googleapi.IsNotModified to check whether the returned error was
6488// because http.StatusNotModified was returned.
6489func (c *UsersMessagesListCall) Do(opts ...googleapi.CallOption) (*ListMessagesResponse, error) {
6490	gensupport.SetOptions(c.urlParams_, opts...)
6491	res, err := c.doRequest("json")
6492	if res != nil && res.StatusCode == http.StatusNotModified {
6493		if res.Body != nil {
6494			res.Body.Close()
6495		}
6496		return nil, &googleapi.Error{
6497			Code:   res.StatusCode,
6498			Header: res.Header,
6499		}
6500	}
6501	if err != nil {
6502		return nil, err
6503	}
6504	defer googleapi.CloseBody(res)
6505	if err := googleapi.CheckResponse(res); err != nil {
6506		return nil, err
6507	}
6508	ret := &ListMessagesResponse{
6509		ServerResponse: googleapi.ServerResponse{
6510			Header:         res.Header,
6511			HTTPStatusCode: res.StatusCode,
6512		},
6513	}
6514	target := &ret
6515	if err := gensupport.DecodeResponse(target, res); err != nil {
6516		return nil, err
6517	}
6518	return ret, nil
6519	// {
6520	//   "description": "Lists the messages in the user's mailbox.",
6521	//   "flatPath": "gmail/v1/users/{userId}/messages",
6522	//   "httpMethod": "GET",
6523	//   "id": "gmail.users.messages.list",
6524	//   "parameterOrder": [
6525	//     "userId"
6526	//   ],
6527	//   "parameters": {
6528	//     "includeSpamTrash": {
6529	//       "default": "false",
6530	//       "description": "Include messages from \u003ccode\u003eSPAM\u003c/code\u003e and \u003ccode\u003eTRASH\u003c/code\u003e\nin the results.",
6531	//       "location": "query",
6532	//       "type": "boolean"
6533	//     },
6534	//     "labelIds": {
6535	//       "description": "Only return messages with labels that match all of the specified label IDs.",
6536	//       "location": "query",
6537	//       "repeated": true,
6538	//       "type": "string"
6539	//     },
6540	//     "maxResults": {
6541	//       "default": "100",
6542	//       "description": "Maximum number of messages to return.",
6543	//       "format": "uint32",
6544	//       "location": "query",
6545	//       "type": "integer"
6546	//     },
6547	//     "pageToken": {
6548	//       "description": "Page token to retrieve a specific page of results in the list.",
6549	//       "location": "query",
6550	//       "type": "string"
6551	//     },
6552	//     "q": {
6553	//       "description": "Only return messages matching the specified query. Supports the same\nquery format as the Gmail search box. For example,\n\u003ccode\u003e\"from:someuser@example.com rfc822msgid:\u0026lt;somemsgid@example.com\u0026gt;\nis:unread\"\u003c/code\u003e. Parameter cannot be used when accessing the api\nusing the gmail.metadata scope.",
6554	//       "location": "query",
6555	//       "type": "string"
6556	//     },
6557	//     "userId": {
6558	//       "default": "me",
6559	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
6560	//       "location": "path",
6561	//       "required": true,
6562	//       "type": "string"
6563	//     }
6564	//   },
6565	//   "path": "gmail/v1/users/{userId}/messages",
6566	//   "response": {
6567	//     "$ref": "ListMessagesResponse"
6568	//   },
6569	//   "scopes": [
6570	//     "https://mail.google.com/",
6571	//     "https://www.googleapis.com/auth/gmail.metadata",
6572	//     "https://www.googleapis.com/auth/gmail.modify",
6573	//     "https://www.googleapis.com/auth/gmail.readonly"
6574	//   ]
6575	// }
6576
6577}
6578
6579// Pages invokes f for each page of results.
6580// A non-nil error returned from f will halt the iteration.
6581// The provided context supersedes any context provided to the Context method.
6582func (c *UsersMessagesListCall) Pages(ctx context.Context, f func(*ListMessagesResponse) error) error {
6583	c.ctx_ = ctx
6584	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6585	for {
6586		x, err := c.Do()
6587		if err != nil {
6588			return err
6589		}
6590		if err := f(x); err != nil {
6591			return err
6592		}
6593		if x.NextPageToken == "" {
6594			return nil
6595		}
6596		c.PageToken(x.NextPageToken)
6597	}
6598}
6599
6600// method id "gmail.users.messages.modify":
6601
6602type UsersMessagesModifyCall struct {
6603	s                    *Service
6604	userId               string
6605	id                   string
6606	modifymessagerequest *ModifyMessageRequest
6607	urlParams_           gensupport.URLParams
6608	ctx_                 context.Context
6609	header_              http.Header
6610}
6611
6612// Modify: Modifies the labels on the specified message.
6613func (r *UsersMessagesService) Modify(userId string, id string, modifymessagerequest *ModifyMessageRequest) *UsersMessagesModifyCall {
6614	c := &UsersMessagesModifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6615	c.userId = userId
6616	c.id = id
6617	c.modifymessagerequest = modifymessagerequest
6618	return c
6619}
6620
6621// Fields allows partial responses to be retrieved. See
6622// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6623// for more information.
6624func (c *UsersMessagesModifyCall) Fields(s ...googleapi.Field) *UsersMessagesModifyCall {
6625	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6626	return c
6627}
6628
6629// Context sets the context to be used in this call's Do method. Any
6630// pending HTTP request will be aborted if the provided context is
6631// canceled.
6632func (c *UsersMessagesModifyCall) Context(ctx context.Context) *UsersMessagesModifyCall {
6633	c.ctx_ = ctx
6634	return c
6635}
6636
6637// Header returns an http.Header that can be modified by the caller to
6638// add HTTP headers to the request.
6639func (c *UsersMessagesModifyCall) Header() http.Header {
6640	if c.header_ == nil {
6641		c.header_ = make(http.Header)
6642	}
6643	return c.header_
6644}
6645
6646func (c *UsersMessagesModifyCall) doRequest(alt string) (*http.Response, error) {
6647	reqHeaders := make(http.Header)
6648	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
6649	for k, v := range c.header_ {
6650		reqHeaders[k] = v
6651	}
6652	reqHeaders.Set("User-Agent", c.s.userAgent())
6653	var body io.Reader = nil
6654	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifymessagerequest)
6655	if err != nil {
6656		return nil, err
6657	}
6658	reqHeaders.Set("Content-Type", "application/json")
6659	c.urlParams_.Set("alt", alt)
6660	c.urlParams_.Set("prettyPrint", "false")
6661	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}/modify")
6662	urls += "?" + c.urlParams_.Encode()
6663	req, err := http.NewRequest("POST", urls, body)
6664	if err != nil {
6665		return nil, err
6666	}
6667	req.Header = reqHeaders
6668	googleapi.Expand(req.URL, map[string]string{
6669		"userId": c.userId,
6670		"id":     c.id,
6671	})
6672	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6673}
6674
6675// Do executes the "gmail.users.messages.modify" call.
6676// Exactly one of *Message or error will be non-nil. Any non-2xx status
6677// code is an error. Response headers are in either
6678// *Message.ServerResponse.Header or (if a response was returned at all)
6679// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6680// check whether the returned error was because http.StatusNotModified
6681// was returned.
6682func (c *UsersMessagesModifyCall) Do(opts ...googleapi.CallOption) (*Message, error) {
6683	gensupport.SetOptions(c.urlParams_, opts...)
6684	res, err := c.doRequest("json")
6685	if res != nil && res.StatusCode == http.StatusNotModified {
6686		if res.Body != nil {
6687			res.Body.Close()
6688		}
6689		return nil, &googleapi.Error{
6690			Code:   res.StatusCode,
6691			Header: res.Header,
6692		}
6693	}
6694	if err != nil {
6695		return nil, err
6696	}
6697	defer googleapi.CloseBody(res)
6698	if err := googleapi.CheckResponse(res); err != nil {
6699		return nil, err
6700	}
6701	ret := &Message{
6702		ServerResponse: googleapi.ServerResponse{
6703			Header:         res.Header,
6704			HTTPStatusCode: res.StatusCode,
6705		},
6706	}
6707	target := &ret
6708	if err := gensupport.DecodeResponse(target, res); err != nil {
6709		return nil, err
6710	}
6711	return ret, nil
6712	// {
6713	//   "description": "Modifies the labels on the specified message.",
6714	//   "flatPath": "gmail/v1/users/{userId}/messages/{id}/modify",
6715	//   "httpMethod": "POST",
6716	//   "id": "gmail.users.messages.modify",
6717	//   "parameterOrder": [
6718	//     "userId",
6719	//     "id"
6720	//   ],
6721	//   "parameters": {
6722	//     "id": {
6723	//       "description": "The ID of the message to modify.",
6724	//       "location": "path",
6725	//       "required": true,
6726	//       "type": "string"
6727	//     },
6728	//     "userId": {
6729	//       "default": "me",
6730	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
6731	//       "location": "path",
6732	//       "required": true,
6733	//       "type": "string"
6734	//     }
6735	//   },
6736	//   "path": "gmail/v1/users/{userId}/messages/{id}/modify",
6737	//   "request": {
6738	//     "$ref": "ModifyMessageRequest"
6739	//   },
6740	//   "response": {
6741	//     "$ref": "Message"
6742	//   },
6743	//   "scopes": [
6744	//     "https://mail.google.com/",
6745	//     "https://www.googleapis.com/auth/gmail.modify"
6746	//   ]
6747	// }
6748
6749}
6750
6751// method id "gmail.users.messages.send":
6752
6753type UsersMessagesSendCall struct {
6754	s          *Service
6755	userId     string
6756	message    *Message
6757	urlParams_ gensupport.URLParams
6758	mediaInfo_ *gensupport.MediaInfo
6759	ctx_       context.Context
6760	header_    http.Header
6761}
6762
6763// Send: Sends the specified message to the recipients in
6764// the
6765// <code>To</code>, <code>Cc</code>, and <code>Bcc</code> headers.
6766func (r *UsersMessagesService) Send(userId string, message *Message) *UsersMessagesSendCall {
6767	c := &UsersMessagesSendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6768	c.userId = userId
6769	c.message = message
6770	return c
6771}
6772
6773// Media specifies the media to upload in one or more chunks. The chunk
6774// size may be controlled by supplying a MediaOption generated by
6775// googleapi.ChunkSize. The chunk size defaults to
6776// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
6777// upload request will be determined by sniffing the contents of r,
6778// unless a MediaOption generated by googleapi.ContentType is
6779// supplied.
6780// At most one of Media and ResumableMedia may be set.
6781func (c *UsersMessagesSendCall) Media(r io.Reader, options ...googleapi.MediaOption) *UsersMessagesSendCall {
6782	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
6783	return c
6784}
6785
6786// ResumableMedia specifies the media to upload in chunks and can be
6787// canceled with ctx.
6788//
6789// Deprecated: use Media instead.
6790//
6791// At most one of Media and ResumableMedia may be set. mediaType
6792// identifies the MIME media type of the upload, such as "image/png". If
6793// mediaType is "", it will be auto-detected. The provided ctx will
6794// supersede any context previously provided to the Context method.
6795func (c *UsersMessagesSendCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *UsersMessagesSendCall {
6796	c.ctx_ = ctx
6797	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
6798	return c
6799}
6800
6801// ProgressUpdater provides a callback function that will be called
6802// after every chunk. It should be a low-latency function in order to
6803// not slow down the upload operation. This should only be called when
6804// using ResumableMedia (as opposed to Media).
6805func (c *UsersMessagesSendCall) ProgressUpdater(pu googleapi.ProgressUpdater) *UsersMessagesSendCall {
6806	c.mediaInfo_.SetProgressUpdater(pu)
6807	return c
6808}
6809
6810// Fields allows partial responses to be retrieved. See
6811// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6812// for more information.
6813func (c *UsersMessagesSendCall) Fields(s ...googleapi.Field) *UsersMessagesSendCall {
6814	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6815	return c
6816}
6817
6818// Context sets the context to be used in this call's Do method. Any
6819// pending HTTP request will be aborted if the provided context is
6820// canceled.
6821// This context will supersede any context previously provided to the
6822// ResumableMedia method.
6823func (c *UsersMessagesSendCall) Context(ctx context.Context) *UsersMessagesSendCall {
6824	c.ctx_ = ctx
6825	return c
6826}
6827
6828// Header returns an http.Header that can be modified by the caller to
6829// add HTTP headers to the request.
6830func (c *UsersMessagesSendCall) Header() http.Header {
6831	if c.header_ == nil {
6832		c.header_ = make(http.Header)
6833	}
6834	return c.header_
6835}
6836
6837func (c *UsersMessagesSendCall) doRequest(alt string) (*http.Response, error) {
6838	reqHeaders := make(http.Header)
6839	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
6840	for k, v := range c.header_ {
6841		reqHeaders[k] = v
6842	}
6843	reqHeaders.Set("User-Agent", c.s.userAgent())
6844	var body io.Reader = nil
6845	body, err := googleapi.WithoutDataWrapper.JSONReader(c.message)
6846	if err != nil {
6847		return nil, err
6848	}
6849	reqHeaders.Set("Content-Type", "application/json")
6850	c.urlParams_.Set("alt", alt)
6851	c.urlParams_.Set("prettyPrint", "false")
6852	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/send")
6853	if c.mediaInfo_ != nil {
6854		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/gmail/v1/users/{userId}/messages/send")
6855		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
6856	}
6857	if body == nil {
6858		body = new(bytes.Buffer)
6859		reqHeaders.Set("Content-Type", "application/json")
6860	}
6861	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
6862	defer cleanup()
6863	urls += "?" + c.urlParams_.Encode()
6864	req, err := http.NewRequest("POST", urls, body)
6865	if err != nil {
6866		return nil, err
6867	}
6868	req.Header = reqHeaders
6869	req.GetBody = getBody
6870	googleapi.Expand(req.URL, map[string]string{
6871		"userId": c.userId,
6872	})
6873	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6874}
6875
6876// Do executes the "gmail.users.messages.send" call.
6877// Exactly one of *Message or error will be non-nil. Any non-2xx status
6878// code is an error. Response headers are in either
6879// *Message.ServerResponse.Header or (if a response was returned at all)
6880// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6881// check whether the returned error was because http.StatusNotModified
6882// was returned.
6883func (c *UsersMessagesSendCall) Do(opts ...googleapi.CallOption) (*Message, error) {
6884	gensupport.SetOptions(c.urlParams_, opts...)
6885	res, err := c.doRequest("json")
6886	if res != nil && res.StatusCode == http.StatusNotModified {
6887		if res.Body != nil {
6888			res.Body.Close()
6889		}
6890		return nil, &googleapi.Error{
6891			Code:   res.StatusCode,
6892			Header: res.Header,
6893		}
6894	}
6895	if err != nil {
6896		return nil, err
6897	}
6898	defer googleapi.CloseBody(res)
6899	if err := googleapi.CheckResponse(res); err != nil {
6900		return nil, err
6901	}
6902	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
6903	if rx != nil {
6904		rx.Client = c.s.client
6905		rx.UserAgent = c.s.userAgent()
6906		ctx := c.ctx_
6907		if ctx == nil {
6908			ctx = context.TODO()
6909		}
6910		res, err = rx.Upload(ctx)
6911		if err != nil {
6912			return nil, err
6913		}
6914		defer res.Body.Close()
6915		if err := googleapi.CheckResponse(res); err != nil {
6916			return nil, err
6917		}
6918	}
6919	ret := &Message{
6920		ServerResponse: googleapi.ServerResponse{
6921			Header:         res.Header,
6922			HTTPStatusCode: res.StatusCode,
6923		},
6924	}
6925	target := &ret
6926	if err := gensupport.DecodeResponse(target, res); err != nil {
6927		return nil, err
6928	}
6929	return ret, nil
6930	// {
6931	//   "description": "Sends the specified message to the recipients in the\n\u003ccode\u003eTo\u003c/code\u003e, \u003ccode\u003eCc\u003c/code\u003e, and \u003ccode\u003eBcc\u003c/code\u003e headers.",
6932	//   "flatPath": "gmail/v1/users/{userId}/messages/send",
6933	//   "httpMethod": "POST",
6934	//   "id": "gmail.users.messages.send",
6935	//   "mediaUpload": {
6936	//     "accept": [
6937	//       "message/*"
6938	//     ],
6939	//     "maxSize": "36700160",
6940	//     "protocols": {
6941	//       "resumable": {
6942	//         "multipart": true,
6943	//         "path": "/resumable/upload/gmail/v1/users/{userId}/messages/send"
6944	//       },
6945	//       "simple": {
6946	//         "multipart": true,
6947	//         "path": "/upload/gmail/v1/users/{userId}/messages/send"
6948	//       }
6949	//     }
6950	//   },
6951	//   "parameterOrder": [
6952	//     "userId"
6953	//   ],
6954	//   "parameters": {
6955	//     "userId": {
6956	//       "default": "me",
6957	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
6958	//       "location": "path",
6959	//       "required": true,
6960	//       "type": "string"
6961	//     }
6962	//   },
6963	//   "path": "gmail/v1/users/{userId}/messages/send",
6964	//   "request": {
6965	//     "$ref": "Message"
6966	//   },
6967	//   "response": {
6968	//     "$ref": "Message"
6969	//   },
6970	//   "scopes": [
6971	//     "https://mail.google.com/",
6972	//     "https://www.googleapis.com/auth/gmail.addons.current.action.compose",
6973	//     "https://www.googleapis.com/auth/gmail.compose",
6974	//     "https://www.googleapis.com/auth/gmail.modify",
6975	//     "https://www.googleapis.com/auth/gmail.send"
6976	//   ],
6977	//   "supportsMediaUpload": true
6978	// }
6979
6980}
6981
6982// method id "gmail.users.messages.trash":
6983
6984type UsersMessagesTrashCall struct {
6985	s          *Service
6986	userId     string
6987	id         string
6988	urlParams_ gensupport.URLParams
6989	ctx_       context.Context
6990	header_    http.Header
6991}
6992
6993// Trash: Moves the specified message to the trash.
6994func (r *UsersMessagesService) Trash(userId string, id string) *UsersMessagesTrashCall {
6995	c := &UsersMessagesTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6996	c.userId = userId
6997	c.id = id
6998	return c
6999}
7000
7001// Fields allows partial responses to be retrieved. See
7002// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7003// for more information.
7004func (c *UsersMessagesTrashCall) Fields(s ...googleapi.Field) *UsersMessagesTrashCall {
7005	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7006	return c
7007}
7008
7009// Context sets the context to be used in this call's Do method. Any
7010// pending HTTP request will be aborted if the provided context is
7011// canceled.
7012func (c *UsersMessagesTrashCall) Context(ctx context.Context) *UsersMessagesTrashCall {
7013	c.ctx_ = ctx
7014	return c
7015}
7016
7017// Header returns an http.Header that can be modified by the caller to
7018// add HTTP headers to the request.
7019func (c *UsersMessagesTrashCall) Header() http.Header {
7020	if c.header_ == nil {
7021		c.header_ = make(http.Header)
7022	}
7023	return c.header_
7024}
7025
7026func (c *UsersMessagesTrashCall) doRequest(alt string) (*http.Response, error) {
7027	reqHeaders := make(http.Header)
7028	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
7029	for k, v := range c.header_ {
7030		reqHeaders[k] = v
7031	}
7032	reqHeaders.Set("User-Agent", c.s.userAgent())
7033	var body io.Reader = nil
7034	c.urlParams_.Set("alt", alt)
7035	c.urlParams_.Set("prettyPrint", "false")
7036	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}/trash")
7037	urls += "?" + c.urlParams_.Encode()
7038	req, err := http.NewRequest("POST", urls, body)
7039	if err != nil {
7040		return nil, err
7041	}
7042	req.Header = reqHeaders
7043	googleapi.Expand(req.URL, map[string]string{
7044		"userId": c.userId,
7045		"id":     c.id,
7046	})
7047	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7048}
7049
7050// Do executes the "gmail.users.messages.trash" call.
7051// Exactly one of *Message or error will be non-nil. Any non-2xx status
7052// code is an error. Response headers are in either
7053// *Message.ServerResponse.Header or (if a response was returned at all)
7054// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7055// check whether the returned error was because http.StatusNotModified
7056// was returned.
7057func (c *UsersMessagesTrashCall) Do(opts ...googleapi.CallOption) (*Message, error) {
7058	gensupport.SetOptions(c.urlParams_, opts...)
7059	res, err := c.doRequest("json")
7060	if res != nil && res.StatusCode == http.StatusNotModified {
7061		if res.Body != nil {
7062			res.Body.Close()
7063		}
7064		return nil, &googleapi.Error{
7065			Code:   res.StatusCode,
7066			Header: res.Header,
7067		}
7068	}
7069	if err != nil {
7070		return nil, err
7071	}
7072	defer googleapi.CloseBody(res)
7073	if err := googleapi.CheckResponse(res); err != nil {
7074		return nil, err
7075	}
7076	ret := &Message{
7077		ServerResponse: googleapi.ServerResponse{
7078			Header:         res.Header,
7079			HTTPStatusCode: res.StatusCode,
7080		},
7081	}
7082	target := &ret
7083	if err := gensupport.DecodeResponse(target, res); err != nil {
7084		return nil, err
7085	}
7086	return ret, nil
7087	// {
7088	//   "description": "Moves the specified message to the trash.",
7089	//   "flatPath": "gmail/v1/users/{userId}/messages/{id}/trash",
7090	//   "httpMethod": "POST",
7091	//   "id": "gmail.users.messages.trash",
7092	//   "parameterOrder": [
7093	//     "userId",
7094	//     "id"
7095	//   ],
7096	//   "parameters": {
7097	//     "id": {
7098	//       "description": "The ID of the message to Trash.",
7099	//       "location": "path",
7100	//       "required": true,
7101	//       "type": "string"
7102	//     },
7103	//     "userId": {
7104	//       "default": "me",
7105	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
7106	//       "location": "path",
7107	//       "required": true,
7108	//       "type": "string"
7109	//     }
7110	//   },
7111	//   "path": "gmail/v1/users/{userId}/messages/{id}/trash",
7112	//   "response": {
7113	//     "$ref": "Message"
7114	//   },
7115	//   "scopes": [
7116	//     "https://mail.google.com/",
7117	//     "https://www.googleapis.com/auth/gmail.modify"
7118	//   ]
7119	// }
7120
7121}
7122
7123// method id "gmail.users.messages.untrash":
7124
7125type UsersMessagesUntrashCall struct {
7126	s          *Service
7127	userId     string
7128	id         string
7129	urlParams_ gensupport.URLParams
7130	ctx_       context.Context
7131	header_    http.Header
7132}
7133
7134// Untrash: Removes the specified message from the trash.
7135func (r *UsersMessagesService) Untrash(userId string, id string) *UsersMessagesUntrashCall {
7136	c := &UsersMessagesUntrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7137	c.userId = userId
7138	c.id = id
7139	return c
7140}
7141
7142// Fields allows partial responses to be retrieved. See
7143// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7144// for more information.
7145func (c *UsersMessagesUntrashCall) Fields(s ...googleapi.Field) *UsersMessagesUntrashCall {
7146	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7147	return c
7148}
7149
7150// Context sets the context to be used in this call's Do method. Any
7151// pending HTTP request will be aborted if the provided context is
7152// canceled.
7153func (c *UsersMessagesUntrashCall) Context(ctx context.Context) *UsersMessagesUntrashCall {
7154	c.ctx_ = ctx
7155	return c
7156}
7157
7158// Header returns an http.Header that can be modified by the caller to
7159// add HTTP headers to the request.
7160func (c *UsersMessagesUntrashCall) Header() http.Header {
7161	if c.header_ == nil {
7162		c.header_ = make(http.Header)
7163	}
7164	return c.header_
7165}
7166
7167func (c *UsersMessagesUntrashCall) doRequest(alt string) (*http.Response, error) {
7168	reqHeaders := make(http.Header)
7169	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
7170	for k, v := range c.header_ {
7171		reqHeaders[k] = v
7172	}
7173	reqHeaders.Set("User-Agent", c.s.userAgent())
7174	var body io.Reader = nil
7175	c.urlParams_.Set("alt", alt)
7176	c.urlParams_.Set("prettyPrint", "false")
7177	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{id}/untrash")
7178	urls += "?" + c.urlParams_.Encode()
7179	req, err := http.NewRequest("POST", urls, body)
7180	if err != nil {
7181		return nil, err
7182	}
7183	req.Header = reqHeaders
7184	googleapi.Expand(req.URL, map[string]string{
7185		"userId": c.userId,
7186		"id":     c.id,
7187	})
7188	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7189}
7190
7191// Do executes the "gmail.users.messages.untrash" call.
7192// Exactly one of *Message or error will be non-nil. Any non-2xx status
7193// code is an error. Response headers are in either
7194// *Message.ServerResponse.Header or (if a response was returned at all)
7195// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7196// check whether the returned error was because http.StatusNotModified
7197// was returned.
7198func (c *UsersMessagesUntrashCall) Do(opts ...googleapi.CallOption) (*Message, error) {
7199	gensupport.SetOptions(c.urlParams_, opts...)
7200	res, err := c.doRequest("json")
7201	if res != nil && res.StatusCode == http.StatusNotModified {
7202		if res.Body != nil {
7203			res.Body.Close()
7204		}
7205		return nil, &googleapi.Error{
7206			Code:   res.StatusCode,
7207			Header: res.Header,
7208		}
7209	}
7210	if err != nil {
7211		return nil, err
7212	}
7213	defer googleapi.CloseBody(res)
7214	if err := googleapi.CheckResponse(res); err != nil {
7215		return nil, err
7216	}
7217	ret := &Message{
7218		ServerResponse: googleapi.ServerResponse{
7219			Header:         res.Header,
7220			HTTPStatusCode: res.StatusCode,
7221		},
7222	}
7223	target := &ret
7224	if err := gensupport.DecodeResponse(target, res); err != nil {
7225		return nil, err
7226	}
7227	return ret, nil
7228	// {
7229	//   "description": "Removes the specified message from the trash.",
7230	//   "flatPath": "gmail/v1/users/{userId}/messages/{id}/untrash",
7231	//   "httpMethod": "POST",
7232	//   "id": "gmail.users.messages.untrash",
7233	//   "parameterOrder": [
7234	//     "userId",
7235	//     "id"
7236	//   ],
7237	//   "parameters": {
7238	//     "id": {
7239	//       "description": "The ID of the message to remove from Trash.",
7240	//       "location": "path",
7241	//       "required": true,
7242	//       "type": "string"
7243	//     },
7244	//     "userId": {
7245	//       "default": "me",
7246	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
7247	//       "location": "path",
7248	//       "required": true,
7249	//       "type": "string"
7250	//     }
7251	//   },
7252	//   "path": "gmail/v1/users/{userId}/messages/{id}/untrash",
7253	//   "response": {
7254	//     "$ref": "Message"
7255	//   },
7256	//   "scopes": [
7257	//     "https://mail.google.com/",
7258	//     "https://www.googleapis.com/auth/gmail.modify"
7259	//   ]
7260	// }
7261
7262}
7263
7264// method id "gmail.users.messages.attachments.get":
7265
7266type UsersMessagesAttachmentsGetCall struct {
7267	s            *Service
7268	userId       string
7269	messageId    string
7270	id           string
7271	urlParams_   gensupport.URLParams
7272	ifNoneMatch_ string
7273	ctx_         context.Context
7274	header_      http.Header
7275}
7276
7277// Get: Gets the specified message attachment.
7278func (r *UsersMessagesAttachmentsService) Get(userId string, messageId string, id string) *UsersMessagesAttachmentsGetCall {
7279	c := &UsersMessagesAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7280	c.userId = userId
7281	c.messageId = messageId
7282	c.id = id
7283	return c
7284}
7285
7286// Fields allows partial responses to be retrieved. See
7287// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7288// for more information.
7289func (c *UsersMessagesAttachmentsGetCall) Fields(s ...googleapi.Field) *UsersMessagesAttachmentsGetCall {
7290	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7291	return c
7292}
7293
7294// IfNoneMatch sets the optional parameter which makes the operation
7295// fail if the object's ETag matches the given value. This is useful for
7296// getting updates only after the object has changed since the last
7297// request. Use googleapi.IsNotModified to check whether the response
7298// error from Do is the result of In-None-Match.
7299func (c *UsersMessagesAttachmentsGetCall) IfNoneMatch(entityTag string) *UsersMessagesAttachmentsGetCall {
7300	c.ifNoneMatch_ = entityTag
7301	return c
7302}
7303
7304// Context sets the context to be used in this call's Do method. Any
7305// pending HTTP request will be aborted if the provided context is
7306// canceled.
7307func (c *UsersMessagesAttachmentsGetCall) Context(ctx context.Context) *UsersMessagesAttachmentsGetCall {
7308	c.ctx_ = ctx
7309	return c
7310}
7311
7312// Header returns an http.Header that can be modified by the caller to
7313// add HTTP headers to the request.
7314func (c *UsersMessagesAttachmentsGetCall) Header() http.Header {
7315	if c.header_ == nil {
7316		c.header_ = make(http.Header)
7317	}
7318	return c.header_
7319}
7320
7321func (c *UsersMessagesAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
7322	reqHeaders := make(http.Header)
7323	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
7324	for k, v := range c.header_ {
7325		reqHeaders[k] = v
7326	}
7327	reqHeaders.Set("User-Agent", c.s.userAgent())
7328	if c.ifNoneMatch_ != "" {
7329		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7330	}
7331	var body io.Reader = nil
7332	c.urlParams_.Set("alt", alt)
7333	c.urlParams_.Set("prettyPrint", "false")
7334	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}")
7335	urls += "?" + c.urlParams_.Encode()
7336	req, err := http.NewRequest("GET", urls, body)
7337	if err != nil {
7338		return nil, err
7339	}
7340	req.Header = reqHeaders
7341	googleapi.Expand(req.URL, map[string]string{
7342		"userId":    c.userId,
7343		"messageId": c.messageId,
7344		"id":        c.id,
7345	})
7346	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7347}
7348
7349// Do executes the "gmail.users.messages.attachments.get" call.
7350// Exactly one of *MessagePartBody or error will be non-nil. Any non-2xx
7351// status code is an error. Response headers are in either
7352// *MessagePartBody.ServerResponse.Header or (if a response was returned
7353// at all) in error.(*googleapi.Error).Header. Use
7354// googleapi.IsNotModified to check whether the returned error was
7355// because http.StatusNotModified was returned.
7356func (c *UsersMessagesAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*MessagePartBody, error) {
7357	gensupport.SetOptions(c.urlParams_, opts...)
7358	res, err := c.doRequest("json")
7359	if res != nil && res.StatusCode == http.StatusNotModified {
7360		if res.Body != nil {
7361			res.Body.Close()
7362		}
7363		return nil, &googleapi.Error{
7364			Code:   res.StatusCode,
7365			Header: res.Header,
7366		}
7367	}
7368	if err != nil {
7369		return nil, err
7370	}
7371	defer googleapi.CloseBody(res)
7372	if err := googleapi.CheckResponse(res); err != nil {
7373		return nil, err
7374	}
7375	ret := &MessagePartBody{
7376		ServerResponse: googleapi.ServerResponse{
7377			Header:         res.Header,
7378			HTTPStatusCode: res.StatusCode,
7379		},
7380	}
7381	target := &ret
7382	if err := gensupport.DecodeResponse(target, res); err != nil {
7383		return nil, err
7384	}
7385	return ret, nil
7386	// {
7387	//   "description": "Gets the specified message attachment.",
7388	//   "flatPath": "gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}",
7389	//   "httpMethod": "GET",
7390	//   "id": "gmail.users.messages.attachments.get",
7391	//   "parameterOrder": [
7392	//     "userId",
7393	//     "messageId",
7394	//     "id"
7395	//   ],
7396	//   "parameters": {
7397	//     "id": {
7398	//       "description": "The ID of the attachment.",
7399	//       "location": "path",
7400	//       "required": true,
7401	//       "type": "string"
7402	//     },
7403	//     "messageId": {
7404	//       "description": "The ID of the message containing the attachment.",
7405	//       "location": "path",
7406	//       "required": true,
7407	//       "type": "string"
7408	//     },
7409	//     "userId": {
7410	//       "default": "me",
7411	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
7412	//       "location": "path",
7413	//       "required": true,
7414	//       "type": "string"
7415	//     }
7416	//   },
7417	//   "path": "gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}",
7418	//   "response": {
7419	//     "$ref": "MessagePartBody"
7420	//   },
7421	//   "scopes": [
7422	//     "https://mail.google.com/",
7423	//     "https://www.googleapis.com/auth/gmail.addons.current.message.action",
7424	//     "https://www.googleapis.com/auth/gmail.addons.current.message.readonly",
7425	//     "https://www.googleapis.com/auth/gmail.modify",
7426	//     "https://www.googleapis.com/auth/gmail.readonly"
7427	//   ]
7428	// }
7429
7430}
7431
7432// method id "gmail.users.settings.getAutoForwarding":
7433
7434type UsersSettingsGetAutoForwardingCall struct {
7435	s            *Service
7436	userId       string
7437	urlParams_   gensupport.URLParams
7438	ifNoneMatch_ string
7439	ctx_         context.Context
7440	header_      http.Header
7441}
7442
7443// GetAutoForwarding: Gets the auto-forwarding setting for the specified
7444// account.
7445func (r *UsersSettingsService) GetAutoForwarding(userId string) *UsersSettingsGetAutoForwardingCall {
7446	c := &UsersSettingsGetAutoForwardingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7447	c.userId = userId
7448	return c
7449}
7450
7451// Fields allows partial responses to be retrieved. See
7452// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7453// for more information.
7454func (c *UsersSettingsGetAutoForwardingCall) Fields(s ...googleapi.Field) *UsersSettingsGetAutoForwardingCall {
7455	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7456	return c
7457}
7458
7459// IfNoneMatch sets the optional parameter which makes the operation
7460// fail if the object's ETag matches the given value. This is useful for
7461// getting updates only after the object has changed since the last
7462// request. Use googleapi.IsNotModified to check whether the response
7463// error from Do is the result of In-None-Match.
7464func (c *UsersSettingsGetAutoForwardingCall) IfNoneMatch(entityTag string) *UsersSettingsGetAutoForwardingCall {
7465	c.ifNoneMatch_ = entityTag
7466	return c
7467}
7468
7469// Context sets the context to be used in this call's Do method. Any
7470// pending HTTP request will be aborted if the provided context is
7471// canceled.
7472func (c *UsersSettingsGetAutoForwardingCall) Context(ctx context.Context) *UsersSettingsGetAutoForwardingCall {
7473	c.ctx_ = ctx
7474	return c
7475}
7476
7477// Header returns an http.Header that can be modified by the caller to
7478// add HTTP headers to the request.
7479func (c *UsersSettingsGetAutoForwardingCall) Header() http.Header {
7480	if c.header_ == nil {
7481		c.header_ = make(http.Header)
7482	}
7483	return c.header_
7484}
7485
7486func (c *UsersSettingsGetAutoForwardingCall) doRequest(alt string) (*http.Response, error) {
7487	reqHeaders := make(http.Header)
7488	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
7489	for k, v := range c.header_ {
7490		reqHeaders[k] = v
7491	}
7492	reqHeaders.Set("User-Agent", c.s.userAgent())
7493	if c.ifNoneMatch_ != "" {
7494		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7495	}
7496	var body io.Reader = nil
7497	c.urlParams_.Set("alt", alt)
7498	c.urlParams_.Set("prettyPrint", "false")
7499	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/autoForwarding")
7500	urls += "?" + c.urlParams_.Encode()
7501	req, err := http.NewRequest("GET", urls, body)
7502	if err != nil {
7503		return nil, err
7504	}
7505	req.Header = reqHeaders
7506	googleapi.Expand(req.URL, map[string]string{
7507		"userId": c.userId,
7508	})
7509	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7510}
7511
7512// Do executes the "gmail.users.settings.getAutoForwarding" call.
7513// Exactly one of *AutoForwarding or error will be non-nil. Any non-2xx
7514// status code is an error. Response headers are in either
7515// *AutoForwarding.ServerResponse.Header or (if a response was returned
7516// at all) in error.(*googleapi.Error).Header. Use
7517// googleapi.IsNotModified to check whether the returned error was
7518// because http.StatusNotModified was returned.
7519func (c *UsersSettingsGetAutoForwardingCall) Do(opts ...googleapi.CallOption) (*AutoForwarding, error) {
7520	gensupport.SetOptions(c.urlParams_, opts...)
7521	res, err := c.doRequest("json")
7522	if res != nil && res.StatusCode == http.StatusNotModified {
7523		if res.Body != nil {
7524			res.Body.Close()
7525		}
7526		return nil, &googleapi.Error{
7527			Code:   res.StatusCode,
7528			Header: res.Header,
7529		}
7530	}
7531	if err != nil {
7532		return nil, err
7533	}
7534	defer googleapi.CloseBody(res)
7535	if err := googleapi.CheckResponse(res); err != nil {
7536		return nil, err
7537	}
7538	ret := &AutoForwarding{
7539		ServerResponse: googleapi.ServerResponse{
7540			Header:         res.Header,
7541			HTTPStatusCode: res.StatusCode,
7542		},
7543	}
7544	target := &ret
7545	if err := gensupport.DecodeResponse(target, res); err != nil {
7546		return nil, err
7547	}
7548	return ret, nil
7549	// {
7550	//   "description": "Gets the auto-forwarding setting for the specified account.",
7551	//   "flatPath": "gmail/v1/users/{userId}/settings/autoForwarding",
7552	//   "httpMethod": "GET",
7553	//   "id": "gmail.users.settings.getAutoForwarding",
7554	//   "parameterOrder": [
7555	//     "userId"
7556	//   ],
7557	//   "parameters": {
7558	//     "userId": {
7559	//       "default": "me",
7560	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
7561	//       "location": "path",
7562	//       "required": true,
7563	//       "type": "string"
7564	//     }
7565	//   },
7566	//   "path": "gmail/v1/users/{userId}/settings/autoForwarding",
7567	//   "response": {
7568	//     "$ref": "AutoForwarding"
7569	//   },
7570	//   "scopes": [
7571	//     "https://mail.google.com/",
7572	//     "https://www.googleapis.com/auth/gmail.modify",
7573	//     "https://www.googleapis.com/auth/gmail.readonly",
7574	//     "https://www.googleapis.com/auth/gmail.settings.basic"
7575	//   ]
7576	// }
7577
7578}
7579
7580// method id "gmail.users.settings.getImap":
7581
7582type UsersSettingsGetImapCall struct {
7583	s            *Service
7584	userId       string
7585	urlParams_   gensupport.URLParams
7586	ifNoneMatch_ string
7587	ctx_         context.Context
7588	header_      http.Header
7589}
7590
7591// GetImap: Gets IMAP settings.
7592func (r *UsersSettingsService) GetImap(userId string) *UsersSettingsGetImapCall {
7593	c := &UsersSettingsGetImapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7594	c.userId = userId
7595	return c
7596}
7597
7598// Fields allows partial responses to be retrieved. See
7599// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7600// for more information.
7601func (c *UsersSettingsGetImapCall) Fields(s ...googleapi.Field) *UsersSettingsGetImapCall {
7602	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7603	return c
7604}
7605
7606// IfNoneMatch sets the optional parameter which makes the operation
7607// fail if the object's ETag matches the given value. This is useful for
7608// getting updates only after the object has changed since the last
7609// request. Use googleapi.IsNotModified to check whether the response
7610// error from Do is the result of In-None-Match.
7611func (c *UsersSettingsGetImapCall) IfNoneMatch(entityTag string) *UsersSettingsGetImapCall {
7612	c.ifNoneMatch_ = entityTag
7613	return c
7614}
7615
7616// Context sets the context to be used in this call's Do method. Any
7617// pending HTTP request will be aborted if the provided context is
7618// canceled.
7619func (c *UsersSettingsGetImapCall) Context(ctx context.Context) *UsersSettingsGetImapCall {
7620	c.ctx_ = ctx
7621	return c
7622}
7623
7624// Header returns an http.Header that can be modified by the caller to
7625// add HTTP headers to the request.
7626func (c *UsersSettingsGetImapCall) Header() http.Header {
7627	if c.header_ == nil {
7628		c.header_ = make(http.Header)
7629	}
7630	return c.header_
7631}
7632
7633func (c *UsersSettingsGetImapCall) doRequest(alt string) (*http.Response, error) {
7634	reqHeaders := make(http.Header)
7635	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
7636	for k, v := range c.header_ {
7637		reqHeaders[k] = v
7638	}
7639	reqHeaders.Set("User-Agent", c.s.userAgent())
7640	if c.ifNoneMatch_ != "" {
7641		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7642	}
7643	var body io.Reader = nil
7644	c.urlParams_.Set("alt", alt)
7645	c.urlParams_.Set("prettyPrint", "false")
7646	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/imap")
7647	urls += "?" + c.urlParams_.Encode()
7648	req, err := http.NewRequest("GET", urls, body)
7649	if err != nil {
7650		return nil, err
7651	}
7652	req.Header = reqHeaders
7653	googleapi.Expand(req.URL, map[string]string{
7654		"userId": c.userId,
7655	})
7656	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7657}
7658
7659// Do executes the "gmail.users.settings.getImap" call.
7660// Exactly one of *ImapSettings or error will be non-nil. Any non-2xx
7661// status code is an error. Response headers are in either
7662// *ImapSettings.ServerResponse.Header or (if a response was returned at
7663// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7664// to check whether the returned error was because
7665// http.StatusNotModified was returned.
7666func (c *UsersSettingsGetImapCall) Do(opts ...googleapi.CallOption) (*ImapSettings, error) {
7667	gensupport.SetOptions(c.urlParams_, opts...)
7668	res, err := c.doRequest("json")
7669	if res != nil && res.StatusCode == http.StatusNotModified {
7670		if res.Body != nil {
7671			res.Body.Close()
7672		}
7673		return nil, &googleapi.Error{
7674			Code:   res.StatusCode,
7675			Header: res.Header,
7676		}
7677	}
7678	if err != nil {
7679		return nil, err
7680	}
7681	defer googleapi.CloseBody(res)
7682	if err := googleapi.CheckResponse(res); err != nil {
7683		return nil, err
7684	}
7685	ret := &ImapSettings{
7686		ServerResponse: googleapi.ServerResponse{
7687			Header:         res.Header,
7688			HTTPStatusCode: res.StatusCode,
7689		},
7690	}
7691	target := &ret
7692	if err := gensupport.DecodeResponse(target, res); err != nil {
7693		return nil, err
7694	}
7695	return ret, nil
7696	// {
7697	//   "description": "Gets IMAP settings.",
7698	//   "flatPath": "gmail/v1/users/{userId}/settings/imap",
7699	//   "httpMethod": "GET",
7700	//   "id": "gmail.users.settings.getImap",
7701	//   "parameterOrder": [
7702	//     "userId"
7703	//   ],
7704	//   "parameters": {
7705	//     "userId": {
7706	//       "default": "me",
7707	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
7708	//       "location": "path",
7709	//       "required": true,
7710	//       "type": "string"
7711	//     }
7712	//   },
7713	//   "path": "gmail/v1/users/{userId}/settings/imap",
7714	//   "response": {
7715	//     "$ref": "ImapSettings"
7716	//   },
7717	//   "scopes": [
7718	//     "https://mail.google.com/",
7719	//     "https://www.googleapis.com/auth/gmail.modify",
7720	//     "https://www.googleapis.com/auth/gmail.readonly",
7721	//     "https://www.googleapis.com/auth/gmail.settings.basic"
7722	//   ]
7723	// }
7724
7725}
7726
7727// method id "gmail.users.settings.getLanguage":
7728
7729type UsersSettingsGetLanguageCall struct {
7730	s            *Service
7731	userId       string
7732	urlParams_   gensupport.URLParams
7733	ifNoneMatch_ string
7734	ctx_         context.Context
7735	header_      http.Header
7736}
7737
7738// GetLanguage: Gets language settings.
7739func (r *UsersSettingsService) GetLanguage(userId string) *UsersSettingsGetLanguageCall {
7740	c := &UsersSettingsGetLanguageCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7741	c.userId = userId
7742	return c
7743}
7744
7745// Fields allows partial responses to be retrieved. See
7746// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7747// for more information.
7748func (c *UsersSettingsGetLanguageCall) Fields(s ...googleapi.Field) *UsersSettingsGetLanguageCall {
7749	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7750	return c
7751}
7752
7753// IfNoneMatch sets the optional parameter which makes the operation
7754// fail if the object's ETag matches the given value. This is useful for
7755// getting updates only after the object has changed since the last
7756// request. Use googleapi.IsNotModified to check whether the response
7757// error from Do is the result of In-None-Match.
7758func (c *UsersSettingsGetLanguageCall) IfNoneMatch(entityTag string) *UsersSettingsGetLanguageCall {
7759	c.ifNoneMatch_ = entityTag
7760	return c
7761}
7762
7763// Context sets the context to be used in this call's Do method. Any
7764// pending HTTP request will be aborted if the provided context is
7765// canceled.
7766func (c *UsersSettingsGetLanguageCall) Context(ctx context.Context) *UsersSettingsGetLanguageCall {
7767	c.ctx_ = ctx
7768	return c
7769}
7770
7771// Header returns an http.Header that can be modified by the caller to
7772// add HTTP headers to the request.
7773func (c *UsersSettingsGetLanguageCall) Header() http.Header {
7774	if c.header_ == nil {
7775		c.header_ = make(http.Header)
7776	}
7777	return c.header_
7778}
7779
7780func (c *UsersSettingsGetLanguageCall) doRequest(alt string) (*http.Response, error) {
7781	reqHeaders := make(http.Header)
7782	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
7783	for k, v := range c.header_ {
7784		reqHeaders[k] = v
7785	}
7786	reqHeaders.Set("User-Agent", c.s.userAgent())
7787	if c.ifNoneMatch_ != "" {
7788		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7789	}
7790	var body io.Reader = nil
7791	c.urlParams_.Set("alt", alt)
7792	c.urlParams_.Set("prettyPrint", "false")
7793	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/language")
7794	urls += "?" + c.urlParams_.Encode()
7795	req, err := http.NewRequest("GET", urls, body)
7796	if err != nil {
7797		return nil, err
7798	}
7799	req.Header = reqHeaders
7800	googleapi.Expand(req.URL, map[string]string{
7801		"userId": c.userId,
7802	})
7803	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7804}
7805
7806// Do executes the "gmail.users.settings.getLanguage" call.
7807// Exactly one of *LanguageSettings or error will be non-nil. Any
7808// non-2xx status code is an error. Response headers are in either
7809// *LanguageSettings.ServerResponse.Header or (if a response was
7810// returned at all) in error.(*googleapi.Error).Header. Use
7811// googleapi.IsNotModified to check whether the returned error was
7812// because http.StatusNotModified was returned.
7813func (c *UsersSettingsGetLanguageCall) Do(opts ...googleapi.CallOption) (*LanguageSettings, error) {
7814	gensupport.SetOptions(c.urlParams_, opts...)
7815	res, err := c.doRequest("json")
7816	if res != nil && res.StatusCode == http.StatusNotModified {
7817		if res.Body != nil {
7818			res.Body.Close()
7819		}
7820		return nil, &googleapi.Error{
7821			Code:   res.StatusCode,
7822			Header: res.Header,
7823		}
7824	}
7825	if err != nil {
7826		return nil, err
7827	}
7828	defer googleapi.CloseBody(res)
7829	if err := googleapi.CheckResponse(res); err != nil {
7830		return nil, err
7831	}
7832	ret := &LanguageSettings{
7833		ServerResponse: googleapi.ServerResponse{
7834			Header:         res.Header,
7835			HTTPStatusCode: res.StatusCode,
7836		},
7837	}
7838	target := &ret
7839	if err := gensupport.DecodeResponse(target, res); err != nil {
7840		return nil, err
7841	}
7842	return ret, nil
7843	// {
7844	//   "description": "Gets language settings.",
7845	//   "flatPath": "gmail/v1/users/{userId}/settings/language",
7846	//   "httpMethod": "GET",
7847	//   "id": "gmail.users.settings.getLanguage",
7848	//   "parameterOrder": [
7849	//     "userId"
7850	//   ],
7851	//   "parameters": {
7852	//     "userId": {
7853	//       "default": "me",
7854	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
7855	//       "location": "path",
7856	//       "required": true,
7857	//       "type": "string"
7858	//     }
7859	//   },
7860	//   "path": "gmail/v1/users/{userId}/settings/language",
7861	//   "response": {
7862	//     "$ref": "LanguageSettings"
7863	//   },
7864	//   "scopes": [
7865	//     "https://mail.google.com/",
7866	//     "https://www.googleapis.com/auth/gmail.modify",
7867	//     "https://www.googleapis.com/auth/gmail.readonly",
7868	//     "https://www.googleapis.com/auth/gmail.settings.basic"
7869	//   ]
7870	// }
7871
7872}
7873
7874// method id "gmail.users.settings.getPop":
7875
7876type UsersSettingsGetPopCall struct {
7877	s            *Service
7878	userId       string
7879	urlParams_   gensupport.URLParams
7880	ifNoneMatch_ string
7881	ctx_         context.Context
7882	header_      http.Header
7883}
7884
7885// GetPop: Gets POP settings.
7886func (r *UsersSettingsService) GetPop(userId string) *UsersSettingsGetPopCall {
7887	c := &UsersSettingsGetPopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7888	c.userId = userId
7889	return c
7890}
7891
7892// Fields allows partial responses to be retrieved. See
7893// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7894// for more information.
7895func (c *UsersSettingsGetPopCall) Fields(s ...googleapi.Field) *UsersSettingsGetPopCall {
7896	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7897	return c
7898}
7899
7900// IfNoneMatch sets the optional parameter which makes the operation
7901// fail if the object's ETag matches the given value. This is useful for
7902// getting updates only after the object has changed since the last
7903// request. Use googleapi.IsNotModified to check whether the response
7904// error from Do is the result of In-None-Match.
7905func (c *UsersSettingsGetPopCall) IfNoneMatch(entityTag string) *UsersSettingsGetPopCall {
7906	c.ifNoneMatch_ = entityTag
7907	return c
7908}
7909
7910// Context sets the context to be used in this call's Do method. Any
7911// pending HTTP request will be aborted if the provided context is
7912// canceled.
7913func (c *UsersSettingsGetPopCall) Context(ctx context.Context) *UsersSettingsGetPopCall {
7914	c.ctx_ = ctx
7915	return c
7916}
7917
7918// Header returns an http.Header that can be modified by the caller to
7919// add HTTP headers to the request.
7920func (c *UsersSettingsGetPopCall) Header() http.Header {
7921	if c.header_ == nil {
7922		c.header_ = make(http.Header)
7923	}
7924	return c.header_
7925}
7926
7927func (c *UsersSettingsGetPopCall) doRequest(alt string) (*http.Response, error) {
7928	reqHeaders := make(http.Header)
7929	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
7930	for k, v := range c.header_ {
7931		reqHeaders[k] = v
7932	}
7933	reqHeaders.Set("User-Agent", c.s.userAgent())
7934	if c.ifNoneMatch_ != "" {
7935		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7936	}
7937	var body io.Reader = nil
7938	c.urlParams_.Set("alt", alt)
7939	c.urlParams_.Set("prettyPrint", "false")
7940	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/pop")
7941	urls += "?" + c.urlParams_.Encode()
7942	req, err := http.NewRequest("GET", urls, body)
7943	if err != nil {
7944		return nil, err
7945	}
7946	req.Header = reqHeaders
7947	googleapi.Expand(req.URL, map[string]string{
7948		"userId": c.userId,
7949	})
7950	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7951}
7952
7953// Do executes the "gmail.users.settings.getPop" call.
7954// Exactly one of *PopSettings or error will be non-nil. Any non-2xx
7955// status code is an error. Response headers are in either
7956// *PopSettings.ServerResponse.Header or (if a response was returned at
7957// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7958// to check whether the returned error was because
7959// http.StatusNotModified was returned.
7960func (c *UsersSettingsGetPopCall) Do(opts ...googleapi.CallOption) (*PopSettings, error) {
7961	gensupport.SetOptions(c.urlParams_, opts...)
7962	res, err := c.doRequest("json")
7963	if res != nil && res.StatusCode == http.StatusNotModified {
7964		if res.Body != nil {
7965			res.Body.Close()
7966		}
7967		return nil, &googleapi.Error{
7968			Code:   res.StatusCode,
7969			Header: res.Header,
7970		}
7971	}
7972	if err != nil {
7973		return nil, err
7974	}
7975	defer googleapi.CloseBody(res)
7976	if err := googleapi.CheckResponse(res); err != nil {
7977		return nil, err
7978	}
7979	ret := &PopSettings{
7980		ServerResponse: googleapi.ServerResponse{
7981			Header:         res.Header,
7982			HTTPStatusCode: res.StatusCode,
7983		},
7984	}
7985	target := &ret
7986	if err := gensupport.DecodeResponse(target, res); err != nil {
7987		return nil, err
7988	}
7989	return ret, nil
7990	// {
7991	//   "description": "Gets POP settings.",
7992	//   "flatPath": "gmail/v1/users/{userId}/settings/pop",
7993	//   "httpMethod": "GET",
7994	//   "id": "gmail.users.settings.getPop",
7995	//   "parameterOrder": [
7996	//     "userId"
7997	//   ],
7998	//   "parameters": {
7999	//     "userId": {
8000	//       "default": "me",
8001	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
8002	//       "location": "path",
8003	//       "required": true,
8004	//       "type": "string"
8005	//     }
8006	//   },
8007	//   "path": "gmail/v1/users/{userId}/settings/pop",
8008	//   "response": {
8009	//     "$ref": "PopSettings"
8010	//   },
8011	//   "scopes": [
8012	//     "https://mail.google.com/",
8013	//     "https://www.googleapis.com/auth/gmail.modify",
8014	//     "https://www.googleapis.com/auth/gmail.readonly",
8015	//     "https://www.googleapis.com/auth/gmail.settings.basic"
8016	//   ]
8017	// }
8018
8019}
8020
8021// method id "gmail.users.settings.getVacation":
8022
8023type UsersSettingsGetVacationCall struct {
8024	s            *Service
8025	userId       string
8026	urlParams_   gensupport.URLParams
8027	ifNoneMatch_ string
8028	ctx_         context.Context
8029	header_      http.Header
8030}
8031
8032// GetVacation: Gets vacation responder settings.
8033func (r *UsersSettingsService) GetVacation(userId string) *UsersSettingsGetVacationCall {
8034	c := &UsersSettingsGetVacationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8035	c.userId = userId
8036	return c
8037}
8038
8039// Fields allows partial responses to be retrieved. See
8040// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8041// for more information.
8042func (c *UsersSettingsGetVacationCall) Fields(s ...googleapi.Field) *UsersSettingsGetVacationCall {
8043	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8044	return c
8045}
8046
8047// IfNoneMatch sets the optional parameter which makes the operation
8048// fail if the object's ETag matches the given value. This is useful for
8049// getting updates only after the object has changed since the last
8050// request. Use googleapi.IsNotModified to check whether the response
8051// error from Do is the result of In-None-Match.
8052func (c *UsersSettingsGetVacationCall) IfNoneMatch(entityTag string) *UsersSettingsGetVacationCall {
8053	c.ifNoneMatch_ = entityTag
8054	return c
8055}
8056
8057// Context sets the context to be used in this call's Do method. Any
8058// pending HTTP request will be aborted if the provided context is
8059// canceled.
8060func (c *UsersSettingsGetVacationCall) Context(ctx context.Context) *UsersSettingsGetVacationCall {
8061	c.ctx_ = ctx
8062	return c
8063}
8064
8065// Header returns an http.Header that can be modified by the caller to
8066// add HTTP headers to the request.
8067func (c *UsersSettingsGetVacationCall) Header() http.Header {
8068	if c.header_ == nil {
8069		c.header_ = make(http.Header)
8070	}
8071	return c.header_
8072}
8073
8074func (c *UsersSettingsGetVacationCall) doRequest(alt string) (*http.Response, error) {
8075	reqHeaders := make(http.Header)
8076	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
8077	for k, v := range c.header_ {
8078		reqHeaders[k] = v
8079	}
8080	reqHeaders.Set("User-Agent", c.s.userAgent())
8081	if c.ifNoneMatch_ != "" {
8082		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8083	}
8084	var body io.Reader = nil
8085	c.urlParams_.Set("alt", alt)
8086	c.urlParams_.Set("prettyPrint", "false")
8087	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/vacation")
8088	urls += "?" + c.urlParams_.Encode()
8089	req, err := http.NewRequest("GET", urls, body)
8090	if err != nil {
8091		return nil, err
8092	}
8093	req.Header = reqHeaders
8094	googleapi.Expand(req.URL, map[string]string{
8095		"userId": c.userId,
8096	})
8097	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8098}
8099
8100// Do executes the "gmail.users.settings.getVacation" call.
8101// Exactly one of *VacationSettings or error will be non-nil. Any
8102// non-2xx status code is an error. Response headers are in either
8103// *VacationSettings.ServerResponse.Header or (if a response was
8104// returned at all) in error.(*googleapi.Error).Header. Use
8105// googleapi.IsNotModified to check whether the returned error was
8106// because http.StatusNotModified was returned.
8107func (c *UsersSettingsGetVacationCall) Do(opts ...googleapi.CallOption) (*VacationSettings, error) {
8108	gensupport.SetOptions(c.urlParams_, opts...)
8109	res, err := c.doRequest("json")
8110	if res != nil && res.StatusCode == http.StatusNotModified {
8111		if res.Body != nil {
8112			res.Body.Close()
8113		}
8114		return nil, &googleapi.Error{
8115			Code:   res.StatusCode,
8116			Header: res.Header,
8117		}
8118	}
8119	if err != nil {
8120		return nil, err
8121	}
8122	defer googleapi.CloseBody(res)
8123	if err := googleapi.CheckResponse(res); err != nil {
8124		return nil, err
8125	}
8126	ret := &VacationSettings{
8127		ServerResponse: googleapi.ServerResponse{
8128			Header:         res.Header,
8129			HTTPStatusCode: res.StatusCode,
8130		},
8131	}
8132	target := &ret
8133	if err := gensupport.DecodeResponse(target, res); err != nil {
8134		return nil, err
8135	}
8136	return ret, nil
8137	// {
8138	//   "description": "Gets vacation responder settings.",
8139	//   "flatPath": "gmail/v1/users/{userId}/settings/vacation",
8140	//   "httpMethod": "GET",
8141	//   "id": "gmail.users.settings.getVacation",
8142	//   "parameterOrder": [
8143	//     "userId"
8144	//   ],
8145	//   "parameters": {
8146	//     "userId": {
8147	//       "default": "me",
8148	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
8149	//       "location": "path",
8150	//       "required": true,
8151	//       "type": "string"
8152	//     }
8153	//   },
8154	//   "path": "gmail/v1/users/{userId}/settings/vacation",
8155	//   "response": {
8156	//     "$ref": "VacationSettings"
8157	//   },
8158	//   "scopes": [
8159	//     "https://mail.google.com/",
8160	//     "https://www.googleapis.com/auth/gmail.modify",
8161	//     "https://www.googleapis.com/auth/gmail.readonly",
8162	//     "https://www.googleapis.com/auth/gmail.settings.basic"
8163	//   ]
8164	// }
8165
8166}
8167
8168// method id "gmail.users.settings.updateAutoForwarding":
8169
8170type UsersSettingsUpdateAutoForwardingCall struct {
8171	s              *Service
8172	userId         string
8173	autoforwarding *AutoForwarding
8174	urlParams_     gensupport.URLParams
8175	ctx_           context.Context
8176	header_        http.Header
8177}
8178
8179// UpdateAutoForwarding: Updates the auto-forwarding setting for the
8180// specified account.  A verified
8181// forwarding address must be specified when auto-forwarding is
8182// enabled.
8183//
8184// This method is only available to service account clients that have
8185// been
8186// delegated domain-wide authority.
8187func (r *UsersSettingsService) UpdateAutoForwarding(userId string, autoforwarding *AutoForwarding) *UsersSettingsUpdateAutoForwardingCall {
8188	c := &UsersSettingsUpdateAutoForwardingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8189	c.userId = userId
8190	c.autoforwarding = autoforwarding
8191	return c
8192}
8193
8194// Fields allows partial responses to be retrieved. See
8195// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8196// for more information.
8197func (c *UsersSettingsUpdateAutoForwardingCall) Fields(s ...googleapi.Field) *UsersSettingsUpdateAutoForwardingCall {
8198	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8199	return c
8200}
8201
8202// Context sets the context to be used in this call's Do method. Any
8203// pending HTTP request will be aborted if the provided context is
8204// canceled.
8205func (c *UsersSettingsUpdateAutoForwardingCall) Context(ctx context.Context) *UsersSettingsUpdateAutoForwardingCall {
8206	c.ctx_ = ctx
8207	return c
8208}
8209
8210// Header returns an http.Header that can be modified by the caller to
8211// add HTTP headers to the request.
8212func (c *UsersSettingsUpdateAutoForwardingCall) Header() http.Header {
8213	if c.header_ == nil {
8214		c.header_ = make(http.Header)
8215	}
8216	return c.header_
8217}
8218
8219func (c *UsersSettingsUpdateAutoForwardingCall) doRequest(alt string) (*http.Response, error) {
8220	reqHeaders := make(http.Header)
8221	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
8222	for k, v := range c.header_ {
8223		reqHeaders[k] = v
8224	}
8225	reqHeaders.Set("User-Agent", c.s.userAgent())
8226	var body io.Reader = nil
8227	body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoforwarding)
8228	if err != nil {
8229		return nil, err
8230	}
8231	reqHeaders.Set("Content-Type", "application/json")
8232	c.urlParams_.Set("alt", alt)
8233	c.urlParams_.Set("prettyPrint", "false")
8234	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/autoForwarding")
8235	urls += "?" + c.urlParams_.Encode()
8236	req, err := http.NewRequest("PUT", urls, body)
8237	if err != nil {
8238		return nil, err
8239	}
8240	req.Header = reqHeaders
8241	googleapi.Expand(req.URL, map[string]string{
8242		"userId": c.userId,
8243	})
8244	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8245}
8246
8247// Do executes the "gmail.users.settings.updateAutoForwarding" call.
8248// Exactly one of *AutoForwarding or error will be non-nil. Any non-2xx
8249// status code is an error. Response headers are in either
8250// *AutoForwarding.ServerResponse.Header or (if a response was returned
8251// at all) in error.(*googleapi.Error).Header. Use
8252// googleapi.IsNotModified to check whether the returned error was
8253// because http.StatusNotModified was returned.
8254func (c *UsersSettingsUpdateAutoForwardingCall) Do(opts ...googleapi.CallOption) (*AutoForwarding, error) {
8255	gensupport.SetOptions(c.urlParams_, opts...)
8256	res, err := c.doRequest("json")
8257	if res != nil && res.StatusCode == http.StatusNotModified {
8258		if res.Body != nil {
8259			res.Body.Close()
8260		}
8261		return nil, &googleapi.Error{
8262			Code:   res.StatusCode,
8263			Header: res.Header,
8264		}
8265	}
8266	if err != nil {
8267		return nil, err
8268	}
8269	defer googleapi.CloseBody(res)
8270	if err := googleapi.CheckResponse(res); err != nil {
8271		return nil, err
8272	}
8273	ret := &AutoForwarding{
8274		ServerResponse: googleapi.ServerResponse{
8275			Header:         res.Header,
8276			HTTPStatusCode: res.StatusCode,
8277		},
8278	}
8279	target := &ret
8280	if err := gensupport.DecodeResponse(target, res); err != nil {
8281		return nil, err
8282	}
8283	return ret, nil
8284	// {
8285	//   "description": "Updates the auto-forwarding setting for the specified account.  A verified\nforwarding address must be specified when auto-forwarding is enabled.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
8286	//   "flatPath": "gmail/v1/users/{userId}/settings/autoForwarding",
8287	//   "httpMethod": "PUT",
8288	//   "id": "gmail.users.settings.updateAutoForwarding",
8289	//   "parameterOrder": [
8290	//     "userId"
8291	//   ],
8292	//   "parameters": {
8293	//     "userId": {
8294	//       "default": "me",
8295	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
8296	//       "location": "path",
8297	//       "required": true,
8298	//       "type": "string"
8299	//     }
8300	//   },
8301	//   "path": "gmail/v1/users/{userId}/settings/autoForwarding",
8302	//   "request": {
8303	//     "$ref": "AutoForwarding"
8304	//   },
8305	//   "response": {
8306	//     "$ref": "AutoForwarding"
8307	//   },
8308	//   "scopes": [
8309	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
8310	//   ]
8311	// }
8312
8313}
8314
8315// method id "gmail.users.settings.updateImap":
8316
8317type UsersSettingsUpdateImapCall struct {
8318	s            *Service
8319	userId       string
8320	imapsettings *ImapSettings
8321	urlParams_   gensupport.URLParams
8322	ctx_         context.Context
8323	header_      http.Header
8324}
8325
8326// UpdateImap: Updates IMAP settings.
8327func (r *UsersSettingsService) UpdateImap(userId string, imapsettings *ImapSettings) *UsersSettingsUpdateImapCall {
8328	c := &UsersSettingsUpdateImapCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8329	c.userId = userId
8330	c.imapsettings = imapsettings
8331	return c
8332}
8333
8334// Fields allows partial responses to be retrieved. See
8335// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8336// for more information.
8337func (c *UsersSettingsUpdateImapCall) Fields(s ...googleapi.Field) *UsersSettingsUpdateImapCall {
8338	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8339	return c
8340}
8341
8342// Context sets the context to be used in this call's Do method. Any
8343// pending HTTP request will be aborted if the provided context is
8344// canceled.
8345func (c *UsersSettingsUpdateImapCall) Context(ctx context.Context) *UsersSettingsUpdateImapCall {
8346	c.ctx_ = ctx
8347	return c
8348}
8349
8350// Header returns an http.Header that can be modified by the caller to
8351// add HTTP headers to the request.
8352func (c *UsersSettingsUpdateImapCall) Header() http.Header {
8353	if c.header_ == nil {
8354		c.header_ = make(http.Header)
8355	}
8356	return c.header_
8357}
8358
8359func (c *UsersSettingsUpdateImapCall) doRequest(alt string) (*http.Response, error) {
8360	reqHeaders := make(http.Header)
8361	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
8362	for k, v := range c.header_ {
8363		reqHeaders[k] = v
8364	}
8365	reqHeaders.Set("User-Agent", c.s.userAgent())
8366	var body io.Reader = nil
8367	body, err := googleapi.WithoutDataWrapper.JSONReader(c.imapsettings)
8368	if err != nil {
8369		return nil, err
8370	}
8371	reqHeaders.Set("Content-Type", "application/json")
8372	c.urlParams_.Set("alt", alt)
8373	c.urlParams_.Set("prettyPrint", "false")
8374	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/imap")
8375	urls += "?" + c.urlParams_.Encode()
8376	req, err := http.NewRequest("PUT", urls, body)
8377	if err != nil {
8378		return nil, err
8379	}
8380	req.Header = reqHeaders
8381	googleapi.Expand(req.URL, map[string]string{
8382		"userId": c.userId,
8383	})
8384	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8385}
8386
8387// Do executes the "gmail.users.settings.updateImap" call.
8388// Exactly one of *ImapSettings or error will be non-nil. Any non-2xx
8389// status code is an error. Response headers are in either
8390// *ImapSettings.ServerResponse.Header or (if a response was returned at
8391// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8392// to check whether the returned error was because
8393// http.StatusNotModified was returned.
8394func (c *UsersSettingsUpdateImapCall) Do(opts ...googleapi.CallOption) (*ImapSettings, error) {
8395	gensupport.SetOptions(c.urlParams_, opts...)
8396	res, err := c.doRequest("json")
8397	if res != nil && res.StatusCode == http.StatusNotModified {
8398		if res.Body != nil {
8399			res.Body.Close()
8400		}
8401		return nil, &googleapi.Error{
8402			Code:   res.StatusCode,
8403			Header: res.Header,
8404		}
8405	}
8406	if err != nil {
8407		return nil, err
8408	}
8409	defer googleapi.CloseBody(res)
8410	if err := googleapi.CheckResponse(res); err != nil {
8411		return nil, err
8412	}
8413	ret := &ImapSettings{
8414		ServerResponse: googleapi.ServerResponse{
8415			Header:         res.Header,
8416			HTTPStatusCode: res.StatusCode,
8417		},
8418	}
8419	target := &ret
8420	if err := gensupport.DecodeResponse(target, res); err != nil {
8421		return nil, err
8422	}
8423	return ret, nil
8424	// {
8425	//   "description": "Updates IMAP settings.",
8426	//   "flatPath": "gmail/v1/users/{userId}/settings/imap",
8427	//   "httpMethod": "PUT",
8428	//   "id": "gmail.users.settings.updateImap",
8429	//   "parameterOrder": [
8430	//     "userId"
8431	//   ],
8432	//   "parameters": {
8433	//     "userId": {
8434	//       "default": "me",
8435	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
8436	//       "location": "path",
8437	//       "required": true,
8438	//       "type": "string"
8439	//     }
8440	//   },
8441	//   "path": "gmail/v1/users/{userId}/settings/imap",
8442	//   "request": {
8443	//     "$ref": "ImapSettings"
8444	//   },
8445	//   "response": {
8446	//     "$ref": "ImapSettings"
8447	//   },
8448	//   "scopes": [
8449	//     "https://www.googleapis.com/auth/gmail.settings.basic"
8450	//   ]
8451	// }
8452
8453}
8454
8455// method id "gmail.users.settings.updateLanguage":
8456
8457type UsersSettingsUpdateLanguageCall struct {
8458	s                *Service
8459	userId           string
8460	languagesettings *LanguageSettings
8461	urlParams_       gensupport.URLParams
8462	ctx_             context.Context
8463	header_          http.Header
8464}
8465
8466// UpdateLanguage: Updates language settings.
8467//
8468// If successful, the return object contains the
8469// <code>displayLanguage</code>
8470// that was saved for the user, which may differ from the value passed
8471// into
8472// the request. This is because the requested
8473// <code>displayLanguage</code> may
8474// not be directly supported by Gmail but have a close variant that is,
8475// and so
8476// the variant may be chosen and saved instead.
8477func (r *UsersSettingsService) UpdateLanguage(userId string, languagesettings *LanguageSettings) *UsersSettingsUpdateLanguageCall {
8478	c := &UsersSettingsUpdateLanguageCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8479	c.userId = userId
8480	c.languagesettings = languagesettings
8481	return c
8482}
8483
8484// Fields allows partial responses to be retrieved. See
8485// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8486// for more information.
8487func (c *UsersSettingsUpdateLanguageCall) Fields(s ...googleapi.Field) *UsersSettingsUpdateLanguageCall {
8488	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8489	return c
8490}
8491
8492// Context sets the context to be used in this call's Do method. Any
8493// pending HTTP request will be aborted if the provided context is
8494// canceled.
8495func (c *UsersSettingsUpdateLanguageCall) Context(ctx context.Context) *UsersSettingsUpdateLanguageCall {
8496	c.ctx_ = ctx
8497	return c
8498}
8499
8500// Header returns an http.Header that can be modified by the caller to
8501// add HTTP headers to the request.
8502func (c *UsersSettingsUpdateLanguageCall) Header() http.Header {
8503	if c.header_ == nil {
8504		c.header_ = make(http.Header)
8505	}
8506	return c.header_
8507}
8508
8509func (c *UsersSettingsUpdateLanguageCall) doRequest(alt string) (*http.Response, error) {
8510	reqHeaders := make(http.Header)
8511	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
8512	for k, v := range c.header_ {
8513		reqHeaders[k] = v
8514	}
8515	reqHeaders.Set("User-Agent", c.s.userAgent())
8516	var body io.Reader = nil
8517	body, err := googleapi.WithoutDataWrapper.JSONReader(c.languagesettings)
8518	if err != nil {
8519		return nil, err
8520	}
8521	reqHeaders.Set("Content-Type", "application/json")
8522	c.urlParams_.Set("alt", alt)
8523	c.urlParams_.Set("prettyPrint", "false")
8524	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/language")
8525	urls += "?" + c.urlParams_.Encode()
8526	req, err := http.NewRequest("PUT", urls, body)
8527	if err != nil {
8528		return nil, err
8529	}
8530	req.Header = reqHeaders
8531	googleapi.Expand(req.URL, map[string]string{
8532		"userId": c.userId,
8533	})
8534	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8535}
8536
8537// Do executes the "gmail.users.settings.updateLanguage" call.
8538// Exactly one of *LanguageSettings or error will be non-nil. Any
8539// non-2xx status code is an error. Response headers are in either
8540// *LanguageSettings.ServerResponse.Header or (if a response was
8541// returned at all) in error.(*googleapi.Error).Header. Use
8542// googleapi.IsNotModified to check whether the returned error was
8543// because http.StatusNotModified was returned.
8544func (c *UsersSettingsUpdateLanguageCall) Do(opts ...googleapi.CallOption) (*LanguageSettings, error) {
8545	gensupport.SetOptions(c.urlParams_, opts...)
8546	res, err := c.doRequest("json")
8547	if res != nil && res.StatusCode == http.StatusNotModified {
8548		if res.Body != nil {
8549			res.Body.Close()
8550		}
8551		return nil, &googleapi.Error{
8552			Code:   res.StatusCode,
8553			Header: res.Header,
8554		}
8555	}
8556	if err != nil {
8557		return nil, err
8558	}
8559	defer googleapi.CloseBody(res)
8560	if err := googleapi.CheckResponse(res); err != nil {
8561		return nil, err
8562	}
8563	ret := &LanguageSettings{
8564		ServerResponse: googleapi.ServerResponse{
8565			Header:         res.Header,
8566			HTTPStatusCode: res.StatusCode,
8567		},
8568	}
8569	target := &ret
8570	if err := gensupport.DecodeResponse(target, res); err != nil {
8571		return nil, err
8572	}
8573	return ret, nil
8574	// {
8575	//   "description": "Updates language settings.\n\nIf successful, the return object contains the \u003ccode\u003edisplayLanguage\u003c/code\u003e\nthat was saved for the user, which may differ from the value passed into\nthe request. This is because the requested \u003ccode\u003edisplayLanguage\u003c/code\u003e may\nnot be directly supported by Gmail but have a close variant that is, and so\nthe variant may be chosen and saved instead.",
8576	//   "flatPath": "gmail/v1/users/{userId}/settings/language",
8577	//   "httpMethod": "PUT",
8578	//   "id": "gmail.users.settings.updateLanguage",
8579	//   "parameterOrder": [
8580	//     "userId"
8581	//   ],
8582	//   "parameters": {
8583	//     "userId": {
8584	//       "default": "me",
8585	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
8586	//       "location": "path",
8587	//       "required": true,
8588	//       "type": "string"
8589	//     }
8590	//   },
8591	//   "path": "gmail/v1/users/{userId}/settings/language",
8592	//   "request": {
8593	//     "$ref": "LanguageSettings"
8594	//   },
8595	//   "response": {
8596	//     "$ref": "LanguageSettings"
8597	//   },
8598	//   "scopes": [
8599	//     "https://www.googleapis.com/auth/gmail.settings.basic"
8600	//   ]
8601	// }
8602
8603}
8604
8605// method id "gmail.users.settings.updatePop":
8606
8607type UsersSettingsUpdatePopCall struct {
8608	s           *Service
8609	userId      string
8610	popsettings *PopSettings
8611	urlParams_  gensupport.URLParams
8612	ctx_        context.Context
8613	header_     http.Header
8614}
8615
8616// UpdatePop: Updates POP settings.
8617func (r *UsersSettingsService) UpdatePop(userId string, popsettings *PopSettings) *UsersSettingsUpdatePopCall {
8618	c := &UsersSettingsUpdatePopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8619	c.userId = userId
8620	c.popsettings = popsettings
8621	return c
8622}
8623
8624// Fields allows partial responses to be retrieved. See
8625// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8626// for more information.
8627func (c *UsersSettingsUpdatePopCall) Fields(s ...googleapi.Field) *UsersSettingsUpdatePopCall {
8628	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8629	return c
8630}
8631
8632// Context sets the context to be used in this call's Do method. Any
8633// pending HTTP request will be aborted if the provided context is
8634// canceled.
8635func (c *UsersSettingsUpdatePopCall) Context(ctx context.Context) *UsersSettingsUpdatePopCall {
8636	c.ctx_ = ctx
8637	return c
8638}
8639
8640// Header returns an http.Header that can be modified by the caller to
8641// add HTTP headers to the request.
8642func (c *UsersSettingsUpdatePopCall) Header() http.Header {
8643	if c.header_ == nil {
8644		c.header_ = make(http.Header)
8645	}
8646	return c.header_
8647}
8648
8649func (c *UsersSettingsUpdatePopCall) doRequest(alt string) (*http.Response, error) {
8650	reqHeaders := make(http.Header)
8651	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
8652	for k, v := range c.header_ {
8653		reqHeaders[k] = v
8654	}
8655	reqHeaders.Set("User-Agent", c.s.userAgent())
8656	var body io.Reader = nil
8657	body, err := googleapi.WithoutDataWrapper.JSONReader(c.popsettings)
8658	if err != nil {
8659		return nil, err
8660	}
8661	reqHeaders.Set("Content-Type", "application/json")
8662	c.urlParams_.Set("alt", alt)
8663	c.urlParams_.Set("prettyPrint", "false")
8664	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/pop")
8665	urls += "?" + c.urlParams_.Encode()
8666	req, err := http.NewRequest("PUT", urls, body)
8667	if err != nil {
8668		return nil, err
8669	}
8670	req.Header = reqHeaders
8671	googleapi.Expand(req.URL, map[string]string{
8672		"userId": c.userId,
8673	})
8674	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8675}
8676
8677// Do executes the "gmail.users.settings.updatePop" call.
8678// Exactly one of *PopSettings or error will be non-nil. Any non-2xx
8679// status code is an error. Response headers are in either
8680// *PopSettings.ServerResponse.Header or (if a response was returned at
8681// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8682// to check whether the returned error was because
8683// http.StatusNotModified was returned.
8684func (c *UsersSettingsUpdatePopCall) Do(opts ...googleapi.CallOption) (*PopSettings, error) {
8685	gensupport.SetOptions(c.urlParams_, opts...)
8686	res, err := c.doRequest("json")
8687	if res != nil && res.StatusCode == http.StatusNotModified {
8688		if res.Body != nil {
8689			res.Body.Close()
8690		}
8691		return nil, &googleapi.Error{
8692			Code:   res.StatusCode,
8693			Header: res.Header,
8694		}
8695	}
8696	if err != nil {
8697		return nil, err
8698	}
8699	defer googleapi.CloseBody(res)
8700	if err := googleapi.CheckResponse(res); err != nil {
8701		return nil, err
8702	}
8703	ret := &PopSettings{
8704		ServerResponse: googleapi.ServerResponse{
8705			Header:         res.Header,
8706			HTTPStatusCode: res.StatusCode,
8707		},
8708	}
8709	target := &ret
8710	if err := gensupport.DecodeResponse(target, res); err != nil {
8711		return nil, err
8712	}
8713	return ret, nil
8714	// {
8715	//   "description": "Updates POP settings.",
8716	//   "flatPath": "gmail/v1/users/{userId}/settings/pop",
8717	//   "httpMethod": "PUT",
8718	//   "id": "gmail.users.settings.updatePop",
8719	//   "parameterOrder": [
8720	//     "userId"
8721	//   ],
8722	//   "parameters": {
8723	//     "userId": {
8724	//       "default": "me",
8725	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
8726	//       "location": "path",
8727	//       "required": true,
8728	//       "type": "string"
8729	//     }
8730	//   },
8731	//   "path": "gmail/v1/users/{userId}/settings/pop",
8732	//   "request": {
8733	//     "$ref": "PopSettings"
8734	//   },
8735	//   "response": {
8736	//     "$ref": "PopSettings"
8737	//   },
8738	//   "scopes": [
8739	//     "https://www.googleapis.com/auth/gmail.settings.basic"
8740	//   ]
8741	// }
8742
8743}
8744
8745// method id "gmail.users.settings.updateVacation":
8746
8747type UsersSettingsUpdateVacationCall struct {
8748	s                *Service
8749	userId           string
8750	vacationsettings *VacationSettings
8751	urlParams_       gensupport.URLParams
8752	ctx_             context.Context
8753	header_          http.Header
8754}
8755
8756// UpdateVacation: Updates vacation responder settings.
8757func (r *UsersSettingsService) UpdateVacation(userId string, vacationsettings *VacationSettings) *UsersSettingsUpdateVacationCall {
8758	c := &UsersSettingsUpdateVacationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8759	c.userId = userId
8760	c.vacationsettings = vacationsettings
8761	return c
8762}
8763
8764// Fields allows partial responses to be retrieved. See
8765// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8766// for more information.
8767func (c *UsersSettingsUpdateVacationCall) Fields(s ...googleapi.Field) *UsersSettingsUpdateVacationCall {
8768	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8769	return c
8770}
8771
8772// Context sets the context to be used in this call's Do method. Any
8773// pending HTTP request will be aborted if the provided context is
8774// canceled.
8775func (c *UsersSettingsUpdateVacationCall) Context(ctx context.Context) *UsersSettingsUpdateVacationCall {
8776	c.ctx_ = ctx
8777	return c
8778}
8779
8780// Header returns an http.Header that can be modified by the caller to
8781// add HTTP headers to the request.
8782func (c *UsersSettingsUpdateVacationCall) Header() http.Header {
8783	if c.header_ == nil {
8784		c.header_ = make(http.Header)
8785	}
8786	return c.header_
8787}
8788
8789func (c *UsersSettingsUpdateVacationCall) doRequest(alt string) (*http.Response, error) {
8790	reqHeaders := make(http.Header)
8791	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
8792	for k, v := range c.header_ {
8793		reqHeaders[k] = v
8794	}
8795	reqHeaders.Set("User-Agent", c.s.userAgent())
8796	var body io.Reader = nil
8797	body, err := googleapi.WithoutDataWrapper.JSONReader(c.vacationsettings)
8798	if err != nil {
8799		return nil, err
8800	}
8801	reqHeaders.Set("Content-Type", "application/json")
8802	c.urlParams_.Set("alt", alt)
8803	c.urlParams_.Set("prettyPrint", "false")
8804	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/vacation")
8805	urls += "?" + c.urlParams_.Encode()
8806	req, err := http.NewRequest("PUT", urls, body)
8807	if err != nil {
8808		return nil, err
8809	}
8810	req.Header = reqHeaders
8811	googleapi.Expand(req.URL, map[string]string{
8812		"userId": c.userId,
8813	})
8814	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8815}
8816
8817// Do executes the "gmail.users.settings.updateVacation" call.
8818// Exactly one of *VacationSettings or error will be non-nil. Any
8819// non-2xx status code is an error. Response headers are in either
8820// *VacationSettings.ServerResponse.Header or (if a response was
8821// returned at all) in error.(*googleapi.Error).Header. Use
8822// googleapi.IsNotModified to check whether the returned error was
8823// because http.StatusNotModified was returned.
8824func (c *UsersSettingsUpdateVacationCall) Do(opts ...googleapi.CallOption) (*VacationSettings, error) {
8825	gensupport.SetOptions(c.urlParams_, opts...)
8826	res, err := c.doRequest("json")
8827	if res != nil && res.StatusCode == http.StatusNotModified {
8828		if res.Body != nil {
8829			res.Body.Close()
8830		}
8831		return nil, &googleapi.Error{
8832			Code:   res.StatusCode,
8833			Header: res.Header,
8834		}
8835	}
8836	if err != nil {
8837		return nil, err
8838	}
8839	defer googleapi.CloseBody(res)
8840	if err := googleapi.CheckResponse(res); err != nil {
8841		return nil, err
8842	}
8843	ret := &VacationSettings{
8844		ServerResponse: googleapi.ServerResponse{
8845			Header:         res.Header,
8846			HTTPStatusCode: res.StatusCode,
8847		},
8848	}
8849	target := &ret
8850	if err := gensupport.DecodeResponse(target, res); err != nil {
8851		return nil, err
8852	}
8853	return ret, nil
8854	// {
8855	//   "description": "Updates vacation responder settings.",
8856	//   "flatPath": "gmail/v1/users/{userId}/settings/vacation",
8857	//   "httpMethod": "PUT",
8858	//   "id": "gmail.users.settings.updateVacation",
8859	//   "parameterOrder": [
8860	//     "userId"
8861	//   ],
8862	//   "parameters": {
8863	//     "userId": {
8864	//       "default": "me",
8865	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
8866	//       "location": "path",
8867	//       "required": true,
8868	//       "type": "string"
8869	//     }
8870	//   },
8871	//   "path": "gmail/v1/users/{userId}/settings/vacation",
8872	//   "request": {
8873	//     "$ref": "VacationSettings"
8874	//   },
8875	//   "response": {
8876	//     "$ref": "VacationSettings"
8877	//   },
8878	//   "scopes": [
8879	//     "https://www.googleapis.com/auth/gmail.settings.basic"
8880	//   ]
8881	// }
8882
8883}
8884
8885// method id "gmail.users.settings.delegates.create":
8886
8887type UsersSettingsDelegatesCreateCall struct {
8888	s          *Service
8889	userId     string
8890	delegate   *Delegate
8891	urlParams_ gensupport.URLParams
8892	ctx_       context.Context
8893	header_    http.Header
8894}
8895
8896// Create: Adds a delegate with its verification status set directly
8897// to
8898// <code>accepted</code>, without sending any verification email.
8899// The
8900// delegate user must be a member of the same G Suite organization as
8901// the
8902// delegator user.
8903//
8904// Gmail imposes limitations on the number of delegates and delegators
8905// each
8906// user in a G Suite organization can have. These limits depend on
8907// your
8908// organization, but in general each user can have up to 25 delegates
8909// and
8910// up to 10 delegators.
8911//
8912// Note that a delegate user must be referred to by their primary
8913// email
8914// address, and not an email alias.
8915//
8916// Also note that when a new delegate is created, there may be up to a
8917// one
8918// minute delay before the new delegate is available for use.
8919//
8920// This method is only available to service account clients that have
8921// been
8922// delegated domain-wide authority.
8923func (r *UsersSettingsDelegatesService) Create(userId string, delegate *Delegate) *UsersSettingsDelegatesCreateCall {
8924	c := &UsersSettingsDelegatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8925	c.userId = userId
8926	c.delegate = delegate
8927	return c
8928}
8929
8930// Fields allows partial responses to be retrieved. See
8931// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8932// for more information.
8933func (c *UsersSettingsDelegatesCreateCall) Fields(s ...googleapi.Field) *UsersSettingsDelegatesCreateCall {
8934	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8935	return c
8936}
8937
8938// Context sets the context to be used in this call's Do method. Any
8939// pending HTTP request will be aborted if the provided context is
8940// canceled.
8941func (c *UsersSettingsDelegatesCreateCall) Context(ctx context.Context) *UsersSettingsDelegatesCreateCall {
8942	c.ctx_ = ctx
8943	return c
8944}
8945
8946// Header returns an http.Header that can be modified by the caller to
8947// add HTTP headers to the request.
8948func (c *UsersSettingsDelegatesCreateCall) Header() http.Header {
8949	if c.header_ == nil {
8950		c.header_ = make(http.Header)
8951	}
8952	return c.header_
8953}
8954
8955func (c *UsersSettingsDelegatesCreateCall) doRequest(alt string) (*http.Response, error) {
8956	reqHeaders := make(http.Header)
8957	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
8958	for k, v := range c.header_ {
8959		reqHeaders[k] = v
8960	}
8961	reqHeaders.Set("User-Agent", c.s.userAgent())
8962	var body io.Reader = nil
8963	body, err := googleapi.WithoutDataWrapper.JSONReader(c.delegate)
8964	if err != nil {
8965		return nil, err
8966	}
8967	reqHeaders.Set("Content-Type", "application/json")
8968	c.urlParams_.Set("alt", alt)
8969	c.urlParams_.Set("prettyPrint", "false")
8970	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/delegates")
8971	urls += "?" + c.urlParams_.Encode()
8972	req, err := http.NewRequest("POST", urls, body)
8973	if err != nil {
8974		return nil, err
8975	}
8976	req.Header = reqHeaders
8977	googleapi.Expand(req.URL, map[string]string{
8978		"userId": c.userId,
8979	})
8980	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8981}
8982
8983// Do executes the "gmail.users.settings.delegates.create" call.
8984// Exactly one of *Delegate or error will be non-nil. Any non-2xx status
8985// code is an error. Response headers are in either
8986// *Delegate.ServerResponse.Header or (if a response was returned at
8987// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8988// to check whether the returned error was because
8989// http.StatusNotModified was returned.
8990func (c *UsersSettingsDelegatesCreateCall) Do(opts ...googleapi.CallOption) (*Delegate, error) {
8991	gensupport.SetOptions(c.urlParams_, opts...)
8992	res, err := c.doRequest("json")
8993	if res != nil && res.StatusCode == http.StatusNotModified {
8994		if res.Body != nil {
8995			res.Body.Close()
8996		}
8997		return nil, &googleapi.Error{
8998			Code:   res.StatusCode,
8999			Header: res.Header,
9000		}
9001	}
9002	if err != nil {
9003		return nil, err
9004	}
9005	defer googleapi.CloseBody(res)
9006	if err := googleapi.CheckResponse(res); err != nil {
9007		return nil, err
9008	}
9009	ret := &Delegate{
9010		ServerResponse: googleapi.ServerResponse{
9011			Header:         res.Header,
9012			HTTPStatusCode: res.StatusCode,
9013		},
9014	}
9015	target := &ret
9016	if err := gensupport.DecodeResponse(target, res); err != nil {
9017		return nil, err
9018	}
9019	return ret, nil
9020	// {
9021	//   "description": "Adds a delegate with its verification status set directly to\n\u003ccode\u003eaccepted\u003c/code\u003e, without sending any verification email.  The\ndelegate user must be a member of the same G Suite organization as the\ndelegator user.\n\nGmail imposes limitations on the number of delegates and delegators each\nuser in a G Suite organization can have. These limits depend on your\norganization, but in general each user can have up to 25 delegates and\nup to 10 delegators.\n\nNote that a delegate user must be referred to by their primary email\naddress, and not an email alias.\n\nAlso note that when a new delegate is created, there may be up to a one\nminute delay before the new delegate is available for use.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
9022	//   "flatPath": "gmail/v1/users/{userId}/settings/delegates",
9023	//   "httpMethod": "POST",
9024	//   "id": "gmail.users.settings.delegates.create",
9025	//   "parameterOrder": [
9026	//     "userId"
9027	//   ],
9028	//   "parameters": {
9029	//     "userId": {
9030	//       "default": "me",
9031	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
9032	//       "location": "path",
9033	//       "required": true,
9034	//       "type": "string"
9035	//     }
9036	//   },
9037	//   "path": "gmail/v1/users/{userId}/settings/delegates",
9038	//   "request": {
9039	//     "$ref": "Delegate"
9040	//   },
9041	//   "response": {
9042	//     "$ref": "Delegate"
9043	//   },
9044	//   "scopes": [
9045	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
9046	//   ]
9047	// }
9048
9049}
9050
9051// method id "gmail.users.settings.delegates.delete":
9052
9053type UsersSettingsDelegatesDeleteCall struct {
9054	s             *Service
9055	userId        string
9056	delegateEmail string
9057	urlParams_    gensupport.URLParams
9058	ctx_          context.Context
9059	header_       http.Header
9060}
9061
9062// Delete: Removes the specified delegate (which can be of any
9063// verification status),
9064// and revokes any verification that may have been required for using
9065// it.
9066//
9067// Note that a delegate user must be referred to by their primary
9068// email
9069// address, and not an email alias.
9070//
9071// This method is only available to service account clients that have
9072// been
9073// delegated domain-wide authority.
9074func (r *UsersSettingsDelegatesService) Delete(userId string, delegateEmail string) *UsersSettingsDelegatesDeleteCall {
9075	c := &UsersSettingsDelegatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9076	c.userId = userId
9077	c.delegateEmail = delegateEmail
9078	return c
9079}
9080
9081// Fields allows partial responses to be retrieved. See
9082// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9083// for more information.
9084func (c *UsersSettingsDelegatesDeleteCall) Fields(s ...googleapi.Field) *UsersSettingsDelegatesDeleteCall {
9085	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9086	return c
9087}
9088
9089// Context sets the context to be used in this call's Do method. Any
9090// pending HTTP request will be aborted if the provided context is
9091// canceled.
9092func (c *UsersSettingsDelegatesDeleteCall) Context(ctx context.Context) *UsersSettingsDelegatesDeleteCall {
9093	c.ctx_ = ctx
9094	return c
9095}
9096
9097// Header returns an http.Header that can be modified by the caller to
9098// add HTTP headers to the request.
9099func (c *UsersSettingsDelegatesDeleteCall) Header() http.Header {
9100	if c.header_ == nil {
9101		c.header_ = make(http.Header)
9102	}
9103	return c.header_
9104}
9105
9106func (c *UsersSettingsDelegatesDeleteCall) doRequest(alt string) (*http.Response, error) {
9107	reqHeaders := make(http.Header)
9108	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
9109	for k, v := range c.header_ {
9110		reqHeaders[k] = v
9111	}
9112	reqHeaders.Set("User-Agent", c.s.userAgent())
9113	var body io.Reader = nil
9114	c.urlParams_.Set("alt", alt)
9115	c.urlParams_.Set("prettyPrint", "false")
9116	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}")
9117	urls += "?" + c.urlParams_.Encode()
9118	req, err := http.NewRequest("DELETE", urls, body)
9119	if err != nil {
9120		return nil, err
9121	}
9122	req.Header = reqHeaders
9123	googleapi.Expand(req.URL, map[string]string{
9124		"userId":        c.userId,
9125		"delegateEmail": c.delegateEmail,
9126	})
9127	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9128}
9129
9130// Do executes the "gmail.users.settings.delegates.delete" call.
9131func (c *UsersSettingsDelegatesDeleteCall) Do(opts ...googleapi.CallOption) error {
9132	gensupport.SetOptions(c.urlParams_, opts...)
9133	res, err := c.doRequest("json")
9134	if err != nil {
9135		return err
9136	}
9137	defer googleapi.CloseBody(res)
9138	if err := googleapi.CheckResponse(res); err != nil {
9139		return err
9140	}
9141	return nil
9142	// {
9143	//   "description": "Removes the specified delegate (which can be of any verification status),\nand revokes any verification that may have been required for using it.\n\nNote that a delegate user must be referred to by their primary email\naddress, and not an email alias.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
9144	//   "flatPath": "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}",
9145	//   "httpMethod": "DELETE",
9146	//   "id": "gmail.users.settings.delegates.delete",
9147	//   "parameterOrder": [
9148	//     "userId",
9149	//     "delegateEmail"
9150	//   ],
9151	//   "parameters": {
9152	//     "delegateEmail": {
9153	//       "description": "The email address of the user to be removed as a delegate.",
9154	//       "location": "path",
9155	//       "required": true,
9156	//       "type": "string"
9157	//     },
9158	//     "userId": {
9159	//       "default": "me",
9160	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
9161	//       "location": "path",
9162	//       "required": true,
9163	//       "type": "string"
9164	//     }
9165	//   },
9166	//   "path": "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}",
9167	//   "scopes": [
9168	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
9169	//   ]
9170	// }
9171
9172}
9173
9174// method id "gmail.users.settings.delegates.get":
9175
9176type UsersSettingsDelegatesGetCall struct {
9177	s             *Service
9178	userId        string
9179	delegateEmail string
9180	urlParams_    gensupport.URLParams
9181	ifNoneMatch_  string
9182	ctx_          context.Context
9183	header_       http.Header
9184}
9185
9186// Get: Gets the specified delegate.
9187//
9188// Note that a delegate user must be referred to by their primary
9189// email
9190// address, and not an email alias.
9191//
9192// This method is only available to service account clients that have
9193// been
9194// delegated domain-wide authority.
9195func (r *UsersSettingsDelegatesService) Get(userId string, delegateEmail string) *UsersSettingsDelegatesGetCall {
9196	c := &UsersSettingsDelegatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9197	c.userId = userId
9198	c.delegateEmail = delegateEmail
9199	return c
9200}
9201
9202// Fields allows partial responses to be retrieved. See
9203// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9204// for more information.
9205func (c *UsersSettingsDelegatesGetCall) Fields(s ...googleapi.Field) *UsersSettingsDelegatesGetCall {
9206	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9207	return c
9208}
9209
9210// IfNoneMatch sets the optional parameter which makes the operation
9211// fail if the object's ETag matches the given value. This is useful for
9212// getting updates only after the object has changed since the last
9213// request. Use googleapi.IsNotModified to check whether the response
9214// error from Do is the result of In-None-Match.
9215func (c *UsersSettingsDelegatesGetCall) IfNoneMatch(entityTag string) *UsersSettingsDelegatesGetCall {
9216	c.ifNoneMatch_ = entityTag
9217	return c
9218}
9219
9220// Context sets the context to be used in this call's Do method. Any
9221// pending HTTP request will be aborted if the provided context is
9222// canceled.
9223func (c *UsersSettingsDelegatesGetCall) Context(ctx context.Context) *UsersSettingsDelegatesGetCall {
9224	c.ctx_ = ctx
9225	return c
9226}
9227
9228// Header returns an http.Header that can be modified by the caller to
9229// add HTTP headers to the request.
9230func (c *UsersSettingsDelegatesGetCall) Header() http.Header {
9231	if c.header_ == nil {
9232		c.header_ = make(http.Header)
9233	}
9234	return c.header_
9235}
9236
9237func (c *UsersSettingsDelegatesGetCall) doRequest(alt string) (*http.Response, error) {
9238	reqHeaders := make(http.Header)
9239	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
9240	for k, v := range c.header_ {
9241		reqHeaders[k] = v
9242	}
9243	reqHeaders.Set("User-Agent", c.s.userAgent())
9244	if c.ifNoneMatch_ != "" {
9245		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9246	}
9247	var body io.Reader = nil
9248	c.urlParams_.Set("alt", alt)
9249	c.urlParams_.Set("prettyPrint", "false")
9250	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}")
9251	urls += "?" + c.urlParams_.Encode()
9252	req, err := http.NewRequest("GET", urls, body)
9253	if err != nil {
9254		return nil, err
9255	}
9256	req.Header = reqHeaders
9257	googleapi.Expand(req.URL, map[string]string{
9258		"userId":        c.userId,
9259		"delegateEmail": c.delegateEmail,
9260	})
9261	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9262}
9263
9264// Do executes the "gmail.users.settings.delegates.get" call.
9265// Exactly one of *Delegate or error will be non-nil. Any non-2xx status
9266// code is an error. Response headers are in either
9267// *Delegate.ServerResponse.Header or (if a response was returned at
9268// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9269// to check whether the returned error was because
9270// http.StatusNotModified was returned.
9271func (c *UsersSettingsDelegatesGetCall) Do(opts ...googleapi.CallOption) (*Delegate, error) {
9272	gensupport.SetOptions(c.urlParams_, opts...)
9273	res, err := c.doRequest("json")
9274	if res != nil && res.StatusCode == http.StatusNotModified {
9275		if res.Body != nil {
9276			res.Body.Close()
9277		}
9278		return nil, &googleapi.Error{
9279			Code:   res.StatusCode,
9280			Header: res.Header,
9281		}
9282	}
9283	if err != nil {
9284		return nil, err
9285	}
9286	defer googleapi.CloseBody(res)
9287	if err := googleapi.CheckResponse(res); err != nil {
9288		return nil, err
9289	}
9290	ret := &Delegate{
9291		ServerResponse: googleapi.ServerResponse{
9292			Header:         res.Header,
9293			HTTPStatusCode: res.StatusCode,
9294		},
9295	}
9296	target := &ret
9297	if err := gensupport.DecodeResponse(target, res); err != nil {
9298		return nil, err
9299	}
9300	return ret, nil
9301	// {
9302	//   "description": "Gets the specified delegate.\n\nNote that a delegate user must be referred to by their primary email\naddress, and not an email alias.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
9303	//   "flatPath": "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}",
9304	//   "httpMethod": "GET",
9305	//   "id": "gmail.users.settings.delegates.get",
9306	//   "parameterOrder": [
9307	//     "userId",
9308	//     "delegateEmail"
9309	//   ],
9310	//   "parameters": {
9311	//     "delegateEmail": {
9312	//       "description": "The email address of the user whose delegate relationship is to be\nretrieved.",
9313	//       "location": "path",
9314	//       "required": true,
9315	//       "type": "string"
9316	//     },
9317	//     "userId": {
9318	//       "default": "me",
9319	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
9320	//       "location": "path",
9321	//       "required": true,
9322	//       "type": "string"
9323	//     }
9324	//   },
9325	//   "path": "gmail/v1/users/{userId}/settings/delegates/{delegateEmail}",
9326	//   "response": {
9327	//     "$ref": "Delegate"
9328	//   },
9329	//   "scopes": [
9330	//     "https://mail.google.com/",
9331	//     "https://www.googleapis.com/auth/gmail.modify",
9332	//     "https://www.googleapis.com/auth/gmail.readonly",
9333	//     "https://www.googleapis.com/auth/gmail.settings.basic"
9334	//   ]
9335	// }
9336
9337}
9338
9339// method id "gmail.users.settings.delegates.list":
9340
9341type UsersSettingsDelegatesListCall struct {
9342	s            *Service
9343	userId       string
9344	urlParams_   gensupport.URLParams
9345	ifNoneMatch_ string
9346	ctx_         context.Context
9347	header_      http.Header
9348}
9349
9350// List: Lists the delegates for the specified account.
9351//
9352// This method is only available to service account clients that have
9353// been
9354// delegated domain-wide authority.
9355func (r *UsersSettingsDelegatesService) List(userId string) *UsersSettingsDelegatesListCall {
9356	c := &UsersSettingsDelegatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9357	c.userId = userId
9358	return c
9359}
9360
9361// Fields allows partial responses to be retrieved. See
9362// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9363// for more information.
9364func (c *UsersSettingsDelegatesListCall) Fields(s ...googleapi.Field) *UsersSettingsDelegatesListCall {
9365	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9366	return c
9367}
9368
9369// IfNoneMatch sets the optional parameter which makes the operation
9370// fail if the object's ETag matches the given value. This is useful for
9371// getting updates only after the object has changed since the last
9372// request. Use googleapi.IsNotModified to check whether the response
9373// error from Do is the result of In-None-Match.
9374func (c *UsersSettingsDelegatesListCall) IfNoneMatch(entityTag string) *UsersSettingsDelegatesListCall {
9375	c.ifNoneMatch_ = entityTag
9376	return c
9377}
9378
9379// Context sets the context to be used in this call's Do method. Any
9380// pending HTTP request will be aborted if the provided context is
9381// canceled.
9382func (c *UsersSettingsDelegatesListCall) Context(ctx context.Context) *UsersSettingsDelegatesListCall {
9383	c.ctx_ = ctx
9384	return c
9385}
9386
9387// Header returns an http.Header that can be modified by the caller to
9388// add HTTP headers to the request.
9389func (c *UsersSettingsDelegatesListCall) Header() http.Header {
9390	if c.header_ == nil {
9391		c.header_ = make(http.Header)
9392	}
9393	return c.header_
9394}
9395
9396func (c *UsersSettingsDelegatesListCall) doRequest(alt string) (*http.Response, error) {
9397	reqHeaders := make(http.Header)
9398	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
9399	for k, v := range c.header_ {
9400		reqHeaders[k] = v
9401	}
9402	reqHeaders.Set("User-Agent", c.s.userAgent())
9403	if c.ifNoneMatch_ != "" {
9404		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9405	}
9406	var body io.Reader = nil
9407	c.urlParams_.Set("alt", alt)
9408	c.urlParams_.Set("prettyPrint", "false")
9409	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/delegates")
9410	urls += "?" + c.urlParams_.Encode()
9411	req, err := http.NewRequest("GET", urls, body)
9412	if err != nil {
9413		return nil, err
9414	}
9415	req.Header = reqHeaders
9416	googleapi.Expand(req.URL, map[string]string{
9417		"userId": c.userId,
9418	})
9419	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9420}
9421
9422// Do executes the "gmail.users.settings.delegates.list" call.
9423// Exactly one of *ListDelegatesResponse or error will be non-nil. Any
9424// non-2xx status code is an error. Response headers are in either
9425// *ListDelegatesResponse.ServerResponse.Header or (if a response was
9426// returned at all) in error.(*googleapi.Error).Header. Use
9427// googleapi.IsNotModified to check whether the returned error was
9428// because http.StatusNotModified was returned.
9429func (c *UsersSettingsDelegatesListCall) Do(opts ...googleapi.CallOption) (*ListDelegatesResponse, error) {
9430	gensupport.SetOptions(c.urlParams_, opts...)
9431	res, err := c.doRequest("json")
9432	if res != nil && res.StatusCode == http.StatusNotModified {
9433		if res.Body != nil {
9434			res.Body.Close()
9435		}
9436		return nil, &googleapi.Error{
9437			Code:   res.StatusCode,
9438			Header: res.Header,
9439		}
9440	}
9441	if err != nil {
9442		return nil, err
9443	}
9444	defer googleapi.CloseBody(res)
9445	if err := googleapi.CheckResponse(res); err != nil {
9446		return nil, err
9447	}
9448	ret := &ListDelegatesResponse{
9449		ServerResponse: googleapi.ServerResponse{
9450			Header:         res.Header,
9451			HTTPStatusCode: res.StatusCode,
9452		},
9453	}
9454	target := &ret
9455	if err := gensupport.DecodeResponse(target, res); err != nil {
9456		return nil, err
9457	}
9458	return ret, nil
9459	// {
9460	//   "description": "Lists the delegates for the specified account.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
9461	//   "flatPath": "gmail/v1/users/{userId}/settings/delegates",
9462	//   "httpMethod": "GET",
9463	//   "id": "gmail.users.settings.delegates.list",
9464	//   "parameterOrder": [
9465	//     "userId"
9466	//   ],
9467	//   "parameters": {
9468	//     "userId": {
9469	//       "default": "me",
9470	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
9471	//       "location": "path",
9472	//       "required": true,
9473	//       "type": "string"
9474	//     }
9475	//   },
9476	//   "path": "gmail/v1/users/{userId}/settings/delegates",
9477	//   "response": {
9478	//     "$ref": "ListDelegatesResponse"
9479	//   },
9480	//   "scopes": [
9481	//     "https://mail.google.com/",
9482	//     "https://www.googleapis.com/auth/gmail.modify",
9483	//     "https://www.googleapis.com/auth/gmail.readonly",
9484	//     "https://www.googleapis.com/auth/gmail.settings.basic"
9485	//   ]
9486	// }
9487
9488}
9489
9490// method id "gmail.users.settings.filters.create":
9491
9492type UsersSettingsFiltersCreateCall struct {
9493	s          *Service
9494	userId     string
9495	filter     *Filter
9496	urlParams_ gensupport.URLParams
9497	ctx_       context.Context
9498	header_    http.Header
9499}
9500
9501// Create: Creates a filter.
9502func (r *UsersSettingsFiltersService) Create(userId string, filter *Filter) *UsersSettingsFiltersCreateCall {
9503	c := &UsersSettingsFiltersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9504	c.userId = userId
9505	c.filter = filter
9506	return c
9507}
9508
9509// Fields allows partial responses to be retrieved. See
9510// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9511// for more information.
9512func (c *UsersSettingsFiltersCreateCall) Fields(s ...googleapi.Field) *UsersSettingsFiltersCreateCall {
9513	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9514	return c
9515}
9516
9517// Context sets the context to be used in this call's Do method. Any
9518// pending HTTP request will be aborted if the provided context is
9519// canceled.
9520func (c *UsersSettingsFiltersCreateCall) Context(ctx context.Context) *UsersSettingsFiltersCreateCall {
9521	c.ctx_ = ctx
9522	return c
9523}
9524
9525// Header returns an http.Header that can be modified by the caller to
9526// add HTTP headers to the request.
9527func (c *UsersSettingsFiltersCreateCall) Header() http.Header {
9528	if c.header_ == nil {
9529		c.header_ = make(http.Header)
9530	}
9531	return c.header_
9532}
9533
9534func (c *UsersSettingsFiltersCreateCall) doRequest(alt string) (*http.Response, error) {
9535	reqHeaders := make(http.Header)
9536	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
9537	for k, v := range c.header_ {
9538		reqHeaders[k] = v
9539	}
9540	reqHeaders.Set("User-Agent", c.s.userAgent())
9541	var body io.Reader = nil
9542	body, err := googleapi.WithoutDataWrapper.JSONReader(c.filter)
9543	if err != nil {
9544		return nil, err
9545	}
9546	reqHeaders.Set("Content-Type", "application/json")
9547	c.urlParams_.Set("alt", alt)
9548	c.urlParams_.Set("prettyPrint", "false")
9549	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/filters")
9550	urls += "?" + c.urlParams_.Encode()
9551	req, err := http.NewRequest("POST", urls, body)
9552	if err != nil {
9553		return nil, err
9554	}
9555	req.Header = reqHeaders
9556	googleapi.Expand(req.URL, map[string]string{
9557		"userId": c.userId,
9558	})
9559	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9560}
9561
9562// Do executes the "gmail.users.settings.filters.create" call.
9563// Exactly one of *Filter or error will be non-nil. Any non-2xx status
9564// code is an error. Response headers are in either
9565// *Filter.ServerResponse.Header or (if a response was returned at all)
9566// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9567// check whether the returned error was because http.StatusNotModified
9568// was returned.
9569func (c *UsersSettingsFiltersCreateCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
9570	gensupport.SetOptions(c.urlParams_, opts...)
9571	res, err := c.doRequest("json")
9572	if res != nil && res.StatusCode == http.StatusNotModified {
9573		if res.Body != nil {
9574			res.Body.Close()
9575		}
9576		return nil, &googleapi.Error{
9577			Code:   res.StatusCode,
9578			Header: res.Header,
9579		}
9580	}
9581	if err != nil {
9582		return nil, err
9583	}
9584	defer googleapi.CloseBody(res)
9585	if err := googleapi.CheckResponse(res); err != nil {
9586		return nil, err
9587	}
9588	ret := &Filter{
9589		ServerResponse: googleapi.ServerResponse{
9590			Header:         res.Header,
9591			HTTPStatusCode: res.StatusCode,
9592		},
9593	}
9594	target := &ret
9595	if err := gensupport.DecodeResponse(target, res); err != nil {
9596		return nil, err
9597	}
9598	return ret, nil
9599	// {
9600	//   "description": "Creates a filter.",
9601	//   "flatPath": "gmail/v1/users/{userId}/settings/filters",
9602	//   "httpMethod": "POST",
9603	//   "id": "gmail.users.settings.filters.create",
9604	//   "parameterOrder": [
9605	//     "userId"
9606	//   ],
9607	//   "parameters": {
9608	//     "userId": {
9609	//       "default": "me",
9610	//       "description": "User's email address. The special value \"me\"\ncan be used to indicate the authenticated user.",
9611	//       "location": "path",
9612	//       "required": true,
9613	//       "type": "string"
9614	//     }
9615	//   },
9616	//   "path": "gmail/v1/users/{userId}/settings/filters",
9617	//   "request": {
9618	//     "$ref": "Filter"
9619	//   },
9620	//   "response": {
9621	//     "$ref": "Filter"
9622	//   },
9623	//   "scopes": [
9624	//     "https://www.googleapis.com/auth/gmail.settings.basic"
9625	//   ]
9626	// }
9627
9628}
9629
9630// method id "gmail.users.settings.filters.delete":
9631
9632type UsersSettingsFiltersDeleteCall struct {
9633	s          *Service
9634	userId     string
9635	id         string
9636	urlParams_ gensupport.URLParams
9637	ctx_       context.Context
9638	header_    http.Header
9639}
9640
9641// Delete: Deletes a filter.
9642func (r *UsersSettingsFiltersService) Delete(userId string, id string) *UsersSettingsFiltersDeleteCall {
9643	c := &UsersSettingsFiltersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9644	c.userId = userId
9645	c.id = id
9646	return c
9647}
9648
9649// Fields allows partial responses to be retrieved. See
9650// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9651// for more information.
9652func (c *UsersSettingsFiltersDeleteCall) Fields(s ...googleapi.Field) *UsersSettingsFiltersDeleteCall {
9653	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9654	return c
9655}
9656
9657// Context sets the context to be used in this call's Do method. Any
9658// pending HTTP request will be aborted if the provided context is
9659// canceled.
9660func (c *UsersSettingsFiltersDeleteCall) Context(ctx context.Context) *UsersSettingsFiltersDeleteCall {
9661	c.ctx_ = ctx
9662	return c
9663}
9664
9665// Header returns an http.Header that can be modified by the caller to
9666// add HTTP headers to the request.
9667func (c *UsersSettingsFiltersDeleteCall) Header() http.Header {
9668	if c.header_ == nil {
9669		c.header_ = make(http.Header)
9670	}
9671	return c.header_
9672}
9673
9674func (c *UsersSettingsFiltersDeleteCall) doRequest(alt string) (*http.Response, error) {
9675	reqHeaders := make(http.Header)
9676	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
9677	for k, v := range c.header_ {
9678		reqHeaders[k] = v
9679	}
9680	reqHeaders.Set("User-Agent", c.s.userAgent())
9681	var body io.Reader = nil
9682	c.urlParams_.Set("alt", alt)
9683	c.urlParams_.Set("prettyPrint", "false")
9684	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/filters/{id}")
9685	urls += "?" + c.urlParams_.Encode()
9686	req, err := http.NewRequest("DELETE", urls, body)
9687	if err != nil {
9688		return nil, err
9689	}
9690	req.Header = reqHeaders
9691	googleapi.Expand(req.URL, map[string]string{
9692		"userId": c.userId,
9693		"id":     c.id,
9694	})
9695	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9696}
9697
9698// Do executes the "gmail.users.settings.filters.delete" call.
9699func (c *UsersSettingsFiltersDeleteCall) Do(opts ...googleapi.CallOption) error {
9700	gensupport.SetOptions(c.urlParams_, opts...)
9701	res, err := c.doRequest("json")
9702	if err != nil {
9703		return err
9704	}
9705	defer googleapi.CloseBody(res)
9706	if err := googleapi.CheckResponse(res); err != nil {
9707		return err
9708	}
9709	return nil
9710	// {
9711	//   "description": "Deletes a filter.",
9712	//   "flatPath": "gmail/v1/users/{userId}/settings/filters/{id}",
9713	//   "httpMethod": "DELETE",
9714	//   "id": "gmail.users.settings.filters.delete",
9715	//   "parameterOrder": [
9716	//     "userId",
9717	//     "id"
9718	//   ],
9719	//   "parameters": {
9720	//     "id": {
9721	//       "description": "The ID of the filter to be deleted.",
9722	//       "location": "path",
9723	//       "required": true,
9724	//       "type": "string"
9725	//     },
9726	//     "userId": {
9727	//       "default": "me",
9728	//       "description": "User's email address. The special value \"me\"\ncan be used to indicate the authenticated user.",
9729	//       "location": "path",
9730	//       "required": true,
9731	//       "type": "string"
9732	//     }
9733	//   },
9734	//   "path": "gmail/v1/users/{userId}/settings/filters/{id}",
9735	//   "scopes": [
9736	//     "https://www.googleapis.com/auth/gmail.settings.basic"
9737	//   ]
9738	// }
9739
9740}
9741
9742// method id "gmail.users.settings.filters.get":
9743
9744type UsersSettingsFiltersGetCall struct {
9745	s            *Service
9746	userId       string
9747	id           string
9748	urlParams_   gensupport.URLParams
9749	ifNoneMatch_ string
9750	ctx_         context.Context
9751	header_      http.Header
9752}
9753
9754// Get: Gets a filter.
9755func (r *UsersSettingsFiltersService) Get(userId string, id string) *UsersSettingsFiltersGetCall {
9756	c := &UsersSettingsFiltersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9757	c.userId = userId
9758	c.id = id
9759	return c
9760}
9761
9762// Fields allows partial responses to be retrieved. See
9763// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9764// for more information.
9765func (c *UsersSettingsFiltersGetCall) Fields(s ...googleapi.Field) *UsersSettingsFiltersGetCall {
9766	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9767	return c
9768}
9769
9770// IfNoneMatch sets the optional parameter which makes the operation
9771// fail if the object's ETag matches the given value. This is useful for
9772// getting updates only after the object has changed since the last
9773// request. Use googleapi.IsNotModified to check whether the response
9774// error from Do is the result of In-None-Match.
9775func (c *UsersSettingsFiltersGetCall) IfNoneMatch(entityTag string) *UsersSettingsFiltersGetCall {
9776	c.ifNoneMatch_ = entityTag
9777	return c
9778}
9779
9780// Context sets the context to be used in this call's Do method. Any
9781// pending HTTP request will be aborted if the provided context is
9782// canceled.
9783func (c *UsersSettingsFiltersGetCall) Context(ctx context.Context) *UsersSettingsFiltersGetCall {
9784	c.ctx_ = ctx
9785	return c
9786}
9787
9788// Header returns an http.Header that can be modified by the caller to
9789// add HTTP headers to the request.
9790func (c *UsersSettingsFiltersGetCall) Header() http.Header {
9791	if c.header_ == nil {
9792		c.header_ = make(http.Header)
9793	}
9794	return c.header_
9795}
9796
9797func (c *UsersSettingsFiltersGetCall) doRequest(alt string) (*http.Response, error) {
9798	reqHeaders := make(http.Header)
9799	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
9800	for k, v := range c.header_ {
9801		reqHeaders[k] = v
9802	}
9803	reqHeaders.Set("User-Agent", c.s.userAgent())
9804	if c.ifNoneMatch_ != "" {
9805		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9806	}
9807	var body io.Reader = nil
9808	c.urlParams_.Set("alt", alt)
9809	c.urlParams_.Set("prettyPrint", "false")
9810	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/filters/{id}")
9811	urls += "?" + c.urlParams_.Encode()
9812	req, err := http.NewRequest("GET", urls, body)
9813	if err != nil {
9814		return nil, err
9815	}
9816	req.Header = reqHeaders
9817	googleapi.Expand(req.URL, map[string]string{
9818		"userId": c.userId,
9819		"id":     c.id,
9820	})
9821	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9822}
9823
9824// Do executes the "gmail.users.settings.filters.get" call.
9825// Exactly one of *Filter or error will be non-nil. Any non-2xx status
9826// code is an error. Response headers are in either
9827// *Filter.ServerResponse.Header or (if a response was returned at all)
9828// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9829// check whether the returned error was because http.StatusNotModified
9830// was returned.
9831func (c *UsersSettingsFiltersGetCall) Do(opts ...googleapi.CallOption) (*Filter, error) {
9832	gensupport.SetOptions(c.urlParams_, opts...)
9833	res, err := c.doRequest("json")
9834	if res != nil && res.StatusCode == http.StatusNotModified {
9835		if res.Body != nil {
9836			res.Body.Close()
9837		}
9838		return nil, &googleapi.Error{
9839			Code:   res.StatusCode,
9840			Header: res.Header,
9841		}
9842	}
9843	if err != nil {
9844		return nil, err
9845	}
9846	defer googleapi.CloseBody(res)
9847	if err := googleapi.CheckResponse(res); err != nil {
9848		return nil, err
9849	}
9850	ret := &Filter{
9851		ServerResponse: googleapi.ServerResponse{
9852			Header:         res.Header,
9853			HTTPStatusCode: res.StatusCode,
9854		},
9855	}
9856	target := &ret
9857	if err := gensupport.DecodeResponse(target, res); err != nil {
9858		return nil, err
9859	}
9860	return ret, nil
9861	// {
9862	//   "description": "Gets a filter.",
9863	//   "flatPath": "gmail/v1/users/{userId}/settings/filters/{id}",
9864	//   "httpMethod": "GET",
9865	//   "id": "gmail.users.settings.filters.get",
9866	//   "parameterOrder": [
9867	//     "userId",
9868	//     "id"
9869	//   ],
9870	//   "parameters": {
9871	//     "id": {
9872	//       "description": "The ID of the filter to be fetched.",
9873	//       "location": "path",
9874	//       "required": true,
9875	//       "type": "string"
9876	//     },
9877	//     "userId": {
9878	//       "default": "me",
9879	//       "description": "User's email address. The special value \"me\"\ncan be used to indicate the authenticated user.",
9880	//       "location": "path",
9881	//       "required": true,
9882	//       "type": "string"
9883	//     }
9884	//   },
9885	//   "path": "gmail/v1/users/{userId}/settings/filters/{id}",
9886	//   "response": {
9887	//     "$ref": "Filter"
9888	//   },
9889	//   "scopes": [
9890	//     "https://mail.google.com/",
9891	//     "https://www.googleapis.com/auth/gmail.modify",
9892	//     "https://www.googleapis.com/auth/gmail.readonly",
9893	//     "https://www.googleapis.com/auth/gmail.settings.basic"
9894	//   ]
9895	// }
9896
9897}
9898
9899// method id "gmail.users.settings.filters.list":
9900
9901type UsersSettingsFiltersListCall struct {
9902	s            *Service
9903	userId       string
9904	urlParams_   gensupport.URLParams
9905	ifNoneMatch_ string
9906	ctx_         context.Context
9907	header_      http.Header
9908}
9909
9910// List: Lists the message filters of a Gmail user.
9911func (r *UsersSettingsFiltersService) List(userId string) *UsersSettingsFiltersListCall {
9912	c := &UsersSettingsFiltersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9913	c.userId = userId
9914	return c
9915}
9916
9917// Fields allows partial responses to be retrieved. See
9918// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9919// for more information.
9920func (c *UsersSettingsFiltersListCall) Fields(s ...googleapi.Field) *UsersSettingsFiltersListCall {
9921	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9922	return c
9923}
9924
9925// IfNoneMatch sets the optional parameter which makes the operation
9926// fail if the object's ETag matches the given value. This is useful for
9927// getting updates only after the object has changed since the last
9928// request. Use googleapi.IsNotModified to check whether the response
9929// error from Do is the result of In-None-Match.
9930func (c *UsersSettingsFiltersListCall) IfNoneMatch(entityTag string) *UsersSettingsFiltersListCall {
9931	c.ifNoneMatch_ = entityTag
9932	return c
9933}
9934
9935// Context sets the context to be used in this call's Do method. Any
9936// pending HTTP request will be aborted if the provided context is
9937// canceled.
9938func (c *UsersSettingsFiltersListCall) Context(ctx context.Context) *UsersSettingsFiltersListCall {
9939	c.ctx_ = ctx
9940	return c
9941}
9942
9943// Header returns an http.Header that can be modified by the caller to
9944// add HTTP headers to the request.
9945func (c *UsersSettingsFiltersListCall) Header() http.Header {
9946	if c.header_ == nil {
9947		c.header_ = make(http.Header)
9948	}
9949	return c.header_
9950}
9951
9952func (c *UsersSettingsFiltersListCall) doRequest(alt string) (*http.Response, error) {
9953	reqHeaders := make(http.Header)
9954	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
9955	for k, v := range c.header_ {
9956		reqHeaders[k] = v
9957	}
9958	reqHeaders.Set("User-Agent", c.s.userAgent())
9959	if c.ifNoneMatch_ != "" {
9960		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9961	}
9962	var body io.Reader = nil
9963	c.urlParams_.Set("alt", alt)
9964	c.urlParams_.Set("prettyPrint", "false")
9965	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/filters")
9966	urls += "?" + c.urlParams_.Encode()
9967	req, err := http.NewRequest("GET", urls, body)
9968	if err != nil {
9969		return nil, err
9970	}
9971	req.Header = reqHeaders
9972	googleapi.Expand(req.URL, map[string]string{
9973		"userId": c.userId,
9974	})
9975	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9976}
9977
9978// Do executes the "gmail.users.settings.filters.list" call.
9979// Exactly one of *ListFiltersResponse or error will be non-nil. Any
9980// non-2xx status code is an error. Response headers are in either
9981// *ListFiltersResponse.ServerResponse.Header or (if a response was
9982// returned at all) in error.(*googleapi.Error).Header. Use
9983// googleapi.IsNotModified to check whether the returned error was
9984// because http.StatusNotModified was returned.
9985func (c *UsersSettingsFiltersListCall) Do(opts ...googleapi.CallOption) (*ListFiltersResponse, error) {
9986	gensupport.SetOptions(c.urlParams_, opts...)
9987	res, err := c.doRequest("json")
9988	if res != nil && res.StatusCode == http.StatusNotModified {
9989		if res.Body != nil {
9990			res.Body.Close()
9991		}
9992		return nil, &googleapi.Error{
9993			Code:   res.StatusCode,
9994			Header: res.Header,
9995		}
9996	}
9997	if err != nil {
9998		return nil, err
9999	}
10000	defer googleapi.CloseBody(res)
10001	if err := googleapi.CheckResponse(res); err != nil {
10002		return nil, err
10003	}
10004	ret := &ListFiltersResponse{
10005		ServerResponse: googleapi.ServerResponse{
10006			Header:         res.Header,
10007			HTTPStatusCode: res.StatusCode,
10008		},
10009	}
10010	target := &ret
10011	if err := gensupport.DecodeResponse(target, res); err != nil {
10012		return nil, err
10013	}
10014	return ret, nil
10015	// {
10016	//   "description": "Lists the message filters of a Gmail user.",
10017	//   "flatPath": "gmail/v1/users/{userId}/settings/filters",
10018	//   "httpMethod": "GET",
10019	//   "id": "gmail.users.settings.filters.list",
10020	//   "parameterOrder": [
10021	//     "userId"
10022	//   ],
10023	//   "parameters": {
10024	//     "userId": {
10025	//       "default": "me",
10026	//       "description": "User's email address. The special value \"me\"\ncan be used to indicate the authenticated user.",
10027	//       "location": "path",
10028	//       "required": true,
10029	//       "type": "string"
10030	//     }
10031	//   },
10032	//   "path": "gmail/v1/users/{userId}/settings/filters",
10033	//   "response": {
10034	//     "$ref": "ListFiltersResponse"
10035	//   },
10036	//   "scopes": [
10037	//     "https://mail.google.com/",
10038	//     "https://www.googleapis.com/auth/gmail.modify",
10039	//     "https://www.googleapis.com/auth/gmail.readonly",
10040	//     "https://www.googleapis.com/auth/gmail.settings.basic"
10041	//   ]
10042	// }
10043
10044}
10045
10046// method id "gmail.users.settings.forwardingAddresses.create":
10047
10048type UsersSettingsForwardingAddressesCreateCall struct {
10049	s                 *Service
10050	userId            string
10051	forwardingaddress *ForwardingAddress
10052	urlParams_        gensupport.URLParams
10053	ctx_              context.Context
10054	header_           http.Header
10055}
10056
10057// Create: Creates a forwarding address.  If ownership verification is
10058// required, a
10059// message will be sent to the recipient and the resource's
10060// verification
10061// status will be set to <code>pending</code>; otherwise, the resource
10062// will be
10063// created with verification status set to <code>accepted</code>.
10064//
10065// This method is only available to service account clients that have
10066// been
10067// delegated domain-wide authority.
10068func (r *UsersSettingsForwardingAddressesService) Create(userId string, forwardingaddress *ForwardingAddress) *UsersSettingsForwardingAddressesCreateCall {
10069	c := &UsersSettingsForwardingAddressesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10070	c.userId = userId
10071	c.forwardingaddress = forwardingaddress
10072	return c
10073}
10074
10075// Fields allows partial responses to be retrieved. See
10076// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10077// for more information.
10078func (c *UsersSettingsForwardingAddressesCreateCall) Fields(s ...googleapi.Field) *UsersSettingsForwardingAddressesCreateCall {
10079	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10080	return c
10081}
10082
10083// Context sets the context to be used in this call's Do method. Any
10084// pending HTTP request will be aborted if the provided context is
10085// canceled.
10086func (c *UsersSettingsForwardingAddressesCreateCall) Context(ctx context.Context) *UsersSettingsForwardingAddressesCreateCall {
10087	c.ctx_ = ctx
10088	return c
10089}
10090
10091// Header returns an http.Header that can be modified by the caller to
10092// add HTTP headers to the request.
10093func (c *UsersSettingsForwardingAddressesCreateCall) Header() http.Header {
10094	if c.header_ == nil {
10095		c.header_ = make(http.Header)
10096	}
10097	return c.header_
10098}
10099
10100func (c *UsersSettingsForwardingAddressesCreateCall) doRequest(alt string) (*http.Response, error) {
10101	reqHeaders := make(http.Header)
10102	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
10103	for k, v := range c.header_ {
10104		reqHeaders[k] = v
10105	}
10106	reqHeaders.Set("User-Agent", c.s.userAgent())
10107	var body io.Reader = nil
10108	body, err := googleapi.WithoutDataWrapper.JSONReader(c.forwardingaddress)
10109	if err != nil {
10110		return nil, err
10111	}
10112	reqHeaders.Set("Content-Type", "application/json")
10113	c.urlParams_.Set("alt", alt)
10114	c.urlParams_.Set("prettyPrint", "false")
10115	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/forwardingAddresses")
10116	urls += "?" + c.urlParams_.Encode()
10117	req, err := http.NewRequest("POST", urls, body)
10118	if err != nil {
10119		return nil, err
10120	}
10121	req.Header = reqHeaders
10122	googleapi.Expand(req.URL, map[string]string{
10123		"userId": c.userId,
10124	})
10125	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10126}
10127
10128// Do executes the "gmail.users.settings.forwardingAddresses.create" call.
10129// Exactly one of *ForwardingAddress or error will be non-nil. Any
10130// non-2xx status code is an error. Response headers are in either
10131// *ForwardingAddress.ServerResponse.Header or (if a response was
10132// returned at all) in error.(*googleapi.Error).Header. Use
10133// googleapi.IsNotModified to check whether the returned error was
10134// because http.StatusNotModified was returned.
10135func (c *UsersSettingsForwardingAddressesCreateCall) Do(opts ...googleapi.CallOption) (*ForwardingAddress, error) {
10136	gensupport.SetOptions(c.urlParams_, opts...)
10137	res, err := c.doRequest("json")
10138	if res != nil && res.StatusCode == http.StatusNotModified {
10139		if res.Body != nil {
10140			res.Body.Close()
10141		}
10142		return nil, &googleapi.Error{
10143			Code:   res.StatusCode,
10144			Header: res.Header,
10145		}
10146	}
10147	if err != nil {
10148		return nil, err
10149	}
10150	defer googleapi.CloseBody(res)
10151	if err := googleapi.CheckResponse(res); err != nil {
10152		return nil, err
10153	}
10154	ret := &ForwardingAddress{
10155		ServerResponse: googleapi.ServerResponse{
10156			Header:         res.Header,
10157			HTTPStatusCode: res.StatusCode,
10158		},
10159	}
10160	target := &ret
10161	if err := gensupport.DecodeResponse(target, res); err != nil {
10162		return nil, err
10163	}
10164	return ret, nil
10165	// {
10166	//   "description": "Creates a forwarding address.  If ownership verification is required, a\nmessage will be sent to the recipient and the resource's verification\nstatus will be set to \u003ccode\u003epending\u003c/code\u003e; otherwise, the resource will be\ncreated with verification status set to \u003ccode\u003eaccepted\u003c/code\u003e.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
10167	//   "flatPath": "gmail/v1/users/{userId}/settings/forwardingAddresses",
10168	//   "httpMethod": "POST",
10169	//   "id": "gmail.users.settings.forwardingAddresses.create",
10170	//   "parameterOrder": [
10171	//     "userId"
10172	//   ],
10173	//   "parameters": {
10174	//     "userId": {
10175	//       "default": "me",
10176	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
10177	//       "location": "path",
10178	//       "required": true,
10179	//       "type": "string"
10180	//     }
10181	//   },
10182	//   "path": "gmail/v1/users/{userId}/settings/forwardingAddresses",
10183	//   "request": {
10184	//     "$ref": "ForwardingAddress"
10185	//   },
10186	//   "response": {
10187	//     "$ref": "ForwardingAddress"
10188	//   },
10189	//   "scopes": [
10190	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
10191	//   ]
10192	// }
10193
10194}
10195
10196// method id "gmail.users.settings.forwardingAddresses.delete":
10197
10198type UsersSettingsForwardingAddressesDeleteCall struct {
10199	s               *Service
10200	userId          string
10201	forwardingEmail string
10202	urlParams_      gensupport.URLParams
10203	ctx_            context.Context
10204	header_         http.Header
10205}
10206
10207// Delete: Deletes the specified forwarding address and revokes any
10208// verification that
10209// may have been required.
10210//
10211// This method is only available to service account clients that have
10212// been
10213// delegated domain-wide authority.
10214func (r *UsersSettingsForwardingAddressesService) Delete(userId string, forwardingEmail string) *UsersSettingsForwardingAddressesDeleteCall {
10215	c := &UsersSettingsForwardingAddressesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10216	c.userId = userId
10217	c.forwardingEmail = forwardingEmail
10218	return c
10219}
10220
10221// Fields allows partial responses to be retrieved. See
10222// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10223// for more information.
10224func (c *UsersSettingsForwardingAddressesDeleteCall) Fields(s ...googleapi.Field) *UsersSettingsForwardingAddressesDeleteCall {
10225	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10226	return c
10227}
10228
10229// Context sets the context to be used in this call's Do method. Any
10230// pending HTTP request will be aborted if the provided context is
10231// canceled.
10232func (c *UsersSettingsForwardingAddressesDeleteCall) Context(ctx context.Context) *UsersSettingsForwardingAddressesDeleteCall {
10233	c.ctx_ = ctx
10234	return c
10235}
10236
10237// Header returns an http.Header that can be modified by the caller to
10238// add HTTP headers to the request.
10239func (c *UsersSettingsForwardingAddressesDeleteCall) Header() http.Header {
10240	if c.header_ == nil {
10241		c.header_ = make(http.Header)
10242	}
10243	return c.header_
10244}
10245
10246func (c *UsersSettingsForwardingAddressesDeleteCall) doRequest(alt string) (*http.Response, error) {
10247	reqHeaders := make(http.Header)
10248	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
10249	for k, v := range c.header_ {
10250		reqHeaders[k] = v
10251	}
10252	reqHeaders.Set("User-Agent", c.s.userAgent())
10253	var body io.Reader = nil
10254	c.urlParams_.Set("alt", alt)
10255	c.urlParams_.Set("prettyPrint", "false")
10256	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}")
10257	urls += "?" + c.urlParams_.Encode()
10258	req, err := http.NewRequest("DELETE", urls, body)
10259	if err != nil {
10260		return nil, err
10261	}
10262	req.Header = reqHeaders
10263	googleapi.Expand(req.URL, map[string]string{
10264		"userId":          c.userId,
10265		"forwardingEmail": c.forwardingEmail,
10266	})
10267	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10268}
10269
10270// Do executes the "gmail.users.settings.forwardingAddresses.delete" call.
10271func (c *UsersSettingsForwardingAddressesDeleteCall) Do(opts ...googleapi.CallOption) error {
10272	gensupport.SetOptions(c.urlParams_, opts...)
10273	res, err := c.doRequest("json")
10274	if err != nil {
10275		return err
10276	}
10277	defer googleapi.CloseBody(res)
10278	if err := googleapi.CheckResponse(res); err != nil {
10279		return err
10280	}
10281	return nil
10282	// {
10283	//   "description": "Deletes the specified forwarding address and revokes any verification that\nmay have been required.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
10284	//   "flatPath": "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}",
10285	//   "httpMethod": "DELETE",
10286	//   "id": "gmail.users.settings.forwardingAddresses.delete",
10287	//   "parameterOrder": [
10288	//     "userId",
10289	//     "forwardingEmail"
10290	//   ],
10291	//   "parameters": {
10292	//     "forwardingEmail": {
10293	//       "description": "The forwarding address to be deleted.",
10294	//       "location": "path",
10295	//       "required": true,
10296	//       "type": "string"
10297	//     },
10298	//     "userId": {
10299	//       "default": "me",
10300	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
10301	//       "location": "path",
10302	//       "required": true,
10303	//       "type": "string"
10304	//     }
10305	//   },
10306	//   "path": "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}",
10307	//   "scopes": [
10308	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
10309	//   ]
10310	// }
10311
10312}
10313
10314// method id "gmail.users.settings.forwardingAddresses.get":
10315
10316type UsersSettingsForwardingAddressesGetCall struct {
10317	s               *Service
10318	userId          string
10319	forwardingEmail string
10320	urlParams_      gensupport.URLParams
10321	ifNoneMatch_    string
10322	ctx_            context.Context
10323	header_         http.Header
10324}
10325
10326// Get: Gets the specified forwarding address.
10327func (r *UsersSettingsForwardingAddressesService) Get(userId string, forwardingEmail string) *UsersSettingsForwardingAddressesGetCall {
10328	c := &UsersSettingsForwardingAddressesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10329	c.userId = userId
10330	c.forwardingEmail = forwardingEmail
10331	return c
10332}
10333
10334// Fields allows partial responses to be retrieved. See
10335// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10336// for more information.
10337func (c *UsersSettingsForwardingAddressesGetCall) Fields(s ...googleapi.Field) *UsersSettingsForwardingAddressesGetCall {
10338	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10339	return c
10340}
10341
10342// IfNoneMatch sets the optional parameter which makes the operation
10343// fail if the object's ETag matches the given value. This is useful for
10344// getting updates only after the object has changed since the last
10345// request. Use googleapi.IsNotModified to check whether the response
10346// error from Do is the result of In-None-Match.
10347func (c *UsersSettingsForwardingAddressesGetCall) IfNoneMatch(entityTag string) *UsersSettingsForwardingAddressesGetCall {
10348	c.ifNoneMatch_ = entityTag
10349	return c
10350}
10351
10352// Context sets the context to be used in this call's Do method. Any
10353// pending HTTP request will be aborted if the provided context is
10354// canceled.
10355func (c *UsersSettingsForwardingAddressesGetCall) Context(ctx context.Context) *UsersSettingsForwardingAddressesGetCall {
10356	c.ctx_ = ctx
10357	return c
10358}
10359
10360// Header returns an http.Header that can be modified by the caller to
10361// add HTTP headers to the request.
10362func (c *UsersSettingsForwardingAddressesGetCall) Header() http.Header {
10363	if c.header_ == nil {
10364		c.header_ = make(http.Header)
10365	}
10366	return c.header_
10367}
10368
10369func (c *UsersSettingsForwardingAddressesGetCall) doRequest(alt string) (*http.Response, error) {
10370	reqHeaders := make(http.Header)
10371	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
10372	for k, v := range c.header_ {
10373		reqHeaders[k] = v
10374	}
10375	reqHeaders.Set("User-Agent", c.s.userAgent())
10376	if c.ifNoneMatch_ != "" {
10377		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10378	}
10379	var body io.Reader = nil
10380	c.urlParams_.Set("alt", alt)
10381	c.urlParams_.Set("prettyPrint", "false")
10382	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}")
10383	urls += "?" + c.urlParams_.Encode()
10384	req, err := http.NewRequest("GET", urls, body)
10385	if err != nil {
10386		return nil, err
10387	}
10388	req.Header = reqHeaders
10389	googleapi.Expand(req.URL, map[string]string{
10390		"userId":          c.userId,
10391		"forwardingEmail": c.forwardingEmail,
10392	})
10393	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10394}
10395
10396// Do executes the "gmail.users.settings.forwardingAddresses.get" call.
10397// Exactly one of *ForwardingAddress or error will be non-nil. Any
10398// non-2xx status code is an error. Response headers are in either
10399// *ForwardingAddress.ServerResponse.Header or (if a response was
10400// returned at all) in error.(*googleapi.Error).Header. Use
10401// googleapi.IsNotModified to check whether the returned error was
10402// because http.StatusNotModified was returned.
10403func (c *UsersSettingsForwardingAddressesGetCall) Do(opts ...googleapi.CallOption) (*ForwardingAddress, error) {
10404	gensupport.SetOptions(c.urlParams_, opts...)
10405	res, err := c.doRequest("json")
10406	if res != nil && res.StatusCode == http.StatusNotModified {
10407		if res.Body != nil {
10408			res.Body.Close()
10409		}
10410		return nil, &googleapi.Error{
10411			Code:   res.StatusCode,
10412			Header: res.Header,
10413		}
10414	}
10415	if err != nil {
10416		return nil, err
10417	}
10418	defer googleapi.CloseBody(res)
10419	if err := googleapi.CheckResponse(res); err != nil {
10420		return nil, err
10421	}
10422	ret := &ForwardingAddress{
10423		ServerResponse: googleapi.ServerResponse{
10424			Header:         res.Header,
10425			HTTPStatusCode: res.StatusCode,
10426		},
10427	}
10428	target := &ret
10429	if err := gensupport.DecodeResponse(target, res); err != nil {
10430		return nil, err
10431	}
10432	return ret, nil
10433	// {
10434	//   "description": "Gets the specified forwarding address.",
10435	//   "flatPath": "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}",
10436	//   "httpMethod": "GET",
10437	//   "id": "gmail.users.settings.forwardingAddresses.get",
10438	//   "parameterOrder": [
10439	//     "userId",
10440	//     "forwardingEmail"
10441	//   ],
10442	//   "parameters": {
10443	//     "forwardingEmail": {
10444	//       "description": "The forwarding address to be retrieved.",
10445	//       "location": "path",
10446	//       "required": true,
10447	//       "type": "string"
10448	//     },
10449	//     "userId": {
10450	//       "default": "me",
10451	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
10452	//       "location": "path",
10453	//       "required": true,
10454	//       "type": "string"
10455	//     }
10456	//   },
10457	//   "path": "gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}",
10458	//   "response": {
10459	//     "$ref": "ForwardingAddress"
10460	//   },
10461	//   "scopes": [
10462	//     "https://mail.google.com/",
10463	//     "https://www.googleapis.com/auth/gmail.modify",
10464	//     "https://www.googleapis.com/auth/gmail.readonly",
10465	//     "https://www.googleapis.com/auth/gmail.settings.basic"
10466	//   ]
10467	// }
10468
10469}
10470
10471// method id "gmail.users.settings.forwardingAddresses.list":
10472
10473type UsersSettingsForwardingAddressesListCall struct {
10474	s            *Service
10475	userId       string
10476	urlParams_   gensupport.URLParams
10477	ifNoneMatch_ string
10478	ctx_         context.Context
10479	header_      http.Header
10480}
10481
10482// List: Lists the forwarding addresses for the specified account.
10483func (r *UsersSettingsForwardingAddressesService) List(userId string) *UsersSettingsForwardingAddressesListCall {
10484	c := &UsersSettingsForwardingAddressesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10485	c.userId = userId
10486	return c
10487}
10488
10489// Fields allows partial responses to be retrieved. See
10490// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10491// for more information.
10492func (c *UsersSettingsForwardingAddressesListCall) Fields(s ...googleapi.Field) *UsersSettingsForwardingAddressesListCall {
10493	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10494	return c
10495}
10496
10497// IfNoneMatch sets the optional parameter which makes the operation
10498// fail if the object's ETag matches the given value. This is useful for
10499// getting updates only after the object has changed since the last
10500// request. Use googleapi.IsNotModified to check whether the response
10501// error from Do is the result of In-None-Match.
10502func (c *UsersSettingsForwardingAddressesListCall) IfNoneMatch(entityTag string) *UsersSettingsForwardingAddressesListCall {
10503	c.ifNoneMatch_ = entityTag
10504	return c
10505}
10506
10507// Context sets the context to be used in this call's Do method. Any
10508// pending HTTP request will be aborted if the provided context is
10509// canceled.
10510func (c *UsersSettingsForwardingAddressesListCall) Context(ctx context.Context) *UsersSettingsForwardingAddressesListCall {
10511	c.ctx_ = ctx
10512	return c
10513}
10514
10515// Header returns an http.Header that can be modified by the caller to
10516// add HTTP headers to the request.
10517func (c *UsersSettingsForwardingAddressesListCall) Header() http.Header {
10518	if c.header_ == nil {
10519		c.header_ = make(http.Header)
10520	}
10521	return c.header_
10522}
10523
10524func (c *UsersSettingsForwardingAddressesListCall) doRequest(alt string) (*http.Response, error) {
10525	reqHeaders := make(http.Header)
10526	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
10527	for k, v := range c.header_ {
10528		reqHeaders[k] = v
10529	}
10530	reqHeaders.Set("User-Agent", c.s.userAgent())
10531	if c.ifNoneMatch_ != "" {
10532		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10533	}
10534	var body io.Reader = nil
10535	c.urlParams_.Set("alt", alt)
10536	c.urlParams_.Set("prettyPrint", "false")
10537	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/forwardingAddresses")
10538	urls += "?" + c.urlParams_.Encode()
10539	req, err := http.NewRequest("GET", urls, body)
10540	if err != nil {
10541		return nil, err
10542	}
10543	req.Header = reqHeaders
10544	googleapi.Expand(req.URL, map[string]string{
10545		"userId": c.userId,
10546	})
10547	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10548}
10549
10550// Do executes the "gmail.users.settings.forwardingAddresses.list" call.
10551// Exactly one of *ListForwardingAddressesResponse or error will be
10552// non-nil. Any non-2xx status code is an error. Response headers are in
10553// either *ListForwardingAddressesResponse.ServerResponse.Header or (if
10554// a response was returned at all) in error.(*googleapi.Error).Header.
10555// Use googleapi.IsNotModified to check whether the returned error was
10556// because http.StatusNotModified was returned.
10557func (c *UsersSettingsForwardingAddressesListCall) Do(opts ...googleapi.CallOption) (*ListForwardingAddressesResponse, error) {
10558	gensupport.SetOptions(c.urlParams_, opts...)
10559	res, err := c.doRequest("json")
10560	if res != nil && res.StatusCode == http.StatusNotModified {
10561		if res.Body != nil {
10562			res.Body.Close()
10563		}
10564		return nil, &googleapi.Error{
10565			Code:   res.StatusCode,
10566			Header: res.Header,
10567		}
10568	}
10569	if err != nil {
10570		return nil, err
10571	}
10572	defer googleapi.CloseBody(res)
10573	if err := googleapi.CheckResponse(res); err != nil {
10574		return nil, err
10575	}
10576	ret := &ListForwardingAddressesResponse{
10577		ServerResponse: googleapi.ServerResponse{
10578			Header:         res.Header,
10579			HTTPStatusCode: res.StatusCode,
10580		},
10581	}
10582	target := &ret
10583	if err := gensupport.DecodeResponse(target, res); err != nil {
10584		return nil, err
10585	}
10586	return ret, nil
10587	// {
10588	//   "description": "Lists the forwarding addresses for the specified account.",
10589	//   "flatPath": "gmail/v1/users/{userId}/settings/forwardingAddresses",
10590	//   "httpMethod": "GET",
10591	//   "id": "gmail.users.settings.forwardingAddresses.list",
10592	//   "parameterOrder": [
10593	//     "userId"
10594	//   ],
10595	//   "parameters": {
10596	//     "userId": {
10597	//       "default": "me",
10598	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
10599	//       "location": "path",
10600	//       "required": true,
10601	//       "type": "string"
10602	//     }
10603	//   },
10604	//   "path": "gmail/v1/users/{userId}/settings/forwardingAddresses",
10605	//   "response": {
10606	//     "$ref": "ListForwardingAddressesResponse"
10607	//   },
10608	//   "scopes": [
10609	//     "https://mail.google.com/",
10610	//     "https://www.googleapis.com/auth/gmail.modify",
10611	//     "https://www.googleapis.com/auth/gmail.readonly",
10612	//     "https://www.googleapis.com/auth/gmail.settings.basic"
10613	//   ]
10614	// }
10615
10616}
10617
10618// method id "gmail.users.settings.sendAs.create":
10619
10620type UsersSettingsSendAsCreateCall struct {
10621	s          *Service
10622	userId     string
10623	sendas     *SendAs
10624	urlParams_ gensupport.URLParams
10625	ctx_       context.Context
10626	header_    http.Header
10627}
10628
10629// Create: Creates a custom "from" send-as alias.  If an SMTP MSA is
10630// specified, Gmail
10631// will attempt to connect to the SMTP service to validate the
10632// configuration
10633// before creating the alias.  If ownership verification is required for
10634// the
10635// alias, a message will be sent to the email address and the
10636// resource's
10637// verification status will be set to <code>pending</code>; otherwise,
10638// the
10639// resource will be created with verification status set
10640// to
10641// <code>accepted</code>.  If a signature is provided, Gmail will
10642// sanitize the
10643// HTML before saving it with the alias.
10644//
10645// This method is only available to service account clients that have
10646// been
10647// delegated domain-wide authority.
10648func (r *UsersSettingsSendAsService) Create(userId string, sendas *SendAs) *UsersSettingsSendAsCreateCall {
10649	c := &UsersSettingsSendAsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10650	c.userId = userId
10651	c.sendas = sendas
10652	return c
10653}
10654
10655// Fields allows partial responses to be retrieved. See
10656// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10657// for more information.
10658func (c *UsersSettingsSendAsCreateCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsCreateCall {
10659	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10660	return c
10661}
10662
10663// Context sets the context to be used in this call's Do method. Any
10664// pending HTTP request will be aborted if the provided context is
10665// canceled.
10666func (c *UsersSettingsSendAsCreateCall) Context(ctx context.Context) *UsersSettingsSendAsCreateCall {
10667	c.ctx_ = ctx
10668	return c
10669}
10670
10671// Header returns an http.Header that can be modified by the caller to
10672// add HTTP headers to the request.
10673func (c *UsersSettingsSendAsCreateCall) Header() http.Header {
10674	if c.header_ == nil {
10675		c.header_ = make(http.Header)
10676	}
10677	return c.header_
10678}
10679
10680func (c *UsersSettingsSendAsCreateCall) doRequest(alt string) (*http.Response, error) {
10681	reqHeaders := make(http.Header)
10682	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
10683	for k, v := range c.header_ {
10684		reqHeaders[k] = v
10685	}
10686	reqHeaders.Set("User-Agent", c.s.userAgent())
10687	var body io.Reader = nil
10688	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendas)
10689	if err != nil {
10690		return nil, err
10691	}
10692	reqHeaders.Set("Content-Type", "application/json")
10693	c.urlParams_.Set("alt", alt)
10694	c.urlParams_.Set("prettyPrint", "false")
10695	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs")
10696	urls += "?" + c.urlParams_.Encode()
10697	req, err := http.NewRequest("POST", urls, body)
10698	if err != nil {
10699		return nil, err
10700	}
10701	req.Header = reqHeaders
10702	googleapi.Expand(req.URL, map[string]string{
10703		"userId": c.userId,
10704	})
10705	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10706}
10707
10708// Do executes the "gmail.users.settings.sendAs.create" call.
10709// Exactly one of *SendAs or error will be non-nil. Any non-2xx status
10710// code is an error. Response headers are in either
10711// *SendAs.ServerResponse.Header or (if a response was returned at all)
10712// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10713// check whether the returned error was because http.StatusNotModified
10714// was returned.
10715func (c *UsersSettingsSendAsCreateCall) Do(opts ...googleapi.CallOption) (*SendAs, error) {
10716	gensupport.SetOptions(c.urlParams_, opts...)
10717	res, err := c.doRequest("json")
10718	if res != nil && res.StatusCode == http.StatusNotModified {
10719		if res.Body != nil {
10720			res.Body.Close()
10721		}
10722		return nil, &googleapi.Error{
10723			Code:   res.StatusCode,
10724			Header: res.Header,
10725		}
10726	}
10727	if err != nil {
10728		return nil, err
10729	}
10730	defer googleapi.CloseBody(res)
10731	if err := googleapi.CheckResponse(res); err != nil {
10732		return nil, err
10733	}
10734	ret := &SendAs{
10735		ServerResponse: googleapi.ServerResponse{
10736			Header:         res.Header,
10737			HTTPStatusCode: res.StatusCode,
10738		},
10739	}
10740	target := &ret
10741	if err := gensupport.DecodeResponse(target, res); err != nil {
10742		return nil, err
10743	}
10744	return ret, nil
10745	// {
10746	//   "description": "Creates a custom \"from\" send-as alias.  If an SMTP MSA is specified, Gmail\nwill attempt to connect to the SMTP service to validate the configuration\nbefore creating the alias.  If ownership verification is required for the\nalias, a message will be sent to the email address and the resource's\nverification status will be set to \u003ccode\u003epending\u003c/code\u003e; otherwise, the\nresource will be created with verification status set to\n\u003ccode\u003eaccepted\u003c/code\u003e.  If a signature is provided, Gmail will sanitize the\nHTML before saving it with the alias.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
10747	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs",
10748	//   "httpMethod": "POST",
10749	//   "id": "gmail.users.settings.sendAs.create",
10750	//   "parameterOrder": [
10751	//     "userId"
10752	//   ],
10753	//   "parameters": {
10754	//     "userId": {
10755	//       "default": "me",
10756	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
10757	//       "location": "path",
10758	//       "required": true,
10759	//       "type": "string"
10760	//     }
10761	//   },
10762	//   "path": "gmail/v1/users/{userId}/settings/sendAs",
10763	//   "request": {
10764	//     "$ref": "SendAs"
10765	//   },
10766	//   "response": {
10767	//     "$ref": "SendAs"
10768	//   },
10769	//   "scopes": [
10770	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
10771	//   ]
10772	// }
10773
10774}
10775
10776// method id "gmail.users.settings.sendAs.delete":
10777
10778type UsersSettingsSendAsDeleteCall struct {
10779	s           *Service
10780	userId      string
10781	sendAsEmail string
10782	urlParams_  gensupport.URLParams
10783	ctx_        context.Context
10784	header_     http.Header
10785}
10786
10787// Delete: Deletes the specified send-as alias.  Revokes any
10788// verification that may
10789// have been required for using it.
10790//
10791// This method is only available to service account clients that have
10792// been
10793// delegated domain-wide authority.
10794func (r *UsersSettingsSendAsService) Delete(userId string, sendAsEmail string) *UsersSettingsSendAsDeleteCall {
10795	c := &UsersSettingsSendAsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10796	c.userId = userId
10797	c.sendAsEmail = sendAsEmail
10798	return c
10799}
10800
10801// Fields allows partial responses to be retrieved. See
10802// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10803// for more information.
10804func (c *UsersSettingsSendAsDeleteCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsDeleteCall {
10805	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10806	return c
10807}
10808
10809// Context sets the context to be used in this call's Do method. Any
10810// pending HTTP request will be aborted if the provided context is
10811// canceled.
10812func (c *UsersSettingsSendAsDeleteCall) Context(ctx context.Context) *UsersSettingsSendAsDeleteCall {
10813	c.ctx_ = ctx
10814	return c
10815}
10816
10817// Header returns an http.Header that can be modified by the caller to
10818// add HTTP headers to the request.
10819func (c *UsersSettingsSendAsDeleteCall) Header() http.Header {
10820	if c.header_ == nil {
10821		c.header_ = make(http.Header)
10822	}
10823	return c.header_
10824}
10825
10826func (c *UsersSettingsSendAsDeleteCall) doRequest(alt string) (*http.Response, error) {
10827	reqHeaders := make(http.Header)
10828	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
10829	for k, v := range c.header_ {
10830		reqHeaders[k] = v
10831	}
10832	reqHeaders.Set("User-Agent", c.s.userAgent())
10833	var body io.Reader = nil
10834	c.urlParams_.Set("alt", alt)
10835	c.urlParams_.Set("prettyPrint", "false")
10836	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}")
10837	urls += "?" + c.urlParams_.Encode()
10838	req, err := http.NewRequest("DELETE", urls, body)
10839	if err != nil {
10840		return nil, err
10841	}
10842	req.Header = reqHeaders
10843	googleapi.Expand(req.URL, map[string]string{
10844		"userId":      c.userId,
10845		"sendAsEmail": c.sendAsEmail,
10846	})
10847	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10848}
10849
10850// Do executes the "gmail.users.settings.sendAs.delete" call.
10851func (c *UsersSettingsSendAsDeleteCall) Do(opts ...googleapi.CallOption) error {
10852	gensupport.SetOptions(c.urlParams_, opts...)
10853	res, err := c.doRequest("json")
10854	if err != nil {
10855		return err
10856	}
10857	defer googleapi.CloseBody(res)
10858	if err := googleapi.CheckResponse(res); err != nil {
10859		return err
10860	}
10861	return nil
10862	// {
10863	//   "description": "Deletes the specified send-as alias.  Revokes any verification that may\nhave been required for using it.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
10864	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
10865	//   "httpMethod": "DELETE",
10866	//   "id": "gmail.users.settings.sendAs.delete",
10867	//   "parameterOrder": [
10868	//     "userId",
10869	//     "sendAsEmail"
10870	//   ],
10871	//   "parameters": {
10872	//     "sendAsEmail": {
10873	//       "description": "The send-as alias to be deleted.",
10874	//       "location": "path",
10875	//       "required": true,
10876	//       "type": "string"
10877	//     },
10878	//     "userId": {
10879	//       "default": "me",
10880	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
10881	//       "location": "path",
10882	//       "required": true,
10883	//       "type": "string"
10884	//     }
10885	//   },
10886	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
10887	//   "scopes": [
10888	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
10889	//   ]
10890	// }
10891
10892}
10893
10894// method id "gmail.users.settings.sendAs.get":
10895
10896type UsersSettingsSendAsGetCall struct {
10897	s            *Service
10898	userId       string
10899	sendAsEmail  string
10900	urlParams_   gensupport.URLParams
10901	ifNoneMatch_ string
10902	ctx_         context.Context
10903	header_      http.Header
10904}
10905
10906// Get: Gets the specified send-as alias.  Fails with an HTTP 404 error
10907// if the
10908// specified address is not a member of the collection.
10909func (r *UsersSettingsSendAsService) Get(userId string, sendAsEmail string) *UsersSettingsSendAsGetCall {
10910	c := &UsersSettingsSendAsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10911	c.userId = userId
10912	c.sendAsEmail = sendAsEmail
10913	return c
10914}
10915
10916// Fields allows partial responses to be retrieved. See
10917// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10918// for more information.
10919func (c *UsersSettingsSendAsGetCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsGetCall {
10920	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10921	return c
10922}
10923
10924// IfNoneMatch sets the optional parameter which makes the operation
10925// fail if the object's ETag matches the given value. This is useful for
10926// getting updates only after the object has changed since the last
10927// request. Use googleapi.IsNotModified to check whether the response
10928// error from Do is the result of In-None-Match.
10929func (c *UsersSettingsSendAsGetCall) IfNoneMatch(entityTag string) *UsersSettingsSendAsGetCall {
10930	c.ifNoneMatch_ = entityTag
10931	return c
10932}
10933
10934// Context sets the context to be used in this call's Do method. Any
10935// pending HTTP request will be aborted if the provided context is
10936// canceled.
10937func (c *UsersSettingsSendAsGetCall) Context(ctx context.Context) *UsersSettingsSendAsGetCall {
10938	c.ctx_ = ctx
10939	return c
10940}
10941
10942// Header returns an http.Header that can be modified by the caller to
10943// add HTTP headers to the request.
10944func (c *UsersSettingsSendAsGetCall) Header() http.Header {
10945	if c.header_ == nil {
10946		c.header_ = make(http.Header)
10947	}
10948	return c.header_
10949}
10950
10951func (c *UsersSettingsSendAsGetCall) doRequest(alt string) (*http.Response, error) {
10952	reqHeaders := make(http.Header)
10953	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
10954	for k, v := range c.header_ {
10955		reqHeaders[k] = v
10956	}
10957	reqHeaders.Set("User-Agent", c.s.userAgent())
10958	if c.ifNoneMatch_ != "" {
10959		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10960	}
10961	var body io.Reader = nil
10962	c.urlParams_.Set("alt", alt)
10963	c.urlParams_.Set("prettyPrint", "false")
10964	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}")
10965	urls += "?" + c.urlParams_.Encode()
10966	req, err := http.NewRequest("GET", urls, body)
10967	if err != nil {
10968		return nil, err
10969	}
10970	req.Header = reqHeaders
10971	googleapi.Expand(req.URL, map[string]string{
10972		"userId":      c.userId,
10973		"sendAsEmail": c.sendAsEmail,
10974	})
10975	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10976}
10977
10978// Do executes the "gmail.users.settings.sendAs.get" call.
10979// Exactly one of *SendAs or error will be non-nil. Any non-2xx status
10980// code is an error. Response headers are in either
10981// *SendAs.ServerResponse.Header or (if a response was returned at all)
10982// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10983// check whether the returned error was because http.StatusNotModified
10984// was returned.
10985func (c *UsersSettingsSendAsGetCall) Do(opts ...googleapi.CallOption) (*SendAs, error) {
10986	gensupport.SetOptions(c.urlParams_, opts...)
10987	res, err := c.doRequest("json")
10988	if res != nil && res.StatusCode == http.StatusNotModified {
10989		if res.Body != nil {
10990			res.Body.Close()
10991		}
10992		return nil, &googleapi.Error{
10993			Code:   res.StatusCode,
10994			Header: res.Header,
10995		}
10996	}
10997	if err != nil {
10998		return nil, err
10999	}
11000	defer googleapi.CloseBody(res)
11001	if err := googleapi.CheckResponse(res); err != nil {
11002		return nil, err
11003	}
11004	ret := &SendAs{
11005		ServerResponse: googleapi.ServerResponse{
11006			Header:         res.Header,
11007			HTTPStatusCode: res.StatusCode,
11008		},
11009	}
11010	target := &ret
11011	if err := gensupport.DecodeResponse(target, res); err != nil {
11012		return nil, err
11013	}
11014	return ret, nil
11015	// {
11016	//   "description": "Gets the specified send-as alias.  Fails with an HTTP 404 error if the\nspecified address is not a member of the collection.",
11017	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
11018	//   "httpMethod": "GET",
11019	//   "id": "gmail.users.settings.sendAs.get",
11020	//   "parameterOrder": [
11021	//     "userId",
11022	//     "sendAsEmail"
11023	//   ],
11024	//   "parameters": {
11025	//     "sendAsEmail": {
11026	//       "description": "The send-as alias to be retrieved.",
11027	//       "location": "path",
11028	//       "required": true,
11029	//       "type": "string"
11030	//     },
11031	//     "userId": {
11032	//       "default": "me",
11033	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
11034	//       "location": "path",
11035	//       "required": true,
11036	//       "type": "string"
11037	//     }
11038	//   },
11039	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
11040	//   "response": {
11041	//     "$ref": "SendAs"
11042	//   },
11043	//   "scopes": [
11044	//     "https://mail.google.com/",
11045	//     "https://www.googleapis.com/auth/gmail.modify",
11046	//     "https://www.googleapis.com/auth/gmail.readonly",
11047	//     "https://www.googleapis.com/auth/gmail.settings.basic"
11048	//   ]
11049	// }
11050
11051}
11052
11053// method id "gmail.users.settings.sendAs.list":
11054
11055type UsersSettingsSendAsListCall struct {
11056	s            *Service
11057	userId       string
11058	urlParams_   gensupport.URLParams
11059	ifNoneMatch_ string
11060	ctx_         context.Context
11061	header_      http.Header
11062}
11063
11064// List: Lists the send-as aliases for the specified account.  The
11065// result includes
11066// the primary send-as address associated with the account as well as
11067// any
11068// custom "from" aliases.
11069func (r *UsersSettingsSendAsService) List(userId string) *UsersSettingsSendAsListCall {
11070	c := &UsersSettingsSendAsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11071	c.userId = userId
11072	return c
11073}
11074
11075// Fields allows partial responses to be retrieved. See
11076// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11077// for more information.
11078func (c *UsersSettingsSendAsListCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsListCall {
11079	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11080	return c
11081}
11082
11083// IfNoneMatch sets the optional parameter which makes the operation
11084// fail if the object's ETag matches the given value. This is useful for
11085// getting updates only after the object has changed since the last
11086// request. Use googleapi.IsNotModified to check whether the response
11087// error from Do is the result of In-None-Match.
11088func (c *UsersSettingsSendAsListCall) IfNoneMatch(entityTag string) *UsersSettingsSendAsListCall {
11089	c.ifNoneMatch_ = entityTag
11090	return c
11091}
11092
11093// Context sets the context to be used in this call's Do method. Any
11094// pending HTTP request will be aborted if the provided context is
11095// canceled.
11096func (c *UsersSettingsSendAsListCall) Context(ctx context.Context) *UsersSettingsSendAsListCall {
11097	c.ctx_ = ctx
11098	return c
11099}
11100
11101// Header returns an http.Header that can be modified by the caller to
11102// add HTTP headers to the request.
11103func (c *UsersSettingsSendAsListCall) Header() http.Header {
11104	if c.header_ == nil {
11105		c.header_ = make(http.Header)
11106	}
11107	return c.header_
11108}
11109
11110func (c *UsersSettingsSendAsListCall) doRequest(alt string) (*http.Response, error) {
11111	reqHeaders := make(http.Header)
11112	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
11113	for k, v := range c.header_ {
11114		reqHeaders[k] = v
11115	}
11116	reqHeaders.Set("User-Agent", c.s.userAgent())
11117	if c.ifNoneMatch_ != "" {
11118		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11119	}
11120	var body io.Reader = nil
11121	c.urlParams_.Set("alt", alt)
11122	c.urlParams_.Set("prettyPrint", "false")
11123	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs")
11124	urls += "?" + c.urlParams_.Encode()
11125	req, err := http.NewRequest("GET", urls, body)
11126	if err != nil {
11127		return nil, err
11128	}
11129	req.Header = reqHeaders
11130	googleapi.Expand(req.URL, map[string]string{
11131		"userId": c.userId,
11132	})
11133	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11134}
11135
11136// Do executes the "gmail.users.settings.sendAs.list" call.
11137// Exactly one of *ListSendAsResponse or error will be non-nil. Any
11138// non-2xx status code is an error. Response headers are in either
11139// *ListSendAsResponse.ServerResponse.Header or (if a response was
11140// returned at all) in error.(*googleapi.Error).Header. Use
11141// googleapi.IsNotModified to check whether the returned error was
11142// because http.StatusNotModified was returned.
11143func (c *UsersSettingsSendAsListCall) Do(opts ...googleapi.CallOption) (*ListSendAsResponse, error) {
11144	gensupport.SetOptions(c.urlParams_, opts...)
11145	res, err := c.doRequest("json")
11146	if res != nil && res.StatusCode == http.StatusNotModified {
11147		if res.Body != nil {
11148			res.Body.Close()
11149		}
11150		return nil, &googleapi.Error{
11151			Code:   res.StatusCode,
11152			Header: res.Header,
11153		}
11154	}
11155	if err != nil {
11156		return nil, err
11157	}
11158	defer googleapi.CloseBody(res)
11159	if err := googleapi.CheckResponse(res); err != nil {
11160		return nil, err
11161	}
11162	ret := &ListSendAsResponse{
11163		ServerResponse: googleapi.ServerResponse{
11164			Header:         res.Header,
11165			HTTPStatusCode: res.StatusCode,
11166		},
11167	}
11168	target := &ret
11169	if err := gensupport.DecodeResponse(target, res); err != nil {
11170		return nil, err
11171	}
11172	return ret, nil
11173	// {
11174	//   "description": "Lists the send-as aliases for the specified account.  The result includes\nthe primary send-as address associated with the account as well as any\ncustom \"from\" aliases.",
11175	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs",
11176	//   "httpMethod": "GET",
11177	//   "id": "gmail.users.settings.sendAs.list",
11178	//   "parameterOrder": [
11179	//     "userId"
11180	//   ],
11181	//   "parameters": {
11182	//     "userId": {
11183	//       "default": "me",
11184	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
11185	//       "location": "path",
11186	//       "required": true,
11187	//       "type": "string"
11188	//     }
11189	//   },
11190	//   "path": "gmail/v1/users/{userId}/settings/sendAs",
11191	//   "response": {
11192	//     "$ref": "ListSendAsResponse"
11193	//   },
11194	//   "scopes": [
11195	//     "https://mail.google.com/",
11196	//     "https://www.googleapis.com/auth/gmail.modify",
11197	//     "https://www.googleapis.com/auth/gmail.readonly",
11198	//     "https://www.googleapis.com/auth/gmail.settings.basic"
11199	//   ]
11200	// }
11201
11202}
11203
11204// method id "gmail.users.settings.sendAs.patch":
11205
11206type UsersSettingsSendAsPatchCall struct {
11207	s           *Service
11208	userId      string
11209	sendAsEmail string
11210	sendas      *SendAs
11211	urlParams_  gensupport.URLParams
11212	ctx_        context.Context
11213	header_     http.Header
11214}
11215
11216// Patch: Patch the specified send-as alias.
11217func (r *UsersSettingsSendAsService) Patch(userId string, sendAsEmail string, sendas *SendAs) *UsersSettingsSendAsPatchCall {
11218	c := &UsersSettingsSendAsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11219	c.userId = userId
11220	c.sendAsEmail = sendAsEmail
11221	c.sendas = sendas
11222	return c
11223}
11224
11225// Fields allows partial responses to be retrieved. See
11226// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11227// for more information.
11228func (c *UsersSettingsSendAsPatchCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsPatchCall {
11229	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11230	return c
11231}
11232
11233// Context sets the context to be used in this call's Do method. Any
11234// pending HTTP request will be aborted if the provided context is
11235// canceled.
11236func (c *UsersSettingsSendAsPatchCall) Context(ctx context.Context) *UsersSettingsSendAsPatchCall {
11237	c.ctx_ = ctx
11238	return c
11239}
11240
11241// Header returns an http.Header that can be modified by the caller to
11242// add HTTP headers to the request.
11243func (c *UsersSettingsSendAsPatchCall) Header() http.Header {
11244	if c.header_ == nil {
11245		c.header_ = make(http.Header)
11246	}
11247	return c.header_
11248}
11249
11250func (c *UsersSettingsSendAsPatchCall) doRequest(alt string) (*http.Response, error) {
11251	reqHeaders := make(http.Header)
11252	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
11253	for k, v := range c.header_ {
11254		reqHeaders[k] = v
11255	}
11256	reqHeaders.Set("User-Agent", c.s.userAgent())
11257	var body io.Reader = nil
11258	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendas)
11259	if err != nil {
11260		return nil, err
11261	}
11262	reqHeaders.Set("Content-Type", "application/json")
11263	c.urlParams_.Set("alt", alt)
11264	c.urlParams_.Set("prettyPrint", "false")
11265	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}")
11266	urls += "?" + c.urlParams_.Encode()
11267	req, err := http.NewRequest("PATCH", urls, body)
11268	if err != nil {
11269		return nil, err
11270	}
11271	req.Header = reqHeaders
11272	googleapi.Expand(req.URL, map[string]string{
11273		"userId":      c.userId,
11274		"sendAsEmail": c.sendAsEmail,
11275	})
11276	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11277}
11278
11279// Do executes the "gmail.users.settings.sendAs.patch" call.
11280// Exactly one of *SendAs or error will be non-nil. Any non-2xx status
11281// code is an error. Response headers are in either
11282// *SendAs.ServerResponse.Header or (if a response was returned at all)
11283// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11284// check whether the returned error was because http.StatusNotModified
11285// was returned.
11286func (c *UsersSettingsSendAsPatchCall) Do(opts ...googleapi.CallOption) (*SendAs, error) {
11287	gensupport.SetOptions(c.urlParams_, opts...)
11288	res, err := c.doRequest("json")
11289	if res != nil && res.StatusCode == http.StatusNotModified {
11290		if res.Body != nil {
11291			res.Body.Close()
11292		}
11293		return nil, &googleapi.Error{
11294			Code:   res.StatusCode,
11295			Header: res.Header,
11296		}
11297	}
11298	if err != nil {
11299		return nil, err
11300	}
11301	defer googleapi.CloseBody(res)
11302	if err := googleapi.CheckResponse(res); err != nil {
11303		return nil, err
11304	}
11305	ret := &SendAs{
11306		ServerResponse: googleapi.ServerResponse{
11307			Header:         res.Header,
11308			HTTPStatusCode: res.StatusCode,
11309		},
11310	}
11311	target := &ret
11312	if err := gensupport.DecodeResponse(target, res); err != nil {
11313		return nil, err
11314	}
11315	return ret, nil
11316	// {
11317	//   "description": "Patch the specified send-as alias.",
11318	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
11319	//   "httpMethod": "PATCH",
11320	//   "id": "gmail.users.settings.sendAs.patch",
11321	//   "parameterOrder": [
11322	//     "userId",
11323	//     "sendAsEmail"
11324	//   ],
11325	//   "parameters": {
11326	//     "sendAsEmail": {
11327	//       "description": "The send-as alias to be updated.",
11328	//       "location": "path",
11329	//       "required": true,
11330	//       "type": "string"
11331	//     },
11332	//     "userId": {
11333	//       "default": "me",
11334	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
11335	//       "location": "path",
11336	//       "required": true,
11337	//       "type": "string"
11338	//     }
11339	//   },
11340	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
11341	//   "request": {
11342	//     "$ref": "SendAs"
11343	//   },
11344	//   "response": {
11345	//     "$ref": "SendAs"
11346	//   },
11347	//   "scopes": [
11348	//     "https://www.googleapis.com/auth/gmail.settings.basic",
11349	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
11350	//   ]
11351	// }
11352
11353}
11354
11355// method id "gmail.users.settings.sendAs.update":
11356
11357type UsersSettingsSendAsUpdateCall struct {
11358	s           *Service
11359	userId      string
11360	sendAsEmail string
11361	sendas      *SendAs
11362	urlParams_  gensupport.URLParams
11363	ctx_        context.Context
11364	header_     http.Header
11365}
11366
11367// Update: Updates a send-as alias.  If a signature is provided, Gmail
11368// will sanitize
11369// the HTML before saving it with the alias.
11370//
11371// Addresses other than the primary address for the account can only
11372// be
11373// updated by service account clients that have been delegated
11374// domain-wide
11375// authority.
11376func (r *UsersSettingsSendAsService) Update(userId string, sendAsEmail string, sendas *SendAs) *UsersSettingsSendAsUpdateCall {
11377	c := &UsersSettingsSendAsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11378	c.userId = userId
11379	c.sendAsEmail = sendAsEmail
11380	c.sendas = sendas
11381	return c
11382}
11383
11384// Fields allows partial responses to be retrieved. See
11385// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11386// for more information.
11387func (c *UsersSettingsSendAsUpdateCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsUpdateCall {
11388	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11389	return c
11390}
11391
11392// Context sets the context to be used in this call's Do method. Any
11393// pending HTTP request will be aborted if the provided context is
11394// canceled.
11395func (c *UsersSettingsSendAsUpdateCall) Context(ctx context.Context) *UsersSettingsSendAsUpdateCall {
11396	c.ctx_ = ctx
11397	return c
11398}
11399
11400// Header returns an http.Header that can be modified by the caller to
11401// add HTTP headers to the request.
11402func (c *UsersSettingsSendAsUpdateCall) Header() http.Header {
11403	if c.header_ == nil {
11404		c.header_ = make(http.Header)
11405	}
11406	return c.header_
11407}
11408
11409func (c *UsersSettingsSendAsUpdateCall) doRequest(alt string) (*http.Response, error) {
11410	reqHeaders := make(http.Header)
11411	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
11412	for k, v := range c.header_ {
11413		reqHeaders[k] = v
11414	}
11415	reqHeaders.Set("User-Agent", c.s.userAgent())
11416	var body io.Reader = nil
11417	body, err := googleapi.WithoutDataWrapper.JSONReader(c.sendas)
11418	if err != nil {
11419		return nil, err
11420	}
11421	reqHeaders.Set("Content-Type", "application/json")
11422	c.urlParams_.Set("alt", alt)
11423	c.urlParams_.Set("prettyPrint", "false")
11424	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}")
11425	urls += "?" + c.urlParams_.Encode()
11426	req, err := http.NewRequest("PUT", urls, body)
11427	if err != nil {
11428		return nil, err
11429	}
11430	req.Header = reqHeaders
11431	googleapi.Expand(req.URL, map[string]string{
11432		"userId":      c.userId,
11433		"sendAsEmail": c.sendAsEmail,
11434	})
11435	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11436}
11437
11438// Do executes the "gmail.users.settings.sendAs.update" call.
11439// Exactly one of *SendAs or error will be non-nil. Any non-2xx status
11440// code is an error. Response headers are in either
11441// *SendAs.ServerResponse.Header or (if a response was returned at all)
11442// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11443// check whether the returned error was because http.StatusNotModified
11444// was returned.
11445func (c *UsersSettingsSendAsUpdateCall) Do(opts ...googleapi.CallOption) (*SendAs, error) {
11446	gensupport.SetOptions(c.urlParams_, opts...)
11447	res, err := c.doRequest("json")
11448	if res != nil && res.StatusCode == http.StatusNotModified {
11449		if res.Body != nil {
11450			res.Body.Close()
11451		}
11452		return nil, &googleapi.Error{
11453			Code:   res.StatusCode,
11454			Header: res.Header,
11455		}
11456	}
11457	if err != nil {
11458		return nil, err
11459	}
11460	defer googleapi.CloseBody(res)
11461	if err := googleapi.CheckResponse(res); err != nil {
11462		return nil, err
11463	}
11464	ret := &SendAs{
11465		ServerResponse: googleapi.ServerResponse{
11466			Header:         res.Header,
11467			HTTPStatusCode: res.StatusCode,
11468		},
11469	}
11470	target := &ret
11471	if err := gensupport.DecodeResponse(target, res); err != nil {
11472		return nil, err
11473	}
11474	return ret, nil
11475	// {
11476	//   "description": "Updates a send-as alias.  If a signature is provided, Gmail will sanitize\nthe HTML before saving it with the alias.\n\nAddresses other than the primary address for the account can only be\nupdated by service account clients that have been delegated domain-wide\nauthority.",
11477	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
11478	//   "httpMethod": "PUT",
11479	//   "id": "gmail.users.settings.sendAs.update",
11480	//   "parameterOrder": [
11481	//     "userId",
11482	//     "sendAsEmail"
11483	//   ],
11484	//   "parameters": {
11485	//     "sendAsEmail": {
11486	//       "description": "The send-as alias to be updated.",
11487	//       "location": "path",
11488	//       "required": true,
11489	//       "type": "string"
11490	//     },
11491	//     "userId": {
11492	//       "default": "me",
11493	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
11494	//       "location": "path",
11495	//       "required": true,
11496	//       "type": "string"
11497	//     }
11498	//   },
11499	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}",
11500	//   "request": {
11501	//     "$ref": "SendAs"
11502	//   },
11503	//   "response": {
11504	//     "$ref": "SendAs"
11505	//   },
11506	//   "scopes": [
11507	//     "https://www.googleapis.com/auth/gmail.settings.basic",
11508	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
11509	//   ]
11510	// }
11511
11512}
11513
11514// method id "gmail.users.settings.sendAs.verify":
11515
11516type UsersSettingsSendAsVerifyCall struct {
11517	s           *Service
11518	userId      string
11519	sendAsEmail string
11520	urlParams_  gensupport.URLParams
11521	ctx_        context.Context
11522	header_     http.Header
11523}
11524
11525// Verify: Sends a verification email to the specified send-as alias
11526// address.
11527// The verification status must be <code>pending</code>.
11528//
11529// This method is only available to service account clients that have
11530// been
11531// delegated domain-wide authority.
11532func (r *UsersSettingsSendAsService) Verify(userId string, sendAsEmail string) *UsersSettingsSendAsVerifyCall {
11533	c := &UsersSettingsSendAsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11534	c.userId = userId
11535	c.sendAsEmail = sendAsEmail
11536	return c
11537}
11538
11539// Fields allows partial responses to be retrieved. See
11540// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11541// for more information.
11542func (c *UsersSettingsSendAsVerifyCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsVerifyCall {
11543	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11544	return c
11545}
11546
11547// Context sets the context to be used in this call's Do method. Any
11548// pending HTTP request will be aborted if the provided context is
11549// canceled.
11550func (c *UsersSettingsSendAsVerifyCall) Context(ctx context.Context) *UsersSettingsSendAsVerifyCall {
11551	c.ctx_ = ctx
11552	return c
11553}
11554
11555// Header returns an http.Header that can be modified by the caller to
11556// add HTTP headers to the request.
11557func (c *UsersSettingsSendAsVerifyCall) Header() http.Header {
11558	if c.header_ == nil {
11559		c.header_ = make(http.Header)
11560	}
11561	return c.header_
11562}
11563
11564func (c *UsersSettingsSendAsVerifyCall) doRequest(alt string) (*http.Response, error) {
11565	reqHeaders := make(http.Header)
11566	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
11567	for k, v := range c.header_ {
11568		reqHeaders[k] = v
11569	}
11570	reqHeaders.Set("User-Agent", c.s.userAgent())
11571	var body io.Reader = nil
11572	c.urlParams_.Set("alt", alt)
11573	c.urlParams_.Set("prettyPrint", "false")
11574	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify")
11575	urls += "?" + c.urlParams_.Encode()
11576	req, err := http.NewRequest("POST", urls, body)
11577	if err != nil {
11578		return nil, err
11579	}
11580	req.Header = reqHeaders
11581	googleapi.Expand(req.URL, map[string]string{
11582		"userId":      c.userId,
11583		"sendAsEmail": c.sendAsEmail,
11584	})
11585	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11586}
11587
11588// Do executes the "gmail.users.settings.sendAs.verify" call.
11589func (c *UsersSettingsSendAsVerifyCall) Do(opts ...googleapi.CallOption) error {
11590	gensupport.SetOptions(c.urlParams_, opts...)
11591	res, err := c.doRequest("json")
11592	if err != nil {
11593		return err
11594	}
11595	defer googleapi.CloseBody(res)
11596	if err := googleapi.CheckResponse(res); err != nil {
11597		return err
11598	}
11599	return nil
11600	// {
11601	//   "description": "Sends a verification email to the specified send-as alias address.\nThe verification status must be \u003ccode\u003epending\u003c/code\u003e.\n\nThis method is only available to service account clients that have been\ndelegated domain-wide authority.",
11602	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify",
11603	//   "httpMethod": "POST",
11604	//   "id": "gmail.users.settings.sendAs.verify",
11605	//   "parameterOrder": [
11606	//     "userId",
11607	//     "sendAsEmail"
11608	//   ],
11609	//   "parameters": {
11610	//     "sendAsEmail": {
11611	//       "description": "The send-as alias to be verified.",
11612	//       "location": "path",
11613	//       "required": true,
11614	//       "type": "string"
11615	//     },
11616	//     "userId": {
11617	//       "default": "me",
11618	//       "description": "User's email address.  The special value \"me\"\ncan be used to indicate the authenticated user.",
11619	//       "location": "path",
11620	//       "required": true,
11621	//       "type": "string"
11622	//     }
11623	//   },
11624	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify",
11625	//   "scopes": [
11626	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
11627	//   ]
11628	// }
11629
11630}
11631
11632// method id "gmail.users.settings.sendAs.smimeInfo.delete":
11633
11634type UsersSettingsSendAsSmimeInfoDeleteCall struct {
11635	s           *Service
11636	userId      string
11637	sendAsEmail string
11638	id          string
11639	urlParams_  gensupport.URLParams
11640	ctx_        context.Context
11641	header_     http.Header
11642}
11643
11644// Delete: Deletes the specified S/MIME config for the specified send-as
11645// alias.
11646func (r *UsersSettingsSendAsSmimeInfoService) Delete(userId string, sendAsEmail string, id string) *UsersSettingsSendAsSmimeInfoDeleteCall {
11647	c := &UsersSettingsSendAsSmimeInfoDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11648	c.userId = userId
11649	c.sendAsEmail = sendAsEmail
11650	c.id = id
11651	return c
11652}
11653
11654// Fields allows partial responses to be retrieved. See
11655// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11656// for more information.
11657func (c *UsersSettingsSendAsSmimeInfoDeleteCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsSmimeInfoDeleteCall {
11658	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11659	return c
11660}
11661
11662// Context sets the context to be used in this call's Do method. Any
11663// pending HTTP request will be aborted if the provided context is
11664// canceled.
11665func (c *UsersSettingsSendAsSmimeInfoDeleteCall) Context(ctx context.Context) *UsersSettingsSendAsSmimeInfoDeleteCall {
11666	c.ctx_ = ctx
11667	return c
11668}
11669
11670// Header returns an http.Header that can be modified by the caller to
11671// add HTTP headers to the request.
11672func (c *UsersSettingsSendAsSmimeInfoDeleteCall) Header() http.Header {
11673	if c.header_ == nil {
11674		c.header_ = make(http.Header)
11675	}
11676	return c.header_
11677}
11678
11679func (c *UsersSettingsSendAsSmimeInfoDeleteCall) doRequest(alt string) (*http.Response, error) {
11680	reqHeaders := make(http.Header)
11681	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
11682	for k, v := range c.header_ {
11683		reqHeaders[k] = v
11684	}
11685	reqHeaders.Set("User-Agent", c.s.userAgent())
11686	var body io.Reader = nil
11687	c.urlParams_.Set("alt", alt)
11688	c.urlParams_.Set("prettyPrint", "false")
11689	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}")
11690	urls += "?" + c.urlParams_.Encode()
11691	req, err := http.NewRequest("DELETE", urls, body)
11692	if err != nil {
11693		return nil, err
11694	}
11695	req.Header = reqHeaders
11696	googleapi.Expand(req.URL, map[string]string{
11697		"userId":      c.userId,
11698		"sendAsEmail": c.sendAsEmail,
11699		"id":          c.id,
11700	})
11701	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11702}
11703
11704// Do executes the "gmail.users.settings.sendAs.smimeInfo.delete" call.
11705func (c *UsersSettingsSendAsSmimeInfoDeleteCall) Do(opts ...googleapi.CallOption) error {
11706	gensupport.SetOptions(c.urlParams_, opts...)
11707	res, err := c.doRequest("json")
11708	if err != nil {
11709		return err
11710	}
11711	defer googleapi.CloseBody(res)
11712	if err := googleapi.CheckResponse(res); err != nil {
11713		return err
11714	}
11715	return nil
11716	// {
11717	//   "description": "Deletes the specified S/MIME config for the specified send-as alias.",
11718	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}",
11719	//   "httpMethod": "DELETE",
11720	//   "id": "gmail.users.settings.sendAs.smimeInfo.delete",
11721	//   "parameterOrder": [
11722	//     "userId",
11723	//     "sendAsEmail",
11724	//     "id"
11725	//   ],
11726	//   "parameters": {
11727	//     "id": {
11728	//       "description": "The immutable ID for the SmimeInfo.",
11729	//       "location": "path",
11730	//       "required": true,
11731	//       "type": "string"
11732	//     },
11733	//     "sendAsEmail": {
11734	//       "description": "The email address that appears in the \"From:\" header for mail sent using\nthis alias.",
11735	//       "location": "path",
11736	//       "required": true,
11737	//       "type": "string"
11738	//     },
11739	//     "userId": {
11740	//       "default": "me",
11741	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
11742	//       "location": "path",
11743	//       "required": true,
11744	//       "type": "string"
11745	//     }
11746	//   },
11747	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}",
11748	//   "scopes": [
11749	//     "https://www.googleapis.com/auth/gmail.settings.basic",
11750	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
11751	//   ]
11752	// }
11753
11754}
11755
11756// method id "gmail.users.settings.sendAs.smimeInfo.get":
11757
11758type UsersSettingsSendAsSmimeInfoGetCall struct {
11759	s            *Service
11760	userId       string
11761	sendAsEmail  string
11762	id           string
11763	urlParams_   gensupport.URLParams
11764	ifNoneMatch_ string
11765	ctx_         context.Context
11766	header_      http.Header
11767}
11768
11769// Get: Gets the specified S/MIME config for the specified send-as
11770// alias.
11771func (r *UsersSettingsSendAsSmimeInfoService) Get(userId string, sendAsEmail string, id string) *UsersSettingsSendAsSmimeInfoGetCall {
11772	c := &UsersSettingsSendAsSmimeInfoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11773	c.userId = userId
11774	c.sendAsEmail = sendAsEmail
11775	c.id = id
11776	return c
11777}
11778
11779// Fields allows partial responses to be retrieved. See
11780// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11781// for more information.
11782func (c *UsersSettingsSendAsSmimeInfoGetCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsSmimeInfoGetCall {
11783	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11784	return c
11785}
11786
11787// IfNoneMatch sets the optional parameter which makes the operation
11788// fail if the object's ETag matches the given value. This is useful for
11789// getting updates only after the object has changed since the last
11790// request. Use googleapi.IsNotModified to check whether the response
11791// error from Do is the result of In-None-Match.
11792func (c *UsersSettingsSendAsSmimeInfoGetCall) IfNoneMatch(entityTag string) *UsersSettingsSendAsSmimeInfoGetCall {
11793	c.ifNoneMatch_ = entityTag
11794	return c
11795}
11796
11797// Context sets the context to be used in this call's Do method. Any
11798// pending HTTP request will be aborted if the provided context is
11799// canceled.
11800func (c *UsersSettingsSendAsSmimeInfoGetCall) Context(ctx context.Context) *UsersSettingsSendAsSmimeInfoGetCall {
11801	c.ctx_ = ctx
11802	return c
11803}
11804
11805// Header returns an http.Header that can be modified by the caller to
11806// add HTTP headers to the request.
11807func (c *UsersSettingsSendAsSmimeInfoGetCall) Header() http.Header {
11808	if c.header_ == nil {
11809		c.header_ = make(http.Header)
11810	}
11811	return c.header_
11812}
11813
11814func (c *UsersSettingsSendAsSmimeInfoGetCall) doRequest(alt string) (*http.Response, error) {
11815	reqHeaders := make(http.Header)
11816	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
11817	for k, v := range c.header_ {
11818		reqHeaders[k] = v
11819	}
11820	reqHeaders.Set("User-Agent", c.s.userAgent())
11821	if c.ifNoneMatch_ != "" {
11822		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11823	}
11824	var body io.Reader = nil
11825	c.urlParams_.Set("alt", alt)
11826	c.urlParams_.Set("prettyPrint", "false")
11827	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}")
11828	urls += "?" + c.urlParams_.Encode()
11829	req, err := http.NewRequest("GET", urls, body)
11830	if err != nil {
11831		return nil, err
11832	}
11833	req.Header = reqHeaders
11834	googleapi.Expand(req.URL, map[string]string{
11835		"userId":      c.userId,
11836		"sendAsEmail": c.sendAsEmail,
11837		"id":          c.id,
11838	})
11839	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11840}
11841
11842// Do executes the "gmail.users.settings.sendAs.smimeInfo.get" call.
11843// Exactly one of *SmimeInfo or error will be non-nil. Any non-2xx
11844// status code is an error. Response headers are in either
11845// *SmimeInfo.ServerResponse.Header or (if a response was returned at
11846// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
11847// to check whether the returned error was because
11848// http.StatusNotModified was returned.
11849func (c *UsersSettingsSendAsSmimeInfoGetCall) Do(opts ...googleapi.CallOption) (*SmimeInfo, error) {
11850	gensupport.SetOptions(c.urlParams_, opts...)
11851	res, err := c.doRequest("json")
11852	if res != nil && res.StatusCode == http.StatusNotModified {
11853		if res.Body != nil {
11854			res.Body.Close()
11855		}
11856		return nil, &googleapi.Error{
11857			Code:   res.StatusCode,
11858			Header: res.Header,
11859		}
11860	}
11861	if err != nil {
11862		return nil, err
11863	}
11864	defer googleapi.CloseBody(res)
11865	if err := googleapi.CheckResponse(res); err != nil {
11866		return nil, err
11867	}
11868	ret := &SmimeInfo{
11869		ServerResponse: googleapi.ServerResponse{
11870			Header:         res.Header,
11871			HTTPStatusCode: res.StatusCode,
11872		},
11873	}
11874	target := &ret
11875	if err := gensupport.DecodeResponse(target, res); err != nil {
11876		return nil, err
11877	}
11878	return ret, nil
11879	// {
11880	//   "description": "Gets the specified S/MIME config for the specified send-as alias.",
11881	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}",
11882	//   "httpMethod": "GET",
11883	//   "id": "gmail.users.settings.sendAs.smimeInfo.get",
11884	//   "parameterOrder": [
11885	//     "userId",
11886	//     "sendAsEmail",
11887	//     "id"
11888	//   ],
11889	//   "parameters": {
11890	//     "id": {
11891	//       "description": "The immutable ID for the SmimeInfo.",
11892	//       "location": "path",
11893	//       "required": true,
11894	//       "type": "string"
11895	//     },
11896	//     "sendAsEmail": {
11897	//       "description": "The email address that appears in the \"From:\" header for mail sent using\nthis alias.",
11898	//       "location": "path",
11899	//       "required": true,
11900	//       "type": "string"
11901	//     },
11902	//     "userId": {
11903	//       "default": "me",
11904	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
11905	//       "location": "path",
11906	//       "required": true,
11907	//       "type": "string"
11908	//     }
11909	//   },
11910	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}",
11911	//   "response": {
11912	//     "$ref": "SmimeInfo"
11913	//   },
11914	//   "scopes": [
11915	//     "https://mail.google.com/",
11916	//     "https://www.googleapis.com/auth/gmail.modify",
11917	//     "https://www.googleapis.com/auth/gmail.readonly",
11918	//     "https://www.googleapis.com/auth/gmail.settings.basic",
11919	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
11920	//   ]
11921	// }
11922
11923}
11924
11925// method id "gmail.users.settings.sendAs.smimeInfo.insert":
11926
11927type UsersSettingsSendAsSmimeInfoInsertCall struct {
11928	s           *Service
11929	userId      string
11930	sendAsEmail string
11931	smimeinfo   *SmimeInfo
11932	urlParams_  gensupport.URLParams
11933	ctx_        context.Context
11934	header_     http.Header
11935}
11936
11937// Insert: Insert (upload) the given S/MIME config for the specified
11938// send-as alias.
11939// Note that pkcs12 format is required for the key.
11940func (r *UsersSettingsSendAsSmimeInfoService) Insert(userId string, sendAsEmail string, smimeinfo *SmimeInfo) *UsersSettingsSendAsSmimeInfoInsertCall {
11941	c := &UsersSettingsSendAsSmimeInfoInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11942	c.userId = userId
11943	c.sendAsEmail = sendAsEmail
11944	c.smimeinfo = smimeinfo
11945	return c
11946}
11947
11948// Fields allows partial responses to be retrieved. See
11949// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11950// for more information.
11951func (c *UsersSettingsSendAsSmimeInfoInsertCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsSmimeInfoInsertCall {
11952	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11953	return c
11954}
11955
11956// Context sets the context to be used in this call's Do method. Any
11957// pending HTTP request will be aborted if the provided context is
11958// canceled.
11959func (c *UsersSettingsSendAsSmimeInfoInsertCall) Context(ctx context.Context) *UsersSettingsSendAsSmimeInfoInsertCall {
11960	c.ctx_ = ctx
11961	return c
11962}
11963
11964// Header returns an http.Header that can be modified by the caller to
11965// add HTTP headers to the request.
11966func (c *UsersSettingsSendAsSmimeInfoInsertCall) Header() http.Header {
11967	if c.header_ == nil {
11968		c.header_ = make(http.Header)
11969	}
11970	return c.header_
11971}
11972
11973func (c *UsersSettingsSendAsSmimeInfoInsertCall) doRequest(alt string) (*http.Response, error) {
11974	reqHeaders := make(http.Header)
11975	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
11976	for k, v := range c.header_ {
11977		reqHeaders[k] = v
11978	}
11979	reqHeaders.Set("User-Agent", c.s.userAgent())
11980	var body io.Reader = nil
11981	body, err := googleapi.WithoutDataWrapper.JSONReader(c.smimeinfo)
11982	if err != nil {
11983		return nil, err
11984	}
11985	reqHeaders.Set("Content-Type", "application/json")
11986	c.urlParams_.Set("alt", alt)
11987	c.urlParams_.Set("prettyPrint", "false")
11988	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo")
11989	urls += "?" + c.urlParams_.Encode()
11990	req, err := http.NewRequest("POST", urls, body)
11991	if err != nil {
11992		return nil, err
11993	}
11994	req.Header = reqHeaders
11995	googleapi.Expand(req.URL, map[string]string{
11996		"userId":      c.userId,
11997		"sendAsEmail": c.sendAsEmail,
11998	})
11999	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12000}
12001
12002// Do executes the "gmail.users.settings.sendAs.smimeInfo.insert" call.
12003// Exactly one of *SmimeInfo or error will be non-nil. Any non-2xx
12004// status code is an error. Response headers are in either
12005// *SmimeInfo.ServerResponse.Header or (if a response was returned at
12006// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
12007// to check whether the returned error was because
12008// http.StatusNotModified was returned.
12009func (c *UsersSettingsSendAsSmimeInfoInsertCall) Do(opts ...googleapi.CallOption) (*SmimeInfo, error) {
12010	gensupport.SetOptions(c.urlParams_, opts...)
12011	res, err := c.doRequest("json")
12012	if res != nil && res.StatusCode == http.StatusNotModified {
12013		if res.Body != nil {
12014			res.Body.Close()
12015		}
12016		return nil, &googleapi.Error{
12017			Code:   res.StatusCode,
12018			Header: res.Header,
12019		}
12020	}
12021	if err != nil {
12022		return nil, err
12023	}
12024	defer googleapi.CloseBody(res)
12025	if err := googleapi.CheckResponse(res); err != nil {
12026		return nil, err
12027	}
12028	ret := &SmimeInfo{
12029		ServerResponse: googleapi.ServerResponse{
12030			Header:         res.Header,
12031			HTTPStatusCode: res.StatusCode,
12032		},
12033	}
12034	target := &ret
12035	if err := gensupport.DecodeResponse(target, res); err != nil {
12036		return nil, err
12037	}
12038	return ret, nil
12039	// {
12040	//   "description": "Insert (upload) the given S/MIME config for the specified send-as alias.\nNote that pkcs12 format is required for the key.",
12041	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo",
12042	//   "httpMethod": "POST",
12043	//   "id": "gmail.users.settings.sendAs.smimeInfo.insert",
12044	//   "parameterOrder": [
12045	//     "userId",
12046	//     "sendAsEmail"
12047	//   ],
12048	//   "parameters": {
12049	//     "sendAsEmail": {
12050	//       "description": "The email address that appears in the \"From:\" header for mail sent using\nthis alias.",
12051	//       "location": "path",
12052	//       "required": true,
12053	//       "type": "string"
12054	//     },
12055	//     "userId": {
12056	//       "default": "me",
12057	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
12058	//       "location": "path",
12059	//       "required": true,
12060	//       "type": "string"
12061	//     }
12062	//   },
12063	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo",
12064	//   "request": {
12065	//     "$ref": "SmimeInfo"
12066	//   },
12067	//   "response": {
12068	//     "$ref": "SmimeInfo"
12069	//   },
12070	//   "scopes": [
12071	//     "https://www.googleapis.com/auth/gmail.settings.basic",
12072	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
12073	//   ]
12074	// }
12075
12076}
12077
12078// method id "gmail.users.settings.sendAs.smimeInfo.list":
12079
12080type UsersSettingsSendAsSmimeInfoListCall struct {
12081	s            *Service
12082	userId       string
12083	sendAsEmail  string
12084	urlParams_   gensupport.URLParams
12085	ifNoneMatch_ string
12086	ctx_         context.Context
12087	header_      http.Header
12088}
12089
12090// List: Lists S/MIME configs for the specified send-as alias.
12091func (r *UsersSettingsSendAsSmimeInfoService) List(userId string, sendAsEmail string) *UsersSettingsSendAsSmimeInfoListCall {
12092	c := &UsersSettingsSendAsSmimeInfoListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12093	c.userId = userId
12094	c.sendAsEmail = sendAsEmail
12095	return c
12096}
12097
12098// Fields allows partial responses to be retrieved. See
12099// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12100// for more information.
12101func (c *UsersSettingsSendAsSmimeInfoListCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsSmimeInfoListCall {
12102	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12103	return c
12104}
12105
12106// IfNoneMatch sets the optional parameter which makes the operation
12107// fail if the object's ETag matches the given value. This is useful for
12108// getting updates only after the object has changed since the last
12109// request. Use googleapi.IsNotModified to check whether the response
12110// error from Do is the result of In-None-Match.
12111func (c *UsersSettingsSendAsSmimeInfoListCall) IfNoneMatch(entityTag string) *UsersSettingsSendAsSmimeInfoListCall {
12112	c.ifNoneMatch_ = entityTag
12113	return c
12114}
12115
12116// Context sets the context to be used in this call's Do method. Any
12117// pending HTTP request will be aborted if the provided context is
12118// canceled.
12119func (c *UsersSettingsSendAsSmimeInfoListCall) Context(ctx context.Context) *UsersSettingsSendAsSmimeInfoListCall {
12120	c.ctx_ = ctx
12121	return c
12122}
12123
12124// Header returns an http.Header that can be modified by the caller to
12125// add HTTP headers to the request.
12126func (c *UsersSettingsSendAsSmimeInfoListCall) Header() http.Header {
12127	if c.header_ == nil {
12128		c.header_ = make(http.Header)
12129	}
12130	return c.header_
12131}
12132
12133func (c *UsersSettingsSendAsSmimeInfoListCall) doRequest(alt string) (*http.Response, error) {
12134	reqHeaders := make(http.Header)
12135	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
12136	for k, v := range c.header_ {
12137		reqHeaders[k] = v
12138	}
12139	reqHeaders.Set("User-Agent", c.s.userAgent())
12140	if c.ifNoneMatch_ != "" {
12141		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12142	}
12143	var body io.Reader = nil
12144	c.urlParams_.Set("alt", alt)
12145	c.urlParams_.Set("prettyPrint", "false")
12146	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo")
12147	urls += "?" + c.urlParams_.Encode()
12148	req, err := http.NewRequest("GET", urls, body)
12149	if err != nil {
12150		return nil, err
12151	}
12152	req.Header = reqHeaders
12153	googleapi.Expand(req.URL, map[string]string{
12154		"userId":      c.userId,
12155		"sendAsEmail": c.sendAsEmail,
12156	})
12157	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12158}
12159
12160// Do executes the "gmail.users.settings.sendAs.smimeInfo.list" call.
12161// Exactly one of *ListSmimeInfoResponse or error will be non-nil. Any
12162// non-2xx status code is an error. Response headers are in either
12163// *ListSmimeInfoResponse.ServerResponse.Header or (if a response was
12164// returned at all) in error.(*googleapi.Error).Header. Use
12165// googleapi.IsNotModified to check whether the returned error was
12166// because http.StatusNotModified was returned.
12167func (c *UsersSettingsSendAsSmimeInfoListCall) Do(opts ...googleapi.CallOption) (*ListSmimeInfoResponse, error) {
12168	gensupport.SetOptions(c.urlParams_, opts...)
12169	res, err := c.doRequest("json")
12170	if res != nil && res.StatusCode == http.StatusNotModified {
12171		if res.Body != nil {
12172			res.Body.Close()
12173		}
12174		return nil, &googleapi.Error{
12175			Code:   res.StatusCode,
12176			Header: res.Header,
12177		}
12178	}
12179	if err != nil {
12180		return nil, err
12181	}
12182	defer googleapi.CloseBody(res)
12183	if err := googleapi.CheckResponse(res); err != nil {
12184		return nil, err
12185	}
12186	ret := &ListSmimeInfoResponse{
12187		ServerResponse: googleapi.ServerResponse{
12188			Header:         res.Header,
12189			HTTPStatusCode: res.StatusCode,
12190		},
12191	}
12192	target := &ret
12193	if err := gensupport.DecodeResponse(target, res); err != nil {
12194		return nil, err
12195	}
12196	return ret, nil
12197	// {
12198	//   "description": "Lists S/MIME configs for the specified send-as alias.",
12199	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo",
12200	//   "httpMethod": "GET",
12201	//   "id": "gmail.users.settings.sendAs.smimeInfo.list",
12202	//   "parameterOrder": [
12203	//     "userId",
12204	//     "sendAsEmail"
12205	//   ],
12206	//   "parameters": {
12207	//     "sendAsEmail": {
12208	//       "description": "The email address that appears in the \"From:\" header for mail sent using\nthis alias.",
12209	//       "location": "path",
12210	//       "required": true,
12211	//       "type": "string"
12212	//     },
12213	//     "userId": {
12214	//       "default": "me",
12215	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
12216	//       "location": "path",
12217	//       "required": true,
12218	//       "type": "string"
12219	//     }
12220	//   },
12221	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo",
12222	//   "response": {
12223	//     "$ref": "ListSmimeInfoResponse"
12224	//   },
12225	//   "scopes": [
12226	//     "https://mail.google.com/",
12227	//     "https://www.googleapis.com/auth/gmail.modify",
12228	//     "https://www.googleapis.com/auth/gmail.readonly",
12229	//     "https://www.googleapis.com/auth/gmail.settings.basic",
12230	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
12231	//   ]
12232	// }
12233
12234}
12235
12236// method id "gmail.users.settings.sendAs.smimeInfo.setDefault":
12237
12238type UsersSettingsSendAsSmimeInfoSetDefaultCall struct {
12239	s           *Service
12240	userId      string
12241	sendAsEmail string
12242	id          string
12243	urlParams_  gensupport.URLParams
12244	ctx_        context.Context
12245	header_     http.Header
12246}
12247
12248// SetDefault: Sets the default S/MIME config for the specified send-as
12249// alias.
12250func (r *UsersSettingsSendAsSmimeInfoService) SetDefault(userId string, sendAsEmail string, id string) *UsersSettingsSendAsSmimeInfoSetDefaultCall {
12251	c := &UsersSettingsSendAsSmimeInfoSetDefaultCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12252	c.userId = userId
12253	c.sendAsEmail = sendAsEmail
12254	c.id = id
12255	return c
12256}
12257
12258// Fields allows partial responses to be retrieved. See
12259// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12260// for more information.
12261func (c *UsersSettingsSendAsSmimeInfoSetDefaultCall) Fields(s ...googleapi.Field) *UsersSettingsSendAsSmimeInfoSetDefaultCall {
12262	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12263	return c
12264}
12265
12266// Context sets the context to be used in this call's Do method. Any
12267// pending HTTP request will be aborted if the provided context is
12268// canceled.
12269func (c *UsersSettingsSendAsSmimeInfoSetDefaultCall) Context(ctx context.Context) *UsersSettingsSendAsSmimeInfoSetDefaultCall {
12270	c.ctx_ = ctx
12271	return c
12272}
12273
12274// Header returns an http.Header that can be modified by the caller to
12275// add HTTP headers to the request.
12276func (c *UsersSettingsSendAsSmimeInfoSetDefaultCall) Header() http.Header {
12277	if c.header_ == nil {
12278		c.header_ = make(http.Header)
12279	}
12280	return c.header_
12281}
12282
12283func (c *UsersSettingsSendAsSmimeInfoSetDefaultCall) doRequest(alt string) (*http.Response, error) {
12284	reqHeaders := make(http.Header)
12285	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
12286	for k, v := range c.header_ {
12287		reqHeaders[k] = v
12288	}
12289	reqHeaders.Set("User-Agent", c.s.userAgent())
12290	var body io.Reader = nil
12291	c.urlParams_.Set("alt", alt)
12292	c.urlParams_.Set("prettyPrint", "false")
12293	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault")
12294	urls += "?" + c.urlParams_.Encode()
12295	req, err := http.NewRequest("POST", urls, body)
12296	if err != nil {
12297		return nil, err
12298	}
12299	req.Header = reqHeaders
12300	googleapi.Expand(req.URL, map[string]string{
12301		"userId":      c.userId,
12302		"sendAsEmail": c.sendAsEmail,
12303		"id":          c.id,
12304	})
12305	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12306}
12307
12308// Do executes the "gmail.users.settings.sendAs.smimeInfo.setDefault" call.
12309func (c *UsersSettingsSendAsSmimeInfoSetDefaultCall) Do(opts ...googleapi.CallOption) error {
12310	gensupport.SetOptions(c.urlParams_, opts...)
12311	res, err := c.doRequest("json")
12312	if err != nil {
12313		return err
12314	}
12315	defer googleapi.CloseBody(res)
12316	if err := googleapi.CheckResponse(res); err != nil {
12317		return err
12318	}
12319	return nil
12320	// {
12321	//   "description": "Sets the default S/MIME config for the specified send-as alias.",
12322	//   "flatPath": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault",
12323	//   "httpMethod": "POST",
12324	//   "id": "gmail.users.settings.sendAs.smimeInfo.setDefault",
12325	//   "parameterOrder": [
12326	//     "userId",
12327	//     "sendAsEmail",
12328	//     "id"
12329	//   ],
12330	//   "parameters": {
12331	//     "id": {
12332	//       "description": "The immutable ID for the SmimeInfo.",
12333	//       "location": "path",
12334	//       "required": true,
12335	//       "type": "string"
12336	//     },
12337	//     "sendAsEmail": {
12338	//       "description": "The email address that appears in the \"From:\" header for mail sent using\nthis alias.",
12339	//       "location": "path",
12340	//       "required": true,
12341	//       "type": "string"
12342	//     },
12343	//     "userId": {
12344	//       "default": "me",
12345	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
12346	//       "location": "path",
12347	//       "required": true,
12348	//       "type": "string"
12349	//     }
12350	//   },
12351	//   "path": "gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault",
12352	//   "scopes": [
12353	//     "https://www.googleapis.com/auth/gmail.settings.basic",
12354	//     "https://www.googleapis.com/auth/gmail.settings.sharing"
12355	//   ]
12356	// }
12357
12358}
12359
12360// method id "gmail.users.threads.delete":
12361
12362type UsersThreadsDeleteCall struct {
12363	s          *Service
12364	userId     string
12365	id         string
12366	urlParams_ gensupport.URLParams
12367	ctx_       context.Context
12368	header_    http.Header
12369}
12370
12371// Delete: Immediately and permanently deletes the specified thread.
12372// This operation
12373// cannot be undone. Prefer <code>threads.trash</code> instead.
12374func (r *UsersThreadsService) Delete(userId string, id string) *UsersThreadsDeleteCall {
12375	c := &UsersThreadsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12376	c.userId = userId
12377	c.id = id
12378	return c
12379}
12380
12381// Fields allows partial responses to be retrieved. See
12382// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12383// for more information.
12384func (c *UsersThreadsDeleteCall) Fields(s ...googleapi.Field) *UsersThreadsDeleteCall {
12385	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12386	return c
12387}
12388
12389// Context sets the context to be used in this call's Do method. Any
12390// pending HTTP request will be aborted if the provided context is
12391// canceled.
12392func (c *UsersThreadsDeleteCall) Context(ctx context.Context) *UsersThreadsDeleteCall {
12393	c.ctx_ = ctx
12394	return c
12395}
12396
12397// Header returns an http.Header that can be modified by the caller to
12398// add HTTP headers to the request.
12399func (c *UsersThreadsDeleteCall) Header() http.Header {
12400	if c.header_ == nil {
12401		c.header_ = make(http.Header)
12402	}
12403	return c.header_
12404}
12405
12406func (c *UsersThreadsDeleteCall) doRequest(alt string) (*http.Response, error) {
12407	reqHeaders := make(http.Header)
12408	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
12409	for k, v := range c.header_ {
12410		reqHeaders[k] = v
12411	}
12412	reqHeaders.Set("User-Agent", c.s.userAgent())
12413	var body io.Reader = nil
12414	c.urlParams_.Set("alt", alt)
12415	c.urlParams_.Set("prettyPrint", "false")
12416	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}")
12417	urls += "?" + c.urlParams_.Encode()
12418	req, err := http.NewRequest("DELETE", urls, body)
12419	if err != nil {
12420		return nil, err
12421	}
12422	req.Header = reqHeaders
12423	googleapi.Expand(req.URL, map[string]string{
12424		"userId": c.userId,
12425		"id":     c.id,
12426	})
12427	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12428}
12429
12430// Do executes the "gmail.users.threads.delete" call.
12431func (c *UsersThreadsDeleteCall) Do(opts ...googleapi.CallOption) error {
12432	gensupport.SetOptions(c.urlParams_, opts...)
12433	res, err := c.doRequest("json")
12434	if err != nil {
12435		return err
12436	}
12437	defer googleapi.CloseBody(res)
12438	if err := googleapi.CheckResponse(res); err != nil {
12439		return err
12440	}
12441	return nil
12442	// {
12443	//   "description": "Immediately and permanently deletes the specified thread. This operation\ncannot be undone. Prefer \u003ccode\u003ethreads.trash\u003c/code\u003e instead.",
12444	//   "flatPath": "gmail/v1/users/{userId}/threads/{id}",
12445	//   "httpMethod": "DELETE",
12446	//   "id": "gmail.users.threads.delete",
12447	//   "parameterOrder": [
12448	//     "userId",
12449	//     "id"
12450	//   ],
12451	//   "parameters": {
12452	//     "id": {
12453	//       "description": "ID of the Thread to delete.",
12454	//       "location": "path",
12455	//       "required": true,
12456	//       "type": "string"
12457	//     },
12458	//     "userId": {
12459	//       "default": "me",
12460	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
12461	//       "location": "path",
12462	//       "required": true,
12463	//       "type": "string"
12464	//     }
12465	//   },
12466	//   "path": "gmail/v1/users/{userId}/threads/{id}",
12467	//   "scopes": [
12468	//     "https://mail.google.com/"
12469	//   ]
12470	// }
12471
12472}
12473
12474// method id "gmail.users.threads.get":
12475
12476type UsersThreadsGetCall struct {
12477	s            *Service
12478	userId       string
12479	id           string
12480	urlParams_   gensupport.URLParams
12481	ifNoneMatch_ string
12482	ctx_         context.Context
12483	header_      http.Header
12484}
12485
12486// Get: Gets the specified thread.
12487func (r *UsersThreadsService) Get(userId string, id string) *UsersThreadsGetCall {
12488	c := &UsersThreadsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12489	c.userId = userId
12490	c.id = id
12491	return c
12492}
12493
12494// Format sets the optional parameter "format": The format to return the
12495// messages in.
12496//
12497// Possible values:
12498//   "full" (default)
12499//   "metadata"
12500//   "minimal"
12501func (c *UsersThreadsGetCall) Format(format string) *UsersThreadsGetCall {
12502	c.urlParams_.Set("format", format)
12503	return c
12504}
12505
12506// MetadataHeaders sets the optional parameter "metadataHeaders": When
12507// given and format is METADATA, only include headers specified.
12508func (c *UsersThreadsGetCall) MetadataHeaders(metadataHeaders ...string) *UsersThreadsGetCall {
12509	c.urlParams_.SetMulti("metadataHeaders", append([]string{}, metadataHeaders...))
12510	return c
12511}
12512
12513// Fields allows partial responses to be retrieved. See
12514// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12515// for more information.
12516func (c *UsersThreadsGetCall) Fields(s ...googleapi.Field) *UsersThreadsGetCall {
12517	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12518	return c
12519}
12520
12521// IfNoneMatch sets the optional parameter which makes the operation
12522// fail if the object's ETag matches the given value. This is useful for
12523// getting updates only after the object has changed since the last
12524// request. Use googleapi.IsNotModified to check whether the response
12525// error from Do is the result of In-None-Match.
12526func (c *UsersThreadsGetCall) IfNoneMatch(entityTag string) *UsersThreadsGetCall {
12527	c.ifNoneMatch_ = entityTag
12528	return c
12529}
12530
12531// Context sets the context to be used in this call's Do method. Any
12532// pending HTTP request will be aborted if the provided context is
12533// canceled.
12534func (c *UsersThreadsGetCall) Context(ctx context.Context) *UsersThreadsGetCall {
12535	c.ctx_ = ctx
12536	return c
12537}
12538
12539// Header returns an http.Header that can be modified by the caller to
12540// add HTTP headers to the request.
12541func (c *UsersThreadsGetCall) Header() http.Header {
12542	if c.header_ == nil {
12543		c.header_ = make(http.Header)
12544	}
12545	return c.header_
12546}
12547
12548func (c *UsersThreadsGetCall) doRequest(alt string) (*http.Response, error) {
12549	reqHeaders := make(http.Header)
12550	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
12551	for k, v := range c.header_ {
12552		reqHeaders[k] = v
12553	}
12554	reqHeaders.Set("User-Agent", c.s.userAgent())
12555	if c.ifNoneMatch_ != "" {
12556		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12557	}
12558	var body io.Reader = nil
12559	c.urlParams_.Set("alt", alt)
12560	c.urlParams_.Set("prettyPrint", "false")
12561	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}")
12562	urls += "?" + c.urlParams_.Encode()
12563	req, err := http.NewRequest("GET", urls, body)
12564	if err != nil {
12565		return nil, err
12566	}
12567	req.Header = reqHeaders
12568	googleapi.Expand(req.URL, map[string]string{
12569		"userId": c.userId,
12570		"id":     c.id,
12571	})
12572	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12573}
12574
12575// Do executes the "gmail.users.threads.get" call.
12576// Exactly one of *Thread or error will be non-nil. Any non-2xx status
12577// code is an error. Response headers are in either
12578// *Thread.ServerResponse.Header or (if a response was returned at all)
12579// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12580// check whether the returned error was because http.StatusNotModified
12581// was returned.
12582func (c *UsersThreadsGetCall) Do(opts ...googleapi.CallOption) (*Thread, error) {
12583	gensupport.SetOptions(c.urlParams_, opts...)
12584	res, err := c.doRequest("json")
12585	if res != nil && res.StatusCode == http.StatusNotModified {
12586		if res.Body != nil {
12587			res.Body.Close()
12588		}
12589		return nil, &googleapi.Error{
12590			Code:   res.StatusCode,
12591			Header: res.Header,
12592		}
12593	}
12594	if err != nil {
12595		return nil, err
12596	}
12597	defer googleapi.CloseBody(res)
12598	if err := googleapi.CheckResponse(res); err != nil {
12599		return nil, err
12600	}
12601	ret := &Thread{
12602		ServerResponse: googleapi.ServerResponse{
12603			Header:         res.Header,
12604			HTTPStatusCode: res.StatusCode,
12605		},
12606	}
12607	target := &ret
12608	if err := gensupport.DecodeResponse(target, res); err != nil {
12609		return nil, err
12610	}
12611	return ret, nil
12612	// {
12613	//   "description": "Gets the specified thread.",
12614	//   "flatPath": "gmail/v1/users/{userId}/threads/{id}",
12615	//   "httpMethod": "GET",
12616	//   "id": "gmail.users.threads.get",
12617	//   "parameterOrder": [
12618	//     "userId",
12619	//     "id"
12620	//   ],
12621	//   "parameters": {
12622	//     "format": {
12623	//       "default": "full",
12624	//       "description": "The format to return the messages in.",
12625	//       "enum": [
12626	//         "full",
12627	//         "metadata",
12628	//         "minimal"
12629	//       ],
12630	//       "location": "query",
12631	//       "type": "string"
12632	//     },
12633	//     "id": {
12634	//       "description": "The ID of the thread to retrieve.",
12635	//       "location": "path",
12636	//       "required": true,
12637	//       "type": "string"
12638	//     },
12639	//     "metadataHeaders": {
12640	//       "description": "When given and format is METADATA, only include headers specified.",
12641	//       "location": "query",
12642	//       "repeated": true,
12643	//       "type": "string"
12644	//     },
12645	//     "userId": {
12646	//       "default": "me",
12647	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
12648	//       "location": "path",
12649	//       "required": true,
12650	//       "type": "string"
12651	//     }
12652	//   },
12653	//   "path": "gmail/v1/users/{userId}/threads/{id}",
12654	//   "response": {
12655	//     "$ref": "Thread"
12656	//   },
12657	//   "scopes": [
12658	//     "https://mail.google.com/",
12659	//     "https://www.googleapis.com/auth/gmail.addons.current.message.action",
12660	//     "https://www.googleapis.com/auth/gmail.addons.current.message.metadata",
12661	//     "https://www.googleapis.com/auth/gmail.addons.current.message.readonly",
12662	//     "https://www.googleapis.com/auth/gmail.metadata",
12663	//     "https://www.googleapis.com/auth/gmail.modify",
12664	//     "https://www.googleapis.com/auth/gmail.readonly"
12665	//   ]
12666	// }
12667
12668}
12669
12670// method id "gmail.users.threads.list":
12671
12672type UsersThreadsListCall struct {
12673	s            *Service
12674	userId       string
12675	urlParams_   gensupport.URLParams
12676	ifNoneMatch_ string
12677	ctx_         context.Context
12678	header_      http.Header
12679}
12680
12681// List: Lists the threads in the user's mailbox.
12682func (r *UsersThreadsService) List(userId string) *UsersThreadsListCall {
12683	c := &UsersThreadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12684	c.userId = userId
12685	return c
12686}
12687
12688// IncludeSpamTrash sets the optional parameter "includeSpamTrash":
12689// Include threads from <code>SPAM</code> and <code>TRASH</code>
12690// in the results.
12691func (c *UsersThreadsListCall) IncludeSpamTrash(includeSpamTrash bool) *UsersThreadsListCall {
12692	c.urlParams_.Set("includeSpamTrash", fmt.Sprint(includeSpamTrash))
12693	return c
12694}
12695
12696// LabelIds sets the optional parameter "labelIds": Only return threads
12697// with labels that match all of the specified label IDs.
12698func (c *UsersThreadsListCall) LabelIds(labelIds ...string) *UsersThreadsListCall {
12699	c.urlParams_.SetMulti("labelIds", append([]string{}, labelIds...))
12700	return c
12701}
12702
12703// MaxResults sets the optional parameter "maxResults": Maximum number
12704// of threads to return.
12705func (c *UsersThreadsListCall) MaxResults(maxResults int64) *UsersThreadsListCall {
12706	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12707	return c
12708}
12709
12710// PageToken sets the optional parameter "pageToken": Page token to
12711// retrieve a specific page of results in the list.
12712func (c *UsersThreadsListCall) PageToken(pageToken string) *UsersThreadsListCall {
12713	c.urlParams_.Set("pageToken", pageToken)
12714	return c
12715}
12716
12717// Q sets the optional parameter "q": Only return threads matching the
12718// specified query. Supports the same
12719// query format as the Gmail search box. For
12720// example,
12721// <code>"from:someuser@example.com
12722// rfc822msgid:<somemsgid@example.com>
12723// is:unread"</code>. Parameter cannot be used when accessing the
12724// api
12725// using the gmail.metadata scope.
12726func (c *UsersThreadsListCall) Q(q string) *UsersThreadsListCall {
12727	c.urlParams_.Set("q", q)
12728	return c
12729}
12730
12731// Fields allows partial responses to be retrieved. See
12732// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12733// for more information.
12734func (c *UsersThreadsListCall) Fields(s ...googleapi.Field) *UsersThreadsListCall {
12735	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12736	return c
12737}
12738
12739// IfNoneMatch sets the optional parameter which makes the operation
12740// fail if the object's ETag matches the given value. This is useful for
12741// getting updates only after the object has changed since the last
12742// request. Use googleapi.IsNotModified to check whether the response
12743// error from Do is the result of In-None-Match.
12744func (c *UsersThreadsListCall) IfNoneMatch(entityTag string) *UsersThreadsListCall {
12745	c.ifNoneMatch_ = entityTag
12746	return c
12747}
12748
12749// Context sets the context to be used in this call's Do method. Any
12750// pending HTTP request will be aborted if the provided context is
12751// canceled.
12752func (c *UsersThreadsListCall) Context(ctx context.Context) *UsersThreadsListCall {
12753	c.ctx_ = ctx
12754	return c
12755}
12756
12757// Header returns an http.Header that can be modified by the caller to
12758// add HTTP headers to the request.
12759func (c *UsersThreadsListCall) Header() http.Header {
12760	if c.header_ == nil {
12761		c.header_ = make(http.Header)
12762	}
12763	return c.header_
12764}
12765
12766func (c *UsersThreadsListCall) doRequest(alt string) (*http.Response, error) {
12767	reqHeaders := make(http.Header)
12768	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
12769	for k, v := range c.header_ {
12770		reqHeaders[k] = v
12771	}
12772	reqHeaders.Set("User-Agent", c.s.userAgent())
12773	if c.ifNoneMatch_ != "" {
12774		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12775	}
12776	var body io.Reader = nil
12777	c.urlParams_.Set("alt", alt)
12778	c.urlParams_.Set("prettyPrint", "false")
12779	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads")
12780	urls += "?" + c.urlParams_.Encode()
12781	req, err := http.NewRequest("GET", urls, body)
12782	if err != nil {
12783		return nil, err
12784	}
12785	req.Header = reqHeaders
12786	googleapi.Expand(req.URL, map[string]string{
12787		"userId": c.userId,
12788	})
12789	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12790}
12791
12792// Do executes the "gmail.users.threads.list" call.
12793// Exactly one of *ListThreadsResponse or error will be non-nil. Any
12794// non-2xx status code is an error. Response headers are in either
12795// *ListThreadsResponse.ServerResponse.Header or (if a response was
12796// returned at all) in error.(*googleapi.Error).Header. Use
12797// googleapi.IsNotModified to check whether the returned error was
12798// because http.StatusNotModified was returned.
12799func (c *UsersThreadsListCall) Do(opts ...googleapi.CallOption) (*ListThreadsResponse, error) {
12800	gensupport.SetOptions(c.urlParams_, opts...)
12801	res, err := c.doRequest("json")
12802	if res != nil && res.StatusCode == http.StatusNotModified {
12803		if res.Body != nil {
12804			res.Body.Close()
12805		}
12806		return nil, &googleapi.Error{
12807			Code:   res.StatusCode,
12808			Header: res.Header,
12809		}
12810	}
12811	if err != nil {
12812		return nil, err
12813	}
12814	defer googleapi.CloseBody(res)
12815	if err := googleapi.CheckResponse(res); err != nil {
12816		return nil, err
12817	}
12818	ret := &ListThreadsResponse{
12819		ServerResponse: googleapi.ServerResponse{
12820			Header:         res.Header,
12821			HTTPStatusCode: res.StatusCode,
12822		},
12823	}
12824	target := &ret
12825	if err := gensupport.DecodeResponse(target, res); err != nil {
12826		return nil, err
12827	}
12828	return ret, nil
12829	// {
12830	//   "description": "Lists the threads in the user's mailbox.",
12831	//   "flatPath": "gmail/v1/users/{userId}/threads",
12832	//   "httpMethod": "GET",
12833	//   "id": "gmail.users.threads.list",
12834	//   "parameterOrder": [
12835	//     "userId"
12836	//   ],
12837	//   "parameters": {
12838	//     "includeSpamTrash": {
12839	//       "default": "false",
12840	//       "description": "Include threads from \u003ccode\u003eSPAM\u003c/code\u003e and \u003ccode\u003eTRASH\u003c/code\u003e\nin the results.",
12841	//       "location": "query",
12842	//       "type": "boolean"
12843	//     },
12844	//     "labelIds": {
12845	//       "description": "Only return threads with labels that match all of the specified label IDs.",
12846	//       "location": "query",
12847	//       "repeated": true,
12848	//       "type": "string"
12849	//     },
12850	//     "maxResults": {
12851	//       "default": "100",
12852	//       "description": "Maximum number of threads to return.",
12853	//       "format": "uint32",
12854	//       "location": "query",
12855	//       "type": "integer"
12856	//     },
12857	//     "pageToken": {
12858	//       "description": "Page token to retrieve a specific page of results in the list.",
12859	//       "location": "query",
12860	//       "type": "string"
12861	//     },
12862	//     "q": {
12863	//       "description": "Only return threads matching the specified query. Supports the same\nquery format as the Gmail search box. For example,\n\u003ccode\u003e\"from:someuser@example.com rfc822msgid:\u003csomemsgid@example.com\u003e\nis:unread\"\u003c/code\u003e. Parameter cannot be used when accessing the api\nusing the gmail.metadata scope.",
12864	//       "location": "query",
12865	//       "type": "string"
12866	//     },
12867	//     "userId": {
12868	//       "default": "me",
12869	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
12870	//       "location": "path",
12871	//       "required": true,
12872	//       "type": "string"
12873	//     }
12874	//   },
12875	//   "path": "gmail/v1/users/{userId}/threads",
12876	//   "response": {
12877	//     "$ref": "ListThreadsResponse"
12878	//   },
12879	//   "scopes": [
12880	//     "https://mail.google.com/",
12881	//     "https://www.googleapis.com/auth/gmail.metadata",
12882	//     "https://www.googleapis.com/auth/gmail.modify",
12883	//     "https://www.googleapis.com/auth/gmail.readonly"
12884	//   ]
12885	// }
12886
12887}
12888
12889// Pages invokes f for each page of results.
12890// A non-nil error returned from f will halt the iteration.
12891// The provided context supersedes any context provided to the Context method.
12892func (c *UsersThreadsListCall) Pages(ctx context.Context, f func(*ListThreadsResponse) error) error {
12893	c.ctx_ = ctx
12894	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12895	for {
12896		x, err := c.Do()
12897		if err != nil {
12898			return err
12899		}
12900		if err := f(x); err != nil {
12901			return err
12902		}
12903		if x.NextPageToken == "" {
12904			return nil
12905		}
12906		c.PageToken(x.NextPageToken)
12907	}
12908}
12909
12910// method id "gmail.users.threads.modify":
12911
12912type UsersThreadsModifyCall struct {
12913	s                   *Service
12914	userId              string
12915	id                  string
12916	modifythreadrequest *ModifyThreadRequest
12917	urlParams_          gensupport.URLParams
12918	ctx_                context.Context
12919	header_             http.Header
12920}
12921
12922// Modify: Modifies the labels applied to the thread. This applies to
12923// all messages
12924// in the thread.
12925func (r *UsersThreadsService) Modify(userId string, id string, modifythreadrequest *ModifyThreadRequest) *UsersThreadsModifyCall {
12926	c := &UsersThreadsModifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12927	c.userId = userId
12928	c.id = id
12929	c.modifythreadrequest = modifythreadrequest
12930	return c
12931}
12932
12933// Fields allows partial responses to be retrieved. See
12934// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12935// for more information.
12936func (c *UsersThreadsModifyCall) Fields(s ...googleapi.Field) *UsersThreadsModifyCall {
12937	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12938	return c
12939}
12940
12941// Context sets the context to be used in this call's Do method. Any
12942// pending HTTP request will be aborted if the provided context is
12943// canceled.
12944func (c *UsersThreadsModifyCall) Context(ctx context.Context) *UsersThreadsModifyCall {
12945	c.ctx_ = ctx
12946	return c
12947}
12948
12949// Header returns an http.Header that can be modified by the caller to
12950// add HTTP headers to the request.
12951func (c *UsersThreadsModifyCall) Header() http.Header {
12952	if c.header_ == nil {
12953		c.header_ = make(http.Header)
12954	}
12955	return c.header_
12956}
12957
12958func (c *UsersThreadsModifyCall) doRequest(alt string) (*http.Response, error) {
12959	reqHeaders := make(http.Header)
12960	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
12961	for k, v := range c.header_ {
12962		reqHeaders[k] = v
12963	}
12964	reqHeaders.Set("User-Agent", c.s.userAgent())
12965	var body io.Reader = nil
12966	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifythreadrequest)
12967	if err != nil {
12968		return nil, err
12969	}
12970	reqHeaders.Set("Content-Type", "application/json")
12971	c.urlParams_.Set("alt", alt)
12972	c.urlParams_.Set("prettyPrint", "false")
12973	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}/modify")
12974	urls += "?" + c.urlParams_.Encode()
12975	req, err := http.NewRequest("POST", urls, body)
12976	if err != nil {
12977		return nil, err
12978	}
12979	req.Header = reqHeaders
12980	googleapi.Expand(req.URL, map[string]string{
12981		"userId": c.userId,
12982		"id":     c.id,
12983	})
12984	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12985}
12986
12987// Do executes the "gmail.users.threads.modify" call.
12988// Exactly one of *Thread or error will be non-nil. Any non-2xx status
12989// code is an error. Response headers are in either
12990// *Thread.ServerResponse.Header or (if a response was returned at all)
12991// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12992// check whether the returned error was because http.StatusNotModified
12993// was returned.
12994func (c *UsersThreadsModifyCall) Do(opts ...googleapi.CallOption) (*Thread, error) {
12995	gensupport.SetOptions(c.urlParams_, opts...)
12996	res, err := c.doRequest("json")
12997	if res != nil && res.StatusCode == http.StatusNotModified {
12998		if res.Body != nil {
12999			res.Body.Close()
13000		}
13001		return nil, &googleapi.Error{
13002			Code:   res.StatusCode,
13003			Header: res.Header,
13004		}
13005	}
13006	if err != nil {
13007		return nil, err
13008	}
13009	defer googleapi.CloseBody(res)
13010	if err := googleapi.CheckResponse(res); err != nil {
13011		return nil, err
13012	}
13013	ret := &Thread{
13014		ServerResponse: googleapi.ServerResponse{
13015			Header:         res.Header,
13016			HTTPStatusCode: res.StatusCode,
13017		},
13018	}
13019	target := &ret
13020	if err := gensupport.DecodeResponse(target, res); err != nil {
13021		return nil, err
13022	}
13023	return ret, nil
13024	// {
13025	//   "description": "Modifies the labels applied to the thread. This applies to all messages\nin the thread.",
13026	//   "flatPath": "gmail/v1/users/{userId}/threads/{id}/modify",
13027	//   "httpMethod": "POST",
13028	//   "id": "gmail.users.threads.modify",
13029	//   "parameterOrder": [
13030	//     "userId",
13031	//     "id"
13032	//   ],
13033	//   "parameters": {
13034	//     "id": {
13035	//       "description": "The ID of the thread to modify.",
13036	//       "location": "path",
13037	//       "required": true,
13038	//       "type": "string"
13039	//     },
13040	//     "userId": {
13041	//       "default": "me",
13042	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
13043	//       "location": "path",
13044	//       "required": true,
13045	//       "type": "string"
13046	//     }
13047	//   },
13048	//   "path": "gmail/v1/users/{userId}/threads/{id}/modify",
13049	//   "request": {
13050	//     "$ref": "ModifyThreadRequest"
13051	//   },
13052	//   "response": {
13053	//     "$ref": "Thread"
13054	//   },
13055	//   "scopes": [
13056	//     "https://mail.google.com/",
13057	//     "https://www.googleapis.com/auth/gmail.modify"
13058	//   ]
13059	// }
13060
13061}
13062
13063// method id "gmail.users.threads.trash":
13064
13065type UsersThreadsTrashCall struct {
13066	s          *Service
13067	userId     string
13068	id         string
13069	urlParams_ gensupport.URLParams
13070	ctx_       context.Context
13071	header_    http.Header
13072}
13073
13074// Trash: Moves the specified thread to the trash.
13075func (r *UsersThreadsService) Trash(userId string, id string) *UsersThreadsTrashCall {
13076	c := &UsersThreadsTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13077	c.userId = userId
13078	c.id = id
13079	return c
13080}
13081
13082// Fields allows partial responses to be retrieved. See
13083// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13084// for more information.
13085func (c *UsersThreadsTrashCall) Fields(s ...googleapi.Field) *UsersThreadsTrashCall {
13086	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13087	return c
13088}
13089
13090// Context sets the context to be used in this call's Do method. Any
13091// pending HTTP request will be aborted if the provided context is
13092// canceled.
13093func (c *UsersThreadsTrashCall) Context(ctx context.Context) *UsersThreadsTrashCall {
13094	c.ctx_ = ctx
13095	return c
13096}
13097
13098// Header returns an http.Header that can be modified by the caller to
13099// add HTTP headers to the request.
13100func (c *UsersThreadsTrashCall) Header() http.Header {
13101	if c.header_ == nil {
13102		c.header_ = make(http.Header)
13103	}
13104	return c.header_
13105}
13106
13107func (c *UsersThreadsTrashCall) doRequest(alt string) (*http.Response, error) {
13108	reqHeaders := make(http.Header)
13109	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
13110	for k, v := range c.header_ {
13111		reqHeaders[k] = v
13112	}
13113	reqHeaders.Set("User-Agent", c.s.userAgent())
13114	var body io.Reader = nil
13115	c.urlParams_.Set("alt", alt)
13116	c.urlParams_.Set("prettyPrint", "false")
13117	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}/trash")
13118	urls += "?" + c.urlParams_.Encode()
13119	req, err := http.NewRequest("POST", urls, body)
13120	if err != nil {
13121		return nil, err
13122	}
13123	req.Header = reqHeaders
13124	googleapi.Expand(req.URL, map[string]string{
13125		"userId": c.userId,
13126		"id":     c.id,
13127	})
13128	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13129}
13130
13131// Do executes the "gmail.users.threads.trash" call.
13132// Exactly one of *Thread or error will be non-nil. Any non-2xx status
13133// code is an error. Response headers are in either
13134// *Thread.ServerResponse.Header or (if a response was returned at all)
13135// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13136// check whether the returned error was because http.StatusNotModified
13137// was returned.
13138func (c *UsersThreadsTrashCall) Do(opts ...googleapi.CallOption) (*Thread, error) {
13139	gensupport.SetOptions(c.urlParams_, opts...)
13140	res, err := c.doRequest("json")
13141	if res != nil && res.StatusCode == http.StatusNotModified {
13142		if res.Body != nil {
13143			res.Body.Close()
13144		}
13145		return nil, &googleapi.Error{
13146			Code:   res.StatusCode,
13147			Header: res.Header,
13148		}
13149	}
13150	if err != nil {
13151		return nil, err
13152	}
13153	defer googleapi.CloseBody(res)
13154	if err := googleapi.CheckResponse(res); err != nil {
13155		return nil, err
13156	}
13157	ret := &Thread{
13158		ServerResponse: googleapi.ServerResponse{
13159			Header:         res.Header,
13160			HTTPStatusCode: res.StatusCode,
13161		},
13162	}
13163	target := &ret
13164	if err := gensupport.DecodeResponse(target, res); err != nil {
13165		return nil, err
13166	}
13167	return ret, nil
13168	// {
13169	//   "description": "Moves the specified thread to the trash.",
13170	//   "flatPath": "gmail/v1/users/{userId}/threads/{id}/trash",
13171	//   "httpMethod": "POST",
13172	//   "id": "gmail.users.threads.trash",
13173	//   "parameterOrder": [
13174	//     "userId",
13175	//     "id"
13176	//   ],
13177	//   "parameters": {
13178	//     "id": {
13179	//       "description": "The ID of the thread to Trash.",
13180	//       "location": "path",
13181	//       "required": true,
13182	//       "type": "string"
13183	//     },
13184	//     "userId": {
13185	//       "default": "me",
13186	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
13187	//       "location": "path",
13188	//       "required": true,
13189	//       "type": "string"
13190	//     }
13191	//   },
13192	//   "path": "gmail/v1/users/{userId}/threads/{id}/trash",
13193	//   "response": {
13194	//     "$ref": "Thread"
13195	//   },
13196	//   "scopes": [
13197	//     "https://mail.google.com/",
13198	//     "https://www.googleapis.com/auth/gmail.modify"
13199	//   ]
13200	// }
13201
13202}
13203
13204// method id "gmail.users.threads.untrash":
13205
13206type UsersThreadsUntrashCall struct {
13207	s          *Service
13208	userId     string
13209	id         string
13210	urlParams_ gensupport.URLParams
13211	ctx_       context.Context
13212	header_    http.Header
13213}
13214
13215// Untrash: Removes the specified thread from the trash.
13216func (r *UsersThreadsService) Untrash(userId string, id string) *UsersThreadsUntrashCall {
13217	c := &UsersThreadsUntrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13218	c.userId = userId
13219	c.id = id
13220	return c
13221}
13222
13223// Fields allows partial responses to be retrieved. See
13224// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13225// for more information.
13226func (c *UsersThreadsUntrashCall) Fields(s ...googleapi.Field) *UsersThreadsUntrashCall {
13227	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13228	return c
13229}
13230
13231// Context sets the context to be used in this call's Do method. Any
13232// pending HTTP request will be aborted if the provided context is
13233// canceled.
13234func (c *UsersThreadsUntrashCall) Context(ctx context.Context) *UsersThreadsUntrashCall {
13235	c.ctx_ = ctx
13236	return c
13237}
13238
13239// Header returns an http.Header that can be modified by the caller to
13240// add HTTP headers to the request.
13241func (c *UsersThreadsUntrashCall) Header() http.Header {
13242	if c.header_ == nil {
13243		c.header_ = make(http.Header)
13244	}
13245	return c.header_
13246}
13247
13248func (c *UsersThreadsUntrashCall) doRequest(alt string) (*http.Response, error) {
13249	reqHeaders := make(http.Header)
13250	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707")
13251	for k, v := range c.header_ {
13252		reqHeaders[k] = v
13253	}
13254	reqHeaders.Set("User-Agent", c.s.userAgent())
13255	var body io.Reader = nil
13256	c.urlParams_.Set("alt", alt)
13257	c.urlParams_.Set("prettyPrint", "false")
13258	urls := googleapi.ResolveRelative(c.s.BasePath, "gmail/v1/users/{userId}/threads/{id}/untrash")
13259	urls += "?" + c.urlParams_.Encode()
13260	req, err := http.NewRequest("POST", urls, body)
13261	if err != nil {
13262		return nil, err
13263	}
13264	req.Header = reqHeaders
13265	googleapi.Expand(req.URL, map[string]string{
13266		"userId": c.userId,
13267		"id":     c.id,
13268	})
13269	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13270}
13271
13272// Do executes the "gmail.users.threads.untrash" call.
13273// Exactly one of *Thread or error will be non-nil. Any non-2xx status
13274// code is an error. Response headers are in either
13275// *Thread.ServerResponse.Header or (if a response was returned at all)
13276// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13277// check whether the returned error was because http.StatusNotModified
13278// was returned.
13279func (c *UsersThreadsUntrashCall) Do(opts ...googleapi.CallOption) (*Thread, error) {
13280	gensupport.SetOptions(c.urlParams_, opts...)
13281	res, err := c.doRequest("json")
13282	if res != nil && res.StatusCode == http.StatusNotModified {
13283		if res.Body != nil {
13284			res.Body.Close()
13285		}
13286		return nil, &googleapi.Error{
13287			Code:   res.StatusCode,
13288			Header: res.Header,
13289		}
13290	}
13291	if err != nil {
13292		return nil, err
13293	}
13294	defer googleapi.CloseBody(res)
13295	if err := googleapi.CheckResponse(res); err != nil {
13296		return nil, err
13297	}
13298	ret := &Thread{
13299		ServerResponse: googleapi.ServerResponse{
13300			Header:         res.Header,
13301			HTTPStatusCode: res.StatusCode,
13302		},
13303	}
13304	target := &ret
13305	if err := gensupport.DecodeResponse(target, res); err != nil {
13306		return nil, err
13307	}
13308	return ret, nil
13309	// {
13310	//   "description": "Removes the specified thread from the trash.",
13311	//   "flatPath": "gmail/v1/users/{userId}/threads/{id}/untrash",
13312	//   "httpMethod": "POST",
13313	//   "id": "gmail.users.threads.untrash",
13314	//   "parameterOrder": [
13315	//     "userId",
13316	//     "id"
13317	//   ],
13318	//   "parameters": {
13319	//     "id": {
13320	//       "description": "The ID of the thread to remove from Trash.",
13321	//       "location": "path",
13322	//       "required": true,
13323	//       "type": "string"
13324	//     },
13325	//     "userId": {
13326	//       "default": "me",
13327	//       "description": "The user's email address. The special value \u003ccode\u003eme\u003c/code\u003e\ncan be used to indicate the authenticated user.",
13328	//       "location": "path",
13329	//       "required": true,
13330	//       "type": "string"
13331	//     }
13332	//   },
13333	//   "path": "gmail/v1/users/{userId}/threads/{id}/untrash",
13334	//   "response": {
13335	//     "$ref": "Thread"
13336	//   },
13337	//   "scopes": [
13338	//     "https://mail.google.com/",
13339	//     "https://www.googleapis.com/auth/gmail.modify"
13340	//   ]
13341	// }
13342
13343}
13344