~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/calendar/v3/calendar-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package calendar provides access to the Calendar API.
 
2
//
 
3
// See https://developers.google.com/google-apps/calendar/firstapp
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/calendar/v3"
 
8
//   ...
 
9
//   calendarService, err := calendar.New(oauthHttpClient)
 
10
package calendar
 
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 = "calendar:v3"
 
38
const apiName = "calendar"
 
39
const apiVersion = "v3"
 
40
const basePath = "https://www.googleapis.com/calendar/v3/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // Manage your calendars
 
45
        CalendarScope = "https://www.googleapis.com/auth/calendar"
 
46
 
 
47
        // View your calendars
 
48
        CalendarReadonlyScope = "https://www.googleapis.com/auth/calendar.readonly"
 
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.Acl = NewAclService(s)
 
57
        s.CalendarList = NewCalendarListService(s)
 
58
        s.Calendars = NewCalendarsService(s)
 
59
        s.Channels = NewChannelsService(s)
 
60
        s.Colors = NewColorsService(s)
 
61
        s.Events = NewEventsService(s)
 
62
        s.Freebusy = NewFreebusyService(s)
 
63
        s.Settings = NewSettingsService(s)
 
64
        return s, nil
 
65
}
 
66
 
 
67
type Service struct {
 
68
        client   *http.Client
 
69
        BasePath string // API endpoint base URL
 
70
 
 
71
        Acl *AclService
 
72
 
 
73
        CalendarList *CalendarListService
 
74
 
 
75
        Calendars *CalendarsService
 
76
 
 
77
        Channels *ChannelsService
 
78
 
 
79
        Colors *ColorsService
 
80
 
 
81
        Events *EventsService
 
82
 
 
83
        Freebusy *FreebusyService
 
84
 
 
85
        Settings *SettingsService
 
86
}
 
87
 
 
88
func NewAclService(s *Service) *AclService {
 
89
        rs := &AclService{s: s}
 
90
        return rs
 
91
}
 
92
 
 
93
type AclService struct {
 
94
        s *Service
 
95
}
 
96
 
 
97
func NewCalendarListService(s *Service) *CalendarListService {
 
98
        rs := &CalendarListService{s: s}
 
99
        return rs
 
100
}
 
101
 
 
102
type CalendarListService struct {
 
103
        s *Service
 
104
}
 
105
 
 
106
func NewCalendarsService(s *Service) *CalendarsService {
 
107
        rs := &CalendarsService{s: s}
 
108
        return rs
 
109
}
 
110
 
 
111
type CalendarsService struct {
 
112
        s *Service
 
113
}
 
114
 
 
115
func NewChannelsService(s *Service) *ChannelsService {
 
116
        rs := &ChannelsService{s: s}
 
117
        return rs
 
118
}
 
119
 
 
120
type ChannelsService struct {
 
121
        s *Service
 
122
}
 
123
 
 
124
func NewColorsService(s *Service) *ColorsService {
 
125
        rs := &ColorsService{s: s}
 
126
        return rs
 
127
}
 
128
 
 
129
type ColorsService struct {
 
130
        s *Service
 
131
}
 
132
 
 
133
func NewEventsService(s *Service) *EventsService {
 
134
        rs := &EventsService{s: s}
 
135
        return rs
 
136
}
 
137
 
 
138
type EventsService struct {
 
139
        s *Service
 
140
}
 
141
 
 
142
func NewFreebusyService(s *Service) *FreebusyService {
 
143
        rs := &FreebusyService{s: s}
 
144
        return rs
 
145
}
 
146
 
 
147
type FreebusyService struct {
 
148
        s *Service
 
149
}
 
150
 
 
151
func NewSettingsService(s *Service) *SettingsService {
 
152
        rs := &SettingsService{s: s}
 
153
        return rs
 
154
}
 
155
 
 
156
type SettingsService struct {
 
157
        s *Service
 
158
}
 
159
 
 
160
type Acl struct {
 
161
        // Etag: ETag of the collection.
 
162
        Etag string `json:"etag,omitempty"`
 
163
 
 
164
        // Items: List of rules on the access control list.
 
165
        Items []*AclRule `json:"items,omitempty"`
 
166
 
 
167
        // Kind: Type of the collection ("calendar#acl").
 
168
        Kind string `json:"kind,omitempty"`
 
169
 
 
170
        // NextPageToken: Token used to access the next page of this result.
 
171
        // Omitted if no further results are available, in which case
 
172
        // nextSyncToken is provided.
 
173
        NextPageToken string `json:"nextPageToken,omitempty"`
 
174
 
 
175
        // NextSyncToken: Token used at a later point in time to retrieve only
 
176
        // the entries that have changed since this result was returned. Omitted
 
177
        // if further results are available, in which case nextPageToken is
 
178
        // provided.
 
179
        NextSyncToken string `json:"nextSyncToken,omitempty"`
 
180
}
 
181
 
 
182
type AclRule struct {
 
183
        // Etag: ETag of the resource.
 
184
        Etag string `json:"etag,omitempty"`
 
185
 
 
186
        // Id: Identifier of the ACL rule.
 
187
        Id string `json:"id,omitempty"`
 
188
 
 
189
        // Kind: Type of the resource ("calendar#aclRule").
 
190
        Kind string `json:"kind,omitempty"`
 
191
 
 
192
        // Role: The role assigned to the scope. Possible values are:
 
193
        // - "none"
 
194
        // - Provides no access.
 
195
        // - "freeBusyReader" - Provides read access to
 
196
        // free/busy information.
 
197
        // - "reader" - Provides read access to the
 
198
        // calendar. Private events will appear to users with reader access, but
 
199
        // event details will be hidden.
 
200
        // - "writer" - Provides read and write
 
201
        // access to the calendar. Private events will appear to users with
 
202
        // writer access, and event details will be visible.
 
203
        // - "owner" -
 
204
        // Provides ownership of the calendar. This role has all of the
 
205
        // permissions of the writer role with the additional ability to see and
 
206
        // manipulate ACLs.
 
207
        Role string `json:"role,omitempty"`
 
208
 
 
209
        // Scope: The scope of the rule.
 
210
        Scope *AclRuleScope `json:"scope,omitempty"`
 
211
}
 
212
 
 
213
type AclRuleScope struct {
 
214
        // Type: The type of the scope. Possible values are:
 
215
        // - "default" - The
 
216
        // public scope. This is the default value.
 
217
        // - "user" - Limits the scope
 
218
        // to a single user.
 
219
        // - "group" - Limits the scope to a group.
 
220
        // -
 
221
        // "domain" - Limits the scope to a domain.  Note: The permissions
 
222
        // granted to the "default", or public, scope apply to any user,
 
223
        // authenticated or not.
 
224
        Type string `json:"type,omitempty"`
 
225
 
 
226
        // Value: The email address of a user or group, or the name of a domain,
 
227
        // depending on the scope type. Omitted for type "default".
 
228
        Value string `json:"value,omitempty"`
 
229
}
 
230
 
 
231
type Calendar struct {
 
232
        // Description: Description of the calendar. Optional.
 
233
        Description string `json:"description,omitempty"`
 
234
 
 
235
        // Etag: ETag of the resource.
 
236
        Etag string `json:"etag,omitempty"`
 
237
 
 
238
        // Id: Identifier of the calendar.
 
239
        Id string `json:"id,omitempty"`
 
240
 
 
241
        // Kind: Type of the resource ("calendar#calendar").
 
242
        Kind string `json:"kind,omitempty"`
 
243
 
 
244
        // Location: Geographic location of the calendar as free-form text.
 
245
        // Optional.
 
246
        Location string `json:"location,omitempty"`
 
247
 
 
248
        // Summary: Title of the calendar.
 
249
        Summary string `json:"summary,omitempty"`
 
250
 
 
251
        // TimeZone: The time zone of the calendar. Optional.
 
252
        TimeZone string `json:"timeZone,omitempty"`
 
253
}
 
254
 
 
255
type CalendarList struct {
 
256
        // Etag: ETag of the collection.
 
257
        Etag string `json:"etag,omitempty"`
 
258
 
 
259
        // Items: Calendars that are present on the user's calendar list.
 
260
        Items []*CalendarListEntry `json:"items,omitempty"`
 
261
 
 
262
        // Kind: Type of the collection ("calendar#calendarList").
 
263
        Kind string `json:"kind,omitempty"`
 
264
 
 
265
        // NextPageToken: Token used to access the next page of this result.
 
266
        // Omitted if no further results are available, in which case
 
267
        // nextSyncToken is provided.
 
268
        NextPageToken string `json:"nextPageToken,omitempty"`
 
269
 
 
270
        // NextSyncToken: Token used at a later point in time to retrieve only
 
271
        // the entries that have changed since this result was returned. Omitted
 
272
        // if further results are available, in which case nextPageToken is
 
273
        // provided.
 
274
        NextSyncToken string `json:"nextSyncToken,omitempty"`
 
275
}
 
276
 
 
277
type CalendarListEntry struct {
 
278
        // AccessRole: The effective access role that the authenticated user has
 
279
        // on the calendar. Read-only. Possible values are:
 
280
        // - "freeBusyReader"
 
281
        // - Provides read access to free/busy information.
 
282
        // - "reader" -
 
283
        // Provides read access to the calendar. Private events will appear to
 
284
        // users with reader access, but event details will be hidden.
 
285
        // -
 
286
        // "writer" - Provides read and write access to the calendar. Private
 
287
        // events will appear to users with writer access, and event details
 
288
        // will be visible.
 
289
        // - "owner" - Provides ownership of the calendar.
 
290
        // This role has all of the permissions of the writer role with the
 
291
        // additional ability to see and manipulate ACLs.
 
292
        AccessRole string `json:"accessRole,omitempty"`
 
293
 
 
294
        // BackgroundColor: The main color of the calendar in the hexadecimal
 
295
        // format "#0088aa". This property supersedes the index-based colorId
 
296
        // property. Optional.
 
297
        BackgroundColor string `json:"backgroundColor,omitempty"`
 
298
 
 
299
        // ColorId: The color of the calendar. This is an ID referring to an
 
300
        // entry in the calendar section of the colors definition (see the
 
301
        // colors endpoint). Optional.
 
302
        ColorId string `json:"colorId,omitempty"`
 
303
 
 
304
        // DefaultReminders: The default reminders that the authenticated user
 
305
        // has for this calendar.
 
306
        DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"`
 
307
 
 
308
        // Deleted: Whether this calendar list entry has been deleted from the
 
309
        // calendar list. Read-only. Optional. The default is False.
 
310
        Deleted bool `json:"deleted,omitempty"`
 
311
 
 
312
        // Description: Description of the calendar. Optional. Read-only.
 
313
        Description string `json:"description,omitempty"`
 
314
 
 
315
        // Etag: ETag of the resource.
 
316
        Etag string `json:"etag,omitempty"`
 
317
 
 
318
        // ForegroundColor: The foreground color of the calendar in the
 
319
        // hexadecimal format "#ffffff". This property supersedes the
 
320
        // index-based colorId property. Optional.
 
321
        ForegroundColor string `json:"foregroundColor,omitempty"`
 
322
 
 
323
        // Hidden: Whether the calendar has been hidden from the list. Optional.
 
324
        // The default is False.
 
325
        Hidden bool `json:"hidden,omitempty"`
 
326
 
 
327
        // Id: Identifier of the calendar.
 
328
        Id string `json:"id,omitempty"`
 
329
 
 
330
        // Kind: Type of the resource ("calendar#calendarListEntry").
 
331
        Kind string `json:"kind,omitempty"`
 
332
 
 
333
        // Location: Geographic location of the calendar as free-form text.
 
334
        // Optional. Read-only.
 
335
        Location string `json:"location,omitempty"`
 
336
 
 
337
        // NotificationSettings: The notifications that the authenticated user
 
338
        // is receiving for this calendar.
 
339
        NotificationSettings *CalendarListEntryNotificationSettings `json:"notificationSettings,omitempty"`
 
340
 
 
341
        // Primary: Whether the calendar is the primary calendar of the
 
342
        // authenticated user. Read-only. Optional. The default is False.
 
343
        Primary bool `json:"primary,omitempty"`
 
344
 
 
345
        // Selected: Whether the calendar content shows up in the calendar UI.
 
346
        // Optional. The default is False.
 
347
        Selected bool `json:"selected,omitempty"`
 
348
 
 
349
        // Summary: Title of the calendar. Read-only.
 
350
        Summary string `json:"summary,omitempty"`
 
351
 
 
352
        // SummaryOverride: The summary that the authenticated user has set for
 
353
        // this calendar. Optional.
 
354
        SummaryOverride string `json:"summaryOverride,omitempty"`
 
355
 
 
356
        // TimeZone: The time zone of the calendar. Optional. Read-only.
 
357
        TimeZone string `json:"timeZone,omitempty"`
 
358
}
 
359
 
 
360
type CalendarListEntryNotificationSettings struct {
 
361
        // Notifications: The list of notifications set for this calendar.
 
362
        Notifications []*CalendarNotification `json:"notifications,omitempty"`
 
363
}
 
364
 
 
365
type CalendarNotification struct {
 
366
        // Method: The method used to deliver the notification. Possible values
 
367
        // are:
 
368
        // - "email" - Reminders are sent via email.
 
369
        // - "sms" - Reminders
 
370
        // are sent via SMS. This value is read-only and is ignored on inserts
 
371
        // and updates.
 
372
        Method string `json:"method,omitempty"`
 
373
 
 
374
        // Type: The type of notification. Possible values are:
 
375
        // -
 
376
        // "eventCreation" - Notification sent when a new event is put on the
 
377
        // calendar.
 
378
        // - "eventChange" - Notification sent when an event is
 
379
        // changed.
 
380
        // - "eventCancellation" - Notification sent when an event is
 
381
        // cancelled.
 
382
        // - "eventResponse" - Notification sent when an event is
 
383
        // changed.
 
384
        // - "agenda" - An agenda with the events of the day (sent out
 
385
        // in the morning).
 
386
        Type string `json:"type,omitempty"`
 
387
}
 
388
 
 
389
type Channel struct {
 
390
        // Address: The address where notifications are delivered for this
 
391
        // channel.
 
392
        Address string `json:"address,omitempty"`
 
393
 
 
394
        // Expiration: Date and time of notification channel expiration,
 
395
        // expressed as a Unix timestamp, in milliseconds. Optional.
 
396
        Expiration int64 `json:"expiration,omitempty,string"`
 
397
 
 
398
        // Id: A UUID or similar unique string that identifies this channel.
 
399
        Id string `json:"id,omitempty"`
 
400
 
 
401
        // Kind: Identifies this as a notification channel used to watch for
 
402
        // changes to a resource. Value: the fixed string "api#channel".
 
403
        Kind string `json:"kind,omitempty"`
 
404
 
 
405
        // Params: Additional parameters controlling delivery channel behavior.
 
406
        // Optional.
 
407
        Params map[string]string `json:"params,omitempty"`
 
408
 
 
409
        // Payload: A Boolean value to indicate whether payload is wanted.
 
410
        // Optional.
 
411
        Payload bool `json:"payload,omitempty"`
 
412
 
 
413
        // ResourceId: An opaque ID that identifies the resource being watched
 
414
        // on this channel. Stable across different API versions.
 
415
        ResourceId string `json:"resourceId,omitempty"`
 
416
 
 
417
        // ResourceUri: A version-specific identifier for the watched resource.
 
418
        ResourceUri string `json:"resourceUri,omitempty"`
 
419
 
 
420
        // Token: An arbitrary string delivered to the target address with each
 
421
        // notification delivered over this channel. Optional.
 
422
        Token string `json:"token,omitempty"`
 
423
 
 
424
        // Type: The type of delivery mechanism used for this channel.
 
425
        Type string `json:"type,omitempty"`
 
426
}
 
427
 
 
428
type ColorDefinition struct {
 
429
        // Background: The background color associated with this color
 
430
        // definition.
 
431
        Background string `json:"background,omitempty"`
 
432
 
 
433
        // Foreground: The foreground color that can be used to write on top of
 
434
        // a background with 'background' color.
 
435
        Foreground string `json:"foreground,omitempty"`
 
436
}
 
437
 
 
438
type Colors struct {
 
439
        // Calendar: Palette of calendar colors, mapping from the color ID to
 
440
        // its definition. A calendarListEntry resource refers to one of these
 
441
        // color IDs in its color field. Read-only.
 
442
        Calendar map[string]ColorDefinition `json:"calendar,omitempty"`
 
443
 
 
444
        // Event: Palette of event colors, mapping from the color ID to its
 
445
        // definition. An event resource may refer to one of these color IDs in
 
446
        // its color field. Read-only.
 
447
        Event map[string]ColorDefinition `json:"event,omitempty"`
 
448
 
 
449
        // Kind: Type of the resource ("calendar#colors").
 
450
        Kind string `json:"kind,omitempty"`
 
451
 
 
452
        // Updated: Last modification time of the color palette (as a RFC 3339
 
453
        // timestamp). Read-only.
 
454
        Updated string `json:"updated,omitempty"`
 
455
}
 
456
 
 
457
type Error struct {
 
458
        // Domain: Domain, or broad category, of the error.
 
459
        Domain string `json:"domain,omitempty"`
 
460
 
 
461
        // Reason: Specific reason for the error. Some of the possible values
 
462
        // are:
 
463
        // - "groupTooBig" - The group of users requested is too large
 
464
        // for a single query.
 
465
        // - "tooManyCalendarsRequested" - The number of
 
466
        // calendars requested is too large for a single query.
 
467
        // - "notFound" -
 
468
        // The requested resource was not found.
 
469
        // - "internalError" - The API
 
470
        // service has encountered an internal error.  Additional error types
 
471
        // may be added in the future, so clients should gracefully handle
 
472
        // additional error statuses not included in this list.
 
473
        Reason string `json:"reason,omitempty"`
 
474
}
 
475
 
 
476
type Event struct {
 
477
        // AnyoneCanAddSelf: Whether anyone can invite themselves to the event.
 
478
        // Optional. The default is False.
 
479
        AnyoneCanAddSelf bool `json:"anyoneCanAddSelf,omitempty"`
 
480
 
 
481
        // Attendees: The attendees of the event.
 
482
        Attendees []*EventAttendee `json:"attendees,omitempty"`
 
483
 
 
484
        // AttendeesOmitted: Whether attendees may have been omitted from the
 
485
        // event's representation. When retrieving an event, this may be due to
 
486
        // a restriction specified by the maxAttendee query parameter. When
 
487
        // updating an event, this can be used to only update the participant's
 
488
        // response. Optional. The default is False.
 
489
        AttendeesOmitted bool `json:"attendeesOmitted,omitempty"`
 
490
 
 
491
        // ColorId: The color of the event. This is an ID referring to an entry
 
492
        // in the event section of the colors definition (see the  colors
 
493
        // endpoint). Optional.
 
494
        ColorId string `json:"colorId,omitempty"`
 
495
 
 
496
        // Created: Creation time of the event (as a RFC 3339 timestamp).
 
497
        // Read-only.
 
498
        Created string `json:"created,omitempty"`
 
499
 
 
500
        // Creator: The creator of the event. Read-only.
 
501
        Creator *EventCreator `json:"creator,omitempty"`
 
502
 
 
503
        // Description: Description of the event. Optional.
 
504
        Description string `json:"description,omitempty"`
 
505
 
 
506
        // End: The (exclusive) end time of the event. For a recurring event,
 
507
        // this is the end time of the first instance.
 
508
        End *EventDateTime `json:"end,omitempty"`
 
509
 
 
510
        // EndTimeUnspecified: Whether the end time is actually unspecified. An
 
511
        // end time is still provided for compatibility reasons, even if this
 
512
        // attribute is set to True. The default is False.
 
513
        EndTimeUnspecified bool `json:"endTimeUnspecified,omitempty"`
 
514
 
 
515
        // Etag: ETag of the resource.
 
516
        Etag string `json:"etag,omitempty"`
 
517
 
 
518
        // ExtendedProperties: Extended properties of the event.
 
519
        ExtendedProperties *EventExtendedProperties `json:"extendedProperties,omitempty"`
 
520
 
 
521
        // Gadget: A gadget that extends this event.
 
522
        Gadget *EventGadget `json:"gadget,omitempty"`
 
523
 
 
524
        // GuestsCanInviteOthers: Whether attendees other than the organizer can
 
525
        // invite others to the event. Optional. The default is True.
 
526
        GuestsCanInviteOthers bool `json:"guestsCanInviteOthers,omitempty"`
 
527
 
 
528
        // GuestsCanModify: Whether attendees other than the organizer can
 
529
        // modify the event. Optional. The default is False.
 
530
        GuestsCanModify bool `json:"guestsCanModify,omitempty"`
 
531
 
 
532
        // GuestsCanSeeOtherGuests: Whether attendees other than the organizer
 
533
        // can see who the event's attendees are. Optional. The default is True.
 
534
        GuestsCanSeeOtherGuests bool `json:"guestsCanSeeOtherGuests,omitempty"`
 
535
 
 
536
        // HangoutLink: An absolute link to the Google+ hangout associated with
 
537
        // this event. Read-only.
 
538
        HangoutLink string `json:"hangoutLink,omitempty"`
 
539
 
 
540
        // HtmlLink: An absolute link to this event in the Google Calendar Web
 
541
        // UI. Read-only.
 
542
        HtmlLink string `json:"htmlLink,omitempty"`
 
543
 
 
544
        // ICalUID: Event ID in the iCalendar format.
 
545
        ICalUID string `json:"iCalUID,omitempty"`
 
546
 
 
547
        // Id: Identifier of the event. When creating new single or recurring
 
548
        // events, you can specify their IDs. Provided IDs must follow these
 
549
        // rules:
 
550
        // - characters allowed in the ID are those used in base32hex
 
551
        // encoding, i.e. lowercase letters a-v and digits 0-9, see section
 
552
        // 3.1.2 in RFC2938
 
553
        // - the length of the ID must be between 5 and 1024
 
554
        // characters
 
555
        // - the ID must be unique per calendar  Due to the globally
 
556
        // distributed nature of the system, we cannot guarantee that ID
 
557
        // collisions will be detected at event creation time. To minimize the
 
558
        // risk of collisions we recommend using an established UUID algorithm
 
559
        // such as one described in RFC4122.
 
560
        Id string `json:"id,omitempty"`
 
561
 
 
562
        // Kind: Type of the resource ("calendar#event").
 
563
        Kind string `json:"kind,omitempty"`
 
564
 
 
565
        // Location: Geographic location of the event as free-form text.
 
566
        // Optional.
 
567
        Location string `json:"location,omitempty"`
 
568
 
 
569
        // Locked: Whether this is a locked event copy where no changes can be
 
570
        // made to the main event fields "summary", "description", "location",
 
571
        // "start", "end" or "recurrence". The default is False. Read-Only.
 
572
        Locked bool `json:"locked,omitempty"`
 
573
 
 
574
        // Organizer: The organizer of the event. If the organizer is also an
 
575
        // attendee, this is indicated with a separate entry in attendees with
 
576
        // the organizer field set to True. To change the organizer, use the
 
577
        // move operation. Read-only, except when importing an event.
 
578
        Organizer *EventOrganizer `json:"organizer,omitempty"`
 
579
 
 
580
        // OriginalStartTime: For an instance of a recurring event, this is the
 
581
        // time at which this event would start according to the recurrence data
 
582
        // in the recurring event identified by recurringEventId. Immutable.
 
583
        OriginalStartTime *EventDateTime `json:"originalStartTime,omitempty"`
 
584
 
 
585
        // PrivateCopy: Whether this is a private event copy where changes are
 
586
        // not shared with other copies on other calendars. Optional. Immutable.
 
587
        // The default is False.
 
588
        PrivateCopy bool `json:"privateCopy,omitempty"`
 
589
 
 
590
        // Recurrence: List of RRULE, EXRULE, RDATE and EXDATE lines for a
 
591
        // recurring event. This field is omitted for single events or instances
 
592
        // of recurring events.
 
593
        Recurrence []string `json:"recurrence,omitempty"`
 
594
 
 
595
        // RecurringEventId: For an instance of a recurring event, this is the
 
596
        // event ID of the recurring event itself. Immutable.
 
597
        RecurringEventId string `json:"recurringEventId,omitempty"`
 
598
 
 
599
        // Reminders: Information about the event's reminders for the
 
600
        // authenticated user.
 
601
        Reminders *EventReminders `json:"reminders,omitempty"`
 
602
 
 
603
        // Sequence: Sequence number as per iCalendar.
 
604
        Sequence int64 `json:"sequence,omitempty"`
 
605
 
 
606
        // Source: Source of an event from which it was created; for example a
 
607
        // web page, an email message or any document identifiable by an URL
 
608
        // using HTTP/HTTPS protocol. Accessible only by the creator of the
 
609
        // event.
 
610
        Source *EventSource `json:"source,omitempty"`
 
611
 
 
612
        // Start: The (inclusive) start time of the event. For a recurring
 
613
        // event, this is the start time of the first instance.
 
614
        Start *EventDateTime `json:"start,omitempty"`
 
615
 
 
616
        // Status: Status of the event. Optional. Possible values are:
 
617
        // -
 
618
        // "confirmed" - The event is confirmed. This is the default status.
 
619
        // -
 
620
        // "tentative" - The event is tentatively confirmed.
 
621
        // - "cancelled" -
 
622
        // The event is cancelled.
 
623
        Status string `json:"status,omitempty"`
 
624
 
 
625
        // Summary: Title of the event.
 
626
        Summary string `json:"summary,omitempty"`
 
627
 
 
628
        // Transparency: Whether the event blocks time on the calendar.
 
629
        // Optional. Possible values are:
 
630
        // - "opaque" - The event blocks time
 
631
        // on the calendar. This is the default value.
 
632
        // - "transparent" - The
 
633
        // event does not block time on the calendar.
 
634
        Transparency string `json:"transparency,omitempty"`
 
635
 
 
636
        // Updated: Last modification time of the event (as a RFC 3339
 
637
        // timestamp). Read-only.
 
638
        Updated string `json:"updated,omitempty"`
 
639
 
 
640
        // Visibility: Visibility of the event. Optional. Possible values are:
 
641
        //
 
642
        // - "default" - Uses the default visibility for events on the
 
643
        // calendar. This is the default value.
 
644
        // - "public" - The event is
 
645
        // public and event details are visible to all readers of the calendar.
 
646
        //
 
647
        // - "private" - The event is private and only event attendees may view
 
648
        // event details.
 
649
        // - "confidential" - The event is private. This value
 
650
        // is provided for compatibility reasons.
 
651
        Visibility string `json:"visibility,omitempty"`
 
652
}
 
653
 
 
654
type EventCreator struct {
 
655
        // DisplayName: The creator's name, if available.
 
656
        DisplayName string `json:"displayName,omitempty"`
 
657
 
 
658
        // Email: The creator's email address, if available.
 
659
        Email string `json:"email,omitempty"`
 
660
 
 
661
        // Id: The creator's Profile ID, if available.
 
662
        Id string `json:"id,omitempty"`
 
663
 
 
664
        // Self: Whether the creator corresponds to the calendar on which this
 
665
        // copy of the event appears. Read-only. The default is False.
 
666
        Self bool `json:"self,omitempty"`
 
667
}
 
668
 
 
669
type EventExtendedProperties struct {
 
670
        // Private: Properties that are private to the copy of the event that
 
671
        // appears on this calendar.
 
672
        Private map[string]string `json:"private,omitempty"`
 
673
 
 
674
        // Shared: Properties that are shared between copies of the event on
 
675
        // other attendees' calendars.
 
676
        Shared map[string]string `json:"shared,omitempty"`
 
677
}
 
678
 
 
679
type EventGadget struct {
 
680
        // Display: The gadget's display mode. Optional. Possible values are:
 
681
        //
 
682
        // - "icon" - The gadget displays next to the event's title in the
 
683
        // calendar view.
 
684
        // - "chip" - The gadget displays when the event is
 
685
        // clicked.
 
686
        Display string `json:"display,omitempty"`
 
687
 
 
688
        // Height: The gadget's height in pixels. Optional.
 
689
        Height int64 `json:"height,omitempty"`
 
690
 
 
691
        // IconLink: The gadget's icon URL.
 
692
        IconLink string `json:"iconLink,omitempty"`
 
693
 
 
694
        // Link: The gadget's URL.
 
695
        Link string `json:"link,omitempty"`
 
696
 
 
697
        // Preferences: Preferences.
 
698
        Preferences map[string]string `json:"preferences,omitempty"`
 
699
 
 
700
        // Title: The gadget's title.
 
701
        Title string `json:"title,omitempty"`
 
702
 
 
703
        // Type: The gadget's type.
 
704
        Type string `json:"type,omitempty"`
 
705
 
 
706
        // Width: The gadget's width in pixels. Optional.
 
707
        Width int64 `json:"width,omitempty"`
 
708
}
 
709
 
 
710
type EventOrganizer struct {
 
711
        // DisplayName: The organizer's name, if available.
 
712
        DisplayName string `json:"displayName,omitempty"`
 
713
 
 
714
        // Email: The organizer's email address, if available.
 
715
        Email string `json:"email,omitempty"`
 
716
 
 
717
        // Id: The organizer's Profile ID, if available.
 
718
        Id string `json:"id,omitempty"`
 
719
 
 
720
        // Self: Whether the organizer corresponds to the calendar on which this
 
721
        // copy of the event appears. Read-only. The default is False.
 
722
        Self bool `json:"self,omitempty"`
 
723
}
 
724
 
 
725
type EventReminders struct {
 
726
        // Overrides: If the event doesn't use the default reminders, this lists
 
727
        // the reminders specific to the event, or, if not set, indicates that
 
728
        // no reminders are set for this event.
 
729
        Overrides []*EventReminder `json:"overrides,omitempty"`
 
730
 
 
731
        // UseDefault: Whether the default reminders of the calendar apply to
 
732
        // the event.
 
733
        UseDefault bool `json:"useDefault,omitempty"`
 
734
}
 
735
 
 
736
type EventSource struct {
 
737
        // Title: Title of the source; for example a title of a web page or an
 
738
        // email subject.
 
739
        Title string `json:"title,omitempty"`
 
740
 
 
741
        // Url: URL of the source pointing to a resource. URL's protocol must be
 
742
        // HTTP or HTTPS.
 
743
        Url string `json:"url,omitempty"`
 
744
}
 
745
 
 
746
type EventAttachment struct {
 
747
        // Title: File name.
 
748
        Title string `json:"title,omitempty"`
 
749
}
 
750
 
 
751
type EventAttendee struct {
 
752
        // AdditionalGuests: Number of additional guests. Optional. The default
 
753
        // is 0.
 
754
        AdditionalGuests int64 `json:"additionalGuests,omitempty"`
 
755
 
 
756
        // Comment: The attendee's response comment. Optional.
 
757
        Comment string `json:"comment,omitempty"`
 
758
 
 
759
        // DisplayName: The attendee's name, if available. Optional.
 
760
        DisplayName string `json:"displayName,omitempty"`
 
761
 
 
762
        // Email: The attendee's email address, if available. This field must be
 
763
        // present when adding an attendee.
 
764
        Email string `json:"email,omitempty"`
 
765
 
 
766
        // Id: The attendee's Profile ID, if available.
 
767
        Id string `json:"id,omitempty"`
 
768
 
 
769
        // Optional: Whether this is an optional attendee. Optional. The default
 
770
        // is False.
 
771
        Optional bool `json:"optional,omitempty"`
 
772
 
 
773
        // Organizer: Whether the attendee is the organizer of the event.
 
774
        // Read-only. The default is False.
 
775
        Organizer bool `json:"organizer,omitempty"`
 
776
 
 
777
        // Resource: Whether the attendee is a resource. Read-only. The default
 
778
        // is False.
 
779
        Resource bool `json:"resource,omitempty"`
 
780
 
 
781
        // ResponseStatus: The attendee's response status. Possible values are:
 
782
        //
 
783
        // - "needsAction" - The attendee has not responded to the invitation.
 
784
        //
 
785
        // - "declined" - The attendee has declined the invitation.
 
786
        // -
 
787
        // "tentative" - The attendee has tentatively accepted the invitation.
 
788
        //
 
789
        // - "accepted" - The attendee has accepted the invitation.
 
790
        ResponseStatus string `json:"responseStatus,omitempty"`
 
791
 
 
792
        // Self: Whether this entry represents the calendar on which this copy
 
793
        // of the event appears. Read-only. The default is False.
 
794
        Self bool `json:"self,omitempty"`
 
795
}
 
796
 
 
797
type EventDateTime struct {
 
798
        // Date: The date, in the format "yyyy-mm-dd", if this is an all-day
 
799
        // event.
 
800
        Date string `json:"date,omitempty"`
 
801
 
 
802
        // DateTime: The time, as a combined date-time value (formatted
 
803
        // according to RFC 3339). A time zone offset is required unless a time
 
804
        // zone is explicitly specified in timeZone.
 
805
        DateTime string `json:"dateTime,omitempty"`
 
806
 
 
807
        // TimeZone: The name of the time zone in which the time is specified
 
808
        // (e.g. "Europe/Zurich"). For recurring events this field is required
 
809
        // and specifies the time zone in which the recurrence is expanded. For
 
810
        // single events this field is optional and indicates a custom time zone
 
811
        // for the event start/end.
 
812
        TimeZone string `json:"timeZone,omitempty"`
 
813
}
 
814
 
 
815
type EventReminder struct {
 
816
        // Method: The method used by this reminder. Possible values are:
 
817
        // -
 
818
        // "email" - Reminders are sent via email.
 
819
        // - "sms" - Reminders are sent
 
820
        // via SMS.
 
821
        // - "popup" - Reminders are sent via a UI popup.
 
822
        Method string `json:"method,omitempty"`
 
823
 
 
824
        // Minutes: Number of minutes before the start of the event when the
 
825
        // reminder should trigger.
 
826
        Minutes int64 `json:"minutes,omitempty"`
 
827
}
 
828
 
 
829
type Events struct {
 
830
        // AccessRole: The user's access role for this calendar. Read-only.
 
831
        // Possible values are:
 
832
        // - "none" - The user has no access.
 
833
        // -
 
834
        // "freeBusyReader" - The user has read access to free/busy information.
 
835
        //
 
836
        // - "reader" - The user has read access to the calendar. Private
 
837
        // events will appear to users with reader access, but event details
 
838
        // will be hidden.
 
839
        // - "writer" - The user has read and write access to
 
840
        // the calendar. Private events will appear to users with writer access,
 
841
        // and event details will be visible.
 
842
        // - "owner" - The user has
 
843
        // ownership of the calendar. This role has all of the permissions of
 
844
        // the writer role with the additional ability to see and manipulate
 
845
        // ACLs.
 
846
        AccessRole string `json:"accessRole,omitempty"`
 
847
 
 
848
        // DefaultReminders: The default reminders on the calendar for the
 
849
        // authenticated user. These reminders apply to all events on this
 
850
        // calendar that do not explicitly override them (i.e. do not have
 
851
        // reminders.useDefault set to True).
 
852
        DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"`
 
853
 
 
854
        // Description: Description of the calendar. Read-only.
 
855
        Description string `json:"description,omitempty"`
 
856
 
 
857
        // Etag: ETag of the collection.
 
858
        Etag string `json:"etag,omitempty"`
 
859
 
 
860
        // Items: List of events on the calendar.
 
861
        Items []*Event `json:"items,omitempty"`
 
862
 
 
863
        // Kind: Type of the collection ("calendar#events").
 
864
        Kind string `json:"kind,omitempty"`
 
865
 
 
866
        // NextPageToken: Token used to access the next page of this result.
 
867
        // Omitted if no further results are available, in which case
 
868
        // nextSyncToken is provided.
 
869
        NextPageToken string `json:"nextPageToken,omitempty"`
 
870
 
 
871
        // NextSyncToken: Token used at a later point in time to retrieve only
 
872
        // the entries that have changed since this result was returned. Omitted
 
873
        // if further results are available, in which case nextPageToken is
 
874
        // provided.
 
875
        NextSyncToken string `json:"nextSyncToken,omitempty"`
 
876
 
 
877
        // Summary: Title of the calendar. Read-only.
 
878
        Summary string `json:"summary,omitempty"`
 
879
 
 
880
        // TimeZone: The time zone of the calendar. Read-only.
 
881
        TimeZone string `json:"timeZone,omitempty"`
 
882
 
 
883
        // Updated: Last modification time of the calendar (as a RFC 3339
 
884
        // timestamp). Read-only.
 
885
        Updated string `json:"updated,omitempty"`
 
886
}
 
887
 
 
888
type FreeBusyCalendar struct {
 
889
        // Busy: List of time ranges during which this calendar should be
 
890
        // regarded as busy.
 
891
        Busy []*TimePeriod `json:"busy,omitempty"`
 
892
 
 
893
        // Errors: Optional error(s) (if computation for the calendar failed).
 
894
        Errors []*Error `json:"errors,omitempty"`
 
895
}
 
896
 
 
897
type FreeBusyGroup struct {
 
898
        // Calendars: List of calendars' identifiers within a group.
 
899
        Calendars []string `json:"calendars,omitempty"`
 
900
 
 
901
        // Errors: Optional error(s) (if computation for the group failed).
 
902
        Errors []*Error `json:"errors,omitempty"`
 
903
}
 
904
 
 
905
type FreeBusyRequest struct {
 
906
        // CalendarExpansionMax: Maximal number of calendars for which FreeBusy
 
907
        // information is to be provided. Optional.
 
908
        CalendarExpansionMax int64 `json:"calendarExpansionMax,omitempty"`
 
909
 
 
910
        // GroupExpansionMax: Maximal number of calendar identifiers to be
 
911
        // provided for a single group. Optional. An error will be returned for
 
912
        // a group with more members than this value.
 
913
        GroupExpansionMax int64 `json:"groupExpansionMax,omitempty"`
 
914
 
 
915
        // Items: List of calendars and/or groups to query.
 
916
        Items []*FreeBusyRequestItem `json:"items,omitempty"`
 
917
 
 
918
        // TimeMax: The end of the interval for the query.
 
919
        TimeMax string `json:"timeMax,omitempty"`
 
920
 
 
921
        // TimeMin: The start of the interval for the query.
 
922
        TimeMin string `json:"timeMin,omitempty"`
 
923
 
 
924
        // TimeZone: Time zone used in the response. Optional. The default is
 
925
        // UTC.
 
926
        TimeZone string `json:"timeZone,omitempty"`
 
927
}
 
928
 
 
929
type FreeBusyRequestItem struct {
 
930
        // Id: The identifier of a calendar or a group.
 
931
        Id string `json:"id,omitempty"`
 
932
}
 
933
 
 
934
type FreeBusyResponse struct {
 
935
        // Calendars: List of free/busy information for calendars.
 
936
        Calendars map[string]FreeBusyCalendar `json:"calendars,omitempty"`
 
937
 
 
938
        // Groups: Expansion of groups.
 
939
        Groups map[string]FreeBusyGroup `json:"groups,omitempty"`
 
940
 
 
941
        // Kind: Type of the resource ("calendar#freeBusy").
 
942
        Kind string `json:"kind,omitempty"`
 
943
 
 
944
        // TimeMax: The end of the interval.
 
945
        TimeMax string `json:"timeMax,omitempty"`
 
946
 
 
947
        // TimeMin: The start of the interval.
 
948
        TimeMin string `json:"timeMin,omitempty"`
 
949
}
 
950
 
 
951
type Setting struct {
 
952
        // Etag: ETag of the resource.
 
953
        Etag string `json:"etag,omitempty"`
 
954
 
 
955
        // Id: The id of the user setting.
 
956
        Id string `json:"id,omitempty"`
 
957
 
 
958
        // Kind: Type of the resource ("calendar#setting").
 
959
        Kind string `json:"kind,omitempty"`
 
960
 
 
961
        // Value: Value of the user setting. The format of the value depends on
 
962
        // the ID of the setting. It must always be a UTF-8 string of length up
 
963
        // to 1024 characters.
 
964
        Value string `json:"value,omitempty"`
 
965
}
 
966
 
 
967
type Settings struct {
 
968
        // Etag: Etag of the collection.
 
969
        Etag string `json:"etag,omitempty"`
 
970
 
 
971
        // Items: List of user settings.
 
972
        Items []*Setting `json:"items,omitempty"`
 
973
 
 
974
        // Kind: Type of the collection ("calendar#settings").
 
975
        Kind string `json:"kind,omitempty"`
 
976
 
 
977
        // NextPageToken: Token used to access the next page of this result.
 
978
        // Omitted if no further results are available, in which case
 
979
        // nextSyncToken is provided.
 
980
        NextPageToken string `json:"nextPageToken,omitempty"`
 
981
 
 
982
        // NextSyncToken: Token used at a later point in time to retrieve only
 
983
        // the entries that have changed since this result was returned. Omitted
 
984
        // if further results are available, in which case nextPageToken is
 
985
        // provided.
 
986
        NextSyncToken string `json:"nextSyncToken,omitempty"`
 
987
}
 
988
 
 
989
type TimePeriod struct {
 
990
        // End: The (exclusive) end of the time period.
 
991
        End string `json:"end,omitempty"`
 
992
 
 
993
        // Start: The (inclusive) start of the time period.
 
994
        Start string `json:"start,omitempty"`
 
995
}
 
996
 
 
997
// method id "calendar.acl.delete":
 
998
 
 
999
type AclDeleteCall struct {
 
1000
        s          *Service
 
1001
        calendarId string
 
1002
        ruleId     string
 
1003
        opt_       map[string]interface{}
 
1004
}
 
1005
 
 
1006
// Delete: Deletes an access control rule.
 
1007
func (r *AclService) Delete(calendarId string, ruleId string) *AclDeleteCall {
 
1008
        c := &AclDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
1009
        c.calendarId = calendarId
 
1010
        c.ruleId = ruleId
 
1011
        return c
 
1012
}
 
1013
 
 
1014
// Fields allows partial responses to be retrieved.
 
1015
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1016
// for more information.
 
1017
func (c *AclDeleteCall) Fields(s ...googleapi.Field) *AclDeleteCall {
 
1018
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1019
        return c
 
1020
}
 
1021
 
 
1022
func (c *AclDeleteCall) Do() error {
 
1023
        var body io.Reader = nil
 
1024
        params := make(url.Values)
 
1025
        params.Set("alt", "json")
 
1026
        if v, ok := c.opt_["fields"]; ok {
 
1027
                params.Set("fields", fmt.Sprintf("%v", v))
 
1028
        }
 
1029
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
 
1030
        urls += "?" + params.Encode()
 
1031
        req, _ := http.NewRequest("DELETE", urls, body)
 
1032
        googleapi.Expand(req.URL, map[string]string{
 
1033
                "calendarId": c.calendarId,
 
1034
                "ruleId":     c.ruleId,
 
1035
        })
 
1036
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1037
        res, err := c.s.client.Do(req)
 
1038
        if err != nil {
 
1039
                return err
 
1040
        }
 
1041
        defer googleapi.CloseBody(res)
 
1042
        if err := googleapi.CheckResponse(res); err != nil {
 
1043
                return err
 
1044
        }
 
1045
        return nil
 
1046
        // {
 
1047
        //   "description": "Deletes an access control rule.",
 
1048
        //   "httpMethod": "DELETE",
 
1049
        //   "id": "calendar.acl.delete",
 
1050
        //   "parameterOrder": [
 
1051
        //     "calendarId",
 
1052
        //     "ruleId"
 
1053
        //   ],
 
1054
        //   "parameters": {
 
1055
        //     "calendarId": {
 
1056
        //       "description": "Calendar identifier.",
 
1057
        //       "location": "path",
 
1058
        //       "required": true,
 
1059
        //       "type": "string"
 
1060
        //     },
 
1061
        //     "ruleId": {
 
1062
        //       "description": "ACL rule identifier.",
 
1063
        //       "location": "path",
 
1064
        //       "required": true,
 
1065
        //       "type": "string"
 
1066
        //     }
 
1067
        //   },
 
1068
        //   "path": "calendars/{calendarId}/acl/{ruleId}",
 
1069
        //   "scopes": [
 
1070
        //     "https://www.googleapis.com/auth/calendar"
 
1071
        //   ]
 
1072
        // }
 
1073
 
 
1074
}
 
1075
 
 
1076
// method id "calendar.acl.get":
 
1077
 
 
1078
type AclGetCall struct {
 
1079
        s          *Service
 
1080
        calendarId string
 
1081
        ruleId     string
 
1082
        opt_       map[string]interface{}
 
1083
}
 
1084
 
 
1085
// Get: Returns an access control rule.
 
1086
func (r *AclService) Get(calendarId string, ruleId string) *AclGetCall {
 
1087
        c := &AclGetCall{s: r.s, opt_: make(map[string]interface{})}
 
1088
        c.calendarId = calendarId
 
1089
        c.ruleId = ruleId
 
1090
        return c
 
1091
}
 
1092
 
 
1093
// Fields allows partial responses to be retrieved.
 
1094
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1095
// for more information.
 
1096
func (c *AclGetCall) Fields(s ...googleapi.Field) *AclGetCall {
 
1097
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1098
        return c
 
1099
}
 
1100
 
 
1101
func (c *AclGetCall) Do() (*AclRule, error) {
 
1102
        var body io.Reader = nil
 
1103
        params := make(url.Values)
 
1104
        params.Set("alt", "json")
 
1105
        if v, ok := c.opt_["fields"]; ok {
 
1106
                params.Set("fields", fmt.Sprintf("%v", v))
 
1107
        }
 
1108
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
 
1109
        urls += "?" + params.Encode()
 
1110
        req, _ := http.NewRequest("GET", urls, body)
 
1111
        googleapi.Expand(req.URL, map[string]string{
 
1112
                "calendarId": c.calendarId,
 
1113
                "ruleId":     c.ruleId,
 
1114
        })
 
1115
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1116
        res, err := c.s.client.Do(req)
 
1117
        if err != nil {
 
1118
                return nil, err
 
1119
        }
 
1120
        defer googleapi.CloseBody(res)
 
1121
        if err := googleapi.CheckResponse(res); err != nil {
 
1122
                return nil, err
 
1123
        }
 
1124
        var ret *AclRule
 
1125
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1126
                return nil, err
 
1127
        }
 
1128
        return ret, nil
 
1129
        // {
 
1130
        //   "description": "Returns an access control rule.",
 
1131
        //   "httpMethod": "GET",
 
1132
        //   "id": "calendar.acl.get",
 
1133
        //   "parameterOrder": [
 
1134
        //     "calendarId",
 
1135
        //     "ruleId"
 
1136
        //   ],
 
1137
        //   "parameters": {
 
1138
        //     "calendarId": {
 
1139
        //       "description": "Calendar identifier.",
 
1140
        //       "location": "path",
 
1141
        //       "required": true,
 
1142
        //       "type": "string"
 
1143
        //     },
 
1144
        //     "ruleId": {
 
1145
        //       "description": "ACL rule identifier.",
 
1146
        //       "location": "path",
 
1147
        //       "required": true,
 
1148
        //       "type": "string"
 
1149
        //     }
 
1150
        //   },
 
1151
        //   "path": "calendars/{calendarId}/acl/{ruleId}",
 
1152
        //   "response": {
 
1153
        //     "$ref": "AclRule"
 
1154
        //   },
 
1155
        //   "scopes": [
 
1156
        //     "https://www.googleapis.com/auth/calendar",
 
1157
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
1158
        //   ]
 
1159
        // }
 
1160
 
 
1161
}
 
1162
 
 
1163
// method id "calendar.acl.insert":
 
1164
 
 
1165
type AclInsertCall struct {
 
1166
        s          *Service
 
1167
        calendarId string
 
1168
        aclrule    *AclRule
 
1169
        opt_       map[string]interface{}
 
1170
}
 
1171
 
 
1172
// Insert: Creates an access control rule.
 
1173
func (r *AclService) Insert(calendarId string, aclrule *AclRule) *AclInsertCall {
 
1174
        c := &AclInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
1175
        c.calendarId = calendarId
 
1176
        c.aclrule = aclrule
 
1177
        return c
 
1178
}
 
1179
 
 
1180
// Fields allows partial responses to be retrieved.
 
1181
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1182
// for more information.
 
1183
func (c *AclInsertCall) Fields(s ...googleapi.Field) *AclInsertCall {
 
1184
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1185
        return c
 
1186
}
 
1187
 
 
1188
func (c *AclInsertCall) Do() (*AclRule, error) {
 
1189
        var body io.Reader = nil
 
1190
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
 
1191
        if err != nil {
 
1192
                return nil, err
 
1193
        }
 
1194
        ctype := "application/json"
 
1195
        params := make(url.Values)
 
1196
        params.Set("alt", "json")
 
1197
        if v, ok := c.opt_["fields"]; ok {
 
1198
                params.Set("fields", fmt.Sprintf("%v", v))
 
1199
        }
 
1200
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl")
 
1201
        urls += "?" + params.Encode()
 
1202
        req, _ := http.NewRequest("POST", urls, body)
 
1203
        googleapi.Expand(req.URL, map[string]string{
 
1204
                "calendarId": c.calendarId,
 
1205
        })
 
1206
        req.Header.Set("Content-Type", ctype)
 
1207
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1208
        res, err := c.s.client.Do(req)
 
1209
        if err != nil {
 
1210
                return nil, err
 
1211
        }
 
1212
        defer googleapi.CloseBody(res)
 
1213
        if err := googleapi.CheckResponse(res); err != nil {
 
1214
                return nil, err
 
1215
        }
 
1216
        var ret *AclRule
 
1217
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1218
                return nil, err
 
1219
        }
 
1220
        return ret, nil
 
1221
        // {
 
1222
        //   "description": "Creates an access control rule.",
 
1223
        //   "httpMethod": "POST",
 
1224
        //   "id": "calendar.acl.insert",
 
1225
        //   "parameterOrder": [
 
1226
        //     "calendarId"
 
1227
        //   ],
 
1228
        //   "parameters": {
 
1229
        //     "calendarId": {
 
1230
        //       "description": "Calendar identifier.",
 
1231
        //       "location": "path",
 
1232
        //       "required": true,
 
1233
        //       "type": "string"
 
1234
        //     }
 
1235
        //   },
 
1236
        //   "path": "calendars/{calendarId}/acl",
 
1237
        //   "request": {
 
1238
        //     "$ref": "AclRule"
 
1239
        //   },
 
1240
        //   "response": {
 
1241
        //     "$ref": "AclRule"
 
1242
        //   },
 
1243
        //   "scopes": [
 
1244
        //     "https://www.googleapis.com/auth/calendar"
 
1245
        //   ]
 
1246
        // }
 
1247
 
 
1248
}
 
1249
 
 
1250
// method id "calendar.acl.list":
 
1251
 
 
1252
type AclListCall struct {
 
1253
        s          *Service
 
1254
        calendarId string
 
1255
        opt_       map[string]interface{}
 
1256
}
 
1257
 
 
1258
// List: Returns the rules in the access control list for the calendar.
 
1259
func (r *AclService) List(calendarId string) *AclListCall {
 
1260
        c := &AclListCall{s: r.s, opt_: make(map[string]interface{})}
 
1261
        c.calendarId = calendarId
 
1262
        return c
 
1263
}
 
1264
 
 
1265
// MaxResults sets the optional parameter "maxResults": Maximum number
 
1266
// of entries returned on one result page. By default the value is 100
 
1267
// entries. The page size can never be larger than 250 entries.
 
1268
func (c *AclListCall) MaxResults(maxResults int64) *AclListCall {
 
1269
        c.opt_["maxResults"] = maxResults
 
1270
        return c
 
1271
}
 
1272
 
 
1273
// PageToken sets the optional parameter "pageToken": Token specifying
 
1274
// which result page to return.
 
1275
func (c *AclListCall) PageToken(pageToken string) *AclListCall {
 
1276
        c.opt_["pageToken"] = pageToken
 
1277
        return c
 
1278
}
 
1279
 
 
1280
// ShowDeleted sets the optional parameter "showDeleted": Whether to
 
1281
// include deleted ACLs in the result. Deleted ACLs are represented by
 
1282
// role equal to "none". Deleted ACLs will always be included if
 
1283
// syncToken is provided.  The default is False.
 
1284
func (c *AclListCall) ShowDeleted(showDeleted bool) *AclListCall {
 
1285
        c.opt_["showDeleted"] = showDeleted
 
1286
        return c
 
1287
}
 
1288
 
 
1289
// SyncToken sets the optional parameter "syncToken": Token obtained
 
1290
// from the nextSyncToken field returned on the last page of results
 
1291
// from the previous list request. It makes the result of this list
 
1292
// request contain only entries that have changed since then. All
 
1293
// entries deleted since the previous list request will always be in the
 
1294
// result set and it is not allowed to set showDeleted to False.
 
1295
// If the
 
1296
// syncToken expires, the server will respond with a 410 GONE response
 
1297
// code and the client should clear its storage and perform a full
 
1298
// synchronization without any syncToken.
 
1299
// Learn more about incremental
 
1300
// synchronization.
 
1301
//  The default is to return all entries.
 
1302
func (c *AclListCall) SyncToken(syncToken string) *AclListCall {
 
1303
        c.opt_["syncToken"] = syncToken
 
1304
        return c
 
1305
}
 
1306
 
 
1307
// Fields allows partial responses to be retrieved.
 
1308
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1309
// for more information.
 
1310
func (c *AclListCall) Fields(s ...googleapi.Field) *AclListCall {
 
1311
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1312
        return c
 
1313
}
 
1314
 
 
1315
func (c *AclListCall) Do() (*Acl, error) {
 
1316
        var body io.Reader = nil
 
1317
        params := make(url.Values)
 
1318
        params.Set("alt", "json")
 
1319
        if v, ok := c.opt_["maxResults"]; ok {
 
1320
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
1321
        }
 
1322
        if v, ok := c.opt_["pageToken"]; ok {
 
1323
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
1324
        }
 
1325
        if v, ok := c.opt_["showDeleted"]; ok {
 
1326
                params.Set("showDeleted", fmt.Sprintf("%v", v))
 
1327
        }
 
1328
        if v, ok := c.opt_["syncToken"]; ok {
 
1329
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
1330
        }
 
1331
        if v, ok := c.opt_["fields"]; ok {
 
1332
                params.Set("fields", fmt.Sprintf("%v", v))
 
1333
        }
 
1334
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl")
 
1335
        urls += "?" + params.Encode()
 
1336
        req, _ := http.NewRequest("GET", urls, body)
 
1337
        googleapi.Expand(req.URL, map[string]string{
 
1338
                "calendarId": c.calendarId,
 
1339
        })
 
1340
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1341
        res, err := c.s.client.Do(req)
 
1342
        if err != nil {
 
1343
                return nil, err
 
1344
        }
 
1345
        defer googleapi.CloseBody(res)
 
1346
        if err := googleapi.CheckResponse(res); err != nil {
 
1347
                return nil, err
 
1348
        }
 
1349
        var ret *Acl
 
1350
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1351
                return nil, err
 
1352
        }
 
1353
        return ret, nil
 
1354
        // {
 
1355
        //   "description": "Returns the rules in the access control list for the calendar.",
 
1356
        //   "httpMethod": "GET",
 
1357
        //   "id": "calendar.acl.list",
 
1358
        //   "parameterOrder": [
 
1359
        //     "calendarId"
 
1360
        //   ],
 
1361
        //   "parameters": {
 
1362
        //     "calendarId": {
 
1363
        //       "description": "Calendar identifier.",
 
1364
        //       "location": "path",
 
1365
        //       "required": true,
 
1366
        //       "type": "string"
 
1367
        //     },
 
1368
        //     "maxResults": {
 
1369
        //       "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.",
 
1370
        //       "format": "int32",
 
1371
        //       "location": "query",
 
1372
        //       "minimum": "1",
 
1373
        //       "type": "integer"
 
1374
        //     },
 
1375
        //     "pageToken": {
 
1376
        //       "description": "Token specifying which result page to return. Optional.",
 
1377
        //       "location": "query",
 
1378
        //       "type": "string"
 
1379
        //     },
 
1380
        //     "showDeleted": {
 
1381
        //       "description": "Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to \"none\". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False.",
 
1382
        //       "location": "query",
 
1383
        //       "type": "boolean"
 
1384
        //     },
 
1385
        //     "syncToken": {
 
1386
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
1387
        //       "location": "query",
 
1388
        //       "type": "string"
 
1389
        //     }
 
1390
        //   },
 
1391
        //   "path": "calendars/{calendarId}/acl",
 
1392
        //   "response": {
 
1393
        //     "$ref": "Acl"
 
1394
        //   },
 
1395
        //   "scopes": [
 
1396
        //     "https://www.googleapis.com/auth/calendar"
 
1397
        //   ],
 
1398
        //   "supportsSubscription": true
 
1399
        // }
 
1400
 
 
1401
}
 
1402
 
 
1403
// method id "calendar.acl.patch":
 
1404
 
 
1405
type AclPatchCall struct {
 
1406
        s          *Service
 
1407
        calendarId string
 
1408
        ruleId     string
 
1409
        aclrule    *AclRule
 
1410
        opt_       map[string]interface{}
 
1411
}
 
1412
 
 
1413
// Patch: Updates an access control rule. This method supports patch
 
1414
// semantics.
 
1415
func (r *AclService) Patch(calendarId string, ruleId string, aclrule *AclRule) *AclPatchCall {
 
1416
        c := &AclPatchCall{s: r.s, opt_: make(map[string]interface{})}
 
1417
        c.calendarId = calendarId
 
1418
        c.ruleId = ruleId
 
1419
        c.aclrule = aclrule
 
1420
        return c
 
1421
}
 
1422
 
 
1423
// Fields allows partial responses to be retrieved.
 
1424
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1425
// for more information.
 
1426
func (c *AclPatchCall) Fields(s ...googleapi.Field) *AclPatchCall {
 
1427
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1428
        return c
 
1429
}
 
1430
 
 
1431
func (c *AclPatchCall) Do() (*AclRule, error) {
 
1432
        var body io.Reader = nil
 
1433
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
 
1434
        if err != nil {
 
1435
                return nil, err
 
1436
        }
 
1437
        ctype := "application/json"
 
1438
        params := make(url.Values)
 
1439
        params.Set("alt", "json")
 
1440
        if v, ok := c.opt_["fields"]; ok {
 
1441
                params.Set("fields", fmt.Sprintf("%v", v))
 
1442
        }
 
1443
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
 
1444
        urls += "?" + params.Encode()
 
1445
        req, _ := http.NewRequest("PATCH", urls, body)
 
1446
        googleapi.Expand(req.URL, map[string]string{
 
1447
                "calendarId": c.calendarId,
 
1448
                "ruleId":     c.ruleId,
 
1449
        })
 
1450
        req.Header.Set("Content-Type", ctype)
 
1451
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1452
        res, err := c.s.client.Do(req)
 
1453
        if err != nil {
 
1454
                return nil, err
 
1455
        }
 
1456
        defer googleapi.CloseBody(res)
 
1457
        if err := googleapi.CheckResponse(res); err != nil {
 
1458
                return nil, err
 
1459
        }
 
1460
        var ret *AclRule
 
1461
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1462
                return nil, err
 
1463
        }
 
1464
        return ret, nil
 
1465
        // {
 
1466
        //   "description": "Updates an access control rule. This method supports patch semantics.",
 
1467
        //   "httpMethod": "PATCH",
 
1468
        //   "id": "calendar.acl.patch",
 
1469
        //   "parameterOrder": [
 
1470
        //     "calendarId",
 
1471
        //     "ruleId"
 
1472
        //   ],
 
1473
        //   "parameters": {
 
1474
        //     "calendarId": {
 
1475
        //       "description": "Calendar identifier.",
 
1476
        //       "location": "path",
 
1477
        //       "required": true,
 
1478
        //       "type": "string"
 
1479
        //     },
 
1480
        //     "ruleId": {
 
1481
        //       "description": "ACL rule identifier.",
 
1482
        //       "location": "path",
 
1483
        //       "required": true,
 
1484
        //       "type": "string"
 
1485
        //     }
 
1486
        //   },
 
1487
        //   "path": "calendars/{calendarId}/acl/{ruleId}",
 
1488
        //   "request": {
 
1489
        //     "$ref": "AclRule"
 
1490
        //   },
 
1491
        //   "response": {
 
1492
        //     "$ref": "AclRule"
 
1493
        //   },
 
1494
        //   "scopes": [
 
1495
        //     "https://www.googleapis.com/auth/calendar"
 
1496
        //   ]
 
1497
        // }
 
1498
 
 
1499
}
 
1500
 
 
1501
// method id "calendar.acl.update":
 
1502
 
 
1503
type AclUpdateCall struct {
 
1504
        s          *Service
 
1505
        calendarId string
 
1506
        ruleId     string
 
1507
        aclrule    *AclRule
 
1508
        opt_       map[string]interface{}
 
1509
}
 
1510
 
 
1511
// Update: Updates an access control rule.
 
1512
func (r *AclService) Update(calendarId string, ruleId string, aclrule *AclRule) *AclUpdateCall {
 
1513
        c := &AclUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
1514
        c.calendarId = calendarId
 
1515
        c.ruleId = ruleId
 
1516
        c.aclrule = aclrule
 
1517
        return c
 
1518
}
 
1519
 
 
1520
// Fields allows partial responses to be retrieved.
 
1521
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1522
// for more information.
 
1523
func (c *AclUpdateCall) Fields(s ...googleapi.Field) *AclUpdateCall {
 
1524
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1525
        return c
 
1526
}
 
1527
 
 
1528
func (c *AclUpdateCall) Do() (*AclRule, error) {
 
1529
        var body io.Reader = nil
 
1530
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
 
1531
        if err != nil {
 
1532
                return nil, err
 
1533
        }
 
1534
        ctype := "application/json"
 
1535
        params := make(url.Values)
 
1536
        params.Set("alt", "json")
 
1537
        if v, ok := c.opt_["fields"]; ok {
 
1538
                params.Set("fields", fmt.Sprintf("%v", v))
 
1539
        }
 
1540
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
 
1541
        urls += "?" + params.Encode()
 
1542
        req, _ := http.NewRequest("PUT", urls, body)
 
1543
        googleapi.Expand(req.URL, map[string]string{
 
1544
                "calendarId": c.calendarId,
 
1545
                "ruleId":     c.ruleId,
 
1546
        })
 
1547
        req.Header.Set("Content-Type", ctype)
 
1548
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1549
        res, err := c.s.client.Do(req)
 
1550
        if err != nil {
 
1551
                return nil, err
 
1552
        }
 
1553
        defer googleapi.CloseBody(res)
 
1554
        if err := googleapi.CheckResponse(res); err != nil {
 
1555
                return nil, err
 
1556
        }
 
1557
        var ret *AclRule
 
1558
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1559
                return nil, err
 
1560
        }
 
1561
        return ret, nil
 
1562
        // {
 
1563
        //   "description": "Updates an access control rule.",
 
1564
        //   "httpMethod": "PUT",
 
1565
        //   "id": "calendar.acl.update",
 
1566
        //   "parameterOrder": [
 
1567
        //     "calendarId",
 
1568
        //     "ruleId"
 
1569
        //   ],
 
1570
        //   "parameters": {
 
1571
        //     "calendarId": {
 
1572
        //       "description": "Calendar identifier.",
 
1573
        //       "location": "path",
 
1574
        //       "required": true,
 
1575
        //       "type": "string"
 
1576
        //     },
 
1577
        //     "ruleId": {
 
1578
        //       "description": "ACL rule identifier.",
 
1579
        //       "location": "path",
 
1580
        //       "required": true,
 
1581
        //       "type": "string"
 
1582
        //     }
 
1583
        //   },
 
1584
        //   "path": "calendars/{calendarId}/acl/{ruleId}",
 
1585
        //   "request": {
 
1586
        //     "$ref": "AclRule"
 
1587
        //   },
 
1588
        //   "response": {
 
1589
        //     "$ref": "AclRule"
 
1590
        //   },
 
1591
        //   "scopes": [
 
1592
        //     "https://www.googleapis.com/auth/calendar"
 
1593
        //   ]
 
1594
        // }
 
1595
 
 
1596
}
 
1597
 
 
1598
// method id "calendar.acl.watch":
 
1599
 
 
1600
type AclWatchCall struct {
 
1601
        s          *Service
 
1602
        calendarId string
 
1603
        channel    *Channel
 
1604
        opt_       map[string]interface{}
 
1605
}
 
1606
 
 
1607
// Watch: Watch for changes to ACL resources.
 
1608
func (r *AclService) Watch(calendarId string, channel *Channel) *AclWatchCall {
 
1609
        c := &AclWatchCall{s: r.s, opt_: make(map[string]interface{})}
 
1610
        c.calendarId = calendarId
 
1611
        c.channel = channel
 
1612
        return c
 
1613
}
 
1614
 
 
1615
// MaxResults sets the optional parameter "maxResults": Maximum number
 
1616
// of entries returned on one result page. By default the value is 100
 
1617
// entries. The page size can never be larger than 250 entries.
 
1618
func (c *AclWatchCall) MaxResults(maxResults int64) *AclWatchCall {
 
1619
        c.opt_["maxResults"] = maxResults
 
1620
        return c
 
1621
}
 
1622
 
 
1623
// PageToken sets the optional parameter "pageToken": Token specifying
 
1624
// which result page to return.
 
1625
func (c *AclWatchCall) PageToken(pageToken string) *AclWatchCall {
 
1626
        c.opt_["pageToken"] = pageToken
 
1627
        return c
 
1628
}
 
1629
 
 
1630
// ShowDeleted sets the optional parameter "showDeleted": Whether to
 
1631
// include deleted ACLs in the result. Deleted ACLs are represented by
 
1632
// role equal to "none". Deleted ACLs will always be included if
 
1633
// syncToken is provided.  The default is False.
 
1634
func (c *AclWatchCall) ShowDeleted(showDeleted bool) *AclWatchCall {
 
1635
        c.opt_["showDeleted"] = showDeleted
 
1636
        return c
 
1637
}
 
1638
 
 
1639
// SyncToken sets the optional parameter "syncToken": Token obtained
 
1640
// from the nextSyncToken field returned on the last page of results
 
1641
// from the previous list request. It makes the result of this list
 
1642
// request contain only entries that have changed since then. All
 
1643
// entries deleted since the previous list request will always be in the
 
1644
// result set and it is not allowed to set showDeleted to False.
 
1645
// If the
 
1646
// syncToken expires, the server will respond with a 410 GONE response
 
1647
// code and the client should clear its storage and perform a full
 
1648
// synchronization without any syncToken.
 
1649
// Learn more about incremental
 
1650
// synchronization.
 
1651
//  The default is to return all entries.
 
1652
func (c *AclWatchCall) SyncToken(syncToken string) *AclWatchCall {
 
1653
        c.opt_["syncToken"] = syncToken
 
1654
        return c
 
1655
}
 
1656
 
 
1657
// Fields allows partial responses to be retrieved.
 
1658
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1659
// for more information.
 
1660
func (c *AclWatchCall) Fields(s ...googleapi.Field) *AclWatchCall {
 
1661
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1662
        return c
 
1663
}
 
1664
 
 
1665
func (c *AclWatchCall) Do() (*Channel, error) {
 
1666
        var body io.Reader = nil
 
1667
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
 
1668
        if err != nil {
 
1669
                return nil, err
 
1670
        }
 
1671
        ctype := "application/json"
 
1672
        params := make(url.Values)
 
1673
        params.Set("alt", "json")
 
1674
        if v, ok := c.opt_["maxResults"]; ok {
 
1675
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
1676
        }
 
1677
        if v, ok := c.opt_["pageToken"]; ok {
 
1678
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
1679
        }
 
1680
        if v, ok := c.opt_["showDeleted"]; ok {
 
1681
                params.Set("showDeleted", fmt.Sprintf("%v", v))
 
1682
        }
 
1683
        if v, ok := c.opt_["syncToken"]; ok {
 
1684
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
1685
        }
 
1686
        if v, ok := c.opt_["fields"]; ok {
 
1687
                params.Set("fields", fmt.Sprintf("%v", v))
 
1688
        }
 
1689
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/watch")
 
1690
        urls += "?" + params.Encode()
 
1691
        req, _ := http.NewRequest("POST", urls, body)
 
1692
        googleapi.Expand(req.URL, map[string]string{
 
1693
                "calendarId": c.calendarId,
 
1694
        })
 
1695
        req.Header.Set("Content-Type", ctype)
 
1696
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1697
        res, err := c.s.client.Do(req)
 
1698
        if err != nil {
 
1699
                return nil, err
 
1700
        }
 
1701
        defer googleapi.CloseBody(res)
 
1702
        if err := googleapi.CheckResponse(res); err != nil {
 
1703
                return nil, err
 
1704
        }
 
1705
        var ret *Channel
 
1706
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1707
                return nil, err
 
1708
        }
 
1709
        return ret, nil
 
1710
        // {
 
1711
        //   "description": "Watch for changes to ACL resources.",
 
1712
        //   "httpMethod": "POST",
 
1713
        //   "id": "calendar.acl.watch",
 
1714
        //   "parameterOrder": [
 
1715
        //     "calendarId"
 
1716
        //   ],
 
1717
        //   "parameters": {
 
1718
        //     "calendarId": {
 
1719
        //       "description": "Calendar identifier.",
 
1720
        //       "location": "path",
 
1721
        //       "required": true,
 
1722
        //       "type": "string"
 
1723
        //     },
 
1724
        //     "maxResults": {
 
1725
        //       "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.",
 
1726
        //       "format": "int32",
 
1727
        //       "location": "query",
 
1728
        //       "minimum": "1",
 
1729
        //       "type": "integer"
 
1730
        //     },
 
1731
        //     "pageToken": {
 
1732
        //       "description": "Token specifying which result page to return. Optional.",
 
1733
        //       "location": "query",
 
1734
        //       "type": "string"
 
1735
        //     },
 
1736
        //     "showDeleted": {
 
1737
        //       "description": "Whether to include deleted ACLs in the result. Deleted ACLs are represented by role equal to \"none\". Deleted ACLs will always be included if syncToken is provided. Optional. The default is False.",
 
1738
        //       "location": "query",
 
1739
        //       "type": "boolean"
 
1740
        //     },
 
1741
        //     "syncToken": {
 
1742
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All entries deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
1743
        //       "location": "query",
 
1744
        //       "type": "string"
 
1745
        //     }
 
1746
        //   },
 
1747
        //   "path": "calendars/{calendarId}/acl/watch",
 
1748
        //   "request": {
 
1749
        //     "$ref": "Channel",
 
1750
        //     "parameterName": "resource"
 
1751
        //   },
 
1752
        //   "response": {
 
1753
        //     "$ref": "Channel"
 
1754
        //   },
 
1755
        //   "scopes": [
 
1756
        //     "https://www.googleapis.com/auth/calendar"
 
1757
        //   ],
 
1758
        //   "supportsSubscription": true
 
1759
        // }
 
1760
 
 
1761
}
 
1762
 
 
1763
// method id "calendar.calendarList.delete":
 
1764
 
 
1765
type CalendarListDeleteCall struct {
 
1766
        s          *Service
 
1767
        calendarId string
 
1768
        opt_       map[string]interface{}
 
1769
}
 
1770
 
 
1771
// Delete: Deletes an entry on the user's calendar list.
 
1772
func (r *CalendarListService) Delete(calendarId string) *CalendarListDeleteCall {
 
1773
        c := &CalendarListDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
1774
        c.calendarId = calendarId
 
1775
        return c
 
1776
}
 
1777
 
 
1778
// Fields allows partial responses to be retrieved.
 
1779
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1780
// for more information.
 
1781
func (c *CalendarListDeleteCall) Fields(s ...googleapi.Field) *CalendarListDeleteCall {
 
1782
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1783
        return c
 
1784
}
 
1785
 
 
1786
func (c *CalendarListDeleteCall) Do() error {
 
1787
        var body io.Reader = nil
 
1788
        params := make(url.Values)
 
1789
        params.Set("alt", "json")
 
1790
        if v, ok := c.opt_["fields"]; ok {
 
1791
                params.Set("fields", fmt.Sprintf("%v", v))
 
1792
        }
 
1793
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
 
1794
        urls += "?" + params.Encode()
 
1795
        req, _ := http.NewRequest("DELETE", urls, body)
 
1796
        googleapi.Expand(req.URL, map[string]string{
 
1797
                "calendarId": c.calendarId,
 
1798
        })
 
1799
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1800
        res, err := c.s.client.Do(req)
 
1801
        if err != nil {
 
1802
                return err
 
1803
        }
 
1804
        defer googleapi.CloseBody(res)
 
1805
        if err := googleapi.CheckResponse(res); err != nil {
 
1806
                return err
 
1807
        }
 
1808
        return nil
 
1809
        // {
 
1810
        //   "description": "Deletes an entry on the user's calendar list.",
 
1811
        //   "httpMethod": "DELETE",
 
1812
        //   "id": "calendar.calendarList.delete",
 
1813
        //   "parameterOrder": [
 
1814
        //     "calendarId"
 
1815
        //   ],
 
1816
        //   "parameters": {
 
1817
        //     "calendarId": {
 
1818
        //       "description": "Calendar identifier.",
 
1819
        //       "location": "path",
 
1820
        //       "required": true,
 
1821
        //       "type": "string"
 
1822
        //     }
 
1823
        //   },
 
1824
        //   "path": "users/me/calendarList/{calendarId}",
 
1825
        //   "scopes": [
 
1826
        //     "https://www.googleapis.com/auth/calendar"
 
1827
        //   ]
 
1828
        // }
 
1829
 
 
1830
}
 
1831
 
 
1832
// method id "calendar.calendarList.get":
 
1833
 
 
1834
type CalendarListGetCall struct {
 
1835
        s          *Service
 
1836
        calendarId string
 
1837
        opt_       map[string]interface{}
 
1838
}
 
1839
 
 
1840
// Get: Returns an entry on the user's calendar list.
 
1841
func (r *CalendarListService) Get(calendarId string) *CalendarListGetCall {
 
1842
        c := &CalendarListGetCall{s: r.s, opt_: make(map[string]interface{})}
 
1843
        c.calendarId = calendarId
 
1844
        return c
 
1845
}
 
1846
 
 
1847
// Fields allows partial responses to be retrieved.
 
1848
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1849
// for more information.
 
1850
func (c *CalendarListGetCall) Fields(s ...googleapi.Field) *CalendarListGetCall {
 
1851
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1852
        return c
 
1853
}
 
1854
 
 
1855
func (c *CalendarListGetCall) Do() (*CalendarListEntry, error) {
 
1856
        var body io.Reader = nil
 
1857
        params := make(url.Values)
 
1858
        params.Set("alt", "json")
 
1859
        if v, ok := c.opt_["fields"]; ok {
 
1860
                params.Set("fields", fmt.Sprintf("%v", v))
 
1861
        }
 
1862
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
 
1863
        urls += "?" + params.Encode()
 
1864
        req, _ := http.NewRequest("GET", urls, body)
 
1865
        googleapi.Expand(req.URL, map[string]string{
 
1866
                "calendarId": c.calendarId,
 
1867
        })
 
1868
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1869
        res, err := c.s.client.Do(req)
 
1870
        if err != nil {
 
1871
                return nil, err
 
1872
        }
 
1873
        defer googleapi.CloseBody(res)
 
1874
        if err := googleapi.CheckResponse(res); err != nil {
 
1875
                return nil, err
 
1876
        }
 
1877
        var ret *CalendarListEntry
 
1878
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1879
                return nil, err
 
1880
        }
 
1881
        return ret, nil
 
1882
        // {
 
1883
        //   "description": "Returns an entry on the user's calendar list.",
 
1884
        //   "httpMethod": "GET",
 
1885
        //   "id": "calendar.calendarList.get",
 
1886
        //   "parameterOrder": [
 
1887
        //     "calendarId"
 
1888
        //   ],
 
1889
        //   "parameters": {
 
1890
        //     "calendarId": {
 
1891
        //       "description": "Calendar identifier.",
 
1892
        //       "location": "path",
 
1893
        //       "required": true,
 
1894
        //       "type": "string"
 
1895
        //     }
 
1896
        //   },
 
1897
        //   "path": "users/me/calendarList/{calendarId}",
 
1898
        //   "response": {
 
1899
        //     "$ref": "CalendarListEntry"
 
1900
        //   },
 
1901
        //   "scopes": [
 
1902
        //     "https://www.googleapis.com/auth/calendar",
 
1903
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
1904
        //   ]
 
1905
        // }
 
1906
 
 
1907
}
 
1908
 
 
1909
// method id "calendar.calendarList.insert":
 
1910
 
 
1911
type CalendarListInsertCall struct {
 
1912
        s                 *Service
 
1913
        calendarlistentry *CalendarListEntry
 
1914
        opt_              map[string]interface{}
 
1915
}
 
1916
 
 
1917
// Insert: Adds an entry to the user's calendar list.
 
1918
func (r *CalendarListService) Insert(calendarlistentry *CalendarListEntry) *CalendarListInsertCall {
 
1919
        c := &CalendarListInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
1920
        c.calendarlistentry = calendarlistentry
 
1921
        return c
 
1922
}
 
1923
 
 
1924
// ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether
 
1925
// to use the foregroundColor and backgroundColor fields to write the
 
1926
// calendar colors (RGB). If this feature is used, the index-based
 
1927
// colorId field will be set to the best matching option automatically.
 
1928
// The default is False.
 
1929
func (c *CalendarListInsertCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListInsertCall {
 
1930
        c.opt_["colorRgbFormat"] = colorRgbFormat
 
1931
        return c
 
1932
}
 
1933
 
 
1934
// Fields allows partial responses to be retrieved.
 
1935
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1936
// for more information.
 
1937
func (c *CalendarListInsertCall) Fields(s ...googleapi.Field) *CalendarListInsertCall {
 
1938
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1939
        return c
 
1940
}
 
1941
 
 
1942
func (c *CalendarListInsertCall) Do() (*CalendarListEntry, error) {
 
1943
        var body io.Reader = nil
 
1944
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
 
1945
        if err != nil {
 
1946
                return nil, err
 
1947
        }
 
1948
        ctype := "application/json"
 
1949
        params := make(url.Values)
 
1950
        params.Set("alt", "json")
 
1951
        if v, ok := c.opt_["colorRgbFormat"]; ok {
 
1952
                params.Set("colorRgbFormat", fmt.Sprintf("%v", v))
 
1953
        }
 
1954
        if v, ok := c.opt_["fields"]; ok {
 
1955
                params.Set("fields", fmt.Sprintf("%v", v))
 
1956
        }
 
1957
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList")
 
1958
        urls += "?" + params.Encode()
 
1959
        req, _ := http.NewRequest("POST", urls, body)
 
1960
        googleapi.SetOpaque(req.URL)
 
1961
        req.Header.Set("Content-Type", ctype)
 
1962
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1963
        res, err := c.s.client.Do(req)
 
1964
        if err != nil {
 
1965
                return nil, err
 
1966
        }
 
1967
        defer googleapi.CloseBody(res)
 
1968
        if err := googleapi.CheckResponse(res); err != nil {
 
1969
                return nil, err
 
1970
        }
 
1971
        var ret *CalendarListEntry
 
1972
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1973
                return nil, err
 
1974
        }
 
1975
        return ret, nil
 
1976
        // {
 
1977
        //   "description": "Adds an entry to the user's calendar list.",
 
1978
        //   "httpMethod": "POST",
 
1979
        //   "id": "calendar.calendarList.insert",
 
1980
        //   "parameters": {
 
1981
        //     "colorRgbFormat": {
 
1982
        //       "description": "Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False.",
 
1983
        //       "location": "query",
 
1984
        //       "type": "boolean"
 
1985
        //     }
 
1986
        //   },
 
1987
        //   "path": "users/me/calendarList",
 
1988
        //   "request": {
 
1989
        //     "$ref": "CalendarListEntry"
 
1990
        //   },
 
1991
        //   "response": {
 
1992
        //     "$ref": "CalendarListEntry"
 
1993
        //   },
 
1994
        //   "scopes": [
 
1995
        //     "https://www.googleapis.com/auth/calendar"
 
1996
        //   ]
 
1997
        // }
 
1998
 
 
1999
}
 
2000
 
 
2001
// method id "calendar.calendarList.list":
 
2002
 
 
2003
type CalendarListListCall struct {
 
2004
        s    *Service
 
2005
        opt_ map[string]interface{}
 
2006
}
 
2007
 
 
2008
// List: Returns entries on the user's calendar list.
 
2009
func (r *CalendarListService) List() *CalendarListListCall {
 
2010
        c := &CalendarListListCall{s: r.s, opt_: make(map[string]interface{})}
 
2011
        return c
 
2012
}
 
2013
 
 
2014
// MaxResults sets the optional parameter "maxResults": Maximum number
 
2015
// of entries returned on one result page. By default the value is 100
 
2016
// entries. The page size can never be larger than 250 entries.
 
2017
func (c *CalendarListListCall) MaxResults(maxResults int64) *CalendarListListCall {
 
2018
        c.opt_["maxResults"] = maxResults
 
2019
        return c
 
2020
}
 
2021
 
 
2022
// MinAccessRole sets the optional parameter "minAccessRole": The
 
2023
// minimum access role for the user in the returned entires.  The
 
2024
// default is no restriction.
 
2025
func (c *CalendarListListCall) MinAccessRole(minAccessRole string) *CalendarListListCall {
 
2026
        c.opt_["minAccessRole"] = minAccessRole
 
2027
        return c
 
2028
}
 
2029
 
 
2030
// PageToken sets the optional parameter "pageToken": Token specifying
 
2031
// which result page to return.
 
2032
func (c *CalendarListListCall) PageToken(pageToken string) *CalendarListListCall {
 
2033
        c.opt_["pageToken"] = pageToken
 
2034
        return c
 
2035
}
 
2036
 
 
2037
// ShowDeleted sets the optional parameter "showDeleted": Whether to
 
2038
// include deleted calendar list entries in the result.  The default is
 
2039
// False.
 
2040
func (c *CalendarListListCall) ShowDeleted(showDeleted bool) *CalendarListListCall {
 
2041
        c.opt_["showDeleted"] = showDeleted
 
2042
        return c
 
2043
}
 
2044
 
 
2045
// ShowHidden sets the optional parameter "showHidden": Whether to show
 
2046
// hidden entries.  The default is False.
 
2047
func (c *CalendarListListCall) ShowHidden(showHidden bool) *CalendarListListCall {
 
2048
        c.opt_["showHidden"] = showHidden
 
2049
        return c
 
2050
}
 
2051
 
 
2052
// SyncToken sets the optional parameter "syncToken": Token obtained
 
2053
// from the nextSyncToken field returned on the last page of results
 
2054
// from the previous list request. It makes the result of this list
 
2055
// request contain only entries that have changed since then. If only
 
2056
// read-only fields such as calendar properties or ACLs have changed,
 
2057
// the entry won't be returned. All entries deleted and hidden since the
 
2058
// previous list request will always be in the result set and it is not
 
2059
// allowed to set showDeleted neither showHidden to False.
 
2060
// To ensure
 
2061
// client state consistency minAccessRole query parameter cannot be
 
2062
// specified together with nextSyncToken.
 
2063
// If the syncToken expires, the
 
2064
// server will respond with a 410 GONE response code and the client
 
2065
// should clear its storage and perform a full synchronization without
 
2066
// any syncToken.
 
2067
// Learn more about incremental synchronization.
 
2068
//  The
 
2069
// default is to return all entries.
 
2070
func (c *CalendarListListCall) SyncToken(syncToken string) *CalendarListListCall {
 
2071
        c.opt_["syncToken"] = syncToken
 
2072
        return c
 
2073
}
 
2074
 
 
2075
// Fields allows partial responses to be retrieved.
 
2076
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2077
// for more information.
 
2078
func (c *CalendarListListCall) Fields(s ...googleapi.Field) *CalendarListListCall {
 
2079
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2080
        return c
 
2081
}
 
2082
 
 
2083
func (c *CalendarListListCall) Do() (*CalendarList, error) {
 
2084
        var body io.Reader = nil
 
2085
        params := make(url.Values)
 
2086
        params.Set("alt", "json")
 
2087
        if v, ok := c.opt_["maxResults"]; ok {
 
2088
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
2089
        }
 
2090
        if v, ok := c.opt_["minAccessRole"]; ok {
 
2091
                params.Set("minAccessRole", fmt.Sprintf("%v", v))
 
2092
        }
 
2093
        if v, ok := c.opt_["pageToken"]; ok {
 
2094
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
2095
        }
 
2096
        if v, ok := c.opt_["showDeleted"]; ok {
 
2097
                params.Set("showDeleted", fmt.Sprintf("%v", v))
 
2098
        }
 
2099
        if v, ok := c.opt_["showHidden"]; ok {
 
2100
                params.Set("showHidden", fmt.Sprintf("%v", v))
 
2101
        }
 
2102
        if v, ok := c.opt_["syncToken"]; ok {
 
2103
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
2104
        }
 
2105
        if v, ok := c.opt_["fields"]; ok {
 
2106
                params.Set("fields", fmt.Sprintf("%v", v))
 
2107
        }
 
2108
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList")
 
2109
        urls += "?" + params.Encode()
 
2110
        req, _ := http.NewRequest("GET", urls, body)
 
2111
        googleapi.SetOpaque(req.URL)
 
2112
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2113
        res, err := c.s.client.Do(req)
 
2114
        if err != nil {
 
2115
                return nil, err
 
2116
        }
 
2117
        defer googleapi.CloseBody(res)
 
2118
        if err := googleapi.CheckResponse(res); err != nil {
 
2119
                return nil, err
 
2120
        }
 
2121
        var ret *CalendarList
 
2122
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2123
                return nil, err
 
2124
        }
 
2125
        return ret, nil
 
2126
        // {
 
2127
        //   "description": "Returns entries on the user's calendar list.",
 
2128
        //   "httpMethod": "GET",
 
2129
        //   "id": "calendar.calendarList.list",
 
2130
        //   "parameters": {
 
2131
        //     "maxResults": {
 
2132
        //       "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.",
 
2133
        //       "format": "int32",
 
2134
        //       "location": "query",
 
2135
        //       "minimum": "1",
 
2136
        //       "type": "integer"
 
2137
        //     },
 
2138
        //     "minAccessRole": {
 
2139
        //       "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.",
 
2140
        //       "enum": [
 
2141
        //         "freeBusyReader",
 
2142
        //         "owner",
 
2143
        //         "reader",
 
2144
        //         "writer"
 
2145
        //       ],
 
2146
        //       "enumDescriptions": [
 
2147
        //         "The user can read free/busy information.",
 
2148
        //         "The user can read and modify events and access control lists.",
 
2149
        //         "The user can read events that are not private.",
 
2150
        //         "The user can read and modify events."
 
2151
        //       ],
 
2152
        //       "location": "query",
 
2153
        //       "type": "string"
 
2154
        //     },
 
2155
        //     "pageToken": {
 
2156
        //       "description": "Token specifying which result page to return. Optional.",
 
2157
        //       "location": "query",
 
2158
        //       "type": "string"
 
2159
        //     },
 
2160
        //     "showDeleted": {
 
2161
        //       "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.",
 
2162
        //       "location": "query",
 
2163
        //       "type": "boolean"
 
2164
        //     },
 
2165
        //     "showHidden": {
 
2166
        //       "description": "Whether to show hidden entries. Optional. The default is False.",
 
2167
        //       "location": "query",
 
2168
        //       "type": "boolean"
 
2169
        //     },
 
2170
        //     "syncToken": {
 
2171
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False.\nTo ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
2172
        //       "location": "query",
 
2173
        //       "type": "string"
 
2174
        //     }
 
2175
        //   },
 
2176
        //   "path": "users/me/calendarList",
 
2177
        //   "response": {
 
2178
        //     "$ref": "CalendarList"
 
2179
        //   },
 
2180
        //   "scopes": [
 
2181
        //     "https://www.googleapis.com/auth/calendar",
 
2182
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
2183
        //   ],
 
2184
        //   "supportsSubscription": true
 
2185
        // }
 
2186
 
 
2187
}
 
2188
 
 
2189
// method id "calendar.calendarList.patch":
 
2190
 
 
2191
type CalendarListPatchCall struct {
 
2192
        s                 *Service
 
2193
        calendarId        string
 
2194
        calendarlistentry *CalendarListEntry
 
2195
        opt_              map[string]interface{}
 
2196
}
 
2197
 
 
2198
// Patch: Updates an entry on the user's calendar list. This method
 
2199
// supports patch semantics.
 
2200
func (r *CalendarListService) Patch(calendarId string, calendarlistentry *CalendarListEntry) *CalendarListPatchCall {
 
2201
        c := &CalendarListPatchCall{s: r.s, opt_: make(map[string]interface{})}
 
2202
        c.calendarId = calendarId
 
2203
        c.calendarlistentry = calendarlistentry
 
2204
        return c
 
2205
}
 
2206
 
 
2207
// ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether
 
2208
// to use the foregroundColor and backgroundColor fields to write the
 
2209
// calendar colors (RGB). If this feature is used, the index-based
 
2210
// colorId field will be set to the best matching option automatically.
 
2211
// The default is False.
 
2212
func (c *CalendarListPatchCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListPatchCall {
 
2213
        c.opt_["colorRgbFormat"] = colorRgbFormat
 
2214
        return c
 
2215
}
 
2216
 
 
2217
// Fields allows partial responses to be retrieved.
 
2218
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2219
// for more information.
 
2220
func (c *CalendarListPatchCall) Fields(s ...googleapi.Field) *CalendarListPatchCall {
 
2221
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2222
        return c
 
2223
}
 
2224
 
 
2225
func (c *CalendarListPatchCall) Do() (*CalendarListEntry, error) {
 
2226
        var body io.Reader = nil
 
2227
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
 
2228
        if err != nil {
 
2229
                return nil, err
 
2230
        }
 
2231
        ctype := "application/json"
 
2232
        params := make(url.Values)
 
2233
        params.Set("alt", "json")
 
2234
        if v, ok := c.opt_["colorRgbFormat"]; ok {
 
2235
                params.Set("colorRgbFormat", fmt.Sprintf("%v", v))
 
2236
        }
 
2237
        if v, ok := c.opt_["fields"]; ok {
 
2238
                params.Set("fields", fmt.Sprintf("%v", v))
 
2239
        }
 
2240
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
 
2241
        urls += "?" + params.Encode()
 
2242
        req, _ := http.NewRequest("PATCH", urls, body)
 
2243
        googleapi.Expand(req.URL, map[string]string{
 
2244
                "calendarId": c.calendarId,
 
2245
        })
 
2246
        req.Header.Set("Content-Type", ctype)
 
2247
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2248
        res, err := c.s.client.Do(req)
 
2249
        if err != nil {
 
2250
                return nil, err
 
2251
        }
 
2252
        defer googleapi.CloseBody(res)
 
2253
        if err := googleapi.CheckResponse(res); err != nil {
 
2254
                return nil, err
 
2255
        }
 
2256
        var ret *CalendarListEntry
 
2257
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2258
                return nil, err
 
2259
        }
 
2260
        return ret, nil
 
2261
        // {
 
2262
        //   "description": "Updates an entry on the user's calendar list. This method supports patch semantics.",
 
2263
        //   "httpMethod": "PATCH",
 
2264
        //   "id": "calendar.calendarList.patch",
 
2265
        //   "parameterOrder": [
 
2266
        //     "calendarId"
 
2267
        //   ],
 
2268
        //   "parameters": {
 
2269
        //     "calendarId": {
 
2270
        //       "description": "Calendar identifier.",
 
2271
        //       "location": "path",
 
2272
        //       "required": true,
 
2273
        //       "type": "string"
 
2274
        //     },
 
2275
        //     "colorRgbFormat": {
 
2276
        //       "description": "Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False.",
 
2277
        //       "location": "query",
 
2278
        //       "type": "boolean"
 
2279
        //     }
 
2280
        //   },
 
2281
        //   "path": "users/me/calendarList/{calendarId}",
 
2282
        //   "request": {
 
2283
        //     "$ref": "CalendarListEntry"
 
2284
        //   },
 
2285
        //   "response": {
 
2286
        //     "$ref": "CalendarListEntry"
 
2287
        //   },
 
2288
        //   "scopes": [
 
2289
        //     "https://www.googleapis.com/auth/calendar"
 
2290
        //   ]
 
2291
        // }
 
2292
 
 
2293
}
 
2294
 
 
2295
// method id "calendar.calendarList.update":
 
2296
 
 
2297
type CalendarListUpdateCall struct {
 
2298
        s                 *Service
 
2299
        calendarId        string
 
2300
        calendarlistentry *CalendarListEntry
 
2301
        opt_              map[string]interface{}
 
2302
}
 
2303
 
 
2304
// Update: Updates an entry on the user's calendar list.
 
2305
func (r *CalendarListService) Update(calendarId string, calendarlistentry *CalendarListEntry) *CalendarListUpdateCall {
 
2306
        c := &CalendarListUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
2307
        c.calendarId = calendarId
 
2308
        c.calendarlistentry = calendarlistentry
 
2309
        return c
 
2310
}
 
2311
 
 
2312
// ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether
 
2313
// to use the foregroundColor and backgroundColor fields to write the
 
2314
// calendar colors (RGB). If this feature is used, the index-based
 
2315
// colorId field will be set to the best matching option automatically.
 
2316
// The default is False.
 
2317
func (c *CalendarListUpdateCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListUpdateCall {
 
2318
        c.opt_["colorRgbFormat"] = colorRgbFormat
 
2319
        return c
 
2320
}
 
2321
 
 
2322
// Fields allows partial responses to be retrieved.
 
2323
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2324
// for more information.
 
2325
func (c *CalendarListUpdateCall) Fields(s ...googleapi.Field) *CalendarListUpdateCall {
 
2326
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2327
        return c
 
2328
}
 
2329
 
 
2330
func (c *CalendarListUpdateCall) Do() (*CalendarListEntry, error) {
 
2331
        var body io.Reader = nil
 
2332
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
 
2333
        if err != nil {
 
2334
                return nil, err
 
2335
        }
 
2336
        ctype := "application/json"
 
2337
        params := make(url.Values)
 
2338
        params.Set("alt", "json")
 
2339
        if v, ok := c.opt_["colorRgbFormat"]; ok {
 
2340
                params.Set("colorRgbFormat", fmt.Sprintf("%v", v))
 
2341
        }
 
2342
        if v, ok := c.opt_["fields"]; ok {
 
2343
                params.Set("fields", fmt.Sprintf("%v", v))
 
2344
        }
 
2345
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
 
2346
        urls += "?" + params.Encode()
 
2347
        req, _ := http.NewRequest("PUT", urls, body)
 
2348
        googleapi.Expand(req.URL, map[string]string{
 
2349
                "calendarId": c.calendarId,
 
2350
        })
 
2351
        req.Header.Set("Content-Type", ctype)
 
2352
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2353
        res, err := c.s.client.Do(req)
 
2354
        if err != nil {
 
2355
                return nil, err
 
2356
        }
 
2357
        defer googleapi.CloseBody(res)
 
2358
        if err := googleapi.CheckResponse(res); err != nil {
 
2359
                return nil, err
 
2360
        }
 
2361
        var ret *CalendarListEntry
 
2362
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2363
                return nil, err
 
2364
        }
 
2365
        return ret, nil
 
2366
        // {
 
2367
        //   "description": "Updates an entry on the user's calendar list.",
 
2368
        //   "httpMethod": "PUT",
 
2369
        //   "id": "calendar.calendarList.update",
 
2370
        //   "parameterOrder": [
 
2371
        //     "calendarId"
 
2372
        //   ],
 
2373
        //   "parameters": {
 
2374
        //     "calendarId": {
 
2375
        //       "description": "Calendar identifier.",
 
2376
        //       "location": "path",
 
2377
        //       "required": true,
 
2378
        //       "type": "string"
 
2379
        //     },
 
2380
        //     "colorRgbFormat": {
 
2381
        //       "description": "Whether to use the foregroundColor and backgroundColor fields to write the calendar colors (RGB). If this feature is used, the index-based colorId field will be set to the best matching option automatically. Optional. The default is False.",
 
2382
        //       "location": "query",
 
2383
        //       "type": "boolean"
 
2384
        //     }
 
2385
        //   },
 
2386
        //   "path": "users/me/calendarList/{calendarId}",
 
2387
        //   "request": {
 
2388
        //     "$ref": "CalendarListEntry"
 
2389
        //   },
 
2390
        //   "response": {
 
2391
        //     "$ref": "CalendarListEntry"
 
2392
        //   },
 
2393
        //   "scopes": [
 
2394
        //     "https://www.googleapis.com/auth/calendar"
 
2395
        //   ]
 
2396
        // }
 
2397
 
 
2398
}
 
2399
 
 
2400
// method id "calendar.calendarList.watch":
 
2401
 
 
2402
type CalendarListWatchCall struct {
 
2403
        s       *Service
 
2404
        channel *Channel
 
2405
        opt_    map[string]interface{}
 
2406
}
 
2407
 
 
2408
// Watch: Watch for changes to CalendarList resources.
 
2409
func (r *CalendarListService) Watch(channel *Channel) *CalendarListWatchCall {
 
2410
        c := &CalendarListWatchCall{s: r.s, opt_: make(map[string]interface{})}
 
2411
        c.channel = channel
 
2412
        return c
 
2413
}
 
2414
 
 
2415
// MaxResults sets the optional parameter "maxResults": Maximum number
 
2416
// of entries returned on one result page. By default the value is 100
 
2417
// entries. The page size can never be larger than 250 entries.
 
2418
func (c *CalendarListWatchCall) MaxResults(maxResults int64) *CalendarListWatchCall {
 
2419
        c.opt_["maxResults"] = maxResults
 
2420
        return c
 
2421
}
 
2422
 
 
2423
// MinAccessRole sets the optional parameter "minAccessRole": The
 
2424
// minimum access role for the user in the returned entires.  The
 
2425
// default is no restriction.
 
2426
func (c *CalendarListWatchCall) MinAccessRole(minAccessRole string) *CalendarListWatchCall {
 
2427
        c.opt_["minAccessRole"] = minAccessRole
 
2428
        return c
 
2429
}
 
2430
 
 
2431
// PageToken sets the optional parameter "pageToken": Token specifying
 
2432
// which result page to return.
 
2433
func (c *CalendarListWatchCall) PageToken(pageToken string) *CalendarListWatchCall {
 
2434
        c.opt_["pageToken"] = pageToken
 
2435
        return c
 
2436
}
 
2437
 
 
2438
// ShowDeleted sets the optional parameter "showDeleted": Whether to
 
2439
// include deleted calendar list entries in the result.  The default is
 
2440
// False.
 
2441
func (c *CalendarListWatchCall) ShowDeleted(showDeleted bool) *CalendarListWatchCall {
 
2442
        c.opt_["showDeleted"] = showDeleted
 
2443
        return c
 
2444
}
 
2445
 
 
2446
// ShowHidden sets the optional parameter "showHidden": Whether to show
 
2447
// hidden entries.  The default is False.
 
2448
func (c *CalendarListWatchCall) ShowHidden(showHidden bool) *CalendarListWatchCall {
 
2449
        c.opt_["showHidden"] = showHidden
 
2450
        return c
 
2451
}
 
2452
 
 
2453
// SyncToken sets the optional parameter "syncToken": Token obtained
 
2454
// from the nextSyncToken field returned on the last page of results
 
2455
// from the previous list request. It makes the result of this list
 
2456
// request contain only entries that have changed since then. If only
 
2457
// read-only fields such as calendar properties or ACLs have changed,
 
2458
// the entry won't be returned. All entries deleted and hidden since the
 
2459
// previous list request will always be in the result set and it is not
 
2460
// allowed to set showDeleted neither showHidden to False.
 
2461
// To ensure
 
2462
// client state consistency minAccessRole query parameter cannot be
 
2463
// specified together with nextSyncToken.
 
2464
// If the syncToken expires, the
 
2465
// server will respond with a 410 GONE response code and the client
 
2466
// should clear its storage and perform a full synchronization without
 
2467
// any syncToken.
 
2468
// Learn more about incremental synchronization.
 
2469
//  The
 
2470
// default is to return all entries.
 
2471
func (c *CalendarListWatchCall) SyncToken(syncToken string) *CalendarListWatchCall {
 
2472
        c.opt_["syncToken"] = syncToken
 
2473
        return c
 
2474
}
 
2475
 
 
2476
// Fields allows partial responses to be retrieved.
 
2477
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2478
// for more information.
 
2479
func (c *CalendarListWatchCall) Fields(s ...googleapi.Field) *CalendarListWatchCall {
 
2480
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2481
        return c
 
2482
}
 
2483
 
 
2484
func (c *CalendarListWatchCall) Do() (*Channel, error) {
 
2485
        var body io.Reader = nil
 
2486
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
 
2487
        if err != nil {
 
2488
                return nil, err
 
2489
        }
 
2490
        ctype := "application/json"
 
2491
        params := make(url.Values)
 
2492
        params.Set("alt", "json")
 
2493
        if v, ok := c.opt_["maxResults"]; ok {
 
2494
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
2495
        }
 
2496
        if v, ok := c.opt_["minAccessRole"]; ok {
 
2497
                params.Set("minAccessRole", fmt.Sprintf("%v", v))
 
2498
        }
 
2499
        if v, ok := c.opt_["pageToken"]; ok {
 
2500
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
2501
        }
 
2502
        if v, ok := c.opt_["showDeleted"]; ok {
 
2503
                params.Set("showDeleted", fmt.Sprintf("%v", v))
 
2504
        }
 
2505
        if v, ok := c.opt_["showHidden"]; ok {
 
2506
                params.Set("showHidden", fmt.Sprintf("%v", v))
 
2507
        }
 
2508
        if v, ok := c.opt_["syncToken"]; ok {
 
2509
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
2510
        }
 
2511
        if v, ok := c.opt_["fields"]; ok {
 
2512
                params.Set("fields", fmt.Sprintf("%v", v))
 
2513
        }
 
2514
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/watch")
 
2515
        urls += "?" + params.Encode()
 
2516
        req, _ := http.NewRequest("POST", urls, body)
 
2517
        googleapi.SetOpaque(req.URL)
 
2518
        req.Header.Set("Content-Type", ctype)
 
2519
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2520
        res, err := c.s.client.Do(req)
 
2521
        if err != nil {
 
2522
                return nil, err
 
2523
        }
 
2524
        defer googleapi.CloseBody(res)
 
2525
        if err := googleapi.CheckResponse(res); err != nil {
 
2526
                return nil, err
 
2527
        }
 
2528
        var ret *Channel
 
2529
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2530
                return nil, err
 
2531
        }
 
2532
        return ret, nil
 
2533
        // {
 
2534
        //   "description": "Watch for changes to CalendarList resources.",
 
2535
        //   "httpMethod": "POST",
 
2536
        //   "id": "calendar.calendarList.watch",
 
2537
        //   "parameters": {
 
2538
        //     "maxResults": {
 
2539
        //       "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.",
 
2540
        //       "format": "int32",
 
2541
        //       "location": "query",
 
2542
        //       "minimum": "1",
 
2543
        //       "type": "integer"
 
2544
        //     },
 
2545
        //     "minAccessRole": {
 
2546
        //       "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.",
 
2547
        //       "enum": [
 
2548
        //         "freeBusyReader",
 
2549
        //         "owner",
 
2550
        //         "reader",
 
2551
        //         "writer"
 
2552
        //       ],
 
2553
        //       "enumDescriptions": [
 
2554
        //         "The user can read free/busy information.",
 
2555
        //         "The user can read and modify events and access control lists.",
 
2556
        //         "The user can read events that are not private.",
 
2557
        //         "The user can read and modify events."
 
2558
        //       ],
 
2559
        //       "location": "query",
 
2560
        //       "type": "string"
 
2561
        //     },
 
2562
        //     "pageToken": {
 
2563
        //       "description": "Token specifying which result page to return. Optional.",
 
2564
        //       "location": "query",
 
2565
        //       "type": "string"
 
2566
        //     },
 
2567
        //     "showDeleted": {
 
2568
        //       "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.",
 
2569
        //       "location": "query",
 
2570
        //       "type": "boolean"
 
2571
        //     },
 
2572
        //     "showHidden": {
 
2573
        //       "description": "Whether to show hidden entries. Optional. The default is False.",
 
2574
        //       "location": "query",
 
2575
        //       "type": "boolean"
 
2576
        //     },
 
2577
        //     "syncToken": {
 
2578
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. If only read-only fields such as calendar properties or ACLs have changed, the entry won't be returned. All entries deleted and hidden since the previous list request will always be in the result set and it is not allowed to set showDeleted neither showHidden to False.\nTo ensure client state consistency minAccessRole query parameter cannot be specified together with nextSyncToken.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
2579
        //       "location": "query",
 
2580
        //       "type": "string"
 
2581
        //     }
 
2582
        //   },
 
2583
        //   "path": "users/me/calendarList/watch",
 
2584
        //   "request": {
 
2585
        //     "$ref": "Channel",
 
2586
        //     "parameterName": "resource"
 
2587
        //   },
 
2588
        //   "response": {
 
2589
        //     "$ref": "Channel"
 
2590
        //   },
 
2591
        //   "scopes": [
 
2592
        //     "https://www.googleapis.com/auth/calendar",
 
2593
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
2594
        //   ],
 
2595
        //   "supportsSubscription": true
 
2596
        // }
 
2597
 
 
2598
}
 
2599
 
 
2600
// method id "calendar.calendars.clear":
 
2601
 
 
2602
type CalendarsClearCall struct {
 
2603
        s          *Service
 
2604
        calendarId string
 
2605
        opt_       map[string]interface{}
 
2606
}
 
2607
 
 
2608
// Clear: Clears a primary calendar. This operation deletes all data
 
2609
// associated with the primary calendar of an account and cannot be
 
2610
// undone.
 
2611
func (r *CalendarsService) Clear(calendarId string) *CalendarsClearCall {
 
2612
        c := &CalendarsClearCall{s: r.s, opt_: make(map[string]interface{})}
 
2613
        c.calendarId = calendarId
 
2614
        return c
 
2615
}
 
2616
 
 
2617
// Fields allows partial responses to be retrieved.
 
2618
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2619
// for more information.
 
2620
func (c *CalendarsClearCall) Fields(s ...googleapi.Field) *CalendarsClearCall {
 
2621
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2622
        return c
 
2623
}
 
2624
 
 
2625
func (c *CalendarsClearCall) Do() error {
 
2626
        var body io.Reader = nil
 
2627
        params := make(url.Values)
 
2628
        params.Set("alt", "json")
 
2629
        if v, ok := c.opt_["fields"]; ok {
 
2630
                params.Set("fields", fmt.Sprintf("%v", v))
 
2631
        }
 
2632
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/clear")
 
2633
        urls += "?" + params.Encode()
 
2634
        req, _ := http.NewRequest("POST", urls, body)
 
2635
        googleapi.Expand(req.URL, map[string]string{
 
2636
                "calendarId": c.calendarId,
 
2637
        })
 
2638
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2639
        res, err := c.s.client.Do(req)
 
2640
        if err != nil {
 
2641
                return err
 
2642
        }
 
2643
        defer googleapi.CloseBody(res)
 
2644
        if err := googleapi.CheckResponse(res); err != nil {
 
2645
                return err
 
2646
        }
 
2647
        return nil
 
2648
        // {
 
2649
        //   "description": "Clears a primary calendar. This operation deletes all data associated with the primary calendar of an account and cannot be undone.",
 
2650
        //   "httpMethod": "POST",
 
2651
        //   "id": "calendar.calendars.clear",
 
2652
        //   "parameterOrder": [
 
2653
        //     "calendarId"
 
2654
        //   ],
 
2655
        //   "parameters": {
 
2656
        //     "calendarId": {
 
2657
        //       "description": "Calendar identifier.",
 
2658
        //       "location": "path",
 
2659
        //       "required": true,
 
2660
        //       "type": "string"
 
2661
        //     }
 
2662
        //   },
 
2663
        //   "path": "calendars/{calendarId}/clear",
 
2664
        //   "scopes": [
 
2665
        //     "https://www.googleapis.com/auth/calendar"
 
2666
        //   ]
 
2667
        // }
 
2668
 
 
2669
}
 
2670
 
 
2671
// method id "calendar.calendars.delete":
 
2672
 
 
2673
type CalendarsDeleteCall struct {
 
2674
        s          *Service
 
2675
        calendarId string
 
2676
        opt_       map[string]interface{}
 
2677
}
 
2678
 
 
2679
// Delete: Deletes a secondary calendar.
 
2680
func (r *CalendarsService) Delete(calendarId string) *CalendarsDeleteCall {
 
2681
        c := &CalendarsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
2682
        c.calendarId = calendarId
 
2683
        return c
 
2684
}
 
2685
 
 
2686
// Fields allows partial responses to be retrieved.
 
2687
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2688
// for more information.
 
2689
func (c *CalendarsDeleteCall) Fields(s ...googleapi.Field) *CalendarsDeleteCall {
 
2690
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2691
        return c
 
2692
}
 
2693
 
 
2694
func (c *CalendarsDeleteCall) Do() error {
 
2695
        var body io.Reader = nil
 
2696
        params := make(url.Values)
 
2697
        params.Set("alt", "json")
 
2698
        if v, ok := c.opt_["fields"]; ok {
 
2699
                params.Set("fields", fmt.Sprintf("%v", v))
 
2700
        }
 
2701
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
 
2702
        urls += "?" + params.Encode()
 
2703
        req, _ := http.NewRequest("DELETE", urls, body)
 
2704
        googleapi.Expand(req.URL, map[string]string{
 
2705
                "calendarId": c.calendarId,
 
2706
        })
 
2707
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2708
        res, err := c.s.client.Do(req)
 
2709
        if err != nil {
 
2710
                return err
 
2711
        }
 
2712
        defer googleapi.CloseBody(res)
 
2713
        if err := googleapi.CheckResponse(res); err != nil {
 
2714
                return err
 
2715
        }
 
2716
        return nil
 
2717
        // {
 
2718
        //   "description": "Deletes a secondary calendar.",
 
2719
        //   "httpMethod": "DELETE",
 
2720
        //   "id": "calendar.calendars.delete",
 
2721
        //   "parameterOrder": [
 
2722
        //     "calendarId"
 
2723
        //   ],
 
2724
        //   "parameters": {
 
2725
        //     "calendarId": {
 
2726
        //       "description": "Calendar identifier.",
 
2727
        //       "location": "path",
 
2728
        //       "required": true,
 
2729
        //       "type": "string"
 
2730
        //     }
 
2731
        //   },
 
2732
        //   "path": "calendars/{calendarId}",
 
2733
        //   "scopes": [
 
2734
        //     "https://www.googleapis.com/auth/calendar"
 
2735
        //   ]
 
2736
        // }
 
2737
 
 
2738
}
 
2739
 
 
2740
// method id "calendar.calendars.get":
 
2741
 
 
2742
type CalendarsGetCall struct {
 
2743
        s          *Service
 
2744
        calendarId string
 
2745
        opt_       map[string]interface{}
 
2746
}
 
2747
 
 
2748
// Get: Returns metadata for a calendar.
 
2749
func (r *CalendarsService) Get(calendarId string) *CalendarsGetCall {
 
2750
        c := &CalendarsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
2751
        c.calendarId = calendarId
 
2752
        return c
 
2753
}
 
2754
 
 
2755
// Fields allows partial responses to be retrieved.
 
2756
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2757
// for more information.
 
2758
func (c *CalendarsGetCall) Fields(s ...googleapi.Field) *CalendarsGetCall {
 
2759
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2760
        return c
 
2761
}
 
2762
 
 
2763
func (c *CalendarsGetCall) Do() (*Calendar, error) {
 
2764
        var body io.Reader = nil
 
2765
        params := make(url.Values)
 
2766
        params.Set("alt", "json")
 
2767
        if v, ok := c.opt_["fields"]; ok {
 
2768
                params.Set("fields", fmt.Sprintf("%v", v))
 
2769
        }
 
2770
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
 
2771
        urls += "?" + params.Encode()
 
2772
        req, _ := http.NewRequest("GET", urls, body)
 
2773
        googleapi.Expand(req.URL, map[string]string{
 
2774
                "calendarId": c.calendarId,
 
2775
        })
 
2776
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2777
        res, err := c.s.client.Do(req)
 
2778
        if err != nil {
 
2779
                return nil, err
 
2780
        }
 
2781
        defer googleapi.CloseBody(res)
 
2782
        if err := googleapi.CheckResponse(res); err != nil {
 
2783
                return nil, err
 
2784
        }
 
2785
        var ret *Calendar
 
2786
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2787
                return nil, err
 
2788
        }
 
2789
        return ret, nil
 
2790
        // {
 
2791
        //   "description": "Returns metadata for a calendar.",
 
2792
        //   "httpMethod": "GET",
 
2793
        //   "id": "calendar.calendars.get",
 
2794
        //   "parameterOrder": [
 
2795
        //     "calendarId"
 
2796
        //   ],
 
2797
        //   "parameters": {
 
2798
        //     "calendarId": {
 
2799
        //       "description": "Calendar identifier.",
 
2800
        //       "location": "path",
 
2801
        //       "required": true,
 
2802
        //       "type": "string"
 
2803
        //     }
 
2804
        //   },
 
2805
        //   "path": "calendars/{calendarId}",
 
2806
        //   "response": {
 
2807
        //     "$ref": "Calendar"
 
2808
        //   },
 
2809
        //   "scopes": [
 
2810
        //     "https://www.googleapis.com/auth/calendar",
 
2811
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
2812
        //   ]
 
2813
        // }
 
2814
 
 
2815
}
 
2816
 
 
2817
// method id "calendar.calendars.insert":
 
2818
 
 
2819
type CalendarsInsertCall struct {
 
2820
        s        *Service
 
2821
        calendar *Calendar
 
2822
        opt_     map[string]interface{}
 
2823
}
 
2824
 
 
2825
// Insert: Creates a secondary calendar.
 
2826
func (r *CalendarsService) Insert(calendar *Calendar) *CalendarsInsertCall {
 
2827
        c := &CalendarsInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
2828
        c.calendar = calendar
 
2829
        return c
 
2830
}
 
2831
 
 
2832
// Fields allows partial responses to be retrieved.
 
2833
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2834
// for more information.
 
2835
func (c *CalendarsInsertCall) Fields(s ...googleapi.Field) *CalendarsInsertCall {
 
2836
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2837
        return c
 
2838
}
 
2839
 
 
2840
func (c *CalendarsInsertCall) Do() (*Calendar, error) {
 
2841
        var body io.Reader = nil
 
2842
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
 
2843
        if err != nil {
 
2844
                return nil, err
 
2845
        }
 
2846
        ctype := "application/json"
 
2847
        params := make(url.Values)
 
2848
        params.Set("alt", "json")
 
2849
        if v, ok := c.opt_["fields"]; ok {
 
2850
                params.Set("fields", fmt.Sprintf("%v", v))
 
2851
        }
 
2852
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars")
 
2853
        urls += "?" + params.Encode()
 
2854
        req, _ := http.NewRequest("POST", urls, body)
 
2855
        googleapi.SetOpaque(req.URL)
 
2856
        req.Header.Set("Content-Type", ctype)
 
2857
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2858
        res, err := c.s.client.Do(req)
 
2859
        if err != nil {
 
2860
                return nil, err
 
2861
        }
 
2862
        defer googleapi.CloseBody(res)
 
2863
        if err := googleapi.CheckResponse(res); err != nil {
 
2864
                return nil, err
 
2865
        }
 
2866
        var ret *Calendar
 
2867
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2868
                return nil, err
 
2869
        }
 
2870
        return ret, nil
 
2871
        // {
 
2872
        //   "description": "Creates a secondary calendar.",
 
2873
        //   "httpMethod": "POST",
 
2874
        //   "id": "calendar.calendars.insert",
 
2875
        //   "path": "calendars",
 
2876
        //   "request": {
 
2877
        //     "$ref": "Calendar"
 
2878
        //   },
 
2879
        //   "response": {
 
2880
        //     "$ref": "Calendar"
 
2881
        //   },
 
2882
        //   "scopes": [
 
2883
        //     "https://www.googleapis.com/auth/calendar"
 
2884
        //   ]
 
2885
        // }
 
2886
 
 
2887
}
 
2888
 
 
2889
// method id "calendar.calendars.patch":
 
2890
 
 
2891
type CalendarsPatchCall struct {
 
2892
        s          *Service
 
2893
        calendarId string
 
2894
        calendar   *Calendar
 
2895
        opt_       map[string]interface{}
 
2896
}
 
2897
 
 
2898
// Patch: Updates metadata for a calendar. This method supports patch
 
2899
// semantics.
 
2900
func (r *CalendarsService) Patch(calendarId string, calendar *Calendar) *CalendarsPatchCall {
 
2901
        c := &CalendarsPatchCall{s: r.s, opt_: make(map[string]interface{})}
 
2902
        c.calendarId = calendarId
 
2903
        c.calendar = calendar
 
2904
        return c
 
2905
}
 
2906
 
 
2907
// Fields allows partial responses to be retrieved.
 
2908
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2909
// for more information.
 
2910
func (c *CalendarsPatchCall) Fields(s ...googleapi.Field) *CalendarsPatchCall {
 
2911
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2912
        return c
 
2913
}
 
2914
 
 
2915
func (c *CalendarsPatchCall) Do() (*Calendar, error) {
 
2916
        var body io.Reader = nil
 
2917
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
 
2918
        if err != nil {
 
2919
                return nil, err
 
2920
        }
 
2921
        ctype := "application/json"
 
2922
        params := make(url.Values)
 
2923
        params.Set("alt", "json")
 
2924
        if v, ok := c.opt_["fields"]; ok {
 
2925
                params.Set("fields", fmt.Sprintf("%v", v))
 
2926
        }
 
2927
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
 
2928
        urls += "?" + params.Encode()
 
2929
        req, _ := http.NewRequest("PATCH", urls, body)
 
2930
        googleapi.Expand(req.URL, map[string]string{
 
2931
                "calendarId": c.calendarId,
 
2932
        })
 
2933
        req.Header.Set("Content-Type", ctype)
 
2934
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
2935
        res, err := c.s.client.Do(req)
 
2936
        if err != nil {
 
2937
                return nil, err
 
2938
        }
 
2939
        defer googleapi.CloseBody(res)
 
2940
        if err := googleapi.CheckResponse(res); err != nil {
 
2941
                return nil, err
 
2942
        }
 
2943
        var ret *Calendar
 
2944
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
2945
                return nil, err
 
2946
        }
 
2947
        return ret, nil
 
2948
        // {
 
2949
        //   "description": "Updates metadata for a calendar. This method supports patch semantics.",
 
2950
        //   "httpMethod": "PATCH",
 
2951
        //   "id": "calendar.calendars.patch",
 
2952
        //   "parameterOrder": [
 
2953
        //     "calendarId"
 
2954
        //   ],
 
2955
        //   "parameters": {
 
2956
        //     "calendarId": {
 
2957
        //       "description": "Calendar identifier.",
 
2958
        //       "location": "path",
 
2959
        //       "required": true,
 
2960
        //       "type": "string"
 
2961
        //     }
 
2962
        //   },
 
2963
        //   "path": "calendars/{calendarId}",
 
2964
        //   "request": {
 
2965
        //     "$ref": "Calendar"
 
2966
        //   },
 
2967
        //   "response": {
 
2968
        //     "$ref": "Calendar"
 
2969
        //   },
 
2970
        //   "scopes": [
 
2971
        //     "https://www.googleapis.com/auth/calendar"
 
2972
        //   ]
 
2973
        // }
 
2974
 
 
2975
}
 
2976
 
 
2977
// method id "calendar.calendars.update":
 
2978
 
 
2979
type CalendarsUpdateCall struct {
 
2980
        s          *Service
 
2981
        calendarId string
 
2982
        calendar   *Calendar
 
2983
        opt_       map[string]interface{}
 
2984
}
 
2985
 
 
2986
// Update: Updates metadata for a calendar.
 
2987
func (r *CalendarsService) Update(calendarId string, calendar *Calendar) *CalendarsUpdateCall {
 
2988
        c := &CalendarsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
2989
        c.calendarId = calendarId
 
2990
        c.calendar = calendar
 
2991
        return c
 
2992
}
 
2993
 
 
2994
// Fields allows partial responses to be retrieved.
 
2995
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
2996
// for more information.
 
2997
func (c *CalendarsUpdateCall) Fields(s ...googleapi.Field) *CalendarsUpdateCall {
 
2998
        c.opt_["fields"] = googleapi.CombineFields(s)
 
2999
        return c
 
3000
}
 
3001
 
 
3002
func (c *CalendarsUpdateCall) Do() (*Calendar, error) {
 
3003
        var body io.Reader = nil
 
3004
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
 
3005
        if err != nil {
 
3006
                return nil, err
 
3007
        }
 
3008
        ctype := "application/json"
 
3009
        params := make(url.Values)
 
3010
        params.Set("alt", "json")
 
3011
        if v, ok := c.opt_["fields"]; ok {
 
3012
                params.Set("fields", fmt.Sprintf("%v", v))
 
3013
        }
 
3014
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
 
3015
        urls += "?" + params.Encode()
 
3016
        req, _ := http.NewRequest("PUT", urls, body)
 
3017
        googleapi.Expand(req.URL, map[string]string{
 
3018
                "calendarId": c.calendarId,
 
3019
        })
 
3020
        req.Header.Set("Content-Type", ctype)
 
3021
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3022
        res, err := c.s.client.Do(req)
 
3023
        if err != nil {
 
3024
                return nil, err
 
3025
        }
 
3026
        defer googleapi.CloseBody(res)
 
3027
        if err := googleapi.CheckResponse(res); err != nil {
 
3028
                return nil, err
 
3029
        }
 
3030
        var ret *Calendar
 
3031
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
3032
                return nil, err
 
3033
        }
 
3034
        return ret, nil
 
3035
        // {
 
3036
        //   "description": "Updates metadata for a calendar.",
 
3037
        //   "httpMethod": "PUT",
 
3038
        //   "id": "calendar.calendars.update",
 
3039
        //   "parameterOrder": [
 
3040
        //     "calendarId"
 
3041
        //   ],
 
3042
        //   "parameters": {
 
3043
        //     "calendarId": {
 
3044
        //       "description": "Calendar identifier.",
 
3045
        //       "location": "path",
 
3046
        //       "required": true,
 
3047
        //       "type": "string"
 
3048
        //     }
 
3049
        //   },
 
3050
        //   "path": "calendars/{calendarId}",
 
3051
        //   "request": {
 
3052
        //     "$ref": "Calendar"
 
3053
        //   },
 
3054
        //   "response": {
 
3055
        //     "$ref": "Calendar"
 
3056
        //   },
 
3057
        //   "scopes": [
 
3058
        //     "https://www.googleapis.com/auth/calendar"
 
3059
        //   ]
 
3060
        // }
 
3061
 
 
3062
}
 
3063
 
 
3064
// method id "calendar.channels.stop":
 
3065
 
 
3066
type ChannelsStopCall struct {
 
3067
        s       *Service
 
3068
        channel *Channel
 
3069
        opt_    map[string]interface{}
 
3070
}
 
3071
 
 
3072
// Stop: Stop watching resources through this channel
 
3073
func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
 
3074
        c := &ChannelsStopCall{s: r.s, opt_: make(map[string]interface{})}
 
3075
        c.channel = channel
 
3076
        return c
 
3077
}
 
3078
 
 
3079
// Fields allows partial responses to be retrieved.
 
3080
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
3081
// for more information.
 
3082
func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
 
3083
        c.opt_["fields"] = googleapi.CombineFields(s)
 
3084
        return c
 
3085
}
 
3086
 
 
3087
func (c *ChannelsStopCall) Do() error {
 
3088
        var body io.Reader = nil
 
3089
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
 
3090
        if err != nil {
 
3091
                return err
 
3092
        }
 
3093
        ctype := "application/json"
 
3094
        params := make(url.Values)
 
3095
        params.Set("alt", "json")
 
3096
        if v, ok := c.opt_["fields"]; ok {
 
3097
                params.Set("fields", fmt.Sprintf("%v", v))
 
3098
        }
 
3099
        urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
 
3100
        urls += "?" + params.Encode()
 
3101
        req, _ := http.NewRequest("POST", urls, body)
 
3102
        googleapi.SetOpaque(req.URL)
 
3103
        req.Header.Set("Content-Type", ctype)
 
3104
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3105
        res, err := c.s.client.Do(req)
 
3106
        if err != nil {
 
3107
                return err
 
3108
        }
 
3109
        defer googleapi.CloseBody(res)
 
3110
        if err := googleapi.CheckResponse(res); err != nil {
 
3111
                return err
 
3112
        }
 
3113
        return nil
 
3114
        // {
 
3115
        //   "description": "Stop watching resources through this channel",
 
3116
        //   "httpMethod": "POST",
 
3117
        //   "id": "calendar.channels.stop",
 
3118
        //   "path": "channels/stop",
 
3119
        //   "request": {
 
3120
        //     "$ref": "Channel",
 
3121
        //     "parameterName": "resource"
 
3122
        //   },
 
3123
        //   "scopes": [
 
3124
        //     "https://www.googleapis.com/auth/calendar",
 
3125
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
3126
        //   ]
 
3127
        // }
 
3128
 
 
3129
}
 
3130
 
 
3131
// method id "calendar.colors.get":
 
3132
 
 
3133
type ColorsGetCall struct {
 
3134
        s    *Service
 
3135
        opt_ map[string]interface{}
 
3136
}
 
3137
 
 
3138
// Get: Returns the color definitions for calendars and events.
 
3139
func (r *ColorsService) Get() *ColorsGetCall {
 
3140
        c := &ColorsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
3141
        return c
 
3142
}
 
3143
 
 
3144
// Fields allows partial responses to be retrieved.
 
3145
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
3146
// for more information.
 
3147
func (c *ColorsGetCall) Fields(s ...googleapi.Field) *ColorsGetCall {
 
3148
        c.opt_["fields"] = googleapi.CombineFields(s)
 
3149
        return c
 
3150
}
 
3151
 
 
3152
func (c *ColorsGetCall) Do() (*Colors, error) {
 
3153
        var body io.Reader = nil
 
3154
        params := make(url.Values)
 
3155
        params.Set("alt", "json")
 
3156
        if v, ok := c.opt_["fields"]; ok {
 
3157
                params.Set("fields", fmt.Sprintf("%v", v))
 
3158
        }
 
3159
        urls := googleapi.ResolveRelative(c.s.BasePath, "colors")
 
3160
        urls += "?" + params.Encode()
 
3161
        req, _ := http.NewRequest("GET", urls, body)
 
3162
        googleapi.SetOpaque(req.URL)
 
3163
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3164
        res, err := c.s.client.Do(req)
 
3165
        if err != nil {
 
3166
                return nil, err
 
3167
        }
 
3168
        defer googleapi.CloseBody(res)
 
3169
        if err := googleapi.CheckResponse(res); err != nil {
 
3170
                return nil, err
 
3171
        }
 
3172
        var ret *Colors
 
3173
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
3174
                return nil, err
 
3175
        }
 
3176
        return ret, nil
 
3177
        // {
 
3178
        //   "description": "Returns the color definitions for calendars and events.",
 
3179
        //   "httpMethod": "GET",
 
3180
        //   "id": "calendar.colors.get",
 
3181
        //   "path": "colors",
 
3182
        //   "response": {
 
3183
        //     "$ref": "Colors"
 
3184
        //   },
 
3185
        //   "scopes": [
 
3186
        //     "https://www.googleapis.com/auth/calendar",
 
3187
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
3188
        //   ]
 
3189
        // }
 
3190
 
 
3191
}
 
3192
 
 
3193
// method id "calendar.events.delete":
 
3194
 
 
3195
type EventsDeleteCall struct {
 
3196
        s          *Service
 
3197
        calendarId string
 
3198
        eventId    string
 
3199
        opt_       map[string]interface{}
 
3200
}
 
3201
 
 
3202
// Delete: Deletes an event.
 
3203
func (r *EventsService) Delete(calendarId string, eventId string) *EventsDeleteCall {
 
3204
        c := &EventsDeleteCall{s: r.s, opt_: make(map[string]interface{})}
 
3205
        c.calendarId = calendarId
 
3206
        c.eventId = eventId
 
3207
        return c
 
3208
}
 
3209
 
 
3210
// SendNotifications sets the optional parameter "sendNotifications":
 
3211
// Whether to send notifications about the deletion of the event.  The
 
3212
// default is False.
 
3213
func (c *EventsDeleteCall) SendNotifications(sendNotifications bool) *EventsDeleteCall {
 
3214
        c.opt_["sendNotifications"] = sendNotifications
 
3215
        return c
 
3216
}
 
3217
 
 
3218
// Fields allows partial responses to be retrieved.
 
3219
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
3220
// for more information.
 
3221
func (c *EventsDeleteCall) Fields(s ...googleapi.Field) *EventsDeleteCall {
 
3222
        c.opt_["fields"] = googleapi.CombineFields(s)
 
3223
        return c
 
3224
}
 
3225
 
 
3226
func (c *EventsDeleteCall) Do() error {
 
3227
        var body io.Reader = nil
 
3228
        params := make(url.Values)
 
3229
        params.Set("alt", "json")
 
3230
        if v, ok := c.opt_["sendNotifications"]; ok {
 
3231
                params.Set("sendNotifications", fmt.Sprintf("%v", v))
 
3232
        }
 
3233
        if v, ok := c.opt_["fields"]; ok {
 
3234
                params.Set("fields", fmt.Sprintf("%v", v))
 
3235
        }
 
3236
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
 
3237
        urls += "?" + params.Encode()
 
3238
        req, _ := http.NewRequest("DELETE", urls, body)
 
3239
        googleapi.Expand(req.URL, map[string]string{
 
3240
                "calendarId": c.calendarId,
 
3241
                "eventId":    c.eventId,
 
3242
        })
 
3243
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3244
        res, err := c.s.client.Do(req)
 
3245
        if err != nil {
 
3246
                return err
 
3247
        }
 
3248
        defer googleapi.CloseBody(res)
 
3249
        if err := googleapi.CheckResponse(res); err != nil {
 
3250
                return err
 
3251
        }
 
3252
        return nil
 
3253
        // {
 
3254
        //   "description": "Deletes an event.",
 
3255
        //   "httpMethod": "DELETE",
 
3256
        //   "id": "calendar.events.delete",
 
3257
        //   "parameterOrder": [
 
3258
        //     "calendarId",
 
3259
        //     "eventId"
 
3260
        //   ],
 
3261
        //   "parameters": {
 
3262
        //     "calendarId": {
 
3263
        //       "description": "Calendar identifier.",
 
3264
        //       "location": "path",
 
3265
        //       "required": true,
 
3266
        //       "type": "string"
 
3267
        //     },
 
3268
        //     "eventId": {
 
3269
        //       "description": "Event identifier.",
 
3270
        //       "location": "path",
 
3271
        //       "required": true,
 
3272
        //       "type": "string"
 
3273
        //     },
 
3274
        //     "sendNotifications": {
 
3275
        //       "description": "Whether to send notifications about the deletion of the event. Optional. The default is False.",
 
3276
        //       "location": "query",
 
3277
        //       "type": "boolean"
 
3278
        //     }
 
3279
        //   },
 
3280
        //   "path": "calendars/{calendarId}/events/{eventId}",
 
3281
        //   "scopes": [
 
3282
        //     "https://www.googleapis.com/auth/calendar"
 
3283
        //   ]
 
3284
        // }
 
3285
 
 
3286
}
 
3287
 
 
3288
// method id "calendar.events.get":
 
3289
 
 
3290
type EventsGetCall struct {
 
3291
        s          *Service
 
3292
        calendarId string
 
3293
        eventId    string
 
3294
        opt_       map[string]interface{}
 
3295
}
 
3296
 
 
3297
// Get: Returns an event.
 
3298
func (r *EventsService) Get(calendarId string, eventId string) *EventsGetCall {
 
3299
        c := &EventsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
3300
        c.calendarId = calendarId
 
3301
        c.eventId = eventId
 
3302
        return c
 
3303
}
 
3304
 
 
3305
// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
 
3306
// Whether to always include a value in the email field for the
 
3307
// organizer, creator and attendees, even if no real email is available
 
3308
// (i.e. a generated, non-working value will be provided). The use of
 
3309
// this option is discouraged and should only be used by clients which
 
3310
// cannot handle the absence of an email address value in the mentioned
 
3311
// places.  The default is False.
 
3312
func (c *EventsGetCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsGetCall {
 
3313
        c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail
 
3314
        return c
 
3315
}
 
3316
 
 
3317
// MaxAttendees sets the optional parameter "maxAttendees": The maximum
 
3318
// number of attendees to include in the response. If there are more
 
3319
// than the specified number of attendees, only the participant is
 
3320
// returned.
 
3321
func (c *EventsGetCall) MaxAttendees(maxAttendees int64) *EventsGetCall {
 
3322
        c.opt_["maxAttendees"] = maxAttendees
 
3323
        return c
 
3324
}
 
3325
 
 
3326
// TimeZone sets the optional parameter "timeZone": Time zone used in
 
3327
// the response.  The default is the time zone of the calendar.
 
3328
func (c *EventsGetCall) TimeZone(timeZone string) *EventsGetCall {
 
3329
        c.opt_["timeZone"] = timeZone
 
3330
        return c
 
3331
}
 
3332
 
 
3333
// Fields allows partial responses to be retrieved.
 
3334
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
3335
// for more information.
 
3336
func (c *EventsGetCall) Fields(s ...googleapi.Field) *EventsGetCall {
 
3337
        c.opt_["fields"] = googleapi.CombineFields(s)
 
3338
        return c
 
3339
}
 
3340
 
 
3341
func (c *EventsGetCall) Do() (*Event, error) {
 
3342
        var body io.Reader = nil
 
3343
        params := make(url.Values)
 
3344
        params.Set("alt", "json")
 
3345
        if v, ok := c.opt_["alwaysIncludeEmail"]; ok {
 
3346
                params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v))
 
3347
        }
 
3348
        if v, ok := c.opt_["maxAttendees"]; ok {
 
3349
                params.Set("maxAttendees", fmt.Sprintf("%v", v))
 
3350
        }
 
3351
        if v, ok := c.opt_["timeZone"]; ok {
 
3352
                params.Set("timeZone", fmt.Sprintf("%v", v))
 
3353
        }
 
3354
        if v, ok := c.opt_["fields"]; ok {
 
3355
                params.Set("fields", fmt.Sprintf("%v", v))
 
3356
        }
 
3357
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
 
3358
        urls += "?" + params.Encode()
 
3359
        req, _ := http.NewRequest("GET", urls, body)
 
3360
        googleapi.Expand(req.URL, map[string]string{
 
3361
                "calendarId": c.calendarId,
 
3362
                "eventId":    c.eventId,
 
3363
        })
 
3364
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3365
        res, err := c.s.client.Do(req)
 
3366
        if err != nil {
 
3367
                return nil, err
 
3368
        }
 
3369
        defer googleapi.CloseBody(res)
 
3370
        if err := googleapi.CheckResponse(res); err != nil {
 
3371
                return nil, err
 
3372
        }
 
3373
        var ret *Event
 
3374
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
3375
                return nil, err
 
3376
        }
 
3377
        return ret, nil
 
3378
        // {
 
3379
        //   "description": "Returns an event.",
 
3380
        //   "httpMethod": "GET",
 
3381
        //   "id": "calendar.events.get",
 
3382
        //   "parameterOrder": [
 
3383
        //     "calendarId",
 
3384
        //     "eventId"
 
3385
        //   ],
 
3386
        //   "parameters": {
 
3387
        //     "alwaysIncludeEmail": {
 
3388
        //       "description": "Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.",
 
3389
        //       "location": "query",
 
3390
        //       "type": "boolean"
 
3391
        //     },
 
3392
        //     "calendarId": {
 
3393
        //       "description": "Calendar identifier.",
 
3394
        //       "location": "path",
 
3395
        //       "required": true,
 
3396
        //       "type": "string"
 
3397
        //     },
 
3398
        //     "eventId": {
 
3399
        //       "description": "Event identifier.",
 
3400
        //       "location": "path",
 
3401
        //       "required": true,
 
3402
        //       "type": "string"
 
3403
        //     },
 
3404
        //     "maxAttendees": {
 
3405
        //       "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.",
 
3406
        //       "format": "int32",
 
3407
        //       "location": "query",
 
3408
        //       "minimum": "1",
 
3409
        //       "type": "integer"
 
3410
        //     },
 
3411
        //     "timeZone": {
 
3412
        //       "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
 
3413
        //       "location": "query",
 
3414
        //       "type": "string"
 
3415
        //     }
 
3416
        //   },
 
3417
        //   "path": "calendars/{calendarId}/events/{eventId}",
 
3418
        //   "response": {
 
3419
        //     "$ref": "Event"
 
3420
        //   },
 
3421
        //   "scopes": [
 
3422
        //     "https://www.googleapis.com/auth/calendar",
 
3423
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
3424
        //   ]
 
3425
        // }
 
3426
 
 
3427
}
 
3428
 
 
3429
// method id "calendar.events.import":
 
3430
 
 
3431
type EventsImportCall struct {
 
3432
        s          *Service
 
3433
        calendarId string
 
3434
        event      *Event
 
3435
        opt_       map[string]interface{}
 
3436
}
 
3437
 
 
3438
// Import: Imports an event. This operation is used to add a private
 
3439
// copy of an existing event to a calendar.
 
3440
func (r *EventsService) Import(calendarId string, event *Event) *EventsImportCall {
 
3441
        c := &EventsImportCall{s: r.s, opt_: make(map[string]interface{})}
 
3442
        c.calendarId = calendarId
 
3443
        c.event = event
 
3444
        return c
 
3445
}
 
3446
 
 
3447
// Fields allows partial responses to be retrieved.
 
3448
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
3449
// for more information.
 
3450
func (c *EventsImportCall) Fields(s ...googleapi.Field) *EventsImportCall {
 
3451
        c.opt_["fields"] = googleapi.CombineFields(s)
 
3452
        return c
 
3453
}
 
3454
 
 
3455
func (c *EventsImportCall) Do() (*Event, error) {
 
3456
        var body io.Reader = nil
 
3457
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
 
3458
        if err != nil {
 
3459
                return nil, err
 
3460
        }
 
3461
        ctype := "application/json"
 
3462
        params := make(url.Values)
 
3463
        params.Set("alt", "json")
 
3464
        if v, ok := c.opt_["fields"]; ok {
 
3465
                params.Set("fields", fmt.Sprintf("%v", v))
 
3466
        }
 
3467
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/import")
 
3468
        urls += "?" + params.Encode()
 
3469
        req, _ := http.NewRequest("POST", urls, body)
 
3470
        googleapi.Expand(req.URL, map[string]string{
 
3471
                "calendarId": c.calendarId,
 
3472
        })
 
3473
        req.Header.Set("Content-Type", ctype)
 
3474
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3475
        res, err := c.s.client.Do(req)
 
3476
        if err != nil {
 
3477
                return nil, err
 
3478
        }
 
3479
        defer googleapi.CloseBody(res)
 
3480
        if err := googleapi.CheckResponse(res); err != nil {
 
3481
                return nil, err
 
3482
        }
 
3483
        var ret *Event
 
3484
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
3485
                return nil, err
 
3486
        }
 
3487
        return ret, nil
 
3488
        // {
 
3489
        //   "description": "Imports an event. This operation is used to add a private copy of an existing event to a calendar.",
 
3490
        //   "httpMethod": "POST",
 
3491
        //   "id": "calendar.events.import",
 
3492
        //   "parameterOrder": [
 
3493
        //     "calendarId"
 
3494
        //   ],
 
3495
        //   "parameters": {
 
3496
        //     "calendarId": {
 
3497
        //       "description": "Calendar identifier.",
 
3498
        //       "location": "path",
 
3499
        //       "required": true,
 
3500
        //       "type": "string"
 
3501
        //     }
 
3502
        //   },
 
3503
        //   "path": "calendars/{calendarId}/events/import",
 
3504
        //   "request": {
 
3505
        //     "$ref": "Event"
 
3506
        //   },
 
3507
        //   "response": {
 
3508
        //     "$ref": "Event"
 
3509
        //   },
 
3510
        //   "scopes": [
 
3511
        //     "https://www.googleapis.com/auth/calendar"
 
3512
        //   ]
 
3513
        // }
 
3514
 
 
3515
}
 
3516
 
 
3517
// method id "calendar.events.insert":
 
3518
 
 
3519
type EventsInsertCall struct {
 
3520
        s          *Service
 
3521
        calendarId string
 
3522
        event      *Event
 
3523
        opt_       map[string]interface{}
 
3524
}
 
3525
 
 
3526
// Insert: Creates an event.
 
3527
func (r *EventsService) Insert(calendarId string, event *Event) *EventsInsertCall {
 
3528
        c := &EventsInsertCall{s: r.s, opt_: make(map[string]interface{})}
 
3529
        c.calendarId = calendarId
 
3530
        c.event = event
 
3531
        return c
 
3532
}
 
3533
 
 
3534
// MaxAttendees sets the optional parameter "maxAttendees": The maximum
 
3535
// number of attendees to include in the response. If there are more
 
3536
// than the specified number of attendees, only the participant is
 
3537
// returned.
 
3538
func (c *EventsInsertCall) MaxAttendees(maxAttendees int64) *EventsInsertCall {
 
3539
        c.opt_["maxAttendees"] = maxAttendees
 
3540
        return c
 
3541
}
 
3542
 
 
3543
// SendNotifications sets the optional parameter "sendNotifications":
 
3544
// Whether to send notifications about the creation of the new event.
 
3545
// The default is False.
 
3546
func (c *EventsInsertCall) SendNotifications(sendNotifications bool) *EventsInsertCall {
 
3547
        c.opt_["sendNotifications"] = sendNotifications
 
3548
        return c
 
3549
}
 
3550
 
 
3551
// Fields allows partial responses to be retrieved.
 
3552
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
3553
// for more information.
 
3554
func (c *EventsInsertCall) Fields(s ...googleapi.Field) *EventsInsertCall {
 
3555
        c.opt_["fields"] = googleapi.CombineFields(s)
 
3556
        return c
 
3557
}
 
3558
 
 
3559
func (c *EventsInsertCall) Do() (*Event, error) {
 
3560
        var body io.Reader = nil
 
3561
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
 
3562
        if err != nil {
 
3563
                return nil, err
 
3564
        }
 
3565
        ctype := "application/json"
 
3566
        params := make(url.Values)
 
3567
        params.Set("alt", "json")
 
3568
        if v, ok := c.opt_["maxAttendees"]; ok {
 
3569
                params.Set("maxAttendees", fmt.Sprintf("%v", v))
 
3570
        }
 
3571
        if v, ok := c.opt_["sendNotifications"]; ok {
 
3572
                params.Set("sendNotifications", fmt.Sprintf("%v", v))
 
3573
        }
 
3574
        if v, ok := c.opt_["fields"]; ok {
 
3575
                params.Set("fields", fmt.Sprintf("%v", v))
 
3576
        }
 
3577
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events")
 
3578
        urls += "?" + params.Encode()
 
3579
        req, _ := http.NewRequest("POST", urls, body)
 
3580
        googleapi.Expand(req.URL, map[string]string{
 
3581
                "calendarId": c.calendarId,
 
3582
        })
 
3583
        req.Header.Set("Content-Type", ctype)
 
3584
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3585
        res, err := c.s.client.Do(req)
 
3586
        if err != nil {
 
3587
                return nil, err
 
3588
        }
 
3589
        defer googleapi.CloseBody(res)
 
3590
        if err := googleapi.CheckResponse(res); err != nil {
 
3591
                return nil, err
 
3592
        }
 
3593
        var ret *Event
 
3594
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
3595
                return nil, err
 
3596
        }
 
3597
        return ret, nil
 
3598
        // {
 
3599
        //   "description": "Creates an event.",
 
3600
        //   "httpMethod": "POST",
 
3601
        //   "id": "calendar.events.insert",
 
3602
        //   "parameterOrder": [
 
3603
        //     "calendarId"
 
3604
        //   ],
 
3605
        //   "parameters": {
 
3606
        //     "calendarId": {
 
3607
        //       "description": "Calendar identifier.",
 
3608
        //       "location": "path",
 
3609
        //       "required": true,
 
3610
        //       "type": "string"
 
3611
        //     },
 
3612
        //     "maxAttendees": {
 
3613
        //       "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.",
 
3614
        //       "format": "int32",
 
3615
        //       "location": "query",
 
3616
        //       "minimum": "1",
 
3617
        //       "type": "integer"
 
3618
        //     },
 
3619
        //     "sendNotifications": {
 
3620
        //       "description": "Whether to send notifications about the creation of the new event. Optional. The default is False.",
 
3621
        //       "location": "query",
 
3622
        //       "type": "boolean"
 
3623
        //     }
 
3624
        //   },
 
3625
        //   "path": "calendars/{calendarId}/events",
 
3626
        //   "request": {
 
3627
        //     "$ref": "Event"
 
3628
        //   },
 
3629
        //   "response": {
 
3630
        //     "$ref": "Event"
 
3631
        //   },
 
3632
        //   "scopes": [
 
3633
        //     "https://www.googleapis.com/auth/calendar"
 
3634
        //   ]
 
3635
        // }
 
3636
 
 
3637
}
 
3638
 
 
3639
// method id "calendar.events.instances":
 
3640
 
 
3641
type EventsInstancesCall struct {
 
3642
        s          *Service
 
3643
        calendarId string
 
3644
        eventId    string
 
3645
        opt_       map[string]interface{}
 
3646
}
 
3647
 
 
3648
// Instances: Returns instances of the specified recurring event.
 
3649
func (r *EventsService) Instances(calendarId string, eventId string) *EventsInstancesCall {
 
3650
        c := &EventsInstancesCall{s: r.s, opt_: make(map[string]interface{})}
 
3651
        c.calendarId = calendarId
 
3652
        c.eventId = eventId
 
3653
        return c
 
3654
}
 
3655
 
 
3656
// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
 
3657
// Whether to always include a value in the email field for the
 
3658
// organizer, creator and attendees, even if no real email is available
 
3659
// (i.e. a generated, non-working value will be provided). The use of
 
3660
// this option is discouraged and should only be used by clients which
 
3661
// cannot handle the absence of an email address value in the mentioned
 
3662
// places.  The default is False.
 
3663
func (c *EventsInstancesCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsInstancesCall {
 
3664
        c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail
 
3665
        return c
 
3666
}
 
3667
 
 
3668
// MaxAttendees sets the optional parameter "maxAttendees": The maximum
 
3669
// number of attendees to include in the response. If there are more
 
3670
// than the specified number of attendees, only the participant is
 
3671
// returned.
 
3672
func (c *EventsInstancesCall) MaxAttendees(maxAttendees int64) *EventsInstancesCall {
 
3673
        c.opt_["maxAttendees"] = maxAttendees
 
3674
        return c
 
3675
}
 
3676
 
 
3677
// MaxResults sets the optional parameter "maxResults": Maximum number
 
3678
// of events returned on one result page. By default the value is 250
 
3679
// events. The page size can never be larger than 2500 events.
 
3680
func (c *EventsInstancesCall) MaxResults(maxResults int64) *EventsInstancesCall {
 
3681
        c.opt_["maxResults"] = maxResults
 
3682
        return c
 
3683
}
 
3684
 
 
3685
// OriginalStart sets the optional parameter "originalStart": The
 
3686
// original start time of the instance in the result.
 
3687
func (c *EventsInstancesCall) OriginalStart(originalStart string) *EventsInstancesCall {
 
3688
        c.opt_["originalStart"] = originalStart
 
3689
        return c
 
3690
}
 
3691
 
 
3692
// PageToken sets the optional parameter "pageToken": Token specifying
 
3693
// which result page to return.
 
3694
func (c *EventsInstancesCall) PageToken(pageToken string) *EventsInstancesCall {
 
3695
        c.opt_["pageToken"] = pageToken
 
3696
        return c
 
3697
}
 
3698
 
 
3699
// ShowDeleted sets the optional parameter "showDeleted": Whether to
 
3700
// include deleted events (with status equals "cancelled") in the
 
3701
// result. Cancelled instances of recurring events will still be
 
3702
// included if singleEvents is False.  The default is False.
 
3703
func (c *EventsInstancesCall) ShowDeleted(showDeleted bool) *EventsInstancesCall {
 
3704
        c.opt_["showDeleted"] = showDeleted
 
3705
        return c
 
3706
}
 
3707
 
 
3708
// TimeMax sets the optional parameter "timeMax": Upper bound
 
3709
// (exclusive) for an event's start time to filter by.  The default is
 
3710
// not to filter by start time.
 
3711
func (c *EventsInstancesCall) TimeMax(timeMax string) *EventsInstancesCall {
 
3712
        c.opt_["timeMax"] = timeMax
 
3713
        return c
 
3714
}
 
3715
 
 
3716
// TimeMin sets the optional parameter "timeMin": Lower bound
 
3717
// (inclusive) for an event's end time to filter by.  The default is not
 
3718
// to filter by end time.
 
3719
func (c *EventsInstancesCall) TimeMin(timeMin string) *EventsInstancesCall {
 
3720
        c.opt_["timeMin"] = timeMin
 
3721
        return c
 
3722
}
 
3723
 
 
3724
// TimeZone sets the optional parameter "timeZone": Time zone used in
 
3725
// the response.  The default is the time zone of the calendar.
 
3726
func (c *EventsInstancesCall) TimeZone(timeZone string) *EventsInstancesCall {
 
3727
        c.opt_["timeZone"] = timeZone
 
3728
        return c
 
3729
}
 
3730
 
 
3731
// Fields allows partial responses to be retrieved.
 
3732
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
3733
// for more information.
 
3734
func (c *EventsInstancesCall) Fields(s ...googleapi.Field) *EventsInstancesCall {
 
3735
        c.opt_["fields"] = googleapi.CombineFields(s)
 
3736
        return c
 
3737
}
 
3738
 
 
3739
func (c *EventsInstancesCall) Do() (*Events, error) {
 
3740
        var body io.Reader = nil
 
3741
        params := make(url.Values)
 
3742
        params.Set("alt", "json")
 
3743
        if v, ok := c.opt_["alwaysIncludeEmail"]; ok {
 
3744
                params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v))
 
3745
        }
 
3746
        if v, ok := c.opt_["maxAttendees"]; ok {
 
3747
                params.Set("maxAttendees", fmt.Sprintf("%v", v))
 
3748
        }
 
3749
        if v, ok := c.opt_["maxResults"]; ok {
 
3750
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
3751
        }
 
3752
        if v, ok := c.opt_["originalStart"]; ok {
 
3753
                params.Set("originalStart", fmt.Sprintf("%v", v))
 
3754
        }
 
3755
        if v, ok := c.opt_["pageToken"]; ok {
 
3756
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
3757
        }
 
3758
        if v, ok := c.opt_["showDeleted"]; ok {
 
3759
                params.Set("showDeleted", fmt.Sprintf("%v", v))
 
3760
        }
 
3761
        if v, ok := c.opt_["timeMax"]; ok {
 
3762
                params.Set("timeMax", fmt.Sprintf("%v", v))
 
3763
        }
 
3764
        if v, ok := c.opt_["timeMin"]; ok {
 
3765
                params.Set("timeMin", fmt.Sprintf("%v", v))
 
3766
        }
 
3767
        if v, ok := c.opt_["timeZone"]; ok {
 
3768
                params.Set("timeZone", fmt.Sprintf("%v", v))
 
3769
        }
 
3770
        if v, ok := c.opt_["fields"]; ok {
 
3771
                params.Set("fields", fmt.Sprintf("%v", v))
 
3772
        }
 
3773
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/instances")
 
3774
        urls += "?" + params.Encode()
 
3775
        req, _ := http.NewRequest("GET", urls, body)
 
3776
        googleapi.Expand(req.URL, map[string]string{
 
3777
                "calendarId": c.calendarId,
 
3778
                "eventId":    c.eventId,
 
3779
        })
 
3780
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
3781
        res, err := c.s.client.Do(req)
 
3782
        if err != nil {
 
3783
                return nil, err
 
3784
        }
 
3785
        defer googleapi.CloseBody(res)
 
3786
        if err := googleapi.CheckResponse(res); err != nil {
 
3787
                return nil, err
 
3788
        }
 
3789
        var ret *Events
 
3790
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
3791
                return nil, err
 
3792
        }
 
3793
        return ret, nil
 
3794
        // {
 
3795
        //   "description": "Returns instances of the specified recurring event.",
 
3796
        //   "httpMethod": "GET",
 
3797
        //   "id": "calendar.events.instances",
 
3798
        //   "parameterOrder": [
 
3799
        //     "calendarId",
 
3800
        //     "eventId"
 
3801
        //   ],
 
3802
        //   "parameters": {
 
3803
        //     "alwaysIncludeEmail": {
 
3804
        //       "description": "Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.",
 
3805
        //       "location": "query",
 
3806
        //       "type": "boolean"
 
3807
        //     },
 
3808
        //     "calendarId": {
 
3809
        //       "description": "Calendar identifier.",
 
3810
        //       "location": "path",
 
3811
        //       "required": true,
 
3812
        //       "type": "string"
 
3813
        //     },
 
3814
        //     "eventId": {
 
3815
        //       "description": "Recurring event identifier.",
 
3816
        //       "location": "path",
 
3817
        //       "required": true,
 
3818
        //       "type": "string"
 
3819
        //     },
 
3820
        //     "maxAttendees": {
 
3821
        //       "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.",
 
3822
        //       "format": "int32",
 
3823
        //       "location": "query",
 
3824
        //       "minimum": "1",
 
3825
        //       "type": "integer"
 
3826
        //     },
 
3827
        //     "maxResults": {
 
3828
        //       "description": "Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.",
 
3829
        //       "format": "int32",
 
3830
        //       "location": "query",
 
3831
        //       "minimum": "1",
 
3832
        //       "type": "integer"
 
3833
        //     },
 
3834
        //     "originalStart": {
 
3835
        //       "description": "The original start time of the instance in the result. Optional.",
 
3836
        //       "location": "query",
 
3837
        //       "type": "string"
 
3838
        //     },
 
3839
        //     "pageToken": {
 
3840
        //       "description": "Token specifying which result page to return. Optional.",
 
3841
        //       "location": "query",
 
3842
        //       "type": "string"
 
3843
        //     },
 
3844
        //     "showDeleted": {
 
3845
        //       "description": "Whether to include deleted events (with status equals \"cancelled\") in the result. Cancelled instances of recurring events will still be included if singleEvents is False. Optional. The default is False.",
 
3846
        //       "location": "query",
 
3847
        //       "type": "boolean"
 
3848
        //     },
 
3849
        //     "timeMax": {
 
3850
        //       "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.",
 
3851
        //       "format": "date-time",
 
3852
        //       "location": "query",
 
3853
        //       "type": "string"
 
3854
        //     },
 
3855
        //     "timeMin": {
 
3856
        //       "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.",
 
3857
        //       "format": "date-time",
 
3858
        //       "location": "query",
 
3859
        //       "type": "string"
 
3860
        //     },
 
3861
        //     "timeZone": {
 
3862
        //       "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
 
3863
        //       "location": "query",
 
3864
        //       "type": "string"
 
3865
        //     }
 
3866
        //   },
 
3867
        //   "path": "calendars/{calendarId}/events/{eventId}/instances",
 
3868
        //   "response": {
 
3869
        //     "$ref": "Events"
 
3870
        //   },
 
3871
        //   "scopes": [
 
3872
        //     "https://www.googleapis.com/auth/calendar",
 
3873
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
3874
        //   ],
 
3875
        //   "supportsSubscription": true
 
3876
        // }
 
3877
 
 
3878
}
 
3879
 
 
3880
// method id "calendar.events.list":
 
3881
 
 
3882
type EventsListCall struct {
 
3883
        s          *Service
 
3884
        calendarId string
 
3885
        opt_       map[string]interface{}
 
3886
}
 
3887
 
 
3888
// List: Returns events on the specified calendar.
 
3889
func (r *EventsService) List(calendarId string) *EventsListCall {
 
3890
        c := &EventsListCall{s: r.s, opt_: make(map[string]interface{})}
 
3891
        c.calendarId = calendarId
 
3892
        return c
 
3893
}
 
3894
 
 
3895
// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
 
3896
// Whether to always include a value in the email field for the
 
3897
// organizer, creator and attendees, even if no real email is available
 
3898
// (i.e. a generated, non-working value will be provided). The use of
 
3899
// this option is discouraged and should only be used by clients which
 
3900
// cannot handle the absence of an email address value in the mentioned
 
3901
// places.  The default is False.
 
3902
func (c *EventsListCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsListCall {
 
3903
        c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail
 
3904
        return c
 
3905
}
 
3906
 
 
3907
// ICalUID sets the optional parameter "iCalUID": Specifies event ID in
 
3908
// the iCalendar format to be included in the response.
 
3909
func (c *EventsListCall) ICalUID(iCalUID string) *EventsListCall {
 
3910
        c.opt_["iCalUID"] = iCalUID
 
3911
        return c
 
3912
}
 
3913
 
 
3914
// MaxAttendees sets the optional parameter "maxAttendees": The maximum
 
3915
// number of attendees to include in the response. If there are more
 
3916
// than the specified number of attendees, only the participant is
 
3917
// returned.
 
3918
func (c *EventsListCall) MaxAttendees(maxAttendees int64) *EventsListCall {
 
3919
        c.opt_["maxAttendees"] = maxAttendees
 
3920
        return c
 
3921
}
 
3922
 
 
3923
// MaxResults sets the optional parameter "maxResults": Maximum number
 
3924
// of events returned on one result page. By default the value is 250
 
3925
// events. The page size can never be larger than 2500 events.
 
3926
func (c *EventsListCall) MaxResults(maxResults int64) *EventsListCall {
 
3927
        c.opt_["maxResults"] = maxResults
 
3928
        return c
 
3929
}
 
3930
 
 
3931
// OrderBy sets the optional parameter "orderBy": The order of the
 
3932
// events returned in the result.  The default is an unspecified, stable
 
3933
// order.
 
3934
func (c *EventsListCall) OrderBy(orderBy string) *EventsListCall {
 
3935
        c.opt_["orderBy"] = orderBy
 
3936
        return c
 
3937
}
 
3938
 
 
3939
// PageToken sets the optional parameter "pageToken": Token specifying
 
3940
// which result page to return.
 
3941
func (c *EventsListCall) PageToken(pageToken string) *EventsListCall {
 
3942
        c.opt_["pageToken"] = pageToken
 
3943
        return c
 
3944
}
 
3945
 
 
3946
// PrivateExtendedProperty sets the optional parameter
 
3947
// "privateExtendedProperty": Extended properties constraint specified
 
3948
// as propertyName=value. Matches only private properties. This
 
3949
// parameter might be repeated multiple times to return events that
 
3950
// match all given constraints.
 
3951
func (c *EventsListCall) PrivateExtendedProperty(privateExtendedProperty string) *EventsListCall {
 
3952
        c.opt_["privateExtendedProperty"] = privateExtendedProperty
 
3953
        return c
 
3954
}
 
3955
 
 
3956
// Q sets the optional parameter "q": Free text search terms to find
 
3957
// events that match these terms in any field, except for extended
 
3958
// properties.
 
3959
func (c *EventsListCall) Q(q string) *EventsListCall {
 
3960
        c.opt_["q"] = q
 
3961
        return c
 
3962
}
 
3963
 
 
3964
// SharedExtendedProperty sets the optional parameter
 
3965
// "sharedExtendedProperty": Extended properties constraint specified as
 
3966
// propertyName=value. Matches only shared properties. This parameter
 
3967
// might be repeated multiple times to return events that match all
 
3968
// given constraints.
 
3969
func (c *EventsListCall) SharedExtendedProperty(sharedExtendedProperty string) *EventsListCall {
 
3970
        c.opt_["sharedExtendedProperty"] = sharedExtendedProperty
 
3971
        return c
 
3972
}
 
3973
 
 
3974
// ShowDeleted sets the optional parameter "showDeleted": Whether to
 
3975
// include deleted events (with status equals "cancelled") in the
 
3976
// result. Cancelled instances of recurring events (but not the
 
3977
// underlying recurring event) will still be included if showDeleted and
 
3978
// singleEvents are both False. If showDeleted and singleEvents are both
 
3979
// True, only single instances of deleted events (but not the underlying
 
3980
// recurring events) are returned.  The default is False.
 
3981
func (c *EventsListCall) ShowDeleted(showDeleted bool) *EventsListCall {
 
3982
        c.opt_["showDeleted"] = showDeleted
 
3983
        return c
 
3984
}
 
3985
 
 
3986
// ShowHiddenInvitations sets the optional parameter
 
3987
// "showHiddenInvitations": Whether to include hidden invitations in the
 
3988
// result.  The default is False.
 
3989
func (c *EventsListCall) ShowHiddenInvitations(showHiddenInvitations bool) *EventsListCall {
 
3990
        c.opt_["showHiddenInvitations"] = showHiddenInvitations
 
3991
        return c
 
3992
}
 
3993
 
 
3994
// SingleEvents sets the optional parameter "singleEvents": Whether to
 
3995
// expand recurring events into instances and only return single one-off
 
3996
// events and instances of recurring events, but not the underlying
 
3997
// recurring events themselves.  The default is False.
 
3998
func (c *EventsListCall) SingleEvents(singleEvents bool) *EventsListCall {
 
3999
        c.opt_["singleEvents"] = singleEvents
 
4000
        return c
 
4001
}
 
4002
 
 
4003
// SyncToken sets the optional parameter "syncToken": Token obtained
 
4004
// from the nextSyncToken field returned on the last page of results
 
4005
// from the previous list request. It makes the result of this list
 
4006
// request contain only entries that have changed since then. All events
 
4007
// deleted since the previous list request will always be in the result
 
4008
// set and it is not allowed to set showDeleted to False.
 
4009
// There are
 
4010
// several query parameters that cannot be specified together with
 
4011
// nextSyncToken to ensure consistency of the client state.
 
4012
//
 
4013
// These are:
 
4014
//
 
4015
// - iCalUID
 
4016
// - orderBy
 
4017
// - privateExtendedProperty
 
4018
// - q
 
4019
// -
 
4020
// sharedExtendedProperty
 
4021
// - timeMin
 
4022
// - timeMax
 
4023
// - updatedMin If the
 
4024
// syncToken expires, the server will respond with a 410 GONE response
 
4025
// code and the client should clear its storage and perform a full
 
4026
// synchronization without any syncToken.
 
4027
// Learn more about incremental
 
4028
// synchronization.
 
4029
//  The default is to return all entries.
 
4030
func (c *EventsListCall) SyncToken(syncToken string) *EventsListCall {
 
4031
        c.opt_["syncToken"] = syncToken
 
4032
        return c
 
4033
}
 
4034
 
 
4035
// TimeMax sets the optional parameter "timeMax": Upper bound
 
4036
// (exclusive) for an event's start time to filter by.  The default is
 
4037
// not to filter by start time.
 
4038
func (c *EventsListCall) TimeMax(timeMax string) *EventsListCall {
 
4039
        c.opt_["timeMax"] = timeMax
 
4040
        return c
 
4041
}
 
4042
 
 
4043
// TimeMin sets the optional parameter "timeMin": Lower bound
 
4044
// (inclusive) for an event's end time to filter by.  The default is not
 
4045
// to filter by end time.
 
4046
func (c *EventsListCall) TimeMin(timeMin string) *EventsListCall {
 
4047
        c.opt_["timeMin"] = timeMin
 
4048
        return c
 
4049
}
 
4050
 
 
4051
// TimeZone sets the optional parameter "timeZone": Time zone used in
 
4052
// the response.  The default is the time zone of the calendar.
 
4053
func (c *EventsListCall) TimeZone(timeZone string) *EventsListCall {
 
4054
        c.opt_["timeZone"] = timeZone
 
4055
        return c
 
4056
}
 
4057
 
 
4058
// UpdatedMin sets the optional parameter "updatedMin": Lower bound for
 
4059
// an event's last modification time (as a RFC 3339 timestamp) to filter
 
4060
// by. When specified, entries deleted since this time will always be
 
4061
// included regardless of showDeleted.  The default is not to filter by
 
4062
// last modification time.
 
4063
func (c *EventsListCall) UpdatedMin(updatedMin string) *EventsListCall {
 
4064
        c.opt_["updatedMin"] = updatedMin
 
4065
        return c
 
4066
}
 
4067
 
 
4068
// Fields allows partial responses to be retrieved.
 
4069
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
4070
// for more information.
 
4071
func (c *EventsListCall) Fields(s ...googleapi.Field) *EventsListCall {
 
4072
        c.opt_["fields"] = googleapi.CombineFields(s)
 
4073
        return c
 
4074
}
 
4075
 
 
4076
func (c *EventsListCall) Do() (*Events, error) {
 
4077
        var body io.Reader = nil
 
4078
        params := make(url.Values)
 
4079
        params.Set("alt", "json")
 
4080
        if v, ok := c.opt_["alwaysIncludeEmail"]; ok {
 
4081
                params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v))
 
4082
        }
 
4083
        if v, ok := c.opt_["iCalUID"]; ok {
 
4084
                params.Set("iCalUID", fmt.Sprintf("%v", v))
 
4085
        }
 
4086
        if v, ok := c.opt_["maxAttendees"]; ok {
 
4087
                params.Set("maxAttendees", fmt.Sprintf("%v", v))
 
4088
        }
 
4089
        if v, ok := c.opt_["maxResults"]; ok {
 
4090
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
4091
        }
 
4092
        if v, ok := c.opt_["orderBy"]; ok {
 
4093
                params.Set("orderBy", fmt.Sprintf("%v", v))
 
4094
        }
 
4095
        if v, ok := c.opt_["pageToken"]; ok {
 
4096
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
4097
        }
 
4098
        if v, ok := c.opt_["privateExtendedProperty"]; ok {
 
4099
                params.Set("privateExtendedProperty", fmt.Sprintf("%v", v))
 
4100
        }
 
4101
        if v, ok := c.opt_["q"]; ok {
 
4102
                params.Set("q", fmt.Sprintf("%v", v))
 
4103
        }
 
4104
        if v, ok := c.opt_["sharedExtendedProperty"]; ok {
 
4105
                params.Set("sharedExtendedProperty", fmt.Sprintf("%v", v))
 
4106
        }
 
4107
        if v, ok := c.opt_["showDeleted"]; ok {
 
4108
                params.Set("showDeleted", fmt.Sprintf("%v", v))
 
4109
        }
 
4110
        if v, ok := c.opt_["showHiddenInvitations"]; ok {
 
4111
                params.Set("showHiddenInvitations", fmt.Sprintf("%v", v))
 
4112
        }
 
4113
        if v, ok := c.opt_["singleEvents"]; ok {
 
4114
                params.Set("singleEvents", fmt.Sprintf("%v", v))
 
4115
        }
 
4116
        if v, ok := c.opt_["syncToken"]; ok {
 
4117
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
4118
        }
 
4119
        if v, ok := c.opt_["timeMax"]; ok {
 
4120
                params.Set("timeMax", fmt.Sprintf("%v", v))
 
4121
        }
 
4122
        if v, ok := c.opt_["timeMin"]; ok {
 
4123
                params.Set("timeMin", fmt.Sprintf("%v", v))
 
4124
        }
 
4125
        if v, ok := c.opt_["timeZone"]; ok {
 
4126
                params.Set("timeZone", fmt.Sprintf("%v", v))
 
4127
        }
 
4128
        if v, ok := c.opt_["updatedMin"]; ok {
 
4129
                params.Set("updatedMin", fmt.Sprintf("%v", v))
 
4130
        }
 
4131
        if v, ok := c.opt_["fields"]; ok {
 
4132
                params.Set("fields", fmt.Sprintf("%v", v))
 
4133
        }
 
4134
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events")
 
4135
        urls += "?" + params.Encode()
 
4136
        req, _ := http.NewRequest("GET", urls, body)
 
4137
        googleapi.Expand(req.URL, map[string]string{
 
4138
                "calendarId": c.calendarId,
 
4139
        })
 
4140
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
4141
        res, err := c.s.client.Do(req)
 
4142
        if err != nil {
 
4143
                return nil, err
 
4144
        }
 
4145
        defer googleapi.CloseBody(res)
 
4146
        if err := googleapi.CheckResponse(res); err != nil {
 
4147
                return nil, err
 
4148
        }
 
4149
        var ret *Events
 
4150
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
4151
                return nil, err
 
4152
        }
 
4153
        return ret, nil
 
4154
        // {
 
4155
        //   "description": "Returns events on the specified calendar.",
 
4156
        //   "httpMethod": "GET",
 
4157
        //   "id": "calendar.events.list",
 
4158
        //   "parameterOrder": [
 
4159
        //     "calendarId"
 
4160
        //   ],
 
4161
        //   "parameters": {
 
4162
        //     "alwaysIncludeEmail": {
 
4163
        //       "description": "Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.",
 
4164
        //       "location": "query",
 
4165
        //       "type": "boolean"
 
4166
        //     },
 
4167
        //     "calendarId": {
 
4168
        //       "description": "Calendar identifier.",
 
4169
        //       "location": "path",
 
4170
        //       "required": true,
 
4171
        //       "type": "string"
 
4172
        //     },
 
4173
        //     "iCalUID": {
 
4174
        //       "description": "Specifies event ID in the iCalendar format to be included in the response. Optional.",
 
4175
        //       "location": "query",
 
4176
        //       "type": "string"
 
4177
        //     },
 
4178
        //     "maxAttendees": {
 
4179
        //       "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.",
 
4180
        //       "format": "int32",
 
4181
        //       "location": "query",
 
4182
        //       "minimum": "1",
 
4183
        //       "type": "integer"
 
4184
        //     },
 
4185
        //     "maxResults": {
 
4186
        //       "description": "Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.",
 
4187
        //       "format": "int32",
 
4188
        //       "location": "query",
 
4189
        //       "minimum": "1",
 
4190
        //       "type": "integer"
 
4191
        //     },
 
4192
        //     "orderBy": {
 
4193
        //       "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.",
 
4194
        //       "enum": [
 
4195
        //         "startTime",
 
4196
        //         "updated"
 
4197
        //       ],
 
4198
        //       "enumDescriptions": [
 
4199
        //         "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)",
 
4200
        //         "Order by last modification time (ascending)."
 
4201
        //       ],
 
4202
        //       "location": "query",
 
4203
        //       "type": "string"
 
4204
        //     },
 
4205
        //     "pageToken": {
 
4206
        //       "description": "Token specifying which result page to return. Optional.",
 
4207
        //       "location": "query",
 
4208
        //       "type": "string"
 
4209
        //     },
 
4210
        //     "privateExtendedProperty": {
 
4211
        //       "description": "Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints.",
 
4212
        //       "location": "query",
 
4213
        //       "repeated": true,
 
4214
        //       "type": "string"
 
4215
        //     },
 
4216
        //     "q": {
 
4217
        //       "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.",
 
4218
        //       "location": "query",
 
4219
        //       "type": "string"
 
4220
        //     },
 
4221
        //     "sharedExtendedProperty": {
 
4222
        //       "description": "Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints.",
 
4223
        //       "location": "query",
 
4224
        //       "repeated": true,
 
4225
        //       "type": "string"
 
4226
        //     },
 
4227
        //     "showDeleted": {
 
4228
        //       "description": "Whether to include deleted events (with status equals \"cancelled\") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False.",
 
4229
        //       "location": "query",
 
4230
        //       "type": "boolean"
 
4231
        //     },
 
4232
        //     "showHiddenInvitations": {
 
4233
        //       "description": "Whether to include hidden invitations in the result. Optional. The default is False.",
 
4234
        //       "location": "query",
 
4235
        //       "type": "boolean"
 
4236
        //     },
 
4237
        //     "singleEvents": {
 
4238
        //       "description": "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.",
 
4239
        //       "location": "query",
 
4240
        //       "type": "boolean"
 
4241
        //     },
 
4242
        //     "syncToken": {
 
4243
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nThere are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.\n\nThese are: \n- iCalUID \n- orderBy \n- privateExtendedProperty \n- q \n- sharedExtendedProperty \n- timeMin \n- timeMax \n- updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
4244
        //       "location": "query",
 
4245
        //       "type": "string"
 
4246
        //     },
 
4247
        //     "timeMax": {
 
4248
        //       "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.",
 
4249
        //       "format": "date-time",
 
4250
        //       "location": "query",
 
4251
        //       "type": "string"
 
4252
        //     },
 
4253
        //     "timeMin": {
 
4254
        //       "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.",
 
4255
        //       "format": "date-time",
 
4256
        //       "location": "query",
 
4257
        //       "type": "string"
 
4258
        //     },
 
4259
        //     "timeZone": {
 
4260
        //       "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
 
4261
        //       "location": "query",
 
4262
        //       "type": "string"
 
4263
        //     },
 
4264
        //     "updatedMin": {
 
4265
        //       "description": "Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time.",
 
4266
        //       "format": "date-time",
 
4267
        //       "location": "query",
 
4268
        //       "type": "string"
 
4269
        //     }
 
4270
        //   },
 
4271
        //   "path": "calendars/{calendarId}/events",
 
4272
        //   "response": {
 
4273
        //     "$ref": "Events"
 
4274
        //   },
 
4275
        //   "scopes": [
 
4276
        //     "https://www.googleapis.com/auth/calendar",
 
4277
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
4278
        //   ],
 
4279
        //   "supportsSubscription": true
 
4280
        // }
 
4281
 
 
4282
}
 
4283
 
 
4284
// method id "calendar.events.move":
 
4285
 
 
4286
type EventsMoveCall struct {
 
4287
        s             *Service
 
4288
        calendarId    string
 
4289
        eventId       string
 
4290
        destinationid string
 
4291
        opt_          map[string]interface{}
 
4292
}
 
4293
 
 
4294
// Move: Moves an event to another calendar, i.e. changes an event's
 
4295
// organizer.
 
4296
func (r *EventsService) Move(calendarId string, eventId string, destinationid string) *EventsMoveCall {
 
4297
        c := &EventsMoveCall{s: r.s, opt_: make(map[string]interface{})}
 
4298
        c.calendarId = calendarId
 
4299
        c.eventId = eventId
 
4300
        c.destinationid = destinationid
 
4301
        return c
 
4302
}
 
4303
 
 
4304
// SendNotifications sets the optional parameter "sendNotifications":
 
4305
// Whether to send notifications about the change of the event's
 
4306
// organizer.  The default is False.
 
4307
func (c *EventsMoveCall) SendNotifications(sendNotifications bool) *EventsMoveCall {
 
4308
        c.opt_["sendNotifications"] = sendNotifications
 
4309
        return c
 
4310
}
 
4311
 
 
4312
// Fields allows partial responses to be retrieved.
 
4313
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
4314
// for more information.
 
4315
func (c *EventsMoveCall) Fields(s ...googleapi.Field) *EventsMoveCall {
 
4316
        c.opt_["fields"] = googleapi.CombineFields(s)
 
4317
        return c
 
4318
}
 
4319
 
 
4320
func (c *EventsMoveCall) Do() (*Event, error) {
 
4321
        var body io.Reader = nil
 
4322
        params := make(url.Values)
 
4323
        params.Set("alt", "json")
 
4324
        params.Set("destination", fmt.Sprintf("%v", c.destinationid))
 
4325
        if v, ok := c.opt_["sendNotifications"]; ok {
 
4326
                params.Set("sendNotifications", fmt.Sprintf("%v", v))
 
4327
        }
 
4328
        if v, ok := c.opt_["fields"]; ok {
 
4329
                params.Set("fields", fmt.Sprintf("%v", v))
 
4330
        }
 
4331
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/move")
 
4332
        urls += "?" + params.Encode()
 
4333
        req, _ := http.NewRequest("POST", urls, body)
 
4334
        googleapi.Expand(req.URL, map[string]string{
 
4335
                "calendarId": c.calendarId,
 
4336
                "eventId":    c.eventId,
 
4337
        })
 
4338
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
4339
        res, err := c.s.client.Do(req)
 
4340
        if err != nil {
 
4341
                return nil, err
 
4342
        }
 
4343
        defer googleapi.CloseBody(res)
 
4344
        if err := googleapi.CheckResponse(res); err != nil {
 
4345
                return nil, err
 
4346
        }
 
4347
        var ret *Event
 
4348
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
4349
                return nil, err
 
4350
        }
 
4351
        return ret, nil
 
4352
        // {
 
4353
        //   "description": "Moves an event to another calendar, i.e. changes an event's organizer.",
 
4354
        //   "httpMethod": "POST",
 
4355
        //   "id": "calendar.events.move",
 
4356
        //   "parameterOrder": [
 
4357
        //     "calendarId",
 
4358
        //     "eventId",
 
4359
        //     "destination"
 
4360
        //   ],
 
4361
        //   "parameters": {
 
4362
        //     "calendarId": {
 
4363
        //       "description": "Calendar identifier of the source calendar where the event currently is on.",
 
4364
        //       "location": "path",
 
4365
        //       "required": true,
 
4366
        //       "type": "string"
 
4367
        //     },
 
4368
        //     "destination": {
 
4369
        //       "description": "Calendar identifier of the target calendar where the event is to be moved to.",
 
4370
        //       "location": "query",
 
4371
        //       "required": true,
 
4372
        //       "type": "string"
 
4373
        //     },
 
4374
        //     "eventId": {
 
4375
        //       "description": "Event identifier.",
 
4376
        //       "location": "path",
 
4377
        //       "required": true,
 
4378
        //       "type": "string"
 
4379
        //     },
 
4380
        //     "sendNotifications": {
 
4381
        //       "description": "Whether to send notifications about the change of the event's organizer. Optional. The default is False.",
 
4382
        //       "location": "query",
 
4383
        //       "type": "boolean"
 
4384
        //     }
 
4385
        //   },
 
4386
        //   "path": "calendars/{calendarId}/events/{eventId}/move",
 
4387
        //   "response": {
 
4388
        //     "$ref": "Event"
 
4389
        //   },
 
4390
        //   "scopes": [
 
4391
        //     "https://www.googleapis.com/auth/calendar"
 
4392
        //   ]
 
4393
        // }
 
4394
 
 
4395
}
 
4396
 
 
4397
// method id "calendar.events.patch":
 
4398
 
 
4399
type EventsPatchCall struct {
 
4400
        s          *Service
 
4401
        calendarId string
 
4402
        eventId    string
 
4403
        event      *Event
 
4404
        opt_       map[string]interface{}
 
4405
}
 
4406
 
 
4407
// Patch: Updates an event. This method supports patch semantics.
 
4408
func (r *EventsService) Patch(calendarId string, eventId string, event *Event) *EventsPatchCall {
 
4409
        c := &EventsPatchCall{s: r.s, opt_: make(map[string]interface{})}
 
4410
        c.calendarId = calendarId
 
4411
        c.eventId = eventId
 
4412
        c.event = event
 
4413
        return c
 
4414
}
 
4415
 
 
4416
// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
 
4417
// Whether to always include a value in the email field for the
 
4418
// organizer, creator and attendees, even if no real email is available
 
4419
// (i.e. a generated, non-working value will be provided). The use of
 
4420
// this option is discouraged and should only be used by clients which
 
4421
// cannot handle the absence of an email address value in the mentioned
 
4422
// places.  The default is False.
 
4423
func (c *EventsPatchCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsPatchCall {
 
4424
        c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail
 
4425
        return c
 
4426
}
 
4427
 
 
4428
// MaxAttendees sets the optional parameter "maxAttendees": The maximum
 
4429
// number of attendees to include in the response. If there are more
 
4430
// than the specified number of attendees, only the participant is
 
4431
// returned.
 
4432
func (c *EventsPatchCall) MaxAttendees(maxAttendees int64) *EventsPatchCall {
 
4433
        c.opt_["maxAttendees"] = maxAttendees
 
4434
        return c
 
4435
}
 
4436
 
 
4437
// SendNotifications sets the optional parameter "sendNotifications":
 
4438
// Whether to send notifications about the event update (e.g. attendee's
 
4439
// responses, title changes, etc.).  The default is False.
 
4440
func (c *EventsPatchCall) SendNotifications(sendNotifications bool) *EventsPatchCall {
 
4441
        c.opt_["sendNotifications"] = sendNotifications
 
4442
        return c
 
4443
}
 
4444
 
 
4445
// Fields allows partial responses to be retrieved.
 
4446
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
4447
// for more information.
 
4448
func (c *EventsPatchCall) Fields(s ...googleapi.Field) *EventsPatchCall {
 
4449
        c.opt_["fields"] = googleapi.CombineFields(s)
 
4450
        return c
 
4451
}
 
4452
 
 
4453
func (c *EventsPatchCall) Do() (*Event, error) {
 
4454
        var body io.Reader = nil
 
4455
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
 
4456
        if err != nil {
 
4457
                return nil, err
 
4458
        }
 
4459
        ctype := "application/json"
 
4460
        params := make(url.Values)
 
4461
        params.Set("alt", "json")
 
4462
        if v, ok := c.opt_["alwaysIncludeEmail"]; ok {
 
4463
                params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v))
 
4464
        }
 
4465
        if v, ok := c.opt_["maxAttendees"]; ok {
 
4466
                params.Set("maxAttendees", fmt.Sprintf("%v", v))
 
4467
        }
 
4468
        if v, ok := c.opt_["sendNotifications"]; ok {
 
4469
                params.Set("sendNotifications", fmt.Sprintf("%v", v))
 
4470
        }
 
4471
        if v, ok := c.opt_["fields"]; ok {
 
4472
                params.Set("fields", fmt.Sprintf("%v", v))
 
4473
        }
 
4474
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
 
4475
        urls += "?" + params.Encode()
 
4476
        req, _ := http.NewRequest("PATCH", urls, body)
 
4477
        googleapi.Expand(req.URL, map[string]string{
 
4478
                "calendarId": c.calendarId,
 
4479
                "eventId":    c.eventId,
 
4480
        })
 
4481
        req.Header.Set("Content-Type", ctype)
 
4482
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
4483
        res, err := c.s.client.Do(req)
 
4484
        if err != nil {
 
4485
                return nil, err
 
4486
        }
 
4487
        defer googleapi.CloseBody(res)
 
4488
        if err := googleapi.CheckResponse(res); err != nil {
 
4489
                return nil, err
 
4490
        }
 
4491
        var ret *Event
 
4492
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
4493
                return nil, err
 
4494
        }
 
4495
        return ret, nil
 
4496
        // {
 
4497
        //   "description": "Updates an event. This method supports patch semantics.",
 
4498
        //   "httpMethod": "PATCH",
 
4499
        //   "id": "calendar.events.patch",
 
4500
        //   "parameterOrder": [
 
4501
        //     "calendarId",
 
4502
        //     "eventId"
 
4503
        //   ],
 
4504
        //   "parameters": {
 
4505
        //     "alwaysIncludeEmail": {
 
4506
        //       "description": "Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.",
 
4507
        //       "location": "query",
 
4508
        //       "type": "boolean"
 
4509
        //     },
 
4510
        //     "calendarId": {
 
4511
        //       "description": "Calendar identifier.",
 
4512
        //       "location": "path",
 
4513
        //       "required": true,
 
4514
        //       "type": "string"
 
4515
        //     },
 
4516
        //     "eventId": {
 
4517
        //       "description": "Event identifier.",
 
4518
        //       "location": "path",
 
4519
        //       "required": true,
 
4520
        //       "type": "string"
 
4521
        //     },
 
4522
        //     "maxAttendees": {
 
4523
        //       "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.",
 
4524
        //       "format": "int32",
 
4525
        //       "location": "query",
 
4526
        //       "minimum": "1",
 
4527
        //       "type": "integer"
 
4528
        //     },
 
4529
        //     "sendNotifications": {
 
4530
        //       "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.",
 
4531
        //       "location": "query",
 
4532
        //       "type": "boolean"
 
4533
        //     }
 
4534
        //   },
 
4535
        //   "path": "calendars/{calendarId}/events/{eventId}",
 
4536
        //   "request": {
 
4537
        //     "$ref": "Event"
 
4538
        //   },
 
4539
        //   "response": {
 
4540
        //     "$ref": "Event"
 
4541
        //   },
 
4542
        //   "scopes": [
 
4543
        //     "https://www.googleapis.com/auth/calendar"
 
4544
        //   ]
 
4545
        // }
 
4546
 
 
4547
}
 
4548
 
 
4549
// method id "calendar.events.quickAdd":
 
4550
 
 
4551
type EventsQuickAddCall struct {
 
4552
        s          *Service
 
4553
        calendarId string
 
4554
        text       string
 
4555
        opt_       map[string]interface{}
 
4556
}
 
4557
 
 
4558
// QuickAdd: Creates an event based on a simple text string.
 
4559
func (r *EventsService) QuickAdd(calendarId string, text string) *EventsQuickAddCall {
 
4560
        c := &EventsQuickAddCall{s: r.s, opt_: make(map[string]interface{})}
 
4561
        c.calendarId = calendarId
 
4562
        c.text = text
 
4563
        return c
 
4564
}
 
4565
 
 
4566
// SendNotifications sets the optional parameter "sendNotifications":
 
4567
// Whether to send notifications about the creation of the event.  The
 
4568
// default is False.
 
4569
func (c *EventsQuickAddCall) SendNotifications(sendNotifications bool) *EventsQuickAddCall {
 
4570
        c.opt_["sendNotifications"] = sendNotifications
 
4571
        return c
 
4572
}
 
4573
 
 
4574
// Fields allows partial responses to be retrieved.
 
4575
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
4576
// for more information.
 
4577
func (c *EventsQuickAddCall) Fields(s ...googleapi.Field) *EventsQuickAddCall {
 
4578
        c.opt_["fields"] = googleapi.CombineFields(s)
 
4579
        return c
 
4580
}
 
4581
 
 
4582
func (c *EventsQuickAddCall) Do() (*Event, error) {
 
4583
        var body io.Reader = nil
 
4584
        params := make(url.Values)
 
4585
        params.Set("alt", "json")
 
4586
        params.Set("text", fmt.Sprintf("%v", c.text))
 
4587
        if v, ok := c.opt_["sendNotifications"]; ok {
 
4588
                params.Set("sendNotifications", fmt.Sprintf("%v", v))
 
4589
        }
 
4590
        if v, ok := c.opt_["fields"]; ok {
 
4591
                params.Set("fields", fmt.Sprintf("%v", v))
 
4592
        }
 
4593
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/quickAdd")
 
4594
        urls += "?" + params.Encode()
 
4595
        req, _ := http.NewRequest("POST", urls, body)
 
4596
        googleapi.Expand(req.URL, map[string]string{
 
4597
                "calendarId": c.calendarId,
 
4598
        })
 
4599
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
4600
        res, err := c.s.client.Do(req)
 
4601
        if err != nil {
 
4602
                return nil, err
 
4603
        }
 
4604
        defer googleapi.CloseBody(res)
 
4605
        if err := googleapi.CheckResponse(res); err != nil {
 
4606
                return nil, err
 
4607
        }
 
4608
        var ret *Event
 
4609
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
4610
                return nil, err
 
4611
        }
 
4612
        return ret, nil
 
4613
        // {
 
4614
        //   "description": "Creates an event based on a simple text string.",
 
4615
        //   "httpMethod": "POST",
 
4616
        //   "id": "calendar.events.quickAdd",
 
4617
        //   "parameterOrder": [
 
4618
        //     "calendarId",
 
4619
        //     "text"
 
4620
        //   ],
 
4621
        //   "parameters": {
 
4622
        //     "calendarId": {
 
4623
        //       "description": "Calendar identifier.",
 
4624
        //       "location": "path",
 
4625
        //       "required": true,
 
4626
        //       "type": "string"
 
4627
        //     },
 
4628
        //     "sendNotifications": {
 
4629
        //       "description": "Whether to send notifications about the creation of the event. Optional. The default is False.",
 
4630
        //       "location": "query",
 
4631
        //       "type": "boolean"
 
4632
        //     },
 
4633
        //     "text": {
 
4634
        //       "description": "The text describing the event to be created.",
 
4635
        //       "location": "query",
 
4636
        //       "required": true,
 
4637
        //       "type": "string"
 
4638
        //     }
 
4639
        //   },
 
4640
        //   "path": "calendars/{calendarId}/events/quickAdd",
 
4641
        //   "response": {
 
4642
        //     "$ref": "Event"
 
4643
        //   },
 
4644
        //   "scopes": [
 
4645
        //     "https://www.googleapis.com/auth/calendar"
 
4646
        //   ]
 
4647
        // }
 
4648
 
 
4649
}
 
4650
 
 
4651
// method id "calendar.events.update":
 
4652
 
 
4653
type EventsUpdateCall struct {
 
4654
        s          *Service
 
4655
        calendarId string
 
4656
        eventId    string
 
4657
        event      *Event
 
4658
        opt_       map[string]interface{}
 
4659
}
 
4660
 
 
4661
// Update: Updates an event.
 
4662
func (r *EventsService) Update(calendarId string, eventId string, event *Event) *EventsUpdateCall {
 
4663
        c := &EventsUpdateCall{s: r.s, opt_: make(map[string]interface{})}
 
4664
        c.calendarId = calendarId
 
4665
        c.eventId = eventId
 
4666
        c.event = event
 
4667
        return c
 
4668
}
 
4669
 
 
4670
// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
 
4671
// Whether to always include a value in the email field for the
 
4672
// organizer, creator and attendees, even if no real email is available
 
4673
// (i.e. a generated, non-working value will be provided). The use of
 
4674
// this option is discouraged and should only be used by clients which
 
4675
// cannot handle the absence of an email address value in the mentioned
 
4676
// places.  The default is False.
 
4677
func (c *EventsUpdateCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsUpdateCall {
 
4678
        c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail
 
4679
        return c
 
4680
}
 
4681
 
 
4682
// MaxAttendees sets the optional parameter "maxAttendees": The maximum
 
4683
// number of attendees to include in the response. If there are more
 
4684
// than the specified number of attendees, only the participant is
 
4685
// returned.
 
4686
func (c *EventsUpdateCall) MaxAttendees(maxAttendees int64) *EventsUpdateCall {
 
4687
        c.opt_["maxAttendees"] = maxAttendees
 
4688
        return c
 
4689
}
 
4690
 
 
4691
// SendNotifications sets the optional parameter "sendNotifications":
 
4692
// Whether to send notifications about the event update (e.g. attendee's
 
4693
// responses, title changes, etc.).  The default is False.
 
4694
func (c *EventsUpdateCall) SendNotifications(sendNotifications bool) *EventsUpdateCall {
 
4695
        c.opt_["sendNotifications"] = sendNotifications
 
4696
        return c
 
4697
}
 
4698
 
 
4699
// Fields allows partial responses to be retrieved.
 
4700
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
4701
// for more information.
 
4702
func (c *EventsUpdateCall) Fields(s ...googleapi.Field) *EventsUpdateCall {
 
4703
        c.opt_["fields"] = googleapi.CombineFields(s)
 
4704
        return c
 
4705
}
 
4706
 
 
4707
func (c *EventsUpdateCall) Do() (*Event, error) {
 
4708
        var body io.Reader = nil
 
4709
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
 
4710
        if err != nil {
 
4711
                return nil, err
 
4712
        }
 
4713
        ctype := "application/json"
 
4714
        params := make(url.Values)
 
4715
        params.Set("alt", "json")
 
4716
        if v, ok := c.opt_["alwaysIncludeEmail"]; ok {
 
4717
                params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v))
 
4718
        }
 
4719
        if v, ok := c.opt_["maxAttendees"]; ok {
 
4720
                params.Set("maxAttendees", fmt.Sprintf("%v", v))
 
4721
        }
 
4722
        if v, ok := c.opt_["sendNotifications"]; ok {
 
4723
                params.Set("sendNotifications", fmt.Sprintf("%v", v))
 
4724
        }
 
4725
        if v, ok := c.opt_["fields"]; ok {
 
4726
                params.Set("fields", fmt.Sprintf("%v", v))
 
4727
        }
 
4728
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
 
4729
        urls += "?" + params.Encode()
 
4730
        req, _ := http.NewRequest("PUT", urls, body)
 
4731
        googleapi.Expand(req.URL, map[string]string{
 
4732
                "calendarId": c.calendarId,
 
4733
                "eventId":    c.eventId,
 
4734
        })
 
4735
        req.Header.Set("Content-Type", ctype)
 
4736
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
4737
        res, err := c.s.client.Do(req)
 
4738
        if err != nil {
 
4739
                return nil, err
 
4740
        }
 
4741
        defer googleapi.CloseBody(res)
 
4742
        if err := googleapi.CheckResponse(res); err != nil {
 
4743
                return nil, err
 
4744
        }
 
4745
        var ret *Event
 
4746
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
4747
                return nil, err
 
4748
        }
 
4749
        return ret, nil
 
4750
        // {
 
4751
        //   "description": "Updates an event.",
 
4752
        //   "httpMethod": "PUT",
 
4753
        //   "id": "calendar.events.update",
 
4754
        //   "parameterOrder": [
 
4755
        //     "calendarId",
 
4756
        //     "eventId"
 
4757
        //   ],
 
4758
        //   "parameters": {
 
4759
        //     "alwaysIncludeEmail": {
 
4760
        //       "description": "Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.",
 
4761
        //       "location": "query",
 
4762
        //       "type": "boolean"
 
4763
        //     },
 
4764
        //     "calendarId": {
 
4765
        //       "description": "Calendar identifier.",
 
4766
        //       "location": "path",
 
4767
        //       "required": true,
 
4768
        //       "type": "string"
 
4769
        //     },
 
4770
        //     "eventId": {
 
4771
        //       "description": "Event identifier.",
 
4772
        //       "location": "path",
 
4773
        //       "required": true,
 
4774
        //       "type": "string"
 
4775
        //     },
 
4776
        //     "maxAttendees": {
 
4777
        //       "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.",
 
4778
        //       "format": "int32",
 
4779
        //       "location": "query",
 
4780
        //       "minimum": "1",
 
4781
        //       "type": "integer"
 
4782
        //     },
 
4783
        //     "sendNotifications": {
 
4784
        //       "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.",
 
4785
        //       "location": "query",
 
4786
        //       "type": "boolean"
 
4787
        //     }
 
4788
        //   },
 
4789
        //   "path": "calendars/{calendarId}/events/{eventId}",
 
4790
        //   "request": {
 
4791
        //     "$ref": "Event"
 
4792
        //   },
 
4793
        //   "response": {
 
4794
        //     "$ref": "Event"
 
4795
        //   },
 
4796
        //   "scopes": [
 
4797
        //     "https://www.googleapis.com/auth/calendar"
 
4798
        //   ]
 
4799
        // }
 
4800
 
 
4801
}
 
4802
 
 
4803
// method id "calendar.events.watch":
 
4804
 
 
4805
type EventsWatchCall struct {
 
4806
        s          *Service
 
4807
        calendarId string
 
4808
        channel    *Channel
 
4809
        opt_       map[string]interface{}
 
4810
}
 
4811
 
 
4812
// Watch: Watch for changes to Events resources.
 
4813
func (r *EventsService) Watch(calendarId string, channel *Channel) *EventsWatchCall {
 
4814
        c := &EventsWatchCall{s: r.s, opt_: make(map[string]interface{})}
 
4815
        c.calendarId = calendarId
 
4816
        c.channel = channel
 
4817
        return c
 
4818
}
 
4819
 
 
4820
// AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
 
4821
// Whether to always include a value in the email field for the
 
4822
// organizer, creator and attendees, even if no real email is available
 
4823
// (i.e. a generated, non-working value will be provided). The use of
 
4824
// this option is discouraged and should only be used by clients which
 
4825
// cannot handle the absence of an email address value in the mentioned
 
4826
// places.  The default is False.
 
4827
func (c *EventsWatchCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsWatchCall {
 
4828
        c.opt_["alwaysIncludeEmail"] = alwaysIncludeEmail
 
4829
        return c
 
4830
}
 
4831
 
 
4832
// ICalUID sets the optional parameter "iCalUID": Specifies event ID in
 
4833
// the iCalendar format to be included in the response.
 
4834
func (c *EventsWatchCall) ICalUID(iCalUID string) *EventsWatchCall {
 
4835
        c.opt_["iCalUID"] = iCalUID
 
4836
        return c
 
4837
}
 
4838
 
 
4839
// MaxAttendees sets the optional parameter "maxAttendees": The maximum
 
4840
// number of attendees to include in the response. If there are more
 
4841
// than the specified number of attendees, only the participant is
 
4842
// returned.
 
4843
func (c *EventsWatchCall) MaxAttendees(maxAttendees int64) *EventsWatchCall {
 
4844
        c.opt_["maxAttendees"] = maxAttendees
 
4845
        return c
 
4846
}
 
4847
 
 
4848
// MaxResults sets the optional parameter "maxResults": Maximum number
 
4849
// of events returned on one result page. By default the value is 250
 
4850
// events. The page size can never be larger than 2500 events.
 
4851
func (c *EventsWatchCall) MaxResults(maxResults int64) *EventsWatchCall {
 
4852
        c.opt_["maxResults"] = maxResults
 
4853
        return c
 
4854
}
 
4855
 
 
4856
// OrderBy sets the optional parameter "orderBy": The order of the
 
4857
// events returned in the result.  The default is an unspecified, stable
 
4858
// order.
 
4859
func (c *EventsWatchCall) OrderBy(orderBy string) *EventsWatchCall {
 
4860
        c.opt_["orderBy"] = orderBy
 
4861
        return c
 
4862
}
 
4863
 
 
4864
// PageToken sets the optional parameter "pageToken": Token specifying
 
4865
// which result page to return.
 
4866
func (c *EventsWatchCall) PageToken(pageToken string) *EventsWatchCall {
 
4867
        c.opt_["pageToken"] = pageToken
 
4868
        return c
 
4869
}
 
4870
 
 
4871
// PrivateExtendedProperty sets the optional parameter
 
4872
// "privateExtendedProperty": Extended properties constraint specified
 
4873
// as propertyName=value. Matches only private properties. This
 
4874
// parameter might be repeated multiple times to return events that
 
4875
// match all given constraints.
 
4876
func (c *EventsWatchCall) PrivateExtendedProperty(privateExtendedProperty string) *EventsWatchCall {
 
4877
        c.opt_["privateExtendedProperty"] = privateExtendedProperty
 
4878
        return c
 
4879
}
 
4880
 
 
4881
// Q sets the optional parameter "q": Free text search terms to find
 
4882
// events that match these terms in any field, except for extended
 
4883
// properties.
 
4884
func (c *EventsWatchCall) Q(q string) *EventsWatchCall {
 
4885
        c.opt_["q"] = q
 
4886
        return c
 
4887
}
 
4888
 
 
4889
// SharedExtendedProperty sets the optional parameter
 
4890
// "sharedExtendedProperty": Extended properties constraint specified as
 
4891
// propertyName=value. Matches only shared properties. This parameter
 
4892
// might be repeated multiple times to return events that match all
 
4893
// given constraints.
 
4894
func (c *EventsWatchCall) SharedExtendedProperty(sharedExtendedProperty string) *EventsWatchCall {
 
4895
        c.opt_["sharedExtendedProperty"] = sharedExtendedProperty
 
4896
        return c
 
4897
}
 
4898
 
 
4899
// ShowDeleted sets the optional parameter "showDeleted": Whether to
 
4900
// include deleted events (with status equals "cancelled") in the
 
4901
// result. Cancelled instances of recurring events (but not the
 
4902
// underlying recurring event) will still be included if showDeleted and
 
4903
// singleEvents are both False. If showDeleted and singleEvents are both
 
4904
// True, only single instances of deleted events (but not the underlying
 
4905
// recurring events) are returned.  The default is False.
 
4906
func (c *EventsWatchCall) ShowDeleted(showDeleted bool) *EventsWatchCall {
 
4907
        c.opt_["showDeleted"] = showDeleted
 
4908
        return c
 
4909
}
 
4910
 
 
4911
// ShowHiddenInvitations sets the optional parameter
 
4912
// "showHiddenInvitations": Whether to include hidden invitations in the
 
4913
// result.  The default is False.
 
4914
func (c *EventsWatchCall) ShowHiddenInvitations(showHiddenInvitations bool) *EventsWatchCall {
 
4915
        c.opt_["showHiddenInvitations"] = showHiddenInvitations
 
4916
        return c
 
4917
}
 
4918
 
 
4919
// SingleEvents sets the optional parameter "singleEvents": Whether to
 
4920
// expand recurring events into instances and only return single one-off
 
4921
// events and instances of recurring events, but not the underlying
 
4922
// recurring events themselves.  The default is False.
 
4923
func (c *EventsWatchCall) SingleEvents(singleEvents bool) *EventsWatchCall {
 
4924
        c.opt_["singleEvents"] = singleEvents
 
4925
        return c
 
4926
}
 
4927
 
 
4928
// SyncToken sets the optional parameter "syncToken": Token obtained
 
4929
// from the nextSyncToken field returned on the last page of results
 
4930
// from the previous list request. It makes the result of this list
 
4931
// request contain only entries that have changed since then. All events
 
4932
// deleted since the previous list request will always be in the result
 
4933
// set and it is not allowed to set showDeleted to False.
 
4934
// There are
 
4935
// several query parameters that cannot be specified together with
 
4936
// nextSyncToken to ensure consistency of the client state.
 
4937
//
 
4938
// These are:
 
4939
//
 
4940
// - iCalUID
 
4941
// - orderBy
 
4942
// - privateExtendedProperty
 
4943
// - q
 
4944
// -
 
4945
// sharedExtendedProperty
 
4946
// - timeMin
 
4947
// - timeMax
 
4948
// - updatedMin If the
 
4949
// syncToken expires, the server will respond with a 410 GONE response
 
4950
// code and the client should clear its storage and perform a full
 
4951
// synchronization without any syncToken.
 
4952
// Learn more about incremental
 
4953
// synchronization.
 
4954
//  The default is to return all entries.
 
4955
func (c *EventsWatchCall) SyncToken(syncToken string) *EventsWatchCall {
 
4956
        c.opt_["syncToken"] = syncToken
 
4957
        return c
 
4958
}
 
4959
 
 
4960
// TimeMax sets the optional parameter "timeMax": Upper bound
 
4961
// (exclusive) for an event's start time to filter by.  The default is
 
4962
// not to filter by start time.
 
4963
func (c *EventsWatchCall) TimeMax(timeMax string) *EventsWatchCall {
 
4964
        c.opt_["timeMax"] = timeMax
 
4965
        return c
 
4966
}
 
4967
 
 
4968
// TimeMin sets the optional parameter "timeMin": Lower bound
 
4969
// (inclusive) for an event's end time to filter by.  The default is not
 
4970
// to filter by end time.
 
4971
func (c *EventsWatchCall) TimeMin(timeMin string) *EventsWatchCall {
 
4972
        c.opt_["timeMin"] = timeMin
 
4973
        return c
 
4974
}
 
4975
 
 
4976
// TimeZone sets the optional parameter "timeZone": Time zone used in
 
4977
// the response.  The default is the time zone of the calendar.
 
4978
func (c *EventsWatchCall) TimeZone(timeZone string) *EventsWatchCall {
 
4979
        c.opt_["timeZone"] = timeZone
 
4980
        return c
 
4981
}
 
4982
 
 
4983
// UpdatedMin sets the optional parameter "updatedMin": Lower bound for
 
4984
// an event's last modification time (as a RFC 3339 timestamp) to filter
 
4985
// by. When specified, entries deleted since this time will always be
 
4986
// included regardless of showDeleted.  The default is not to filter by
 
4987
// last modification time.
 
4988
func (c *EventsWatchCall) UpdatedMin(updatedMin string) *EventsWatchCall {
 
4989
        c.opt_["updatedMin"] = updatedMin
 
4990
        return c
 
4991
}
 
4992
 
 
4993
// Fields allows partial responses to be retrieved.
 
4994
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
4995
// for more information.
 
4996
func (c *EventsWatchCall) Fields(s ...googleapi.Field) *EventsWatchCall {
 
4997
        c.opt_["fields"] = googleapi.CombineFields(s)
 
4998
        return c
 
4999
}
 
5000
 
 
5001
func (c *EventsWatchCall) Do() (*Channel, error) {
 
5002
        var body io.Reader = nil
 
5003
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
 
5004
        if err != nil {
 
5005
                return nil, err
 
5006
        }
 
5007
        ctype := "application/json"
 
5008
        params := make(url.Values)
 
5009
        params.Set("alt", "json")
 
5010
        if v, ok := c.opt_["alwaysIncludeEmail"]; ok {
 
5011
                params.Set("alwaysIncludeEmail", fmt.Sprintf("%v", v))
 
5012
        }
 
5013
        if v, ok := c.opt_["iCalUID"]; ok {
 
5014
                params.Set("iCalUID", fmt.Sprintf("%v", v))
 
5015
        }
 
5016
        if v, ok := c.opt_["maxAttendees"]; ok {
 
5017
                params.Set("maxAttendees", fmt.Sprintf("%v", v))
 
5018
        }
 
5019
        if v, ok := c.opt_["maxResults"]; ok {
 
5020
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
5021
        }
 
5022
        if v, ok := c.opt_["orderBy"]; ok {
 
5023
                params.Set("orderBy", fmt.Sprintf("%v", v))
 
5024
        }
 
5025
        if v, ok := c.opt_["pageToken"]; ok {
 
5026
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
5027
        }
 
5028
        if v, ok := c.opt_["privateExtendedProperty"]; ok {
 
5029
                params.Set("privateExtendedProperty", fmt.Sprintf("%v", v))
 
5030
        }
 
5031
        if v, ok := c.opt_["q"]; ok {
 
5032
                params.Set("q", fmt.Sprintf("%v", v))
 
5033
        }
 
5034
        if v, ok := c.opt_["sharedExtendedProperty"]; ok {
 
5035
                params.Set("sharedExtendedProperty", fmt.Sprintf("%v", v))
 
5036
        }
 
5037
        if v, ok := c.opt_["showDeleted"]; ok {
 
5038
                params.Set("showDeleted", fmt.Sprintf("%v", v))
 
5039
        }
 
5040
        if v, ok := c.opt_["showHiddenInvitations"]; ok {
 
5041
                params.Set("showHiddenInvitations", fmt.Sprintf("%v", v))
 
5042
        }
 
5043
        if v, ok := c.opt_["singleEvents"]; ok {
 
5044
                params.Set("singleEvents", fmt.Sprintf("%v", v))
 
5045
        }
 
5046
        if v, ok := c.opt_["syncToken"]; ok {
 
5047
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
5048
        }
 
5049
        if v, ok := c.opt_["timeMax"]; ok {
 
5050
                params.Set("timeMax", fmt.Sprintf("%v", v))
 
5051
        }
 
5052
        if v, ok := c.opt_["timeMin"]; ok {
 
5053
                params.Set("timeMin", fmt.Sprintf("%v", v))
 
5054
        }
 
5055
        if v, ok := c.opt_["timeZone"]; ok {
 
5056
                params.Set("timeZone", fmt.Sprintf("%v", v))
 
5057
        }
 
5058
        if v, ok := c.opt_["updatedMin"]; ok {
 
5059
                params.Set("updatedMin", fmt.Sprintf("%v", v))
 
5060
        }
 
5061
        if v, ok := c.opt_["fields"]; ok {
 
5062
                params.Set("fields", fmt.Sprintf("%v", v))
 
5063
        }
 
5064
        urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/watch")
 
5065
        urls += "?" + params.Encode()
 
5066
        req, _ := http.NewRequest("POST", urls, body)
 
5067
        googleapi.Expand(req.URL, map[string]string{
 
5068
                "calendarId": c.calendarId,
 
5069
        })
 
5070
        req.Header.Set("Content-Type", ctype)
 
5071
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
5072
        res, err := c.s.client.Do(req)
 
5073
        if err != nil {
 
5074
                return nil, err
 
5075
        }
 
5076
        defer googleapi.CloseBody(res)
 
5077
        if err := googleapi.CheckResponse(res); err != nil {
 
5078
                return nil, err
 
5079
        }
 
5080
        var ret *Channel
 
5081
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
5082
                return nil, err
 
5083
        }
 
5084
        return ret, nil
 
5085
        // {
 
5086
        //   "description": "Watch for changes to Events resources.",
 
5087
        //   "httpMethod": "POST",
 
5088
        //   "id": "calendar.events.watch",
 
5089
        //   "parameterOrder": [
 
5090
        //     "calendarId"
 
5091
        //   ],
 
5092
        //   "parameters": {
 
5093
        //     "alwaysIncludeEmail": {
 
5094
        //       "description": "Whether to always include a value in the email field for the organizer, creator and attendees, even if no real email is available (i.e. a generated, non-working value will be provided). The use of this option is discouraged and should only be used by clients which cannot handle the absence of an email address value in the mentioned places. Optional. The default is False.",
 
5095
        //       "location": "query",
 
5096
        //       "type": "boolean"
 
5097
        //     },
 
5098
        //     "calendarId": {
 
5099
        //       "description": "Calendar identifier.",
 
5100
        //       "location": "path",
 
5101
        //       "required": true,
 
5102
        //       "type": "string"
 
5103
        //     },
 
5104
        //     "iCalUID": {
 
5105
        //       "description": "Specifies event ID in the iCalendar format to be included in the response. Optional.",
 
5106
        //       "location": "query",
 
5107
        //       "type": "string"
 
5108
        //     },
 
5109
        //     "maxAttendees": {
 
5110
        //       "description": "The maximum number of attendees to include in the response. If there are more than the specified number of attendees, only the participant is returned. Optional.",
 
5111
        //       "format": "int32",
 
5112
        //       "location": "query",
 
5113
        //       "minimum": "1",
 
5114
        //       "type": "integer"
 
5115
        //     },
 
5116
        //     "maxResults": {
 
5117
        //       "description": "Maximum number of events returned on one result page. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.",
 
5118
        //       "format": "int32",
 
5119
        //       "location": "query",
 
5120
        //       "minimum": "1",
 
5121
        //       "type": "integer"
 
5122
        //     },
 
5123
        //     "orderBy": {
 
5124
        //       "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.",
 
5125
        //       "enum": [
 
5126
        //         "startTime",
 
5127
        //         "updated"
 
5128
        //       ],
 
5129
        //       "enumDescriptions": [
 
5130
        //         "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)",
 
5131
        //         "Order by last modification time (ascending)."
 
5132
        //       ],
 
5133
        //       "location": "query",
 
5134
        //       "type": "string"
 
5135
        //     },
 
5136
        //     "pageToken": {
 
5137
        //       "description": "Token specifying which result page to return. Optional.",
 
5138
        //       "location": "query",
 
5139
        //       "type": "string"
 
5140
        //     },
 
5141
        //     "privateExtendedProperty": {
 
5142
        //       "description": "Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints.",
 
5143
        //       "location": "query",
 
5144
        //       "repeated": true,
 
5145
        //       "type": "string"
 
5146
        //     },
 
5147
        //     "q": {
 
5148
        //       "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.",
 
5149
        //       "location": "query",
 
5150
        //       "type": "string"
 
5151
        //     },
 
5152
        //     "sharedExtendedProperty": {
 
5153
        //       "description": "Extended properties constraint specified as propertyName=value. Matches only shared properties. This parameter might be repeated multiple times to return events that match all given constraints.",
 
5154
        //       "location": "query",
 
5155
        //       "repeated": true,
 
5156
        //       "type": "string"
 
5157
        //     },
 
5158
        //     "showDeleted": {
 
5159
        //       "description": "Whether to include deleted events (with status equals \"cancelled\") in the result. Cancelled instances of recurring events (but not the underlying recurring event) will still be included if showDeleted and singleEvents are both False. If showDeleted and singleEvents are both True, only single instances of deleted events (but not the underlying recurring events) are returned. Optional. The default is False.",
 
5160
        //       "location": "query",
 
5161
        //       "type": "boolean"
 
5162
        //     },
 
5163
        //     "showHiddenInvitations": {
 
5164
        //       "description": "Whether to include hidden invitations in the result. Optional. The default is False.",
 
5165
        //       "location": "query",
 
5166
        //       "type": "boolean"
 
5167
        //     },
 
5168
        //     "singleEvents": {
 
5169
        //       "description": "Whether to expand recurring events into instances and only return single one-off events and instances of recurring events, but not the underlying recurring events themselves. Optional. The default is False.",
 
5170
        //       "location": "query",
 
5171
        //       "type": "boolean"
 
5172
        //     },
 
5173
        //     "syncToken": {
 
5174
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then. All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False.\nThere are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state.\n\nThese are: \n- iCalUID \n- orderBy \n- privateExtendedProperty \n- q \n- sharedExtendedProperty \n- timeMin \n- timeMax \n- updatedMin If the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
5175
        //       "location": "query",
 
5176
        //       "type": "string"
 
5177
        //     },
 
5178
        //     "timeMax": {
 
5179
        //       "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time.",
 
5180
        //       "format": "date-time",
 
5181
        //       "location": "query",
 
5182
        //       "type": "string"
 
5183
        //     },
 
5184
        //     "timeMin": {
 
5185
        //       "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time.",
 
5186
        //       "format": "date-time",
 
5187
        //       "location": "query",
 
5188
        //       "type": "string"
 
5189
        //     },
 
5190
        //     "timeZone": {
 
5191
        //       "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
 
5192
        //       "location": "query",
 
5193
        //       "type": "string"
 
5194
        //     },
 
5195
        //     "updatedMin": {
 
5196
        //       "description": "Lower bound for an event's last modification time (as a RFC 3339 timestamp) to filter by. When specified, entries deleted since this time will always be included regardless of showDeleted. Optional. The default is not to filter by last modification time.",
 
5197
        //       "format": "date-time",
 
5198
        //       "location": "query",
 
5199
        //       "type": "string"
 
5200
        //     }
 
5201
        //   },
 
5202
        //   "path": "calendars/{calendarId}/events/watch",
 
5203
        //   "request": {
 
5204
        //     "$ref": "Channel",
 
5205
        //     "parameterName": "resource"
 
5206
        //   },
 
5207
        //   "response": {
 
5208
        //     "$ref": "Channel"
 
5209
        //   },
 
5210
        //   "scopes": [
 
5211
        //     "https://www.googleapis.com/auth/calendar",
 
5212
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
5213
        //   ],
 
5214
        //   "supportsSubscription": true
 
5215
        // }
 
5216
 
 
5217
}
 
5218
 
 
5219
// method id "calendar.freebusy.query":
 
5220
 
 
5221
type FreebusyQueryCall struct {
 
5222
        s               *Service
 
5223
        freebusyrequest *FreeBusyRequest
 
5224
        opt_            map[string]interface{}
 
5225
}
 
5226
 
 
5227
// Query: Returns free/busy information for a set of calendars.
 
5228
func (r *FreebusyService) Query(freebusyrequest *FreeBusyRequest) *FreebusyQueryCall {
 
5229
        c := &FreebusyQueryCall{s: r.s, opt_: make(map[string]interface{})}
 
5230
        c.freebusyrequest = freebusyrequest
 
5231
        return c
 
5232
}
 
5233
 
 
5234
// Fields allows partial responses to be retrieved.
 
5235
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
5236
// for more information.
 
5237
func (c *FreebusyQueryCall) Fields(s ...googleapi.Field) *FreebusyQueryCall {
 
5238
        c.opt_["fields"] = googleapi.CombineFields(s)
 
5239
        return c
 
5240
}
 
5241
 
 
5242
func (c *FreebusyQueryCall) Do() (*FreeBusyResponse, error) {
 
5243
        var body io.Reader = nil
 
5244
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.freebusyrequest)
 
5245
        if err != nil {
 
5246
                return nil, err
 
5247
        }
 
5248
        ctype := "application/json"
 
5249
        params := make(url.Values)
 
5250
        params.Set("alt", "json")
 
5251
        if v, ok := c.opt_["fields"]; ok {
 
5252
                params.Set("fields", fmt.Sprintf("%v", v))
 
5253
        }
 
5254
        urls := googleapi.ResolveRelative(c.s.BasePath, "freeBusy")
 
5255
        urls += "?" + params.Encode()
 
5256
        req, _ := http.NewRequest("POST", urls, body)
 
5257
        googleapi.SetOpaque(req.URL)
 
5258
        req.Header.Set("Content-Type", ctype)
 
5259
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
5260
        res, err := c.s.client.Do(req)
 
5261
        if err != nil {
 
5262
                return nil, err
 
5263
        }
 
5264
        defer googleapi.CloseBody(res)
 
5265
        if err := googleapi.CheckResponse(res); err != nil {
 
5266
                return nil, err
 
5267
        }
 
5268
        var ret *FreeBusyResponse
 
5269
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
5270
                return nil, err
 
5271
        }
 
5272
        return ret, nil
 
5273
        // {
 
5274
        //   "description": "Returns free/busy information for a set of calendars.",
 
5275
        //   "httpMethod": "POST",
 
5276
        //   "id": "calendar.freebusy.query",
 
5277
        //   "path": "freeBusy",
 
5278
        //   "request": {
 
5279
        //     "$ref": "FreeBusyRequest"
 
5280
        //   },
 
5281
        //   "response": {
 
5282
        //     "$ref": "FreeBusyResponse"
 
5283
        //   },
 
5284
        //   "scopes": [
 
5285
        //     "https://www.googleapis.com/auth/calendar",
 
5286
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
5287
        //   ]
 
5288
        // }
 
5289
 
 
5290
}
 
5291
 
 
5292
// method id "calendar.settings.get":
 
5293
 
 
5294
type SettingsGetCall struct {
 
5295
        s       *Service
 
5296
        setting string
 
5297
        opt_    map[string]interface{}
 
5298
}
 
5299
 
 
5300
// Get: Returns a single user setting.
 
5301
func (r *SettingsService) Get(setting string) *SettingsGetCall {
 
5302
        c := &SettingsGetCall{s: r.s, opt_: make(map[string]interface{})}
 
5303
        c.setting = setting
 
5304
        return c
 
5305
}
 
5306
 
 
5307
// Fields allows partial responses to be retrieved.
 
5308
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
5309
// for more information.
 
5310
func (c *SettingsGetCall) Fields(s ...googleapi.Field) *SettingsGetCall {
 
5311
        c.opt_["fields"] = googleapi.CombineFields(s)
 
5312
        return c
 
5313
}
 
5314
 
 
5315
func (c *SettingsGetCall) Do() (*Setting, error) {
 
5316
        var body io.Reader = nil
 
5317
        params := make(url.Values)
 
5318
        params.Set("alt", "json")
 
5319
        if v, ok := c.opt_["fields"]; ok {
 
5320
                params.Set("fields", fmt.Sprintf("%v", v))
 
5321
        }
 
5322
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/{setting}")
 
5323
        urls += "?" + params.Encode()
 
5324
        req, _ := http.NewRequest("GET", urls, body)
 
5325
        googleapi.Expand(req.URL, map[string]string{
 
5326
                "setting": c.setting,
 
5327
        })
 
5328
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
5329
        res, err := c.s.client.Do(req)
 
5330
        if err != nil {
 
5331
                return nil, err
 
5332
        }
 
5333
        defer googleapi.CloseBody(res)
 
5334
        if err := googleapi.CheckResponse(res); err != nil {
 
5335
                return nil, err
 
5336
        }
 
5337
        var ret *Setting
 
5338
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
5339
                return nil, err
 
5340
        }
 
5341
        return ret, nil
 
5342
        // {
 
5343
        //   "description": "Returns a single user setting.",
 
5344
        //   "httpMethod": "GET",
 
5345
        //   "id": "calendar.settings.get",
 
5346
        //   "parameterOrder": [
 
5347
        //     "setting"
 
5348
        //   ],
 
5349
        //   "parameters": {
 
5350
        //     "setting": {
 
5351
        //       "description": "The id of the user setting.",
 
5352
        //       "location": "path",
 
5353
        //       "required": true,
 
5354
        //       "type": "string"
 
5355
        //     }
 
5356
        //   },
 
5357
        //   "path": "users/me/settings/{setting}",
 
5358
        //   "response": {
 
5359
        //     "$ref": "Setting"
 
5360
        //   },
 
5361
        //   "scopes": [
 
5362
        //     "https://www.googleapis.com/auth/calendar",
 
5363
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
5364
        //   ]
 
5365
        // }
 
5366
 
 
5367
}
 
5368
 
 
5369
// method id "calendar.settings.list":
 
5370
 
 
5371
type SettingsListCall struct {
 
5372
        s    *Service
 
5373
        opt_ map[string]interface{}
 
5374
}
 
5375
 
 
5376
// List: Returns all user settings for the authenticated user.
 
5377
func (r *SettingsService) List() *SettingsListCall {
 
5378
        c := &SettingsListCall{s: r.s, opt_: make(map[string]interface{})}
 
5379
        return c
 
5380
}
 
5381
 
 
5382
// MaxResults sets the optional parameter "maxResults": Maximum number
 
5383
// of entries returned on one result page. By default the value is 100
 
5384
// entries. The page size can never be larger than 250 entries.
 
5385
func (c *SettingsListCall) MaxResults(maxResults int64) *SettingsListCall {
 
5386
        c.opt_["maxResults"] = maxResults
 
5387
        return c
 
5388
}
 
5389
 
 
5390
// PageToken sets the optional parameter "pageToken": Token specifying
 
5391
// which result page to return.
 
5392
func (c *SettingsListCall) PageToken(pageToken string) *SettingsListCall {
 
5393
        c.opt_["pageToken"] = pageToken
 
5394
        return c
 
5395
}
 
5396
 
 
5397
// SyncToken sets the optional parameter "syncToken": Token obtained
 
5398
// from the nextSyncToken field returned on the last page of results
 
5399
// from the previous list request. It makes the result of this list
 
5400
// request contain only entries that have changed since then.
 
5401
// If the
 
5402
// syncToken expires, the server will respond with a 410 GONE response
 
5403
// code and the client should clear its storage and perform a full
 
5404
// synchronization without any syncToken.
 
5405
// Learn more about incremental
 
5406
// synchronization.
 
5407
//  The default is to return all entries.
 
5408
func (c *SettingsListCall) SyncToken(syncToken string) *SettingsListCall {
 
5409
        c.opt_["syncToken"] = syncToken
 
5410
        return c
 
5411
}
 
5412
 
 
5413
// Fields allows partial responses to be retrieved.
 
5414
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
5415
// for more information.
 
5416
func (c *SettingsListCall) Fields(s ...googleapi.Field) *SettingsListCall {
 
5417
        c.opt_["fields"] = googleapi.CombineFields(s)
 
5418
        return c
 
5419
}
 
5420
 
 
5421
func (c *SettingsListCall) Do() (*Settings, error) {
 
5422
        var body io.Reader = nil
 
5423
        params := make(url.Values)
 
5424
        params.Set("alt", "json")
 
5425
        if v, ok := c.opt_["maxResults"]; ok {
 
5426
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
5427
        }
 
5428
        if v, ok := c.opt_["pageToken"]; ok {
 
5429
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
5430
        }
 
5431
        if v, ok := c.opt_["syncToken"]; ok {
 
5432
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
5433
        }
 
5434
        if v, ok := c.opt_["fields"]; ok {
 
5435
                params.Set("fields", fmt.Sprintf("%v", v))
 
5436
        }
 
5437
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings")
 
5438
        urls += "?" + params.Encode()
 
5439
        req, _ := http.NewRequest("GET", urls, body)
 
5440
        googleapi.SetOpaque(req.URL)
 
5441
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
5442
        res, err := c.s.client.Do(req)
 
5443
        if err != nil {
 
5444
                return nil, err
 
5445
        }
 
5446
        defer googleapi.CloseBody(res)
 
5447
        if err := googleapi.CheckResponse(res); err != nil {
 
5448
                return nil, err
 
5449
        }
 
5450
        var ret *Settings
 
5451
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
5452
                return nil, err
 
5453
        }
 
5454
        return ret, nil
 
5455
        // {
 
5456
        //   "description": "Returns all user settings for the authenticated user.",
 
5457
        //   "httpMethod": "GET",
 
5458
        //   "id": "calendar.settings.list",
 
5459
        //   "parameters": {
 
5460
        //     "maxResults": {
 
5461
        //       "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.",
 
5462
        //       "format": "int32",
 
5463
        //       "location": "query",
 
5464
        //       "minimum": "1",
 
5465
        //       "type": "integer"
 
5466
        //     },
 
5467
        //     "pageToken": {
 
5468
        //       "description": "Token specifying which result page to return. Optional.",
 
5469
        //       "location": "query",
 
5470
        //       "type": "string"
 
5471
        //     },
 
5472
        //     "syncToken": {
 
5473
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
5474
        //       "location": "query",
 
5475
        //       "type": "string"
 
5476
        //     }
 
5477
        //   },
 
5478
        //   "path": "users/me/settings",
 
5479
        //   "response": {
 
5480
        //     "$ref": "Settings"
 
5481
        //   },
 
5482
        //   "scopes": [
 
5483
        //     "https://www.googleapis.com/auth/calendar",
 
5484
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
5485
        //   ],
 
5486
        //   "supportsSubscription": true
 
5487
        // }
 
5488
 
 
5489
}
 
5490
 
 
5491
// method id "calendar.settings.watch":
 
5492
 
 
5493
type SettingsWatchCall struct {
 
5494
        s       *Service
 
5495
        channel *Channel
 
5496
        opt_    map[string]interface{}
 
5497
}
 
5498
 
 
5499
// Watch: Watch for changes to Settings resources.
 
5500
func (r *SettingsService) Watch(channel *Channel) *SettingsWatchCall {
 
5501
        c := &SettingsWatchCall{s: r.s, opt_: make(map[string]interface{})}
 
5502
        c.channel = channel
 
5503
        return c
 
5504
}
 
5505
 
 
5506
// MaxResults sets the optional parameter "maxResults": Maximum number
 
5507
// of entries returned on one result page. By default the value is 100
 
5508
// entries. The page size can never be larger than 250 entries.
 
5509
func (c *SettingsWatchCall) MaxResults(maxResults int64) *SettingsWatchCall {
 
5510
        c.opt_["maxResults"] = maxResults
 
5511
        return c
 
5512
}
 
5513
 
 
5514
// PageToken sets the optional parameter "pageToken": Token specifying
 
5515
// which result page to return.
 
5516
func (c *SettingsWatchCall) PageToken(pageToken string) *SettingsWatchCall {
 
5517
        c.opt_["pageToken"] = pageToken
 
5518
        return c
 
5519
}
 
5520
 
 
5521
// SyncToken sets the optional parameter "syncToken": Token obtained
 
5522
// from the nextSyncToken field returned on the last page of results
 
5523
// from the previous list request. It makes the result of this list
 
5524
// request contain only entries that have changed since then.
 
5525
// If the
 
5526
// syncToken expires, the server will respond with a 410 GONE response
 
5527
// code and the client should clear its storage and perform a full
 
5528
// synchronization without any syncToken.
 
5529
// Learn more about incremental
 
5530
// synchronization.
 
5531
//  The default is to return all entries.
 
5532
func (c *SettingsWatchCall) SyncToken(syncToken string) *SettingsWatchCall {
 
5533
        c.opt_["syncToken"] = syncToken
 
5534
        return c
 
5535
}
 
5536
 
 
5537
// Fields allows partial responses to be retrieved.
 
5538
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
5539
// for more information.
 
5540
func (c *SettingsWatchCall) Fields(s ...googleapi.Field) *SettingsWatchCall {
 
5541
        c.opt_["fields"] = googleapi.CombineFields(s)
 
5542
        return c
 
5543
}
 
5544
 
 
5545
func (c *SettingsWatchCall) Do() (*Channel, error) {
 
5546
        var body io.Reader = nil
 
5547
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
 
5548
        if err != nil {
 
5549
                return nil, err
 
5550
        }
 
5551
        ctype := "application/json"
 
5552
        params := make(url.Values)
 
5553
        params.Set("alt", "json")
 
5554
        if v, ok := c.opt_["maxResults"]; ok {
 
5555
                params.Set("maxResults", fmt.Sprintf("%v", v))
 
5556
        }
 
5557
        if v, ok := c.opt_["pageToken"]; ok {
 
5558
                params.Set("pageToken", fmt.Sprintf("%v", v))
 
5559
        }
 
5560
        if v, ok := c.opt_["syncToken"]; ok {
 
5561
                params.Set("syncToken", fmt.Sprintf("%v", v))
 
5562
        }
 
5563
        if v, ok := c.opt_["fields"]; ok {
 
5564
                params.Set("fields", fmt.Sprintf("%v", v))
 
5565
        }
 
5566
        urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/watch")
 
5567
        urls += "?" + params.Encode()
 
5568
        req, _ := http.NewRequest("POST", urls, body)
 
5569
        googleapi.SetOpaque(req.URL)
 
5570
        req.Header.Set("Content-Type", ctype)
 
5571
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
5572
        res, err := c.s.client.Do(req)
 
5573
        if err != nil {
 
5574
                return nil, err
 
5575
        }
 
5576
        defer googleapi.CloseBody(res)
 
5577
        if err := googleapi.CheckResponse(res); err != nil {
 
5578
                return nil, err
 
5579
        }
 
5580
        var ret *Channel
 
5581
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
5582
                return nil, err
 
5583
        }
 
5584
        return ret, nil
 
5585
        // {
 
5586
        //   "description": "Watch for changes to Settings resources.",
 
5587
        //   "httpMethod": "POST",
 
5588
        //   "id": "calendar.settings.watch",
 
5589
        //   "parameters": {
 
5590
        //     "maxResults": {
 
5591
        //       "description": "Maximum number of entries returned on one result page. By default the value is 100 entries. The page size can never be larger than 250 entries. Optional.",
 
5592
        //       "format": "int32",
 
5593
        //       "location": "query",
 
5594
        //       "minimum": "1",
 
5595
        //       "type": "integer"
 
5596
        //     },
 
5597
        //     "pageToken": {
 
5598
        //       "description": "Token specifying which result page to return. Optional.",
 
5599
        //       "location": "query",
 
5600
        //       "type": "string"
 
5601
        //     },
 
5602
        //     "syncToken": {
 
5603
        //       "description": "Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. It makes the result of this list request contain only entries that have changed since then.\nIf the syncToken expires, the server will respond with a 410 GONE response code and the client should clear its storage and perform a full synchronization without any syncToken.\nLearn more about incremental synchronization.\nOptional. The default is to return all entries.",
 
5604
        //       "location": "query",
 
5605
        //       "type": "string"
 
5606
        //     }
 
5607
        //   },
 
5608
        //   "path": "users/me/settings/watch",
 
5609
        //   "request": {
 
5610
        //     "$ref": "Channel",
 
5611
        //     "parameterName": "resource"
 
5612
        //   },
 
5613
        //   "response": {
 
5614
        //     "$ref": "Channel"
 
5615
        //   },
 
5616
        //   "scopes": [
 
5617
        //     "https://www.googleapis.com/auth/calendar",
 
5618
        //     "https://www.googleapis.com/auth/calendar.readonly"
 
5619
        //   ],
 
5620
        //   "supportsSubscription": true
 
5621
        // }
 
5622
 
 
5623
}