...

Source file src/google.golang.org/api/mirror/v1/mirror-gen.go

Documentation: google.golang.org/api/mirror/v1

     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 mirror provides access to the Google Mirror API.
     8  //
     9  // For product documentation, see: https://developers.google.com/glass
    10  //
    11  // # Creating a client
    12  //
    13  // Usage example:
    14  //
    15  //	import "google.golang.org/api/mirror/v1"
    16  //	...
    17  //	ctx := context.Background()
    18  //	mirrorService, err := mirror.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  //	mirrorService, err := mirror.NewService(ctx, option.WithScopes(mirror.GlassTimelineScope))
    29  //
    30  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    31  //
    32  //	mirrorService, err := mirror.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  //	mirrorService, err := mirror.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    40  //
    41  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    42  package mirror // import "google.golang.org/api/mirror/v1"
    43  
    44  import (
    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.
    65  var _ = bytes.NewBuffer
    66  var _ = strconv.Itoa
    67  var _ = fmt.Sprintf
    68  var _ = json.NewDecoder
    69  var _ = io.Copy
    70  var _ = url.Parse
    71  var _ = gensupport.MarshalJSON
    72  var _ = googleapi.Version
    73  var _ = errors.New
    74  var _ = strings.Replace
    75  var _ = context.Canceled
    76  var _ = internaloption.WithDefaultEndpoint
    77  
    78  const apiId = "mirror:v1"
    79  const apiName = "mirror"
    80  const apiVersion = "v1"
    81  const basePath = "https://www.googleapis.com/mirror/v1/"
    82  
    83  // OAuth2 scopes used by this API.
    84  const (
    85  	// View your location
    86  	GlassLocationScope = "https://www.googleapis.com/auth/glass.location"
    87  
    88  	// View and manage your Glass timeline
    89  	GlassTimelineScope = "https://www.googleapis.com/auth/glass.timeline"
    90  )
    91  
    92  // NewService creates a new Service.
    93  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    94  	scopesOption := option.WithScopes(
    95  		"https://www.googleapis.com/auth/glass.location",
    96  		"https://www.googleapis.com/auth/glass.timeline",
    97  	)
    98  	// NOTE: prepend, so we don't override user-specified scopes.
    99  	opts = append([]option.ClientOption{scopesOption}, opts...)
   100  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   101  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   102  	if err != nil {
   103  		return nil, err
   104  	}
   105  	s, err := New(client)
   106  	if err != nil {
   107  		return nil, err
   108  	}
   109  	if endpoint != "" {
   110  		s.BasePath = endpoint
   111  	}
   112  	return s, nil
   113  }
   114  
   115  // New creates a new Service. It uses the provided http.Client for requests.
   116  //
   117  // Deprecated: please use NewService instead.
   118  // To provide a custom HTTP client, use option.WithHTTPClient.
   119  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   120  func New(client *http.Client) (*Service, error) {
   121  	if client == nil {
   122  		return nil, errors.New("client is nil")
   123  	}
   124  	s := &Service{client: client, BasePath: basePath}
   125  	s.Accounts = NewAccountsService(s)
   126  	s.Contacts = NewContactsService(s)
   127  	s.Locations = NewLocationsService(s)
   128  	s.Settings = NewSettingsService(s)
   129  	s.Subscriptions = NewSubscriptionsService(s)
   130  	s.Timeline = NewTimelineService(s)
   131  	return s, nil
   132  }
   133  
   134  type Service struct {
   135  	client    *http.Client
   136  	BasePath  string // API endpoint base URL
   137  	UserAgent string // optional additional User-Agent fragment
   138  
   139  	Accounts *AccountsService
   140  
   141  	Contacts *ContactsService
   142  
   143  	Locations *LocationsService
   144  
   145  	Settings *SettingsService
   146  
   147  	Subscriptions *SubscriptionsService
   148  
   149  	Timeline *TimelineService
   150  }
   151  
   152  func (s *Service) userAgent() string {
   153  	if s.UserAgent == "" {
   154  		return googleapi.UserAgent
   155  	}
   156  	return googleapi.UserAgent + " " + s.UserAgent
   157  }
   158  
   159  func NewAccountsService(s *Service) *AccountsService {
   160  	rs := &AccountsService{s: s}
   161  	return rs
   162  }
   163  
   164  type AccountsService struct {
   165  	s *Service
   166  }
   167  
   168  func NewContactsService(s *Service) *ContactsService {
   169  	rs := &ContactsService{s: s}
   170  	return rs
   171  }
   172  
   173  type ContactsService struct {
   174  	s *Service
   175  }
   176  
   177  func NewLocationsService(s *Service) *LocationsService {
   178  	rs := &LocationsService{s: s}
   179  	return rs
   180  }
   181  
   182  type LocationsService struct {
   183  	s *Service
   184  }
   185  
   186  func NewSettingsService(s *Service) *SettingsService {
   187  	rs := &SettingsService{s: s}
   188  	return rs
   189  }
   190  
   191  type SettingsService struct {
   192  	s *Service
   193  }
   194  
   195  func NewSubscriptionsService(s *Service) *SubscriptionsService {
   196  	rs := &SubscriptionsService{s: s}
   197  	return rs
   198  }
   199  
   200  type SubscriptionsService struct {
   201  	s *Service
   202  }
   203  
   204  func NewTimelineService(s *Service) *TimelineService {
   205  	rs := &TimelineService{s: s}
   206  	rs.Attachments = NewTimelineAttachmentsService(s)
   207  	return rs
   208  }
   209  
   210  type TimelineService struct {
   211  	s *Service
   212  
   213  	Attachments *TimelineAttachmentsService
   214  }
   215  
   216  func NewTimelineAttachmentsService(s *Service) *TimelineAttachmentsService {
   217  	rs := &TimelineAttachmentsService{s: s}
   218  	return rs
   219  }
   220  
   221  type TimelineAttachmentsService struct {
   222  	s *Service
   223  }
   224  
   225  // Account: Represents an account passed into the Account Manager on
   226  // Glass.
   227  type Account struct {
   228  	AuthTokens []*AuthToken `json:"authTokens,omitempty"`
   229  
   230  	Features []string `json:"features,omitempty"`
   231  
   232  	Password string `json:"password,omitempty"`
   233  
   234  	UserData []*UserData `json:"userData,omitempty"`
   235  
   236  	// ServerResponse contains the HTTP response code and headers from the
   237  	// server.
   238  	googleapi.ServerResponse `json:"-"`
   239  
   240  	// ForceSendFields is a list of field names (e.g. "AuthTokens") to
   241  	// unconditionally include in API requests. By default, fields with
   242  	// empty values are omitted from API requests. However, any non-pointer,
   243  	// non-interface field appearing in ForceSendFields will be sent to the
   244  	// server regardless of whether the field is empty or not. This may be
   245  	// used to include empty fields in Patch requests.
   246  	ForceSendFields []string `json:"-"`
   247  
   248  	// NullFields is a list of field names (e.g. "AuthTokens") to include in
   249  	// API requests with the JSON null value. By default, fields with empty
   250  	// values are omitted from API requests. However, any field with an
   251  	// empty value appearing in NullFields will be sent to the server as
   252  	// null. It is an error if a field in this list has a non-empty value.
   253  	// This may be used to include null fields in Patch requests.
   254  	NullFields []string `json:"-"`
   255  }
   256  
   257  func (s *Account) MarshalJSON() ([]byte, error) {
   258  	type NoMethod Account
   259  	raw := NoMethod(*s)
   260  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   261  }
   262  
   263  // Attachment: Represents media content, such as a photo, that can be
   264  // attached to a timeline item.
   265  type Attachment struct {
   266  	// ContentType: The MIME type of the attachment.
   267  	ContentType string `json:"contentType,omitempty"`
   268  
   269  	// ContentUrl: The URL for the content.
   270  	ContentUrl string `json:"contentUrl,omitempty"`
   271  
   272  	// Id: The ID of the attachment.
   273  	Id string `json:"id,omitempty"`
   274  
   275  	// IsProcessingContent: Indicates that the contentUrl is not available
   276  	// because the attachment content is still being processed. If the
   277  	// caller wishes to retrieve the content, it should try again later.
   278  	IsProcessingContent bool `json:"isProcessingContent,omitempty"`
   279  
   280  	// ServerResponse contains the HTTP response code and headers from the
   281  	// server.
   282  	googleapi.ServerResponse `json:"-"`
   283  
   284  	// ForceSendFields is a list of field names (e.g. "ContentType") to
   285  	// unconditionally include in API requests. By default, fields with
   286  	// empty values are omitted from API requests. However, any non-pointer,
   287  	// non-interface field appearing in ForceSendFields will be sent to the
   288  	// server regardless of whether the field is empty or not. This may be
   289  	// used to include empty fields in Patch requests.
   290  	ForceSendFields []string `json:"-"`
   291  
   292  	// NullFields is a list of field names (e.g. "ContentType") to include
   293  	// in API requests with the JSON null value. By default, fields with
   294  	// empty values are omitted from API requests. However, any field with
   295  	// an empty value appearing in NullFields will be sent to the server as
   296  	// null. It is an error if a field in this list has a non-empty value.
   297  	// This may be used to include null fields in Patch requests.
   298  	NullFields []string `json:"-"`
   299  }
   300  
   301  func (s *Attachment) MarshalJSON() ([]byte, error) {
   302  	type NoMethod Attachment
   303  	raw := NoMethod(*s)
   304  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   305  }
   306  
   307  // AttachmentsListResponse: A list of Attachments. This is the response
   308  // from the server to GET requests on the attachments collection.
   309  type AttachmentsListResponse struct {
   310  	// Items: The list of attachments.
   311  	Items []*Attachment `json:"items,omitempty"`
   312  
   313  	// Kind: The type of resource. This is always mirror#attachmentsList.
   314  	Kind string `json:"kind,omitempty"`
   315  
   316  	// ServerResponse contains the HTTP response code and headers from the
   317  	// server.
   318  	googleapi.ServerResponse `json:"-"`
   319  
   320  	// ForceSendFields is a list of field names (e.g. "Items") to
   321  	// unconditionally include in API requests. By default, fields with
   322  	// empty values are omitted from API requests. However, any non-pointer,
   323  	// non-interface field appearing in ForceSendFields will be sent to the
   324  	// server regardless of whether the field is empty or not. This may be
   325  	// used to include empty fields in Patch requests.
   326  	ForceSendFields []string `json:"-"`
   327  
   328  	// NullFields is a list of field names (e.g. "Items") to include in API
   329  	// requests with the JSON null value. By default, fields with empty
   330  	// values are omitted from API requests. However, any field with an
   331  	// empty value appearing in NullFields will be sent to the server as
   332  	// null. It is an error if a field in this list has a non-empty value.
   333  	// This may be used to include null fields in Patch requests.
   334  	NullFields []string `json:"-"`
   335  }
   336  
   337  func (s *AttachmentsListResponse) MarshalJSON() ([]byte, error) {
   338  	type NoMethod AttachmentsListResponse
   339  	raw := NoMethod(*s)
   340  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   341  }
   342  
   343  type AuthToken struct {
   344  	AuthToken string `json:"authToken,omitempty"`
   345  
   346  	Type string `json:"type,omitempty"`
   347  
   348  	// ForceSendFields is a list of field names (e.g. "AuthToken") to
   349  	// unconditionally include in API requests. By default, fields with
   350  	// empty values are omitted from API requests. However, any non-pointer,
   351  	// non-interface field appearing in ForceSendFields will be sent to the
   352  	// server regardless of whether the field is empty or not. This may be
   353  	// used to include empty fields in Patch requests.
   354  	ForceSendFields []string `json:"-"`
   355  
   356  	// NullFields is a list of field names (e.g. "AuthToken") to include in
   357  	// API requests with the JSON null value. By default, fields with empty
   358  	// values are omitted from API requests. However, any field with an
   359  	// empty value appearing in NullFields will be sent to the server as
   360  	// null. It is an error if a field in this list has a non-empty value.
   361  	// This may be used to include null fields in Patch requests.
   362  	NullFields []string `json:"-"`
   363  }
   364  
   365  func (s *AuthToken) MarshalJSON() ([]byte, error) {
   366  	type NoMethod AuthToken
   367  	raw := NoMethod(*s)
   368  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   369  }
   370  
   371  // Command: A single menu command that is part of a Contact.
   372  type Command struct {
   373  	// Type: The type of operation this command corresponds to. Allowed
   374  	// values are:
   375  	// - TAKE_A_NOTE - Shares a timeline item with the transcription of user
   376  	// speech from the "Take a note" voice menu command.
   377  	// - POST_AN_UPDATE - Shares a timeline item with the transcription of
   378  	// user speech from the "Post an update" voice menu command.
   379  	Type string `json:"type,omitempty"`
   380  
   381  	// ForceSendFields is a list of field names (e.g. "Type") to
   382  	// unconditionally include in API requests. By default, fields with
   383  	// empty values are omitted from API requests. However, any non-pointer,
   384  	// non-interface field appearing in ForceSendFields will be sent to the
   385  	// server regardless of whether the field is empty or not. This may be
   386  	// used to include empty fields in Patch requests.
   387  	ForceSendFields []string `json:"-"`
   388  
   389  	// NullFields is a list of field names (e.g. "Type") to include in API
   390  	// requests with the JSON null value. By default, fields with empty
   391  	// values are omitted from API requests. However, any field with an
   392  	// empty value appearing in NullFields will be sent to the server as
   393  	// null. It is an error if a field in this list has a non-empty value.
   394  	// This may be used to include null fields in Patch requests.
   395  	NullFields []string `json:"-"`
   396  }
   397  
   398  func (s *Command) MarshalJSON() ([]byte, error) {
   399  	type NoMethod Command
   400  	raw := NoMethod(*s)
   401  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   402  }
   403  
   404  // Contact: A person or group that can be used as a creator or a
   405  // contact.
   406  type Contact struct {
   407  	// AcceptCommands: A list of voice menu commands that a contact can
   408  	// handle. Glass shows up to three contacts for each voice menu command.
   409  	// If there are more than that, the three contacts with the highest
   410  	// priority are shown for that particular command.
   411  	AcceptCommands []*Command `json:"acceptCommands,omitempty"`
   412  
   413  	// AcceptTypes: A list of MIME types that a contact supports. The
   414  	// contact will be shown to the user if any of its acceptTypes matches
   415  	// any of the types of the attachments on the item. If no acceptTypes
   416  	// are given, the contact will be shown for all items.
   417  	AcceptTypes []string `json:"acceptTypes,omitempty"`
   418  
   419  	// DisplayName: The name to display for this contact.
   420  	DisplayName string `json:"displayName,omitempty"`
   421  
   422  	// Id: An ID for this contact. This is generated by the application and
   423  	// is treated as an opaque token.
   424  	Id string `json:"id,omitempty"`
   425  
   426  	// ImageUrls: Set of image URLs to display for a contact. Most contacts
   427  	// will have a single image, but a "group" contact may include up to 8
   428  	// image URLs and they will be resized and cropped into a mosaic on the
   429  	// client.
   430  	ImageUrls []string `json:"imageUrls,omitempty"`
   431  
   432  	// Kind: The type of resource. This is always mirror#contact.
   433  	Kind string `json:"kind,omitempty"`
   434  
   435  	// PhoneNumber: Primary phone number for the contact. This can be a
   436  	// fully-qualified number, with country calling code and area code, or a
   437  	// local number.
   438  	PhoneNumber string `json:"phoneNumber,omitempty"`
   439  
   440  	// Priority: Priority for the contact to determine ordering in a list of
   441  	// contacts. Contacts with higher priorities will be shown before ones
   442  	// with lower priorities.
   443  	Priority int64 `json:"priority,omitempty"`
   444  
   445  	// SharingFeatures: A list of sharing features that a contact can
   446  	// handle. Allowed values are:
   447  	// - ADD_CAPTION
   448  	SharingFeatures []string `json:"sharingFeatures,omitempty"`
   449  
   450  	// Source: The ID of the application that created this contact. This is
   451  	// populated by the API
   452  	Source string `json:"source,omitempty"`
   453  
   454  	// SpeakableName: Name of this contact as it should be pronounced. If
   455  	// this contact's name must be spoken as part of a voice disambiguation
   456  	// menu, this name is used as the expected pronunciation. This is useful
   457  	// for contact names with unpronounceable characters or whose display
   458  	// spelling is otherwise not phonetic.
   459  	SpeakableName string `json:"speakableName,omitempty"`
   460  
   461  	// Type: The type for this contact. This is used for sorting in UIs.
   462  	// Allowed values are:
   463  	// - INDIVIDUAL - Represents a single person. This is the default.
   464  	// - GROUP - Represents more than a single person.
   465  	Type string `json:"type,omitempty"`
   466  
   467  	// ServerResponse contains the HTTP response code and headers from the
   468  	// server.
   469  	googleapi.ServerResponse `json:"-"`
   470  
   471  	// ForceSendFields is a list of field names (e.g. "AcceptCommands") to
   472  	// unconditionally include in API requests. By default, fields with
   473  	// empty values are omitted from API requests. However, any non-pointer,
   474  	// non-interface field appearing in ForceSendFields will be sent to the
   475  	// server regardless of whether the field is empty or not. This may be
   476  	// used to include empty fields in Patch requests.
   477  	ForceSendFields []string `json:"-"`
   478  
   479  	// NullFields is a list of field names (e.g. "AcceptCommands") to
   480  	// include in API requests with the JSON null value. By default, fields
   481  	// with empty values are omitted from API requests. However, any field
   482  	// with an empty value appearing in NullFields will be sent to the
   483  	// server as null. It is an error if a field in this list has a
   484  	// non-empty value. This may be used to include null fields in Patch
   485  	// requests.
   486  	NullFields []string `json:"-"`
   487  }
   488  
   489  func (s *Contact) MarshalJSON() ([]byte, error) {
   490  	type NoMethod Contact
   491  	raw := NoMethod(*s)
   492  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   493  }
   494  
   495  // ContactsListResponse: A list of Contacts representing contacts. This
   496  // is the response from the server to GET requests on the contacts
   497  // collection.
   498  type ContactsListResponse struct {
   499  	// Items: Contact list.
   500  	Items []*Contact `json:"items,omitempty"`
   501  
   502  	// Kind: The type of resource. This is always mirror#contacts.
   503  	Kind string `json:"kind,omitempty"`
   504  
   505  	// ServerResponse contains the HTTP response code and headers from the
   506  	// server.
   507  	googleapi.ServerResponse `json:"-"`
   508  
   509  	// ForceSendFields is a list of field names (e.g. "Items") to
   510  	// unconditionally include in API requests. By default, fields with
   511  	// empty values are omitted from API requests. However, any non-pointer,
   512  	// non-interface field appearing in ForceSendFields will be sent to the
   513  	// server regardless of whether the field is empty or not. This may be
   514  	// used to include empty fields in Patch requests.
   515  	ForceSendFields []string `json:"-"`
   516  
   517  	// NullFields is a list of field names (e.g. "Items") to include in API
   518  	// requests with the JSON null value. By default, fields with empty
   519  	// values are omitted from API requests. However, any field with an
   520  	// empty value appearing in NullFields will be sent to the server as
   521  	// null. It is an error if a field in this list has a non-empty value.
   522  	// This may be used to include null fields in Patch requests.
   523  	NullFields []string `json:"-"`
   524  }
   525  
   526  func (s *ContactsListResponse) MarshalJSON() ([]byte, error) {
   527  	type NoMethod ContactsListResponse
   528  	raw := NoMethod(*s)
   529  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   530  }
   531  
   532  // Location: A geographic location that can be associated with a
   533  // timeline item.
   534  type Location struct {
   535  	// Accuracy: The accuracy of the location fix in meters.
   536  	Accuracy float64 `json:"accuracy,omitempty"`
   537  
   538  	// Address: The full address of the location.
   539  	Address string `json:"address,omitempty"`
   540  
   541  	// DisplayName: The name to be displayed. This may be a business name or
   542  	// a user-defined place, such as "Home".
   543  	DisplayName string `json:"displayName,omitempty"`
   544  
   545  	// Id: The ID of the location.
   546  	Id string `json:"id,omitempty"`
   547  
   548  	// Kind: The type of resource. This is always mirror#location.
   549  	Kind string `json:"kind,omitempty"`
   550  
   551  	// Latitude: The latitude, in degrees.
   552  	Latitude float64 `json:"latitude,omitempty"`
   553  
   554  	// Longitude: The longitude, in degrees.
   555  	Longitude float64 `json:"longitude,omitempty"`
   556  
   557  	// Timestamp: The time at which this location was captured, formatted
   558  	// according to RFC 3339.
   559  	Timestamp string `json:"timestamp,omitempty"`
   560  
   561  	// ServerResponse contains the HTTP response code and headers from the
   562  	// server.
   563  	googleapi.ServerResponse `json:"-"`
   564  
   565  	// ForceSendFields is a list of field names (e.g. "Accuracy") to
   566  	// unconditionally include in API requests. By default, fields with
   567  	// empty values are omitted from API requests. However, any non-pointer,
   568  	// non-interface field appearing in ForceSendFields will be sent to the
   569  	// server regardless of whether the field is empty or not. This may be
   570  	// used to include empty fields in Patch requests.
   571  	ForceSendFields []string `json:"-"`
   572  
   573  	// NullFields is a list of field names (e.g. "Accuracy") to include in
   574  	// API requests with the JSON null value. By default, fields with empty
   575  	// values are omitted from API requests. However, any field with an
   576  	// empty value appearing in NullFields will be sent to the server as
   577  	// null. It is an error if a field in this list has a non-empty value.
   578  	// This may be used to include null fields in Patch requests.
   579  	NullFields []string `json:"-"`
   580  }
   581  
   582  func (s *Location) MarshalJSON() ([]byte, error) {
   583  	type NoMethod Location
   584  	raw := NoMethod(*s)
   585  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   586  }
   587  
   588  func (s *Location) UnmarshalJSON(data []byte) error {
   589  	type NoMethod Location
   590  	var s1 struct {
   591  		Accuracy  gensupport.JSONFloat64 `json:"accuracy"`
   592  		Latitude  gensupport.JSONFloat64 `json:"latitude"`
   593  		Longitude gensupport.JSONFloat64 `json:"longitude"`
   594  		*NoMethod
   595  	}
   596  	s1.NoMethod = (*NoMethod)(s)
   597  	if err := json.Unmarshal(data, &s1); err != nil {
   598  		return err
   599  	}
   600  	s.Accuracy = float64(s1.Accuracy)
   601  	s.Latitude = float64(s1.Latitude)
   602  	s.Longitude = float64(s1.Longitude)
   603  	return nil
   604  }
   605  
   606  // LocationsListResponse: A list of Locations. This is the response from
   607  // the server to GET requests on the locations collection.
   608  type LocationsListResponse struct {
   609  	// Items: The list of locations.
   610  	Items []*Location `json:"items,omitempty"`
   611  
   612  	// Kind: The type of resource. This is always mirror#locationsList.
   613  	Kind string `json:"kind,omitempty"`
   614  
   615  	// ServerResponse contains the HTTP response code and headers from the
   616  	// server.
   617  	googleapi.ServerResponse `json:"-"`
   618  
   619  	// ForceSendFields is a list of field names (e.g. "Items") to
   620  	// unconditionally include in API requests. By default, fields with
   621  	// empty values are omitted from API requests. However, any non-pointer,
   622  	// non-interface field appearing in ForceSendFields will be sent to the
   623  	// server regardless of whether the field is empty or not. This may be
   624  	// used to include empty fields in Patch requests.
   625  	ForceSendFields []string `json:"-"`
   626  
   627  	// NullFields is a list of field names (e.g. "Items") to include in API
   628  	// requests with the JSON null value. By default, fields with empty
   629  	// values are omitted from API requests. However, any field with an
   630  	// empty value appearing in NullFields will be sent to the server as
   631  	// null. It is an error if a field in this list has a non-empty value.
   632  	// This may be used to include null fields in Patch requests.
   633  	NullFields []string `json:"-"`
   634  }
   635  
   636  func (s *LocationsListResponse) MarshalJSON() ([]byte, error) {
   637  	type NoMethod LocationsListResponse
   638  	raw := NoMethod(*s)
   639  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   640  }
   641  
   642  // MenuItem: A custom menu item that can be presented to the user by a
   643  // timeline item.
   644  type MenuItem struct {
   645  	// Action: Controls the behavior when the user picks the menu option.
   646  	// Allowed values are:
   647  	// - CUSTOM - Custom action set by the service. When the user selects
   648  	// this menuItem, the API triggers a notification to your callbackUrl
   649  	// with the userActions.type set to CUSTOM and the userActions.payload
   650  	// set to the ID of this menu item. This is the default value.
   651  	// - Built-in actions:
   652  	// - REPLY - Initiate a reply to the timeline item using the voice
   653  	// recording UI. The creator attribute must be set in the timeline item
   654  	// for this menu to be available.
   655  	// - REPLY_ALL - Same behavior as REPLY. The original timeline item's
   656  	// recipients will be added to the reply item.
   657  	// - DELETE - Delete the timeline item.
   658  	// - SHARE - Share the timeline item with the available contacts.
   659  	// - READ_ALOUD - Read the timeline item's speakableText aloud; if this
   660  	// field is not set, read the text field; if none of those fields are
   661  	// set, this menu item is ignored.
   662  	// - GET_MEDIA_INPUT - Allow users to provide media payloads to
   663  	// Glassware from a menu item (currently, only transcribed text from
   664  	// voice input is supported). Subscribe to notifications when users
   665  	// invoke this menu item to receive the timeline item ID. Retrieve the
   666  	// media from the timeline item in the payload property.
   667  	// - VOICE_CALL - Initiate a phone call using the timeline item's
   668  	// creator.phoneNumber attribute as recipient.
   669  	// - NAVIGATE - Navigate to the timeline item's location.
   670  	// - TOGGLE_PINNED - Toggle the isPinned state of the timeline item.
   671  	// - OPEN_URI - Open the payload of the menu item in the browser.
   672  	// - PLAY_VIDEO - Open the payload of the menu item in the Glass video
   673  	// player.
   674  	// - SEND_MESSAGE - Initiate sending a message to the timeline item's
   675  	// creator:
   676  	// - If the creator.phoneNumber is set and Glass is connected to an
   677  	// Android phone, the message is an SMS.
   678  	// - Otherwise, if the creator.email is set, the message is an email.
   679  	Action string `json:"action,omitempty"`
   680  
   681  	// ContextualCommand: The ContextualMenus.Command associated with this
   682  	// MenuItem (e.g. READ_ALOUD). The voice label for this command will be
   683  	// displayed in the voice menu and the touch label will be displayed in
   684  	// the touch menu. Note that the default menu value's display name will
   685  	// be overriden if you specify this property. Values that do not
   686  	// correspond to a ContextualMenus.Command name will be ignored.
   687  	ContextualCommand string `json:"contextual_command,omitempty"`
   688  
   689  	// Id: The ID for this menu item. This is generated by the application
   690  	// and is treated as an opaque token.
   691  	Id string `json:"id,omitempty"`
   692  
   693  	// Payload: A generic payload whose meaning changes depending on this
   694  	// MenuItem's action.
   695  	// - When the action is OPEN_URI, the payload is the URL of the website
   696  	// to view.
   697  	// - When the action is PLAY_VIDEO, the payload is the streaming URL of
   698  	// the video
   699  	// - When the action is GET_MEDIA_INPUT, the payload is the text
   700  	// transcription of a user's speech input
   701  	Payload string `json:"payload,omitempty"`
   702  
   703  	// RemoveWhenSelected: If set to true on a CUSTOM menu item, that item
   704  	// will be removed from the menu after it is selected.
   705  	RemoveWhenSelected bool `json:"removeWhenSelected,omitempty"`
   706  
   707  	// Values: For CUSTOM items, a list of values controlling the appearance
   708  	// of the menu item in each of its states. A value for the DEFAULT state
   709  	// must be provided. If the PENDING or CONFIRMED states are missing,
   710  	// they will not be shown.
   711  	Values []*MenuValue `json:"values,omitempty"`
   712  
   713  	// ForceSendFields is a list of field names (e.g. "Action") to
   714  	// unconditionally include in API requests. By default, fields with
   715  	// empty values are omitted from API requests. However, any non-pointer,
   716  	// non-interface field appearing in ForceSendFields will be sent to the
   717  	// server regardless of whether the field is empty or not. This may be
   718  	// used to include empty fields in Patch requests.
   719  	ForceSendFields []string `json:"-"`
   720  
   721  	// NullFields is a list of field names (e.g. "Action") to include in API
   722  	// requests with the JSON null value. By default, fields with empty
   723  	// values are omitted from API requests. However, any field with an
   724  	// empty value appearing in NullFields will be sent to the server as
   725  	// null. It is an error if a field in this list has a non-empty value.
   726  	// This may be used to include null fields in Patch requests.
   727  	NullFields []string `json:"-"`
   728  }
   729  
   730  func (s *MenuItem) MarshalJSON() ([]byte, error) {
   731  	type NoMethod MenuItem
   732  	raw := NoMethod(*s)
   733  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   734  }
   735  
   736  // MenuValue: A single value that is part of a MenuItem.
   737  type MenuValue struct {
   738  	// DisplayName: The name to display for the menu item. If you specify
   739  	// this property for a built-in menu item, the default contextual voice
   740  	// command for that menu item is not shown.
   741  	DisplayName string `json:"displayName,omitempty"`
   742  
   743  	// IconUrl: URL of an icon to display with the menu item.
   744  	IconUrl string `json:"iconUrl,omitempty"`
   745  
   746  	// State: The state that this value applies to. Allowed values are:
   747  	// - DEFAULT - Default value shown when displayed in the menuItems list.
   748  	//
   749  	// - PENDING - Value shown when the menuItem has been selected by the
   750  	// user but can still be cancelled.
   751  	// - CONFIRMED - Value shown when the menuItem has been selected by the
   752  	// user and can no longer be cancelled.
   753  	State string `json:"state,omitempty"`
   754  
   755  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
   756  	// unconditionally include in API requests. By default, fields with
   757  	// empty values are omitted from API requests. However, any non-pointer,
   758  	// non-interface field appearing in ForceSendFields will be sent to the
   759  	// server regardless of whether the field is empty or not. This may be
   760  	// used to include empty fields in Patch requests.
   761  	ForceSendFields []string `json:"-"`
   762  
   763  	// NullFields is a list of field names (e.g. "DisplayName") to include
   764  	// in API requests with the JSON null value. By default, fields with
   765  	// empty values are omitted from API requests. However, any field with
   766  	// an empty value appearing in NullFields will be sent to the server as
   767  	// null. It is an error if a field in this list has a non-empty value.
   768  	// This may be used to include null fields in Patch requests.
   769  	NullFields []string `json:"-"`
   770  }
   771  
   772  func (s *MenuValue) MarshalJSON() ([]byte, error) {
   773  	type NoMethod MenuValue
   774  	raw := NoMethod(*s)
   775  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   776  }
   777  
   778  // Notification: A notification delivered by the API.
   779  type Notification struct {
   780  	// Collection: The collection that generated the notification.
   781  	Collection string `json:"collection,omitempty"`
   782  
   783  	// ItemId: The ID of the item that generated the notification.
   784  	ItemId string `json:"itemId,omitempty"`
   785  
   786  	// Operation: The type of operation that generated the notification.
   787  	Operation string `json:"operation,omitempty"`
   788  
   789  	// UserActions: A list of actions taken by the user that triggered the
   790  	// notification.
   791  	UserActions []*UserAction `json:"userActions,omitempty"`
   792  
   793  	// UserToken: The user token provided by the service when it subscribed
   794  	// for notifications.
   795  	UserToken string `json:"userToken,omitempty"`
   796  
   797  	// VerifyToken: The secret verify token provided by the service when it
   798  	// subscribed for notifications.
   799  	VerifyToken string `json:"verifyToken,omitempty"`
   800  
   801  	// ForceSendFields is a list of field names (e.g. "Collection") to
   802  	// unconditionally include in API requests. By default, fields with
   803  	// empty values are omitted from API requests. However, any non-pointer,
   804  	// non-interface field appearing in ForceSendFields will be sent to the
   805  	// server regardless of whether the field is empty or not. This may be
   806  	// used to include empty fields in Patch requests.
   807  	ForceSendFields []string `json:"-"`
   808  
   809  	// NullFields is a list of field names (e.g. "Collection") to include in
   810  	// API requests with the JSON null value. By default, fields with empty
   811  	// values are omitted from API requests. However, any field with an
   812  	// empty value appearing in NullFields will be sent to the server as
   813  	// null. It is an error if a field in this list has a non-empty value.
   814  	// This may be used to include null fields in Patch requests.
   815  	NullFields []string `json:"-"`
   816  }
   817  
   818  func (s *Notification) MarshalJSON() ([]byte, error) {
   819  	type NoMethod Notification
   820  	raw := NoMethod(*s)
   821  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   822  }
   823  
   824  // NotificationConfig: Controls how notifications for a timeline item
   825  // are presented to the user.
   826  type NotificationConfig struct {
   827  	// DeliveryTime: The time at which the notification should be delivered.
   828  	DeliveryTime string `json:"deliveryTime,omitempty"`
   829  
   830  	// Level: Describes how important the notification is. Allowed values
   831  	// are:
   832  	// - DEFAULT - Notifications of default importance. A chime will be
   833  	// played to alert users.
   834  	Level string `json:"level,omitempty"`
   835  
   836  	// ForceSendFields is a list of field names (e.g. "DeliveryTime") to
   837  	// unconditionally include in API requests. By default, fields with
   838  	// empty values are omitted from API requests. However, any non-pointer,
   839  	// non-interface field appearing in ForceSendFields will be sent to the
   840  	// server regardless of whether the field is empty or not. This may be
   841  	// used to include empty fields in Patch requests.
   842  	ForceSendFields []string `json:"-"`
   843  
   844  	// NullFields is a list of field names (e.g. "DeliveryTime") to include
   845  	// in API requests with the JSON null value. By default, fields with
   846  	// empty values are omitted from API requests. However, any field with
   847  	// an empty value appearing in NullFields will be sent to the server as
   848  	// null. It is an error if a field in this list has a non-empty value.
   849  	// This may be used to include null fields in Patch requests.
   850  	NullFields []string `json:"-"`
   851  }
   852  
   853  func (s *NotificationConfig) MarshalJSON() ([]byte, error) {
   854  	type NoMethod NotificationConfig
   855  	raw := NoMethod(*s)
   856  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   857  }
   858  
   859  // Setting: A setting for Glass.
   860  type Setting struct {
   861  	// Id: The setting's ID. The following IDs are valid:
   862  	// - locale - The key to the user’s language/locale (BCP 47
   863  	// identifier) that Glassware should use to render localized content.
   864  	//
   865  	// - timezone - The key to the user’s current time zone region as
   866  	// defined in the tz database. Example: America/Los_Angeles.
   867  	Id string `json:"id,omitempty"`
   868  
   869  	// Kind: The type of resource. This is always mirror#setting.
   870  	Kind string `json:"kind,omitempty"`
   871  
   872  	// Value: The setting value, as a string.
   873  	Value string `json:"value,omitempty"`
   874  
   875  	// ServerResponse contains the HTTP response code and headers from the
   876  	// server.
   877  	googleapi.ServerResponse `json:"-"`
   878  
   879  	// ForceSendFields is a list of field names (e.g. "Id") to
   880  	// unconditionally include in API requests. By default, fields with
   881  	// empty values are omitted from API requests. However, any non-pointer,
   882  	// non-interface field appearing in ForceSendFields will be sent to the
   883  	// server regardless of whether the field is empty or not. This may be
   884  	// used to include empty fields in Patch requests.
   885  	ForceSendFields []string `json:"-"`
   886  
   887  	// NullFields is a list of field names (e.g. "Id") to include in API
   888  	// requests with the JSON null value. By default, fields with empty
   889  	// values are omitted from API requests. However, any field with an
   890  	// empty value appearing in NullFields will be sent to the server as
   891  	// null. It is an error if a field in this list has a non-empty value.
   892  	// This may be used to include null fields in Patch requests.
   893  	NullFields []string `json:"-"`
   894  }
   895  
   896  func (s *Setting) MarshalJSON() ([]byte, error) {
   897  	type NoMethod Setting
   898  	raw := NoMethod(*s)
   899  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   900  }
   901  
   902  // Subscription: A subscription to events on a collection.
   903  type Subscription struct {
   904  	// CallbackUrl: The URL where notifications should be delivered (must
   905  	// start with https://).
   906  	CallbackUrl string `json:"callbackUrl,omitempty"`
   907  
   908  	// Collection: The collection to subscribe to. Allowed values are:
   909  	// - timeline - Changes in the timeline including insertion, deletion,
   910  	// and updates.
   911  	// - locations - Location updates.
   912  	// - settings - Settings updates.
   913  	Collection string `json:"collection,omitempty"`
   914  
   915  	// Id: The ID of the subscription.
   916  	Id string `json:"id,omitempty"`
   917  
   918  	// Kind: The type of resource. This is always mirror#subscription.
   919  	Kind string `json:"kind,omitempty"`
   920  
   921  	// Notification: Container object for notifications. This is not
   922  	// populated in the Subscription resource.
   923  	Notification *Notification `json:"notification,omitempty"`
   924  
   925  	// Operation: A list of operations that should be subscribed to. An
   926  	// empty list indicates that all operations on the collection should be
   927  	// subscribed to. Allowed values are:
   928  	// - UPDATE - The item has been updated.
   929  	// - INSERT - A new item has been inserted.
   930  	// - DELETE - The item has been deleted.
   931  	// - MENU_ACTION - A custom menu item has been triggered by the user.
   932  	Operation []string `json:"operation,omitempty"`
   933  
   934  	// Updated: The time at which this subscription was last modified,
   935  	// formatted according to RFC 3339.
   936  	Updated string `json:"updated,omitempty"`
   937  
   938  	// UserToken: An opaque token sent to the subscriber in notifications so
   939  	// that it can determine the ID of the user.
   940  	UserToken string `json:"userToken,omitempty"`
   941  
   942  	// VerifyToken: A secret token sent to the subscriber in notifications
   943  	// so that it can verify that the notification was generated by Google.
   944  	VerifyToken string `json:"verifyToken,omitempty"`
   945  
   946  	// ServerResponse contains the HTTP response code and headers from the
   947  	// server.
   948  	googleapi.ServerResponse `json:"-"`
   949  
   950  	// ForceSendFields is a list of field names (e.g. "CallbackUrl") to
   951  	// unconditionally include in API requests. By default, fields with
   952  	// empty values are omitted from API requests. However, any non-pointer,
   953  	// non-interface field appearing in ForceSendFields will be sent to the
   954  	// server regardless of whether the field is empty or not. This may be
   955  	// used to include empty fields in Patch requests.
   956  	ForceSendFields []string `json:"-"`
   957  
   958  	// NullFields is a list of field names (e.g. "CallbackUrl") to include
   959  	// in API requests with the JSON null value. By default, fields with
   960  	// empty values are omitted from API requests. However, any field with
   961  	// an empty value appearing in NullFields will be sent to the server as
   962  	// null. It is an error if a field in this list has a non-empty value.
   963  	// This may be used to include null fields in Patch requests.
   964  	NullFields []string `json:"-"`
   965  }
   966  
   967  func (s *Subscription) MarshalJSON() ([]byte, error) {
   968  	type NoMethod Subscription
   969  	raw := NoMethod(*s)
   970  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   971  }
   972  
   973  // SubscriptionsListResponse: A list of Subscriptions. This is the
   974  // response from the server to GET requests on the subscription
   975  // collection.
   976  type SubscriptionsListResponse struct {
   977  	// Items: The list of subscriptions.
   978  	Items []*Subscription `json:"items,omitempty"`
   979  
   980  	// Kind: The type of resource. This is always mirror#subscriptionsList.
   981  	Kind string `json:"kind,omitempty"`
   982  
   983  	// ServerResponse contains the HTTP response code and headers from the
   984  	// server.
   985  	googleapi.ServerResponse `json:"-"`
   986  
   987  	// ForceSendFields is a list of field names (e.g. "Items") to
   988  	// unconditionally include in API requests. By default, fields with
   989  	// empty values are omitted from API requests. However, any non-pointer,
   990  	// non-interface field appearing in ForceSendFields will be sent to the
   991  	// server regardless of whether the field is empty or not. This may be
   992  	// used to include empty fields in Patch requests.
   993  	ForceSendFields []string `json:"-"`
   994  
   995  	// NullFields is a list of field names (e.g. "Items") to include in API
   996  	// requests with the JSON null value. By default, fields with empty
   997  	// values are omitted from API requests. However, any field with an
   998  	// empty value appearing in NullFields will be sent to the server as
   999  	// null. It is an error if a field in this list has a non-empty value.
  1000  	// This may be used to include null fields in Patch requests.
  1001  	NullFields []string `json:"-"`
  1002  }
  1003  
  1004  func (s *SubscriptionsListResponse) MarshalJSON() ([]byte, error) {
  1005  	type NoMethod SubscriptionsListResponse
  1006  	raw := NoMethod(*s)
  1007  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1008  }
  1009  
  1010  // TimelineItem: Each item in the user's timeline is represented as a
  1011  // TimelineItem JSON structure, described below.
  1012  type TimelineItem struct {
  1013  	// Attachments: A list of media attachments associated with this item.
  1014  	// As a convenience, you can refer to attachments in your HTML payloads
  1015  	// with the attachment or cid scheme. For example:
  1016  	// - attachment: <img src="attachment:attachment_index"> where
  1017  	// attachment_index is the 0-based index of this array.
  1018  	// - cid: <img src="cid:attachment_id"> where attachment_id is the ID of
  1019  	// the attachment.
  1020  	Attachments []*Attachment `json:"attachments,omitempty"`
  1021  
  1022  	// BundleId: The bundle ID for this item. Services can specify a
  1023  	// bundleId to group many items together. They appear under a single
  1024  	// top-level item on the device.
  1025  	BundleId string `json:"bundleId,omitempty"`
  1026  
  1027  	// CanonicalUrl: A canonical URL pointing to the canonical/high quality
  1028  	// version of the data represented by the timeline item.
  1029  	CanonicalUrl string `json:"canonicalUrl,omitempty"`
  1030  
  1031  	// Created: The time at which this item was created, formatted according
  1032  	// to RFC 3339.
  1033  	Created string `json:"created,omitempty"`
  1034  
  1035  	// Creator: The user or group that created this item.
  1036  	Creator *Contact `json:"creator,omitempty"`
  1037  
  1038  	// DisplayTime: The time that should be displayed when this item is
  1039  	// viewed in the timeline, formatted according to RFC 3339. This user's
  1040  	// timeline is sorted chronologically on display time, so this will also
  1041  	// determine where the item is displayed in the timeline. If not set by
  1042  	// the service, the display time defaults to the updated time.
  1043  	DisplayTime string `json:"displayTime,omitempty"`
  1044  
  1045  	// Etag: ETag for this item.
  1046  	Etag string `json:"etag,omitempty"`
  1047  
  1048  	// Html: HTML content for this item. If both text and html are provided
  1049  	// for an item, the html will be rendered in the timeline.
  1050  	// Allowed HTML elements - You can use these elements in your timeline
  1051  	// cards.
  1052  	//
  1053  	// - Headers: h1, h2, h3, h4, h5, h6
  1054  	// - Images: img
  1055  	// - Lists: li, ol, ul
  1056  	// - HTML5 semantics: article, aside, details, figure, figcaption,
  1057  	// footer, header, nav, section, summary, time
  1058  	// - Structural: blockquote, br, div, hr, p, span
  1059  	// - Style: b, big, center, em, i, u, s, small, strike, strong, style,
  1060  	// sub, sup
  1061  	// - Tables: table, tbody, td, tfoot, th, thead, tr
  1062  	// Blocked HTML elements: These elements and their contents are removed
  1063  	// from HTML payloads.
  1064  	//
  1065  	// - Document headers: head, title
  1066  	// - Embeds: audio, embed, object, source, video
  1067  	// - Frames: frame, frameset
  1068  	// - Scripting: applet, script
  1069  	// Other elements: Any elements that aren't listed are removed, but
  1070  	// their contents are preserved.
  1071  	Html string `json:"html,omitempty"`
  1072  
  1073  	// Id: The ID of the timeline item. This is unique within a user's
  1074  	// timeline.
  1075  	Id string `json:"id,omitempty"`
  1076  
  1077  	// InReplyTo: If this item was generated as a reply to another item,
  1078  	// this field will be set to the ID of the item being replied to. This
  1079  	// can be used to attach a reply to the appropriate conversation or
  1080  	// post.
  1081  	InReplyTo string `json:"inReplyTo,omitempty"`
  1082  
  1083  	// IsBundleCover: Whether this item is a bundle cover.
  1084  	//
  1085  	// If an item is marked as a bundle cover, it will be the entry point to
  1086  	// the bundle of items that have the same bundleId as that item. It will
  1087  	// be shown only on the main timeline — not within the opened
  1088  	// bundle.
  1089  	//
  1090  	// On the main timeline, items that are shown are:
  1091  	// - Items that have isBundleCover set to true
  1092  	// - Items that do not have a bundleId  In a bundle sub-timeline, items
  1093  	// that are shown are:
  1094  	// - Items that have the bundleId in question AND isBundleCover set to
  1095  	// false
  1096  	IsBundleCover bool `json:"isBundleCover,omitempty"`
  1097  
  1098  	// IsDeleted: When true, indicates this item is deleted, and only the ID
  1099  	// property is set.
  1100  	IsDeleted bool `json:"isDeleted,omitempty"`
  1101  
  1102  	// IsPinned: When true, indicates this item is pinned, which means it's
  1103  	// grouped alongside "active" items like navigation and hangouts, on the
  1104  	// opposite side of the home screen from historical (non-pinned)
  1105  	// timeline items. You can allow the user to toggle the value of this
  1106  	// property with the TOGGLE_PINNED built-in menu item.
  1107  	IsPinned bool `json:"isPinned,omitempty"`
  1108  
  1109  	// Kind: The type of resource. This is always mirror#timelineItem.
  1110  	Kind string `json:"kind,omitempty"`
  1111  
  1112  	// Location: The geographic location associated with this item.
  1113  	Location *Location `json:"location,omitempty"`
  1114  
  1115  	// MenuItems: A list of menu items that will be presented to the user
  1116  	// when this item is selected in the timeline.
  1117  	MenuItems []*MenuItem `json:"menuItems,omitempty"`
  1118  
  1119  	// Notification: Controls how notifications for this item are presented
  1120  	// on the device. If this is missing, no notification will be generated.
  1121  	Notification *NotificationConfig `json:"notification,omitempty"`
  1122  
  1123  	// PinScore: For pinned items, this determines the order in which the
  1124  	// item is displayed in the timeline, with a higher score appearing
  1125  	// closer to the clock. Note: setting this field is currently not
  1126  	// supported.
  1127  	PinScore int64 `json:"pinScore,omitempty"`
  1128  
  1129  	// Recipients: A list of users or groups that this item has been shared
  1130  	// with.
  1131  	Recipients []*Contact `json:"recipients,omitempty"`
  1132  
  1133  	// SelfLink: A URL that can be used to retrieve this item.
  1134  	SelfLink string `json:"selfLink,omitempty"`
  1135  
  1136  	// SourceItemId: Opaque string you can use to map a timeline item to
  1137  	// data in your own service.
  1138  	SourceItemId string `json:"sourceItemId,omitempty"`
  1139  
  1140  	// SpeakableText: The speakable version of the content of this item.
  1141  	// Along with the READ_ALOUD menu item, use this field to provide text
  1142  	// that would be clearer when read aloud, or to provide extended
  1143  	// information to what is displayed visually on Glass.
  1144  	//
  1145  	// Glassware should also specify the speakableType field, which will be
  1146  	// spoken before this text in cases where the additional context is
  1147  	// useful, for example when the user requests that the item be read
  1148  	// aloud following a notification.
  1149  	SpeakableText string `json:"speakableText,omitempty"`
  1150  
  1151  	// SpeakableType: A speakable description of the type of this item. This
  1152  	// will be announced to the user prior to reading the content of the
  1153  	// item in cases where the additional context is useful, for example
  1154  	// when the user requests that the item be read aloud following a
  1155  	// notification.
  1156  	//
  1157  	// This should be a short, simple noun phrase such as "Email", "Text
  1158  	// message", or "Daily Planet News Update".
  1159  	//
  1160  	// Glassware are encouraged to populate this field for every timeline
  1161  	// item, even if the item does not contain speakableText or text so that
  1162  	// the user can learn the type of the item without looking at the
  1163  	// screen.
  1164  	SpeakableType string `json:"speakableType,omitempty"`
  1165  
  1166  	// Text: Text content of this item.
  1167  	Text string `json:"text,omitempty"`
  1168  
  1169  	// Title: The title of this item.
  1170  	Title string `json:"title,omitempty"`
  1171  
  1172  	// Updated: The time at which this item was last modified, formatted
  1173  	// according to RFC 3339.
  1174  	Updated string `json:"updated,omitempty"`
  1175  
  1176  	// ServerResponse contains the HTTP response code and headers from the
  1177  	// server.
  1178  	googleapi.ServerResponse `json:"-"`
  1179  
  1180  	// ForceSendFields is a list of field names (e.g. "Attachments") to
  1181  	// unconditionally include in API requests. By default, fields with
  1182  	// empty values are omitted from API requests. However, any non-pointer,
  1183  	// non-interface field appearing in ForceSendFields will be sent to the
  1184  	// server regardless of whether the field is empty or not. This may be
  1185  	// used to include empty fields in Patch requests.
  1186  	ForceSendFields []string `json:"-"`
  1187  
  1188  	// NullFields is a list of field names (e.g. "Attachments") to include
  1189  	// in API requests with the JSON null value. By default, fields with
  1190  	// empty values are omitted from API requests. However, any field with
  1191  	// an empty value appearing in NullFields will be sent to the server as
  1192  	// null. It is an error if a field in this list has a non-empty value.
  1193  	// This may be used to include null fields in Patch requests.
  1194  	NullFields []string `json:"-"`
  1195  }
  1196  
  1197  func (s *TimelineItem) MarshalJSON() ([]byte, error) {
  1198  	type NoMethod TimelineItem
  1199  	raw := NoMethod(*s)
  1200  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1201  }
  1202  
  1203  // TimelineListResponse: A list of timeline items. This is the response
  1204  // from the server to GET requests on the timeline collection.
  1205  type TimelineListResponse struct {
  1206  	// Items: Items in the timeline.
  1207  	Items []*TimelineItem `json:"items,omitempty"`
  1208  
  1209  	// Kind: The type of resource. This is always mirror#timeline.
  1210  	Kind string `json:"kind,omitempty"`
  1211  
  1212  	// NextPageToken: The next page token. Provide this as the pageToken
  1213  	// parameter in the request to retrieve the next page of results.
  1214  	NextPageToken string `json:"nextPageToken,omitempty"`
  1215  
  1216  	// ServerResponse contains the HTTP response code and headers from the
  1217  	// server.
  1218  	googleapi.ServerResponse `json:"-"`
  1219  
  1220  	// ForceSendFields is a list of field names (e.g. "Items") to
  1221  	// unconditionally include in API requests. By default, fields with
  1222  	// empty values are omitted from API requests. However, any non-pointer,
  1223  	// non-interface field appearing in ForceSendFields will be sent to the
  1224  	// server regardless of whether the field is empty or not. This may be
  1225  	// used to include empty fields in Patch requests.
  1226  	ForceSendFields []string `json:"-"`
  1227  
  1228  	// NullFields is a list of field names (e.g. "Items") to include in API
  1229  	// requests with the JSON null value. By default, fields with empty
  1230  	// values are omitted from API requests. However, any field with an
  1231  	// empty value appearing in NullFields will be sent to the server as
  1232  	// null. It is an error if a field in this list has a non-empty value.
  1233  	// This may be used to include null fields in Patch requests.
  1234  	NullFields []string `json:"-"`
  1235  }
  1236  
  1237  func (s *TimelineListResponse) MarshalJSON() ([]byte, error) {
  1238  	type NoMethod TimelineListResponse
  1239  	raw := NoMethod(*s)
  1240  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1241  }
  1242  
  1243  // UserAction: Represents an action taken by the user that triggered a
  1244  // notification.
  1245  type UserAction struct {
  1246  	// Payload: An optional payload for the action.
  1247  	//
  1248  	// For actions of type CUSTOM, this is the ID of the custom menu item
  1249  	// that was selected.
  1250  	Payload string `json:"payload,omitempty"`
  1251  
  1252  	// Type: The type of action. The value of this can be:
  1253  	// - SHARE - the user shared an item.
  1254  	// - REPLY - the user replied to an item.
  1255  	// - REPLY_ALL - the user replied to all recipients of an item.
  1256  	// - CUSTOM - the user selected a custom menu item on the timeline item.
  1257  	//
  1258  	// - DELETE - the user deleted the item.
  1259  	// - PIN - the user pinned the item.
  1260  	// - UNPIN - the user unpinned the item.
  1261  	// - LAUNCH - the user initiated a voice command.  In the future,
  1262  	// additional types may be added. UserActions with unrecognized types
  1263  	// should be ignored.
  1264  	Type string `json:"type,omitempty"`
  1265  
  1266  	// ForceSendFields is a list of field names (e.g. "Payload") to
  1267  	// unconditionally include in API requests. By default, fields with
  1268  	// empty values are omitted from API requests. However, any non-pointer,
  1269  	// non-interface field appearing in ForceSendFields will be sent to the
  1270  	// server regardless of whether the field is empty or not. This may be
  1271  	// used to include empty fields in Patch requests.
  1272  	ForceSendFields []string `json:"-"`
  1273  
  1274  	// NullFields is a list of field names (e.g. "Payload") to include in
  1275  	// API requests with the JSON null value. By default, fields with empty
  1276  	// values are omitted from API requests. However, any field with an
  1277  	// empty value appearing in NullFields will be sent to the server as
  1278  	// null. It is an error if a field in this list has a non-empty value.
  1279  	// This may be used to include null fields in Patch requests.
  1280  	NullFields []string `json:"-"`
  1281  }
  1282  
  1283  func (s *UserAction) MarshalJSON() ([]byte, error) {
  1284  	type NoMethod UserAction
  1285  	raw := NoMethod(*s)
  1286  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1287  }
  1288  
  1289  type UserData struct {
  1290  	Key string `json:"key,omitempty"`
  1291  
  1292  	Value string `json:"value,omitempty"`
  1293  
  1294  	// ForceSendFields is a list of field names (e.g. "Key") to
  1295  	// unconditionally include in API requests. By default, fields with
  1296  	// empty values are omitted from API requests. However, any non-pointer,
  1297  	// non-interface field appearing in ForceSendFields will be sent to the
  1298  	// server regardless of whether the field is empty or not. This may be
  1299  	// used to include empty fields in Patch requests.
  1300  	ForceSendFields []string `json:"-"`
  1301  
  1302  	// NullFields is a list of field names (e.g. "Key") to include in API
  1303  	// requests with the JSON null value. By default, fields with empty
  1304  	// values are omitted from API requests. However, any field with an
  1305  	// empty value appearing in NullFields will be sent to the server as
  1306  	// null. It is an error if a field in this list has a non-empty value.
  1307  	// This may be used to include null fields in Patch requests.
  1308  	NullFields []string `json:"-"`
  1309  }
  1310  
  1311  func (s *UserData) MarshalJSON() ([]byte, error) {
  1312  	type NoMethod UserData
  1313  	raw := NoMethod(*s)
  1314  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1315  }
  1316  
  1317  // method id "mirror.accounts.insert":
  1318  
  1319  type AccountsInsertCall struct {
  1320  	s           *Service
  1321  	userToken   string
  1322  	accountType string
  1323  	accountName string
  1324  	account     *Account
  1325  	urlParams_  gensupport.URLParams
  1326  	ctx_        context.Context
  1327  	header_     http.Header
  1328  }
  1329  
  1330  // Insert: Inserts a new account for a user
  1331  func (r *AccountsService) Insert(userToken string, accountType string, accountName string, account *Account) *AccountsInsertCall {
  1332  	c := &AccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1333  	c.userToken = userToken
  1334  	c.accountType = accountType
  1335  	c.accountName = accountName
  1336  	c.account = account
  1337  	return c
  1338  }
  1339  
  1340  // Fields allows partial responses to be retrieved. See
  1341  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1342  // for more information.
  1343  func (c *AccountsInsertCall) Fields(s ...googleapi.Field) *AccountsInsertCall {
  1344  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1345  	return c
  1346  }
  1347  
  1348  // Context sets the context to be used in this call's Do method. Any
  1349  // pending HTTP request will be aborted if the provided context is
  1350  // canceled.
  1351  func (c *AccountsInsertCall) Context(ctx context.Context) *AccountsInsertCall {
  1352  	c.ctx_ = ctx
  1353  	return c
  1354  }
  1355  
  1356  // Header returns an http.Header that can be modified by the caller to
  1357  // add HTTP headers to the request.
  1358  func (c *AccountsInsertCall) Header() http.Header {
  1359  	if c.header_ == nil {
  1360  		c.header_ = make(http.Header)
  1361  	}
  1362  	return c.header_
  1363  }
  1364  
  1365  func (c *AccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  1366  	reqHeaders := make(http.Header)
  1367  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  1368  	for k, v := range c.header_ {
  1369  		reqHeaders[k] = v
  1370  	}
  1371  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1372  	var body io.Reader = nil
  1373  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  1374  	if err != nil {
  1375  		return nil, err
  1376  	}
  1377  	reqHeaders.Set("Content-Type", "application/json")
  1378  	c.urlParams_.Set("alt", alt)
  1379  	c.urlParams_.Set("prettyPrint", "false")
  1380  	urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{userToken}/{accountType}/{accountName}")
  1381  	urls += "?" + c.urlParams_.Encode()
  1382  	req, err := http.NewRequest("POST", urls, body)
  1383  	if err != nil {
  1384  		return nil, err
  1385  	}
  1386  	req.Header = reqHeaders
  1387  	googleapi.Expand(req.URL, map[string]string{
  1388  		"userToken":   c.userToken,
  1389  		"accountType": c.accountType,
  1390  		"accountName": c.accountName,
  1391  	})
  1392  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1393  }
  1394  
  1395  // Do executes the "mirror.accounts.insert" call.
  1396  // Exactly one of *Account or error will be non-nil. Any non-2xx status
  1397  // code is an error. Response headers are in either
  1398  // *Account.ServerResponse.Header or (if a response was returned at all)
  1399  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1400  // check whether the returned error was because http.StatusNotModified
  1401  // was returned.
  1402  func (c *AccountsInsertCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  1403  	gensupport.SetOptions(c.urlParams_, opts...)
  1404  	res, err := c.doRequest("json")
  1405  	if res != nil && res.StatusCode == http.StatusNotModified {
  1406  		if res.Body != nil {
  1407  			res.Body.Close()
  1408  		}
  1409  		return nil, &googleapi.Error{
  1410  			Code:   res.StatusCode,
  1411  			Header: res.Header,
  1412  		}
  1413  	}
  1414  	if err != nil {
  1415  		return nil, err
  1416  	}
  1417  	defer googleapi.CloseBody(res)
  1418  	if err := googleapi.CheckResponse(res); err != nil {
  1419  		return nil, err
  1420  	}
  1421  	ret := &Account{
  1422  		ServerResponse: googleapi.ServerResponse{
  1423  			Header:         res.Header,
  1424  			HTTPStatusCode: res.StatusCode,
  1425  		},
  1426  	}
  1427  	target := &ret
  1428  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1429  		return nil, err
  1430  	}
  1431  	return ret, nil
  1432  	// {
  1433  	//   "description": "Inserts a new account for a user",
  1434  	//   "httpMethod": "POST",
  1435  	//   "id": "mirror.accounts.insert",
  1436  	//   "parameterOrder": [
  1437  	//     "userToken",
  1438  	//     "accountType",
  1439  	//     "accountName"
  1440  	//   ],
  1441  	//   "parameters": {
  1442  	//     "accountName": {
  1443  	//       "description": "The name of the account to be passed to the Android Account Manager.",
  1444  	//       "location": "path",
  1445  	//       "required": true,
  1446  	//       "type": "string"
  1447  	//     },
  1448  	//     "accountType": {
  1449  	//       "description": "Account type to be passed to Android Account Manager.",
  1450  	//       "location": "path",
  1451  	//       "required": true,
  1452  	//       "type": "string"
  1453  	//     },
  1454  	//     "userToken": {
  1455  	//       "description": "The ID for the user.",
  1456  	//       "location": "path",
  1457  	//       "required": true,
  1458  	//       "type": "string"
  1459  	//     }
  1460  	//   },
  1461  	//   "path": "accounts/{userToken}/{accountType}/{accountName}",
  1462  	//   "request": {
  1463  	//     "$ref": "Account"
  1464  	//   },
  1465  	//   "response": {
  1466  	//     "$ref": "Account"
  1467  	//   }
  1468  	// }
  1469  
  1470  }
  1471  
  1472  // method id "mirror.contacts.delete":
  1473  
  1474  type ContactsDeleteCall struct {
  1475  	s          *Service
  1476  	id         string
  1477  	urlParams_ gensupport.URLParams
  1478  	ctx_       context.Context
  1479  	header_    http.Header
  1480  }
  1481  
  1482  // Delete: Deletes a contact.
  1483  func (r *ContactsService) Delete(id string) *ContactsDeleteCall {
  1484  	c := &ContactsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1485  	c.id = id
  1486  	return c
  1487  }
  1488  
  1489  // Fields allows partial responses to be retrieved. See
  1490  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1491  // for more information.
  1492  func (c *ContactsDeleteCall) Fields(s ...googleapi.Field) *ContactsDeleteCall {
  1493  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1494  	return c
  1495  }
  1496  
  1497  // Context sets the context to be used in this call's Do method. Any
  1498  // pending HTTP request will be aborted if the provided context is
  1499  // canceled.
  1500  func (c *ContactsDeleteCall) Context(ctx context.Context) *ContactsDeleteCall {
  1501  	c.ctx_ = ctx
  1502  	return c
  1503  }
  1504  
  1505  // Header returns an http.Header that can be modified by the caller to
  1506  // add HTTP headers to the request.
  1507  func (c *ContactsDeleteCall) Header() http.Header {
  1508  	if c.header_ == nil {
  1509  		c.header_ = make(http.Header)
  1510  	}
  1511  	return c.header_
  1512  }
  1513  
  1514  func (c *ContactsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1515  	reqHeaders := make(http.Header)
  1516  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  1517  	for k, v := range c.header_ {
  1518  		reqHeaders[k] = v
  1519  	}
  1520  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1521  	var body io.Reader = nil
  1522  	c.urlParams_.Set("alt", alt)
  1523  	c.urlParams_.Set("prettyPrint", "false")
  1524  	urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
  1525  	urls += "?" + c.urlParams_.Encode()
  1526  	req, err := http.NewRequest("DELETE", urls, body)
  1527  	if err != nil {
  1528  		return nil, err
  1529  	}
  1530  	req.Header = reqHeaders
  1531  	googleapi.Expand(req.URL, map[string]string{
  1532  		"id": c.id,
  1533  	})
  1534  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1535  }
  1536  
  1537  // Do executes the "mirror.contacts.delete" call.
  1538  func (c *ContactsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1539  	gensupport.SetOptions(c.urlParams_, opts...)
  1540  	res, err := c.doRequest("json")
  1541  	if err != nil {
  1542  		return err
  1543  	}
  1544  	defer googleapi.CloseBody(res)
  1545  	if err := googleapi.CheckResponse(res); err != nil {
  1546  		return err
  1547  	}
  1548  	return nil
  1549  	// {
  1550  	//   "description": "Deletes a contact.",
  1551  	//   "httpMethod": "DELETE",
  1552  	//   "id": "mirror.contacts.delete",
  1553  	//   "parameterOrder": [
  1554  	//     "id"
  1555  	//   ],
  1556  	//   "parameters": {
  1557  	//     "id": {
  1558  	//       "description": "The ID of the contact.",
  1559  	//       "location": "path",
  1560  	//       "required": true,
  1561  	//       "type": "string"
  1562  	//     }
  1563  	//   },
  1564  	//   "path": "contacts/{id}",
  1565  	//   "scopes": [
  1566  	//     "https://www.googleapis.com/auth/glass.timeline"
  1567  	//   ]
  1568  	// }
  1569  
  1570  }
  1571  
  1572  // method id "mirror.contacts.get":
  1573  
  1574  type ContactsGetCall struct {
  1575  	s            *Service
  1576  	id           string
  1577  	urlParams_   gensupport.URLParams
  1578  	ifNoneMatch_ string
  1579  	ctx_         context.Context
  1580  	header_      http.Header
  1581  }
  1582  
  1583  // Get: Gets a single contact by ID.
  1584  func (r *ContactsService) Get(id string) *ContactsGetCall {
  1585  	c := &ContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1586  	c.id = id
  1587  	return c
  1588  }
  1589  
  1590  // Fields allows partial responses to be retrieved. See
  1591  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1592  // for more information.
  1593  func (c *ContactsGetCall) Fields(s ...googleapi.Field) *ContactsGetCall {
  1594  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1595  	return c
  1596  }
  1597  
  1598  // IfNoneMatch sets the optional parameter which makes the operation
  1599  // fail if the object's ETag matches the given value. This is useful for
  1600  // getting updates only after the object has changed since the last
  1601  // request. Use googleapi.IsNotModified to check whether the response
  1602  // error from Do is the result of In-None-Match.
  1603  func (c *ContactsGetCall) IfNoneMatch(entityTag string) *ContactsGetCall {
  1604  	c.ifNoneMatch_ = entityTag
  1605  	return c
  1606  }
  1607  
  1608  // Context sets the context to be used in this call's Do method. Any
  1609  // pending HTTP request will be aborted if the provided context is
  1610  // canceled.
  1611  func (c *ContactsGetCall) Context(ctx context.Context) *ContactsGetCall {
  1612  	c.ctx_ = ctx
  1613  	return c
  1614  }
  1615  
  1616  // Header returns an http.Header that can be modified by the caller to
  1617  // add HTTP headers to the request.
  1618  func (c *ContactsGetCall) Header() http.Header {
  1619  	if c.header_ == nil {
  1620  		c.header_ = make(http.Header)
  1621  	}
  1622  	return c.header_
  1623  }
  1624  
  1625  func (c *ContactsGetCall) doRequest(alt string) (*http.Response, error) {
  1626  	reqHeaders := make(http.Header)
  1627  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  1628  	for k, v := range c.header_ {
  1629  		reqHeaders[k] = v
  1630  	}
  1631  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1632  	if c.ifNoneMatch_ != "" {
  1633  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1634  	}
  1635  	var body io.Reader = nil
  1636  	c.urlParams_.Set("alt", alt)
  1637  	c.urlParams_.Set("prettyPrint", "false")
  1638  	urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
  1639  	urls += "?" + c.urlParams_.Encode()
  1640  	req, err := http.NewRequest("GET", urls, body)
  1641  	if err != nil {
  1642  		return nil, err
  1643  	}
  1644  	req.Header = reqHeaders
  1645  	googleapi.Expand(req.URL, map[string]string{
  1646  		"id": c.id,
  1647  	})
  1648  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1649  }
  1650  
  1651  // Do executes the "mirror.contacts.get" call.
  1652  // Exactly one of *Contact or error will be non-nil. Any non-2xx status
  1653  // code is an error. Response headers are in either
  1654  // *Contact.ServerResponse.Header or (if a response was returned at all)
  1655  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1656  // check whether the returned error was because http.StatusNotModified
  1657  // was returned.
  1658  func (c *ContactsGetCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
  1659  	gensupport.SetOptions(c.urlParams_, opts...)
  1660  	res, err := c.doRequest("json")
  1661  	if res != nil && res.StatusCode == http.StatusNotModified {
  1662  		if res.Body != nil {
  1663  			res.Body.Close()
  1664  		}
  1665  		return nil, &googleapi.Error{
  1666  			Code:   res.StatusCode,
  1667  			Header: res.Header,
  1668  		}
  1669  	}
  1670  	if err != nil {
  1671  		return nil, err
  1672  	}
  1673  	defer googleapi.CloseBody(res)
  1674  	if err := googleapi.CheckResponse(res); err != nil {
  1675  		return nil, err
  1676  	}
  1677  	ret := &Contact{
  1678  		ServerResponse: googleapi.ServerResponse{
  1679  			Header:         res.Header,
  1680  			HTTPStatusCode: res.StatusCode,
  1681  		},
  1682  	}
  1683  	target := &ret
  1684  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1685  		return nil, err
  1686  	}
  1687  	return ret, nil
  1688  	// {
  1689  	//   "description": "Gets a single contact by ID.",
  1690  	//   "httpMethod": "GET",
  1691  	//   "id": "mirror.contacts.get",
  1692  	//   "parameterOrder": [
  1693  	//     "id"
  1694  	//   ],
  1695  	//   "parameters": {
  1696  	//     "id": {
  1697  	//       "description": "The ID of the contact.",
  1698  	//       "location": "path",
  1699  	//       "required": true,
  1700  	//       "type": "string"
  1701  	//     }
  1702  	//   },
  1703  	//   "path": "contacts/{id}",
  1704  	//   "response": {
  1705  	//     "$ref": "Contact"
  1706  	//   },
  1707  	//   "scopes": [
  1708  	//     "https://www.googleapis.com/auth/glass.timeline"
  1709  	//   ]
  1710  	// }
  1711  
  1712  }
  1713  
  1714  // method id "mirror.contacts.insert":
  1715  
  1716  type ContactsInsertCall struct {
  1717  	s          *Service
  1718  	contact    *Contact
  1719  	urlParams_ gensupport.URLParams
  1720  	ctx_       context.Context
  1721  	header_    http.Header
  1722  }
  1723  
  1724  // Insert: Inserts a new contact.
  1725  func (r *ContactsService) Insert(contact *Contact) *ContactsInsertCall {
  1726  	c := &ContactsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1727  	c.contact = contact
  1728  	return c
  1729  }
  1730  
  1731  // Fields allows partial responses to be retrieved. See
  1732  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1733  // for more information.
  1734  func (c *ContactsInsertCall) Fields(s ...googleapi.Field) *ContactsInsertCall {
  1735  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1736  	return c
  1737  }
  1738  
  1739  // Context sets the context to be used in this call's Do method. Any
  1740  // pending HTTP request will be aborted if the provided context is
  1741  // canceled.
  1742  func (c *ContactsInsertCall) Context(ctx context.Context) *ContactsInsertCall {
  1743  	c.ctx_ = ctx
  1744  	return c
  1745  }
  1746  
  1747  // Header returns an http.Header that can be modified by the caller to
  1748  // add HTTP headers to the request.
  1749  func (c *ContactsInsertCall) Header() http.Header {
  1750  	if c.header_ == nil {
  1751  		c.header_ = make(http.Header)
  1752  	}
  1753  	return c.header_
  1754  }
  1755  
  1756  func (c *ContactsInsertCall) doRequest(alt string) (*http.Response, error) {
  1757  	reqHeaders := make(http.Header)
  1758  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  1759  	for k, v := range c.header_ {
  1760  		reqHeaders[k] = v
  1761  	}
  1762  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1763  	var body io.Reader = nil
  1764  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
  1765  	if err != nil {
  1766  		return nil, err
  1767  	}
  1768  	reqHeaders.Set("Content-Type", "application/json")
  1769  	c.urlParams_.Set("alt", alt)
  1770  	c.urlParams_.Set("prettyPrint", "false")
  1771  	urls := googleapi.ResolveRelative(c.s.BasePath, "contacts")
  1772  	urls += "?" + c.urlParams_.Encode()
  1773  	req, err := http.NewRequest("POST", urls, body)
  1774  	if err != nil {
  1775  		return nil, err
  1776  	}
  1777  	req.Header = reqHeaders
  1778  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1779  }
  1780  
  1781  // Do executes the "mirror.contacts.insert" call.
  1782  // Exactly one of *Contact or error will be non-nil. Any non-2xx status
  1783  // code is an error. Response headers are in either
  1784  // *Contact.ServerResponse.Header or (if a response was returned at all)
  1785  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1786  // check whether the returned error was because http.StatusNotModified
  1787  // was returned.
  1788  func (c *ContactsInsertCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
  1789  	gensupport.SetOptions(c.urlParams_, opts...)
  1790  	res, err := c.doRequest("json")
  1791  	if res != nil && res.StatusCode == http.StatusNotModified {
  1792  		if res.Body != nil {
  1793  			res.Body.Close()
  1794  		}
  1795  		return nil, &googleapi.Error{
  1796  			Code:   res.StatusCode,
  1797  			Header: res.Header,
  1798  		}
  1799  	}
  1800  	if err != nil {
  1801  		return nil, err
  1802  	}
  1803  	defer googleapi.CloseBody(res)
  1804  	if err := googleapi.CheckResponse(res); err != nil {
  1805  		return nil, err
  1806  	}
  1807  	ret := &Contact{
  1808  		ServerResponse: googleapi.ServerResponse{
  1809  			Header:         res.Header,
  1810  			HTTPStatusCode: res.StatusCode,
  1811  		},
  1812  	}
  1813  	target := &ret
  1814  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1815  		return nil, err
  1816  	}
  1817  	return ret, nil
  1818  	// {
  1819  	//   "description": "Inserts a new contact.",
  1820  	//   "httpMethod": "POST",
  1821  	//   "id": "mirror.contacts.insert",
  1822  	//   "path": "contacts",
  1823  	//   "request": {
  1824  	//     "$ref": "Contact"
  1825  	//   },
  1826  	//   "response": {
  1827  	//     "$ref": "Contact"
  1828  	//   },
  1829  	//   "scopes": [
  1830  	//     "https://www.googleapis.com/auth/glass.timeline"
  1831  	//   ]
  1832  	// }
  1833  
  1834  }
  1835  
  1836  // method id "mirror.contacts.list":
  1837  
  1838  type ContactsListCall struct {
  1839  	s            *Service
  1840  	urlParams_   gensupport.URLParams
  1841  	ifNoneMatch_ string
  1842  	ctx_         context.Context
  1843  	header_      http.Header
  1844  }
  1845  
  1846  // List: Retrieves a list of contacts for the authenticated user.
  1847  func (r *ContactsService) List() *ContactsListCall {
  1848  	c := &ContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1849  	return c
  1850  }
  1851  
  1852  // Fields allows partial responses to be retrieved. See
  1853  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1854  // for more information.
  1855  func (c *ContactsListCall) Fields(s ...googleapi.Field) *ContactsListCall {
  1856  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1857  	return c
  1858  }
  1859  
  1860  // IfNoneMatch sets the optional parameter which makes the operation
  1861  // fail if the object's ETag matches the given value. This is useful for
  1862  // getting updates only after the object has changed since the last
  1863  // request. Use googleapi.IsNotModified to check whether the response
  1864  // error from Do is the result of In-None-Match.
  1865  func (c *ContactsListCall) IfNoneMatch(entityTag string) *ContactsListCall {
  1866  	c.ifNoneMatch_ = entityTag
  1867  	return c
  1868  }
  1869  
  1870  // Context sets the context to be used in this call's Do method. Any
  1871  // pending HTTP request will be aborted if the provided context is
  1872  // canceled.
  1873  func (c *ContactsListCall) Context(ctx context.Context) *ContactsListCall {
  1874  	c.ctx_ = ctx
  1875  	return c
  1876  }
  1877  
  1878  // Header returns an http.Header that can be modified by the caller to
  1879  // add HTTP headers to the request.
  1880  func (c *ContactsListCall) Header() http.Header {
  1881  	if c.header_ == nil {
  1882  		c.header_ = make(http.Header)
  1883  	}
  1884  	return c.header_
  1885  }
  1886  
  1887  func (c *ContactsListCall) doRequest(alt string) (*http.Response, error) {
  1888  	reqHeaders := make(http.Header)
  1889  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  1890  	for k, v := range c.header_ {
  1891  		reqHeaders[k] = v
  1892  	}
  1893  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1894  	if c.ifNoneMatch_ != "" {
  1895  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1896  	}
  1897  	var body io.Reader = nil
  1898  	c.urlParams_.Set("alt", alt)
  1899  	c.urlParams_.Set("prettyPrint", "false")
  1900  	urls := googleapi.ResolveRelative(c.s.BasePath, "contacts")
  1901  	urls += "?" + c.urlParams_.Encode()
  1902  	req, err := http.NewRequest("GET", urls, body)
  1903  	if err != nil {
  1904  		return nil, err
  1905  	}
  1906  	req.Header = reqHeaders
  1907  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1908  }
  1909  
  1910  // Do executes the "mirror.contacts.list" call.
  1911  // Exactly one of *ContactsListResponse or error will be non-nil. Any
  1912  // non-2xx status code is an error. Response headers are in either
  1913  // *ContactsListResponse.ServerResponse.Header or (if a response was
  1914  // returned at all) in error.(*googleapi.Error).Header. Use
  1915  // googleapi.IsNotModified to check whether the returned error was
  1916  // because http.StatusNotModified was returned.
  1917  func (c *ContactsListCall) Do(opts ...googleapi.CallOption) (*ContactsListResponse, error) {
  1918  	gensupport.SetOptions(c.urlParams_, opts...)
  1919  	res, err := c.doRequest("json")
  1920  	if res != nil && res.StatusCode == http.StatusNotModified {
  1921  		if res.Body != nil {
  1922  			res.Body.Close()
  1923  		}
  1924  		return nil, &googleapi.Error{
  1925  			Code:   res.StatusCode,
  1926  			Header: res.Header,
  1927  		}
  1928  	}
  1929  	if err != nil {
  1930  		return nil, err
  1931  	}
  1932  	defer googleapi.CloseBody(res)
  1933  	if err := googleapi.CheckResponse(res); err != nil {
  1934  		return nil, err
  1935  	}
  1936  	ret := &ContactsListResponse{
  1937  		ServerResponse: googleapi.ServerResponse{
  1938  			Header:         res.Header,
  1939  			HTTPStatusCode: res.StatusCode,
  1940  		},
  1941  	}
  1942  	target := &ret
  1943  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1944  		return nil, err
  1945  	}
  1946  	return ret, nil
  1947  	// {
  1948  	//   "description": "Retrieves a list of contacts for the authenticated user.",
  1949  	//   "httpMethod": "GET",
  1950  	//   "id": "mirror.contacts.list",
  1951  	//   "path": "contacts",
  1952  	//   "response": {
  1953  	//     "$ref": "ContactsListResponse"
  1954  	//   },
  1955  	//   "scopes": [
  1956  	//     "https://www.googleapis.com/auth/glass.timeline"
  1957  	//   ]
  1958  	// }
  1959  
  1960  }
  1961  
  1962  // method id "mirror.contacts.patch":
  1963  
  1964  type ContactsPatchCall struct {
  1965  	s          *Service
  1966  	id         string
  1967  	contact    *Contact
  1968  	urlParams_ gensupport.URLParams
  1969  	ctx_       context.Context
  1970  	header_    http.Header
  1971  }
  1972  
  1973  // Patch: Updates a contact in place. This method supports patch
  1974  // semantics.
  1975  func (r *ContactsService) Patch(id string, contact *Contact) *ContactsPatchCall {
  1976  	c := &ContactsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1977  	c.id = id
  1978  	c.contact = contact
  1979  	return c
  1980  }
  1981  
  1982  // Fields allows partial responses to be retrieved. See
  1983  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1984  // for more information.
  1985  func (c *ContactsPatchCall) Fields(s ...googleapi.Field) *ContactsPatchCall {
  1986  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1987  	return c
  1988  }
  1989  
  1990  // Context sets the context to be used in this call's Do method. Any
  1991  // pending HTTP request will be aborted if the provided context is
  1992  // canceled.
  1993  func (c *ContactsPatchCall) Context(ctx context.Context) *ContactsPatchCall {
  1994  	c.ctx_ = ctx
  1995  	return c
  1996  }
  1997  
  1998  // Header returns an http.Header that can be modified by the caller to
  1999  // add HTTP headers to the request.
  2000  func (c *ContactsPatchCall) Header() http.Header {
  2001  	if c.header_ == nil {
  2002  		c.header_ = make(http.Header)
  2003  	}
  2004  	return c.header_
  2005  }
  2006  
  2007  func (c *ContactsPatchCall) doRequest(alt string) (*http.Response, error) {
  2008  	reqHeaders := make(http.Header)
  2009  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  2010  	for k, v := range c.header_ {
  2011  		reqHeaders[k] = v
  2012  	}
  2013  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2014  	var body io.Reader = nil
  2015  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
  2016  	if err != nil {
  2017  		return nil, err
  2018  	}
  2019  	reqHeaders.Set("Content-Type", "application/json")
  2020  	c.urlParams_.Set("alt", alt)
  2021  	c.urlParams_.Set("prettyPrint", "false")
  2022  	urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
  2023  	urls += "?" + c.urlParams_.Encode()
  2024  	req, err := http.NewRequest("PATCH", urls, body)
  2025  	if err != nil {
  2026  		return nil, err
  2027  	}
  2028  	req.Header = reqHeaders
  2029  	googleapi.Expand(req.URL, map[string]string{
  2030  		"id": c.id,
  2031  	})
  2032  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2033  }
  2034  
  2035  // Do executes the "mirror.contacts.patch" call.
  2036  // Exactly one of *Contact or error will be non-nil. Any non-2xx status
  2037  // code is an error. Response headers are in either
  2038  // *Contact.ServerResponse.Header or (if a response was returned at all)
  2039  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2040  // check whether the returned error was because http.StatusNotModified
  2041  // was returned.
  2042  func (c *ContactsPatchCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
  2043  	gensupport.SetOptions(c.urlParams_, opts...)
  2044  	res, err := c.doRequest("json")
  2045  	if res != nil && res.StatusCode == http.StatusNotModified {
  2046  		if res.Body != nil {
  2047  			res.Body.Close()
  2048  		}
  2049  		return nil, &googleapi.Error{
  2050  			Code:   res.StatusCode,
  2051  			Header: res.Header,
  2052  		}
  2053  	}
  2054  	if err != nil {
  2055  		return nil, err
  2056  	}
  2057  	defer googleapi.CloseBody(res)
  2058  	if err := googleapi.CheckResponse(res); err != nil {
  2059  		return nil, err
  2060  	}
  2061  	ret := &Contact{
  2062  		ServerResponse: googleapi.ServerResponse{
  2063  			Header:         res.Header,
  2064  			HTTPStatusCode: res.StatusCode,
  2065  		},
  2066  	}
  2067  	target := &ret
  2068  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2069  		return nil, err
  2070  	}
  2071  	return ret, nil
  2072  	// {
  2073  	//   "description": "Updates a contact in place. This method supports patch semantics.",
  2074  	//   "httpMethod": "PATCH",
  2075  	//   "id": "mirror.contacts.patch",
  2076  	//   "parameterOrder": [
  2077  	//     "id"
  2078  	//   ],
  2079  	//   "parameters": {
  2080  	//     "id": {
  2081  	//       "description": "The ID of the contact.",
  2082  	//       "location": "path",
  2083  	//       "required": true,
  2084  	//       "type": "string"
  2085  	//     }
  2086  	//   },
  2087  	//   "path": "contacts/{id}",
  2088  	//   "request": {
  2089  	//     "$ref": "Contact"
  2090  	//   },
  2091  	//   "response": {
  2092  	//     "$ref": "Contact"
  2093  	//   },
  2094  	//   "scopes": [
  2095  	//     "https://www.googleapis.com/auth/glass.timeline"
  2096  	//   ]
  2097  	// }
  2098  
  2099  }
  2100  
  2101  // method id "mirror.contacts.update":
  2102  
  2103  type ContactsUpdateCall struct {
  2104  	s          *Service
  2105  	id         string
  2106  	contact    *Contact
  2107  	urlParams_ gensupport.URLParams
  2108  	ctx_       context.Context
  2109  	header_    http.Header
  2110  }
  2111  
  2112  // Update: Updates a contact in place.
  2113  func (r *ContactsService) Update(id string, contact *Contact) *ContactsUpdateCall {
  2114  	c := &ContactsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2115  	c.id = id
  2116  	c.contact = contact
  2117  	return c
  2118  }
  2119  
  2120  // Fields allows partial responses to be retrieved. See
  2121  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2122  // for more information.
  2123  func (c *ContactsUpdateCall) Fields(s ...googleapi.Field) *ContactsUpdateCall {
  2124  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2125  	return c
  2126  }
  2127  
  2128  // Context sets the context to be used in this call's Do method. Any
  2129  // pending HTTP request will be aborted if the provided context is
  2130  // canceled.
  2131  func (c *ContactsUpdateCall) Context(ctx context.Context) *ContactsUpdateCall {
  2132  	c.ctx_ = ctx
  2133  	return c
  2134  }
  2135  
  2136  // Header returns an http.Header that can be modified by the caller to
  2137  // add HTTP headers to the request.
  2138  func (c *ContactsUpdateCall) Header() http.Header {
  2139  	if c.header_ == nil {
  2140  		c.header_ = make(http.Header)
  2141  	}
  2142  	return c.header_
  2143  }
  2144  
  2145  func (c *ContactsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2146  	reqHeaders := make(http.Header)
  2147  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  2148  	for k, v := range c.header_ {
  2149  		reqHeaders[k] = v
  2150  	}
  2151  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2152  	var body io.Reader = nil
  2153  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
  2154  	if err != nil {
  2155  		return nil, err
  2156  	}
  2157  	reqHeaders.Set("Content-Type", "application/json")
  2158  	c.urlParams_.Set("alt", alt)
  2159  	c.urlParams_.Set("prettyPrint", "false")
  2160  	urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
  2161  	urls += "?" + c.urlParams_.Encode()
  2162  	req, err := http.NewRequest("PUT", urls, body)
  2163  	if err != nil {
  2164  		return nil, err
  2165  	}
  2166  	req.Header = reqHeaders
  2167  	googleapi.Expand(req.URL, map[string]string{
  2168  		"id": c.id,
  2169  	})
  2170  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2171  }
  2172  
  2173  // Do executes the "mirror.contacts.update" call.
  2174  // Exactly one of *Contact or error will be non-nil. Any non-2xx status
  2175  // code is an error. Response headers are in either
  2176  // *Contact.ServerResponse.Header or (if a response was returned at all)
  2177  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2178  // check whether the returned error was because http.StatusNotModified
  2179  // was returned.
  2180  func (c *ContactsUpdateCall) Do(opts ...googleapi.CallOption) (*Contact, error) {
  2181  	gensupport.SetOptions(c.urlParams_, opts...)
  2182  	res, err := c.doRequest("json")
  2183  	if res != nil && res.StatusCode == http.StatusNotModified {
  2184  		if res.Body != nil {
  2185  			res.Body.Close()
  2186  		}
  2187  		return nil, &googleapi.Error{
  2188  			Code:   res.StatusCode,
  2189  			Header: res.Header,
  2190  		}
  2191  	}
  2192  	if err != nil {
  2193  		return nil, err
  2194  	}
  2195  	defer googleapi.CloseBody(res)
  2196  	if err := googleapi.CheckResponse(res); err != nil {
  2197  		return nil, err
  2198  	}
  2199  	ret := &Contact{
  2200  		ServerResponse: googleapi.ServerResponse{
  2201  			Header:         res.Header,
  2202  			HTTPStatusCode: res.StatusCode,
  2203  		},
  2204  	}
  2205  	target := &ret
  2206  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2207  		return nil, err
  2208  	}
  2209  	return ret, nil
  2210  	// {
  2211  	//   "description": "Updates a contact in place.",
  2212  	//   "httpMethod": "PUT",
  2213  	//   "id": "mirror.contacts.update",
  2214  	//   "parameterOrder": [
  2215  	//     "id"
  2216  	//   ],
  2217  	//   "parameters": {
  2218  	//     "id": {
  2219  	//       "description": "The ID of the contact.",
  2220  	//       "location": "path",
  2221  	//       "required": true,
  2222  	//       "type": "string"
  2223  	//     }
  2224  	//   },
  2225  	//   "path": "contacts/{id}",
  2226  	//   "request": {
  2227  	//     "$ref": "Contact"
  2228  	//   },
  2229  	//   "response": {
  2230  	//     "$ref": "Contact"
  2231  	//   },
  2232  	//   "scopes": [
  2233  	//     "https://www.googleapis.com/auth/glass.timeline"
  2234  	//   ]
  2235  	// }
  2236  
  2237  }
  2238  
  2239  // method id "mirror.locations.get":
  2240  
  2241  type LocationsGetCall struct {
  2242  	s            *Service
  2243  	id           string
  2244  	urlParams_   gensupport.URLParams
  2245  	ifNoneMatch_ string
  2246  	ctx_         context.Context
  2247  	header_      http.Header
  2248  }
  2249  
  2250  // Get: Gets a single location by ID.
  2251  func (r *LocationsService) Get(id string) *LocationsGetCall {
  2252  	c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2253  	c.id = id
  2254  	return c
  2255  }
  2256  
  2257  // Fields allows partial responses to be retrieved. See
  2258  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2259  // for more information.
  2260  func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall {
  2261  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2262  	return c
  2263  }
  2264  
  2265  // IfNoneMatch sets the optional parameter which makes the operation
  2266  // fail if the object's ETag matches the given value. This is useful for
  2267  // getting updates only after the object has changed since the last
  2268  // request. Use googleapi.IsNotModified to check whether the response
  2269  // error from Do is the result of In-None-Match.
  2270  func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall {
  2271  	c.ifNoneMatch_ = entityTag
  2272  	return c
  2273  }
  2274  
  2275  // Context sets the context to be used in this call's Do method. Any
  2276  // pending HTTP request will be aborted if the provided context is
  2277  // canceled.
  2278  func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall {
  2279  	c.ctx_ = ctx
  2280  	return c
  2281  }
  2282  
  2283  // Header returns an http.Header that can be modified by the caller to
  2284  // add HTTP headers to the request.
  2285  func (c *LocationsGetCall) Header() http.Header {
  2286  	if c.header_ == nil {
  2287  		c.header_ = make(http.Header)
  2288  	}
  2289  	return c.header_
  2290  }
  2291  
  2292  func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) {
  2293  	reqHeaders := make(http.Header)
  2294  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  2295  	for k, v := range c.header_ {
  2296  		reqHeaders[k] = v
  2297  	}
  2298  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2299  	if c.ifNoneMatch_ != "" {
  2300  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2301  	}
  2302  	var body io.Reader = nil
  2303  	c.urlParams_.Set("alt", alt)
  2304  	c.urlParams_.Set("prettyPrint", "false")
  2305  	urls := googleapi.ResolveRelative(c.s.BasePath, "locations/{id}")
  2306  	urls += "?" + c.urlParams_.Encode()
  2307  	req, err := http.NewRequest("GET", urls, body)
  2308  	if err != nil {
  2309  		return nil, err
  2310  	}
  2311  	req.Header = reqHeaders
  2312  	googleapi.Expand(req.URL, map[string]string{
  2313  		"id": c.id,
  2314  	})
  2315  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2316  }
  2317  
  2318  // Do executes the "mirror.locations.get" call.
  2319  // Exactly one of *Location or error will be non-nil. Any non-2xx status
  2320  // code is an error. Response headers are in either
  2321  // *Location.ServerResponse.Header or (if a response was returned at
  2322  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2323  // to check whether the returned error was because
  2324  // http.StatusNotModified was returned.
  2325  func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
  2326  	gensupport.SetOptions(c.urlParams_, opts...)
  2327  	res, err := c.doRequest("json")
  2328  	if res != nil && res.StatusCode == http.StatusNotModified {
  2329  		if res.Body != nil {
  2330  			res.Body.Close()
  2331  		}
  2332  		return nil, &googleapi.Error{
  2333  			Code:   res.StatusCode,
  2334  			Header: res.Header,
  2335  		}
  2336  	}
  2337  	if err != nil {
  2338  		return nil, err
  2339  	}
  2340  	defer googleapi.CloseBody(res)
  2341  	if err := googleapi.CheckResponse(res); err != nil {
  2342  		return nil, err
  2343  	}
  2344  	ret := &Location{
  2345  		ServerResponse: googleapi.ServerResponse{
  2346  			Header:         res.Header,
  2347  			HTTPStatusCode: res.StatusCode,
  2348  		},
  2349  	}
  2350  	target := &ret
  2351  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2352  		return nil, err
  2353  	}
  2354  	return ret, nil
  2355  	// {
  2356  	//   "description": "Gets a single location by ID.",
  2357  	//   "httpMethod": "GET",
  2358  	//   "id": "mirror.locations.get",
  2359  	//   "parameterOrder": [
  2360  	//     "id"
  2361  	//   ],
  2362  	//   "parameters": {
  2363  	//     "id": {
  2364  	//       "description": "The ID of the location or latest for the last known location.",
  2365  	//       "location": "path",
  2366  	//       "required": true,
  2367  	//       "type": "string"
  2368  	//     }
  2369  	//   },
  2370  	//   "path": "locations/{id}",
  2371  	//   "response": {
  2372  	//     "$ref": "Location"
  2373  	//   },
  2374  	//   "scopes": [
  2375  	//     "https://www.googleapis.com/auth/glass.location",
  2376  	//     "https://www.googleapis.com/auth/glass.timeline"
  2377  	//   ]
  2378  	// }
  2379  
  2380  }
  2381  
  2382  // method id "mirror.locations.list":
  2383  
  2384  type LocationsListCall struct {
  2385  	s            *Service
  2386  	urlParams_   gensupport.URLParams
  2387  	ifNoneMatch_ string
  2388  	ctx_         context.Context
  2389  	header_      http.Header
  2390  }
  2391  
  2392  // List: Retrieves a list of locations for the user.
  2393  func (r *LocationsService) List() *LocationsListCall {
  2394  	c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2395  	return c
  2396  }
  2397  
  2398  // Fields allows partial responses to be retrieved. See
  2399  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2400  // for more information.
  2401  func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall {
  2402  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2403  	return c
  2404  }
  2405  
  2406  // IfNoneMatch sets the optional parameter which makes the operation
  2407  // fail if the object's ETag matches the given value. This is useful for
  2408  // getting updates only after the object has changed since the last
  2409  // request. Use googleapi.IsNotModified to check whether the response
  2410  // error from Do is the result of In-None-Match.
  2411  func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall {
  2412  	c.ifNoneMatch_ = entityTag
  2413  	return c
  2414  }
  2415  
  2416  // Context sets the context to be used in this call's Do method. Any
  2417  // pending HTTP request will be aborted if the provided context is
  2418  // canceled.
  2419  func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall {
  2420  	c.ctx_ = ctx
  2421  	return c
  2422  }
  2423  
  2424  // Header returns an http.Header that can be modified by the caller to
  2425  // add HTTP headers to the request.
  2426  func (c *LocationsListCall) Header() http.Header {
  2427  	if c.header_ == nil {
  2428  		c.header_ = make(http.Header)
  2429  	}
  2430  	return c.header_
  2431  }
  2432  
  2433  func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) {
  2434  	reqHeaders := make(http.Header)
  2435  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  2436  	for k, v := range c.header_ {
  2437  		reqHeaders[k] = v
  2438  	}
  2439  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2440  	if c.ifNoneMatch_ != "" {
  2441  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2442  	}
  2443  	var body io.Reader = nil
  2444  	c.urlParams_.Set("alt", alt)
  2445  	c.urlParams_.Set("prettyPrint", "false")
  2446  	urls := googleapi.ResolveRelative(c.s.BasePath, "locations")
  2447  	urls += "?" + c.urlParams_.Encode()
  2448  	req, err := http.NewRequest("GET", urls, body)
  2449  	if err != nil {
  2450  		return nil, err
  2451  	}
  2452  	req.Header = reqHeaders
  2453  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2454  }
  2455  
  2456  // Do executes the "mirror.locations.list" call.
  2457  // Exactly one of *LocationsListResponse or error will be non-nil. Any
  2458  // non-2xx status code is an error. Response headers are in either
  2459  // *LocationsListResponse.ServerResponse.Header or (if a response was
  2460  // returned at all) in error.(*googleapi.Error).Header. Use
  2461  // googleapi.IsNotModified to check whether the returned error was
  2462  // because http.StatusNotModified was returned.
  2463  func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*LocationsListResponse, error) {
  2464  	gensupport.SetOptions(c.urlParams_, opts...)
  2465  	res, err := c.doRequest("json")
  2466  	if res != nil && res.StatusCode == http.StatusNotModified {
  2467  		if res.Body != nil {
  2468  			res.Body.Close()
  2469  		}
  2470  		return nil, &googleapi.Error{
  2471  			Code:   res.StatusCode,
  2472  			Header: res.Header,
  2473  		}
  2474  	}
  2475  	if err != nil {
  2476  		return nil, err
  2477  	}
  2478  	defer googleapi.CloseBody(res)
  2479  	if err := googleapi.CheckResponse(res); err != nil {
  2480  		return nil, err
  2481  	}
  2482  	ret := &LocationsListResponse{
  2483  		ServerResponse: googleapi.ServerResponse{
  2484  			Header:         res.Header,
  2485  			HTTPStatusCode: res.StatusCode,
  2486  		},
  2487  	}
  2488  	target := &ret
  2489  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2490  		return nil, err
  2491  	}
  2492  	return ret, nil
  2493  	// {
  2494  	//   "description": "Retrieves a list of locations for the user.",
  2495  	//   "httpMethod": "GET",
  2496  	//   "id": "mirror.locations.list",
  2497  	//   "path": "locations",
  2498  	//   "response": {
  2499  	//     "$ref": "LocationsListResponse"
  2500  	//   },
  2501  	//   "scopes": [
  2502  	//     "https://www.googleapis.com/auth/glass.location",
  2503  	//     "https://www.googleapis.com/auth/glass.timeline"
  2504  	//   ]
  2505  	// }
  2506  
  2507  }
  2508  
  2509  // method id "mirror.settings.get":
  2510  
  2511  type SettingsGetCall struct {
  2512  	s            *Service
  2513  	id           string
  2514  	urlParams_   gensupport.URLParams
  2515  	ifNoneMatch_ string
  2516  	ctx_         context.Context
  2517  	header_      http.Header
  2518  }
  2519  
  2520  // Get: Gets a single setting by ID.
  2521  func (r *SettingsService) Get(id string) *SettingsGetCall {
  2522  	c := &SettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2523  	c.id = id
  2524  	return c
  2525  }
  2526  
  2527  // Fields allows partial responses to be retrieved. See
  2528  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2529  // for more information.
  2530  func (c *SettingsGetCall) Fields(s ...googleapi.Field) *SettingsGetCall {
  2531  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2532  	return c
  2533  }
  2534  
  2535  // IfNoneMatch sets the optional parameter which makes the operation
  2536  // fail if the object's ETag matches the given value. This is useful for
  2537  // getting updates only after the object has changed since the last
  2538  // request. Use googleapi.IsNotModified to check whether the response
  2539  // error from Do is the result of In-None-Match.
  2540  func (c *SettingsGetCall) IfNoneMatch(entityTag string) *SettingsGetCall {
  2541  	c.ifNoneMatch_ = entityTag
  2542  	return c
  2543  }
  2544  
  2545  // Context sets the context to be used in this call's Do method. Any
  2546  // pending HTTP request will be aborted if the provided context is
  2547  // canceled.
  2548  func (c *SettingsGetCall) Context(ctx context.Context) *SettingsGetCall {
  2549  	c.ctx_ = ctx
  2550  	return c
  2551  }
  2552  
  2553  // Header returns an http.Header that can be modified by the caller to
  2554  // add HTTP headers to the request.
  2555  func (c *SettingsGetCall) Header() http.Header {
  2556  	if c.header_ == nil {
  2557  		c.header_ = make(http.Header)
  2558  	}
  2559  	return c.header_
  2560  }
  2561  
  2562  func (c *SettingsGetCall) doRequest(alt string) (*http.Response, error) {
  2563  	reqHeaders := make(http.Header)
  2564  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  2565  	for k, v := range c.header_ {
  2566  		reqHeaders[k] = v
  2567  	}
  2568  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2569  	if c.ifNoneMatch_ != "" {
  2570  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2571  	}
  2572  	var body io.Reader = nil
  2573  	c.urlParams_.Set("alt", alt)
  2574  	c.urlParams_.Set("prettyPrint", "false")
  2575  	urls := googleapi.ResolveRelative(c.s.BasePath, "settings/{id}")
  2576  	urls += "?" + c.urlParams_.Encode()
  2577  	req, err := http.NewRequest("GET", urls, body)
  2578  	if err != nil {
  2579  		return nil, err
  2580  	}
  2581  	req.Header = reqHeaders
  2582  	googleapi.Expand(req.URL, map[string]string{
  2583  		"id": c.id,
  2584  	})
  2585  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2586  }
  2587  
  2588  // Do executes the "mirror.settings.get" call.
  2589  // Exactly one of *Setting or error will be non-nil. Any non-2xx status
  2590  // code is an error. Response headers are in either
  2591  // *Setting.ServerResponse.Header or (if a response was returned at all)
  2592  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2593  // check whether the returned error was because http.StatusNotModified
  2594  // was returned.
  2595  func (c *SettingsGetCall) Do(opts ...googleapi.CallOption) (*Setting, error) {
  2596  	gensupport.SetOptions(c.urlParams_, opts...)
  2597  	res, err := c.doRequest("json")
  2598  	if res != nil && res.StatusCode == http.StatusNotModified {
  2599  		if res.Body != nil {
  2600  			res.Body.Close()
  2601  		}
  2602  		return nil, &googleapi.Error{
  2603  			Code:   res.StatusCode,
  2604  			Header: res.Header,
  2605  		}
  2606  	}
  2607  	if err != nil {
  2608  		return nil, err
  2609  	}
  2610  	defer googleapi.CloseBody(res)
  2611  	if err := googleapi.CheckResponse(res); err != nil {
  2612  		return nil, err
  2613  	}
  2614  	ret := &Setting{
  2615  		ServerResponse: googleapi.ServerResponse{
  2616  			Header:         res.Header,
  2617  			HTTPStatusCode: res.StatusCode,
  2618  		},
  2619  	}
  2620  	target := &ret
  2621  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2622  		return nil, err
  2623  	}
  2624  	return ret, nil
  2625  	// {
  2626  	//   "description": "Gets a single setting by ID.",
  2627  	//   "httpMethod": "GET",
  2628  	//   "id": "mirror.settings.get",
  2629  	//   "parameterOrder": [
  2630  	//     "id"
  2631  	//   ],
  2632  	//   "parameters": {
  2633  	//     "id": {
  2634  	//       "description": "The ID of the setting. The following IDs are valid: \n- locale - The key to the user’s language/locale (BCP 47 identifier) that Glassware should use to render localized content. \n- timezone - The key to the user’s current time zone region as defined in the tz database. Example: America/Los_Angeles.",
  2635  	//       "location": "path",
  2636  	//       "required": true,
  2637  	//       "type": "string"
  2638  	//     }
  2639  	//   },
  2640  	//   "path": "settings/{id}",
  2641  	//   "response": {
  2642  	//     "$ref": "Setting"
  2643  	//   },
  2644  	//   "scopes": [
  2645  	//     "https://www.googleapis.com/auth/glass.timeline"
  2646  	//   ]
  2647  	// }
  2648  
  2649  }
  2650  
  2651  // method id "mirror.subscriptions.delete":
  2652  
  2653  type SubscriptionsDeleteCall struct {
  2654  	s          *Service
  2655  	id         string
  2656  	urlParams_ gensupport.URLParams
  2657  	ctx_       context.Context
  2658  	header_    http.Header
  2659  }
  2660  
  2661  // Delete: Deletes a subscription.
  2662  func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall {
  2663  	c := &SubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2664  	c.id = id
  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.
  2671  func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
  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.
  2679  func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall {
  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.
  2686  func (c *SubscriptionsDeleteCall) Header() http.Header {
  2687  	if c.header_ == nil {
  2688  		c.header_ = make(http.Header)
  2689  	}
  2690  	return c.header_
  2691  }
  2692  
  2693  func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2694  	reqHeaders := make(http.Header)
  2695  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  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, "subscriptions/{id}")
  2704  	urls += "?" + c.urlParams_.Encode()
  2705  	req, err := http.NewRequest("DELETE", urls, body)
  2706  	if err != nil {
  2707  		return nil, err
  2708  	}
  2709  	req.Header = reqHeaders
  2710  	googleapi.Expand(req.URL, map[string]string{
  2711  		"id": c.id,
  2712  	})
  2713  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2714  }
  2715  
  2716  // Do executes the "mirror.subscriptions.delete" call.
  2717  func (c *SubscriptionsDeleteCall) 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": "Deletes a subscription.",
  2730  	//   "httpMethod": "DELETE",
  2731  	//   "id": "mirror.subscriptions.delete",
  2732  	//   "parameterOrder": [
  2733  	//     "id"
  2734  	//   ],
  2735  	//   "parameters": {
  2736  	//     "id": {
  2737  	//       "description": "The ID of the subscription.",
  2738  	//       "location": "path",
  2739  	//       "required": true,
  2740  	//       "type": "string"
  2741  	//     }
  2742  	//   },
  2743  	//   "path": "subscriptions/{id}",
  2744  	//   "scopes": [
  2745  	//     "https://www.googleapis.com/auth/glass.timeline"
  2746  	//   ]
  2747  	// }
  2748  
  2749  }
  2750  
  2751  // method id "mirror.subscriptions.insert":
  2752  
  2753  type SubscriptionsInsertCall struct {
  2754  	s            *Service
  2755  	subscription *Subscription
  2756  	urlParams_   gensupport.URLParams
  2757  	ctx_         context.Context
  2758  	header_      http.Header
  2759  }
  2760  
  2761  // Insert: Creates a new subscription.
  2762  func (r *SubscriptionsService) Insert(subscription *Subscription) *SubscriptionsInsertCall {
  2763  	c := &SubscriptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2764  	c.subscription = subscription
  2765  	return c
  2766  }
  2767  
  2768  // Fields allows partial responses to be retrieved. See
  2769  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2770  // for more information.
  2771  func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
  2772  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2773  	return c
  2774  }
  2775  
  2776  // Context sets the context to be used in this call's Do method. Any
  2777  // pending HTTP request will be aborted if the provided context is
  2778  // canceled.
  2779  func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall {
  2780  	c.ctx_ = ctx
  2781  	return c
  2782  }
  2783  
  2784  // Header returns an http.Header that can be modified by the caller to
  2785  // add HTTP headers to the request.
  2786  func (c *SubscriptionsInsertCall) Header() http.Header {
  2787  	if c.header_ == nil {
  2788  		c.header_ = make(http.Header)
  2789  	}
  2790  	return c.header_
  2791  }
  2792  
  2793  func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  2794  	reqHeaders := make(http.Header)
  2795  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  2796  	for k, v := range c.header_ {
  2797  		reqHeaders[k] = v
  2798  	}
  2799  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2800  	var body io.Reader = nil
  2801  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  2802  	if err != nil {
  2803  		return nil, err
  2804  	}
  2805  	reqHeaders.Set("Content-Type", "application/json")
  2806  	c.urlParams_.Set("alt", alt)
  2807  	c.urlParams_.Set("prettyPrint", "false")
  2808  	urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  2809  	urls += "?" + c.urlParams_.Encode()
  2810  	req, err := http.NewRequest("POST", urls, body)
  2811  	if err != nil {
  2812  		return nil, err
  2813  	}
  2814  	req.Header = reqHeaders
  2815  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2816  }
  2817  
  2818  // Do executes the "mirror.subscriptions.insert" call.
  2819  // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  2820  // status code is an error. Response headers are in either
  2821  // *Subscription.ServerResponse.Header or (if a response was returned at
  2822  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2823  // to check whether the returned error was because
  2824  // http.StatusNotModified was returned.
  2825  func (c *SubscriptionsInsertCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  2826  	gensupport.SetOptions(c.urlParams_, opts...)
  2827  	res, err := c.doRequest("json")
  2828  	if res != nil && res.StatusCode == http.StatusNotModified {
  2829  		if res.Body != nil {
  2830  			res.Body.Close()
  2831  		}
  2832  		return nil, &googleapi.Error{
  2833  			Code:   res.StatusCode,
  2834  			Header: res.Header,
  2835  		}
  2836  	}
  2837  	if err != nil {
  2838  		return nil, err
  2839  	}
  2840  	defer googleapi.CloseBody(res)
  2841  	if err := googleapi.CheckResponse(res); err != nil {
  2842  		return nil, err
  2843  	}
  2844  	ret := &Subscription{
  2845  		ServerResponse: googleapi.ServerResponse{
  2846  			Header:         res.Header,
  2847  			HTTPStatusCode: res.StatusCode,
  2848  		},
  2849  	}
  2850  	target := &ret
  2851  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2852  		return nil, err
  2853  	}
  2854  	return ret, nil
  2855  	// {
  2856  	//   "description": "Creates a new subscription.",
  2857  	//   "httpMethod": "POST",
  2858  	//   "id": "mirror.subscriptions.insert",
  2859  	//   "path": "subscriptions",
  2860  	//   "request": {
  2861  	//     "$ref": "Subscription"
  2862  	//   },
  2863  	//   "response": {
  2864  	//     "$ref": "Subscription"
  2865  	//   },
  2866  	//   "scopes": [
  2867  	//     "https://www.googleapis.com/auth/glass.timeline"
  2868  	//   ]
  2869  	// }
  2870  
  2871  }
  2872  
  2873  // method id "mirror.subscriptions.list":
  2874  
  2875  type SubscriptionsListCall struct {
  2876  	s            *Service
  2877  	urlParams_   gensupport.URLParams
  2878  	ifNoneMatch_ string
  2879  	ctx_         context.Context
  2880  	header_      http.Header
  2881  }
  2882  
  2883  // List: Retrieves a list of subscriptions for the authenticated user
  2884  // and service.
  2885  func (r *SubscriptionsService) List() *SubscriptionsListCall {
  2886  	c := &SubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2887  	return c
  2888  }
  2889  
  2890  // Fields allows partial responses to be retrieved. See
  2891  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2892  // for more information.
  2893  func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
  2894  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2895  	return c
  2896  }
  2897  
  2898  // IfNoneMatch sets the optional parameter which makes the operation
  2899  // fail if the object's ETag matches the given value. This is useful for
  2900  // getting updates only after the object has changed since the last
  2901  // request. Use googleapi.IsNotModified to check whether the response
  2902  // error from Do is the result of In-None-Match.
  2903  func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall {
  2904  	c.ifNoneMatch_ = entityTag
  2905  	return c
  2906  }
  2907  
  2908  // Context sets the context to be used in this call's Do method. Any
  2909  // pending HTTP request will be aborted if the provided context is
  2910  // canceled.
  2911  func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall {
  2912  	c.ctx_ = ctx
  2913  	return c
  2914  }
  2915  
  2916  // Header returns an http.Header that can be modified by the caller to
  2917  // add HTTP headers to the request.
  2918  func (c *SubscriptionsListCall) Header() http.Header {
  2919  	if c.header_ == nil {
  2920  		c.header_ = make(http.Header)
  2921  	}
  2922  	return c.header_
  2923  }
  2924  
  2925  func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  2926  	reqHeaders := make(http.Header)
  2927  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  2928  	for k, v := range c.header_ {
  2929  		reqHeaders[k] = v
  2930  	}
  2931  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2932  	if c.ifNoneMatch_ != "" {
  2933  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2934  	}
  2935  	var body io.Reader = nil
  2936  	c.urlParams_.Set("alt", alt)
  2937  	c.urlParams_.Set("prettyPrint", "false")
  2938  	urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  2939  	urls += "?" + c.urlParams_.Encode()
  2940  	req, err := http.NewRequest("GET", urls, body)
  2941  	if err != nil {
  2942  		return nil, err
  2943  	}
  2944  	req.Header = reqHeaders
  2945  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2946  }
  2947  
  2948  // Do executes the "mirror.subscriptions.list" call.
  2949  // Exactly one of *SubscriptionsListResponse or error will be non-nil.
  2950  // Any non-2xx status code is an error. Response headers are in either
  2951  // *SubscriptionsListResponse.ServerResponse.Header or (if a response
  2952  // was returned at all) in error.(*googleapi.Error).Header. Use
  2953  // googleapi.IsNotModified to check whether the returned error was
  2954  // because http.StatusNotModified was returned.
  2955  func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*SubscriptionsListResponse, error) {
  2956  	gensupport.SetOptions(c.urlParams_, opts...)
  2957  	res, err := c.doRequest("json")
  2958  	if res != nil && res.StatusCode == http.StatusNotModified {
  2959  		if res.Body != nil {
  2960  			res.Body.Close()
  2961  		}
  2962  		return nil, &googleapi.Error{
  2963  			Code:   res.StatusCode,
  2964  			Header: res.Header,
  2965  		}
  2966  	}
  2967  	if err != nil {
  2968  		return nil, err
  2969  	}
  2970  	defer googleapi.CloseBody(res)
  2971  	if err := googleapi.CheckResponse(res); err != nil {
  2972  		return nil, err
  2973  	}
  2974  	ret := &SubscriptionsListResponse{
  2975  		ServerResponse: googleapi.ServerResponse{
  2976  			Header:         res.Header,
  2977  			HTTPStatusCode: res.StatusCode,
  2978  		},
  2979  	}
  2980  	target := &ret
  2981  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2982  		return nil, err
  2983  	}
  2984  	return ret, nil
  2985  	// {
  2986  	//   "description": "Retrieves a list of subscriptions for the authenticated user and service.",
  2987  	//   "httpMethod": "GET",
  2988  	//   "id": "mirror.subscriptions.list",
  2989  	//   "path": "subscriptions",
  2990  	//   "response": {
  2991  	//     "$ref": "SubscriptionsListResponse"
  2992  	//   },
  2993  	//   "scopes": [
  2994  	//     "https://www.googleapis.com/auth/glass.timeline"
  2995  	//   ]
  2996  	// }
  2997  
  2998  }
  2999  
  3000  // method id "mirror.subscriptions.update":
  3001  
  3002  type SubscriptionsUpdateCall struct {
  3003  	s            *Service
  3004  	id           string
  3005  	subscription *Subscription
  3006  	urlParams_   gensupport.URLParams
  3007  	ctx_         context.Context
  3008  	header_      http.Header
  3009  }
  3010  
  3011  // Update: Updates an existing subscription in place.
  3012  func (r *SubscriptionsService) Update(id string, subscription *Subscription) *SubscriptionsUpdateCall {
  3013  	c := &SubscriptionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3014  	c.id = id
  3015  	c.subscription = subscription
  3016  	return c
  3017  }
  3018  
  3019  // Fields allows partial responses to be retrieved. See
  3020  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3021  // for more information.
  3022  func (c *SubscriptionsUpdateCall) Fields(s ...googleapi.Field) *SubscriptionsUpdateCall {
  3023  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3024  	return c
  3025  }
  3026  
  3027  // Context sets the context to be used in this call's Do method. Any
  3028  // pending HTTP request will be aborted if the provided context is
  3029  // canceled.
  3030  func (c *SubscriptionsUpdateCall) Context(ctx context.Context) *SubscriptionsUpdateCall {
  3031  	c.ctx_ = ctx
  3032  	return c
  3033  }
  3034  
  3035  // Header returns an http.Header that can be modified by the caller to
  3036  // add HTTP headers to the request.
  3037  func (c *SubscriptionsUpdateCall) Header() http.Header {
  3038  	if c.header_ == nil {
  3039  		c.header_ = make(http.Header)
  3040  	}
  3041  	return c.header_
  3042  }
  3043  
  3044  func (c *SubscriptionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3045  	reqHeaders := make(http.Header)
  3046  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  3047  	for k, v := range c.header_ {
  3048  		reqHeaders[k] = v
  3049  	}
  3050  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3051  	var body io.Reader = nil
  3052  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  3053  	if err != nil {
  3054  		return nil, err
  3055  	}
  3056  	reqHeaders.Set("Content-Type", "application/json")
  3057  	c.urlParams_.Set("alt", alt)
  3058  	c.urlParams_.Set("prettyPrint", "false")
  3059  	urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}")
  3060  	urls += "?" + c.urlParams_.Encode()
  3061  	req, err := http.NewRequest("PUT", urls, body)
  3062  	if err != nil {
  3063  		return nil, err
  3064  	}
  3065  	req.Header = reqHeaders
  3066  	googleapi.Expand(req.URL, map[string]string{
  3067  		"id": c.id,
  3068  	})
  3069  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3070  }
  3071  
  3072  // Do executes the "mirror.subscriptions.update" call.
  3073  // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  3074  // status code is an error. Response headers are in either
  3075  // *Subscription.ServerResponse.Header or (if a response was returned at
  3076  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3077  // to check whether the returned error was because
  3078  // http.StatusNotModified was returned.
  3079  func (c *SubscriptionsUpdateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  3080  	gensupport.SetOptions(c.urlParams_, opts...)
  3081  	res, err := c.doRequest("json")
  3082  	if res != nil && res.StatusCode == http.StatusNotModified {
  3083  		if res.Body != nil {
  3084  			res.Body.Close()
  3085  		}
  3086  		return nil, &googleapi.Error{
  3087  			Code:   res.StatusCode,
  3088  			Header: res.Header,
  3089  		}
  3090  	}
  3091  	if err != nil {
  3092  		return nil, err
  3093  	}
  3094  	defer googleapi.CloseBody(res)
  3095  	if err := googleapi.CheckResponse(res); err != nil {
  3096  		return nil, err
  3097  	}
  3098  	ret := &Subscription{
  3099  		ServerResponse: googleapi.ServerResponse{
  3100  			Header:         res.Header,
  3101  			HTTPStatusCode: res.StatusCode,
  3102  		},
  3103  	}
  3104  	target := &ret
  3105  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3106  		return nil, err
  3107  	}
  3108  	return ret, nil
  3109  	// {
  3110  	//   "description": "Updates an existing subscription in place.",
  3111  	//   "httpMethod": "PUT",
  3112  	//   "id": "mirror.subscriptions.update",
  3113  	//   "parameterOrder": [
  3114  	//     "id"
  3115  	//   ],
  3116  	//   "parameters": {
  3117  	//     "id": {
  3118  	//       "description": "The ID of the subscription.",
  3119  	//       "location": "path",
  3120  	//       "required": true,
  3121  	//       "type": "string"
  3122  	//     }
  3123  	//   },
  3124  	//   "path": "subscriptions/{id}",
  3125  	//   "request": {
  3126  	//     "$ref": "Subscription"
  3127  	//   },
  3128  	//   "response": {
  3129  	//     "$ref": "Subscription"
  3130  	//   },
  3131  	//   "scopes": [
  3132  	//     "https://www.googleapis.com/auth/glass.timeline"
  3133  	//   ]
  3134  	// }
  3135  
  3136  }
  3137  
  3138  // method id "mirror.timeline.delete":
  3139  
  3140  type TimelineDeleteCall struct {
  3141  	s          *Service
  3142  	id         string
  3143  	urlParams_ gensupport.URLParams
  3144  	ctx_       context.Context
  3145  	header_    http.Header
  3146  }
  3147  
  3148  // Delete: Deletes a timeline item.
  3149  func (r *TimelineService) Delete(id string) *TimelineDeleteCall {
  3150  	c := &TimelineDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3151  	c.id = id
  3152  	return c
  3153  }
  3154  
  3155  // Fields allows partial responses to be retrieved. See
  3156  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3157  // for more information.
  3158  func (c *TimelineDeleteCall) Fields(s ...googleapi.Field) *TimelineDeleteCall {
  3159  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3160  	return c
  3161  }
  3162  
  3163  // Context sets the context to be used in this call's Do method. Any
  3164  // pending HTTP request will be aborted if the provided context is
  3165  // canceled.
  3166  func (c *TimelineDeleteCall) Context(ctx context.Context) *TimelineDeleteCall {
  3167  	c.ctx_ = ctx
  3168  	return c
  3169  }
  3170  
  3171  // Header returns an http.Header that can be modified by the caller to
  3172  // add HTTP headers to the request.
  3173  func (c *TimelineDeleteCall) Header() http.Header {
  3174  	if c.header_ == nil {
  3175  		c.header_ = make(http.Header)
  3176  	}
  3177  	return c.header_
  3178  }
  3179  
  3180  func (c *TimelineDeleteCall) doRequest(alt string) (*http.Response, error) {
  3181  	reqHeaders := make(http.Header)
  3182  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  3183  	for k, v := range c.header_ {
  3184  		reqHeaders[k] = v
  3185  	}
  3186  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3187  	var body io.Reader = nil
  3188  	c.urlParams_.Set("alt", alt)
  3189  	c.urlParams_.Set("prettyPrint", "false")
  3190  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
  3191  	urls += "?" + c.urlParams_.Encode()
  3192  	req, err := http.NewRequest("DELETE", urls, body)
  3193  	if err != nil {
  3194  		return nil, err
  3195  	}
  3196  	req.Header = reqHeaders
  3197  	googleapi.Expand(req.URL, map[string]string{
  3198  		"id": c.id,
  3199  	})
  3200  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3201  }
  3202  
  3203  // Do executes the "mirror.timeline.delete" call.
  3204  func (c *TimelineDeleteCall) Do(opts ...googleapi.CallOption) error {
  3205  	gensupport.SetOptions(c.urlParams_, opts...)
  3206  	res, err := c.doRequest("json")
  3207  	if err != nil {
  3208  		return err
  3209  	}
  3210  	defer googleapi.CloseBody(res)
  3211  	if err := googleapi.CheckResponse(res); err != nil {
  3212  		return err
  3213  	}
  3214  	return nil
  3215  	// {
  3216  	//   "description": "Deletes a timeline item.",
  3217  	//   "httpMethod": "DELETE",
  3218  	//   "id": "mirror.timeline.delete",
  3219  	//   "parameterOrder": [
  3220  	//     "id"
  3221  	//   ],
  3222  	//   "parameters": {
  3223  	//     "id": {
  3224  	//       "description": "The ID of the timeline item.",
  3225  	//       "location": "path",
  3226  	//       "required": true,
  3227  	//       "type": "string"
  3228  	//     }
  3229  	//   },
  3230  	//   "path": "timeline/{id}",
  3231  	//   "scopes": [
  3232  	//     "https://www.googleapis.com/auth/glass.location",
  3233  	//     "https://www.googleapis.com/auth/glass.timeline"
  3234  	//   ]
  3235  	// }
  3236  
  3237  }
  3238  
  3239  // method id "mirror.timeline.get":
  3240  
  3241  type TimelineGetCall struct {
  3242  	s            *Service
  3243  	id           string
  3244  	urlParams_   gensupport.URLParams
  3245  	ifNoneMatch_ string
  3246  	ctx_         context.Context
  3247  	header_      http.Header
  3248  }
  3249  
  3250  // Get: Gets a single timeline item by ID.
  3251  func (r *TimelineService) Get(id string) *TimelineGetCall {
  3252  	c := &TimelineGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3253  	c.id = id
  3254  	return c
  3255  }
  3256  
  3257  // Fields allows partial responses to be retrieved. See
  3258  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3259  // for more information.
  3260  func (c *TimelineGetCall) Fields(s ...googleapi.Field) *TimelineGetCall {
  3261  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3262  	return c
  3263  }
  3264  
  3265  // IfNoneMatch sets the optional parameter which makes the operation
  3266  // fail if the object's ETag matches the given value. This is useful for
  3267  // getting updates only after the object has changed since the last
  3268  // request. Use googleapi.IsNotModified to check whether the response
  3269  // error from Do is the result of In-None-Match.
  3270  func (c *TimelineGetCall) IfNoneMatch(entityTag string) *TimelineGetCall {
  3271  	c.ifNoneMatch_ = entityTag
  3272  	return c
  3273  }
  3274  
  3275  // Context sets the context to be used in this call's Do method. Any
  3276  // pending HTTP request will be aborted if the provided context is
  3277  // canceled.
  3278  func (c *TimelineGetCall) Context(ctx context.Context) *TimelineGetCall {
  3279  	c.ctx_ = ctx
  3280  	return c
  3281  }
  3282  
  3283  // Header returns an http.Header that can be modified by the caller to
  3284  // add HTTP headers to the request.
  3285  func (c *TimelineGetCall) Header() http.Header {
  3286  	if c.header_ == nil {
  3287  		c.header_ = make(http.Header)
  3288  	}
  3289  	return c.header_
  3290  }
  3291  
  3292  func (c *TimelineGetCall) doRequest(alt string) (*http.Response, error) {
  3293  	reqHeaders := make(http.Header)
  3294  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  3295  	for k, v := range c.header_ {
  3296  		reqHeaders[k] = v
  3297  	}
  3298  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3299  	if c.ifNoneMatch_ != "" {
  3300  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3301  	}
  3302  	var body io.Reader = nil
  3303  	c.urlParams_.Set("alt", alt)
  3304  	c.urlParams_.Set("prettyPrint", "false")
  3305  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
  3306  	urls += "?" + c.urlParams_.Encode()
  3307  	req, err := http.NewRequest("GET", urls, body)
  3308  	if err != nil {
  3309  		return nil, err
  3310  	}
  3311  	req.Header = reqHeaders
  3312  	googleapi.Expand(req.URL, map[string]string{
  3313  		"id": c.id,
  3314  	})
  3315  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3316  }
  3317  
  3318  // Do executes the "mirror.timeline.get" call.
  3319  // Exactly one of *TimelineItem or error will be non-nil. Any non-2xx
  3320  // status code is an error. Response headers are in either
  3321  // *TimelineItem.ServerResponse.Header or (if a response was returned at
  3322  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3323  // to check whether the returned error was because
  3324  // http.StatusNotModified was returned.
  3325  func (c *TimelineGetCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
  3326  	gensupport.SetOptions(c.urlParams_, opts...)
  3327  	res, err := c.doRequest("json")
  3328  	if res != nil && res.StatusCode == http.StatusNotModified {
  3329  		if res.Body != nil {
  3330  			res.Body.Close()
  3331  		}
  3332  		return nil, &googleapi.Error{
  3333  			Code:   res.StatusCode,
  3334  			Header: res.Header,
  3335  		}
  3336  	}
  3337  	if err != nil {
  3338  		return nil, err
  3339  	}
  3340  	defer googleapi.CloseBody(res)
  3341  	if err := googleapi.CheckResponse(res); err != nil {
  3342  		return nil, err
  3343  	}
  3344  	ret := &TimelineItem{
  3345  		ServerResponse: googleapi.ServerResponse{
  3346  			Header:         res.Header,
  3347  			HTTPStatusCode: res.StatusCode,
  3348  		},
  3349  	}
  3350  	target := &ret
  3351  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3352  		return nil, err
  3353  	}
  3354  	return ret, nil
  3355  	// {
  3356  	//   "description": "Gets a single timeline item by ID.",
  3357  	//   "httpMethod": "GET",
  3358  	//   "id": "mirror.timeline.get",
  3359  	//   "parameterOrder": [
  3360  	//     "id"
  3361  	//   ],
  3362  	//   "parameters": {
  3363  	//     "id": {
  3364  	//       "description": "The ID of the timeline item.",
  3365  	//       "location": "path",
  3366  	//       "required": true,
  3367  	//       "type": "string"
  3368  	//     }
  3369  	//   },
  3370  	//   "path": "timeline/{id}",
  3371  	//   "response": {
  3372  	//     "$ref": "TimelineItem"
  3373  	//   },
  3374  	//   "scopes": [
  3375  	//     "https://www.googleapis.com/auth/glass.location",
  3376  	//     "https://www.googleapis.com/auth/glass.timeline"
  3377  	//   ]
  3378  	// }
  3379  
  3380  }
  3381  
  3382  // method id "mirror.timeline.insert":
  3383  
  3384  type TimelineInsertCall struct {
  3385  	s            *Service
  3386  	timelineitem *TimelineItem
  3387  	urlParams_   gensupport.URLParams
  3388  	mediaInfo_   *gensupport.MediaInfo
  3389  	ctx_         context.Context
  3390  	header_      http.Header
  3391  }
  3392  
  3393  // Insert: Inserts a new item into the timeline.
  3394  func (r *TimelineService) Insert(timelineitem *TimelineItem) *TimelineInsertCall {
  3395  	c := &TimelineInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3396  	c.timelineitem = timelineitem
  3397  	return c
  3398  }
  3399  
  3400  // Media specifies the media to upload in one or more chunks. The chunk
  3401  // size may be controlled by supplying a MediaOption generated by
  3402  // googleapi.ChunkSize. The chunk size defaults to
  3403  // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  3404  // upload request will be determined by sniffing the contents of r,
  3405  // unless a MediaOption generated by googleapi.ContentType is
  3406  // supplied.
  3407  // At most one of Media and ResumableMedia may be set.
  3408  func (c *TimelineInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *TimelineInsertCall {
  3409  	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  3410  	return c
  3411  }
  3412  
  3413  // ResumableMedia specifies the media to upload in chunks and can be
  3414  // canceled with ctx.
  3415  //
  3416  // Deprecated: use Media instead.
  3417  //
  3418  // At most one of Media and ResumableMedia may be set. mediaType
  3419  // identifies the MIME media type of the upload, such as "image/png". If
  3420  // mediaType is "", it will be auto-detected. The provided ctx will
  3421  // supersede any context previously provided to the Context method.
  3422  func (c *TimelineInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineInsertCall {
  3423  	c.ctx_ = ctx
  3424  	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3425  	return c
  3426  }
  3427  
  3428  // ProgressUpdater provides a callback function that will be called
  3429  // after every chunk. It should be a low-latency function in order to
  3430  // not slow down the upload operation. This should only be called when
  3431  // using ResumableMedia (as opposed to Media).
  3432  func (c *TimelineInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineInsertCall {
  3433  	c.mediaInfo_.SetProgressUpdater(pu)
  3434  	return c
  3435  }
  3436  
  3437  // Fields allows partial responses to be retrieved. See
  3438  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3439  // for more information.
  3440  func (c *TimelineInsertCall) Fields(s ...googleapi.Field) *TimelineInsertCall {
  3441  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3442  	return c
  3443  }
  3444  
  3445  // Context sets the context to be used in this call's Do method. Any
  3446  // pending HTTP request will be aborted if the provided context is
  3447  // canceled.
  3448  // This context will supersede any context previously provided to the
  3449  // ResumableMedia method.
  3450  func (c *TimelineInsertCall) Context(ctx context.Context) *TimelineInsertCall {
  3451  	c.ctx_ = ctx
  3452  	return c
  3453  }
  3454  
  3455  // Header returns an http.Header that can be modified by the caller to
  3456  // add HTTP headers to the request.
  3457  func (c *TimelineInsertCall) Header() http.Header {
  3458  	if c.header_ == nil {
  3459  		c.header_ = make(http.Header)
  3460  	}
  3461  	return c.header_
  3462  }
  3463  
  3464  func (c *TimelineInsertCall) doRequest(alt string) (*http.Response, error) {
  3465  	reqHeaders := make(http.Header)
  3466  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  3467  	for k, v := range c.header_ {
  3468  		reqHeaders[k] = v
  3469  	}
  3470  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3471  	var body io.Reader = nil
  3472  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
  3473  	if err != nil {
  3474  		return nil, err
  3475  	}
  3476  	reqHeaders.Set("Content-Type", "application/json")
  3477  	c.urlParams_.Set("alt", alt)
  3478  	c.urlParams_.Set("prettyPrint", "false")
  3479  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline")
  3480  	if c.mediaInfo_ != nil {
  3481  		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/mirror/v1/timeline")
  3482  		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3483  	}
  3484  	if body == nil {
  3485  		body = new(bytes.Buffer)
  3486  		reqHeaders.Set("Content-Type", "application/json")
  3487  	}
  3488  	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3489  	defer cleanup()
  3490  	urls += "?" + c.urlParams_.Encode()
  3491  	req, err := http.NewRequest("POST", urls, body)
  3492  	if err != nil {
  3493  		return nil, err
  3494  	}
  3495  	req.Header = reqHeaders
  3496  	req.GetBody = getBody
  3497  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3498  }
  3499  
  3500  // Do executes the "mirror.timeline.insert" call.
  3501  // Exactly one of *TimelineItem or error will be non-nil. Any non-2xx
  3502  // status code is an error. Response headers are in either
  3503  // *TimelineItem.ServerResponse.Header or (if a response was returned at
  3504  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3505  // to check whether the returned error was because
  3506  // http.StatusNotModified was returned.
  3507  func (c *TimelineInsertCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
  3508  	gensupport.SetOptions(c.urlParams_, opts...)
  3509  	res, err := c.doRequest("json")
  3510  	if res != nil && res.StatusCode == http.StatusNotModified {
  3511  		if res.Body != nil {
  3512  			res.Body.Close()
  3513  		}
  3514  		return nil, &googleapi.Error{
  3515  			Code:   res.StatusCode,
  3516  			Header: res.Header,
  3517  		}
  3518  	}
  3519  	if err != nil {
  3520  		return nil, err
  3521  	}
  3522  	defer googleapi.CloseBody(res)
  3523  	if err := googleapi.CheckResponse(res); err != nil {
  3524  		return nil, err
  3525  	}
  3526  	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3527  	if rx != nil {
  3528  		rx.Client = c.s.client
  3529  		rx.UserAgent = c.s.userAgent()
  3530  		ctx := c.ctx_
  3531  		if ctx == nil {
  3532  			ctx = context.TODO()
  3533  		}
  3534  		res, err = rx.Upload(ctx)
  3535  		if err != nil {
  3536  			return nil, err
  3537  		}
  3538  		defer res.Body.Close()
  3539  		if err := googleapi.CheckResponse(res); err != nil {
  3540  			return nil, err
  3541  		}
  3542  	}
  3543  	ret := &TimelineItem{
  3544  		ServerResponse: googleapi.ServerResponse{
  3545  			Header:         res.Header,
  3546  			HTTPStatusCode: res.StatusCode,
  3547  		},
  3548  	}
  3549  	target := &ret
  3550  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3551  		return nil, err
  3552  	}
  3553  	return ret, nil
  3554  	// {
  3555  	//   "description": "Inserts a new item into the timeline.",
  3556  	//   "httpMethod": "POST",
  3557  	//   "id": "mirror.timeline.insert",
  3558  	//   "mediaUpload": {
  3559  	//     "accept": [
  3560  	//       "audio/*",
  3561  	//       "image/*",
  3562  	//       "video/*"
  3563  	//     ],
  3564  	//     "maxSize": "10MB",
  3565  	//     "protocols": {
  3566  	//       "resumable": {
  3567  	//         "multipart": true,
  3568  	//         "path": "/resumable/upload/mirror/v1/timeline"
  3569  	//       },
  3570  	//       "simple": {
  3571  	//         "multipart": true,
  3572  	//         "path": "/upload/mirror/v1/timeline"
  3573  	//       }
  3574  	//     }
  3575  	//   },
  3576  	//   "path": "timeline",
  3577  	//   "request": {
  3578  	//     "$ref": "TimelineItem"
  3579  	//   },
  3580  	//   "response": {
  3581  	//     "$ref": "TimelineItem"
  3582  	//   },
  3583  	//   "scopes": [
  3584  	//     "https://www.googleapis.com/auth/glass.location",
  3585  	//     "https://www.googleapis.com/auth/glass.timeline"
  3586  	//   ],
  3587  	//   "supportsMediaUpload": true
  3588  	// }
  3589  
  3590  }
  3591  
  3592  // method id "mirror.timeline.list":
  3593  
  3594  type TimelineListCall struct {
  3595  	s            *Service
  3596  	urlParams_   gensupport.URLParams
  3597  	ifNoneMatch_ string
  3598  	ctx_         context.Context
  3599  	header_      http.Header
  3600  }
  3601  
  3602  // List: Retrieves a list of timeline items for the authenticated user.
  3603  func (r *TimelineService) List() *TimelineListCall {
  3604  	c := &TimelineListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3605  	return c
  3606  }
  3607  
  3608  // BundleId sets the optional parameter "bundleId": If provided, only
  3609  // items with the given bundleId will be returned.
  3610  func (c *TimelineListCall) BundleId(bundleId string) *TimelineListCall {
  3611  	c.urlParams_.Set("bundleId", bundleId)
  3612  	return c
  3613  }
  3614  
  3615  // IncludeDeleted sets the optional parameter "includeDeleted": If true,
  3616  // tombstone records for deleted items will be returned.
  3617  func (c *TimelineListCall) IncludeDeleted(includeDeleted bool) *TimelineListCall {
  3618  	c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  3619  	return c
  3620  }
  3621  
  3622  // MaxResults sets the optional parameter "maxResults": The maximum
  3623  // number of items to include in the response, used for paging.
  3624  func (c *TimelineListCall) MaxResults(maxResults int64) *TimelineListCall {
  3625  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3626  	return c
  3627  }
  3628  
  3629  // OrderBy sets the optional parameter "orderBy": Controls the order in
  3630  // which timeline items are returned.
  3631  //
  3632  // Possible values:
  3633  //
  3634  //	"displayTime" - Results will be ordered by displayTime (default).
  3635  //
  3636  // This is the same ordering as is used in the timeline on the device.
  3637  //
  3638  //	"writeTime" - Results will be ordered by the time at which they
  3639  //
  3640  // were last written to the data store.
  3641  func (c *TimelineListCall) OrderBy(orderBy string) *TimelineListCall {
  3642  	c.urlParams_.Set("orderBy", orderBy)
  3643  	return c
  3644  }
  3645  
  3646  // PageToken sets the optional parameter "pageToken": Token for the page
  3647  // of results to return.
  3648  func (c *TimelineListCall) PageToken(pageToken string) *TimelineListCall {
  3649  	c.urlParams_.Set("pageToken", pageToken)
  3650  	return c
  3651  }
  3652  
  3653  // PinnedOnly sets the optional parameter "pinnedOnly": If true, only
  3654  // pinned items will be returned.
  3655  func (c *TimelineListCall) PinnedOnly(pinnedOnly bool) *TimelineListCall {
  3656  	c.urlParams_.Set("pinnedOnly", fmt.Sprint(pinnedOnly))
  3657  	return c
  3658  }
  3659  
  3660  // SourceItemId sets the optional parameter "sourceItemId": If provided,
  3661  // only items with the given sourceItemId will be returned.
  3662  func (c *TimelineListCall) SourceItemId(sourceItemId string) *TimelineListCall {
  3663  	c.urlParams_.Set("sourceItemId", sourceItemId)
  3664  	return c
  3665  }
  3666  
  3667  // Fields allows partial responses to be retrieved. See
  3668  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3669  // for more information.
  3670  func (c *TimelineListCall) Fields(s ...googleapi.Field) *TimelineListCall {
  3671  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3672  	return c
  3673  }
  3674  
  3675  // IfNoneMatch sets the optional parameter which makes the operation
  3676  // fail if the object's ETag matches the given value. This is useful for
  3677  // getting updates only after the object has changed since the last
  3678  // request. Use googleapi.IsNotModified to check whether the response
  3679  // error from Do is the result of In-None-Match.
  3680  func (c *TimelineListCall) IfNoneMatch(entityTag string) *TimelineListCall {
  3681  	c.ifNoneMatch_ = entityTag
  3682  	return c
  3683  }
  3684  
  3685  // Context sets the context to be used in this call's Do method. Any
  3686  // pending HTTP request will be aborted if the provided context is
  3687  // canceled.
  3688  func (c *TimelineListCall) Context(ctx context.Context) *TimelineListCall {
  3689  	c.ctx_ = ctx
  3690  	return c
  3691  }
  3692  
  3693  // Header returns an http.Header that can be modified by the caller to
  3694  // add HTTP headers to the request.
  3695  func (c *TimelineListCall) Header() http.Header {
  3696  	if c.header_ == nil {
  3697  		c.header_ = make(http.Header)
  3698  	}
  3699  	return c.header_
  3700  }
  3701  
  3702  func (c *TimelineListCall) doRequest(alt string) (*http.Response, error) {
  3703  	reqHeaders := make(http.Header)
  3704  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  3705  	for k, v := range c.header_ {
  3706  		reqHeaders[k] = v
  3707  	}
  3708  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3709  	if c.ifNoneMatch_ != "" {
  3710  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3711  	}
  3712  	var body io.Reader = nil
  3713  	c.urlParams_.Set("alt", alt)
  3714  	c.urlParams_.Set("prettyPrint", "false")
  3715  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline")
  3716  	urls += "?" + c.urlParams_.Encode()
  3717  	req, err := http.NewRequest("GET", urls, body)
  3718  	if err != nil {
  3719  		return nil, err
  3720  	}
  3721  	req.Header = reqHeaders
  3722  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3723  }
  3724  
  3725  // Do executes the "mirror.timeline.list" call.
  3726  // Exactly one of *TimelineListResponse or error will be non-nil. Any
  3727  // non-2xx status code is an error. Response headers are in either
  3728  // *TimelineListResponse.ServerResponse.Header or (if a response was
  3729  // returned at all) in error.(*googleapi.Error).Header. Use
  3730  // googleapi.IsNotModified to check whether the returned error was
  3731  // because http.StatusNotModified was returned.
  3732  func (c *TimelineListCall) Do(opts ...googleapi.CallOption) (*TimelineListResponse, error) {
  3733  	gensupport.SetOptions(c.urlParams_, opts...)
  3734  	res, err := c.doRequest("json")
  3735  	if res != nil && res.StatusCode == http.StatusNotModified {
  3736  		if res.Body != nil {
  3737  			res.Body.Close()
  3738  		}
  3739  		return nil, &googleapi.Error{
  3740  			Code:   res.StatusCode,
  3741  			Header: res.Header,
  3742  		}
  3743  	}
  3744  	if err != nil {
  3745  		return nil, err
  3746  	}
  3747  	defer googleapi.CloseBody(res)
  3748  	if err := googleapi.CheckResponse(res); err != nil {
  3749  		return nil, err
  3750  	}
  3751  	ret := &TimelineListResponse{
  3752  		ServerResponse: googleapi.ServerResponse{
  3753  			Header:         res.Header,
  3754  			HTTPStatusCode: res.StatusCode,
  3755  		},
  3756  	}
  3757  	target := &ret
  3758  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3759  		return nil, err
  3760  	}
  3761  	return ret, nil
  3762  	// {
  3763  	//   "description": "Retrieves a list of timeline items for the authenticated user.",
  3764  	//   "httpMethod": "GET",
  3765  	//   "id": "mirror.timeline.list",
  3766  	//   "parameters": {
  3767  	//     "bundleId": {
  3768  	//       "description": "If provided, only items with the given bundleId will be returned.",
  3769  	//       "location": "query",
  3770  	//       "type": "string"
  3771  	//     },
  3772  	//     "includeDeleted": {
  3773  	//       "description": "If true, tombstone records for deleted items will be returned.",
  3774  	//       "location": "query",
  3775  	//       "type": "boolean"
  3776  	//     },
  3777  	//     "maxResults": {
  3778  	//       "description": "The maximum number of items to include in the response, used for paging.",
  3779  	//       "format": "uint32",
  3780  	//       "location": "query",
  3781  	//       "type": "integer"
  3782  	//     },
  3783  	//     "orderBy": {
  3784  	//       "description": "Controls the order in which timeline items are returned.",
  3785  	//       "enum": [
  3786  	//         "displayTime",
  3787  	//         "writeTime"
  3788  	//       ],
  3789  	//       "enumDescriptions": [
  3790  	//         "Results will be ordered by displayTime (default). This is the same ordering as is used in the timeline on the device.",
  3791  	//         "Results will be ordered by the time at which they were last written to the data store."
  3792  	//       ],
  3793  	//       "location": "query",
  3794  	//       "type": "string"
  3795  	//     },
  3796  	//     "pageToken": {
  3797  	//       "description": "Token for the page of results to return.",
  3798  	//       "location": "query",
  3799  	//       "type": "string"
  3800  	//     },
  3801  	//     "pinnedOnly": {
  3802  	//       "description": "If true, only pinned items will be returned.",
  3803  	//       "location": "query",
  3804  	//       "type": "boolean"
  3805  	//     },
  3806  	//     "sourceItemId": {
  3807  	//       "description": "If provided, only items with the given sourceItemId will be returned.",
  3808  	//       "location": "query",
  3809  	//       "type": "string"
  3810  	//     }
  3811  	//   },
  3812  	//   "path": "timeline",
  3813  	//   "response": {
  3814  	//     "$ref": "TimelineListResponse"
  3815  	//   },
  3816  	//   "scopes": [
  3817  	//     "https://www.googleapis.com/auth/glass.location",
  3818  	//     "https://www.googleapis.com/auth/glass.timeline"
  3819  	//   ]
  3820  	// }
  3821  
  3822  }
  3823  
  3824  // Pages invokes f for each page of results.
  3825  // A non-nil error returned from f will halt the iteration.
  3826  // The provided context supersedes any context provided to the Context method.
  3827  func (c *TimelineListCall) Pages(ctx context.Context, f func(*TimelineListResponse) error) error {
  3828  	c.ctx_ = ctx
  3829  	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3830  	for {
  3831  		x, err := c.Do()
  3832  		if err != nil {
  3833  			return err
  3834  		}
  3835  		if err := f(x); err != nil {
  3836  			return err
  3837  		}
  3838  		if x.NextPageToken == "" {
  3839  			return nil
  3840  		}
  3841  		c.PageToken(x.NextPageToken)
  3842  	}
  3843  }
  3844  
  3845  // method id "mirror.timeline.patch":
  3846  
  3847  type TimelinePatchCall struct {
  3848  	s            *Service
  3849  	id           string
  3850  	timelineitem *TimelineItem
  3851  	urlParams_   gensupport.URLParams
  3852  	ctx_         context.Context
  3853  	header_      http.Header
  3854  }
  3855  
  3856  // Patch: Updates a timeline item in place. This method supports patch
  3857  // semantics.
  3858  func (r *TimelineService) Patch(id string, timelineitem *TimelineItem) *TimelinePatchCall {
  3859  	c := &TimelinePatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3860  	c.id = id
  3861  	c.timelineitem = timelineitem
  3862  	return c
  3863  }
  3864  
  3865  // Fields allows partial responses to be retrieved. See
  3866  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3867  // for more information.
  3868  func (c *TimelinePatchCall) Fields(s ...googleapi.Field) *TimelinePatchCall {
  3869  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3870  	return c
  3871  }
  3872  
  3873  // Context sets the context to be used in this call's Do method. Any
  3874  // pending HTTP request will be aborted if the provided context is
  3875  // canceled.
  3876  func (c *TimelinePatchCall) Context(ctx context.Context) *TimelinePatchCall {
  3877  	c.ctx_ = ctx
  3878  	return c
  3879  }
  3880  
  3881  // Header returns an http.Header that can be modified by the caller to
  3882  // add HTTP headers to the request.
  3883  func (c *TimelinePatchCall) Header() http.Header {
  3884  	if c.header_ == nil {
  3885  		c.header_ = make(http.Header)
  3886  	}
  3887  	return c.header_
  3888  }
  3889  
  3890  func (c *TimelinePatchCall) doRequest(alt string) (*http.Response, error) {
  3891  	reqHeaders := make(http.Header)
  3892  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  3893  	for k, v := range c.header_ {
  3894  		reqHeaders[k] = v
  3895  	}
  3896  	reqHeaders.Set("User-Agent", c.s.userAgent())
  3897  	var body io.Reader = nil
  3898  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
  3899  	if err != nil {
  3900  		return nil, err
  3901  	}
  3902  	reqHeaders.Set("Content-Type", "application/json")
  3903  	c.urlParams_.Set("alt", alt)
  3904  	c.urlParams_.Set("prettyPrint", "false")
  3905  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
  3906  	urls += "?" + c.urlParams_.Encode()
  3907  	req, err := http.NewRequest("PATCH", urls, body)
  3908  	if err != nil {
  3909  		return nil, err
  3910  	}
  3911  	req.Header = reqHeaders
  3912  	googleapi.Expand(req.URL, map[string]string{
  3913  		"id": c.id,
  3914  	})
  3915  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3916  }
  3917  
  3918  // Do executes the "mirror.timeline.patch" call.
  3919  // Exactly one of *TimelineItem or error will be non-nil. Any non-2xx
  3920  // status code is an error. Response headers are in either
  3921  // *TimelineItem.ServerResponse.Header or (if a response was returned at
  3922  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3923  // to check whether the returned error was because
  3924  // http.StatusNotModified was returned.
  3925  func (c *TimelinePatchCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
  3926  	gensupport.SetOptions(c.urlParams_, opts...)
  3927  	res, err := c.doRequest("json")
  3928  	if res != nil && res.StatusCode == http.StatusNotModified {
  3929  		if res.Body != nil {
  3930  			res.Body.Close()
  3931  		}
  3932  		return nil, &googleapi.Error{
  3933  			Code:   res.StatusCode,
  3934  			Header: res.Header,
  3935  		}
  3936  	}
  3937  	if err != nil {
  3938  		return nil, err
  3939  	}
  3940  	defer googleapi.CloseBody(res)
  3941  	if err := googleapi.CheckResponse(res); err != nil {
  3942  		return nil, err
  3943  	}
  3944  	ret := &TimelineItem{
  3945  		ServerResponse: googleapi.ServerResponse{
  3946  			Header:         res.Header,
  3947  			HTTPStatusCode: res.StatusCode,
  3948  		},
  3949  	}
  3950  	target := &ret
  3951  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3952  		return nil, err
  3953  	}
  3954  	return ret, nil
  3955  	// {
  3956  	//   "description": "Updates a timeline item in place. This method supports patch semantics.",
  3957  	//   "httpMethod": "PATCH",
  3958  	//   "id": "mirror.timeline.patch",
  3959  	//   "parameterOrder": [
  3960  	//     "id"
  3961  	//   ],
  3962  	//   "parameters": {
  3963  	//     "id": {
  3964  	//       "description": "The ID of the timeline item.",
  3965  	//       "location": "path",
  3966  	//       "required": true,
  3967  	//       "type": "string"
  3968  	//     }
  3969  	//   },
  3970  	//   "path": "timeline/{id}",
  3971  	//   "request": {
  3972  	//     "$ref": "TimelineItem"
  3973  	//   },
  3974  	//   "response": {
  3975  	//     "$ref": "TimelineItem"
  3976  	//   },
  3977  	//   "scopes": [
  3978  	//     "https://www.googleapis.com/auth/glass.location",
  3979  	//     "https://www.googleapis.com/auth/glass.timeline"
  3980  	//   ]
  3981  	// }
  3982  
  3983  }
  3984  
  3985  // method id "mirror.timeline.update":
  3986  
  3987  type TimelineUpdateCall struct {
  3988  	s            *Service
  3989  	id           string
  3990  	timelineitem *TimelineItem
  3991  	urlParams_   gensupport.URLParams
  3992  	mediaInfo_   *gensupport.MediaInfo
  3993  	ctx_         context.Context
  3994  	header_      http.Header
  3995  }
  3996  
  3997  // Update: Updates a timeline item in place.
  3998  func (r *TimelineService) Update(id string, timelineitem *TimelineItem) *TimelineUpdateCall {
  3999  	c := &TimelineUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4000  	c.id = id
  4001  	c.timelineitem = timelineitem
  4002  	return c
  4003  }
  4004  
  4005  // Media specifies the media to upload in one or more chunks. The chunk
  4006  // size may be controlled by supplying a MediaOption generated by
  4007  // googleapi.ChunkSize. The chunk size defaults to
  4008  // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4009  // upload request will be determined by sniffing the contents of r,
  4010  // unless a MediaOption generated by googleapi.ContentType is
  4011  // supplied.
  4012  // At most one of Media and ResumableMedia may be set.
  4013  func (c *TimelineUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *TimelineUpdateCall {
  4014  	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4015  	return c
  4016  }
  4017  
  4018  // ResumableMedia specifies the media to upload in chunks and can be
  4019  // canceled with ctx.
  4020  //
  4021  // Deprecated: use Media instead.
  4022  //
  4023  // At most one of Media and ResumableMedia may be set. mediaType
  4024  // identifies the MIME media type of the upload, such as "image/png". If
  4025  // mediaType is "", it will be auto-detected. The provided ctx will
  4026  // supersede any context previously provided to the Context method.
  4027  func (c *TimelineUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineUpdateCall {
  4028  	c.ctx_ = ctx
  4029  	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4030  	return c
  4031  }
  4032  
  4033  // ProgressUpdater provides a callback function that will be called
  4034  // after every chunk. It should be a low-latency function in order to
  4035  // not slow down the upload operation. This should only be called when
  4036  // using ResumableMedia (as opposed to Media).
  4037  func (c *TimelineUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineUpdateCall {
  4038  	c.mediaInfo_.SetProgressUpdater(pu)
  4039  	return c
  4040  }
  4041  
  4042  // Fields allows partial responses to be retrieved. See
  4043  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4044  // for more information.
  4045  func (c *TimelineUpdateCall) Fields(s ...googleapi.Field) *TimelineUpdateCall {
  4046  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4047  	return c
  4048  }
  4049  
  4050  // Context sets the context to be used in this call's Do method. Any
  4051  // pending HTTP request will be aborted if the provided context is
  4052  // canceled.
  4053  // This context will supersede any context previously provided to the
  4054  // ResumableMedia method.
  4055  func (c *TimelineUpdateCall) Context(ctx context.Context) *TimelineUpdateCall {
  4056  	c.ctx_ = ctx
  4057  	return c
  4058  }
  4059  
  4060  // Header returns an http.Header that can be modified by the caller to
  4061  // add HTTP headers to the request.
  4062  func (c *TimelineUpdateCall) Header() http.Header {
  4063  	if c.header_ == nil {
  4064  		c.header_ = make(http.Header)
  4065  	}
  4066  	return c.header_
  4067  }
  4068  
  4069  func (c *TimelineUpdateCall) doRequest(alt string) (*http.Response, error) {
  4070  	reqHeaders := make(http.Header)
  4071  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  4072  	for k, v := range c.header_ {
  4073  		reqHeaders[k] = v
  4074  	}
  4075  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4076  	var body io.Reader = nil
  4077  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
  4078  	if err != nil {
  4079  		return nil, err
  4080  	}
  4081  	reqHeaders.Set("Content-Type", "application/json")
  4082  	c.urlParams_.Set("alt", alt)
  4083  	c.urlParams_.Set("prettyPrint", "false")
  4084  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
  4085  	if c.mediaInfo_ != nil {
  4086  		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/mirror/v1/timeline/{id}")
  4087  		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4088  	}
  4089  	if body == nil {
  4090  		body = new(bytes.Buffer)
  4091  		reqHeaders.Set("Content-Type", "application/json")
  4092  	}
  4093  	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4094  	defer cleanup()
  4095  	urls += "?" + c.urlParams_.Encode()
  4096  	req, err := http.NewRequest("PUT", urls, body)
  4097  	if err != nil {
  4098  		return nil, err
  4099  	}
  4100  	req.Header = reqHeaders
  4101  	req.GetBody = getBody
  4102  	googleapi.Expand(req.URL, map[string]string{
  4103  		"id": c.id,
  4104  	})
  4105  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4106  }
  4107  
  4108  // Do executes the "mirror.timeline.update" call.
  4109  // Exactly one of *TimelineItem or error will be non-nil. Any non-2xx
  4110  // status code is an error. Response headers are in either
  4111  // *TimelineItem.ServerResponse.Header or (if a response was returned at
  4112  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4113  // to check whether the returned error was because
  4114  // http.StatusNotModified was returned.
  4115  func (c *TimelineUpdateCall) Do(opts ...googleapi.CallOption) (*TimelineItem, error) {
  4116  	gensupport.SetOptions(c.urlParams_, opts...)
  4117  	res, err := c.doRequest("json")
  4118  	if res != nil && res.StatusCode == http.StatusNotModified {
  4119  		if res.Body != nil {
  4120  			res.Body.Close()
  4121  		}
  4122  		return nil, &googleapi.Error{
  4123  			Code:   res.StatusCode,
  4124  			Header: res.Header,
  4125  		}
  4126  	}
  4127  	if err != nil {
  4128  		return nil, err
  4129  	}
  4130  	defer googleapi.CloseBody(res)
  4131  	if err := googleapi.CheckResponse(res); err != nil {
  4132  		return nil, err
  4133  	}
  4134  	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4135  	if rx != nil {
  4136  		rx.Client = c.s.client
  4137  		rx.UserAgent = c.s.userAgent()
  4138  		ctx := c.ctx_
  4139  		if ctx == nil {
  4140  			ctx = context.TODO()
  4141  		}
  4142  		res, err = rx.Upload(ctx)
  4143  		if err != nil {
  4144  			return nil, err
  4145  		}
  4146  		defer res.Body.Close()
  4147  		if err := googleapi.CheckResponse(res); err != nil {
  4148  			return nil, err
  4149  		}
  4150  	}
  4151  	ret := &TimelineItem{
  4152  		ServerResponse: googleapi.ServerResponse{
  4153  			Header:         res.Header,
  4154  			HTTPStatusCode: res.StatusCode,
  4155  		},
  4156  	}
  4157  	target := &ret
  4158  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4159  		return nil, err
  4160  	}
  4161  	return ret, nil
  4162  	// {
  4163  	//   "description": "Updates a timeline item in place.",
  4164  	//   "httpMethod": "PUT",
  4165  	//   "id": "mirror.timeline.update",
  4166  	//   "mediaUpload": {
  4167  	//     "accept": [
  4168  	//       "audio/*",
  4169  	//       "image/*",
  4170  	//       "video/*"
  4171  	//     ],
  4172  	//     "maxSize": "10MB",
  4173  	//     "protocols": {
  4174  	//       "resumable": {
  4175  	//         "multipart": true,
  4176  	//         "path": "/resumable/upload/mirror/v1/timeline/{id}"
  4177  	//       },
  4178  	//       "simple": {
  4179  	//         "multipart": true,
  4180  	//         "path": "/upload/mirror/v1/timeline/{id}"
  4181  	//       }
  4182  	//     }
  4183  	//   },
  4184  	//   "parameterOrder": [
  4185  	//     "id"
  4186  	//   ],
  4187  	//   "parameters": {
  4188  	//     "id": {
  4189  	//       "description": "The ID of the timeline item.",
  4190  	//       "location": "path",
  4191  	//       "required": true,
  4192  	//       "type": "string"
  4193  	//     }
  4194  	//   },
  4195  	//   "path": "timeline/{id}",
  4196  	//   "request": {
  4197  	//     "$ref": "TimelineItem"
  4198  	//   },
  4199  	//   "response": {
  4200  	//     "$ref": "TimelineItem"
  4201  	//   },
  4202  	//   "scopes": [
  4203  	//     "https://www.googleapis.com/auth/glass.location",
  4204  	//     "https://www.googleapis.com/auth/glass.timeline"
  4205  	//   ],
  4206  	//   "supportsMediaUpload": true
  4207  	// }
  4208  
  4209  }
  4210  
  4211  // method id "mirror.timeline.attachments.delete":
  4212  
  4213  type TimelineAttachmentsDeleteCall struct {
  4214  	s            *Service
  4215  	itemId       string
  4216  	attachmentId string
  4217  	urlParams_   gensupport.URLParams
  4218  	ctx_         context.Context
  4219  	header_      http.Header
  4220  }
  4221  
  4222  // Delete: Deletes an attachment from a timeline item.
  4223  func (r *TimelineAttachmentsService) Delete(itemId string, attachmentId string) *TimelineAttachmentsDeleteCall {
  4224  	c := &TimelineAttachmentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4225  	c.itemId = itemId
  4226  	c.attachmentId = attachmentId
  4227  	return c
  4228  }
  4229  
  4230  // Fields allows partial responses to be retrieved. See
  4231  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4232  // for more information.
  4233  func (c *TimelineAttachmentsDeleteCall) Fields(s ...googleapi.Field) *TimelineAttachmentsDeleteCall {
  4234  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4235  	return c
  4236  }
  4237  
  4238  // Context sets the context to be used in this call's Do method. Any
  4239  // pending HTTP request will be aborted if the provided context is
  4240  // canceled.
  4241  func (c *TimelineAttachmentsDeleteCall) Context(ctx context.Context) *TimelineAttachmentsDeleteCall {
  4242  	c.ctx_ = ctx
  4243  	return c
  4244  }
  4245  
  4246  // Header returns an http.Header that can be modified by the caller to
  4247  // add HTTP headers to the request.
  4248  func (c *TimelineAttachmentsDeleteCall) Header() http.Header {
  4249  	if c.header_ == nil {
  4250  		c.header_ = make(http.Header)
  4251  	}
  4252  	return c.header_
  4253  }
  4254  
  4255  func (c *TimelineAttachmentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4256  	reqHeaders := make(http.Header)
  4257  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  4258  	for k, v := range c.header_ {
  4259  		reqHeaders[k] = v
  4260  	}
  4261  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4262  	var body io.Reader = nil
  4263  	c.urlParams_.Set("alt", alt)
  4264  	c.urlParams_.Set("prettyPrint", "false")
  4265  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}")
  4266  	urls += "?" + c.urlParams_.Encode()
  4267  	req, err := http.NewRequest("DELETE", urls, body)
  4268  	if err != nil {
  4269  		return nil, err
  4270  	}
  4271  	req.Header = reqHeaders
  4272  	googleapi.Expand(req.URL, map[string]string{
  4273  		"itemId":       c.itemId,
  4274  		"attachmentId": c.attachmentId,
  4275  	})
  4276  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4277  }
  4278  
  4279  // Do executes the "mirror.timeline.attachments.delete" call.
  4280  func (c *TimelineAttachmentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4281  	gensupport.SetOptions(c.urlParams_, opts...)
  4282  	res, err := c.doRequest("json")
  4283  	if err != nil {
  4284  		return err
  4285  	}
  4286  	defer googleapi.CloseBody(res)
  4287  	if err := googleapi.CheckResponse(res); err != nil {
  4288  		return err
  4289  	}
  4290  	return nil
  4291  	// {
  4292  	//   "description": "Deletes an attachment from a timeline item.",
  4293  	//   "httpMethod": "DELETE",
  4294  	//   "id": "mirror.timeline.attachments.delete",
  4295  	//   "parameterOrder": [
  4296  	//     "itemId",
  4297  	//     "attachmentId"
  4298  	//   ],
  4299  	//   "parameters": {
  4300  	//     "attachmentId": {
  4301  	//       "description": "The ID of the attachment.",
  4302  	//       "location": "path",
  4303  	//       "required": true,
  4304  	//       "type": "string"
  4305  	//     },
  4306  	//     "itemId": {
  4307  	//       "description": "The ID of the timeline item the attachment belongs to.",
  4308  	//       "location": "path",
  4309  	//       "required": true,
  4310  	//       "type": "string"
  4311  	//     }
  4312  	//   },
  4313  	//   "path": "timeline/{itemId}/attachments/{attachmentId}",
  4314  	//   "scopes": [
  4315  	//     "https://www.googleapis.com/auth/glass.timeline"
  4316  	//   ]
  4317  	// }
  4318  
  4319  }
  4320  
  4321  // method id "mirror.timeline.attachments.get":
  4322  
  4323  type TimelineAttachmentsGetCall struct {
  4324  	s            *Service
  4325  	itemId       string
  4326  	attachmentId string
  4327  	urlParams_   gensupport.URLParams
  4328  	ifNoneMatch_ string
  4329  	ctx_         context.Context
  4330  	header_      http.Header
  4331  }
  4332  
  4333  // Get: Retrieves an attachment on a timeline item by item ID and
  4334  // attachment ID.
  4335  func (r *TimelineAttachmentsService) Get(itemId string, attachmentId string) *TimelineAttachmentsGetCall {
  4336  	c := &TimelineAttachmentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4337  	c.itemId = itemId
  4338  	c.attachmentId = attachmentId
  4339  	return c
  4340  }
  4341  
  4342  // Fields allows partial responses to be retrieved. See
  4343  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4344  // for more information.
  4345  func (c *TimelineAttachmentsGetCall) Fields(s ...googleapi.Field) *TimelineAttachmentsGetCall {
  4346  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4347  	return c
  4348  }
  4349  
  4350  // IfNoneMatch sets the optional parameter which makes the operation
  4351  // fail if the object's ETag matches the given value. This is useful for
  4352  // getting updates only after the object has changed since the last
  4353  // request. Use googleapi.IsNotModified to check whether the response
  4354  // error from Do is the result of In-None-Match.
  4355  func (c *TimelineAttachmentsGetCall) IfNoneMatch(entityTag string) *TimelineAttachmentsGetCall {
  4356  	c.ifNoneMatch_ = entityTag
  4357  	return c
  4358  }
  4359  
  4360  // Context sets the context to be used in this call's Do and Download
  4361  // methods. Any pending HTTP request will be aborted if the provided
  4362  // context is canceled.
  4363  func (c *TimelineAttachmentsGetCall) Context(ctx context.Context) *TimelineAttachmentsGetCall {
  4364  	c.ctx_ = ctx
  4365  	return c
  4366  }
  4367  
  4368  // Header returns an http.Header that can be modified by the caller to
  4369  // add HTTP headers to the request.
  4370  func (c *TimelineAttachmentsGetCall) Header() http.Header {
  4371  	if c.header_ == nil {
  4372  		c.header_ = make(http.Header)
  4373  	}
  4374  	return c.header_
  4375  }
  4376  
  4377  func (c *TimelineAttachmentsGetCall) doRequest(alt string) (*http.Response, error) {
  4378  	reqHeaders := make(http.Header)
  4379  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  4380  	for k, v := range c.header_ {
  4381  		reqHeaders[k] = v
  4382  	}
  4383  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4384  	if c.ifNoneMatch_ != "" {
  4385  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4386  	}
  4387  	var body io.Reader = nil
  4388  	c.urlParams_.Set("alt", alt)
  4389  	c.urlParams_.Set("prettyPrint", "false")
  4390  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}")
  4391  	urls += "?" + c.urlParams_.Encode()
  4392  	req, err := http.NewRequest("GET", urls, body)
  4393  	if err != nil {
  4394  		return nil, err
  4395  	}
  4396  	req.Header = reqHeaders
  4397  	googleapi.Expand(req.URL, map[string]string{
  4398  		"itemId":       c.itemId,
  4399  		"attachmentId": c.attachmentId,
  4400  	})
  4401  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4402  }
  4403  
  4404  // Download fetches the API endpoint's "media" value, instead of the normal
  4405  // API response value. If the returned error is nil, the Response is guaranteed to
  4406  // have a 2xx status code. Callers must close the Response.Body as usual.
  4407  func (c *TimelineAttachmentsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  4408  	gensupport.SetOptions(c.urlParams_, opts...)
  4409  	res, err := c.doRequest("media")
  4410  	if err != nil {
  4411  		return nil, err
  4412  	}
  4413  	if err := googleapi.CheckMediaResponse(res); err != nil {
  4414  		res.Body.Close()
  4415  		return nil, err
  4416  	}
  4417  	return res, nil
  4418  }
  4419  
  4420  // Do executes the "mirror.timeline.attachments.get" call.
  4421  // Exactly one of *Attachment or error will be non-nil. Any non-2xx
  4422  // status code is an error. Response headers are in either
  4423  // *Attachment.ServerResponse.Header or (if a response was returned at
  4424  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4425  // to check whether the returned error was because
  4426  // http.StatusNotModified was returned.
  4427  func (c *TimelineAttachmentsGetCall) Do(opts ...googleapi.CallOption) (*Attachment, error) {
  4428  	gensupport.SetOptions(c.urlParams_, opts...)
  4429  	res, err := c.doRequest("json")
  4430  	if res != nil && res.StatusCode == http.StatusNotModified {
  4431  		if res.Body != nil {
  4432  			res.Body.Close()
  4433  		}
  4434  		return nil, &googleapi.Error{
  4435  			Code:   res.StatusCode,
  4436  			Header: res.Header,
  4437  		}
  4438  	}
  4439  	if err != nil {
  4440  		return nil, err
  4441  	}
  4442  	defer googleapi.CloseBody(res)
  4443  	if err := googleapi.CheckResponse(res); err != nil {
  4444  		return nil, err
  4445  	}
  4446  	ret := &Attachment{
  4447  		ServerResponse: googleapi.ServerResponse{
  4448  			Header:         res.Header,
  4449  			HTTPStatusCode: res.StatusCode,
  4450  		},
  4451  	}
  4452  	target := &ret
  4453  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4454  		return nil, err
  4455  	}
  4456  	return ret, nil
  4457  	// {
  4458  	//   "description": "Retrieves an attachment on a timeline item by item ID and attachment ID.",
  4459  	//   "httpMethod": "GET",
  4460  	//   "id": "mirror.timeline.attachments.get",
  4461  	//   "parameterOrder": [
  4462  	//     "itemId",
  4463  	//     "attachmentId"
  4464  	//   ],
  4465  	//   "parameters": {
  4466  	//     "attachmentId": {
  4467  	//       "description": "The ID of the attachment.",
  4468  	//       "location": "path",
  4469  	//       "required": true,
  4470  	//       "type": "string"
  4471  	//     },
  4472  	//     "itemId": {
  4473  	//       "description": "The ID of the timeline item the attachment belongs to.",
  4474  	//       "location": "path",
  4475  	//       "required": true,
  4476  	//       "type": "string"
  4477  	//     }
  4478  	//   },
  4479  	//   "path": "timeline/{itemId}/attachments/{attachmentId}",
  4480  	//   "response": {
  4481  	//     "$ref": "Attachment"
  4482  	//   },
  4483  	//   "scopes": [
  4484  	//     "https://www.googleapis.com/auth/glass.timeline"
  4485  	//   ],
  4486  	//   "supportsMediaDownload": true
  4487  	// }
  4488  
  4489  }
  4490  
  4491  // method id "mirror.timeline.attachments.insert":
  4492  
  4493  type TimelineAttachmentsInsertCall struct {
  4494  	s          *Service
  4495  	itemId     string
  4496  	urlParams_ gensupport.URLParams
  4497  	mediaInfo_ *gensupport.MediaInfo
  4498  	ctx_       context.Context
  4499  	header_    http.Header
  4500  }
  4501  
  4502  // Insert: Adds a new attachment to a timeline item.
  4503  func (r *TimelineAttachmentsService) Insert(itemId string) *TimelineAttachmentsInsertCall {
  4504  	c := &TimelineAttachmentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4505  	c.itemId = itemId
  4506  	return c
  4507  }
  4508  
  4509  // Media specifies the media to upload in one or more chunks. The chunk
  4510  // size may be controlled by supplying a MediaOption generated by
  4511  // googleapi.ChunkSize. The chunk size defaults to
  4512  // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4513  // upload request will be determined by sniffing the contents of r,
  4514  // unless a MediaOption generated by googleapi.ContentType is
  4515  // supplied.
  4516  // At most one of Media and ResumableMedia may be set.
  4517  func (c *TimelineAttachmentsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *TimelineAttachmentsInsertCall {
  4518  	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4519  	return c
  4520  }
  4521  
  4522  // ResumableMedia specifies the media to upload in chunks and can be
  4523  // canceled with ctx.
  4524  //
  4525  // Deprecated: use Media instead.
  4526  //
  4527  // At most one of Media and ResumableMedia may be set. mediaType
  4528  // identifies the MIME media type of the upload, such as "image/png". If
  4529  // mediaType is "", it will be auto-detected. The provided ctx will
  4530  // supersede any context previously provided to the Context method.
  4531  func (c *TimelineAttachmentsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *TimelineAttachmentsInsertCall {
  4532  	c.ctx_ = ctx
  4533  	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4534  	return c
  4535  }
  4536  
  4537  // ProgressUpdater provides a callback function that will be called
  4538  // after every chunk. It should be a low-latency function in order to
  4539  // not slow down the upload operation. This should only be called when
  4540  // using ResumableMedia (as opposed to Media).
  4541  func (c *TimelineAttachmentsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *TimelineAttachmentsInsertCall {
  4542  	c.mediaInfo_.SetProgressUpdater(pu)
  4543  	return c
  4544  }
  4545  
  4546  // Fields allows partial responses to be retrieved. See
  4547  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4548  // for more information.
  4549  func (c *TimelineAttachmentsInsertCall) Fields(s ...googleapi.Field) *TimelineAttachmentsInsertCall {
  4550  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4551  	return c
  4552  }
  4553  
  4554  // Context sets the context to be used in this call's Do method. Any
  4555  // pending HTTP request will be aborted if the provided context is
  4556  // canceled.
  4557  // This context will supersede any context previously provided to the
  4558  // ResumableMedia method.
  4559  func (c *TimelineAttachmentsInsertCall) Context(ctx context.Context) *TimelineAttachmentsInsertCall {
  4560  	c.ctx_ = ctx
  4561  	return c
  4562  }
  4563  
  4564  // Header returns an http.Header that can be modified by the caller to
  4565  // add HTTP headers to the request.
  4566  func (c *TimelineAttachmentsInsertCall) Header() http.Header {
  4567  	if c.header_ == nil {
  4568  		c.header_ = make(http.Header)
  4569  	}
  4570  	return c.header_
  4571  }
  4572  
  4573  func (c *TimelineAttachmentsInsertCall) doRequest(alt string) (*http.Response, error) {
  4574  	reqHeaders := make(http.Header)
  4575  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  4576  	for k, v := range c.header_ {
  4577  		reqHeaders[k] = v
  4578  	}
  4579  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4580  	var body io.Reader = nil
  4581  	c.urlParams_.Set("alt", alt)
  4582  	c.urlParams_.Set("prettyPrint", "false")
  4583  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments")
  4584  	if c.mediaInfo_ != nil {
  4585  		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/mirror/v1/timeline/{itemId}/attachments")
  4586  		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4587  	}
  4588  	if body == nil {
  4589  		body = new(bytes.Buffer)
  4590  		reqHeaders.Set("Content-Type", "application/json")
  4591  	}
  4592  	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4593  	defer cleanup()
  4594  	urls += "?" + c.urlParams_.Encode()
  4595  	req, err := http.NewRequest("POST", urls, body)
  4596  	if err != nil {
  4597  		return nil, err
  4598  	}
  4599  	req.Header = reqHeaders
  4600  	req.GetBody = getBody
  4601  	googleapi.Expand(req.URL, map[string]string{
  4602  		"itemId": c.itemId,
  4603  	})
  4604  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4605  }
  4606  
  4607  // Do executes the "mirror.timeline.attachments.insert" call.
  4608  // Exactly one of *Attachment or error will be non-nil. Any non-2xx
  4609  // status code is an error. Response headers are in either
  4610  // *Attachment.ServerResponse.Header or (if a response was returned at
  4611  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4612  // to check whether the returned error was because
  4613  // http.StatusNotModified was returned.
  4614  func (c *TimelineAttachmentsInsertCall) Do(opts ...googleapi.CallOption) (*Attachment, error) {
  4615  	gensupport.SetOptions(c.urlParams_, opts...)
  4616  	res, err := c.doRequest("json")
  4617  	if res != nil && res.StatusCode == http.StatusNotModified {
  4618  		if res.Body != nil {
  4619  			res.Body.Close()
  4620  		}
  4621  		return nil, &googleapi.Error{
  4622  			Code:   res.StatusCode,
  4623  			Header: res.Header,
  4624  		}
  4625  	}
  4626  	if err != nil {
  4627  		return nil, err
  4628  	}
  4629  	defer googleapi.CloseBody(res)
  4630  	if err := googleapi.CheckResponse(res); err != nil {
  4631  		return nil, err
  4632  	}
  4633  	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4634  	if rx != nil {
  4635  		rx.Client = c.s.client
  4636  		rx.UserAgent = c.s.userAgent()
  4637  		ctx := c.ctx_
  4638  		if ctx == nil {
  4639  			ctx = context.TODO()
  4640  		}
  4641  		res, err = rx.Upload(ctx)
  4642  		if err != nil {
  4643  			return nil, err
  4644  		}
  4645  		defer res.Body.Close()
  4646  		if err := googleapi.CheckResponse(res); err != nil {
  4647  			return nil, err
  4648  		}
  4649  	}
  4650  	ret := &Attachment{
  4651  		ServerResponse: googleapi.ServerResponse{
  4652  			Header:         res.Header,
  4653  			HTTPStatusCode: res.StatusCode,
  4654  		},
  4655  	}
  4656  	target := &ret
  4657  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4658  		return nil, err
  4659  	}
  4660  	return ret, nil
  4661  	// {
  4662  	//   "description": "Adds a new attachment to a timeline item.",
  4663  	//   "httpMethod": "POST",
  4664  	//   "id": "mirror.timeline.attachments.insert",
  4665  	//   "mediaUpload": {
  4666  	//     "accept": [
  4667  	//       "audio/*",
  4668  	//       "image/*",
  4669  	//       "video/*"
  4670  	//     ],
  4671  	//     "maxSize": "10MB",
  4672  	//     "protocols": {
  4673  	//       "resumable": {
  4674  	//         "multipart": true,
  4675  	//         "path": "/resumable/upload/mirror/v1/timeline/{itemId}/attachments"
  4676  	//       },
  4677  	//       "simple": {
  4678  	//         "multipart": true,
  4679  	//         "path": "/upload/mirror/v1/timeline/{itemId}/attachments"
  4680  	//       }
  4681  	//     }
  4682  	//   },
  4683  	//   "parameterOrder": [
  4684  	//     "itemId"
  4685  	//   ],
  4686  	//   "parameters": {
  4687  	//     "itemId": {
  4688  	//       "description": "The ID of the timeline item the attachment belongs to.",
  4689  	//       "location": "path",
  4690  	//       "required": true,
  4691  	//       "type": "string"
  4692  	//     }
  4693  	//   },
  4694  	//   "path": "timeline/{itemId}/attachments",
  4695  	//   "response": {
  4696  	//     "$ref": "Attachment"
  4697  	//   },
  4698  	//   "scopes": [
  4699  	//     "https://www.googleapis.com/auth/glass.timeline"
  4700  	//   ],
  4701  	//   "supportsMediaUpload": true
  4702  	// }
  4703  
  4704  }
  4705  
  4706  // method id "mirror.timeline.attachments.list":
  4707  
  4708  type TimelineAttachmentsListCall struct {
  4709  	s            *Service
  4710  	itemId       string
  4711  	urlParams_   gensupport.URLParams
  4712  	ifNoneMatch_ string
  4713  	ctx_         context.Context
  4714  	header_      http.Header
  4715  }
  4716  
  4717  // List: Returns a list of attachments for a timeline item.
  4718  func (r *TimelineAttachmentsService) List(itemId string) *TimelineAttachmentsListCall {
  4719  	c := &TimelineAttachmentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4720  	c.itemId = itemId
  4721  	return c
  4722  }
  4723  
  4724  // Fields allows partial responses to be retrieved. See
  4725  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4726  // for more information.
  4727  func (c *TimelineAttachmentsListCall) Fields(s ...googleapi.Field) *TimelineAttachmentsListCall {
  4728  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4729  	return c
  4730  }
  4731  
  4732  // IfNoneMatch sets the optional parameter which makes the operation
  4733  // fail if the object's ETag matches the given value. This is useful for
  4734  // getting updates only after the object has changed since the last
  4735  // request. Use googleapi.IsNotModified to check whether the response
  4736  // error from Do is the result of In-None-Match.
  4737  func (c *TimelineAttachmentsListCall) IfNoneMatch(entityTag string) *TimelineAttachmentsListCall {
  4738  	c.ifNoneMatch_ = entityTag
  4739  	return c
  4740  }
  4741  
  4742  // Context sets the context to be used in this call's Do method. Any
  4743  // pending HTTP request will be aborted if the provided context is
  4744  // canceled.
  4745  func (c *TimelineAttachmentsListCall) Context(ctx context.Context) *TimelineAttachmentsListCall {
  4746  	c.ctx_ = ctx
  4747  	return c
  4748  }
  4749  
  4750  // Header returns an http.Header that can be modified by the caller to
  4751  // add HTTP headers to the request.
  4752  func (c *TimelineAttachmentsListCall) Header() http.Header {
  4753  	if c.header_ == nil {
  4754  		c.header_ = make(http.Header)
  4755  	}
  4756  	return c.header_
  4757  }
  4758  
  4759  func (c *TimelineAttachmentsListCall) doRequest(alt string) (*http.Response, error) {
  4760  	reqHeaders := make(http.Header)
  4761  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200317")
  4762  	for k, v := range c.header_ {
  4763  		reqHeaders[k] = v
  4764  	}
  4765  	reqHeaders.Set("User-Agent", c.s.userAgent())
  4766  	if c.ifNoneMatch_ != "" {
  4767  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4768  	}
  4769  	var body io.Reader = nil
  4770  	c.urlParams_.Set("alt", alt)
  4771  	c.urlParams_.Set("prettyPrint", "false")
  4772  	urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments")
  4773  	urls += "?" + c.urlParams_.Encode()
  4774  	req, err := http.NewRequest("GET", urls, body)
  4775  	if err != nil {
  4776  		return nil, err
  4777  	}
  4778  	req.Header = reqHeaders
  4779  	googleapi.Expand(req.URL, map[string]string{
  4780  		"itemId": c.itemId,
  4781  	})
  4782  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4783  }
  4784  
  4785  // Do executes the "mirror.timeline.attachments.list" call.
  4786  // Exactly one of *AttachmentsListResponse or error will be non-nil. Any
  4787  // non-2xx status code is an error. Response headers are in either
  4788  // *AttachmentsListResponse.ServerResponse.Header or (if a response was
  4789  // returned at all) in error.(*googleapi.Error).Header. Use
  4790  // googleapi.IsNotModified to check whether the returned error was
  4791  // because http.StatusNotModified was returned.
  4792  func (c *TimelineAttachmentsListCall) Do(opts ...googleapi.CallOption) (*AttachmentsListResponse, error) {
  4793  	gensupport.SetOptions(c.urlParams_, opts...)
  4794  	res, err := c.doRequest("json")
  4795  	if res != nil && res.StatusCode == http.StatusNotModified {
  4796  		if res.Body != nil {
  4797  			res.Body.Close()
  4798  		}
  4799  		return nil, &googleapi.Error{
  4800  			Code:   res.StatusCode,
  4801  			Header: res.Header,
  4802  		}
  4803  	}
  4804  	if err != nil {
  4805  		return nil, err
  4806  	}
  4807  	defer googleapi.CloseBody(res)
  4808  	if err := googleapi.CheckResponse(res); err != nil {
  4809  		return nil, err
  4810  	}
  4811  	ret := &AttachmentsListResponse{
  4812  		ServerResponse: googleapi.ServerResponse{
  4813  			Header:         res.Header,
  4814  			HTTPStatusCode: res.StatusCode,
  4815  		},
  4816  	}
  4817  	target := &ret
  4818  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4819  		return nil, err
  4820  	}
  4821  	return ret, nil
  4822  	// {
  4823  	//   "description": "Returns a list of attachments for a timeline item.",
  4824  	//   "httpMethod": "GET",
  4825  	//   "id": "mirror.timeline.attachments.list",
  4826  	//   "parameterOrder": [
  4827  	//     "itemId"
  4828  	//   ],
  4829  	//   "parameters": {
  4830  	//     "itemId": {
  4831  	//       "description": "The ID of the timeline item whose attachments should be listed.",
  4832  	//       "location": "path",
  4833  	//       "required": true,
  4834  	//       "type": "string"
  4835  	//     }
  4836  	//   },
  4837  	//   "path": "timeline/{itemId}/attachments",
  4838  	//   "response": {
  4839  	//     "$ref": "AttachmentsListResponse"
  4840  	//   },
  4841  	//   "scopes": [
  4842  	//     "https://www.googleapis.com/auth/glass.timeline"
  4843  	//   ]
  4844  	// }
  4845  
  4846  }
  4847  

View as plain text