1
// Package calendar provides access to the Calendar API.
3
// See https://developers.google.com/google-apps/calendar/firstapp
7
// import "google.golang.org/api/calendar/v3"
9
// calendarService, err := calendar.New(oauthHttpClient)
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "calendar:v3"
38
const apiName = "calendar"
39
const apiVersion = "v3"
40
const basePath = "https://www.googleapis.com/calendar/v3/"
42
// OAuth2 scopes used by this API.
44
// Manage your calendars
45
CalendarScope = "https://www.googleapis.com/auth/calendar"
47
// View your calendars
48
CalendarReadonlyScope = "https://www.googleapis.com/auth/calendar.readonly"
51
func New(client *http.Client) (*Service, error) {
53
return nil, errors.New("client is nil")
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)
69
BasePath string // API endpoint base URL
73
CalendarList *CalendarListService
75
Calendars *CalendarsService
77
Channels *ChannelsService
83
Freebusy *FreebusyService
85
Settings *SettingsService
88
func NewAclService(s *Service) *AclService {
89
rs := &AclService{s: s}
93
type AclService struct {
97
func NewCalendarListService(s *Service) *CalendarListService {
98
rs := &CalendarListService{s: s}
102
type CalendarListService struct {
106
func NewCalendarsService(s *Service) *CalendarsService {
107
rs := &CalendarsService{s: s}
111
type CalendarsService struct {
115
func NewChannelsService(s *Service) *ChannelsService {
116
rs := &ChannelsService{s: s}
120
type ChannelsService struct {
124
func NewColorsService(s *Service) *ColorsService {
125
rs := &ColorsService{s: s}
129
type ColorsService struct {
133
func NewEventsService(s *Service) *EventsService {
134
rs := &EventsService{s: s}
138
type EventsService struct {
142
func NewFreebusyService(s *Service) *FreebusyService {
143
rs := &FreebusyService{s: s}
147
type FreebusyService struct {
151
func NewSettingsService(s *Service) *SettingsService {
152
rs := &SettingsService{s: s}
156
type SettingsService struct {
161
// Etag: ETag of the collection.
162
Etag string `json:"etag,omitempty"`
164
// Items: List of rules on the access control list.
165
Items []*AclRule `json:"items,omitempty"`
167
// Kind: Type of the collection ("calendar#acl").
168
Kind string `json:"kind,omitempty"`
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"`
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
179
NextSyncToken string `json:"nextSyncToken,omitempty"`
182
type AclRule struct {
183
// Etag: ETag of the resource.
184
Etag string `json:"etag,omitempty"`
186
// Id: Identifier of the ACL rule.
187
Id string `json:"id,omitempty"`
189
// Kind: Type of the resource ("calendar#aclRule").
190
Kind string `json:"kind,omitempty"`
192
// Role: The role assigned to the scope. Possible values are:
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.
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
207
Role string `json:"role,omitempty"`
209
// Scope: The scope of the rule.
210
Scope *AclRuleScope `json:"scope,omitempty"`
213
type AclRuleScope struct {
214
// Type: The type of the scope. Possible values are:
216
// public scope. This is the default value.
217
// - "user" - Limits the scope
219
// - "group" - Limits the scope to a group.
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"`
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"`
231
type Calendar struct {
232
// Description: Description of the calendar. Optional.
233
Description string `json:"description,omitempty"`
235
// Etag: ETag of the resource.
236
Etag string `json:"etag,omitempty"`
238
// Id: Identifier of the calendar.
239
Id string `json:"id,omitempty"`
241
// Kind: Type of the resource ("calendar#calendar").
242
Kind string `json:"kind,omitempty"`
244
// Location: Geographic location of the calendar as free-form text.
246
Location string `json:"location,omitempty"`
248
// Summary: Title of the calendar.
249
Summary string `json:"summary,omitempty"`
251
// TimeZone: The time zone of the calendar. Optional.
252
TimeZone string `json:"timeZone,omitempty"`
255
type CalendarList struct {
256
// Etag: ETag of the collection.
257
Etag string `json:"etag,omitempty"`
259
// Items: Calendars that are present on the user's calendar list.
260
Items []*CalendarListEntry `json:"items,omitempty"`
262
// Kind: Type of the collection ("calendar#calendarList").
263
Kind string `json:"kind,omitempty"`
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"`
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
274
NextSyncToken string `json:"nextSyncToken,omitempty"`
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.
283
// Provides read access to the calendar. Private events will appear to
284
// users with reader access, but event details will be hidden.
286
// "writer" - Provides read and write access to the calendar. Private
287
// events will appear to users with writer access, and event details
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"`
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"`
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"`
304
// DefaultReminders: The default reminders that the authenticated user
305
// has for this calendar.
306
DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"`
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"`
312
// Description: Description of the calendar. Optional. Read-only.
313
Description string `json:"description,omitempty"`
315
// Etag: ETag of the resource.
316
Etag string `json:"etag,omitempty"`
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"`
323
// Hidden: Whether the calendar has been hidden from the list. Optional.
324
// The default is False.
325
Hidden bool `json:"hidden,omitempty"`
327
// Id: Identifier of the calendar.
328
Id string `json:"id,omitempty"`
330
// Kind: Type of the resource ("calendar#calendarListEntry").
331
Kind string `json:"kind,omitempty"`
333
// Location: Geographic location of the calendar as free-form text.
334
// Optional. Read-only.
335
Location string `json:"location,omitempty"`
337
// NotificationSettings: The notifications that the authenticated user
338
// is receiving for this calendar.
339
NotificationSettings *CalendarListEntryNotificationSettings `json:"notificationSettings,omitempty"`
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"`
345
// Selected: Whether the calendar content shows up in the calendar UI.
346
// Optional. The default is False.
347
Selected bool `json:"selected,omitempty"`
349
// Summary: Title of the calendar. Read-only.
350
Summary string `json:"summary,omitempty"`
352
// SummaryOverride: The summary that the authenticated user has set for
353
// this calendar. Optional.
354
SummaryOverride string `json:"summaryOverride,omitempty"`
356
// TimeZone: The time zone of the calendar. Optional. Read-only.
357
TimeZone string `json:"timeZone,omitempty"`
360
type CalendarListEntryNotificationSettings struct {
361
// Notifications: The list of notifications set for this calendar.
362
Notifications []*CalendarNotification `json:"notifications,omitempty"`
365
type CalendarNotification struct {
366
// Method: The method used to deliver the notification. Possible values
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
372
Method string `json:"method,omitempty"`
374
// Type: The type of notification. Possible values are:
376
// "eventCreation" - Notification sent when a new event is put on the
378
// - "eventChange" - Notification sent when an event is
380
// - "eventCancellation" - Notification sent when an event is
382
// - "eventResponse" - Notification sent when an event is
384
// - "agenda" - An agenda with the events of the day (sent out
386
Type string `json:"type,omitempty"`
389
type Channel struct {
390
// Address: The address where notifications are delivered for this
392
Address string `json:"address,omitempty"`
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"`
398
// Id: A UUID or similar unique string that identifies this channel.
399
Id string `json:"id,omitempty"`
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"`
405
// Params: Additional parameters controlling delivery channel behavior.
407
Params map[string]string `json:"params,omitempty"`
409
// Payload: A Boolean value to indicate whether payload is wanted.
411
Payload bool `json:"payload,omitempty"`
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"`
417
// ResourceUri: A version-specific identifier for the watched resource.
418
ResourceUri string `json:"resourceUri,omitempty"`
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"`
424
// Type: The type of delivery mechanism used for this channel.
425
Type string `json:"type,omitempty"`
428
type ColorDefinition struct {
429
// Background: The background color associated with this color
431
Background string `json:"background,omitempty"`
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"`
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"`
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"`
449
// Kind: Type of the resource ("calendar#colors").
450
Kind string `json:"kind,omitempty"`
452
// Updated: Last modification time of the color palette (as a RFC 3339
453
// timestamp). Read-only.
454
Updated string `json:"updated,omitempty"`
458
// Domain: Domain, or broad category, of the error.
459
Domain string `json:"domain,omitempty"`
461
// Reason: Specific reason for the error. Some of the possible values
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.
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"`
477
// AnyoneCanAddSelf: Whether anyone can invite themselves to the event.
478
// Optional. The default is False.
479
AnyoneCanAddSelf bool `json:"anyoneCanAddSelf,omitempty"`
481
// Attendees: The attendees of the event.
482
Attendees []*EventAttendee `json:"attendees,omitempty"`
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"`
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"`
496
// Created: Creation time of the event (as a RFC 3339 timestamp).
498
Created string `json:"created,omitempty"`
500
// Creator: The creator of the event. Read-only.
501
Creator *EventCreator `json:"creator,omitempty"`
503
// Description: Description of the event. Optional.
504
Description string `json:"description,omitempty"`
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"`
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"`
515
// Etag: ETag of the resource.
516
Etag string `json:"etag,omitempty"`
518
// ExtendedProperties: Extended properties of the event.
519
ExtendedProperties *EventExtendedProperties `json:"extendedProperties,omitempty"`
521
// Gadget: A gadget that extends this event.
522
Gadget *EventGadget `json:"gadget,omitempty"`
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"`
528
// GuestsCanModify: Whether attendees other than the organizer can
529
// modify the event. Optional. The default is False.
530
GuestsCanModify bool `json:"guestsCanModify,omitempty"`
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"`
536
// HangoutLink: An absolute link to the Google+ hangout associated with
537
// this event. Read-only.
538
HangoutLink string `json:"hangoutLink,omitempty"`
540
// HtmlLink: An absolute link to this event in the Google Calendar Web
542
HtmlLink string `json:"htmlLink,omitempty"`
544
// ICalUID: Event ID in the iCalendar format.
545
ICalUID string `json:"iCalUID,omitempty"`
547
// Id: Identifier of the event. When creating new single or recurring
548
// events, you can specify their IDs. Provided IDs must follow these
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
553
// - the length of the ID must be between 5 and 1024
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"`
562
// Kind: Type of the resource ("calendar#event").
563
Kind string `json:"kind,omitempty"`
565
// Location: Geographic location of the event as free-form text.
567
Location string `json:"location,omitempty"`
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"`
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"`
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"`
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"`
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"`
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"`
599
// Reminders: Information about the event's reminders for the
600
// authenticated user.
601
Reminders *EventReminders `json:"reminders,omitempty"`
603
// Sequence: Sequence number as per iCalendar.
604
Sequence int64 `json:"sequence,omitempty"`
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
610
Source *EventSource `json:"source,omitempty"`
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"`
616
// Status: Status of the event. Optional. Possible values are:
618
// "confirmed" - The event is confirmed. This is the default status.
620
// "tentative" - The event is tentatively confirmed.
622
// The event is cancelled.
623
Status string `json:"status,omitempty"`
625
// Summary: Title of the event.
626
Summary string `json:"summary,omitempty"`
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"`
636
// Updated: Last modification time of the event (as a RFC 3339
637
// timestamp). Read-only.
638
Updated string `json:"updated,omitempty"`
640
// Visibility: Visibility of the event. Optional. Possible values are:
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.
647
// - "private" - The event is private and only event attendees may view
649
// - "confidential" - The event is private. This value
650
// is provided for compatibility reasons.
651
Visibility string `json:"visibility,omitempty"`
654
type EventCreator struct {
655
// DisplayName: The creator's name, if available.
656
DisplayName string `json:"displayName,omitempty"`
658
// Email: The creator's email address, if available.
659
Email string `json:"email,omitempty"`
661
// Id: The creator's Profile ID, if available.
662
Id string `json:"id,omitempty"`
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"`
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"`
674
// Shared: Properties that are shared between copies of the event on
675
// other attendees' calendars.
676
Shared map[string]string `json:"shared,omitempty"`
679
type EventGadget struct {
680
// Display: The gadget's display mode. Optional. Possible values are:
682
// - "icon" - The gadget displays next to the event's title in the
684
// - "chip" - The gadget displays when the event is
686
Display string `json:"display,omitempty"`
688
// Height: The gadget's height in pixels. Optional.
689
Height int64 `json:"height,omitempty"`
691
// IconLink: The gadget's icon URL.
692
IconLink string `json:"iconLink,omitempty"`
694
// Link: The gadget's URL.
695
Link string `json:"link,omitempty"`
697
// Preferences: Preferences.
698
Preferences map[string]string `json:"preferences,omitempty"`
700
// Title: The gadget's title.
701
Title string `json:"title,omitempty"`
703
// Type: The gadget's type.
704
Type string `json:"type,omitempty"`
706
// Width: The gadget's width in pixels. Optional.
707
Width int64 `json:"width,omitempty"`
710
type EventOrganizer struct {
711
// DisplayName: The organizer's name, if available.
712
DisplayName string `json:"displayName,omitempty"`
714
// Email: The organizer's email address, if available.
715
Email string `json:"email,omitempty"`
717
// Id: The organizer's Profile ID, if available.
718
Id string `json:"id,omitempty"`
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"`
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"`
731
// UseDefault: Whether the default reminders of the calendar apply to
733
UseDefault bool `json:"useDefault,omitempty"`
736
type EventSource struct {
737
// Title: Title of the source; for example a title of a web page or an
739
Title string `json:"title,omitempty"`
741
// Url: URL of the source pointing to a resource. URL's protocol must be
743
Url string `json:"url,omitempty"`
746
type EventAttachment struct {
748
Title string `json:"title,omitempty"`
751
type EventAttendee struct {
752
// AdditionalGuests: Number of additional guests. Optional. The default
754
AdditionalGuests int64 `json:"additionalGuests,omitempty"`
756
// Comment: The attendee's response comment. Optional.
757
Comment string `json:"comment,omitempty"`
759
// DisplayName: The attendee's name, if available. Optional.
760
DisplayName string `json:"displayName,omitempty"`
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"`
766
// Id: The attendee's Profile ID, if available.
767
Id string `json:"id,omitempty"`
769
// Optional: Whether this is an optional attendee. Optional. The default
771
Optional bool `json:"optional,omitempty"`
773
// Organizer: Whether the attendee is the organizer of the event.
774
// Read-only. The default is False.
775
Organizer bool `json:"organizer,omitempty"`
777
// Resource: Whether the attendee is a resource. Read-only. The default
779
Resource bool `json:"resource,omitempty"`
781
// ResponseStatus: The attendee's response status. Possible values are:
783
// - "needsAction" - The attendee has not responded to the invitation.
785
// - "declined" - The attendee has declined the invitation.
787
// "tentative" - The attendee has tentatively accepted the invitation.
789
// - "accepted" - The attendee has accepted the invitation.
790
ResponseStatus string `json:"responseStatus,omitempty"`
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"`
797
type EventDateTime struct {
798
// Date: The date, in the format "yyyy-mm-dd", if this is an all-day
800
Date string `json:"date,omitempty"`
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"`
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"`
815
type EventReminder struct {
816
// Method: The method used by this reminder. Possible values are:
818
// "email" - Reminders are sent via email.
819
// - "sms" - Reminders are sent
821
// - "popup" - Reminders are sent via a UI popup.
822
Method string `json:"method,omitempty"`
824
// Minutes: Number of minutes before the start of the event when the
825
// reminder should trigger.
826
Minutes int64 `json:"minutes,omitempty"`
830
// AccessRole: The user's access role for this calendar. Read-only.
831
// Possible values are:
832
// - "none" - The user has no access.
834
// "freeBusyReader" - The user has read access to free/busy information.
836
// - "reader" - The user has read access to the calendar. Private
837
// events will appear to users with reader access, but event details
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
846
AccessRole string `json:"accessRole,omitempty"`
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"`
854
// Description: Description of the calendar. Read-only.
855
Description string `json:"description,omitempty"`
857
// Etag: ETag of the collection.
858
Etag string `json:"etag,omitempty"`
860
// Items: List of events on the calendar.
861
Items []*Event `json:"items,omitempty"`
863
// Kind: Type of the collection ("calendar#events").
864
Kind string `json:"kind,omitempty"`
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"`
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
875
NextSyncToken string `json:"nextSyncToken,omitempty"`
877
// Summary: Title of the calendar. Read-only.
878
Summary string `json:"summary,omitempty"`
880
// TimeZone: The time zone of the calendar. Read-only.
881
TimeZone string `json:"timeZone,omitempty"`
883
// Updated: Last modification time of the calendar (as a RFC 3339
884
// timestamp). Read-only.
885
Updated string `json:"updated,omitempty"`
888
type FreeBusyCalendar struct {
889
// Busy: List of time ranges during which this calendar should be
891
Busy []*TimePeriod `json:"busy,omitempty"`
893
// Errors: Optional error(s) (if computation for the calendar failed).
894
Errors []*Error `json:"errors,omitempty"`
897
type FreeBusyGroup struct {
898
// Calendars: List of calendars' identifiers within a group.
899
Calendars []string `json:"calendars,omitempty"`
901
// Errors: Optional error(s) (if computation for the group failed).
902
Errors []*Error `json:"errors,omitempty"`
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"`
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"`
915
// Items: List of calendars and/or groups to query.
916
Items []*FreeBusyRequestItem `json:"items,omitempty"`
918
// TimeMax: The end of the interval for the query.
919
TimeMax string `json:"timeMax,omitempty"`
921
// TimeMin: The start of the interval for the query.
922
TimeMin string `json:"timeMin,omitempty"`
924
// TimeZone: Time zone used in the response. Optional. The default is
926
TimeZone string `json:"timeZone,omitempty"`
929
type FreeBusyRequestItem struct {
930
// Id: The identifier of a calendar or a group.
931
Id string `json:"id,omitempty"`
934
type FreeBusyResponse struct {
935
// Calendars: List of free/busy information for calendars.
936
Calendars map[string]FreeBusyCalendar `json:"calendars,omitempty"`
938
// Groups: Expansion of groups.
939
Groups map[string]FreeBusyGroup `json:"groups,omitempty"`
941
// Kind: Type of the resource ("calendar#freeBusy").
942
Kind string `json:"kind,omitempty"`
944
// TimeMax: The end of the interval.
945
TimeMax string `json:"timeMax,omitempty"`
947
// TimeMin: The start of the interval.
948
TimeMin string `json:"timeMin,omitempty"`
951
type Setting struct {
952
// Etag: ETag of the resource.
953
Etag string `json:"etag,omitempty"`
955
// Id: The id of the user setting.
956
Id string `json:"id,omitempty"`
958
// Kind: Type of the resource ("calendar#setting").
959
Kind string `json:"kind,omitempty"`
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"`
967
type Settings struct {
968
// Etag: Etag of the collection.
969
Etag string `json:"etag,omitempty"`
971
// Items: List of user settings.
972
Items []*Setting `json:"items,omitempty"`
974
// Kind: Type of the collection ("calendar#settings").
975
Kind string `json:"kind,omitempty"`
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"`
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
986
NextSyncToken string `json:"nextSyncToken,omitempty"`
989
type TimePeriod struct {
990
// End: The (exclusive) end of the time period.
991
End string `json:"end,omitempty"`
993
// Start: The (inclusive) start of the time period.
994
Start string `json:"start,omitempty"`
997
// method id "calendar.acl.delete":
999
type AclDeleteCall struct {
1003
opt_ map[string]interface{}
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
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)
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))
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,
1036
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1037
res, err := c.s.client.Do(req)
1041
defer googleapi.CloseBody(res)
1042
if err := googleapi.CheckResponse(res); err != nil {
1047
// "description": "Deletes an access control rule.",
1048
// "httpMethod": "DELETE",
1049
// "id": "calendar.acl.delete",
1050
// "parameterOrder": [
1056
// "description": "Calendar identifier.",
1057
// "location": "path",
1058
// "required": true,
1062
// "description": "ACL rule identifier.",
1063
// "location": "path",
1064
// "required": true,
1068
// "path": "calendars/{calendarId}/acl/{ruleId}",
1070
// "https://www.googleapis.com/auth/calendar"
1076
// method id "calendar.acl.get":
1078
type AclGetCall struct {
1082
opt_ map[string]interface{}
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
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)
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))
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,
1115
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1116
res, err := c.s.client.Do(req)
1120
defer googleapi.CloseBody(res)
1121
if err := googleapi.CheckResponse(res); err != nil {
1125
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1130
// "description": "Returns an access control rule.",
1131
// "httpMethod": "GET",
1132
// "id": "calendar.acl.get",
1133
// "parameterOrder": [
1139
// "description": "Calendar identifier.",
1140
// "location": "path",
1141
// "required": true,
1145
// "description": "ACL rule identifier.",
1146
// "location": "path",
1147
// "required": true,
1151
// "path": "calendars/{calendarId}/acl/{ruleId}",
1153
// "$ref": "AclRule"
1156
// "https://www.googleapis.com/auth/calendar",
1157
// "https://www.googleapis.com/auth/calendar.readonly"
1163
// method id "calendar.acl.insert":
1165
type AclInsertCall struct {
1169
opt_ map[string]interface{}
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
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)
1188
func (c *AclInsertCall) Do() (*AclRule, error) {
1189
var body io.Reader = nil
1190
body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
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))
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,
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)
1212
defer googleapi.CloseBody(res)
1213
if err := googleapi.CheckResponse(res); err != nil {
1217
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1222
// "description": "Creates an access control rule.",
1223
// "httpMethod": "POST",
1224
// "id": "calendar.acl.insert",
1225
// "parameterOrder": [
1230
// "description": "Calendar identifier.",
1231
// "location": "path",
1232
// "required": true,
1236
// "path": "calendars/{calendarId}/acl",
1238
// "$ref": "AclRule"
1241
// "$ref": "AclRule"
1244
// "https://www.googleapis.com/auth/calendar"
1250
// method id "calendar.acl.list":
1252
type AclListCall struct {
1255
opt_ map[string]interface{}
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
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
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
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
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.
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
1301
// The default is to return all entries.
1302
func (c *AclListCall) SyncToken(syncToken string) *AclListCall {
1303
c.opt_["syncToken"] = syncToken
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)
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))
1322
if v, ok := c.opt_["pageToken"]; ok {
1323
params.Set("pageToken", fmt.Sprintf("%v", v))
1325
if v, ok := c.opt_["showDeleted"]; ok {
1326
params.Set("showDeleted", fmt.Sprintf("%v", v))
1328
if v, ok := c.opt_["syncToken"]; ok {
1329
params.Set("syncToken", fmt.Sprintf("%v", v))
1331
if v, ok := c.opt_["fields"]; ok {
1332
params.Set("fields", fmt.Sprintf("%v", v))
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,
1340
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1341
res, err := c.s.client.Do(req)
1345
defer googleapi.CloseBody(res)
1346
if err := googleapi.CheckResponse(res); err != nil {
1350
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1355
// "description": "Returns the rules in the access control list for the calendar.",
1356
// "httpMethod": "GET",
1357
// "id": "calendar.acl.list",
1358
// "parameterOrder": [
1363
// "description": "Calendar identifier.",
1364
// "location": "path",
1365
// "required": true,
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",
1373
// "type": "integer"
1376
// "description": "Token specifying which result page to return. Optional.",
1377
// "location": "query",
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"
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",
1391
// "path": "calendars/{calendarId}/acl",
1396
// "https://www.googleapis.com/auth/calendar"
1398
// "supportsSubscription": true
1403
// method id "calendar.acl.patch":
1405
type AclPatchCall struct {
1410
opt_ map[string]interface{}
1413
// Patch: Updates an access control rule. This method supports patch
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
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)
1431
func (c *AclPatchCall) Do() (*AclRule, error) {
1432
var body io.Reader = nil
1433
body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
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))
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,
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)
1456
defer googleapi.CloseBody(res)
1457
if err := googleapi.CheckResponse(res); err != nil {
1461
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1466
// "description": "Updates an access control rule. This method supports patch semantics.",
1467
// "httpMethod": "PATCH",
1468
// "id": "calendar.acl.patch",
1469
// "parameterOrder": [
1475
// "description": "Calendar identifier.",
1476
// "location": "path",
1477
// "required": true,
1481
// "description": "ACL rule identifier.",
1482
// "location": "path",
1483
// "required": true,
1487
// "path": "calendars/{calendarId}/acl/{ruleId}",
1489
// "$ref": "AclRule"
1492
// "$ref": "AclRule"
1495
// "https://www.googleapis.com/auth/calendar"
1501
// method id "calendar.acl.update":
1503
type AclUpdateCall struct {
1508
opt_ map[string]interface{}
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
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)
1528
func (c *AclUpdateCall) Do() (*AclRule, error) {
1529
var body io.Reader = nil
1530
body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
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))
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,
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)
1553
defer googleapi.CloseBody(res)
1554
if err := googleapi.CheckResponse(res); err != nil {
1558
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1563
// "description": "Updates an access control rule.",
1564
// "httpMethod": "PUT",
1565
// "id": "calendar.acl.update",
1566
// "parameterOrder": [
1572
// "description": "Calendar identifier.",
1573
// "location": "path",
1574
// "required": true,
1578
// "description": "ACL rule identifier.",
1579
// "location": "path",
1580
// "required": true,
1584
// "path": "calendars/{calendarId}/acl/{ruleId}",
1586
// "$ref": "AclRule"
1589
// "$ref": "AclRule"
1592
// "https://www.googleapis.com/auth/calendar"
1598
// method id "calendar.acl.watch":
1600
type AclWatchCall struct {
1604
opt_ map[string]interface{}
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
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
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
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
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.
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
1651
// The default is to return all entries.
1652
func (c *AclWatchCall) SyncToken(syncToken string) *AclWatchCall {
1653
c.opt_["syncToken"] = syncToken
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)
1665
func (c *AclWatchCall) Do() (*Channel, error) {
1666
var body io.Reader = nil
1667
body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
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))
1677
if v, ok := c.opt_["pageToken"]; ok {
1678
params.Set("pageToken", fmt.Sprintf("%v", v))
1680
if v, ok := c.opt_["showDeleted"]; ok {
1681
params.Set("showDeleted", fmt.Sprintf("%v", v))
1683
if v, ok := c.opt_["syncToken"]; ok {
1684
params.Set("syncToken", fmt.Sprintf("%v", v))
1686
if v, ok := c.opt_["fields"]; ok {
1687
params.Set("fields", fmt.Sprintf("%v", v))
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,
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)
1701
defer googleapi.CloseBody(res)
1702
if err := googleapi.CheckResponse(res); err != nil {
1706
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1711
// "description": "Watch for changes to ACL resources.",
1712
// "httpMethod": "POST",
1713
// "id": "calendar.acl.watch",
1714
// "parameterOrder": [
1719
// "description": "Calendar identifier.",
1720
// "location": "path",
1721
// "required": true,
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",
1729
// "type": "integer"
1732
// "description": "Token specifying which result page to return. Optional.",
1733
// "location": "query",
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"
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",
1747
// "path": "calendars/{calendarId}/acl/watch",
1749
// "$ref": "Channel",
1750
// "parameterName": "resource"
1753
// "$ref": "Channel"
1756
// "https://www.googleapis.com/auth/calendar"
1758
// "supportsSubscription": true
1763
// method id "calendar.calendarList.delete":
1765
type CalendarListDeleteCall struct {
1768
opt_ map[string]interface{}
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
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)
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))
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,
1799
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1800
res, err := c.s.client.Do(req)
1804
defer googleapi.CloseBody(res)
1805
if err := googleapi.CheckResponse(res); err != nil {
1810
// "description": "Deletes an entry on the user's calendar list.",
1811
// "httpMethod": "DELETE",
1812
// "id": "calendar.calendarList.delete",
1813
// "parameterOrder": [
1818
// "description": "Calendar identifier.",
1819
// "location": "path",
1820
// "required": true,
1824
// "path": "users/me/calendarList/{calendarId}",
1826
// "https://www.googleapis.com/auth/calendar"
1832
// method id "calendar.calendarList.get":
1834
type CalendarListGetCall struct {
1837
opt_ map[string]interface{}
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
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)
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))
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,
1868
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1869
res, err := c.s.client.Do(req)
1873
defer googleapi.CloseBody(res)
1874
if err := googleapi.CheckResponse(res); err != nil {
1877
var ret *CalendarListEntry
1878
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1883
// "description": "Returns an entry on the user's calendar list.",
1884
// "httpMethod": "GET",
1885
// "id": "calendar.calendarList.get",
1886
// "parameterOrder": [
1891
// "description": "Calendar identifier.",
1892
// "location": "path",
1893
// "required": true,
1897
// "path": "users/me/calendarList/{calendarId}",
1899
// "$ref": "CalendarListEntry"
1902
// "https://www.googleapis.com/auth/calendar",
1903
// "https://www.googleapis.com/auth/calendar.readonly"
1909
// method id "calendar.calendarList.insert":
1911
type CalendarListInsertCall struct {
1913
calendarlistentry *CalendarListEntry
1914
opt_ map[string]interface{}
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
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
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)
1942
func (c *CalendarListInsertCall) Do() (*CalendarListEntry, error) {
1943
var body io.Reader = nil
1944
body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
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))
1954
if v, ok := c.opt_["fields"]; ok {
1955
params.Set("fields", fmt.Sprintf("%v", v))
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)
1967
defer googleapi.CloseBody(res)
1968
if err := googleapi.CheckResponse(res); err != nil {
1971
var ret *CalendarListEntry
1972
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1977
// "description": "Adds an entry to the user's calendar list.",
1978
// "httpMethod": "POST",
1979
// "id": "calendar.calendarList.insert",
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"
1987
// "path": "users/me/calendarList",
1989
// "$ref": "CalendarListEntry"
1992
// "$ref": "CalendarListEntry"
1995
// "https://www.googleapis.com/auth/calendar"
2001
// method id "calendar.calendarList.list":
2003
type CalendarListListCall struct {
2005
opt_ map[string]interface{}
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{})}
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
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
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
2037
// ShowDeleted sets the optional parameter "showDeleted": Whether to
2038
// include deleted calendar list entries in the result. The default is
2040
func (c *CalendarListListCall) ShowDeleted(showDeleted bool) *CalendarListListCall {
2041
c.opt_["showDeleted"] = showDeleted
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
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.
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
2067
// Learn more about incremental synchronization.
2069
// default is to return all entries.
2070
func (c *CalendarListListCall) SyncToken(syncToken string) *CalendarListListCall {
2071
c.opt_["syncToken"] = syncToken
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)
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))
2090
if v, ok := c.opt_["minAccessRole"]; ok {
2091
params.Set("minAccessRole", fmt.Sprintf("%v", v))
2093
if v, ok := c.opt_["pageToken"]; ok {
2094
params.Set("pageToken", fmt.Sprintf("%v", v))
2096
if v, ok := c.opt_["showDeleted"]; ok {
2097
params.Set("showDeleted", fmt.Sprintf("%v", v))
2099
if v, ok := c.opt_["showHidden"]; ok {
2100
params.Set("showHidden", fmt.Sprintf("%v", v))
2102
if v, ok := c.opt_["syncToken"]; ok {
2103
params.Set("syncToken", fmt.Sprintf("%v", v))
2105
if v, ok := c.opt_["fields"]; ok {
2106
params.Set("fields", fmt.Sprintf("%v", v))
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)
2117
defer googleapi.CloseBody(res)
2118
if err := googleapi.CheckResponse(res); err != nil {
2121
var ret *CalendarList
2122
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2127
// "description": "Returns entries on the user's calendar list.",
2128
// "httpMethod": "GET",
2129
// "id": "calendar.calendarList.list",
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",
2136
// "type": "integer"
2138
// "minAccessRole": {
2139
// "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.",
2141
// "freeBusyReader",
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."
2152
// "location": "query",
2156
// "description": "Token specifying which result page to return. Optional.",
2157
// "location": "query",
2161
// "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.",
2162
// "location": "query",
2163
// "type": "boolean"
2166
// "description": "Whether to show hidden entries. Optional. The default is False.",
2167
// "location": "query",
2168
// "type": "boolean"
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",
2176
// "path": "users/me/calendarList",
2178
// "$ref": "CalendarList"
2181
// "https://www.googleapis.com/auth/calendar",
2182
// "https://www.googleapis.com/auth/calendar.readonly"
2184
// "supportsSubscription": true
2189
// method id "calendar.calendarList.patch":
2191
type CalendarListPatchCall struct {
2194
calendarlistentry *CalendarListEntry
2195
opt_ map[string]interface{}
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
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
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)
2225
func (c *CalendarListPatchCall) Do() (*CalendarListEntry, error) {
2226
var body io.Reader = nil
2227
body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
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))
2237
if v, ok := c.opt_["fields"]; ok {
2238
params.Set("fields", fmt.Sprintf("%v", v))
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,
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)
2252
defer googleapi.CloseBody(res)
2253
if err := googleapi.CheckResponse(res); err != nil {
2256
var ret *CalendarListEntry
2257
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
2270
// "description": "Calendar identifier.",
2271
// "location": "path",
2272
// "required": true,
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"
2281
// "path": "users/me/calendarList/{calendarId}",
2283
// "$ref": "CalendarListEntry"
2286
// "$ref": "CalendarListEntry"
2289
// "https://www.googleapis.com/auth/calendar"
2295
// method id "calendar.calendarList.update":
2297
type CalendarListUpdateCall struct {
2300
calendarlistentry *CalendarListEntry
2301
opt_ map[string]interface{}
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
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
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)
2330
func (c *CalendarListUpdateCall) Do() (*CalendarListEntry, error) {
2331
var body io.Reader = nil
2332
body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
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))
2342
if v, ok := c.opt_["fields"]; ok {
2343
params.Set("fields", fmt.Sprintf("%v", v))
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,
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)
2357
defer googleapi.CloseBody(res)
2358
if err := googleapi.CheckResponse(res); err != nil {
2361
var ret *CalendarListEntry
2362
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2367
// "description": "Updates an entry on the user's calendar list.",
2368
// "httpMethod": "PUT",
2369
// "id": "calendar.calendarList.update",
2370
// "parameterOrder": [
2375
// "description": "Calendar identifier.",
2376
// "location": "path",
2377
// "required": true,
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"
2386
// "path": "users/me/calendarList/{calendarId}",
2388
// "$ref": "CalendarListEntry"
2391
// "$ref": "CalendarListEntry"
2394
// "https://www.googleapis.com/auth/calendar"
2400
// method id "calendar.calendarList.watch":
2402
type CalendarListWatchCall struct {
2405
opt_ map[string]interface{}
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{})}
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
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
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
2438
// ShowDeleted sets the optional parameter "showDeleted": Whether to
2439
// include deleted calendar list entries in the result. The default is
2441
func (c *CalendarListWatchCall) ShowDeleted(showDeleted bool) *CalendarListWatchCall {
2442
c.opt_["showDeleted"] = showDeleted
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
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.
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
2468
// Learn more about incremental synchronization.
2470
// default is to return all entries.
2471
func (c *CalendarListWatchCall) SyncToken(syncToken string) *CalendarListWatchCall {
2472
c.opt_["syncToken"] = syncToken
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)
2484
func (c *CalendarListWatchCall) Do() (*Channel, error) {
2485
var body io.Reader = nil
2486
body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
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))
2496
if v, ok := c.opt_["minAccessRole"]; ok {
2497
params.Set("minAccessRole", fmt.Sprintf("%v", v))
2499
if v, ok := c.opt_["pageToken"]; ok {
2500
params.Set("pageToken", fmt.Sprintf("%v", v))
2502
if v, ok := c.opt_["showDeleted"]; ok {
2503
params.Set("showDeleted", fmt.Sprintf("%v", v))
2505
if v, ok := c.opt_["showHidden"]; ok {
2506
params.Set("showHidden", fmt.Sprintf("%v", v))
2508
if v, ok := c.opt_["syncToken"]; ok {
2509
params.Set("syncToken", fmt.Sprintf("%v", v))
2511
if v, ok := c.opt_["fields"]; ok {
2512
params.Set("fields", fmt.Sprintf("%v", v))
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)
2524
defer googleapi.CloseBody(res)
2525
if err := googleapi.CheckResponse(res); err != nil {
2529
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2534
// "description": "Watch for changes to CalendarList resources.",
2535
// "httpMethod": "POST",
2536
// "id": "calendar.calendarList.watch",
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",
2543
// "type": "integer"
2545
// "minAccessRole": {
2546
// "description": "The minimum access role for the user in the returned entires. Optional. The default is no restriction.",
2548
// "freeBusyReader",
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."
2559
// "location": "query",
2563
// "description": "Token specifying which result page to return. Optional.",
2564
// "location": "query",
2568
// "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.",
2569
// "location": "query",
2570
// "type": "boolean"
2573
// "description": "Whether to show hidden entries. Optional. The default is False.",
2574
// "location": "query",
2575
// "type": "boolean"
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",
2583
// "path": "users/me/calendarList/watch",
2585
// "$ref": "Channel",
2586
// "parameterName": "resource"
2589
// "$ref": "Channel"
2592
// "https://www.googleapis.com/auth/calendar",
2593
// "https://www.googleapis.com/auth/calendar.readonly"
2595
// "supportsSubscription": true
2600
// method id "calendar.calendars.clear":
2602
type CalendarsClearCall struct {
2605
opt_ map[string]interface{}
2608
// Clear: Clears a primary calendar. This operation deletes all data
2609
// associated with the primary calendar of an account and cannot be
2611
func (r *CalendarsService) Clear(calendarId string) *CalendarsClearCall {
2612
c := &CalendarsClearCall{s: r.s, opt_: make(map[string]interface{})}
2613
c.calendarId = calendarId
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)
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))
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,
2638
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2639
res, err := c.s.client.Do(req)
2643
defer googleapi.CloseBody(res)
2644
if err := googleapi.CheckResponse(res); err != nil {
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": [
2657
// "description": "Calendar identifier.",
2658
// "location": "path",
2659
// "required": true,
2663
// "path": "calendars/{calendarId}/clear",
2665
// "https://www.googleapis.com/auth/calendar"
2671
// method id "calendar.calendars.delete":
2673
type CalendarsDeleteCall struct {
2676
opt_ map[string]interface{}
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
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)
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))
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,
2707
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2708
res, err := c.s.client.Do(req)
2712
defer googleapi.CloseBody(res)
2713
if err := googleapi.CheckResponse(res); err != nil {
2718
// "description": "Deletes a secondary calendar.",
2719
// "httpMethod": "DELETE",
2720
// "id": "calendar.calendars.delete",
2721
// "parameterOrder": [
2726
// "description": "Calendar identifier.",
2727
// "location": "path",
2728
// "required": true,
2732
// "path": "calendars/{calendarId}",
2734
// "https://www.googleapis.com/auth/calendar"
2740
// method id "calendar.calendars.get":
2742
type CalendarsGetCall struct {
2745
opt_ map[string]interface{}
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
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)
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))
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,
2776
req.Header.Set("User-Agent", "google-api-go-client/0.5")
2777
res, err := c.s.client.Do(req)
2781
defer googleapi.CloseBody(res)
2782
if err := googleapi.CheckResponse(res); err != nil {
2786
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2791
// "description": "Returns metadata for a calendar.",
2792
// "httpMethod": "GET",
2793
// "id": "calendar.calendars.get",
2794
// "parameterOrder": [
2799
// "description": "Calendar identifier.",
2800
// "location": "path",
2801
// "required": true,
2805
// "path": "calendars/{calendarId}",
2807
// "$ref": "Calendar"
2810
// "https://www.googleapis.com/auth/calendar",
2811
// "https://www.googleapis.com/auth/calendar.readonly"
2817
// method id "calendar.calendars.insert":
2819
type CalendarsInsertCall struct {
2822
opt_ map[string]interface{}
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
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)
2840
func (c *CalendarsInsertCall) Do() (*Calendar, error) {
2841
var body io.Reader = nil
2842
body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
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))
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)
2862
defer googleapi.CloseBody(res)
2863
if err := googleapi.CheckResponse(res); err != nil {
2867
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2872
// "description": "Creates a secondary calendar.",
2873
// "httpMethod": "POST",
2874
// "id": "calendar.calendars.insert",
2875
// "path": "calendars",
2877
// "$ref": "Calendar"
2880
// "$ref": "Calendar"
2883
// "https://www.googleapis.com/auth/calendar"
2889
// method id "calendar.calendars.patch":
2891
type CalendarsPatchCall struct {
2895
opt_ map[string]interface{}
2898
// Patch: Updates metadata for a calendar. This method supports patch
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
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)
2915
func (c *CalendarsPatchCall) Do() (*Calendar, error) {
2916
var body io.Reader = nil
2917
body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
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))
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,
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)
2939
defer googleapi.CloseBody(res)
2940
if err := googleapi.CheckResponse(res); err != nil {
2944
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2949
// "description": "Updates metadata for a calendar. This method supports patch semantics.",
2950
// "httpMethod": "PATCH",
2951
// "id": "calendar.calendars.patch",
2952
// "parameterOrder": [
2957
// "description": "Calendar identifier.",
2958
// "location": "path",
2959
// "required": true,
2963
// "path": "calendars/{calendarId}",
2965
// "$ref": "Calendar"
2968
// "$ref": "Calendar"
2971
// "https://www.googleapis.com/auth/calendar"
2977
// method id "calendar.calendars.update":
2979
type CalendarsUpdateCall struct {
2983
opt_ map[string]interface{}
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
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)
3002
func (c *CalendarsUpdateCall) Do() (*Calendar, error) {
3003
var body io.Reader = nil
3004
body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
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))
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,
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)
3026
defer googleapi.CloseBody(res)
3027
if err := googleapi.CheckResponse(res); err != nil {
3031
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3036
// "description": "Updates metadata for a calendar.",
3037
// "httpMethod": "PUT",
3038
// "id": "calendar.calendars.update",
3039
// "parameterOrder": [
3044
// "description": "Calendar identifier.",
3045
// "location": "path",
3046
// "required": true,
3050
// "path": "calendars/{calendarId}",
3052
// "$ref": "Calendar"
3055
// "$ref": "Calendar"
3058
// "https://www.googleapis.com/auth/calendar"
3064
// method id "calendar.channels.stop":
3066
type ChannelsStopCall struct {
3069
opt_ map[string]interface{}
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{})}
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)
3087
func (c *ChannelsStopCall) Do() error {
3088
var body io.Reader = nil
3089
body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
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))
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)
3109
defer googleapi.CloseBody(res)
3110
if err := googleapi.CheckResponse(res); err != nil {
3115
// "description": "Stop watching resources through this channel",
3116
// "httpMethod": "POST",
3117
// "id": "calendar.channels.stop",
3118
// "path": "channels/stop",
3120
// "$ref": "Channel",
3121
// "parameterName": "resource"
3124
// "https://www.googleapis.com/auth/calendar",
3125
// "https://www.googleapis.com/auth/calendar.readonly"
3131
// method id "calendar.colors.get":
3133
type ColorsGetCall struct {
3135
opt_ map[string]interface{}
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{})}
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)
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))
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)
3168
defer googleapi.CloseBody(res)
3169
if err := googleapi.CheckResponse(res); err != nil {
3173
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3178
// "description": "Returns the color definitions for calendars and events.",
3179
// "httpMethod": "GET",
3180
// "id": "calendar.colors.get",
3181
// "path": "colors",
3186
// "https://www.googleapis.com/auth/calendar",
3187
// "https://www.googleapis.com/auth/calendar.readonly"
3193
// method id "calendar.events.delete":
3195
type EventsDeleteCall struct {
3199
opt_ map[string]interface{}
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
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
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)
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))
3233
if v, ok := c.opt_["fields"]; ok {
3234
params.Set("fields", fmt.Sprintf("%v", v))
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,
3243
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3244
res, err := c.s.client.Do(req)
3248
defer googleapi.CloseBody(res)
3249
if err := googleapi.CheckResponse(res); err != nil {
3254
// "description": "Deletes an event.",
3255
// "httpMethod": "DELETE",
3256
// "id": "calendar.events.delete",
3257
// "parameterOrder": [
3263
// "description": "Calendar identifier.",
3264
// "location": "path",
3265
// "required": true,
3269
// "description": "Event identifier.",
3270
// "location": "path",
3271
// "required": true,
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"
3280
// "path": "calendars/{calendarId}/events/{eventId}",
3282
// "https://www.googleapis.com/auth/calendar"
3288
// method id "calendar.events.get":
3290
type EventsGetCall struct {
3294
opt_ map[string]interface{}
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
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
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
3321
func (c *EventsGetCall) MaxAttendees(maxAttendees int64) *EventsGetCall {
3322
c.opt_["maxAttendees"] = maxAttendees
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
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)
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))
3348
if v, ok := c.opt_["maxAttendees"]; ok {
3349
params.Set("maxAttendees", fmt.Sprintf("%v", v))
3351
if v, ok := c.opt_["timeZone"]; ok {
3352
params.Set("timeZone", fmt.Sprintf("%v", v))
3354
if v, ok := c.opt_["fields"]; ok {
3355
params.Set("fields", fmt.Sprintf("%v", v))
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,
3364
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3365
res, err := c.s.client.Do(req)
3369
defer googleapi.CloseBody(res)
3370
if err := googleapi.CheckResponse(res); err != nil {
3374
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3379
// "description": "Returns an event.",
3380
// "httpMethod": "GET",
3381
// "id": "calendar.events.get",
3382
// "parameterOrder": [
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"
3393
// "description": "Calendar identifier.",
3394
// "location": "path",
3395
// "required": true,
3399
// "description": "Event identifier.",
3400
// "location": "path",
3401
// "required": true,
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",
3409
// "type": "integer"
3412
// "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
3413
// "location": "query",
3417
// "path": "calendars/{calendarId}/events/{eventId}",
3422
// "https://www.googleapis.com/auth/calendar",
3423
// "https://www.googleapis.com/auth/calendar.readonly"
3429
// method id "calendar.events.import":
3431
type EventsImportCall struct {
3435
opt_ map[string]interface{}
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
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)
3455
func (c *EventsImportCall) Do() (*Event, error) {
3456
var body io.Reader = nil
3457
body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
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))
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,
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)
3479
defer googleapi.CloseBody(res)
3480
if err := googleapi.CheckResponse(res); err != nil {
3484
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
3497
// "description": "Calendar identifier.",
3498
// "location": "path",
3499
// "required": true,
3503
// "path": "calendars/{calendarId}/events/import",
3511
// "https://www.googleapis.com/auth/calendar"
3517
// method id "calendar.events.insert":
3519
type EventsInsertCall struct {
3523
opt_ map[string]interface{}
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
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
3538
func (c *EventsInsertCall) MaxAttendees(maxAttendees int64) *EventsInsertCall {
3539
c.opt_["maxAttendees"] = maxAttendees
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
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)
3559
func (c *EventsInsertCall) Do() (*Event, error) {
3560
var body io.Reader = nil
3561
body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
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))
3571
if v, ok := c.opt_["sendNotifications"]; ok {
3572
params.Set("sendNotifications", fmt.Sprintf("%v", v))
3574
if v, ok := c.opt_["fields"]; ok {
3575
params.Set("fields", fmt.Sprintf("%v", v))
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,
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)
3589
defer googleapi.CloseBody(res)
3590
if err := googleapi.CheckResponse(res); err != nil {
3594
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3599
// "description": "Creates an event.",
3600
// "httpMethod": "POST",
3601
// "id": "calendar.events.insert",
3602
// "parameterOrder": [
3607
// "description": "Calendar identifier.",
3608
// "location": "path",
3609
// "required": true,
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",
3617
// "type": "integer"
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"
3625
// "path": "calendars/{calendarId}/events",
3633
// "https://www.googleapis.com/auth/calendar"
3639
// method id "calendar.events.instances":
3641
type EventsInstancesCall struct {
3645
opt_ map[string]interface{}
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
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
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
3672
func (c *EventsInstancesCall) MaxAttendees(maxAttendees int64) *EventsInstancesCall {
3673
c.opt_["maxAttendees"] = maxAttendees
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
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
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
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
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
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
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
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)
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))
3746
if v, ok := c.opt_["maxAttendees"]; ok {
3747
params.Set("maxAttendees", fmt.Sprintf("%v", v))
3749
if v, ok := c.opt_["maxResults"]; ok {
3750
params.Set("maxResults", fmt.Sprintf("%v", v))
3752
if v, ok := c.opt_["originalStart"]; ok {
3753
params.Set("originalStart", fmt.Sprintf("%v", v))
3755
if v, ok := c.opt_["pageToken"]; ok {
3756
params.Set("pageToken", fmt.Sprintf("%v", v))
3758
if v, ok := c.opt_["showDeleted"]; ok {
3759
params.Set("showDeleted", fmt.Sprintf("%v", v))
3761
if v, ok := c.opt_["timeMax"]; ok {
3762
params.Set("timeMax", fmt.Sprintf("%v", v))
3764
if v, ok := c.opt_["timeMin"]; ok {
3765
params.Set("timeMin", fmt.Sprintf("%v", v))
3767
if v, ok := c.opt_["timeZone"]; ok {
3768
params.Set("timeZone", fmt.Sprintf("%v", v))
3770
if v, ok := c.opt_["fields"]; ok {
3771
params.Set("fields", fmt.Sprintf("%v", v))
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,
3780
req.Header.Set("User-Agent", "google-api-go-client/0.5")
3781
res, err := c.s.client.Do(req)
3785
defer googleapi.CloseBody(res)
3786
if err := googleapi.CheckResponse(res); err != nil {
3790
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3795
// "description": "Returns instances of the specified recurring event.",
3796
// "httpMethod": "GET",
3797
// "id": "calendar.events.instances",
3798
// "parameterOrder": [
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"
3809
// "description": "Calendar identifier.",
3810
// "location": "path",
3811
// "required": true,
3815
// "description": "Recurring event identifier.",
3816
// "location": "path",
3817
// "required": true,
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",
3825
// "type": "integer"
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",
3832
// "type": "integer"
3834
// "originalStart": {
3835
// "description": "The original start time of the instance in the result. Optional.",
3836
// "location": "query",
3840
// "description": "Token specifying which result page to return. Optional.",
3841
// "location": "query",
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"
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",
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",
3862
// "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
3863
// "location": "query",
3867
// "path": "calendars/{calendarId}/events/{eventId}/instances",
3872
// "https://www.googleapis.com/auth/calendar",
3873
// "https://www.googleapis.com/auth/calendar.readonly"
3875
// "supportsSubscription": true
3880
// method id "calendar.events.list":
3882
type EventsListCall struct {
3885
opt_ map[string]interface{}
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
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
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
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
3918
func (c *EventsListCall) MaxAttendees(maxAttendees int64) *EventsListCall {
3919
c.opt_["maxAttendees"] = maxAttendees
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
3931
// OrderBy sets the optional parameter "orderBy": The order of the
3932
// events returned in the result. The default is an unspecified, stable
3934
func (c *EventsListCall) OrderBy(orderBy string) *EventsListCall {
3935
c.opt_["orderBy"] = orderBy
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
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
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
3959
func (c *EventsListCall) Q(q string) *EventsListCall {
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
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
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
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
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.
4010
// several query parameters that cannot be specified together with
4011
// nextSyncToken to ensure consistency of the client state.
4017
// - privateExtendedProperty
4020
// sharedExtendedProperty
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
4029
// The default is to return all entries.
4030
func (c *EventsListCall) SyncToken(syncToken string) *EventsListCall {
4031
c.opt_["syncToken"] = syncToken
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
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
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
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
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)
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))
4083
if v, ok := c.opt_["iCalUID"]; ok {
4084
params.Set("iCalUID", fmt.Sprintf("%v", v))
4086
if v, ok := c.opt_["maxAttendees"]; ok {
4087
params.Set("maxAttendees", fmt.Sprintf("%v", v))
4089
if v, ok := c.opt_["maxResults"]; ok {
4090
params.Set("maxResults", fmt.Sprintf("%v", v))
4092
if v, ok := c.opt_["orderBy"]; ok {
4093
params.Set("orderBy", fmt.Sprintf("%v", v))
4095
if v, ok := c.opt_["pageToken"]; ok {
4096
params.Set("pageToken", fmt.Sprintf("%v", v))
4098
if v, ok := c.opt_["privateExtendedProperty"]; ok {
4099
params.Set("privateExtendedProperty", fmt.Sprintf("%v", v))
4101
if v, ok := c.opt_["q"]; ok {
4102
params.Set("q", fmt.Sprintf("%v", v))
4104
if v, ok := c.opt_["sharedExtendedProperty"]; ok {
4105
params.Set("sharedExtendedProperty", fmt.Sprintf("%v", v))
4107
if v, ok := c.opt_["showDeleted"]; ok {
4108
params.Set("showDeleted", fmt.Sprintf("%v", v))
4110
if v, ok := c.opt_["showHiddenInvitations"]; ok {
4111
params.Set("showHiddenInvitations", fmt.Sprintf("%v", v))
4113
if v, ok := c.opt_["singleEvents"]; ok {
4114
params.Set("singleEvents", fmt.Sprintf("%v", v))
4116
if v, ok := c.opt_["syncToken"]; ok {
4117
params.Set("syncToken", fmt.Sprintf("%v", v))
4119
if v, ok := c.opt_["timeMax"]; ok {
4120
params.Set("timeMax", fmt.Sprintf("%v", v))
4122
if v, ok := c.opt_["timeMin"]; ok {
4123
params.Set("timeMin", fmt.Sprintf("%v", v))
4125
if v, ok := c.opt_["timeZone"]; ok {
4126
params.Set("timeZone", fmt.Sprintf("%v", v))
4128
if v, ok := c.opt_["updatedMin"]; ok {
4129
params.Set("updatedMin", fmt.Sprintf("%v", v))
4131
if v, ok := c.opt_["fields"]; ok {
4132
params.Set("fields", fmt.Sprintf("%v", v))
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,
4140
req.Header.Set("User-Agent", "google-api-go-client/0.5")
4141
res, err := c.s.client.Do(req)
4145
defer googleapi.CloseBody(res)
4146
if err := googleapi.CheckResponse(res); err != nil {
4150
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4155
// "description": "Returns events on the specified calendar.",
4156
// "httpMethod": "GET",
4157
// "id": "calendar.events.list",
4158
// "parameterOrder": [
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"
4168
// "description": "Calendar identifier.",
4169
// "location": "path",
4170
// "required": true,
4174
// "description": "Specifies event ID in the iCalendar format to be included in the response. Optional.",
4175
// "location": "query",
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",
4183
// "type": "integer"
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",
4190
// "type": "integer"
4193
// "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.",
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)."
4202
// "location": "query",
4206
// "description": "Token specifying which result page to return. Optional.",
4207
// "location": "query",
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,
4217
// "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.",
4218
// "location": "query",
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,
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"
4232
// "showHiddenInvitations": {
4233
// "description": "Whether to include hidden invitations in the result. Optional. The default is False.",
4234
// "location": "query",
4235
// "type": "boolean"
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"
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",
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",
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",
4260
// "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
4261
// "location": "query",
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",
4271
// "path": "calendars/{calendarId}/events",
4276
// "https://www.googleapis.com/auth/calendar",
4277
// "https://www.googleapis.com/auth/calendar.readonly"
4279
// "supportsSubscription": true
4284
// method id "calendar.events.move":
4286
type EventsMoveCall struct {
4290
destinationid string
4291
opt_ map[string]interface{}
4294
// Move: Moves an event to another calendar, i.e. changes an event's
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
4300
c.destinationid = destinationid
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
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)
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))
4328
if v, ok := c.opt_["fields"]; ok {
4329
params.Set("fields", fmt.Sprintf("%v", v))
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,
4338
req.Header.Set("User-Agent", "google-api-go-client/0.5")
4339
res, err := c.s.client.Do(req)
4343
defer googleapi.CloseBody(res)
4344
if err := googleapi.CheckResponse(res); err != nil {
4348
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
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": [
4363
// "description": "Calendar identifier of the source calendar where the event currently is on.",
4364
// "location": "path",
4365
// "required": true,
4369
// "description": "Calendar identifier of the target calendar where the event is to be moved to.",
4370
// "location": "query",
4371
// "required": true,
4375
// "description": "Event identifier.",
4376
// "location": "path",
4377
// "required": true,
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"
4386
// "path": "calendars/{calendarId}/events/{eventId}/move",
4391
// "https://www.googleapis.com/auth/calendar"
4397
// method id "calendar.events.patch":
4399
type EventsPatchCall struct {
4404
opt_ map[string]interface{}
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
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
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
4432
func (c *EventsPatchCall) MaxAttendees(maxAttendees int64) *EventsPatchCall {
4433
c.opt_["maxAttendees"] = maxAttendees
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
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)
4453
func (c *EventsPatchCall) Do() (*Event, error) {
4454
var body io.Reader = nil
4455
body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
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))
4465
if v, ok := c.opt_["maxAttendees"]; ok {
4466
params.Set("maxAttendees", fmt.Sprintf("%v", v))
4468
if v, ok := c.opt_["sendNotifications"]; ok {
4469
params.Set("sendNotifications", fmt.Sprintf("%v", v))
4471
if v, ok := c.opt_["fields"]; ok {
4472
params.Set("fields", fmt.Sprintf("%v", v))
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,
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)
4487
defer googleapi.CloseBody(res)
4488
if err := googleapi.CheckResponse(res); err != nil {
4492
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4497
// "description": "Updates an event. This method supports patch semantics.",
4498
// "httpMethod": "PATCH",
4499
// "id": "calendar.events.patch",
4500
// "parameterOrder": [
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"
4511
// "description": "Calendar identifier.",
4512
// "location": "path",
4513
// "required": true,
4517
// "description": "Event identifier.",
4518
// "location": "path",
4519
// "required": true,
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",
4527
// "type": "integer"
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"
4535
// "path": "calendars/{calendarId}/events/{eventId}",
4543
// "https://www.googleapis.com/auth/calendar"
4549
// method id "calendar.events.quickAdd":
4551
type EventsQuickAddCall struct {
4555
opt_ map[string]interface{}
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
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
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)
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))
4590
if v, ok := c.opt_["fields"]; ok {
4591
params.Set("fields", fmt.Sprintf("%v", v))
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,
4599
req.Header.Set("User-Agent", "google-api-go-client/0.5")
4600
res, err := c.s.client.Do(req)
4604
defer googleapi.CloseBody(res)
4605
if err := googleapi.CheckResponse(res); err != nil {
4609
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4614
// "description": "Creates an event based on a simple text string.",
4615
// "httpMethod": "POST",
4616
// "id": "calendar.events.quickAdd",
4617
// "parameterOrder": [
4623
// "description": "Calendar identifier.",
4624
// "location": "path",
4625
// "required": true,
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"
4634
// "description": "The text describing the event to be created.",
4635
// "location": "query",
4636
// "required": true,
4640
// "path": "calendars/{calendarId}/events/quickAdd",
4645
// "https://www.googleapis.com/auth/calendar"
4651
// method id "calendar.events.update":
4653
type EventsUpdateCall struct {
4658
opt_ map[string]interface{}
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
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
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
4686
func (c *EventsUpdateCall) MaxAttendees(maxAttendees int64) *EventsUpdateCall {
4687
c.opt_["maxAttendees"] = maxAttendees
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
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)
4707
func (c *EventsUpdateCall) Do() (*Event, error) {
4708
var body io.Reader = nil
4709
body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
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))
4719
if v, ok := c.opt_["maxAttendees"]; ok {
4720
params.Set("maxAttendees", fmt.Sprintf("%v", v))
4722
if v, ok := c.opt_["sendNotifications"]; ok {
4723
params.Set("sendNotifications", fmt.Sprintf("%v", v))
4725
if v, ok := c.opt_["fields"]; ok {
4726
params.Set("fields", fmt.Sprintf("%v", v))
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,
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)
4741
defer googleapi.CloseBody(res)
4742
if err := googleapi.CheckResponse(res); err != nil {
4746
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
4751
// "description": "Updates an event.",
4752
// "httpMethod": "PUT",
4753
// "id": "calendar.events.update",
4754
// "parameterOrder": [
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"
4765
// "description": "Calendar identifier.",
4766
// "location": "path",
4767
// "required": true,
4771
// "description": "Event identifier.",
4772
// "location": "path",
4773
// "required": true,
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",
4781
// "type": "integer"
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"
4789
// "path": "calendars/{calendarId}/events/{eventId}",
4797
// "https://www.googleapis.com/auth/calendar"
4803
// method id "calendar.events.watch":
4805
type EventsWatchCall struct {
4809
opt_ map[string]interface{}
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
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
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
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
4843
func (c *EventsWatchCall) MaxAttendees(maxAttendees int64) *EventsWatchCall {
4844
c.opt_["maxAttendees"] = maxAttendees
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
4856
// OrderBy sets the optional parameter "orderBy": The order of the
4857
// events returned in the result. The default is an unspecified, stable
4859
func (c *EventsWatchCall) OrderBy(orderBy string) *EventsWatchCall {
4860
c.opt_["orderBy"] = orderBy
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
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
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
4884
func (c *EventsWatchCall) Q(q string) *EventsWatchCall {
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
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
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
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
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.
4935
// several query parameters that cannot be specified together with
4936
// nextSyncToken to ensure consistency of the client state.
4942
// - privateExtendedProperty
4945
// sharedExtendedProperty
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
4954
// The default is to return all entries.
4955
func (c *EventsWatchCall) SyncToken(syncToken string) *EventsWatchCall {
4956
c.opt_["syncToken"] = syncToken
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
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
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
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
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)
5001
func (c *EventsWatchCall) Do() (*Channel, error) {
5002
var body io.Reader = nil
5003
body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
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))
5013
if v, ok := c.opt_["iCalUID"]; ok {
5014
params.Set("iCalUID", fmt.Sprintf("%v", v))
5016
if v, ok := c.opt_["maxAttendees"]; ok {
5017
params.Set("maxAttendees", fmt.Sprintf("%v", v))
5019
if v, ok := c.opt_["maxResults"]; ok {
5020
params.Set("maxResults", fmt.Sprintf("%v", v))
5022
if v, ok := c.opt_["orderBy"]; ok {
5023
params.Set("orderBy", fmt.Sprintf("%v", v))
5025
if v, ok := c.opt_["pageToken"]; ok {
5026
params.Set("pageToken", fmt.Sprintf("%v", v))
5028
if v, ok := c.opt_["privateExtendedProperty"]; ok {
5029
params.Set("privateExtendedProperty", fmt.Sprintf("%v", v))
5031
if v, ok := c.opt_["q"]; ok {
5032
params.Set("q", fmt.Sprintf("%v", v))
5034
if v, ok := c.opt_["sharedExtendedProperty"]; ok {
5035
params.Set("sharedExtendedProperty", fmt.Sprintf("%v", v))
5037
if v, ok := c.opt_["showDeleted"]; ok {
5038
params.Set("showDeleted", fmt.Sprintf("%v", v))
5040
if v, ok := c.opt_["showHiddenInvitations"]; ok {
5041
params.Set("showHiddenInvitations", fmt.Sprintf("%v", v))
5043
if v, ok := c.opt_["singleEvents"]; ok {
5044
params.Set("singleEvents", fmt.Sprintf("%v", v))
5046
if v, ok := c.opt_["syncToken"]; ok {
5047
params.Set("syncToken", fmt.Sprintf("%v", v))
5049
if v, ok := c.opt_["timeMax"]; ok {
5050
params.Set("timeMax", fmt.Sprintf("%v", v))
5052
if v, ok := c.opt_["timeMin"]; ok {
5053
params.Set("timeMin", fmt.Sprintf("%v", v))
5055
if v, ok := c.opt_["timeZone"]; ok {
5056
params.Set("timeZone", fmt.Sprintf("%v", v))
5058
if v, ok := c.opt_["updatedMin"]; ok {
5059
params.Set("updatedMin", fmt.Sprintf("%v", v))
5061
if v, ok := c.opt_["fields"]; ok {
5062
params.Set("fields", fmt.Sprintf("%v", v))
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,
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)
5076
defer googleapi.CloseBody(res)
5077
if err := googleapi.CheckResponse(res); err != nil {
5081
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5086
// "description": "Watch for changes to Events resources.",
5087
// "httpMethod": "POST",
5088
// "id": "calendar.events.watch",
5089
// "parameterOrder": [
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"
5099
// "description": "Calendar identifier.",
5100
// "location": "path",
5101
// "required": true,
5105
// "description": "Specifies event ID in the iCalendar format to be included in the response. Optional.",
5106
// "location": "query",
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",
5114
// "type": "integer"
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",
5121
// "type": "integer"
5124
// "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.",
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)."
5133
// "location": "query",
5137
// "description": "Token specifying which result page to return. Optional.",
5138
// "location": "query",
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,
5148
// "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.",
5149
// "location": "query",
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,
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"
5163
// "showHiddenInvitations": {
5164
// "description": "Whether to include hidden invitations in the result. Optional. The default is False.",
5165
// "location": "query",
5166
// "type": "boolean"
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"
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",
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",
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",
5191
// "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
5192
// "location": "query",
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",
5202
// "path": "calendars/{calendarId}/events/watch",
5204
// "$ref": "Channel",
5205
// "parameterName": "resource"
5208
// "$ref": "Channel"
5211
// "https://www.googleapis.com/auth/calendar",
5212
// "https://www.googleapis.com/auth/calendar.readonly"
5214
// "supportsSubscription": true
5219
// method id "calendar.freebusy.query":
5221
type FreebusyQueryCall struct {
5223
freebusyrequest *FreeBusyRequest
5224
opt_ map[string]interface{}
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
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)
5242
func (c *FreebusyQueryCall) Do() (*FreeBusyResponse, error) {
5243
var body io.Reader = nil
5244
body, err := googleapi.WithoutDataWrapper.JSONReader(c.freebusyrequest)
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))
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)
5264
defer googleapi.CloseBody(res)
5265
if err := googleapi.CheckResponse(res); err != nil {
5268
var ret *FreeBusyResponse
5269
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5274
// "description": "Returns free/busy information for a set of calendars.",
5275
// "httpMethod": "POST",
5276
// "id": "calendar.freebusy.query",
5277
// "path": "freeBusy",
5279
// "$ref": "FreeBusyRequest"
5282
// "$ref": "FreeBusyResponse"
5285
// "https://www.googleapis.com/auth/calendar",
5286
// "https://www.googleapis.com/auth/calendar.readonly"
5292
// method id "calendar.settings.get":
5294
type SettingsGetCall struct {
5297
opt_ map[string]interface{}
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{})}
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)
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))
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,
5328
req.Header.Set("User-Agent", "google-api-go-client/0.5")
5329
res, err := c.s.client.Do(req)
5333
defer googleapi.CloseBody(res)
5334
if err := googleapi.CheckResponse(res); err != nil {
5338
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5343
// "description": "Returns a single user setting.",
5344
// "httpMethod": "GET",
5345
// "id": "calendar.settings.get",
5346
// "parameterOrder": [
5351
// "description": "The id of the user setting.",
5352
// "location": "path",
5353
// "required": true,
5357
// "path": "users/me/settings/{setting}",
5359
// "$ref": "Setting"
5362
// "https://www.googleapis.com/auth/calendar",
5363
// "https://www.googleapis.com/auth/calendar.readonly"
5369
// method id "calendar.settings.list":
5371
type SettingsListCall struct {
5373
opt_ map[string]interface{}
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{})}
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
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
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.
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
5407
// The default is to return all entries.
5408
func (c *SettingsListCall) SyncToken(syncToken string) *SettingsListCall {
5409
c.opt_["syncToken"] = syncToken
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)
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))
5428
if v, ok := c.opt_["pageToken"]; ok {
5429
params.Set("pageToken", fmt.Sprintf("%v", v))
5431
if v, ok := c.opt_["syncToken"]; ok {
5432
params.Set("syncToken", fmt.Sprintf("%v", v))
5434
if v, ok := c.opt_["fields"]; ok {
5435
params.Set("fields", fmt.Sprintf("%v", v))
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)
5446
defer googleapi.CloseBody(res)
5447
if err := googleapi.CheckResponse(res); err != nil {
5451
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5456
// "description": "Returns all user settings for the authenticated user.",
5457
// "httpMethod": "GET",
5458
// "id": "calendar.settings.list",
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",
5465
// "type": "integer"
5468
// "description": "Token specifying which result page to return. Optional.",
5469
// "location": "query",
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",
5478
// "path": "users/me/settings",
5480
// "$ref": "Settings"
5483
// "https://www.googleapis.com/auth/calendar",
5484
// "https://www.googleapis.com/auth/calendar.readonly"
5486
// "supportsSubscription": true
5491
// method id "calendar.settings.watch":
5493
type SettingsWatchCall struct {
5496
opt_ map[string]interface{}
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{})}
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
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
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.
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
5531
// The default is to return all entries.
5532
func (c *SettingsWatchCall) SyncToken(syncToken string) *SettingsWatchCall {
5533
c.opt_["syncToken"] = syncToken
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)
5545
func (c *SettingsWatchCall) Do() (*Channel, error) {
5546
var body io.Reader = nil
5547
body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
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))
5557
if v, ok := c.opt_["pageToken"]; ok {
5558
params.Set("pageToken", fmt.Sprintf("%v", v))
5560
if v, ok := c.opt_["syncToken"]; ok {
5561
params.Set("syncToken", fmt.Sprintf("%v", v))
5563
if v, ok := c.opt_["fields"]; ok {
5564
params.Set("fields", fmt.Sprintf("%v", v))
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)
5576
defer googleapi.CloseBody(res)
5577
if err := googleapi.CheckResponse(res); err != nil {
5581
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
5586
// "description": "Watch for changes to Settings resources.",
5587
// "httpMethod": "POST",
5588
// "id": "calendar.settings.watch",
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",
5595
// "type": "integer"
5598
// "description": "Token specifying which result page to return. Optional.",
5599
// "location": "query",
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",
5608
// "path": "users/me/settings/watch",
5610
// "$ref": "Channel",
5611
// "parameterName": "resource"
5614
// "$ref": "Channel"
5617
// "https://www.googleapis.com/auth/calendar",
5618
// "https://www.googleapis.com/auth/calendar.readonly"
5620
// "supportsSubscription": true