~sinzui/ubuntu/vivid/juju-core/vivid-1.24.6

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/mirror/v1/mirror-gen.go

  • Committer: Curtis Hovey
  • Date: 2015-09-30 14:14:54 UTC
  • mfrom: (1.1.34)
  • Revision ID: curtis@hovey.name-20150930141454-o3ldf23dzyjio6c0
Backport of 1.24.6 from wily. (LP: #1500916)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package mirror provides access to the Google Mirror API.
 
2
//
 
3
// See https://developers.google.com/glass
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/mirror/v1"
 
8
//   ...
 
9
//   mirrorService, err := mirror.New(oauthHttpClient)
 
10
package mirror
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
37
const apiId = "mirror:v1"
 
38
const apiName = "mirror"
 
39
const apiVersion = "v1"
 
40
const basePath = "https://www.googleapis.com/mirror/v1/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // View your location
 
45
        GlassLocationScope = "https://www.googleapis.com/auth/glass.location"
 
46
 
 
47
        // View and manage your Glass timeline
 
48
        GlassTimelineScope = "https://www.googleapis.com/auth/glass.timeline"
 
49
)
 
50
 
 
51
func New(client *http.Client) (*Service, error) {
 
52
        if client == nil {
 
53
                return nil, errors.New("client is nil")
 
54
        }
 
55
        s := &Service{client: client, BasePath: basePath}
 
56
        s.Accounts = NewAccountsService(s)
 
57
        s.Contacts = NewContactsService(s)
 
58
        s.Locations = NewLocationsService(s)
 
59
        s.Settings = NewSettingsService(s)
 
60
        s.Subscriptions = NewSubscriptionsService(s)
 
61
        s.Timeline = NewTimelineService(s)
 
62
        return s, nil
 
63
}
 
64
 
 
65
type Service struct {
 
66
        client   *http.Client
 
67
        BasePath string // API endpoint base URL
 
68
 
 
69
        Accounts *AccountsService
 
70
 
 
71
        Contacts *ContactsService
 
72
 
 
73
        Locations *LocationsService
 
74
 
 
75
        Settings *SettingsService
 
76
 
 
77
        Subscriptions *SubscriptionsService
 
78
 
 
79
        Timeline *TimelineService
 
80
}
 
81
 
 
82
func NewAccountsService(s *Service) *AccountsService {
 
83
        rs := &AccountsService{s: s}
 
84
        return rs
 
85
}
 
86
 
 
87
type AccountsService struct {
 
88
        s *Service
 
89
}
 
90
 
 
91
func NewContactsService(s *Service) *ContactsService {
 
92
        rs := &ContactsService{s: s}
 
93
        return rs
 
94
}
 
95
 
 
96
type ContactsService struct {
 
97
        s *Service
 
98
}
 
99
 
 
100
func NewLocationsService(s *Service) *LocationsService {
 
101
        rs := &LocationsService{s: s}
 
102
        return rs
 
103
}
 
104
 
 
105
type LocationsService struct {
 
106
        s *Service
 
107
}
 
108
 
 
109
func NewSettingsService(s *Service) *SettingsService {
 
110
        rs := &SettingsService{s: s}
 
111
        return rs
 
112
}
 
113
 
 
114
type SettingsService struct {
 
115
        s *Service
 
116
}
 
117
 
 
118
func NewSubscriptionsService(s *Service) *SubscriptionsService {
 
119
        rs := &SubscriptionsService{s: s}
 
120
        return rs
 
121
}
 
122
 
 
123
type SubscriptionsService struct {
 
124
        s *Service
 
125
}
 
126
 
 
127
func NewTimelineService(s *Service) *TimelineService {
 
128
        rs := &TimelineService{s: s}
 
129
        rs.Attachments = NewTimelineAttachmentsService(s)
 
130
        return rs
 
131
}
 
132
 
 
133
type TimelineService struct {
 
134
        s *Service
 
135
 
 
136
        Attachments *TimelineAttachmentsService
 
137
}
 
138
 
 
139
func NewTimelineAttachmentsService(s *Service) *TimelineAttachmentsService {
 
140
        rs := &TimelineAttachmentsService{s: s}
 
141
        return rs
 
142
}
 
143
 
 
144
type TimelineAttachmentsService struct {
 
145
        s *Service
 
146
}
 
147
 
 
148
type Account struct {
 
149
        AuthTokens []*AuthToken `json:"authTokens,omitempty"`
 
150
 
 
151
        Features []string `json:"features,omitempty"`
 
152
 
 
153
        Password string `json:"password,omitempty"`
 
154
 
 
155
        UserData []*UserData `json:"userData,omitempty"`
 
156
}
 
157
 
 
158
type Attachment struct {
 
159
        // ContentType: The MIME type of the attachment.
 
160
        ContentType string `json:"contentType,omitempty"`
 
161
 
 
162
        // ContentUrl: The URL for the content.
 
163
        ContentUrl string `json:"contentUrl,omitempty"`
 
164
 
 
165
        // Id: The ID of the attachment.
 
166
        Id string `json:"id,omitempty"`
 
167
 
 
168
        // IsProcessingContent: Indicates that the contentUrl is not available
 
169
        // because the attachment content is still being processed. If the
 
170
        // caller wishes to retrieve the content, it should try again later.
 
171
        IsProcessingContent bool `json:"isProcessingContent,omitempty"`
 
172
}
 
173
 
 
174
type AttachmentsListResponse struct {
 
175
        // Items: The list of attachments.
 
176
        Items []*Attachment `json:"items,omitempty"`
 
177
 
 
178
        // Kind: The type of resource. This is always mirror#attachmentsList.
 
179
        Kind string `json:"kind,omitempty"`
 
180
}
 
181
 
 
182
type AuthToken struct {
 
183
        AuthToken string `json:"authToken,omitempty"`
 
184
 
 
185
        Type string `json:"type,omitempty"`
 
186
}
 
187
 
 
188
type Command struct {
 
189
        // Type: The type of operation this command corresponds to. Allowed
 
190
        // values are:
 
191
        // - TAKE_A_NOTE - Shares a timeline item with the
 
192
        // transcription of user speech from the "Take a note" voice menu
 
193
        // command.
 
194
        // - POST_AN_UPDATE - Shares a timeline item with the
 
195
        // transcription of user speech from the "Post an update" voice menu
 
196
        // command.
 
197
        Type string `json:"type,omitempty"`
 
198
}
 
199
 
 
200
type Contact struct {
 
201
        // AcceptCommands: A list of voice menu commands that a contact can
 
202
        // handle. Glass shows up to three contacts for each voice menu command.
 
203
        // If there are more than that, the three contacts with the highest
 
204
        // priority are shown for that particular command.
 
205
        AcceptCommands []*Command `json:"acceptCommands,omitempty"`
 
206
 
 
207
        // AcceptTypes: A list of MIME types that a contact supports. The
 
208
        // contact will be shown to the user if any of its acceptTypes matches
 
209
        // any of the types of the attachments on the item. If no acceptTypes
 
210
        // are given, the contact will be shown for all items.
 
211
        AcceptTypes []string `json:"acceptTypes,omitempty"`
 
212
 
 
213
        // DisplayName: The name to display for this contact.
 
214
        DisplayName string `json:"displayName,omitempty"`
 
215
 
 
216
        // Id: An ID for this contact. This is generated by the application and
 
217
        // is treated as an opaque token.
 
218
        Id string `json:"id,omitempty"`
 
219
 
 
220
        // ImageUrls: Set of image URLs to display for a contact. Most contacts
 
221
        // will have a single image, but a "group" contact may include up to 8
 
222
        // image URLs and they will be resized and cropped into a mosaic on the
 
223
        // client.
 
224
        ImageUrls []string `json:"imageUrls,omitempty"`
 
225
 
 
226
        // Kind: The type of resource. This is always mirror#contact.
 
227
        Kind string `json:"kind,omitempty"`
 
228
 
 
229
        // PhoneNumber: Primary phone number for the contact. This can be a
 
230
        // fully-qualified number, with country calling code and area code, or a
 
231
        // local number.
 
232
        PhoneNumber string `json:"phoneNumber,omitempty"`
 
233
 
 
234
        // Priority: Priority for the contact to determine ordering in a list of
 
235
        // contacts. Contacts with higher priorities will be shown before ones
 
236
        // with lower priorities.
 
237
        Priority int64 `json:"priority,omitempty"`
 
238
 
 
239
        // SharingFeatures: A list of sharing features that a contact can
 
240
        // handle. Allowed values are:
 
241
        // - ADD_CAPTION
 
242
        SharingFeatures []string `json:"sharingFeatures,omitempty"`
 
243
 
 
244
        // Source: The ID of the application that created this contact. This is
 
245
        // populated by the API
 
246
        Source string `json:"source,omitempty"`
 
247
 
 
248
        // SpeakableName: Name of this contact as it should be pronounced. If
 
249
        // this contact's name must be spoken as part of a voice disambiguation
 
250
        // menu, this name is used as the expected pronunciation. This is useful
 
251
        // for contact names with unpronounceable characters or whose display
 
252
        // spelling is otherwise not phonetic.
 
253
        SpeakableName string `json:"speakableName,omitempty"`
 
254
 
 
255
        // Type: The type for this contact. This is used for sorting in UIs.
 
256
        // Allowed values are:
 
257
        // - INDIVIDUAL - Represents a single person. This
 
258
        // is the default.
 
259
        // - GROUP - Represents more than a single person.
 
260
        Type string `json:"type,omitempty"`
 
261
}
 
262
 
 
263
type ContactsListResponse struct {
 
264
        // Items: Contact list.
 
265
        Items []*Contact `json:"items,omitempty"`
 
266
 
 
267
        // Kind: The type of resource. This is always mirror#contacts.
 
268
        Kind string `json:"kind,omitempty"`
 
269
}
 
270
 
 
271
type Location struct {
 
272
        // Accuracy: The accuracy of the location fix in meters.
 
273
        Accuracy float64 `json:"accuracy,omitempty"`
 
274
 
 
275
        // Address: The full address of the location.
 
276
        Address string `json:"address,omitempty"`
 
277
 
 
278
        // DisplayName: The name to be displayed. This may be a business name or
 
279
        // a user-defined place, such as "Home".
 
280
        DisplayName string `json:"displayName,omitempty"`
 
281
 
 
282
        // Id: The ID of the location.
 
283
        Id string `json:"id,omitempty"`
 
284
 
 
285
        // Kind: The type of resource. This is always mirror#location.
 
286
        Kind string `json:"kind,omitempty"`
 
287
 
 
288
        // Latitude: The latitude, in degrees.
 
289
        Latitude float64 `json:"latitude,omitempty"`
 
290
 
 
291
        // Longitude: The longitude, in degrees.
 
292
        Longitude float64 `json:"longitude,omitempty"`
 
293
 
 
294
        // Timestamp: The time at which this location was captured, formatted
 
295
        // according to RFC 3339.
 
296
        Timestamp string `json:"timestamp,omitempty"`
 
297
}
 
298
 
 
299
type LocationsListResponse struct {
 
300
        // Items: The list of locations.
 
301
        Items []*Location `json:"items,omitempty"`
 
302
 
 
303
        // Kind: The type of resource. This is always mirror#locationsList.
 
304
        Kind string `json:"kind,omitempty"`
 
305
}
 
306
 
 
307
type MenuItem struct {
 
308
        // Action: Controls the behavior when the user picks the menu option.
 
309
        // Allowed values are:
 
310
        // - CUSTOM - Custom action set by the service.
 
311
        // When the user selects this menuItem, the API triggers a notification
 
312
        // to your callbackUrl with the userActions.type set to CUSTOM and the
 
313
        // userActions.payload set to the ID of this menu item. This is the
 
314
        // default value.
 
315
        // - Built-in actions:
 
316
        // - REPLY - Initiate a reply to
 
317
        // the timeline item using the voice recording UI. The creator attribute
 
318
        // must be set in the timeline item for this menu to be available.
 
319
        // -
 
320
        // REPLY_ALL - Same behavior as REPLY. The original timeline item's
 
321
        // recipients will be added to the reply item.
 
322
        // - DELETE - Delete the
 
323
        // timeline item.
 
324
        // - SHARE - Share the timeline item with the available
 
325
        // contacts.
 
326
        // - READ_ALOUD - Read the timeline item's speakableText
 
327
        // aloud; if this field is not set, read the text field; if none of
 
328
        // those fields are set, this menu item is ignored.
 
329
        // - GET_MEDIA_INPUT -
 
330
        // Allow users to provide media payloads to Glassware from a menu item
 
331
        // (currently, only transcribed text from voice input is supported).
 
332
        // Subscribe to notifications when users invoke this menu item to
 
333
        // receive the timeline item ID. Retrieve the media from the timeline
 
334
        // item in the payload property.
 
335
        // - VOICE_CALL - Initiate a phone call
 
336
        // using the timeline item's creator.phoneNumber attribute as recipient.
 
337
        //
 
338
        // - NAVIGATE - Navigate to the timeline item's location.
 
339
        // -
 
340
        // TOGGLE_PINNED - Toggle the isPinned state of the timeline item.
 
341
        // -
 
342
        // OPEN_URI - Open the payload of the menu item in the browser.
 
343
        // -
 
344
        // PLAY_VIDEO - Open the payload of the menu item in the Glass video
 
345
        // player.
 
346
        // - SEND_MESSAGE - Initiate sending a message to the timeline
 
347
        // item's creator:
 
348
        // - If the creator.phoneNumber is set and Glass is
 
349
        // connected to an Android phone, the message is an SMS.
 
350
        // - Otherwise,
 
351
        // if the creator.email is set, the message is an email.
 
352
        Action string `json:"action,omitempty"`
 
353
 
 
354
        // Contextual_command: The ContextualMenus.Command associated with this
 
355
        // MenuItem (e.g. READ_ALOUD). The voice label for this command will be
 
356
        // displayed in the voice menu and the touch label will be displayed in
 
357
        // the touch menu. Note that the default menu value's display name will
 
358
        // be overriden if you specify this property. Values that do not
 
359
        // correspond to a ContextualMenus.Command name will be ignored.
 
360
        Contextual_command string `json:"contextual_command,omitempty"`
 
361
 
 
362
        // Id: The ID for this menu item. This is generated by the application
 
363
        // and is treated as an opaque token.
 
364
        Id string `json:"id,omitempty"`
 
365
 
 
366
        // Payload: A generic payload whose meaning changes depending on this
 
367
        // MenuItem's action.
 
368
        // - When the action is OPEN_URI, the payload is
 
369
        // the URL of the website to view.
 
370
        // - When the action is PLAY_VIDEO, the
 
371
        // payload is the streaming URL of the video
 
372
        // - When the action is
 
373
        // GET_MEDIA_INPUT, the payload is the text transcription of a user's
 
374
        // speech input
 
375
        Payload string `json:"payload,omitempty"`
 
376
 
 
377
        // RemoveWhenSelected: If set to true on a CUSTOM menu item, that item
 
378
        // will be removed from the menu after it is selected.
 
379
        RemoveWhenSelected bool `json:"removeWhenSelected,omitempty"`
 
380
 
 
381
        // Values: For CUSTOM items, a list of values controlling the appearance
 
382
        // of the menu item in each of its states. A value for the DEFAULT state
 
383
        // must be provided. If the PENDING or CONFIRMED states are missing,
 
384
        // they will not be shown.
 
385
        Values []*MenuValue `json:"values,omitempty"`
 
386
}
 
387
 
 
388
type MenuValue struct {
 
389
        // DisplayName: The name to display for the menu item. If you specify
 
390
        // this property for a built-in menu item, the default contextual voice
 
391
        // command for that menu item is not shown.
 
392
        DisplayName string `json:"displayName,omitempty"`
 
393
 
 
394
        // IconUrl: URL of an icon to display with the menu item.
 
395
        IconUrl string `json:"iconUrl,omitempty"`
 
396
 
 
397
        // State: The state that this value applies to. Allowed values are:
 
398
        // -
 
399
        // DEFAULT - Default value shown when displayed in the menuItems list.
 
400
        //
 
401
        // - PENDING - Value shown when the menuItem has been selected by the
 
402
        // user but can still be cancelled.
 
403
        // - CONFIRMED - Value shown when the
 
404
        // menuItem has been selected by the user and can no longer be
 
405
        // cancelled.
 
406
        State string `json:"state,omitempty"`
 
407
}
 
408
 
 
409
type Notification struct {
 
410
        // Collection: The collection that generated the notification.
 
411
        Collection string `json:"collection,omitempty"`
 
412
 
 
413
        // ItemId: The ID of the item that generated the notification.
 
414
        ItemId string `json:"itemId,omitempty"`
 
415
 
 
416
        // Operation: The type of operation that generated the notification.
 
417
        Operation string `json:"operation,omitempty"`
 
418
 
 
419
        // UserActions: A list of actions taken by the user that triggered the
 
420
        // notification.
 
421
        UserActions []*UserAction `json:"userActions,omitempty"`
 
422
 
 
423
        // UserToken: The user token provided by the service when it subscribed
 
424
        // for notifications.
 
425
        UserToken string `json:"userToken,omitempty"`
 
426
 
 
427
        // VerifyToken: The secret verify token provided by the service when it
 
428
        // subscribed for notifications.
 
429
        VerifyToken string `json:"verifyToken,omitempty"`
 
430
}
 
431
 
 
432
type NotificationConfig struct {
 
433
        // DeliveryTime: The time at which the notification should be delivered.
 
434
        DeliveryTime string `json:"deliveryTime,omitempty"`
 
435
 
 
436
        // Level: Describes how important the notification is. Allowed values
 
437
        // are:
 
438
        // - DEFAULT - Notifications of default importance. A chime will
 
439
        // be played to alert users.
 
440
        Level string `json:"level,omitempty"`
 
441
}
 
442
 
 
443
type Setting struct {
 
444
        // Id: The setting's ID. The following IDs are valid:
 
445
        // - locale - The
 
446
        // key to the user’s language/locale (BCP 47 identifier) that
 
447
        // Glassware should use to render localized content.
 
448
        // - timezone - The
 
449
        // key to the user’s current time zone region as defined in the tz
 
450
        // database. Example: America/Los_Angeles.
 
451
        Id string `json:"id,omitempty"`
 
452
 
 
453
        // Kind: The type of resource. This is always mirror#setting.
 
454
        Kind string `json:"kind,omitempty"`
 
455
 
 
456
        // Value: The setting value, as a string.
 
457
        Value string `json:"value,omitempty"`
 
458
}
 
459
 
 
460
type Subscription struct {
 
461
        // CallbackUrl: The URL where notifications should be delivered (must
 
462
        // start with https://).
 
463
        CallbackUrl string `json:"callbackUrl,omitempty"`
 
464
 
 
465
        // Collection: The collection to subscribe to. Allowed values are:
 
466
        // -
 
467
        // timeline - Changes in the timeline including insertion, deletion, and
 
468
        // updates.
 
469
        // - locations - Location updates.
 
470
        // - settings - Settings
 
471
        // updates.
 
472
        Collection string `json:"collection,omitempty"`
 
473
 
 
474
        // Id: The ID of the subscription.
 
475
        Id string `json:"id,omitempty"`
 
476
 
 
477
        // Kind: The type of resource. This is always mirror#subscription.
 
478
        Kind string `json:"kind,omitempty"`
 
479
 
 
480
        // Notification: Container object for notifications. This is not
 
481
        // populated in the Subscription resource.
 
482
        Notification *Notification `json:"notification,omitempty"`
 
483
 
 
484
        // Operation: A list of operations that should be subscribed to. An
 
485
        // empty list indicates that all operations on the collection should be
 
486
        // subscribed to. Allowed values are:
 
487
        // - UPDATE - The item has been
 
488
        // updated.
 
489
        // - INSERT - A new item has been inserted.
 
490
        // - DELETE - The
 
491
        // item has been deleted.
 
492
        // - MENU_ACTION - A custom menu item has been
 
493
        // triggered by the user.
 
494
        Operation []string `json:"operation,omitempty"`
 
495
 
 
496
        // Updated: The time at which this subscription was last modified,
 
497
        // formatted according to RFC 3339.
 
498
        Updated string `json:"updated,omitempty"`
 
499
 
 
500
        // UserToken: An opaque token sent to the subscriber in notifications so
 
501
        // that it can determine the ID of the user.
 
502
        UserToken string `json:"userToken,omitempty"`
 
503
 
 
504
        // VerifyToken: A secret token sent to the subscriber in notifications
 
505
        // so that it can verify that the notification was generated by Google.
 
506
        VerifyToken string `json:"verifyToken,omitempty"`
 
507
}
 
508
 
 
509
type SubscriptionsListResponse struct {
 
510
        // Items: The list of subscriptions.
 
511
        Items []*Subscription `json:"items,omitempty"`
 
512
 
 
513
        // Kind: The type of resource. This is always mirror#subscriptionsList.
 
514
        Kind string `json:"kind,omitempty"`
 
515
}
 
516
 
 
517
type TimelineItem struct {
 
518
        // Attachments: A list of media attachments associated with this item.
 
519
        // As a convenience, you can refer to attachments in your HTML payloads
 
520
        // with the attachment or cid scheme. For example:
 
521
        // - attachment: <img
 
522
        // src="attachment:attachment_index"> where attachment_index is the
 
523
        // 0-based index of this array.
 
524
        // - cid: <img src="cid:attachment_id">
 
525
        // where attachment_id is the ID of the attachment.
 
526
        Attachments []*Attachment `json:"attachments,omitempty"`
 
527
 
 
528
        // BundleId: The bundle ID for this item. Services can specify a
 
529
        // bundleId to group many items together. They appear under a single
 
530
        // top-level item on the device.
 
531
        BundleId string `json:"bundleId,omitempty"`
 
532
 
 
533
        // CanonicalUrl: A canonical URL pointing to the canonical/high quality
 
534
        // version of the data represented by the timeline item.
 
535
        CanonicalUrl string `json:"canonicalUrl,omitempty"`
 
536
 
 
537
        // Created: The time at which this item was created, formatted according
 
538
        // to RFC 3339.
 
539
        Created string `json:"created,omitempty"`
 
540
 
 
541
        // Creator: The user or group that created this item.
 
542
        Creator *Contact `json:"creator,omitempty"`
 
543
 
 
544
        // DisplayTime: The time that should be displayed when this item is
 
545
        // viewed in the timeline, formatted according to RFC 3339. This user's
 
546
        // timeline is sorted chronologically on display time, so this will also
 
547
        // determine where the item is displayed in the timeline. If not set by
 
548
        // the service, the display time defaults to the updated time.
 
549
        DisplayTime string `json:"displayTime,omitempty"`
 
550
 
 
551
        // Etag: ETag for this item.
 
552
        Etag string `json:"etag,omitempty"`
 
553
 
 
554
        // Html: HTML content for this item. If both text and html are provided
 
555
        // for an item, the html will be rendered in the timeline.
 
556
        // Allowed HTML
 
557
        // elements - You can use these elements in your timeline cards.
 
558
        //
 
559
        // -
 
560
        // Headers: h1, h2, h3, h4, h5, h6
 
561
        // - Images: img
 
562
        // - Lists: li, ol, ul
 
563
        //
 
564
        // - HTML5 semantics: article, aside, details, figure, figcaption,
 
565
        // footer, header, nav, section, summary, time
 
566
        // - Structural:
 
567
        // blockquote, br, div, hr, p, span
 
568
        // - Style: b, big, center, em, i, u,
 
569
        // s, small, strike, strong, style, sub, sup
 
570
        // - Tables: table, tbody,
 
571
        // td, tfoot, th, thead, tr
 
572
        // Blocked HTML elements: These elements and
 
573
        // their contents are removed from HTML payloads.
 
574
        //
 
575
        // - Document headers:
 
576
        // head, title
 
577
        // - Embeds: audio, embed, object, source, video
 
578
        // - Frames:
 
579
        // frame, frameset
 
580
        // - Scripting: applet, script
 
581
        // Other elements: Any
 
582
        // elements that aren't listed are removed, but their contents are
 
583
        // preserved.
 
584
        Html string `json:"html,omitempty"`
 
585
 
 
586
        // Id: The ID of the timeline item. This is unique within a user's
 
587
        // timeline.
 
588
        Id string `json:"id,omitempty"`
 
589
 
 
590
        // InReplyTo: If this item was generated as a reply to another item,
 
591
        // this field will be set to the ID of the item being replied to. This
 
592
        // can be used to attach a reply to the appropriate conversation or
 
593
        // post.
 
594
        InReplyTo string `json:"inReplyTo,omitempty"`
 
595
 
 
596
        // IsBundleCover: Whether this item is a bundle cover.
 
597
        //
 
598
        // If an item is
 
599
        // marked as a bundle cover, it will be the entry point to the bundle of
 
600
        // items that have the same bundleId as that item. It will be shown only
 
601
        // on the main timeline — not within the opened bundle.
 
602
        //
 
603
        // On the main
 
604
        // timeline, items that are shown are:
 
605
        // - Items that have isBundleCover
 
606
        // set to true
 
607
        // - Items that do not have a bundleId  In a bundle
 
608
        // sub-timeline, items that are shown are:
 
609
        // - Items that have the
 
610
        // bundleId in question AND isBundleCover set to false
 
611
        IsBundleCover bool `json:"isBundleCover,omitempty"`
 
612
 
 
613
        // IsDeleted: When true, indicates this item is deleted, and only the ID
 
614
        // property is set.
 
615
        IsDeleted bool `json:"isDeleted,omitempty"`
 
616
 
 
617
        // IsPinned: When true, indicates this item is pinned, which means it's
 
618
        // grouped alongside "active" items like navigation and hangouts, on the
 
619
        // opposite side of the home screen from historical (non-pinned)
 
620
        // timeline items. You can allow the user to toggle the value of this
 
621
        // property with the TOGGLE_PINNED built-in menu item.
 
622
        IsPinned bool `json:"isPinned,omitempty"`
 
623
 
 
624
        // Kind: The type of resource. This is always mirror#timelineItem.
 
625
        Kind string `json:"kind,omitempty"`
 
626
 
 
627
        // Location: The geographic location associated with this item.
 
628
        Location *Location `json:"location,omitempty"`
 
629
 
 
630
        // MenuItems: A list of menu items that will be presented to the user
 
631
        // when this item is selected in the timeline.
 
632
        MenuItems []*MenuItem `json:"menuItems,omitempty"`
 
633
 
 
634
        // Notification: Controls how notifications for this item are presented
 
635
        // on the device. If this is missing, no notification will be generated.
 
636
        Notification *NotificationConfig `json:"notification,omitempty"`
 
637
 
 
638
        // PinScore: For pinned items, this determines the order in which the
 
639
        // item is displayed in the timeline, with a higher score appearing
 
640
        // closer to the clock. Note: setting this field is currently not
 
641
        // supported.
 
642
        PinScore int64 `json:"pinScore,omitempty"`
 
643
 
 
644
        // Recipients: A list of users or groups that this item has been shared
 
645
        // with.
 
646
        Recipients []*Contact `json:"recipients,omitempty"`
 
647
 
 
648
        // SelfLink: A URL that can be used to retrieve this item.
 
649
        SelfLink string `json:"selfLink,omitempty"`
 
650
 
 
651
        // SourceItemId: Opaque string you can use to map a timeline item to
 
652
        // data in your own service.
 
653
        SourceItemId string `json:"sourceItemId,omitempty"`
 
654
 
 
655
        // SpeakableText: The speakable version of the content of this item.
 
656
        // Along with the READ_ALOUD menu item, use this field to provide text
 
657
        // that would be clearer when read aloud, or to provide extended
 
658
        // information to what is displayed visually on Glass.
 
659
        //
 
660
        // Glassware should
 
661
        // also specify the speakableType field, which will be spoken before
 
662
        // this text in cases where the additional context is useful, for
 
663
        // example when the user requests that the item be read aloud following
 
664
        // a notification.
 
665
        SpeakableText string `json:"speakableText,omitempty"`
 
666
 
 
667
        // SpeakableType: A speakable description of the type of this item. This
 
668
        // will be announced to the user prior to reading the content of the
 
669
        // item in cases where the additional context is useful, for example
 
670
        // when the user requests that the item be read aloud following a
 
671
        // notification.
 
672
        //
 
673
        // This should be a short, simple noun phrase such as
 
674
        // "Email", "Text message", or "Daily Planet News Update".
 
675
        //
 
676
        // Glassware
 
677
        // are encouraged to populate this field for every timeline item, even
 
678
        // if the item does not contain speakableText or text so that the user
 
679
        // can learn the type of the item without looking at the screen.
 
680
        SpeakableType string `json:"speakableType,omitempty"`
 
681
 
 
682
        // Text: Text content of this item.
 
683
        Text string `json:"text,omitempty"`
 
684
 
 
685
        // Title: The title of this item.
 
686
        Title string `json:"title,omitempty"`
 
687
 
 
688
        // Updated: The time at which this item was last modified, formatted
 
689
        // according to RFC 3339.
 
690
        Updated string `json:"updated,omitempty"`
 
691
}
 
692
 
 
693
type TimelineListResponse struct {
 
694
        // Items: Items in the timeline.
 
695
        Items []*TimelineItem `json:"items,omitempty"`
 
696
 
 
697
        // Kind: The type of resource. This is always mirror#timeline.
 
698
        Kind string `json:"kind,omitempty"`
 
699
 
 
700
        // NextPageToken: The next page token. Provide this as the pageToken
 
701
        // parameter in the request to retrieve the next page of results.
 
702
        NextPageToken string `json:"nextPageToken,omitempty"`
 
703
}
 
704
 
 
705
type UserAction struct {
 
706
        // Payload: An optional payload for the action.
 
707
        //
 
708
        // For actions of type
 
709
        // CUSTOM, this is the ID of the custom menu item that was selected.
 
710
        Payload string `json:"payload,omitempty"`
 
711
 
 
712
        // Type: The type of action. The value of this can be:
 
713
        // - SHARE - the
 
714
        // user shared an item.
 
715
        // - REPLY - the user replied to an item.
 
716
        // -
 
717
        // REPLY_ALL - the user replied to all recipients of an item.
 
718
        // - CUSTOM
 
719
        // - the user selected a custom menu item on the timeline item.
 
720
        // -
 
721
        // DELETE - the user deleted the item.
 
722
        // - PIN - the user pinned the
 
723
        // item.
 
724
        // - UNPIN - the user unpinned the item.
 
725
        // - LAUNCH - the user
 
726
        // initiated a voice command.  In the future, additional types may be
 
727
        // added. UserActions with unrecognized types should be ignored.
 
728
        Type string `json:"type,omitempty"`
 
729
}
 
730
 
 
731
type UserData struct {
 
732
        Key string `json:"key,omitempty"`
 
733
 
 
734
        Value string `json:"value,omitempty"`
 
735
}
 
736
 
 
737
// method id "mirror.accounts.insert":
 
738
 
 
739
type AccountsInsertCall struct {
 
740
        s           *Service
 
741
        userToken   string
 
742
        accountType string
 
743
        accountName string
 
744
        account     *Account
 
745
        opt_        map[string]interface{}
 
746
}
 
747
 
 
748
// Insert: Inserts a new account for a user
 
749
func (r *AccountsService) Insert(userToken string, accountType string, accountName string, account *Account) *AccountsInsertCall {
 
750
        c := &AccountsInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
751
        c.userToken = userToken
 
752
        c.accountType = accountType
 
753
        c.accountName = accountName
 
754
        c.account = account
 
755
        return c
 
756
}
 
757
 
 
758
// Fields allows partial responses to be retrieved.
 
759
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
760
// for more information.
 
761
func (c *AccountsInsertCall) Fields(s ...googleapi.Field) *AccountsInsertCall {
 
762
        c.opt_["fields"] = googleapi.CombineFields(s)
 
763
        return c
 
764
}
 
765
 
 
766
func (c *AccountsInsertCall) Do() (*Account, error) {
 
767
        var body io.Reader = nil
 
768
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
 
769
        if err != nil {
 
770
                return nil, err
 
771
        }
 
772
        ctype := "application/json"
 
773
        params := make(url.Values)
 
774
        params.Set("alt", "json")
 
775
        if v, ok := c.opt_["fields"]; ok {
 
776
                params.Set("fields", fmt.Sprintf("%v", v))
 
777
        }
 
778
        urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/{userToken}/{accountType}/{accountName}")
 
779
        urls += "?" + params.Encode()
 
780
        req, _ := http.NewRequest("POST", urls, body)
 
781
        googleapi.Expand(req.URL, map[string]string{
 
782
                "userToken":   c.userToken,
 
783
                "accountType": c.accountType,
 
784
                "accountName": c.accountName,
 
785
        })
 
786
        req.Header.Set("Content-Type", ctype)
 
787
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
788
        res, err := c.s.client.Do(req)
 
789
        if err != nil {
 
790
                return nil, err
 
791
        }
 
792
        defer googleapi.CloseBody(res)
 
793
        if err := googleapi.CheckResponse(res); err != nil {
 
794
                return nil, err
 
795
        }
 
796
        var ret *Account
 
797
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
798
                return nil, err
 
799
        }
 
800
        return ret, nil
 
801
        // {
 
802
        //   "description": "Inserts a new account for a user",
 
803
        //   "httpMethod": "POST",
 
804
        //   "id": "mirror.accounts.insert",
 
805
        //   "parameterOrder": [
 
806
        //     "userToken",
 
807
        //     "accountType",
 
808
        //     "accountName"
 
809
        //   ],
 
810
        //   "parameters": {
 
811
        //     "accountName": {
 
812
        //       "description": "The name of the account to be passed to the Android Account Manager.",
 
813
        //       "location": "path",
 
814
        //       "required": true,
 
815
        //       "type": "string"
 
816
        //     },
 
817
        //     "accountType": {
 
818
        //       "description": "Account type to be passed to Android Account Manager.",
 
819
        //       "location": "path",
 
820
        //       "required": true,
 
821
        //       "type": "string"
 
822
        //     },
 
823
        //     "userToken": {
 
824
        //       "description": "The ID for the user.",
 
825
        //       "location": "path",
 
826
        //       "required": true,
 
827
        //       "type": "string"
 
828
        //     }
 
829
        //   },
 
830
        //   "path": "accounts/{userToken}/{accountType}/{accountName}",
 
831
        //   "request": {
 
832
        //     "$ref": "Account"
 
833
        //   },
 
834
        //   "response": {
 
835
        //     "$ref": "Account"
 
836
        //   }
 
837
        // }
 
838
 
 
839
}
 
840
 
 
841
// method id "mirror.contacts.delete":
 
842
 
 
843
type ContactsDeleteCall struct {
 
844
        s    *Service
 
845
        id   string
 
846
        opt_ map[string]interface{}
 
847
}
 
848
 
 
849
// Delete: Deletes a contact.
 
850
func (r *ContactsService) Delete(id string) *ContactsDeleteCall {
 
851
        c := &ContactsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
852
        c.id = id
 
853
        return c
 
854
}
 
855
 
 
856
// Fields allows partial responses to be retrieved.
 
857
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
858
// for more information.
 
859
func (c *ContactsDeleteCall) Fields(s ...googleapi.Field) *ContactsDeleteCall {
 
860
        c.opt_["fields"] = googleapi.CombineFields(s)
 
861
        return c
 
862
}
 
863
 
 
864
func (c *ContactsDeleteCall) Do() error {
 
865
        var body io.Reader = nil
 
866
        params := make(url.Values)
 
867
        params.Set("alt", "json")
 
868
        if v, ok := c.opt_["fields"]; ok {
 
869
                params.Set("fields", fmt.Sprintf("%v", v))
 
870
        }
 
871
        urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
 
872
        urls += "?" + params.Encode()
 
873
        req, _ := http.NewRequest("DELETE", urls, body)
 
874
        googleapi.Expand(req.URL, map[string]string{
 
875
                "id": c.id,
 
876
        })
 
877
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
878
        res, err := c.s.client.Do(req)
 
879
        if err != nil {
 
880
                return err
 
881
        }
 
882
        defer googleapi.CloseBody(res)
 
883
        if err := googleapi.CheckResponse(res); err != nil {
 
884
                return err
 
885
        }
 
886
        return nil
 
887
        // {
 
888
        //   "description": "Deletes a contact.",
 
889
        //   "httpMethod": "DELETE",
 
890
        //   "id": "mirror.contacts.delete",
 
891
        //   "parameterOrder": [
 
892
        //     "id"
 
893
        //   ],
 
894
        //   "parameters": {
 
895
        //     "id": {
 
896
        //       "description": "The ID of the contact.",
 
897
        //       "location": "path",
 
898
        //       "required": true,
 
899
        //       "type": "string"
 
900
        //     }
 
901
        //   },
 
902
        //   "path": "contacts/{id}",
 
903
        //   "scopes": [
 
904
        //     "https://www.googleapis.com/auth/glass.timeline"
 
905
        //   ]
 
906
        // }
 
907
 
 
908
}
 
909
 
 
910
// method id "mirror.contacts.get":
 
911
 
 
912
type ContactsGetCall struct {
 
913
        s    *Service
 
914
        id   string
 
915
        opt_ map[string]interface{}
 
916
}
 
917
 
 
918
// Get: Gets a single contact by ID.
 
919
func (r *ContactsService) Get(id string) *ContactsGetCall {
 
920
        c := &ContactsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
921
        c.id = id
 
922
        return c
 
923
}
 
924
 
 
925
// Fields allows partial responses to be retrieved.
 
926
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
927
// for more information.
 
928
func (c *ContactsGetCall) Fields(s ...googleapi.Field) *ContactsGetCall {
 
929
        c.opt_["fields"] = googleapi.CombineFields(s)
 
930
        return c
 
931
}
 
932
 
 
933
func (c *ContactsGetCall) Do() (*Contact, error) {
 
934
        var body io.Reader = nil
 
935
        params := make(url.Values)
 
936
        params.Set("alt", "json")
 
937
        if v, ok := c.opt_["fields"]; ok {
 
938
                params.Set("fields", fmt.Sprintf("%v", v))
 
939
        }
 
940
        urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
 
941
        urls += "?" + params.Encode()
 
942
        req, _ := http.NewRequest("GET", urls, body)
 
943
        googleapi.Expand(req.URL, map[string]string{
 
944
                "id": c.id,
 
945
        })
 
946
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
947
        res, err := c.s.client.Do(req)
 
948
        if err != nil {
 
949
                return nil, err
 
950
        }
 
951
        defer googleapi.CloseBody(res)
 
952
        if err := googleapi.CheckResponse(res); err != nil {
 
953
                return nil, err
 
954
        }
 
955
        var ret *Contact
 
956
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
957
                return nil, err
 
958
        }
 
959
        return ret, nil
 
960
        // {
 
961
        //   "description": "Gets a single contact by ID.",
 
962
        //   "httpMethod": "GET",
 
963
        //   "id": "mirror.contacts.get",
 
964
        //   "parameterOrder": [
 
965
        //     "id"
 
966
        //   ],
 
967
        //   "parameters": {
 
968
        //     "id": {
 
969
        //       "description": "The ID of the contact.",
 
970
        //       "location": "path",
 
971
        //       "required": true,
 
972
        //       "type": "string"
 
973
        //     }
 
974
        //   },
 
975
        //   "path": "contacts/{id}",
 
976
        //   "response": {
 
977
        //     "$ref": "Contact"
 
978
        //   },
 
979
        //   "scopes": [
 
980
        //     "https://www.googleapis.com/auth/glass.timeline"
 
981
        //   ]
 
982
        // }
 
983
 
 
984
}
 
985
 
 
986
// method id "mirror.contacts.insert":
 
987
 
 
988
type ContactsInsertCall struct {
 
989
        s       *Service
 
990
        contact *Contact
 
991
        opt_    map[string]interface{}
 
992
}
 
993
 
 
994
// Insert: Inserts a new contact.
 
995
func (r *ContactsService) Insert(contact *Contact) *ContactsInsertCall {
 
996
        c := &ContactsInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
997
        c.contact = contact
 
998
        return c
 
999
}
 
1000
 
 
1001
// Fields allows partial responses to be retrieved.
 
1002
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1003
// for more information.
 
1004
func (c *ContactsInsertCall) Fields(s ...googleapi.Field) *ContactsInsertCall {
 
1005
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1006
        return c
 
1007
}
 
1008
 
 
1009
func (c *ContactsInsertCall) Do() (*Contact, error) {
 
1010
        var body io.Reader = nil
 
1011
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
 
1012
        if err != nil {
 
1013
                return nil, err
 
1014
        }
 
1015
        ctype := "application/json"
 
1016
        params := make(url.Values)
 
1017
        params.Set("alt", "json")
 
1018
        if v, ok := c.opt_["fields"]; ok {
 
1019
                params.Set("fields", fmt.Sprintf("%v", v))
 
1020
        }
 
1021
        urls := googleapi.ResolveRelative(c.s.BasePath, "contacts")
 
1022
        urls += "?" + params.Encode()
 
1023
        req, _ := http.NewRequest("POST", urls, body)
 
1024
        googleapi.SetOpaque(req.URL)
 
1025
        req.Header.Set("Content-Type", ctype)
 
1026
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1027
        res, err := c.s.client.Do(req)
 
1028
        if err != nil {
 
1029
                return nil, err
 
1030
        }
 
1031
        defer googleapi.CloseBody(res)
 
1032
        if err := googleapi.CheckResponse(res); err != nil {
 
1033
                return nil, err
 
1034
        }
 
1035
        var ret *Contact
 
1036
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1037
                return nil, err
 
1038
        }
 
1039
        return ret, nil
 
1040
        // {
 
1041
        //   "description": "Inserts a new contact.",
 
1042
        //   "httpMethod": "POST",
 
1043
        //   "id": "mirror.contacts.insert",
 
1044
        //   "path": "contacts",
 
1045
        //   "request": {
 
1046
        //     "$ref": "Contact"
 
1047
        //   },
 
1048
        //   "response": {
 
1049
        //     "$ref": "Contact"
 
1050
        //   },
 
1051
        //   "scopes": [
 
1052
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1053
        //   ]
 
1054
        // }
 
1055
 
 
1056
}
 
1057
 
 
1058
// method id "mirror.contacts.list":
 
1059
 
 
1060
type ContactsListCall struct {
 
1061
        s    *Service
 
1062
        opt_ map[string]interface{}
 
1063
}
 
1064
 
 
1065
// List: Retrieves a list of contacts for the authenticated user.
 
1066
func (r *ContactsService) List() *ContactsListCall {
 
1067
        c := &ContactsListCall{s: r.s, opt_: make(map[string]interface{})}
 
1068
        return c
 
1069
}
 
1070
 
 
1071
// Fields allows partial responses to be retrieved.
 
1072
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1073
// for more information.
 
1074
func (c *ContactsListCall) Fields(s ...googleapi.Field) *ContactsListCall {
 
1075
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1076
        return c
 
1077
}
 
1078
 
 
1079
func (c *ContactsListCall) Do() (*ContactsListResponse, error) {
 
1080
        var body io.Reader = nil
 
1081
        params := make(url.Values)
 
1082
        params.Set("alt", "json")
 
1083
        if v, ok := c.opt_["fields"]; ok {
 
1084
                params.Set("fields", fmt.Sprintf("%v", v))
 
1085
        }
 
1086
        urls := googleapi.ResolveRelative(c.s.BasePath, "contacts")
 
1087
        urls += "?" + params.Encode()
 
1088
        req, _ := http.NewRequest("GET", urls, body)
 
1089
        googleapi.SetOpaque(req.URL)
 
1090
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1091
        res, err := c.s.client.Do(req)
 
1092
        if err != nil {
 
1093
                return nil, err
 
1094
        }
 
1095
        defer googleapi.CloseBody(res)
 
1096
        if err := googleapi.CheckResponse(res); err != nil {
 
1097
                return nil, err
 
1098
        }
 
1099
        var ret *ContactsListResponse
 
1100
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1101
                return nil, err
 
1102
        }
 
1103
        return ret, nil
 
1104
        // {
 
1105
        //   "description": "Retrieves a list of contacts for the authenticated user.",
 
1106
        //   "httpMethod": "GET",
 
1107
        //   "id": "mirror.contacts.list",
 
1108
        //   "path": "contacts",
 
1109
        //   "response": {
 
1110
        //     "$ref": "ContactsListResponse"
 
1111
        //   },
 
1112
        //   "scopes": [
 
1113
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1114
        //   ]
 
1115
        // }
 
1116
 
 
1117
}
 
1118
 
 
1119
// method id "mirror.contacts.patch":
 
1120
 
 
1121
type ContactsPatchCall struct {
 
1122
        s       *Service
 
1123
        id      string
 
1124
        contact *Contact
 
1125
        opt_    map[string]interface{}
 
1126
}
 
1127
 
 
1128
// Patch: Updates a contact in place. This method supports patch
 
1129
// semantics.
 
1130
func (r *ContactsService) Patch(id string, contact *Contact) *ContactsPatchCall {
 
1131
        c := &ContactsPatchCall{s: r.s, opt_: make(map[string]interface{})}
 
1132
        c.id = id
 
1133
        c.contact = contact
 
1134
        return c
 
1135
}
 
1136
 
 
1137
// Fields allows partial responses to be retrieved.
 
1138
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1139
// for more information.
 
1140
func (c *ContactsPatchCall) Fields(s ...googleapi.Field) *ContactsPatchCall {
 
1141
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1142
        return c
 
1143
}
 
1144
 
 
1145
func (c *ContactsPatchCall) Do() (*Contact, error) {
 
1146
        var body io.Reader = nil
 
1147
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
 
1148
        if err != nil {
 
1149
                return nil, err
 
1150
        }
 
1151
        ctype := "application/json"
 
1152
        params := make(url.Values)
 
1153
        params.Set("alt", "json")
 
1154
        if v, ok := c.opt_["fields"]; ok {
 
1155
                params.Set("fields", fmt.Sprintf("%v", v))
 
1156
        }
 
1157
        urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
 
1158
        urls += "?" + params.Encode()
 
1159
        req, _ := http.NewRequest("PATCH", urls, body)
 
1160
        googleapi.Expand(req.URL, map[string]string{
 
1161
                "id": c.id,
 
1162
        })
 
1163
        req.Header.Set("Content-Type", ctype)
 
1164
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1165
        res, err := c.s.client.Do(req)
 
1166
        if err != nil {
 
1167
                return nil, err
 
1168
        }
 
1169
        defer googleapi.CloseBody(res)
 
1170
        if err := googleapi.CheckResponse(res); err != nil {
 
1171
                return nil, err
 
1172
        }
 
1173
        var ret *Contact
 
1174
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1175
                return nil, err
 
1176
        }
 
1177
        return ret, nil
 
1178
        // {
 
1179
        //   "description": "Updates a contact in place. This method supports patch semantics.",
 
1180
        //   "httpMethod": "PATCH",
 
1181
        //   "id": "mirror.contacts.patch",
 
1182
        //   "parameterOrder": [
 
1183
        //     "id"
 
1184
        //   ],
 
1185
        //   "parameters": {
 
1186
        //     "id": {
 
1187
        //       "description": "The ID of the contact.",
 
1188
        //       "location": "path",
 
1189
        //       "required": true,
 
1190
        //       "type": "string"
 
1191
        //     }
 
1192
        //   },
 
1193
        //   "path": "contacts/{id}",
 
1194
        //   "request": {
 
1195
        //     "$ref": "Contact"
 
1196
        //   },
 
1197
        //   "response": {
 
1198
        //     "$ref": "Contact"
 
1199
        //   },
 
1200
        //   "scopes": [
 
1201
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1202
        //   ]
 
1203
        // }
 
1204
 
 
1205
}
 
1206
 
 
1207
// method id "mirror.contacts.update":
 
1208
 
 
1209
type ContactsUpdateCall struct {
 
1210
        s       *Service
 
1211
        id      string
 
1212
        contact *Contact
 
1213
        opt_    map[string]interface{}
 
1214
}
 
1215
 
 
1216
// Update: Updates a contact in place.
 
1217
func (r *ContactsService) Update(id string, contact *Contact) *ContactsUpdateCall {
 
1218
        c := &ContactsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
1219
        c.id = id
 
1220
        c.contact = contact
 
1221
        return c
 
1222
}
 
1223
 
 
1224
// Fields allows partial responses to be retrieved.
 
1225
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1226
// for more information.
 
1227
func (c *ContactsUpdateCall) Fields(s ...googleapi.Field) *ContactsUpdateCall {
 
1228
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1229
        return c
 
1230
}
 
1231
 
 
1232
func (c *ContactsUpdateCall) Do() (*Contact, error) {
 
1233
        var body io.Reader = nil
 
1234
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.contact)
 
1235
        if err != nil {
 
1236
                return nil, err
 
1237
        }
 
1238
        ctype := "application/json"
 
1239
        params := make(url.Values)
 
1240
        params.Set("alt", "json")
 
1241
        if v, ok := c.opt_["fields"]; ok {
 
1242
                params.Set("fields", fmt.Sprintf("%v", v))
 
1243
        }
 
1244
        urls := googleapi.ResolveRelative(c.s.BasePath, "contacts/{id}")
 
1245
        urls += "?" + params.Encode()
 
1246
        req, _ := http.NewRequest("PUT", urls, body)
 
1247
        googleapi.Expand(req.URL, map[string]string{
 
1248
                "id": c.id,
 
1249
        })
 
1250
        req.Header.Set("Content-Type", ctype)
 
1251
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1252
        res, err := c.s.client.Do(req)
 
1253
        if err != nil {
 
1254
                return nil, err
 
1255
        }
 
1256
        defer googleapi.CloseBody(res)
 
1257
        if err := googleapi.CheckResponse(res); err != nil {
 
1258
                return nil, err
 
1259
        }
 
1260
        var ret *Contact
 
1261
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1262
                return nil, err
 
1263
        }
 
1264
        return ret, nil
 
1265
        // {
 
1266
        //   "description": "Updates a contact in place.",
 
1267
        //   "httpMethod": "PUT",
 
1268
        //   "id": "mirror.contacts.update",
 
1269
        //   "parameterOrder": [
 
1270
        //     "id"
 
1271
        //   ],
 
1272
        //   "parameters": {
 
1273
        //     "id": {
 
1274
        //       "description": "The ID of the contact.",
 
1275
        //       "location": "path",
 
1276
        //       "required": true,
 
1277
        //       "type": "string"
 
1278
        //     }
 
1279
        //   },
 
1280
        //   "path": "contacts/{id}",
 
1281
        //   "request": {
 
1282
        //     "$ref": "Contact"
 
1283
        //   },
 
1284
        //   "response": {
 
1285
        //     "$ref": "Contact"
 
1286
        //   },
 
1287
        //   "scopes": [
 
1288
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1289
        //   ]
 
1290
        // }
 
1291
 
 
1292
}
 
1293
 
 
1294
// method id "mirror.locations.get":
 
1295
 
 
1296
type LocationsGetCall struct {
 
1297
        s    *Service
 
1298
        id   string
 
1299
        opt_ map[string]interface{}
 
1300
}
 
1301
 
 
1302
// Get: Gets a single location by ID.
 
1303
func (r *LocationsService) Get(id string) *LocationsGetCall {
 
1304
        c := &LocationsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
1305
        c.id = id
 
1306
        return c
 
1307
}
 
1308
 
 
1309
// Fields allows partial responses to be retrieved.
 
1310
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1311
// for more information.
 
1312
func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall {
 
1313
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1314
        return c
 
1315
}
 
1316
 
 
1317
func (c *LocationsGetCall) Do() (*Location, error) {
 
1318
        var body io.Reader = nil
 
1319
        params := make(url.Values)
 
1320
        params.Set("alt", "json")
 
1321
        if v, ok := c.opt_["fields"]; ok {
 
1322
                params.Set("fields", fmt.Sprintf("%v", v))
 
1323
        }
 
1324
        urls := googleapi.ResolveRelative(c.s.BasePath, "locations/{id}")
 
1325
        urls += "?" + params.Encode()
 
1326
        req, _ := http.NewRequest("GET", urls, body)
 
1327
        googleapi.Expand(req.URL, map[string]string{
 
1328
                "id": c.id,
 
1329
        })
 
1330
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1331
        res, err := c.s.client.Do(req)
 
1332
        if err != nil {
 
1333
                return nil, err
 
1334
        }
 
1335
        defer googleapi.CloseBody(res)
 
1336
        if err := googleapi.CheckResponse(res); err != nil {
 
1337
                return nil, err
 
1338
        }
 
1339
        var ret *Location
 
1340
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1341
                return nil, err
 
1342
        }
 
1343
        return ret, nil
 
1344
        // {
 
1345
        //   "description": "Gets a single location by ID.",
 
1346
        //   "httpMethod": "GET",
 
1347
        //   "id": "mirror.locations.get",
 
1348
        //   "parameterOrder": [
 
1349
        //     "id"
 
1350
        //   ],
 
1351
        //   "parameters": {
 
1352
        //     "id": {
 
1353
        //       "description": "The ID of the location or latest for the last known location.",
 
1354
        //       "location": "path",
 
1355
        //       "required": true,
 
1356
        //       "type": "string"
 
1357
        //     }
 
1358
        //   },
 
1359
        //   "path": "locations/{id}",
 
1360
        //   "response": {
 
1361
        //     "$ref": "Location"
 
1362
        //   },
 
1363
        //   "scopes": [
 
1364
        //     "https://www.googleapis.com/auth/glass.location",
 
1365
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1366
        //   ]
 
1367
        // }
 
1368
 
 
1369
}
 
1370
 
 
1371
// method id "mirror.locations.list":
 
1372
 
 
1373
type LocationsListCall struct {
 
1374
        s    *Service
 
1375
        opt_ map[string]interface{}
 
1376
}
 
1377
 
 
1378
// List: Retrieves a list of locations for the user.
 
1379
func (r *LocationsService) List() *LocationsListCall {
 
1380
        c := &LocationsListCall{s: r.s, opt_: make(map[string]interface{})}
 
1381
        return c
 
1382
}
 
1383
 
 
1384
// Fields allows partial responses to be retrieved.
 
1385
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1386
// for more information.
 
1387
func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall {
 
1388
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1389
        return c
 
1390
}
 
1391
 
 
1392
func (c *LocationsListCall) Do() (*LocationsListResponse, error) {
 
1393
        var body io.Reader = nil
 
1394
        params := make(url.Values)
 
1395
        params.Set("alt", "json")
 
1396
        if v, ok := c.opt_["fields"]; ok {
 
1397
                params.Set("fields", fmt.Sprintf("%v", v))
 
1398
        }
 
1399
        urls := googleapi.ResolveRelative(c.s.BasePath, "locations")
 
1400
        urls += "?" + params.Encode()
 
1401
        req, _ := http.NewRequest("GET", urls, body)
 
1402
        googleapi.SetOpaque(req.URL)
 
1403
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1404
        res, err := c.s.client.Do(req)
 
1405
        if err != nil {
 
1406
                return nil, err
 
1407
        }
 
1408
        defer googleapi.CloseBody(res)
 
1409
        if err := googleapi.CheckResponse(res); err != nil {
 
1410
                return nil, err
 
1411
        }
 
1412
        var ret *LocationsListResponse
 
1413
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1414
                return nil, err
 
1415
        }
 
1416
        return ret, nil
 
1417
        // {
 
1418
        //   "description": "Retrieves a list of locations for the user.",
 
1419
        //   "httpMethod": "GET",
 
1420
        //   "id": "mirror.locations.list",
 
1421
        //   "path": "locations",
 
1422
        //   "response": {
 
1423
        //     "$ref": "LocationsListResponse"
 
1424
        //   },
 
1425
        //   "scopes": [
 
1426
        //     "https://www.googleapis.com/auth/glass.location",
 
1427
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1428
        //   ]
 
1429
        // }
 
1430
 
 
1431
}
 
1432
 
 
1433
// method id "mirror.settings.get":
 
1434
 
 
1435
type SettingsGetCall struct {
 
1436
        s    *Service
 
1437
        id   string
 
1438
        opt_ map[string]interface{}
 
1439
}
 
1440
 
 
1441
// Get: Gets a single setting by ID.
 
1442
func (r *SettingsService) Get(id string) *SettingsGetCall {
 
1443
        c := &SettingsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
1444
        c.id = id
 
1445
        return c
 
1446
}
 
1447
 
 
1448
// Fields allows partial responses to be retrieved.
 
1449
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1450
// for more information.
 
1451
func (c *SettingsGetCall) Fields(s ...googleapi.Field) *SettingsGetCall {
 
1452
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1453
        return c
 
1454
}
 
1455
 
 
1456
func (c *SettingsGetCall) Do() (*Setting, error) {
 
1457
        var body io.Reader = nil
 
1458
        params := make(url.Values)
 
1459
        params.Set("alt", "json")
 
1460
        if v, ok := c.opt_["fields"]; ok {
 
1461
                params.Set("fields", fmt.Sprintf("%v", v))
 
1462
        }
 
1463
        urls := googleapi.ResolveRelative(c.s.BasePath, "settings/{id}")
 
1464
        urls += "?" + params.Encode()
 
1465
        req, _ := http.NewRequest("GET", urls, body)
 
1466
        googleapi.Expand(req.URL, map[string]string{
 
1467
                "id": c.id,
 
1468
        })
 
1469
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1470
        res, err := c.s.client.Do(req)
 
1471
        if err != nil {
 
1472
                return nil, err
 
1473
        }
 
1474
        defer googleapi.CloseBody(res)
 
1475
        if err := googleapi.CheckResponse(res); err != nil {
 
1476
                return nil, err
 
1477
        }
 
1478
        var ret *Setting
 
1479
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1480
                return nil, err
 
1481
        }
 
1482
        return ret, nil
 
1483
        // {
 
1484
        //   "description": "Gets a single setting by ID.",
 
1485
        //   "httpMethod": "GET",
 
1486
        //   "id": "mirror.settings.get",
 
1487
        //   "parameterOrder": [
 
1488
        //     "id"
 
1489
        //   ],
 
1490
        //   "parameters": {
 
1491
        //     "id": {
 
1492
        //       "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.",
 
1493
        //       "location": "path",
 
1494
        //       "required": true,
 
1495
        //       "type": "string"
 
1496
        //     }
 
1497
        //   },
 
1498
        //   "path": "settings/{id}",
 
1499
        //   "response": {
 
1500
        //     "$ref": "Setting"
 
1501
        //   },
 
1502
        //   "scopes": [
 
1503
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1504
        //   ]
 
1505
        // }
 
1506
 
 
1507
}
 
1508
 
 
1509
// method id "mirror.subscriptions.delete":
 
1510
 
 
1511
type SubscriptionsDeleteCall struct {
 
1512
        s    *Service
 
1513
        id   string
 
1514
        opt_ map[string]interface{}
 
1515
}
 
1516
 
 
1517
// Delete: Deletes a subscription.
 
1518
func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall {
 
1519
        c := &SubscriptionsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
1520
        c.id = id
 
1521
        return c
 
1522
}
 
1523
 
 
1524
// Fields allows partial responses to be retrieved.
 
1525
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1526
// for more information.
 
1527
func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
 
1528
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1529
        return c
 
1530
}
 
1531
 
 
1532
func (c *SubscriptionsDeleteCall) Do() error {
 
1533
        var body io.Reader = nil
 
1534
        params := make(url.Values)
 
1535
        params.Set("alt", "json")
 
1536
        if v, ok := c.opt_["fields"]; ok {
 
1537
                params.Set("fields", fmt.Sprintf("%v", v))
 
1538
        }
 
1539
        urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}")
 
1540
        urls += "?" + params.Encode()
 
1541
        req, _ := http.NewRequest("DELETE", urls, body)
 
1542
        googleapi.Expand(req.URL, map[string]string{
 
1543
                "id": c.id,
 
1544
        })
 
1545
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1546
        res, err := c.s.client.Do(req)
 
1547
        if err != nil {
 
1548
                return err
 
1549
        }
 
1550
        defer googleapi.CloseBody(res)
 
1551
        if err := googleapi.CheckResponse(res); err != nil {
 
1552
                return err
 
1553
        }
 
1554
        return nil
 
1555
        // {
 
1556
        //   "description": "Deletes a subscription.",
 
1557
        //   "httpMethod": "DELETE",
 
1558
        //   "id": "mirror.subscriptions.delete",
 
1559
        //   "parameterOrder": [
 
1560
        //     "id"
 
1561
        //   ],
 
1562
        //   "parameters": {
 
1563
        //     "id": {
 
1564
        //       "description": "The ID of the subscription.",
 
1565
        //       "location": "path",
 
1566
        //       "required": true,
 
1567
        //       "type": "string"
 
1568
        //     }
 
1569
        //   },
 
1570
        //   "path": "subscriptions/{id}",
 
1571
        //   "scopes": [
 
1572
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1573
        //   ]
 
1574
        // }
 
1575
 
 
1576
}
 
1577
 
 
1578
// method id "mirror.subscriptions.insert":
 
1579
 
 
1580
type SubscriptionsInsertCall struct {
 
1581
        s            *Service
 
1582
        subscription *Subscription
 
1583
        opt_         map[string]interface{}
 
1584
}
 
1585
 
 
1586
// Insert: Creates a new subscription.
 
1587
func (r *SubscriptionsService) Insert(subscription *Subscription) *SubscriptionsInsertCall {
 
1588
        c := &SubscriptionsInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
1589
        c.subscription = subscription
 
1590
        return c
 
1591
}
 
1592
 
 
1593
// Fields allows partial responses to be retrieved.
 
1594
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1595
// for more information.
 
1596
func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
 
1597
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1598
        return c
 
1599
}
 
1600
 
 
1601
func (c *SubscriptionsInsertCall) Do() (*Subscription, error) {
 
1602
        var body io.Reader = nil
 
1603
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
 
1604
        if err != nil {
 
1605
                return nil, err
 
1606
        }
 
1607
        ctype := "application/json"
 
1608
        params := make(url.Values)
 
1609
        params.Set("alt", "json")
 
1610
        if v, ok := c.opt_["fields"]; ok {
 
1611
                params.Set("fields", fmt.Sprintf("%v", v))
 
1612
        }
 
1613
        urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
 
1614
        urls += "?" + params.Encode()
 
1615
        req, _ := http.NewRequest("POST", urls, body)
 
1616
        googleapi.SetOpaque(req.URL)
 
1617
        req.Header.Set("Content-Type", ctype)
 
1618
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1619
        res, err := c.s.client.Do(req)
 
1620
        if err != nil {
 
1621
                return nil, err
 
1622
        }
 
1623
        defer googleapi.CloseBody(res)
 
1624
        if err := googleapi.CheckResponse(res); err != nil {
 
1625
                return nil, err
 
1626
        }
 
1627
        var ret *Subscription
 
1628
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1629
                return nil, err
 
1630
        }
 
1631
        return ret, nil
 
1632
        // {
 
1633
        //   "description": "Creates a new subscription.",
 
1634
        //   "httpMethod": "POST",
 
1635
        //   "id": "mirror.subscriptions.insert",
 
1636
        //   "path": "subscriptions",
 
1637
        //   "request": {
 
1638
        //     "$ref": "Subscription"
 
1639
        //   },
 
1640
        //   "response": {
 
1641
        //     "$ref": "Subscription"
 
1642
        //   },
 
1643
        //   "scopes": [
 
1644
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1645
        //   ]
 
1646
        // }
 
1647
 
 
1648
}
 
1649
 
 
1650
// method id "mirror.subscriptions.list":
 
1651
 
 
1652
type SubscriptionsListCall struct {
 
1653
        s    *Service
 
1654
        opt_ map[string]interface{}
 
1655
}
 
1656
 
 
1657
// List: Retrieves a list of subscriptions for the authenticated user
 
1658
// and service.
 
1659
func (r *SubscriptionsService) List() *SubscriptionsListCall {
 
1660
        c := &SubscriptionsListCall{s: r.s, opt_: make(map[string]interface{})}
 
1661
        return c
 
1662
}
 
1663
 
 
1664
// Fields allows partial responses to be retrieved.
 
1665
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1666
// for more information.
 
1667
func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
 
1668
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1669
        return c
 
1670
}
 
1671
 
 
1672
func (c *SubscriptionsListCall) Do() (*SubscriptionsListResponse, error) {
 
1673
        var body io.Reader = nil
 
1674
        params := make(url.Values)
 
1675
        params.Set("alt", "json")
 
1676
        if v, ok := c.opt_["fields"]; ok {
 
1677
                params.Set("fields", fmt.Sprintf("%v", v))
 
1678
        }
 
1679
        urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
 
1680
        urls += "?" + params.Encode()
 
1681
        req, _ := http.NewRequest("GET", urls, body)
 
1682
        googleapi.SetOpaque(req.URL)
 
1683
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1684
        res, err := c.s.client.Do(req)
 
1685
        if err != nil {
 
1686
                return nil, err
 
1687
        }
 
1688
        defer googleapi.CloseBody(res)
 
1689
        if err := googleapi.CheckResponse(res); err != nil {
 
1690
                return nil, err
 
1691
        }
 
1692
        var ret *SubscriptionsListResponse
 
1693
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1694
                return nil, err
 
1695
        }
 
1696
        return ret, nil
 
1697
        // {
 
1698
        //   "description": "Retrieves a list of subscriptions for the authenticated user and service.",
 
1699
        //   "httpMethod": "GET",
 
1700
        //   "id": "mirror.subscriptions.list",
 
1701
        //   "path": "subscriptions",
 
1702
        //   "response": {
 
1703
        //     "$ref": "SubscriptionsListResponse"
 
1704
        //   },
 
1705
        //   "scopes": [
 
1706
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1707
        //   ]
 
1708
        // }
 
1709
 
 
1710
}
 
1711
 
 
1712
// method id "mirror.subscriptions.update":
 
1713
 
 
1714
type SubscriptionsUpdateCall struct {
 
1715
        s            *Service
 
1716
        id           string
 
1717
        subscription *Subscription
 
1718
        opt_         map[string]interface{}
 
1719
}
 
1720
 
 
1721
// Update: Updates an existing subscription in place.
 
1722
func (r *SubscriptionsService) Update(id string, subscription *Subscription) *SubscriptionsUpdateCall {
 
1723
        c := &SubscriptionsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
1724
        c.id = id
 
1725
        c.subscription = subscription
 
1726
        return c
 
1727
}
 
1728
 
 
1729
// Fields allows partial responses to be retrieved.
 
1730
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1731
// for more information.
 
1732
func (c *SubscriptionsUpdateCall) Fields(s ...googleapi.Field) *SubscriptionsUpdateCall {
 
1733
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1734
        return c
 
1735
}
 
1736
 
 
1737
func (c *SubscriptionsUpdateCall) Do() (*Subscription, error) {
 
1738
        var body io.Reader = nil
 
1739
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
 
1740
        if err != nil {
 
1741
                return nil, err
 
1742
        }
 
1743
        ctype := "application/json"
 
1744
        params := make(url.Values)
 
1745
        params.Set("alt", "json")
 
1746
        if v, ok := c.opt_["fields"]; ok {
 
1747
                params.Set("fields", fmt.Sprintf("%v", v))
 
1748
        }
 
1749
        urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions/{id}")
 
1750
        urls += "?" + params.Encode()
 
1751
        req, _ := http.NewRequest("PUT", urls, body)
 
1752
        googleapi.Expand(req.URL, map[string]string{
 
1753
                "id": c.id,
 
1754
        })
 
1755
        req.Header.Set("Content-Type", ctype)
 
1756
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1757
        res, err := c.s.client.Do(req)
 
1758
        if err != nil {
 
1759
                return nil, err
 
1760
        }
 
1761
        defer googleapi.CloseBody(res)
 
1762
        if err := googleapi.CheckResponse(res); err != nil {
 
1763
                return nil, err
 
1764
        }
 
1765
        var ret *Subscription
 
1766
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1767
                return nil, err
 
1768
        }
 
1769
        return ret, nil
 
1770
        // {
 
1771
        //   "description": "Updates an existing subscription in place.",
 
1772
        //   "httpMethod": "PUT",
 
1773
        //   "id": "mirror.subscriptions.update",
 
1774
        //   "parameterOrder": [
 
1775
        //     "id"
 
1776
        //   ],
 
1777
        //   "parameters": {
 
1778
        //     "id": {
 
1779
        //       "description": "The ID of the subscription.",
 
1780
        //       "location": "path",
 
1781
        //       "required": true,
 
1782
        //       "type": "string"
 
1783
        //     }
 
1784
        //   },
 
1785
        //   "path": "subscriptions/{id}",
 
1786
        //   "request": {
 
1787
        //     "$ref": "Subscription"
 
1788
        //   },
 
1789
        //   "response": {
 
1790
        //     "$ref": "Subscription"
 
1791
        //   },
 
1792
        //   "scopes": [
 
1793
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1794
        //   ]
 
1795
        // }
 
1796
 
 
1797
}
 
1798
 
 
1799
// method id "mirror.timeline.delete":
 
1800
 
 
1801
type TimelineDeleteCall struct {
 
1802
        s    *Service
 
1803
        id   string
 
1804
        opt_ map[string]interface{}
 
1805
}
 
1806
 
 
1807
// Delete: Deletes a timeline item.
 
1808
func (r *TimelineService) Delete(id string) *TimelineDeleteCall {
 
1809
        c := &TimelineDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
1810
        c.id = id
 
1811
        return c
 
1812
}
 
1813
 
 
1814
// Fields allows partial responses to be retrieved.
 
1815
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1816
// for more information.
 
1817
func (c *TimelineDeleteCall) Fields(s ...googleapi.Field) *TimelineDeleteCall {
 
1818
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1819
        return c
 
1820
}
 
1821
 
 
1822
func (c *TimelineDeleteCall) Do() error {
 
1823
        var body io.Reader = nil
 
1824
        params := make(url.Values)
 
1825
        params.Set("alt", "json")
 
1826
        if v, ok := c.opt_["fields"]; ok {
 
1827
                params.Set("fields", fmt.Sprintf("%v", v))
 
1828
        }
 
1829
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
 
1830
        urls += "?" + params.Encode()
 
1831
        req, _ := http.NewRequest("DELETE", urls, body)
 
1832
        googleapi.Expand(req.URL, map[string]string{
 
1833
                "id": c.id,
 
1834
        })
 
1835
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1836
        res, err := c.s.client.Do(req)
 
1837
        if err != nil {
 
1838
                return err
 
1839
        }
 
1840
        defer googleapi.CloseBody(res)
 
1841
        if err := googleapi.CheckResponse(res); err != nil {
 
1842
                return err
 
1843
        }
 
1844
        return nil
 
1845
        // {
 
1846
        //   "description": "Deletes a timeline item.",
 
1847
        //   "httpMethod": "DELETE",
 
1848
        //   "id": "mirror.timeline.delete",
 
1849
        //   "parameterOrder": [
 
1850
        //     "id"
 
1851
        //   ],
 
1852
        //   "parameters": {
 
1853
        //     "id": {
 
1854
        //       "description": "The ID of the timeline item.",
 
1855
        //       "location": "path",
 
1856
        //       "required": true,
 
1857
        //       "type": "string"
 
1858
        //     }
 
1859
        //   },
 
1860
        //   "path": "timeline/{id}",
 
1861
        //   "scopes": [
 
1862
        //     "https://www.googleapis.com/auth/glass.location",
 
1863
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1864
        //   ]
 
1865
        // }
 
1866
 
 
1867
}
 
1868
 
 
1869
// method id "mirror.timeline.get":
 
1870
 
 
1871
type TimelineGetCall struct {
 
1872
        s    *Service
 
1873
        id   string
 
1874
        opt_ map[string]interface{}
 
1875
}
 
1876
 
 
1877
// Get: Gets a single timeline item by ID.
 
1878
func (r *TimelineService) Get(id string) *TimelineGetCall {
 
1879
        c := &TimelineGetCall{s: r.s, opt_: make(map[string]interface{})}
 
1880
        c.id = id
 
1881
        return c
 
1882
}
 
1883
 
 
1884
// Fields allows partial responses to be retrieved.
 
1885
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1886
// for more information.
 
1887
func (c *TimelineGetCall) Fields(s ...googleapi.Field) *TimelineGetCall {
 
1888
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1889
        return c
 
1890
}
 
1891
 
 
1892
func (c *TimelineGetCall) Do() (*TimelineItem, error) {
 
1893
        var body io.Reader = nil
 
1894
        params := make(url.Values)
 
1895
        params.Set("alt", "json")
 
1896
        if v, ok := c.opt_["fields"]; ok {
 
1897
                params.Set("fields", fmt.Sprintf("%v", v))
 
1898
        }
 
1899
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
 
1900
        urls += "?" + params.Encode()
 
1901
        req, _ := http.NewRequest("GET", urls, body)
 
1902
        googleapi.Expand(req.URL, map[string]string{
 
1903
                "id": c.id,
 
1904
        })
 
1905
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1906
        res, err := c.s.client.Do(req)
 
1907
        if err != nil {
 
1908
                return nil, err
 
1909
        }
 
1910
        defer googleapi.CloseBody(res)
 
1911
        if err := googleapi.CheckResponse(res); err != nil {
 
1912
                return nil, err
 
1913
        }
 
1914
        var ret *TimelineItem
 
1915
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1916
                return nil, err
 
1917
        }
 
1918
        return ret, nil
 
1919
        // {
 
1920
        //   "description": "Gets a single timeline item by ID.",
 
1921
        //   "httpMethod": "GET",
 
1922
        //   "id": "mirror.timeline.get",
 
1923
        //   "parameterOrder": [
 
1924
        //     "id"
 
1925
        //   ],
 
1926
        //   "parameters": {
 
1927
        //     "id": {
 
1928
        //       "description": "The ID of the timeline item.",
 
1929
        //       "location": "path",
 
1930
        //       "required": true,
 
1931
        //       "type": "string"
 
1932
        //     }
 
1933
        //   },
 
1934
        //   "path": "timeline/{id}",
 
1935
        //   "response": {
 
1936
        //     "$ref": "TimelineItem"
 
1937
        //   },
 
1938
        //   "scopes": [
 
1939
        //     "https://www.googleapis.com/auth/glass.location",
 
1940
        //     "https://www.googleapis.com/auth/glass.timeline"
 
1941
        //   ]
 
1942
        // }
 
1943
 
 
1944
}
 
1945
 
 
1946
// method id "mirror.timeline.insert":
 
1947
 
 
1948
type TimelineInsertCall struct {
 
1949
        s            *Service
 
1950
        timelineitem *TimelineItem
 
1951
        opt_         map[string]interface{}
 
1952
        media_       io.Reader
 
1953
}
 
1954
 
 
1955
// Insert: Inserts a new item into the timeline.
 
1956
func (r *TimelineService) Insert(timelineitem *TimelineItem) *TimelineInsertCall {
 
1957
        c := &TimelineInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
1958
        c.timelineitem = timelineitem
 
1959
        return c
 
1960
}
 
1961
func (c *TimelineInsertCall) Media(r io.Reader) *TimelineInsertCall {
 
1962
        c.media_ = r
 
1963
        return c
 
1964
}
 
1965
 
 
1966
// Fields allows partial responses to be retrieved.
 
1967
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1968
// for more information.
 
1969
func (c *TimelineInsertCall) Fields(s ...googleapi.Field) *TimelineInsertCall {
 
1970
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1971
        return c
 
1972
}
 
1973
 
 
1974
func (c *TimelineInsertCall) Do() (*TimelineItem, error) {
 
1975
        var body io.Reader = nil
 
1976
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
 
1977
        if err != nil {
 
1978
                return nil, err
 
1979
        }
 
1980
        ctype := "application/json"
 
1981
        params := make(url.Values)
 
1982
        params.Set("alt", "json")
 
1983
        if v, ok := c.opt_["fields"]; ok {
 
1984
                params.Set("fields", fmt.Sprintf("%v", v))
 
1985
        }
 
1986
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline")
 
1987
        if c.media_ != nil {
 
1988
                urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
 
1989
                params.Set("uploadType", "multipart")
 
1990
        }
 
1991
        urls += "?" + params.Encode()
 
1992
        contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)
 
1993
        req, _ := http.NewRequest("POST", urls, body)
 
1994
        googleapi.SetOpaque(req.URL)
 
1995
        if hasMedia_ {
 
1996
                req.ContentLength = contentLength_
 
1997
        }
 
1998
        req.Header.Set("Content-Type", ctype)
 
1999
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2000
        res, err := c.s.client.Do(req)
 
2001
        if err != nil {
 
2002
                return nil, err
 
2003
        }
 
2004
        defer googleapi.CloseBody(res)
 
2005
        if err := googleapi.CheckResponse(res); err != nil {
 
2006
                return nil, err
 
2007
        }
 
2008
        var ret *TimelineItem
 
2009
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2010
                return nil, err
 
2011
        }
 
2012
        return ret, nil
 
2013
        // {
 
2014
        //   "description": "Inserts a new item into the timeline.",
 
2015
        //   "httpMethod": "POST",
 
2016
        //   "id": "mirror.timeline.insert",
 
2017
        //   "mediaUpload": {
 
2018
        //     "accept": [
 
2019
        //       "audio/*",
 
2020
        //       "image/*",
 
2021
        //       "video/*"
 
2022
        //     ],
 
2023
        //     "maxSize": "10MB",
 
2024
        //     "protocols": {
 
2025
        //       "resumable": {
 
2026
        //         "multipart": true,
 
2027
        //         "path": "/resumable/upload/mirror/v1/timeline"
 
2028
        //       },
 
2029
        //       "simple": {
 
2030
        //         "multipart": true,
 
2031
        //         "path": "/upload/mirror/v1/timeline"
 
2032
        //       }
 
2033
        //     }
 
2034
        //   },
 
2035
        //   "path": "timeline",
 
2036
        //   "request": {
 
2037
        //     "$ref": "TimelineItem"
 
2038
        //   },
 
2039
        //   "response": {
 
2040
        //     "$ref": "TimelineItem"
 
2041
        //   },
 
2042
        //   "scopes": [
 
2043
        //     "https://www.googleapis.com/auth/glass.location",
 
2044
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2045
        //   ],
 
2046
        //   "supportsMediaUpload": true
 
2047
        // }
 
2048
 
 
2049
}
 
2050
 
 
2051
// method id "mirror.timeline.list":
 
2052
 
 
2053
type TimelineListCall struct {
 
2054
        s    *Service
 
2055
        opt_ map[string]interface{}
 
2056
}
 
2057
 
 
2058
// List: Retrieves a list of timeline items for the authenticated user.
 
2059
func (r *TimelineService) List() *TimelineListCall {
 
2060
        c := &TimelineListCall{s: r.s, opt_: make(map[string]interface{})}
 
2061
        return c
 
2062
}
 
2063
 
 
2064
// BundleId sets the optional parameter "bundleId": If provided, only
 
2065
// items with the given bundleId will be returned.
 
2066
func (c *TimelineListCall) BundleId(bundleId string) *TimelineListCall {
 
2067
        c.opt_["bundleId"] = bundleId
 
2068
        return c
 
2069
}
 
2070
 
 
2071
// IncludeDeleted sets the optional parameter "includeDeleted": If true,
 
2072
// tombstone records for deleted items will be returned.
 
2073
func (c *TimelineListCall) IncludeDeleted(includeDeleted bool) *TimelineListCall {
 
2074
        c.opt_["includeDeleted"] = includeDeleted
 
2075
        return c
 
2076
}
 
2077
 
 
2078
// MaxResults sets the optional parameter "maxResults": The maximum
 
2079
// number of items to include in the response, used for paging.
 
2080
func (c *TimelineListCall) MaxResults(maxResults int64) *TimelineListCall {
 
2081
        c.opt_["maxResults"] = maxResults
 
2082
        return c
 
2083
}
 
2084
 
 
2085
// OrderBy sets the optional parameter "orderBy": Controls the order in
 
2086
// which timeline items are returned.
 
2087
func (c *TimelineListCall) OrderBy(orderBy string) *TimelineListCall {
 
2088
        c.opt_["orderBy"] = orderBy
 
2089
        return c
 
2090
}
 
2091
 
 
2092
// PageToken sets the optional parameter "pageToken": Token for the page
 
2093
// of results to return.
 
2094
func (c *TimelineListCall) PageToken(pageToken string) *TimelineListCall {
 
2095
        c.opt_["pageToken"] = pageToken
 
2096
        return c
 
2097
}
 
2098
 
 
2099
// PinnedOnly sets the optional parameter "pinnedOnly": If true, only
 
2100
// pinned items will be returned.
 
2101
func (c *TimelineListCall) PinnedOnly(pinnedOnly bool) *TimelineListCall {
 
2102
        c.opt_["pinnedOnly"] = pinnedOnly
 
2103
        return c
 
2104
}
 
2105
 
 
2106
// SourceItemId sets the optional parameter "sourceItemId": If provided,
 
2107
// only items with the given sourceItemId will be returned.
 
2108
func (c *TimelineListCall) SourceItemId(sourceItemId string) *TimelineListCall {
 
2109
        c.opt_["sourceItemId"] = sourceItemId
 
2110
        return c
 
2111
}
 
2112
 
 
2113
// Fields allows partial responses to be retrieved.
 
2114
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2115
// for more information.
 
2116
func (c *TimelineListCall) Fields(s ...googleapi.Field) *TimelineListCall {
 
2117
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2118
        return c
 
2119
}
 
2120
 
 
2121
func (c *TimelineListCall) Do() (*TimelineListResponse, error) {
 
2122
        var body io.Reader = nil
 
2123
        params := make(url.Values)
 
2124
        params.Set("alt", "json")
 
2125
        if v, ok := c.opt_["bundleId"]; ok {
 
2126
                params.Set("bundleId", fmt.Sprintf("%v", v))
 
2127
        }
 
2128
        if v, ok := c.opt_["includeDeleted"]; ok {
 
2129
                params.Set("includeDeleted", fmt.Sprintf("%v", v))
 
2130
        }
 
2131
        if v, ok := c.opt_["maxResults"]; ok {
 
2132
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
2133
        }
 
2134
        if v, ok := c.opt_["orderBy"]; ok {
 
2135
                params.Set("orderBy", fmt.Sprintf("%v", v))
 
2136
        }
 
2137
        if v, ok := c.opt_["pageToken"]; ok {
 
2138
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
2139
        }
 
2140
        if v, ok := c.opt_["pinnedOnly"]; ok {
 
2141
                params.Set("pinnedOnly", fmt.Sprintf("%v", v))
 
2142
        }
 
2143
        if v, ok := c.opt_["sourceItemId"]; ok {
 
2144
                params.Set("sourceItemId", fmt.Sprintf("%v", v))
 
2145
        }
 
2146
        if v, ok := c.opt_["fields"]; ok {
 
2147
                params.Set("fields", fmt.Sprintf("%v", v))
 
2148
        }
 
2149
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline")
 
2150
        urls += "?" + params.Encode()
 
2151
        req, _ := http.NewRequest("GET", urls, body)
 
2152
        googleapi.SetOpaque(req.URL)
 
2153
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2154
        res, err := c.s.client.Do(req)
 
2155
        if err != nil {
 
2156
                return nil, err
 
2157
        }
 
2158
        defer googleapi.CloseBody(res)
 
2159
        if err := googleapi.CheckResponse(res); err != nil {
 
2160
                return nil, err
 
2161
        }
 
2162
        var ret *TimelineListResponse
 
2163
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2164
                return nil, err
 
2165
        }
 
2166
        return ret, nil
 
2167
        // {
 
2168
        //   "description": "Retrieves a list of timeline items for the authenticated user.",
 
2169
        //   "httpMethod": "GET",
 
2170
        //   "id": "mirror.timeline.list",
 
2171
        //   "parameters": {
 
2172
        //     "bundleId": {
 
2173
        //       "description": "If provided, only items with the given bundleId will be returned.",
 
2174
        //       "location": "query",
 
2175
        //       "type": "string"
 
2176
        //     },
 
2177
        //     "includeDeleted": {
 
2178
        //       "description": "If true, tombstone records for deleted items will be returned.",
 
2179
        //       "location": "query",
 
2180
        //       "type": "boolean"
 
2181
        //     },
 
2182
        //     "maxResults": {
 
2183
        //       "description": "The maximum number of items to include in the response, used for paging.",
 
2184
        //       "format": "uint32",
 
2185
        //       "location": "query",
 
2186
        //       "type": "integer"
 
2187
        //     },
 
2188
        //     "orderBy": {
 
2189
        //       "description": "Controls the order in which timeline items are returned.",
 
2190
        //       "enum": [
 
2191
        //         "displayTime",
 
2192
        //         "writeTime"
 
2193
        //       ],
 
2194
        //       "enumDescriptions": [
 
2195
        //         "Results will be ordered by displayTime (default). This is the same ordering as is used in the timeline on the device.",
 
2196
        //         "Results will be ordered by the time at which they were last written to the data store."
 
2197
        //       ],
 
2198
        //       "location": "query",
 
2199
        //       "type": "string"
 
2200
        //     },
 
2201
        //     "pageToken": {
 
2202
        //       "description": "Token for the page of results to return.",
 
2203
        //       "location": "query",
 
2204
        //       "type": "string"
 
2205
        //     },
 
2206
        //     "pinnedOnly": {
 
2207
        //       "description": "If true, only pinned items will be returned.",
 
2208
        //       "location": "query",
 
2209
        //       "type": "boolean"
 
2210
        //     },
 
2211
        //     "sourceItemId": {
 
2212
        //       "description": "If provided, only items with the given sourceItemId will be returned.",
 
2213
        //       "location": "query",
 
2214
        //       "type": "string"
 
2215
        //     }
 
2216
        //   },
 
2217
        //   "path": "timeline",
 
2218
        //   "response": {
 
2219
        //     "$ref": "TimelineListResponse"
 
2220
        //   },
 
2221
        //   "scopes": [
 
2222
        //     "https://www.googleapis.com/auth/glass.location",
 
2223
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2224
        //   ]
 
2225
        // }
 
2226
 
 
2227
}
 
2228
 
 
2229
// method id "mirror.timeline.patch":
 
2230
 
 
2231
type TimelinePatchCall struct {
 
2232
        s            *Service
 
2233
        id           string
 
2234
        timelineitem *TimelineItem
 
2235
        opt_         map[string]interface{}
 
2236
}
 
2237
 
 
2238
// Patch: Updates a timeline item in place. This method supports patch
 
2239
// semantics.
 
2240
func (r *TimelineService) Patch(id string, timelineitem *TimelineItem) *TimelinePatchCall {
 
2241
        c := &TimelinePatchCall{s: r.s, opt_: make(map[string]interface{})}
 
2242
        c.id = id
 
2243
        c.timelineitem = timelineitem
 
2244
        return c
 
2245
}
 
2246
 
 
2247
// Fields allows partial responses to be retrieved.
 
2248
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2249
// for more information.
 
2250
func (c *TimelinePatchCall) Fields(s ...googleapi.Field) *TimelinePatchCall {
 
2251
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2252
        return c
 
2253
}
 
2254
 
 
2255
func (c *TimelinePatchCall) Do() (*TimelineItem, error) {
 
2256
        var body io.Reader = nil
 
2257
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
 
2258
        if err != nil {
 
2259
                return nil, err
 
2260
        }
 
2261
        ctype := "application/json"
 
2262
        params := make(url.Values)
 
2263
        params.Set("alt", "json")
 
2264
        if v, ok := c.opt_["fields"]; ok {
 
2265
                params.Set("fields", fmt.Sprintf("%v", v))
 
2266
        }
 
2267
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
 
2268
        urls += "?" + params.Encode()
 
2269
        req, _ := http.NewRequest("PATCH", urls, body)
 
2270
        googleapi.Expand(req.URL, map[string]string{
 
2271
                "id": c.id,
 
2272
        })
 
2273
        req.Header.Set("Content-Type", ctype)
 
2274
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2275
        res, err := c.s.client.Do(req)
 
2276
        if err != nil {
 
2277
                return nil, err
 
2278
        }
 
2279
        defer googleapi.CloseBody(res)
 
2280
        if err := googleapi.CheckResponse(res); err != nil {
 
2281
                return nil, err
 
2282
        }
 
2283
        var ret *TimelineItem
 
2284
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2285
                return nil, err
 
2286
        }
 
2287
        return ret, nil
 
2288
        // {
 
2289
        //   "description": "Updates a timeline item in place. This method supports patch semantics.",
 
2290
        //   "httpMethod": "PATCH",
 
2291
        //   "id": "mirror.timeline.patch",
 
2292
        //   "parameterOrder": [
 
2293
        //     "id"
 
2294
        //   ],
 
2295
        //   "parameters": {
 
2296
        //     "id": {
 
2297
        //       "description": "The ID of the timeline item.",
 
2298
        //       "location": "path",
 
2299
        //       "required": true,
 
2300
        //       "type": "string"
 
2301
        //     }
 
2302
        //   },
 
2303
        //   "path": "timeline/{id}",
 
2304
        //   "request": {
 
2305
        //     "$ref": "TimelineItem"
 
2306
        //   },
 
2307
        //   "response": {
 
2308
        //     "$ref": "TimelineItem"
 
2309
        //   },
 
2310
        //   "scopes": [
 
2311
        //     "https://www.googleapis.com/auth/glass.location",
 
2312
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2313
        //   ]
 
2314
        // }
 
2315
 
 
2316
}
 
2317
 
 
2318
// method id "mirror.timeline.update":
 
2319
 
 
2320
type TimelineUpdateCall struct {
 
2321
        s            *Service
 
2322
        id           string
 
2323
        timelineitem *TimelineItem
 
2324
        opt_         map[string]interface{}
 
2325
        media_       io.Reader
 
2326
}
 
2327
 
 
2328
// Update: Updates a timeline item in place.
 
2329
func (r *TimelineService) Update(id string, timelineitem *TimelineItem) *TimelineUpdateCall {
 
2330
        c := &TimelineUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
2331
        c.id = id
 
2332
        c.timelineitem = timelineitem
 
2333
        return c
 
2334
}
 
2335
func (c *TimelineUpdateCall) Media(r io.Reader) *TimelineUpdateCall {
 
2336
        c.media_ = r
 
2337
        return c
 
2338
}
 
2339
 
 
2340
// Fields allows partial responses to be retrieved.
 
2341
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2342
// for more information.
 
2343
func (c *TimelineUpdateCall) Fields(s ...googleapi.Field) *TimelineUpdateCall {
 
2344
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2345
        return c
 
2346
}
 
2347
 
 
2348
func (c *TimelineUpdateCall) Do() (*TimelineItem, error) {
 
2349
        var body io.Reader = nil
 
2350
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.timelineitem)
 
2351
        if err != nil {
 
2352
                return nil, err
 
2353
        }
 
2354
        ctype := "application/json"
 
2355
        params := make(url.Values)
 
2356
        params.Set("alt", "json")
 
2357
        if v, ok := c.opt_["fields"]; ok {
 
2358
                params.Set("fields", fmt.Sprintf("%v", v))
 
2359
        }
 
2360
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{id}")
 
2361
        if c.media_ != nil {
 
2362
                urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
 
2363
                params.Set("uploadType", "multipart")
 
2364
        }
 
2365
        urls += "?" + params.Encode()
 
2366
        contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)
 
2367
        req, _ := http.NewRequest("PUT", urls, body)
 
2368
        googleapi.Expand(req.URL, map[string]string{
 
2369
                "id": c.id,
 
2370
        })
 
2371
        if hasMedia_ {
 
2372
                req.ContentLength = contentLength_
 
2373
        }
 
2374
        req.Header.Set("Content-Type", ctype)
 
2375
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2376
        res, err := c.s.client.Do(req)
 
2377
        if err != nil {
 
2378
                return nil, err
 
2379
        }
 
2380
        defer googleapi.CloseBody(res)
 
2381
        if err := googleapi.CheckResponse(res); err != nil {
 
2382
                return nil, err
 
2383
        }
 
2384
        var ret *TimelineItem
 
2385
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2386
                return nil, err
 
2387
        }
 
2388
        return ret, nil
 
2389
        // {
 
2390
        //   "description": "Updates a timeline item in place.",
 
2391
        //   "httpMethod": "PUT",
 
2392
        //   "id": "mirror.timeline.update",
 
2393
        //   "mediaUpload": {
 
2394
        //     "accept": [
 
2395
        //       "audio/*",
 
2396
        //       "image/*",
 
2397
        //       "video/*"
 
2398
        //     ],
 
2399
        //     "maxSize": "10MB",
 
2400
        //     "protocols": {
 
2401
        //       "resumable": {
 
2402
        //         "multipart": true,
 
2403
        //         "path": "/resumable/upload/mirror/v1/timeline/{id}"
 
2404
        //       },
 
2405
        //       "simple": {
 
2406
        //         "multipart": true,
 
2407
        //         "path": "/upload/mirror/v1/timeline/{id}"
 
2408
        //       }
 
2409
        //     }
 
2410
        //   },
 
2411
        //   "parameterOrder": [
 
2412
        //     "id"
 
2413
        //   ],
 
2414
        //   "parameters": {
 
2415
        //     "id": {
 
2416
        //       "description": "The ID of the timeline item.",
 
2417
        //       "location": "path",
 
2418
        //       "required": true,
 
2419
        //       "type": "string"
 
2420
        //     }
 
2421
        //   },
 
2422
        //   "path": "timeline/{id}",
 
2423
        //   "request": {
 
2424
        //     "$ref": "TimelineItem"
 
2425
        //   },
 
2426
        //   "response": {
 
2427
        //     "$ref": "TimelineItem"
 
2428
        //   },
 
2429
        //   "scopes": [
 
2430
        //     "https://www.googleapis.com/auth/glass.location",
 
2431
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2432
        //   ],
 
2433
        //   "supportsMediaUpload": true
 
2434
        // }
 
2435
 
 
2436
}
 
2437
 
 
2438
// method id "mirror.timeline.attachments.delete":
 
2439
 
 
2440
type TimelineAttachmentsDeleteCall struct {
 
2441
        s            *Service
 
2442
        itemId       string
 
2443
        attachmentId string
 
2444
        opt_         map[string]interface{}
 
2445
}
 
2446
 
 
2447
// Delete: Deletes an attachment from a timeline item.
 
2448
func (r *TimelineAttachmentsService) Delete(itemId string, attachmentId string) *TimelineAttachmentsDeleteCall {
 
2449
        c := &TimelineAttachmentsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
2450
        c.itemId = itemId
 
2451
        c.attachmentId = attachmentId
 
2452
        return c
 
2453
}
 
2454
 
 
2455
// Fields allows partial responses to be retrieved.
 
2456
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2457
// for more information.
 
2458
func (c *TimelineAttachmentsDeleteCall) Fields(s ...googleapi.Field) *TimelineAttachmentsDeleteCall {
 
2459
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2460
        return c
 
2461
}
 
2462
 
 
2463
func (c *TimelineAttachmentsDeleteCall) Do() error {
 
2464
        var body io.Reader = nil
 
2465
        params := make(url.Values)
 
2466
        params.Set("alt", "json")
 
2467
        if v, ok := c.opt_["fields"]; ok {
 
2468
                params.Set("fields", fmt.Sprintf("%v", v))
 
2469
        }
 
2470
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}")
 
2471
        urls += "?" + params.Encode()
 
2472
        req, _ := http.NewRequest("DELETE", urls, body)
 
2473
        googleapi.Expand(req.URL, map[string]string{
 
2474
                "itemId":       c.itemId,
 
2475
                "attachmentId": c.attachmentId,
 
2476
        })
 
2477
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2478
        res, err := c.s.client.Do(req)
 
2479
        if err != nil {
 
2480
                return err
 
2481
        }
 
2482
        defer googleapi.CloseBody(res)
 
2483
        if err := googleapi.CheckResponse(res); err != nil {
 
2484
                return err
 
2485
        }
 
2486
        return nil
 
2487
        // {
 
2488
        //   "description": "Deletes an attachment from a timeline item.",
 
2489
        //   "httpMethod": "DELETE",
 
2490
        //   "id": "mirror.timeline.attachments.delete",
 
2491
        //   "parameterOrder": [
 
2492
        //     "itemId",
 
2493
        //     "attachmentId"
 
2494
        //   ],
 
2495
        //   "parameters": {
 
2496
        //     "attachmentId": {
 
2497
        //       "description": "The ID of the attachment.",
 
2498
        //       "location": "path",
 
2499
        //       "required": true,
 
2500
        //       "type": "string"
 
2501
        //     },
 
2502
        //     "itemId": {
 
2503
        //       "description": "The ID of the timeline item the attachment belongs to.",
 
2504
        //       "location": "path",
 
2505
        //       "required": true,
 
2506
        //       "type": "string"
 
2507
        //     }
 
2508
        //   },
 
2509
        //   "path": "timeline/{itemId}/attachments/{attachmentId}",
 
2510
        //   "scopes": [
 
2511
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2512
        //   ]
 
2513
        // }
 
2514
 
 
2515
}
 
2516
 
 
2517
// method id "mirror.timeline.attachments.get":
 
2518
 
 
2519
type TimelineAttachmentsGetCall struct {
 
2520
        s            *Service
 
2521
        itemId       string
 
2522
        attachmentId string
 
2523
        opt_         map[string]interface{}
 
2524
}
 
2525
 
 
2526
// Get: Retrieves an attachment on a timeline item by item ID and
 
2527
// attachment ID.
 
2528
func (r *TimelineAttachmentsService) Get(itemId string, attachmentId string) *TimelineAttachmentsGetCall {
 
2529
        c := &TimelineAttachmentsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
2530
        c.itemId = itemId
 
2531
        c.attachmentId = attachmentId
 
2532
        return c
 
2533
}
 
2534
 
 
2535
// Fields allows partial responses to be retrieved.
 
2536
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2537
// for more information.
 
2538
func (c *TimelineAttachmentsGetCall) Fields(s ...googleapi.Field) *TimelineAttachmentsGetCall {
 
2539
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2540
        return c
 
2541
}
 
2542
 
 
2543
func (c *TimelineAttachmentsGetCall) Do() (*Attachment, error) {
 
2544
        var body io.Reader = nil
 
2545
        params := make(url.Values)
 
2546
        params.Set("alt", "json")
 
2547
        if v, ok := c.opt_["fields"]; ok {
 
2548
                params.Set("fields", fmt.Sprintf("%v", v))
 
2549
        }
 
2550
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments/{attachmentId}")
 
2551
        urls += "?" + params.Encode()
 
2552
        req, _ := http.NewRequest("GET", urls, body)
 
2553
        googleapi.Expand(req.URL, map[string]string{
 
2554
                "itemId":       c.itemId,
 
2555
                "attachmentId": c.attachmentId,
 
2556
        })
 
2557
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2558
        res, err := c.s.client.Do(req)
 
2559
        if err != nil {
 
2560
                return nil, err
 
2561
        }
 
2562
        defer googleapi.CloseBody(res)
 
2563
        if err := googleapi.CheckResponse(res); err != nil {
 
2564
                return nil, err
 
2565
        }
 
2566
        var ret *Attachment
 
2567
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2568
                return nil, err
 
2569
        }
 
2570
        return ret, nil
 
2571
        // {
 
2572
        //   "description": "Retrieves an attachment on a timeline item by item ID and attachment ID.",
 
2573
        //   "httpMethod": "GET",
 
2574
        //   "id": "mirror.timeline.attachments.get",
 
2575
        //   "parameterOrder": [
 
2576
        //     "itemId",
 
2577
        //     "attachmentId"
 
2578
        //   ],
 
2579
        //   "parameters": {
 
2580
        //     "attachmentId": {
 
2581
        //       "description": "The ID of the attachment.",
 
2582
        //       "location": "path",
 
2583
        //       "required": true,
 
2584
        //       "type": "string"
 
2585
        //     },
 
2586
        //     "itemId": {
 
2587
        //       "description": "The ID of the timeline item the attachment belongs to.",
 
2588
        //       "location": "path",
 
2589
        //       "required": true,
 
2590
        //       "type": "string"
 
2591
        //     }
 
2592
        //   },
 
2593
        //   "path": "timeline/{itemId}/attachments/{attachmentId}",
 
2594
        //   "response": {
 
2595
        //     "$ref": "Attachment"
 
2596
        //   },
 
2597
        //   "scopes": [
 
2598
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2599
        //   ],
 
2600
        //   "supportsMediaDownload": true
 
2601
        // }
 
2602
 
 
2603
}
 
2604
 
 
2605
// method id "mirror.timeline.attachments.insert":
 
2606
 
 
2607
type TimelineAttachmentsInsertCall struct {
 
2608
        s      *Service
 
2609
        itemId string
 
2610
        opt_   map[string]interface{}
 
2611
        media_ io.Reader
 
2612
}
 
2613
 
 
2614
// Insert: Adds a new attachment to a timeline item.
 
2615
func (r *TimelineAttachmentsService) Insert(itemId string) *TimelineAttachmentsInsertCall {
 
2616
        c := &TimelineAttachmentsInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
2617
        c.itemId = itemId
 
2618
        return c
 
2619
}
 
2620
func (c *TimelineAttachmentsInsertCall) Media(r io.Reader) *TimelineAttachmentsInsertCall {
 
2621
        c.media_ = r
 
2622
        return c
 
2623
}
 
2624
 
 
2625
// Fields allows partial responses to be retrieved.
 
2626
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2627
// for more information.
 
2628
func (c *TimelineAttachmentsInsertCall) Fields(s ...googleapi.Field) *TimelineAttachmentsInsertCall {
 
2629
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2630
        return c
 
2631
}
 
2632
 
 
2633
func (c *TimelineAttachmentsInsertCall) Do() (*Attachment, error) {
 
2634
        var body io.Reader = nil
 
2635
        params := make(url.Values)
 
2636
        params.Set("alt", "json")
 
2637
        if v, ok := c.opt_["fields"]; ok {
 
2638
                params.Set("fields", fmt.Sprintf("%v", v))
 
2639
        }
 
2640
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments")
 
2641
        if c.media_ != nil {
 
2642
                urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
 
2643
                params.Set("uploadType", "multipart")
 
2644
        }
 
2645
        urls += "?" + params.Encode()
 
2646
        body = new(bytes.Buffer)
 
2647
        ctype := "application/json"
 
2648
        contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype)
 
2649
        req, _ := http.NewRequest("POST", urls, body)
 
2650
        googleapi.Expand(req.URL, map[string]string{
 
2651
                "itemId": c.itemId,
 
2652
        })
 
2653
        if hasMedia_ {
 
2654
                req.ContentLength = contentLength_
 
2655
        }
 
2656
        req.Header.Set("Content-Type", ctype)
 
2657
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2658
        res, err := c.s.client.Do(req)
 
2659
        if err != nil {
 
2660
                return nil, err
 
2661
        }
 
2662
        defer googleapi.CloseBody(res)
 
2663
        if err := googleapi.CheckResponse(res); err != nil {
 
2664
                return nil, err
 
2665
        }
 
2666
        var ret *Attachment
 
2667
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2668
                return nil, err
 
2669
        }
 
2670
        return ret, nil
 
2671
        // {
 
2672
        //   "description": "Adds a new attachment to a timeline item.",
 
2673
        //   "httpMethod": "POST",
 
2674
        //   "id": "mirror.timeline.attachments.insert",
 
2675
        //   "mediaUpload": {
 
2676
        //     "accept": [
 
2677
        //       "audio/*",
 
2678
        //       "image/*",
 
2679
        //       "video/*"
 
2680
        //     ],
 
2681
        //     "maxSize": "10MB",
 
2682
        //     "protocols": {
 
2683
        //       "resumable": {
 
2684
        //         "multipart": true,
 
2685
        //         "path": "/resumable/upload/mirror/v1/timeline/{itemId}/attachments"
 
2686
        //       },
 
2687
        //       "simple": {
 
2688
        //         "multipart": true,
 
2689
        //         "path": "/upload/mirror/v1/timeline/{itemId}/attachments"
 
2690
        //       }
 
2691
        //     }
 
2692
        //   },
 
2693
        //   "parameterOrder": [
 
2694
        //     "itemId"
 
2695
        //   ],
 
2696
        //   "parameters": {
 
2697
        //     "itemId": {
 
2698
        //       "description": "The ID of the timeline item the attachment belongs to.",
 
2699
        //       "location": "path",
 
2700
        //       "required": true,
 
2701
        //       "type": "string"
 
2702
        //     }
 
2703
        //   },
 
2704
        //   "path": "timeline/{itemId}/attachments",
 
2705
        //   "response": {
 
2706
        //     "$ref": "Attachment"
 
2707
        //   },
 
2708
        //   "scopes": [
 
2709
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2710
        //   ],
 
2711
        //   "supportsMediaUpload": true
 
2712
        // }
 
2713
 
 
2714
}
 
2715
 
 
2716
// method id "mirror.timeline.attachments.list":
 
2717
 
 
2718
type TimelineAttachmentsListCall struct {
 
2719
        s      *Service
 
2720
        itemId string
 
2721
        opt_   map[string]interface{}
 
2722
}
 
2723
 
 
2724
// List: Returns a list of attachments for a timeline item.
 
2725
func (r *TimelineAttachmentsService) List(itemId string) *TimelineAttachmentsListCall {
 
2726
        c := &TimelineAttachmentsListCall{s: r.s, opt_: make(map[string]interface{})}
 
2727
        c.itemId = itemId
 
2728
        return c
 
2729
}
 
2730
 
 
2731
// Fields allows partial responses to be retrieved.
 
2732
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2733
// for more information.
 
2734
func (c *TimelineAttachmentsListCall) Fields(s ...googleapi.Field) *TimelineAttachmentsListCall {
 
2735
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2736
        return c
 
2737
}
 
2738
 
 
2739
func (c *TimelineAttachmentsListCall) Do() (*AttachmentsListResponse, error) {
 
2740
        var body io.Reader = nil
 
2741
        params := make(url.Values)
 
2742
        params.Set("alt", "json")
 
2743
        if v, ok := c.opt_["fields"]; ok {
 
2744
                params.Set("fields", fmt.Sprintf("%v", v))
 
2745
        }
 
2746
        urls := googleapi.ResolveRelative(c.s.BasePath, "timeline/{itemId}/attachments")
 
2747
        urls += "?" + params.Encode()
 
2748
        req, _ := http.NewRequest("GET", urls, body)
 
2749
        googleapi.Expand(req.URL, map[string]string{
 
2750
                "itemId": c.itemId,
 
2751
        })
 
2752
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2753
        res, err := c.s.client.Do(req)
 
2754
        if err != nil {
 
2755
                return nil, err
 
2756
        }
 
2757
        defer googleapi.CloseBody(res)
 
2758
        if err := googleapi.CheckResponse(res); err != nil {
 
2759
                return nil, err
 
2760
        }
 
2761
        var ret *AttachmentsListResponse
 
2762
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2763
                return nil, err
 
2764
        }
 
2765
        return ret, nil
 
2766
        // {
 
2767
        //   "description": "Returns a list of attachments for a timeline item.",
 
2768
        //   "httpMethod": "GET",
 
2769
        //   "id": "mirror.timeline.attachments.list",
 
2770
        //   "parameterOrder": [
 
2771
        //     "itemId"
 
2772
        //   ],
 
2773
        //   "parameters": {
 
2774
        //     "itemId": {
 
2775
        //       "description": "The ID of the timeline item whose attachments should be listed.",
 
2776
        //       "location": "path",
 
2777
        //       "required": true,
 
2778
        //       "type": "string"
 
2779
        //     }
 
2780
        //   },
 
2781
        //   "path": "timeline/{itemId}/attachments",
 
2782
        //   "response": {
 
2783
        //     "$ref": "AttachmentsListResponse"
 
2784
        //   },
 
2785
        //   "scopes": [
 
2786
        //     "https://www.googleapis.com/auth/glass.timeline"
 
2787
        //   ]
 
2788
        // }
 
2789
 
 
2790
}