Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

8660 rader
313 KiB

  1. // Package calendar provides access to the Calendar API.
  2. //
  3. // See https://developers.google.com/google-apps/calendar/firstapp
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/calendar/v3"
  8. // ...
  9. // calendarService, err := calendar.New(oauthHttpClient)
  10. package calendar // import "google.golang.org/api/calendar/v3"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "calendar:v3"
  41. const apiName = "calendar"
  42. const apiVersion = "v3"
  43. const basePath = "https://www.googleapis.com/calendar/v3/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your calendars
  47. CalendarScope = "https://www.googleapis.com/auth/calendar"
  48. // View your calendars
  49. CalendarReadonlyScope = "https://www.googleapis.com/auth/calendar.readonly"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Acl = NewAclService(s)
  57. s.CalendarList = NewCalendarListService(s)
  58. s.Calendars = NewCalendarsService(s)
  59. s.Channels = NewChannelsService(s)
  60. s.Colors = NewColorsService(s)
  61. s.Events = NewEventsService(s)
  62. s.Freebusy = NewFreebusyService(s)
  63. s.Settings = NewSettingsService(s)
  64. return s, nil
  65. }
  66. type Service struct {
  67. client *http.Client
  68. BasePath string // API endpoint base URL
  69. UserAgent string // optional additional User-Agent fragment
  70. Acl *AclService
  71. CalendarList *CalendarListService
  72. Calendars *CalendarsService
  73. Channels *ChannelsService
  74. Colors *ColorsService
  75. Events *EventsService
  76. Freebusy *FreebusyService
  77. Settings *SettingsService
  78. }
  79. func (s *Service) userAgent() string {
  80. if s.UserAgent == "" {
  81. return googleapi.UserAgent
  82. }
  83. return googleapi.UserAgent + " " + s.UserAgent
  84. }
  85. func NewAclService(s *Service) *AclService {
  86. rs := &AclService{s: s}
  87. return rs
  88. }
  89. type AclService struct {
  90. s *Service
  91. }
  92. func NewCalendarListService(s *Service) *CalendarListService {
  93. rs := &CalendarListService{s: s}
  94. return rs
  95. }
  96. type CalendarListService struct {
  97. s *Service
  98. }
  99. func NewCalendarsService(s *Service) *CalendarsService {
  100. rs := &CalendarsService{s: s}
  101. return rs
  102. }
  103. type CalendarsService struct {
  104. s *Service
  105. }
  106. func NewChannelsService(s *Service) *ChannelsService {
  107. rs := &ChannelsService{s: s}
  108. return rs
  109. }
  110. type ChannelsService struct {
  111. s *Service
  112. }
  113. func NewColorsService(s *Service) *ColorsService {
  114. rs := &ColorsService{s: s}
  115. return rs
  116. }
  117. type ColorsService struct {
  118. s *Service
  119. }
  120. func NewEventsService(s *Service) *EventsService {
  121. rs := &EventsService{s: s}
  122. return rs
  123. }
  124. type EventsService struct {
  125. s *Service
  126. }
  127. func NewFreebusyService(s *Service) *FreebusyService {
  128. rs := &FreebusyService{s: s}
  129. return rs
  130. }
  131. type FreebusyService struct {
  132. s *Service
  133. }
  134. func NewSettingsService(s *Service) *SettingsService {
  135. rs := &SettingsService{s: s}
  136. return rs
  137. }
  138. type SettingsService struct {
  139. s *Service
  140. }
  141. type Acl struct {
  142. // Etag: ETag of the collection.
  143. Etag string `json:"etag,omitempty"`
  144. // Items: List of rules on the access control list.
  145. Items []*AclRule `json:"items,omitempty"`
  146. // Kind: Type of the collection ("calendar#acl").
  147. Kind string `json:"kind,omitempty"`
  148. // NextPageToken: Token used to access the next page of this result.
  149. // Omitted if no further results are available, in which case
  150. // nextSyncToken is provided.
  151. NextPageToken string `json:"nextPageToken,omitempty"`
  152. // NextSyncToken: Token used at a later point in time to retrieve only
  153. // the entries that have changed since this result was returned. Omitted
  154. // if further results are available, in which case nextPageToken is
  155. // provided.
  156. NextSyncToken string `json:"nextSyncToken,omitempty"`
  157. // ServerResponse contains the HTTP response code and headers from the
  158. // server.
  159. googleapi.ServerResponse `json:"-"`
  160. // ForceSendFields is a list of field names (e.g. "Etag") to
  161. // unconditionally include in API requests. By default, fields with
  162. // empty values are omitted from API requests. However, any non-pointer,
  163. // non-interface field appearing in ForceSendFields will be sent to the
  164. // server regardless of whether the field is empty or not. This may be
  165. // used to include empty fields in Patch requests.
  166. ForceSendFields []string `json:"-"`
  167. // NullFields is a list of field names (e.g. "Etag") to include in API
  168. // requests with the JSON null value. By default, fields with empty
  169. // values are omitted from API requests. However, any field with an
  170. // empty value appearing in NullFields will be sent to the server as
  171. // null. It is an error if a field in this list has a non-empty value.
  172. // This may be used to include null fields in Patch requests.
  173. NullFields []string `json:"-"`
  174. }
  175. func (s *Acl) MarshalJSON() ([]byte, error) {
  176. type NoMethod Acl
  177. raw := NoMethod(*s)
  178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  179. }
  180. type AclRule struct {
  181. // Etag: ETag of the resource.
  182. Etag string `json:"etag,omitempty"`
  183. // Id: Identifier of the ACL rule.
  184. Id string `json:"id,omitempty"`
  185. // Kind: Type of the resource ("calendar#aclRule").
  186. Kind string `json:"kind,omitempty"`
  187. // Role: The role assigned to the scope. Possible values are:
  188. // - "none" - Provides no access.
  189. // - "freeBusyReader" - Provides read access to free/busy information.
  190. //
  191. // - "reader" - Provides read access to the calendar. Private events
  192. // will appear to users with reader access, but event details will be
  193. // hidden.
  194. // - "writer" - Provides read and write access to the calendar. Private
  195. // events will appear to users with writer access, and event details
  196. // will be visible.
  197. // - "owner" - Provides ownership of the calendar. This role has all of
  198. // the permissions of the writer role with the additional ability to see
  199. // and manipulate ACLs.
  200. Role string `json:"role,omitempty"`
  201. // Scope: The scope of the rule.
  202. Scope *AclRuleScope `json:"scope,omitempty"`
  203. // ServerResponse contains the HTTP response code and headers from the
  204. // server.
  205. googleapi.ServerResponse `json:"-"`
  206. // ForceSendFields is a list of field names (e.g. "Etag") to
  207. // unconditionally include in API requests. By default, fields with
  208. // empty values are omitted from API requests. However, any non-pointer,
  209. // non-interface field appearing in ForceSendFields will be sent to the
  210. // server regardless of whether the field is empty or not. This may be
  211. // used to include empty fields in Patch requests.
  212. ForceSendFields []string `json:"-"`
  213. // NullFields is a list of field names (e.g. "Etag") to include in API
  214. // requests with the JSON null value. By default, fields with empty
  215. // values are omitted from API requests. However, any field with an
  216. // empty value appearing in NullFields will be sent to the server as
  217. // null. It is an error if a field in this list has a non-empty value.
  218. // This may be used to include null fields in Patch requests.
  219. NullFields []string `json:"-"`
  220. }
  221. func (s *AclRule) MarshalJSON() ([]byte, error) {
  222. type NoMethod AclRule
  223. raw := NoMethod(*s)
  224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  225. }
  226. // AclRuleScope: The scope of the rule.
  227. type AclRuleScope struct {
  228. // Type: The type of the scope. Possible values are:
  229. // - "default" - The public scope. This is the default value.
  230. // - "user" - Limits the scope to a single user.
  231. // - "group" - Limits the scope to a group.
  232. // - "domain" - Limits the scope to a domain. Note: The permissions
  233. // granted to the "default", or public, scope apply to any user,
  234. // authenticated or not.
  235. Type string `json:"type,omitempty"`
  236. // Value: The email address of a user or group, or the name of a domain,
  237. // depending on the scope type. Omitted for type "default".
  238. Value string `json:"value,omitempty"`
  239. // ForceSendFields is a list of field names (e.g. "Type") to
  240. // unconditionally include in API requests. By default, fields with
  241. // empty values are omitted from API requests. However, any non-pointer,
  242. // non-interface field appearing in ForceSendFields will be sent to the
  243. // server regardless of whether the field is empty or not. This may be
  244. // used to include empty fields in Patch requests.
  245. ForceSendFields []string `json:"-"`
  246. // NullFields is a list of field names (e.g. "Type") to include in API
  247. // requests with the JSON null value. By default, fields with empty
  248. // values are omitted from API requests. However, any field with an
  249. // empty value appearing in NullFields will be sent to the server as
  250. // null. It is an error if a field in this list has a non-empty value.
  251. // This may be used to include null fields in Patch requests.
  252. NullFields []string `json:"-"`
  253. }
  254. func (s *AclRuleScope) MarshalJSON() ([]byte, error) {
  255. type NoMethod AclRuleScope
  256. raw := NoMethod(*s)
  257. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  258. }
  259. type Calendar struct {
  260. // ConferenceProperties: Conferencing properties for this calendar, for
  261. // example what types of conferences are allowed.
  262. ConferenceProperties *ConferenceProperties `json:"conferenceProperties,omitempty"`
  263. // Description: Description of the calendar. Optional.
  264. Description string `json:"description,omitempty"`
  265. // Etag: ETag of the resource.
  266. Etag string `json:"etag,omitempty"`
  267. // Id: Identifier of the calendar. To retrieve IDs call the
  268. // calendarList.list() method.
  269. Id string `json:"id,omitempty"`
  270. // Kind: Type of the resource ("calendar#calendar").
  271. Kind string `json:"kind,omitempty"`
  272. // Location: Geographic location of the calendar as free-form text.
  273. // Optional.
  274. Location string `json:"location,omitempty"`
  275. // Summary: Title of the calendar.
  276. Summary string `json:"summary,omitempty"`
  277. // TimeZone: The time zone of the calendar. (Formatted as an IANA Time
  278. // Zone Database name, e.g. "Europe/Zurich".) Optional.
  279. TimeZone string `json:"timeZone,omitempty"`
  280. // ServerResponse contains the HTTP response code and headers from the
  281. // server.
  282. googleapi.ServerResponse `json:"-"`
  283. // ForceSendFields is a list of field names (e.g.
  284. // "ConferenceProperties") to unconditionally include in API requests.
  285. // By default, fields with empty values are omitted from API requests.
  286. // However, any non-pointer, non-interface field appearing in
  287. // ForceSendFields will be sent to the server regardless of whether the
  288. // field is empty or not. This may be used to include empty fields in
  289. // Patch requests.
  290. ForceSendFields []string `json:"-"`
  291. // NullFields is a list of field names (e.g. "ConferenceProperties") to
  292. // include in API requests with the JSON null value. By default, fields
  293. // with empty values are omitted from API requests. However, any field
  294. // with an empty value appearing in NullFields will be sent to the
  295. // server as null. It is an error if a field in this list has a
  296. // non-empty value. This may be used to include null fields in Patch
  297. // requests.
  298. NullFields []string `json:"-"`
  299. }
  300. func (s *Calendar) MarshalJSON() ([]byte, error) {
  301. type NoMethod Calendar
  302. raw := NoMethod(*s)
  303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  304. }
  305. type CalendarList struct {
  306. // Etag: ETag of the collection.
  307. Etag string `json:"etag,omitempty"`
  308. // Items: Calendars that are present on the user's calendar list.
  309. Items []*CalendarListEntry `json:"items,omitempty"`
  310. // Kind: Type of the collection ("calendar#calendarList").
  311. Kind string `json:"kind,omitempty"`
  312. // NextPageToken: Token used to access the next page of this result.
  313. // Omitted if no further results are available, in which case
  314. // nextSyncToken is provided.
  315. NextPageToken string `json:"nextPageToken,omitempty"`
  316. // NextSyncToken: Token used at a later point in time to retrieve only
  317. // the entries that have changed since this result was returned. Omitted
  318. // if further results are available, in which case nextPageToken is
  319. // provided.
  320. NextSyncToken string `json:"nextSyncToken,omitempty"`
  321. // ServerResponse contains the HTTP response code and headers from the
  322. // server.
  323. googleapi.ServerResponse `json:"-"`
  324. // ForceSendFields is a list of field names (e.g. "Etag") to
  325. // unconditionally include in API requests. By default, fields with
  326. // empty values are omitted from API requests. However, any non-pointer,
  327. // non-interface field appearing in ForceSendFields will be sent to the
  328. // server regardless of whether the field is empty or not. This may be
  329. // used to include empty fields in Patch requests.
  330. ForceSendFields []string `json:"-"`
  331. // NullFields is a list of field names (e.g. "Etag") to include in API
  332. // requests with the JSON null value. By default, fields with empty
  333. // values are omitted from API requests. However, any field with an
  334. // empty value appearing in NullFields will be sent to the server as
  335. // null. It is an error if a field in this list has a non-empty value.
  336. // This may be used to include null fields in Patch requests.
  337. NullFields []string `json:"-"`
  338. }
  339. func (s *CalendarList) MarshalJSON() ([]byte, error) {
  340. type NoMethod CalendarList
  341. raw := NoMethod(*s)
  342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  343. }
  344. type CalendarListEntry struct {
  345. // AccessRole: The effective access role that the authenticated user has
  346. // on the calendar. Read-only. Possible values are:
  347. // - "freeBusyReader" - Provides read access to free/busy information.
  348. //
  349. // - "reader" - Provides read access to the calendar. Private events
  350. // will appear to users with reader access, but event details will be
  351. // hidden.
  352. // - "writer" - Provides read and write access to the calendar. Private
  353. // events will appear to users with writer access, and event details
  354. // will be visible.
  355. // - "owner" - Provides ownership of the calendar. This role has all of
  356. // the permissions of the writer role with the additional ability to see
  357. // and manipulate ACLs.
  358. AccessRole string `json:"accessRole,omitempty"`
  359. // BackgroundColor: The main color of the calendar in the hexadecimal
  360. // format "#0088aa". This property supersedes the index-based colorId
  361. // property. To set or change this property, you need to specify
  362. // colorRgbFormat=true in the parameters of the insert, update and patch
  363. // methods. Optional.
  364. BackgroundColor string `json:"backgroundColor,omitempty"`
  365. // ColorId: The color of the calendar. This is an ID referring to an
  366. // entry in the calendar section of the colors definition (see the
  367. // colors endpoint). This property is superseded by the backgroundColor
  368. // and foregroundColor properties and can be ignored when using these
  369. // properties. Optional.
  370. ColorId string `json:"colorId,omitempty"`
  371. // ConferenceProperties: Conferencing properties for this calendar, for
  372. // example what types of conferences are allowed.
  373. ConferenceProperties *ConferenceProperties `json:"conferenceProperties,omitempty"`
  374. // DefaultReminders: The default reminders that the authenticated user
  375. // has for this calendar.
  376. DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"`
  377. // Deleted: Whether this calendar list entry has been deleted from the
  378. // calendar list. Read-only. Optional. The default is False.
  379. Deleted bool `json:"deleted,omitempty"`
  380. // Description: Description of the calendar. Optional. Read-only.
  381. Description string `json:"description,omitempty"`
  382. // Etag: ETag of the resource.
  383. Etag string `json:"etag,omitempty"`
  384. // ForegroundColor: The foreground color of the calendar in the
  385. // hexadecimal format "#ffffff". This property supersedes the
  386. // index-based colorId property. To set or change this property, you
  387. // need to specify colorRgbFormat=true in the parameters of the insert,
  388. // update and patch methods. Optional.
  389. ForegroundColor string `json:"foregroundColor,omitempty"`
  390. // Hidden: Whether the calendar has been hidden from the list. Optional.
  391. // The default is False.
  392. Hidden bool `json:"hidden,omitempty"`
  393. // Id: Identifier of the calendar.
  394. Id string `json:"id,omitempty"`
  395. // Kind: Type of the resource ("calendar#calendarListEntry").
  396. Kind string `json:"kind,omitempty"`
  397. // Location: Geographic location of the calendar as free-form text.
  398. // Optional. Read-only.
  399. Location string `json:"location,omitempty"`
  400. // NotificationSettings: The notifications that the authenticated user
  401. // is receiving for this calendar.
  402. NotificationSettings *CalendarListEntryNotificationSettings `json:"notificationSettings,omitempty"`
  403. // Primary: Whether the calendar is the primary calendar of the
  404. // authenticated user. Read-only. Optional. The default is False.
  405. Primary bool `json:"primary,omitempty"`
  406. // Selected: Whether the calendar content shows up in the calendar UI.
  407. // Optional. The default is False.
  408. Selected bool `json:"selected,omitempty"`
  409. // Summary: Title of the calendar. Read-only.
  410. Summary string `json:"summary,omitempty"`
  411. // SummaryOverride: The summary that the authenticated user has set for
  412. // this calendar. Optional.
  413. SummaryOverride string `json:"summaryOverride,omitempty"`
  414. // TimeZone: The time zone of the calendar. Optional. Read-only.
  415. TimeZone string `json:"timeZone,omitempty"`
  416. // ServerResponse contains the HTTP response code and headers from the
  417. // server.
  418. googleapi.ServerResponse `json:"-"`
  419. // ForceSendFields is a list of field names (e.g. "AccessRole") to
  420. // unconditionally include in API requests. By default, fields with
  421. // empty values are omitted from API requests. However, any non-pointer,
  422. // non-interface field appearing in ForceSendFields will be sent to the
  423. // server regardless of whether the field is empty or not. This may be
  424. // used to include empty fields in Patch requests.
  425. ForceSendFields []string `json:"-"`
  426. // NullFields is a list of field names (e.g. "AccessRole") to include in
  427. // API requests with the JSON null value. By default, fields with empty
  428. // values are omitted from API requests. However, any field with an
  429. // empty value appearing in NullFields will be sent to the server as
  430. // null. It is an error if a field in this list has a non-empty value.
  431. // This may be used to include null fields in Patch requests.
  432. NullFields []string `json:"-"`
  433. }
  434. func (s *CalendarListEntry) MarshalJSON() ([]byte, error) {
  435. type NoMethod CalendarListEntry
  436. raw := NoMethod(*s)
  437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  438. }
  439. // CalendarListEntryNotificationSettings: The notifications that the
  440. // authenticated user is receiving for this calendar.
  441. type CalendarListEntryNotificationSettings struct {
  442. // Notifications: The list of notifications set for this calendar.
  443. Notifications []*CalendarNotification `json:"notifications,omitempty"`
  444. // ForceSendFields is a list of field names (e.g. "Notifications") to
  445. // unconditionally include in API requests. By default, fields with
  446. // empty values are omitted from API requests. However, any non-pointer,
  447. // non-interface field appearing in ForceSendFields will be sent to the
  448. // server regardless of whether the field is empty or not. This may be
  449. // used to include empty fields in Patch requests.
  450. ForceSendFields []string `json:"-"`
  451. // NullFields is a list of field names (e.g. "Notifications") to include
  452. // in API requests with the JSON null value. By default, fields with
  453. // empty values are omitted from API requests. However, any field with
  454. // an empty value appearing in NullFields will be sent to the server as
  455. // null. It is an error if a field in this list has a non-empty value.
  456. // This may be used to include null fields in Patch requests.
  457. NullFields []string `json:"-"`
  458. }
  459. func (s *CalendarListEntryNotificationSettings) MarshalJSON() ([]byte, error) {
  460. type NoMethod CalendarListEntryNotificationSettings
  461. raw := NoMethod(*s)
  462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  463. }
  464. type CalendarNotification struct {
  465. // Method: The method used to deliver the notification. Possible values
  466. // are:
  467. // - "email" - Reminders are sent via email.
  468. // - "sms" - Reminders are sent via SMS. This value is read-only and is
  469. // ignored on inserts and updates. SMS reminders are only available for
  470. // G Suite customers.
  471. Method string `json:"method,omitempty"`
  472. // Type: The type of notification. Possible values are:
  473. // - "eventCreation" - Notification sent when a new event is put on the
  474. // calendar.
  475. // - "eventChange" - Notification sent when an event is changed.
  476. // - "eventCancellation" - Notification sent when an event is cancelled.
  477. //
  478. // - "eventResponse" - Notification sent when an event is changed.
  479. // - "agenda" - An agenda with the events of the day (sent out in the
  480. // morning).
  481. Type string `json:"type,omitempty"`
  482. // ForceSendFields is a list of field names (e.g. "Method") to
  483. // unconditionally include in API requests. By default, fields with
  484. // empty values are omitted from API requests. However, any non-pointer,
  485. // non-interface field appearing in ForceSendFields will be sent to the
  486. // server regardless of whether the field is empty or not. This may be
  487. // used to include empty fields in Patch requests.
  488. ForceSendFields []string `json:"-"`
  489. // NullFields is a list of field names (e.g. "Method") to include in API
  490. // requests with the JSON null value. By default, fields with empty
  491. // values are omitted from API requests. However, any field with an
  492. // empty value appearing in NullFields will be sent to the server as
  493. // null. It is an error if a field in this list has a non-empty value.
  494. // This may be used to include null fields in Patch requests.
  495. NullFields []string `json:"-"`
  496. }
  497. func (s *CalendarNotification) MarshalJSON() ([]byte, error) {
  498. type NoMethod CalendarNotification
  499. raw := NoMethod(*s)
  500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  501. }
  502. type Channel struct {
  503. // Address: The address where notifications are delivered for this
  504. // channel.
  505. Address string `json:"address,omitempty"`
  506. // Expiration: Date and time of notification channel expiration,
  507. // expressed as a Unix timestamp, in milliseconds. Optional.
  508. Expiration int64 `json:"expiration,omitempty,string"`
  509. // Id: A UUID or similar unique string that identifies this channel.
  510. Id string `json:"id,omitempty"`
  511. // Kind: Identifies this as a notification channel used to watch for
  512. // changes to a resource. Value: the fixed string "api#channel".
  513. Kind string `json:"kind,omitempty"`
  514. // Params: Additional parameters controlling delivery channel behavior.
  515. // Optional.
  516. Params map[string]string `json:"params,omitempty"`
  517. // Payload: A Boolean value to indicate whether payload is wanted.
  518. // Optional.
  519. Payload bool `json:"payload,omitempty"`
  520. // ResourceId: An opaque ID that identifies the resource being watched
  521. // on this channel. Stable across different API versions.
  522. ResourceId string `json:"resourceId,omitempty"`
  523. // ResourceUri: A version-specific identifier for the watched resource.
  524. ResourceUri string `json:"resourceUri,omitempty"`
  525. // Token: An arbitrary string delivered to the target address with each
  526. // notification delivered over this channel. Optional.
  527. Token string `json:"token,omitempty"`
  528. // Type: The type of delivery mechanism used for this channel.
  529. Type string `json:"type,omitempty"`
  530. // ServerResponse contains the HTTP response code and headers from the
  531. // server.
  532. googleapi.ServerResponse `json:"-"`
  533. // ForceSendFields is a list of field names (e.g. "Address") to
  534. // unconditionally include in API requests. By default, fields with
  535. // empty values are omitted from API requests. However, any non-pointer,
  536. // non-interface field appearing in ForceSendFields will be sent to the
  537. // server regardless of whether the field is empty or not. This may be
  538. // used to include empty fields in Patch requests.
  539. ForceSendFields []string `json:"-"`
  540. // NullFields is a list of field names (e.g. "Address") to include in
  541. // API requests with the JSON null value. By default, fields with empty
  542. // values are omitted from API requests. However, any field with an
  543. // empty value appearing in NullFields will be sent to the server as
  544. // null. It is an error if a field in this list has a non-empty value.
  545. // This may be used to include null fields in Patch requests.
  546. NullFields []string `json:"-"`
  547. }
  548. func (s *Channel) MarshalJSON() ([]byte, error) {
  549. type NoMethod Channel
  550. raw := NoMethod(*s)
  551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  552. }
  553. type ColorDefinition struct {
  554. // Background: The background color associated with this color
  555. // definition.
  556. Background string `json:"background,omitempty"`
  557. // Foreground: The foreground color that can be used to write on top of
  558. // a background with 'background' color.
  559. Foreground string `json:"foreground,omitempty"`
  560. // ForceSendFields is a list of field names (e.g. "Background") to
  561. // unconditionally include in API requests. By default, fields with
  562. // empty values are omitted from API requests. However, any non-pointer,
  563. // non-interface field appearing in ForceSendFields will be sent to the
  564. // server regardless of whether the field is empty or not. This may be
  565. // used to include empty fields in Patch requests.
  566. ForceSendFields []string `json:"-"`
  567. // NullFields is a list of field names (e.g. "Background") to include in
  568. // API requests with the JSON null value. By default, fields with empty
  569. // values are omitted from API requests. However, any field with an
  570. // empty value appearing in NullFields will be sent to the server as
  571. // null. It is an error if a field in this list has a non-empty value.
  572. // This may be used to include null fields in Patch requests.
  573. NullFields []string `json:"-"`
  574. }
  575. func (s *ColorDefinition) MarshalJSON() ([]byte, error) {
  576. type NoMethod ColorDefinition
  577. raw := NoMethod(*s)
  578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  579. }
  580. type Colors struct {
  581. // Calendar: A global palette of calendar colors, mapping from the color
  582. // ID to its definition. A calendarListEntry resource refers to one of
  583. // these color IDs in its color field. Read-only.
  584. Calendar map[string]ColorDefinition `json:"calendar,omitempty"`
  585. // Event: A global palette of event colors, mapping from the color ID to
  586. // its definition. An event resource may refer to one of these color IDs
  587. // in its color field. Read-only.
  588. Event map[string]ColorDefinition `json:"event,omitempty"`
  589. // Kind: Type of the resource ("calendar#colors").
  590. Kind string `json:"kind,omitempty"`
  591. // Updated: Last modification time of the color palette (as a RFC3339
  592. // timestamp). Read-only.
  593. Updated string `json:"updated,omitempty"`
  594. // ServerResponse contains the HTTP response code and headers from the
  595. // server.
  596. googleapi.ServerResponse `json:"-"`
  597. // ForceSendFields is a list of field names (e.g. "Calendar") to
  598. // unconditionally include in API requests. By default, fields with
  599. // empty values are omitted from API requests. However, any non-pointer,
  600. // non-interface field appearing in ForceSendFields will be sent to the
  601. // server regardless of whether the field is empty or not. This may be
  602. // used to include empty fields in Patch requests.
  603. ForceSendFields []string `json:"-"`
  604. // NullFields is a list of field names (e.g. "Calendar") to include in
  605. // API requests with the JSON null value. By default, fields with empty
  606. // values are omitted from API requests. However, any field with an
  607. // empty value appearing in NullFields will be sent to the server as
  608. // null. It is an error if a field in this list has a non-empty value.
  609. // This may be used to include null fields in Patch requests.
  610. NullFields []string `json:"-"`
  611. }
  612. func (s *Colors) MarshalJSON() ([]byte, error) {
  613. type NoMethod Colors
  614. raw := NoMethod(*s)
  615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  616. }
  617. type ConferenceData struct {
  618. // ConferenceId: The ID of the conference.
  619. // Can be used by developers to keep track of conferences, should not be
  620. // displayed to users.
  621. // Values for solution types:
  622. // - "eventHangout": unset.
  623. // - "eventNamedHangout": the name of the Hangout.
  624. // - "hangoutsMeet": the 10-letter meeting code, for example
  625. // "aaa-bbbb-ccc". Optional.
  626. ConferenceId string `json:"conferenceId,omitempty"`
  627. // ConferenceSolution: The conference solution, such as Hangouts or
  628. // Hangouts Meet.
  629. // Unset for a conference with a failed create request.
  630. // Either conferenceSolution and at least one entryPoint, or
  631. // createRequest is required.
  632. ConferenceSolution *ConferenceSolution `json:"conferenceSolution,omitempty"`
  633. // CreateRequest: A request to generate a new conference and attach it
  634. // to the event. The data is generated asynchronously. To see whether
  635. // the data is present check the status field.
  636. // Either conferenceSolution and at least one entryPoint, or
  637. // createRequest is required.
  638. CreateRequest *CreateConferenceRequest `json:"createRequest,omitempty"`
  639. // EntryPoints: Information about individual conference entry points,
  640. // such as URLs or phone numbers.
  641. // All of them must belong to the same conference.
  642. // Either conferenceSolution and at least one entryPoint, or
  643. // createRequest is required.
  644. EntryPoints []*EntryPoint `json:"entryPoints,omitempty"`
  645. // Notes: Additional notes (such as instructions from the domain
  646. // administrator, legal notices) to display to the user. Can contain
  647. // HTML. The maximum length is 2048 characters. Optional.
  648. Notes string `json:"notes,omitempty"`
  649. // Parameters: Additional properties related to a conference. An example
  650. // would be a solution-specific setting for enabling video streaming.
  651. Parameters *ConferenceParameters `json:"parameters,omitempty"`
  652. // Signature: The signature of the conference data.
  653. // Genereated on server side. Must be preserved while copying the
  654. // conference data between events, otherwise the conference data will
  655. // not be copied.
  656. // Unset for a conference with a failed create request.
  657. // Optional for a conference with a pending create request.
  658. Signature string `json:"signature,omitempty"`
  659. // ForceSendFields is a list of field names (e.g. "ConferenceId") to
  660. // unconditionally include in API requests. By default, fields with
  661. // empty values are omitted from API requests. However, any non-pointer,
  662. // non-interface field appearing in ForceSendFields will be sent to the
  663. // server regardless of whether the field is empty or not. This may be
  664. // used to include empty fields in Patch requests.
  665. ForceSendFields []string `json:"-"`
  666. // NullFields is a list of field names (e.g. "ConferenceId") to include
  667. // in API requests with the JSON null value. By default, fields with
  668. // empty values are omitted from API requests. However, any field with
  669. // an empty value appearing in NullFields will be sent to the server as
  670. // null. It is an error if a field in this list has a non-empty value.
  671. // This may be used to include null fields in Patch requests.
  672. NullFields []string `json:"-"`
  673. }
  674. func (s *ConferenceData) MarshalJSON() ([]byte, error) {
  675. type NoMethod ConferenceData
  676. raw := NoMethod(*s)
  677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  678. }
  679. type ConferenceParameters struct {
  680. // AddOnParameters: Additional add-on specific data.
  681. AddOnParameters *ConferenceParametersAddOnParameters `json:"addOnParameters,omitempty"`
  682. // ForceSendFields is a list of field names (e.g. "AddOnParameters") to
  683. // unconditionally include in API requests. By default, fields with
  684. // empty values are omitted from API requests. However, any non-pointer,
  685. // non-interface field appearing in ForceSendFields will be sent to the
  686. // server regardless of whether the field is empty or not. This may be
  687. // used to include empty fields in Patch requests.
  688. ForceSendFields []string `json:"-"`
  689. // NullFields is a list of field names (e.g. "AddOnParameters") to
  690. // include in API requests with the JSON null value. By default, fields
  691. // with empty values are omitted from API requests. However, any field
  692. // with an empty value appearing in NullFields will be sent to the
  693. // server as null. It is an error if a field in this list has a
  694. // non-empty value. This may be used to include null fields in Patch
  695. // requests.
  696. NullFields []string `json:"-"`
  697. }
  698. func (s *ConferenceParameters) MarshalJSON() ([]byte, error) {
  699. type NoMethod ConferenceParameters
  700. raw := NoMethod(*s)
  701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  702. }
  703. type ConferenceParametersAddOnParameters struct {
  704. Parameters map[string]string `json:"parameters,omitempty"`
  705. // ForceSendFields is a list of field names (e.g. "Parameters") to
  706. // unconditionally include in API requests. By default, fields with
  707. // empty values are omitted from API requests. However, any non-pointer,
  708. // non-interface field appearing in ForceSendFields will be sent to the
  709. // server regardless of whether the field is empty or not. This may be
  710. // used to include empty fields in Patch requests.
  711. ForceSendFields []string `json:"-"`
  712. // NullFields is a list of field names (e.g. "Parameters") to include in
  713. // API requests with the JSON null value. By default, fields with empty
  714. // values are omitted from API requests. However, any field with an
  715. // empty value appearing in NullFields will be sent to the server as
  716. // null. It is an error if a field in this list has a non-empty value.
  717. // This may be used to include null fields in Patch requests.
  718. NullFields []string `json:"-"`
  719. }
  720. func (s *ConferenceParametersAddOnParameters) MarshalJSON() ([]byte, error) {
  721. type NoMethod ConferenceParametersAddOnParameters
  722. raw := NoMethod(*s)
  723. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  724. }
  725. type ConferenceProperties struct {
  726. // AllowedConferenceSolutionTypes: The types of conference solutions
  727. // that are supported for this calendar.
  728. // The possible values are:
  729. // - "eventHangout"
  730. // - "eventNamedHangout"
  731. // - "hangoutsMeet" Optional.
  732. AllowedConferenceSolutionTypes []string `json:"allowedConferenceSolutionTypes,omitempty"`
  733. // ForceSendFields is a list of field names (e.g.
  734. // "AllowedConferenceSolutionTypes") to unconditionally include in API
  735. // requests. By default, fields with empty values are omitted from API
  736. // requests. However, any non-pointer, non-interface field appearing in
  737. // ForceSendFields will be sent to the server regardless of whether the
  738. // field is empty or not. This may be used to include empty fields in
  739. // Patch requests.
  740. ForceSendFields []string `json:"-"`
  741. // NullFields is a list of field names (e.g.
  742. // "AllowedConferenceSolutionTypes") to include in API requests with the
  743. // JSON null value. By default, fields with empty values are omitted
  744. // from API requests. However, any field with an empty value appearing
  745. // in NullFields will be sent to the server as null. It is an error if a
  746. // field in this list has a non-empty value. This may be used to include
  747. // null fields in Patch requests.
  748. NullFields []string `json:"-"`
  749. }
  750. func (s *ConferenceProperties) MarshalJSON() ([]byte, error) {
  751. type NoMethod ConferenceProperties
  752. raw := NoMethod(*s)
  753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  754. }
  755. type ConferenceRequestStatus struct {
  756. // StatusCode: The current status of the conference create request.
  757. // Read-only.
  758. // The possible values are:
  759. // - "pending": the conference create request is still being
  760. // processed.
  761. // - "success": the conference create request succeeded, the entry
  762. // points are populated.
  763. // - "failure": the conference create request failed, there are no entry
  764. // points.
  765. StatusCode string `json:"statusCode,omitempty"`
  766. // ForceSendFields is a list of field names (e.g. "StatusCode") to
  767. // unconditionally include in API requests. By default, fields with
  768. // empty values are omitted from API requests. However, any non-pointer,
  769. // non-interface field appearing in ForceSendFields will be sent to the
  770. // server regardless of whether the field is empty or not. This may be
  771. // used to include empty fields in Patch requests.
  772. ForceSendFields []string `json:"-"`
  773. // NullFields is a list of field names (e.g. "StatusCode") to include in
  774. // API requests with the JSON null value. By default, fields with empty
  775. // values are omitted from API requests. However, any field with an
  776. // empty value appearing in NullFields will be sent to the server as
  777. // null. It is an error if a field in this list has a non-empty value.
  778. // This may be used to include null fields in Patch requests.
  779. NullFields []string `json:"-"`
  780. }
  781. func (s *ConferenceRequestStatus) MarshalJSON() ([]byte, error) {
  782. type NoMethod ConferenceRequestStatus
  783. raw := NoMethod(*s)
  784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  785. }
  786. type ConferenceSolution struct {
  787. // IconUri: The user-visible icon for this solution.
  788. IconUri string `json:"iconUri,omitempty"`
  789. // Key: The key which can uniquely identify the conference solution for
  790. // this event.
  791. Key *ConferenceSolutionKey `json:"key,omitempty"`
  792. // Name: The user-visible name of this solution. Not localized.
  793. Name string `json:"name,omitempty"`
  794. // ForceSendFields is a list of field names (e.g. "IconUri") to
  795. // unconditionally include in API requests. By default, fields with
  796. // empty values are omitted from API requests. However, any non-pointer,
  797. // non-interface field appearing in ForceSendFields will be sent to the
  798. // server regardless of whether the field is empty or not. This may be
  799. // used to include empty fields in Patch requests.
  800. ForceSendFields []string `json:"-"`
  801. // NullFields is a list of field names (e.g. "IconUri") to include in
  802. // API requests with the JSON null value. By default, fields with empty
  803. // values are omitted from API requests. However, any field with an
  804. // empty value appearing in NullFields will be sent to the server as
  805. // null. It is an error if a field in this list has a non-empty value.
  806. // This may be used to include null fields in Patch requests.
  807. NullFields []string `json:"-"`
  808. }
  809. func (s *ConferenceSolution) MarshalJSON() ([]byte, error) {
  810. type NoMethod ConferenceSolution
  811. raw := NoMethod(*s)
  812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  813. }
  814. type ConferenceSolutionKey struct {
  815. // Type: The conference solution type.
  816. // If a client encounters an unfamiliar or empty type, it should still
  817. // be able to display the entry points. However, it should disallow
  818. // modifications.
  819. // The possible values are:
  820. // - "eventHangout" for Hangouts for consumers
  821. // (http://hangouts.google.com)
  822. // - "eventNamedHangout" for classic Hangouts for G Suite users
  823. // (http://hangouts.google.com)
  824. // - "hangoutsMeet" for Hangouts Meet (http://meet.google.com)
  825. Type string `json:"type,omitempty"`
  826. // ForceSendFields is a list of field names (e.g. "Type") to
  827. // unconditionally include in API requests. By default, fields with
  828. // empty values are omitted from API requests. However, any non-pointer,
  829. // non-interface field appearing in ForceSendFields will be sent to the
  830. // server regardless of whether the field is empty or not. This may be
  831. // used to include empty fields in Patch requests.
  832. ForceSendFields []string `json:"-"`
  833. // NullFields is a list of field names (e.g. "Type") to include in API
  834. // requests with the JSON null value. By default, fields with empty
  835. // values are omitted from API requests. However, any field with an
  836. // empty value appearing in NullFields will be sent to the server as
  837. // null. It is an error if a field in this list has a non-empty value.
  838. // This may be used to include null fields in Patch requests.
  839. NullFields []string `json:"-"`
  840. }
  841. func (s *ConferenceSolutionKey) MarshalJSON() ([]byte, error) {
  842. type NoMethod ConferenceSolutionKey
  843. raw := NoMethod(*s)
  844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  845. }
  846. type CreateConferenceRequest struct {
  847. // ConferenceSolutionKey: The conference solution, such as Hangouts or
  848. // Hangouts Meet.
  849. ConferenceSolutionKey *ConferenceSolutionKey `json:"conferenceSolutionKey,omitempty"`
  850. // RequestId: The client-generated unique ID for this request.
  851. // Clients should regenerate this ID for every new request. If an ID
  852. // provided is the same as for the previous request, the request is
  853. // ignored.
  854. RequestId string `json:"requestId,omitempty"`
  855. // Status: The status of the conference create request.
  856. Status *ConferenceRequestStatus `json:"status,omitempty"`
  857. // ForceSendFields is a list of field names (e.g.
  858. // "ConferenceSolutionKey") to unconditionally include in API requests.
  859. // By default, fields with empty values are omitted from API requests.
  860. // However, any non-pointer, non-interface field appearing in
  861. // ForceSendFields will be sent to the server regardless of whether the
  862. // field is empty or not. This may be used to include empty fields in
  863. // Patch requests.
  864. ForceSendFields []string `json:"-"`
  865. // NullFields is a list of field names (e.g. "ConferenceSolutionKey") to
  866. // include in API requests with the JSON null value. By default, fields
  867. // with empty values are omitted from API requests. However, any field
  868. // with an empty value appearing in NullFields will be sent to the
  869. // server as null. It is an error if a field in this list has a
  870. // non-empty value. This may be used to include null fields in Patch
  871. // requests.
  872. NullFields []string `json:"-"`
  873. }
  874. func (s *CreateConferenceRequest) MarshalJSON() ([]byte, error) {
  875. type NoMethod CreateConferenceRequest
  876. raw := NoMethod(*s)
  877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  878. }
  879. type EntryPoint struct {
  880. // AccessCode: The access code to access the conference. The maximum
  881. // length is 128 characters.
  882. // When creating new conference data, populate only the subset of
  883. // {meetingCode, accessCode, passcode, password, pin} fields that match
  884. // the terminology that the conference provider uses. Only the populated
  885. // fields should be displayed.
  886. // Optional.
  887. AccessCode string `json:"accessCode,omitempty"`
  888. // EntryPointType: The type of the conference entry point.
  889. // Possible values are:
  890. // - "video" - joining a conference over HTTP. A conference can have
  891. // zero or one video entry point.
  892. // - "phone" - joining a conference by dialing a phone number. A
  893. // conference can have zero or more phone entry points.
  894. // - "sip" - joining a conference over SIP. A conference can have zero
  895. // or one sip entry point.
  896. // - "more" - further conference joining instructions, for example
  897. // additional phone numbers. A conference can have zero or one more
  898. // entry point. A conference with only a more entry point is not a valid
  899. // conference.
  900. EntryPointType string `json:"entryPointType,omitempty"`
  901. // Label: The label for the URI. Visible to end users. Not localized.
  902. // The maximum length is 512 characters.
  903. // Examples:
  904. // - for video: meet.google.com/aaa-bbbb-ccc
  905. // - for phone: +1 123 268 2601
  906. // - for sip: 12345678@altostrat.com
  907. // - for more: should not be filled
  908. // Optional.
  909. Label string `json:"label,omitempty"`
  910. // MeetingCode: The meeting code to access the conference. The maximum
  911. // length is 128 characters.
  912. // When creating new conference data, populate only the subset of
  913. // {meetingCode, accessCode, passcode, password, pin} fields that match
  914. // the terminology that the conference provider uses. Only the populated
  915. // fields should be displayed.
  916. // Optional.
  917. MeetingCode string `json:"meetingCode,omitempty"`
  918. // Passcode: The passcode to access the conference. The maximum length
  919. // is 128 characters.
  920. // When creating new conference data, populate only the subset of
  921. // {meetingCode, accessCode, passcode, password, pin} fields that match
  922. // the terminology that the conference provider uses. Only the populated
  923. // fields should be displayed.
  924. Passcode string `json:"passcode,omitempty"`
  925. // Password: The password to access the conference. The maximum length
  926. // is 128 characters.
  927. // When creating new conference data, populate only the subset of
  928. // {meetingCode, accessCode, passcode, password, pin} fields that match
  929. // the terminology that the conference provider uses. Only the populated
  930. // fields should be displayed.
  931. // Optional.
  932. Password string `json:"password,omitempty"`
  933. // Pin: The PIN to access the conference. The maximum length is 128
  934. // characters.
  935. // When creating new conference data, populate only the subset of
  936. // {meetingCode, accessCode, passcode, password, pin} fields that match
  937. // the terminology that the conference provider uses. Only the populated
  938. // fields should be displayed.
  939. // Optional.
  940. Pin string `json:"pin,omitempty"`
  941. // Uri: The URI of the entry point. The maximum length is 1300
  942. // characters.
  943. // Format:
  944. // - for video, http: or https: schema is required.
  945. // - for phone, tel: schema is required. The URI should include the
  946. // entire dial sequence (e.g., tel:+12345678900,,,123456789;1234).
  947. // - for sip, sip: schema is required, e.g.,
  948. // sip:12345678@myprovider.com.
  949. // - for more, http: or https: schema is required.
  950. Uri string `json:"uri,omitempty"`
  951. // ForceSendFields is a list of field names (e.g. "AccessCode") to
  952. // unconditionally include in API requests. By default, fields with
  953. // empty values are omitted from API requests. However, any non-pointer,
  954. // non-interface field appearing in ForceSendFields will be sent to the
  955. // server regardless of whether the field is empty or not. This may be
  956. // used to include empty fields in Patch requests.
  957. ForceSendFields []string `json:"-"`
  958. // NullFields is a list of field names (e.g. "AccessCode") to include in
  959. // API requests with the JSON null value. By default, fields with empty
  960. // values are omitted from API requests. However, any field with an
  961. // empty value appearing in NullFields will be sent to the server as
  962. // null. It is an error if a field in this list has a non-empty value.
  963. // This may be used to include null fields in Patch requests.
  964. NullFields []string `json:"-"`
  965. }
  966. func (s *EntryPoint) MarshalJSON() ([]byte, error) {
  967. type NoMethod EntryPoint
  968. raw := NoMethod(*s)
  969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  970. }
  971. type Error struct {
  972. // Domain: Domain, or broad category, of the error.
  973. Domain string `json:"domain,omitempty"`
  974. // Reason: Specific reason for the error. Some of the possible values
  975. // are:
  976. // - "groupTooBig" - The group of users requested is too large for a
  977. // single query.
  978. // - "tooManyCalendarsRequested" - The number of calendars requested is
  979. // too large for a single query.
  980. // - "notFound" - The requested resource was not found.
  981. // - "internalError" - The API service has encountered an internal
  982. // error. Additional error types may be added in the future, so clients
  983. // should gracefully handle additional error statuses not included in
  984. // this list.
  985. Reason string `json:"reason,omitempty"`
  986. // ForceSendFields is a list of field names (e.g. "Domain") to
  987. // unconditionally include in API requests. By default, fields with
  988. // empty values are omitted from API requests. However, any non-pointer,
  989. // non-interface field appearing in ForceSendFields will be sent to the
  990. // server regardless of whether the field is empty or not. This may be
  991. // used to include empty fields in Patch requests.
  992. ForceSendFields []string `json:"-"`
  993. // NullFields is a list of field names (e.g. "Domain") to include in API
  994. // requests with the JSON null value. By default, fields with empty
  995. // values are omitted from API requests. However, any field with an
  996. // empty value appearing in NullFields will be sent to the server as
  997. // null. It is an error if a field in this list has a non-empty value.
  998. // This may be used to include null fields in Patch requests.
  999. NullFields []string `json:"-"`
  1000. }
  1001. func (s *Error) MarshalJSON() ([]byte, error) {
  1002. type NoMethod Error
  1003. raw := NoMethod(*s)
  1004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1005. }
  1006. type Event struct {
  1007. // AnyoneCanAddSelf: Whether anyone can invite themselves to the event
  1008. // (currently works for Google+ events only). Optional. The default is
  1009. // False.
  1010. AnyoneCanAddSelf bool `json:"anyoneCanAddSelf,omitempty"`
  1011. // Attachments: File attachments for the event. Currently only Google
  1012. // Drive attachments are supported.
  1013. // In order to modify attachments the supportsAttachments request
  1014. // parameter should be set to true.
  1015. // There can be at most 25 attachments per event,
  1016. Attachments []*EventAttachment `json:"attachments,omitempty"`
  1017. // Attendees: The attendees of the event. See the Events with attendees
  1018. // guide for more information on scheduling events with other calendar
  1019. // users.
  1020. Attendees []*EventAttendee `json:"attendees,omitempty"`
  1021. // AttendeesOmitted: Whether attendees may have been omitted from the
  1022. // event's representation. When retrieving an event, this may be due to
  1023. // a restriction specified by the maxAttendee query parameter. When
  1024. // updating an event, this can be used to only update the participant's
  1025. // response. Optional. The default is False.
  1026. AttendeesOmitted bool `json:"attendeesOmitted,omitempty"`
  1027. // ColorId: The color of the event. This is an ID referring to an entry
  1028. // in the event section of the colors definition (see the colors
  1029. // endpoint). Optional.
  1030. ColorId string `json:"colorId,omitempty"`
  1031. // ConferenceData: The conference-related information, such as details
  1032. // of a Hangouts Meet conference. To create new conference details use
  1033. // the createRequest field. To persist your changes, remember to set the
  1034. // conferenceDataVersion request parameter to 1 for all event
  1035. // modification requests.
  1036. ConferenceData *ConferenceData `json:"conferenceData,omitempty"`
  1037. // Created: Creation time of the event (as a RFC3339 timestamp).
  1038. // Read-only.
  1039. Created string `json:"created,omitempty"`
  1040. // Creator: The creator of the event. Read-only.
  1041. Creator *EventCreator `json:"creator,omitempty"`
  1042. // Description: Description of the event. Optional.
  1043. Description string `json:"description,omitempty"`
  1044. // End: The (exclusive) end time of the event. For a recurring event,
  1045. // this is the end time of the first instance.
  1046. End *EventDateTime `json:"end,omitempty"`
  1047. // EndTimeUnspecified: Whether the end time is actually unspecified. An
  1048. // end time is still provided for compatibility reasons, even if this
  1049. // attribute is set to True. The default is False.
  1050. EndTimeUnspecified bool `json:"endTimeUnspecified,omitempty"`
  1051. // Etag: ETag of the resource.
  1052. Etag string `json:"etag,omitempty"`
  1053. // ExtendedProperties: Extended properties of the event.
  1054. ExtendedProperties *EventExtendedProperties `json:"extendedProperties,omitempty"`
  1055. // Gadget: A gadget that extends this event.
  1056. Gadget *EventGadget `json:"gadget,omitempty"`
  1057. // GuestsCanInviteOthers: Whether attendees other than the organizer can
  1058. // invite others to the event. Optional. The default is True.
  1059. //
  1060. // Default: true
  1061. GuestsCanInviteOthers *bool `json:"guestsCanInviteOthers,omitempty"`
  1062. // GuestsCanModify: Whether attendees other than the organizer can
  1063. // modify the event. Optional. The default is False.
  1064. GuestsCanModify bool `json:"guestsCanModify,omitempty"`
  1065. // GuestsCanSeeOtherGuests: Whether attendees other than the organizer
  1066. // can see who the event's attendees are. Optional. The default is True.
  1067. //
  1068. // Default: true
  1069. GuestsCanSeeOtherGuests *bool `json:"guestsCanSeeOtherGuests,omitempty"`
  1070. // HangoutLink: An absolute link to the Google+ hangout associated with
  1071. // this event. Read-only.
  1072. HangoutLink string `json:"hangoutLink,omitempty"`
  1073. // HtmlLink: An absolute link to this event in the Google Calendar Web
  1074. // UI. Read-only.
  1075. HtmlLink string `json:"htmlLink,omitempty"`
  1076. // ICalUID: Event unique identifier as defined in RFC5545. It is used to
  1077. // uniquely identify events accross calendaring systems and must be
  1078. // supplied when importing events via the import method.
  1079. // Note that the icalUID and the id are not identical and only one of
  1080. // them should be supplied at event creation time. One difference in
  1081. // their semantics is that in recurring events, all occurrences of one
  1082. // event have different ids while they all share the same icalUIDs.
  1083. ICalUID string `json:"iCalUID,omitempty"`
  1084. // Id: Opaque identifier of the event. When creating new single or
  1085. // recurring events, you can specify their IDs. Provided IDs must follow
  1086. // these rules:
  1087. // - characters allowed in the ID are those used in base32hex encoding,
  1088. // i.e. lowercase letters a-v and digits 0-9, see section 3.1.2 in
  1089. // RFC2938
  1090. // - the length of the ID must be between 5 and 1024 characters
  1091. // - the ID must be unique per calendar Due to the globally distributed
  1092. // nature of the system, we cannot guarantee that ID collisions will be
  1093. // detected at event creation time. To minimize the risk of collisions
  1094. // we recommend using an established UUID algorithm such as one
  1095. // described in RFC4122.
  1096. // If you do not specify an ID, it will be automatically generated by
  1097. // the server.
  1098. // Note that the icalUID and the id are not identical and only one of
  1099. // them should be supplied at event creation time. One difference in
  1100. // their semantics is that in recurring events, all occurrences of one
  1101. // event have different ids while they all share the same icalUIDs.
  1102. Id string `json:"id,omitempty"`
  1103. // Kind: Type of the resource ("calendar#event").
  1104. Kind string `json:"kind,omitempty"`
  1105. // Location: Geographic location of the event as free-form text.
  1106. // Optional.
  1107. Location string `json:"location,omitempty"`
  1108. // Locked: Whether this is a locked event copy where no changes can be
  1109. // made to the main event fields "summary", "description", "location",
  1110. // "start", "end" or "recurrence". The default is False. Read-Only.
  1111. Locked bool `json:"locked,omitempty"`
  1112. // Organizer: The organizer of the event. If the organizer is also an
  1113. // attendee, this is indicated with a separate entry in attendees with
  1114. // the organizer field set to True. To change the organizer, use the
  1115. // move operation. Read-only, except when importing an event.
  1116. Organizer *EventOrganizer `json:"organizer,omitempty"`
  1117. // OriginalStartTime: For an instance of a recurring event, this is the
  1118. // time at which this event would start according to the recurrence data
  1119. // in the recurring event identified by recurringEventId. Immutable.
  1120. OriginalStartTime *EventDateTime `json:"originalStartTime,omitempty"`
  1121. // PrivateCopy: Whether this is a private event copy where changes are
  1122. // not shared with other copies on other calendars. Optional. Immutable.
  1123. // The default is False.
  1124. PrivateCopy bool `json:"privateCopy,omitempty"`
  1125. // Recurrence: List of RRULE, EXRULE, RDATE and EXDATE lines for a
  1126. // recurring event, as specified in RFC5545. Note that DTSTART and DTEND
  1127. // lines are not allowed in this field; event start and end times are
  1128. // specified in the start and end fields. This field is omitted for
  1129. // single events or instances of recurring events.
  1130. Recurrence []string `json:"recurrence,omitempty"`
  1131. // RecurringEventId: For an instance of a recurring event, this is the
  1132. // id of the recurring event to which this instance belongs. Immutable.
  1133. RecurringEventId string `json:"recurringEventId,omitempty"`
  1134. // Reminders: Information about the event's reminders for the
  1135. // authenticated user.
  1136. Reminders *EventReminders `json:"reminders,omitempty"`
  1137. // Sequence: Sequence number as per iCalendar.
  1138. Sequence int64 `json:"sequence,omitempty"`
  1139. // Source: Source from which the event was created. For example, a web
  1140. // page, an email message or any document identifiable by an URL with
  1141. // HTTP or HTTPS scheme. Can only be seen or modified by the creator of
  1142. // the event.
  1143. Source *EventSource `json:"source,omitempty"`
  1144. // Start: The (inclusive) start time of the event. For a recurring
  1145. // event, this is the start time of the first instance.
  1146. Start *EventDateTime `json:"start,omitempty"`
  1147. // Status: Status of the event. Optional. Possible values are:
  1148. // - "confirmed" - The event is confirmed. This is the default status.
  1149. //
  1150. // - "tentative" - The event is tentatively confirmed.
  1151. // - "cancelled" - The event is cancelled.
  1152. Status string `json:"status,omitempty"`
  1153. // Summary: Title of the event.
  1154. Summary string `json:"summary,omitempty"`
  1155. // Transparency: Whether the event blocks time on the calendar.
  1156. // Optional. Possible values are:
  1157. // - "opaque" - Default value. The event does block time on the
  1158. // calendar. This is equivalent to setting Show me as to Busy in the
  1159. // Calendar UI.
  1160. // - "transparent" - The event does not block time on the calendar. This
  1161. // is equivalent to setting Show me as to Available in the Calendar UI.
  1162. Transparency string `json:"transparency,omitempty"`
  1163. // Updated: Last modification time of the event (as a RFC3339
  1164. // timestamp). Read-only.
  1165. Updated string `json:"updated,omitempty"`
  1166. // Visibility: Visibility of the event. Optional. Possible values are:
  1167. //
  1168. // - "default" - Uses the default visibility for events on the calendar.
  1169. // This is the default value.
  1170. // - "public" - The event is public and event details are visible to all
  1171. // readers of the calendar.
  1172. // - "private" - The event is private and only event attendees may view
  1173. // event details.
  1174. // - "confidential" - The event is private. This value is provided for
  1175. // compatibility reasons.
  1176. Visibility string `json:"visibility,omitempty"`
  1177. // ServerResponse contains the HTTP response code and headers from the
  1178. // server.
  1179. googleapi.ServerResponse `json:"-"`
  1180. // ForceSendFields is a list of field names (e.g. "AnyoneCanAddSelf") to
  1181. // unconditionally include in API requests. By default, fields with
  1182. // empty values are omitted from API requests. However, any non-pointer,
  1183. // non-interface field appearing in ForceSendFields will be sent to the
  1184. // server regardless of whether the field is empty or not. This may be
  1185. // used to include empty fields in Patch requests.
  1186. ForceSendFields []string `json:"-"`
  1187. // NullFields is a list of field names (e.g. "AnyoneCanAddSelf") to
  1188. // include in API requests with the JSON null value. By default, fields
  1189. // with empty values are omitted from API requests. However, any field
  1190. // with an empty value appearing in NullFields will be sent to the
  1191. // server as null. It is an error if a field in this list has a
  1192. // non-empty value. This may be used to include null fields in Patch
  1193. // requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *Event) MarshalJSON() ([]byte, error) {
  1197. type NoMethod Event
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. // EventCreator: The creator of the event. Read-only.
  1202. type EventCreator struct {
  1203. // DisplayName: The creator's name, if available.
  1204. DisplayName string `json:"displayName,omitempty"`
  1205. // Email: The creator's email address, if available.
  1206. Email string `json:"email,omitempty"`
  1207. // Id: The creator's Profile ID, if available. It corresponds to theid
  1208. // field in the People collection of the Google+ API
  1209. Id string `json:"id,omitempty"`
  1210. // Self: Whether the creator corresponds to the calendar on which this
  1211. // copy of the event appears. Read-only. The default is False.
  1212. Self bool `json:"self,omitempty"`
  1213. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  1214. // unconditionally include in API requests. By default, fields with
  1215. // empty values are omitted from API requests. However, any non-pointer,
  1216. // non-interface field appearing in ForceSendFields will be sent to the
  1217. // server regardless of whether the field is empty or not. This may be
  1218. // used to include empty fields in Patch requests.
  1219. ForceSendFields []string `json:"-"`
  1220. // NullFields is a list of field names (e.g. "DisplayName") to include
  1221. // in API requests with the JSON null value. By default, fields with
  1222. // empty values are omitted from API requests. However, any field with
  1223. // an empty value appearing in NullFields will be sent to the server as
  1224. // null. It is an error if a field in this list has a non-empty value.
  1225. // This may be used to include null fields in Patch requests.
  1226. NullFields []string `json:"-"`
  1227. }
  1228. func (s *EventCreator) MarshalJSON() ([]byte, error) {
  1229. type NoMethod EventCreator
  1230. raw := NoMethod(*s)
  1231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1232. }
  1233. // EventExtendedProperties: Extended properties of the event.
  1234. type EventExtendedProperties struct {
  1235. // Private: Properties that are private to the copy of the event that
  1236. // appears on this calendar.
  1237. Private map[string]string `json:"private,omitempty"`
  1238. // Shared: Properties that are shared between copies of the event on
  1239. // other attendees' calendars.
  1240. Shared map[string]string `json:"shared,omitempty"`
  1241. // ForceSendFields is a list of field names (e.g. "Private") to
  1242. // unconditionally include in API requests. By default, fields with
  1243. // empty values are omitted from API requests. However, any non-pointer,
  1244. // non-interface field appearing in ForceSendFields will be sent to the
  1245. // server regardless of whether the field is empty or not. This may be
  1246. // used to include empty fields in Patch requests.
  1247. ForceSendFields []string `json:"-"`
  1248. // NullFields is a list of field names (e.g. "Private") to include in
  1249. // API requests with the JSON null value. By default, fields with empty
  1250. // values are omitted from API requests. However, any field with an
  1251. // empty value appearing in NullFields will be sent to the server as
  1252. // null. It is an error if a field in this list has a non-empty value.
  1253. // This may be used to include null fields in Patch requests.
  1254. NullFields []string `json:"-"`
  1255. }
  1256. func (s *EventExtendedProperties) MarshalJSON() ([]byte, error) {
  1257. type NoMethod EventExtendedProperties
  1258. raw := NoMethod(*s)
  1259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1260. }
  1261. // EventGadget: A gadget that extends this event.
  1262. type EventGadget struct {
  1263. // Display: The gadget's display mode. Optional. Possible values are:
  1264. //
  1265. // - "icon" - The gadget displays next to the event's title in the
  1266. // calendar view.
  1267. // - "chip" - The gadget displays when the event is clicked.
  1268. Display string `json:"display,omitempty"`
  1269. // Height: The gadget's height in pixels. The height must be an integer
  1270. // greater than 0. Optional.
  1271. Height int64 `json:"height,omitempty"`
  1272. // IconLink: The gadget's icon URL. The URL scheme must be HTTPS.
  1273. IconLink string `json:"iconLink,omitempty"`
  1274. // Link: The gadget's URL. The URL scheme must be HTTPS.
  1275. Link string `json:"link,omitempty"`
  1276. // Preferences: Preferences.
  1277. Preferences map[string]string `json:"preferences,omitempty"`
  1278. // Title: The gadget's title.
  1279. Title string `json:"title,omitempty"`
  1280. // Type: The gadget's type.
  1281. Type string `json:"type,omitempty"`
  1282. // Width: The gadget's width in pixels. The width must be an integer
  1283. // greater than 0. Optional.
  1284. Width int64 `json:"width,omitempty"`
  1285. // ForceSendFields is a list of field names (e.g. "Display") to
  1286. // unconditionally include in API requests. By default, fields with
  1287. // empty values are omitted from API requests. However, any non-pointer,
  1288. // non-interface field appearing in ForceSendFields will be sent to the
  1289. // server regardless of whether the field is empty or not. This may be
  1290. // used to include empty fields in Patch requests.
  1291. ForceSendFields []string `json:"-"`
  1292. // NullFields is a list of field names (e.g. "Display") to include in
  1293. // API requests with the JSON null value. By default, fields with empty
  1294. // values are omitted from API requests. However, any field with an
  1295. // empty value appearing in NullFields will be sent to the server as
  1296. // null. It is an error if a field in this list has a non-empty value.
  1297. // This may be used to include null fields in Patch requests.
  1298. NullFields []string `json:"-"`
  1299. }
  1300. func (s *EventGadget) MarshalJSON() ([]byte, error) {
  1301. type NoMethod EventGadget
  1302. raw := NoMethod(*s)
  1303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1304. }
  1305. // EventOrganizer: The organizer of the event. If the organizer is also
  1306. // an attendee, this is indicated with a separate entry in attendees
  1307. // with the organizer field set to True. To change the organizer, use
  1308. // the move operation. Read-only, except when importing an event.
  1309. type EventOrganizer struct {
  1310. // DisplayName: The organizer's name, if available.
  1311. DisplayName string `json:"displayName,omitempty"`
  1312. // Email: The organizer's email address, if available. It must be a
  1313. // valid email address as per RFC5322.
  1314. Email string `json:"email,omitempty"`
  1315. // Id: The organizer's Profile ID, if available. It corresponds to theid
  1316. // field in the People collection of the Google+ API
  1317. Id string `json:"id,omitempty"`
  1318. // Self: Whether the organizer corresponds to the calendar on which this
  1319. // copy of the event appears. Read-only. The default is False.
  1320. Self bool `json:"self,omitempty"`
  1321. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  1322. // unconditionally include in API requests. By default, fields with
  1323. // empty values are omitted from API requests. However, any non-pointer,
  1324. // non-interface field appearing in ForceSendFields will be sent to the
  1325. // server regardless of whether the field is empty or not. This may be
  1326. // used to include empty fields in Patch requests.
  1327. ForceSendFields []string `json:"-"`
  1328. // NullFields is a list of field names (e.g. "DisplayName") to include
  1329. // in API requests with the JSON null value. By default, fields with
  1330. // empty values are omitted from API requests. However, any field with
  1331. // an empty value appearing in NullFields will be sent to the server as
  1332. // null. It is an error if a field in this list has a non-empty value.
  1333. // This may be used to include null fields in Patch requests.
  1334. NullFields []string `json:"-"`
  1335. }
  1336. func (s *EventOrganizer) MarshalJSON() ([]byte, error) {
  1337. type NoMethod EventOrganizer
  1338. raw := NoMethod(*s)
  1339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1340. }
  1341. // EventReminders: Information about the event's reminders for the
  1342. // authenticated user.
  1343. type EventReminders struct {
  1344. // Overrides: If the event doesn't use the default reminders, this lists
  1345. // the reminders specific to the event, or, if not set, indicates that
  1346. // no reminders are set for this event. The maximum number of override
  1347. // reminders is 5.
  1348. Overrides []*EventReminder `json:"overrides,omitempty"`
  1349. // UseDefault: Whether the default reminders of the calendar apply to
  1350. // the event.
  1351. UseDefault bool `json:"useDefault,omitempty"`
  1352. // ForceSendFields is a list of field names (e.g. "Overrides") to
  1353. // unconditionally include in API requests. By default, fields with
  1354. // empty values are omitted from API requests. However, any non-pointer,
  1355. // non-interface field appearing in ForceSendFields will be sent to the
  1356. // server regardless of whether the field is empty or not. This may be
  1357. // used to include empty fields in Patch requests.
  1358. ForceSendFields []string `json:"-"`
  1359. // NullFields is a list of field names (e.g. "Overrides") to include in
  1360. // API requests with the JSON null value. By default, fields with empty
  1361. // values are omitted from API requests. However, any field with an
  1362. // empty value appearing in NullFields will be sent to the server as
  1363. // null. It is an error if a field in this list has a non-empty value.
  1364. // This may be used to include null fields in Patch requests.
  1365. NullFields []string `json:"-"`
  1366. }
  1367. func (s *EventReminders) MarshalJSON() ([]byte, error) {
  1368. type NoMethod EventReminders
  1369. raw := NoMethod(*s)
  1370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1371. }
  1372. // EventSource: Source from which the event was created. For example, a
  1373. // web page, an email message or any document identifiable by an URL
  1374. // with HTTP or HTTPS scheme. Can only be seen or modified by the
  1375. // creator of the event.
  1376. type EventSource struct {
  1377. // Title: Title of the source; for example a title of a web page or an
  1378. // email subject.
  1379. Title string `json:"title,omitempty"`
  1380. // Url: URL of the source pointing to a resource. The URL scheme must be
  1381. // HTTP or HTTPS.
  1382. Url string `json:"url,omitempty"`
  1383. // ForceSendFields is a list of field names (e.g. "Title") to
  1384. // unconditionally include in API requests. By default, fields with
  1385. // empty values are omitted from API requests. However, any non-pointer,
  1386. // non-interface field appearing in ForceSendFields will be sent to the
  1387. // server regardless of whether the field is empty or not. This may be
  1388. // used to include empty fields in Patch requests.
  1389. ForceSendFields []string `json:"-"`
  1390. // NullFields is a list of field names (e.g. "Title") to include in API
  1391. // requests with the JSON null value. By default, fields with empty
  1392. // values are omitted from API requests. However, any field with an
  1393. // empty value appearing in NullFields will be sent to the server as
  1394. // null. It is an error if a field in this list has a non-empty value.
  1395. // This may be used to include null fields in Patch requests.
  1396. NullFields []string `json:"-"`
  1397. }
  1398. func (s *EventSource) MarshalJSON() ([]byte, error) {
  1399. type NoMethod EventSource
  1400. raw := NoMethod(*s)
  1401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1402. }
  1403. type EventAttachment struct {
  1404. // FileId: ID of the attached file. Read-only.
  1405. // For Google Drive files, this is the ID of the corresponding Files
  1406. // resource entry in the Drive API.
  1407. FileId string `json:"fileId,omitempty"`
  1408. // FileUrl: URL link to the attachment.
  1409. // For adding Google Drive file attachments use the same format as in
  1410. // alternateLink property of the Files resource in the Drive API.
  1411. FileUrl string `json:"fileUrl,omitempty"`
  1412. // IconLink: URL link to the attachment's icon. Read-only.
  1413. IconLink string `json:"iconLink,omitempty"`
  1414. // MimeType: Internet media type (MIME type) of the attachment.
  1415. MimeType string `json:"mimeType,omitempty"`
  1416. // Title: Attachment title.
  1417. Title string `json:"title,omitempty"`
  1418. // ForceSendFields is a list of field names (e.g. "FileId") to
  1419. // unconditionally include in API requests. By default, fields with
  1420. // empty values are omitted from API requests. However, any non-pointer,
  1421. // non-interface field appearing in ForceSendFields will be sent to the
  1422. // server regardless of whether the field is empty or not. This may be
  1423. // used to include empty fields in Patch requests.
  1424. ForceSendFields []string `json:"-"`
  1425. // NullFields is a list of field names (e.g. "FileId") to include in API
  1426. // requests with the JSON null value. By default, fields with empty
  1427. // values are omitted from API requests. However, any field with an
  1428. // empty value appearing in NullFields will be sent to the server as
  1429. // null. It is an error if a field in this list has a non-empty value.
  1430. // This may be used to include null fields in Patch requests.
  1431. NullFields []string `json:"-"`
  1432. }
  1433. func (s *EventAttachment) MarshalJSON() ([]byte, error) {
  1434. type NoMethod EventAttachment
  1435. raw := NoMethod(*s)
  1436. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1437. }
  1438. type EventAttendee struct {
  1439. // AdditionalGuests: Number of additional guests. Optional. The default
  1440. // is 0.
  1441. AdditionalGuests int64 `json:"additionalGuests,omitempty"`
  1442. // Comment: The attendee's response comment. Optional.
  1443. Comment string `json:"comment,omitempty"`
  1444. // DisplayName: The attendee's name, if available. Optional.
  1445. DisplayName string `json:"displayName,omitempty"`
  1446. // Email: The attendee's email address, if available. This field must be
  1447. // present when adding an attendee. It must be a valid email address as
  1448. // per RFC5322.
  1449. Email string `json:"email,omitempty"`
  1450. // Id: The attendee's Profile ID, if available. It corresponds to theid
  1451. // field in the People collection of the Google+ API
  1452. Id string `json:"id,omitempty"`
  1453. // Optional: Whether this is an optional attendee. Optional. The default
  1454. // is False.
  1455. Optional bool `json:"optional,omitempty"`
  1456. // Organizer: Whether the attendee is the organizer of the event.
  1457. // Read-only. The default is False.
  1458. Organizer bool `json:"organizer,omitempty"`
  1459. // Resource: Whether the attendee is a resource. Can only be set when
  1460. // the attendee is added to the event for the first time. Subsequent
  1461. // modifications are ignored. Optional. The default is False.
  1462. Resource bool `json:"resource,omitempty"`
  1463. // ResponseStatus: The attendee's response status. Possible values are:
  1464. //
  1465. // - "needsAction" - The attendee has not responded to the invitation.
  1466. //
  1467. // - "declined" - The attendee has declined the invitation.
  1468. // - "tentative" - The attendee has tentatively accepted the invitation.
  1469. //
  1470. // - "accepted" - The attendee has accepted the invitation.
  1471. ResponseStatus string `json:"responseStatus,omitempty"`
  1472. // Self: Whether this entry represents the calendar on which this copy
  1473. // of the event appears. Read-only. The default is False.
  1474. Self bool `json:"self,omitempty"`
  1475. // ForceSendFields is a list of field names (e.g. "AdditionalGuests") to
  1476. // unconditionally include in API requests. By default, fields with
  1477. // empty values are omitted from API requests. However, any non-pointer,
  1478. // non-interface field appearing in ForceSendFields will be sent to the
  1479. // server regardless of whether the field is empty or not. This may be
  1480. // used to include empty fields in Patch requests.
  1481. ForceSendFields []string `json:"-"`
  1482. // NullFields is a list of field names (e.g. "AdditionalGuests") to
  1483. // include in API requests with the JSON null value. By default, fields
  1484. // with empty values are omitted from API requests. However, any field
  1485. // with an empty value appearing in NullFields will be sent to the
  1486. // server as null. It is an error if a field in this list has a
  1487. // non-empty value. This may be used to include null fields in Patch
  1488. // requests.
  1489. NullFields []string `json:"-"`
  1490. }
  1491. func (s *EventAttendee) MarshalJSON() ([]byte, error) {
  1492. type NoMethod EventAttendee
  1493. raw := NoMethod(*s)
  1494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1495. }
  1496. type EventDateTime struct {
  1497. // Date: The date, in the format "yyyy-mm-dd", if this is an all-day
  1498. // event.
  1499. Date string `json:"date,omitempty"`
  1500. // DateTime: The time, as a combined date-time value (formatted
  1501. // according to RFC3339). A time zone offset is required unless a time
  1502. // zone is explicitly specified in timeZone.
  1503. DateTime string `json:"dateTime,omitempty"`
  1504. // TimeZone: The time zone in which the time is specified. (Formatted as
  1505. // an IANA Time Zone Database name, e.g. "Europe/Zurich".) For recurring
  1506. // events this field is required and specifies the time zone in which
  1507. // the recurrence is expanded. For single events this field is optional
  1508. // and indicates a custom time zone for the event start/end.
  1509. TimeZone string `json:"timeZone,omitempty"`
  1510. // ForceSendFields is a list of field names (e.g. "Date") to
  1511. // unconditionally include in API requests. By default, fields with
  1512. // empty values are omitted from API requests. However, any non-pointer,
  1513. // non-interface field appearing in ForceSendFields will be sent to the
  1514. // server regardless of whether the field is empty or not. This may be
  1515. // used to include empty fields in Patch requests.
  1516. ForceSendFields []string `json:"-"`
  1517. // NullFields is a list of field names (e.g. "Date") to include in API
  1518. // requests with the JSON null value. By default, fields with empty
  1519. // values are omitted from API requests. However, any field with an
  1520. // empty value appearing in NullFields will be sent to the server as
  1521. // null. It is an error if a field in this list has a non-empty value.
  1522. // This may be used to include null fields in Patch requests.
  1523. NullFields []string `json:"-"`
  1524. }
  1525. func (s *EventDateTime) MarshalJSON() ([]byte, error) {
  1526. type NoMethod EventDateTime
  1527. raw := NoMethod(*s)
  1528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1529. }
  1530. type EventReminder struct {
  1531. // Method: The method used by this reminder. Possible values are:
  1532. // - "email" - Reminders are sent via email.
  1533. // - "sms" - Reminders are sent via SMS. These are only available for G
  1534. // Suite customers. Requests to set SMS reminders for other account
  1535. // types are ignored.
  1536. // - "popup" - Reminders are sent via a UI popup.
  1537. Method string `json:"method,omitempty"`
  1538. // Minutes: Number of minutes before the start of the event when the
  1539. // reminder should trigger. Valid values are between 0 and 40320 (4
  1540. // weeks in minutes).
  1541. Minutes int64 `json:"minutes,omitempty"`
  1542. // ForceSendFields is a list of field names (e.g. "Method") to
  1543. // unconditionally include in API requests. By default, fields with
  1544. // empty values are omitted from API requests. However, any non-pointer,
  1545. // non-interface field appearing in ForceSendFields will be sent to the
  1546. // server regardless of whether the field is empty or not. This may be
  1547. // used to include empty fields in Patch requests.
  1548. ForceSendFields []string `json:"-"`
  1549. // NullFields is a list of field names (e.g. "Method") to include in API
  1550. // requests with the JSON null value. By default, fields with empty
  1551. // values are omitted from API requests. However, any field with an
  1552. // empty value appearing in NullFields will be sent to the server as
  1553. // null. It is an error if a field in this list has a non-empty value.
  1554. // This may be used to include null fields in Patch requests.
  1555. NullFields []string `json:"-"`
  1556. }
  1557. func (s *EventReminder) MarshalJSON() ([]byte, error) {
  1558. type NoMethod EventReminder
  1559. raw := NoMethod(*s)
  1560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1561. }
  1562. type Events struct {
  1563. // AccessRole: The user's access role for this calendar. Read-only.
  1564. // Possible values are:
  1565. // - "none" - The user has no access.
  1566. // - "freeBusyReader" - The user has read access to free/busy
  1567. // information.
  1568. // - "reader" - The user has read access to the calendar. Private events
  1569. // will appear to users with reader access, but event details will be
  1570. // hidden.
  1571. // - "writer" - The user has read and write access to the calendar.
  1572. // Private events will appear to users with writer access, and event
  1573. // details will be visible.
  1574. // - "owner" - The user has ownership of the calendar. This role has all
  1575. // of the permissions of the writer role with the additional ability to
  1576. // see and manipulate ACLs.
  1577. AccessRole string `json:"accessRole,omitempty"`
  1578. // DefaultReminders: The default reminders on the calendar for the
  1579. // authenticated user. These reminders apply to all events on this
  1580. // calendar that do not explicitly override them (i.e. do not have
  1581. // reminders.useDefault set to True).
  1582. DefaultReminders []*EventReminder `json:"defaultReminders,omitempty"`
  1583. // Description: Description of the calendar. Read-only.
  1584. Description string `json:"description,omitempty"`
  1585. // Etag: ETag of the collection.
  1586. Etag string `json:"etag,omitempty"`
  1587. // Items: List of events on the calendar.
  1588. Items []*Event `json:"items,omitempty"`
  1589. // Kind: Type of the collection ("calendar#events").
  1590. Kind string `json:"kind,omitempty"`
  1591. // NextPageToken: Token used to access the next page of this result.
  1592. // Omitted if no further results are available, in which case
  1593. // nextSyncToken is provided.
  1594. NextPageToken string `json:"nextPageToken,omitempty"`
  1595. // NextSyncToken: Token used at a later point in time to retrieve only
  1596. // the entries that have changed since this result was returned. Omitted
  1597. // if further results are available, in which case nextPageToken is
  1598. // provided.
  1599. NextSyncToken string `json:"nextSyncToken,omitempty"`
  1600. // Summary: Title of the calendar. Read-only.
  1601. Summary string `json:"summary,omitempty"`
  1602. // TimeZone: The time zone of the calendar. Read-only.
  1603. TimeZone string `json:"timeZone,omitempty"`
  1604. // Updated: Last modification time of the calendar (as a RFC3339
  1605. // timestamp). Read-only.
  1606. Updated string `json:"updated,omitempty"`
  1607. // ServerResponse contains the HTTP response code and headers from the
  1608. // server.
  1609. googleapi.ServerResponse `json:"-"`
  1610. // ForceSendFields is a list of field names (e.g. "AccessRole") to
  1611. // unconditionally include in API requests. By default, fields with
  1612. // empty values are omitted from API requests. However, any non-pointer,
  1613. // non-interface field appearing in ForceSendFields will be sent to the
  1614. // server regardless of whether the field is empty or not. This may be
  1615. // used to include empty fields in Patch requests.
  1616. ForceSendFields []string `json:"-"`
  1617. // NullFields is a list of field names (e.g. "AccessRole") to include in
  1618. // API requests with the JSON null value. By default, fields with empty
  1619. // values are omitted from API requests. However, any field with an
  1620. // empty value appearing in NullFields will be sent to the server as
  1621. // null. It is an error if a field in this list has a non-empty value.
  1622. // This may be used to include null fields in Patch requests.
  1623. NullFields []string `json:"-"`
  1624. }
  1625. func (s *Events) MarshalJSON() ([]byte, error) {
  1626. type NoMethod Events
  1627. raw := NoMethod(*s)
  1628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1629. }
  1630. type FreeBusyCalendar struct {
  1631. // Busy: List of time ranges during which this calendar should be
  1632. // regarded as busy.
  1633. Busy []*TimePeriod `json:"busy,omitempty"`
  1634. // Errors: Optional error(s) (if computation for the calendar failed).
  1635. Errors []*Error `json:"errors,omitempty"`
  1636. // ForceSendFields is a list of field names (e.g. "Busy") to
  1637. // unconditionally include in API requests. By default, fields with
  1638. // empty values are omitted from API requests. However, any non-pointer,
  1639. // non-interface field appearing in ForceSendFields will be sent to the
  1640. // server regardless of whether the field is empty or not. This may be
  1641. // used to include empty fields in Patch requests.
  1642. ForceSendFields []string `json:"-"`
  1643. // NullFields is a list of field names (e.g. "Busy") to include in API
  1644. // requests with the JSON null value. By default, fields with empty
  1645. // values are omitted from API requests. However, any field with an
  1646. // empty value appearing in NullFields will be sent to the server as
  1647. // null. It is an error if a field in this list has a non-empty value.
  1648. // This may be used to include null fields in Patch requests.
  1649. NullFields []string `json:"-"`
  1650. }
  1651. func (s *FreeBusyCalendar) MarshalJSON() ([]byte, error) {
  1652. type NoMethod FreeBusyCalendar
  1653. raw := NoMethod(*s)
  1654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1655. }
  1656. type FreeBusyGroup struct {
  1657. // Calendars: List of calendars' identifiers within a group.
  1658. Calendars []string `json:"calendars,omitempty"`
  1659. // Errors: Optional error(s) (if computation for the group failed).
  1660. Errors []*Error `json:"errors,omitempty"`
  1661. // ForceSendFields is a list of field names (e.g. "Calendars") to
  1662. // unconditionally include in API requests. By default, fields with
  1663. // empty values are omitted from API requests. However, any non-pointer,
  1664. // non-interface field appearing in ForceSendFields will be sent to the
  1665. // server regardless of whether the field is empty or not. This may be
  1666. // used to include empty fields in Patch requests.
  1667. ForceSendFields []string `json:"-"`
  1668. // NullFields is a list of field names (e.g. "Calendars") to include in
  1669. // API requests with the JSON null value. By default, fields with empty
  1670. // values are omitted from API requests. However, any field with an
  1671. // empty value appearing in NullFields will be sent to the server as
  1672. // null. It is an error if a field in this list has a non-empty value.
  1673. // This may be used to include null fields in Patch requests.
  1674. NullFields []string `json:"-"`
  1675. }
  1676. func (s *FreeBusyGroup) MarshalJSON() ([]byte, error) {
  1677. type NoMethod FreeBusyGroup
  1678. raw := NoMethod(*s)
  1679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1680. }
  1681. type FreeBusyRequest struct {
  1682. // CalendarExpansionMax: Maximal number of calendars for which FreeBusy
  1683. // information is to be provided. Optional.
  1684. CalendarExpansionMax int64 `json:"calendarExpansionMax,omitempty"`
  1685. // GroupExpansionMax: Maximal number of calendar identifiers to be
  1686. // provided for a single group. Optional. An error will be returned for
  1687. // a group with more members than this value.
  1688. GroupExpansionMax int64 `json:"groupExpansionMax,omitempty"`
  1689. // Items: List of calendars and/or groups to query.
  1690. Items []*FreeBusyRequestItem `json:"items,omitempty"`
  1691. // TimeMax: The end of the interval for the query.
  1692. TimeMax string `json:"timeMax,omitempty"`
  1693. // TimeMin: The start of the interval for the query.
  1694. TimeMin string `json:"timeMin,omitempty"`
  1695. // TimeZone: Time zone used in the response. Optional. The default is
  1696. // UTC.
  1697. TimeZone string `json:"timeZone,omitempty"`
  1698. // ForceSendFields is a list of field names (e.g.
  1699. // "CalendarExpansionMax") to unconditionally include in API requests.
  1700. // By default, fields with empty values are omitted from API requests.
  1701. // However, any non-pointer, non-interface field appearing in
  1702. // ForceSendFields will be sent to the server regardless of whether the
  1703. // field is empty or not. This may be used to include empty fields in
  1704. // Patch requests.
  1705. ForceSendFields []string `json:"-"`
  1706. // NullFields is a list of field names (e.g. "CalendarExpansionMax") to
  1707. // include in API requests with the JSON null value. By default, fields
  1708. // with empty values are omitted from API requests. However, any field
  1709. // with an empty value appearing in NullFields will be sent to the
  1710. // server as null. It is an error if a field in this list has a
  1711. // non-empty value. This may be used to include null fields in Patch
  1712. // requests.
  1713. NullFields []string `json:"-"`
  1714. }
  1715. func (s *FreeBusyRequest) MarshalJSON() ([]byte, error) {
  1716. type NoMethod FreeBusyRequest
  1717. raw := NoMethod(*s)
  1718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1719. }
  1720. type FreeBusyRequestItem struct {
  1721. // Id: The identifier of a calendar or a group.
  1722. Id string `json:"id,omitempty"`
  1723. // ForceSendFields is a list of field names (e.g. "Id") to
  1724. // unconditionally include in API requests. By default, fields with
  1725. // empty values are omitted from API requests. However, any non-pointer,
  1726. // non-interface field appearing in ForceSendFields will be sent to the
  1727. // server regardless of whether the field is empty or not. This may be
  1728. // used to include empty fields in Patch requests.
  1729. ForceSendFields []string `json:"-"`
  1730. // NullFields is a list of field names (e.g. "Id") to include in API
  1731. // requests with the JSON null value. By default, fields with empty
  1732. // values are omitted from API requests. However, any field with an
  1733. // empty value appearing in NullFields will be sent to the server as
  1734. // null. It is an error if a field in this list has a non-empty value.
  1735. // This may be used to include null fields in Patch requests.
  1736. NullFields []string `json:"-"`
  1737. }
  1738. func (s *FreeBusyRequestItem) MarshalJSON() ([]byte, error) {
  1739. type NoMethod FreeBusyRequestItem
  1740. raw := NoMethod(*s)
  1741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1742. }
  1743. type FreeBusyResponse struct {
  1744. // Calendars: List of free/busy information for calendars.
  1745. Calendars map[string]FreeBusyCalendar `json:"calendars,omitempty"`
  1746. // Groups: Expansion of groups.
  1747. Groups map[string]FreeBusyGroup `json:"groups,omitempty"`
  1748. // Kind: Type of the resource ("calendar#freeBusy").
  1749. Kind string `json:"kind,omitempty"`
  1750. // TimeMax: The end of the interval.
  1751. TimeMax string `json:"timeMax,omitempty"`
  1752. // TimeMin: The start of the interval.
  1753. TimeMin string `json:"timeMin,omitempty"`
  1754. // ServerResponse contains the HTTP response code and headers from the
  1755. // server.
  1756. googleapi.ServerResponse `json:"-"`
  1757. // ForceSendFields is a list of field names (e.g. "Calendars") to
  1758. // unconditionally include in API requests. By default, fields with
  1759. // empty values are omitted from API requests. However, any non-pointer,
  1760. // non-interface field appearing in ForceSendFields will be sent to the
  1761. // server regardless of whether the field is empty or not. This may be
  1762. // used to include empty fields in Patch requests.
  1763. ForceSendFields []string `json:"-"`
  1764. // NullFields is a list of field names (e.g. "Calendars") to include in
  1765. // API requests with the JSON null value. By default, fields with empty
  1766. // values are omitted from API requests. However, any field with an
  1767. // empty value appearing in NullFields will be sent to the server as
  1768. // null. It is an error if a field in this list has a non-empty value.
  1769. // This may be used to include null fields in Patch requests.
  1770. NullFields []string `json:"-"`
  1771. }
  1772. func (s *FreeBusyResponse) MarshalJSON() ([]byte, error) {
  1773. type NoMethod FreeBusyResponse
  1774. raw := NoMethod(*s)
  1775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1776. }
  1777. type Setting struct {
  1778. // Etag: ETag of the resource.
  1779. Etag string `json:"etag,omitempty"`
  1780. // Id: The id of the user setting.
  1781. Id string `json:"id,omitempty"`
  1782. // Kind: Type of the resource ("calendar#setting").
  1783. Kind string `json:"kind,omitempty"`
  1784. // Value: Value of the user setting. The format of the value depends on
  1785. // the ID of the setting. It must always be a UTF-8 string of length up
  1786. // to 1024 characters.
  1787. Value string `json:"value,omitempty"`
  1788. // ServerResponse contains the HTTP response code and headers from the
  1789. // server.
  1790. googleapi.ServerResponse `json:"-"`
  1791. // ForceSendFields is a list of field names (e.g. "Etag") to
  1792. // unconditionally include in API requests. By default, fields with
  1793. // empty values are omitted from API requests. However, any non-pointer,
  1794. // non-interface field appearing in ForceSendFields will be sent to the
  1795. // server regardless of whether the field is empty or not. This may be
  1796. // used to include empty fields in Patch requests.
  1797. ForceSendFields []string `json:"-"`
  1798. // NullFields is a list of field names (e.g. "Etag") to include in API
  1799. // requests with the JSON null value. By default, fields with empty
  1800. // values are omitted from API requests. However, any field with an
  1801. // empty value appearing in NullFields will be sent to the server as
  1802. // null. It is an error if a field in this list has a non-empty value.
  1803. // This may be used to include null fields in Patch requests.
  1804. NullFields []string `json:"-"`
  1805. }
  1806. func (s *Setting) MarshalJSON() ([]byte, error) {
  1807. type NoMethod Setting
  1808. raw := NoMethod(*s)
  1809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1810. }
  1811. type Settings struct {
  1812. // Etag: Etag of the collection.
  1813. Etag string `json:"etag,omitempty"`
  1814. // Items: List of user settings.
  1815. Items []*Setting `json:"items,omitempty"`
  1816. // Kind: Type of the collection ("calendar#settings").
  1817. Kind string `json:"kind,omitempty"`
  1818. // NextPageToken: Token used to access the next page of this result.
  1819. // Omitted if no further results are available, in which case
  1820. // nextSyncToken is provided.
  1821. NextPageToken string `json:"nextPageToken,omitempty"`
  1822. // NextSyncToken: Token used at a later point in time to retrieve only
  1823. // the entries that have changed since this result was returned. Omitted
  1824. // if further results are available, in which case nextPageToken is
  1825. // provided.
  1826. NextSyncToken string `json:"nextSyncToken,omitempty"`
  1827. // ServerResponse contains the HTTP response code and headers from the
  1828. // server.
  1829. googleapi.ServerResponse `json:"-"`
  1830. // ForceSendFields is a list of field names (e.g. "Etag") to
  1831. // unconditionally include in API requests. By default, fields with
  1832. // empty values are omitted from API requests. However, any non-pointer,
  1833. // non-interface field appearing in ForceSendFields will be sent to the
  1834. // server regardless of whether the field is empty or not. This may be
  1835. // used to include empty fields in Patch requests.
  1836. ForceSendFields []string `json:"-"`
  1837. // NullFields is a list of field names (e.g. "Etag") to include in API
  1838. // requests with the JSON null value. By default, fields with empty
  1839. // values are omitted from API requests. However, any field with an
  1840. // empty value appearing in NullFields will be sent to the server as
  1841. // null. It is an error if a field in this list has a non-empty value.
  1842. // This may be used to include null fields in Patch requests.
  1843. NullFields []string `json:"-"`
  1844. }
  1845. func (s *Settings) MarshalJSON() ([]byte, error) {
  1846. type NoMethod Settings
  1847. raw := NoMethod(*s)
  1848. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1849. }
  1850. type TimePeriod struct {
  1851. // End: The (exclusive) end of the time period.
  1852. End string `json:"end,omitempty"`
  1853. // Start: The (inclusive) start of the time period.
  1854. Start string `json:"start,omitempty"`
  1855. // ForceSendFields is a list of field names (e.g. "End") to
  1856. // unconditionally include in API requests. By default, fields with
  1857. // empty values are omitted from API requests. However, any non-pointer,
  1858. // non-interface field appearing in ForceSendFields will be sent to the
  1859. // server regardless of whether the field is empty or not. This may be
  1860. // used to include empty fields in Patch requests.
  1861. ForceSendFields []string `json:"-"`
  1862. // NullFields is a list of field names (e.g. "End") to include in API
  1863. // requests with the JSON null value. By default, fields with empty
  1864. // values are omitted from API requests. However, any field with an
  1865. // empty value appearing in NullFields will be sent to the server as
  1866. // null. It is an error if a field in this list has a non-empty value.
  1867. // This may be used to include null fields in Patch requests.
  1868. NullFields []string `json:"-"`
  1869. }
  1870. func (s *TimePeriod) MarshalJSON() ([]byte, error) {
  1871. type NoMethod TimePeriod
  1872. raw := NoMethod(*s)
  1873. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1874. }
  1875. // method id "calendar.acl.delete":
  1876. type AclDeleteCall struct {
  1877. s *Service
  1878. calendarId string
  1879. ruleId string
  1880. urlParams_ gensupport.URLParams
  1881. ctx_ context.Context
  1882. header_ http.Header
  1883. }
  1884. // Delete: Deletes an access control rule.
  1885. func (r *AclService) Delete(calendarId string, ruleId string) *AclDeleteCall {
  1886. c := &AclDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1887. c.calendarId = calendarId
  1888. c.ruleId = ruleId
  1889. return c
  1890. }
  1891. // Fields allows partial responses to be retrieved. See
  1892. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1893. // for more information.
  1894. func (c *AclDeleteCall) Fields(s ...googleapi.Field) *AclDeleteCall {
  1895. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1896. return c
  1897. }
  1898. // Context sets the context to be used in this call's Do method. Any
  1899. // pending HTTP request will be aborted if the provided context is
  1900. // canceled.
  1901. func (c *AclDeleteCall) Context(ctx context.Context) *AclDeleteCall {
  1902. c.ctx_ = ctx
  1903. return c
  1904. }
  1905. // Header returns an http.Header that can be modified by the caller to
  1906. // add HTTP headers to the request.
  1907. func (c *AclDeleteCall) Header() http.Header {
  1908. if c.header_ == nil {
  1909. c.header_ = make(http.Header)
  1910. }
  1911. return c.header_
  1912. }
  1913. func (c *AclDeleteCall) doRequest(alt string) (*http.Response, error) {
  1914. reqHeaders := make(http.Header)
  1915. for k, v := range c.header_ {
  1916. reqHeaders[k] = v
  1917. }
  1918. reqHeaders.Set("User-Agent", c.s.userAgent())
  1919. var body io.Reader = nil
  1920. c.urlParams_.Set("alt", alt)
  1921. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
  1922. urls += "?" + c.urlParams_.Encode()
  1923. req, _ := http.NewRequest("DELETE", urls, body)
  1924. req.Header = reqHeaders
  1925. googleapi.Expand(req.URL, map[string]string{
  1926. "calendarId": c.calendarId,
  1927. "ruleId": c.ruleId,
  1928. })
  1929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1930. }
  1931. // Do executes the "calendar.acl.delete" call.
  1932. func (c *AclDeleteCall) Do(opts ...googleapi.CallOption) error {
  1933. gensupport.SetOptions(c.urlParams_, opts...)
  1934. res, err := c.doRequest("json")
  1935. if err != nil {
  1936. return err
  1937. }
  1938. defer googleapi.CloseBody(res)
  1939. if err := googleapi.CheckResponse(res); err != nil {
  1940. return err
  1941. }
  1942. return nil
  1943. // {
  1944. // "description": "Deletes an access control rule.",
  1945. // "httpMethod": "DELETE",
  1946. // "id": "calendar.acl.delete",
  1947. // "parameterOrder": [
  1948. // "calendarId",
  1949. // "ruleId"
  1950. // ],
  1951. // "parameters": {
  1952. // "calendarId": {
  1953. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  1954. // "location": "path",
  1955. // "required": true,
  1956. // "type": "string"
  1957. // },
  1958. // "ruleId": {
  1959. // "description": "ACL rule identifier.",
  1960. // "location": "path",
  1961. // "required": true,
  1962. // "type": "string"
  1963. // }
  1964. // },
  1965. // "path": "calendars/{calendarId}/acl/{ruleId}",
  1966. // "scopes": [
  1967. // "https://www.googleapis.com/auth/calendar"
  1968. // ]
  1969. // }
  1970. }
  1971. // method id "calendar.acl.get":
  1972. type AclGetCall struct {
  1973. s *Service
  1974. calendarId string
  1975. ruleId string
  1976. urlParams_ gensupport.URLParams
  1977. ifNoneMatch_ string
  1978. ctx_ context.Context
  1979. header_ http.Header
  1980. }
  1981. // Get: Returns an access control rule.
  1982. func (r *AclService) Get(calendarId string, ruleId string) *AclGetCall {
  1983. c := &AclGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1984. c.calendarId = calendarId
  1985. c.ruleId = ruleId
  1986. return c
  1987. }
  1988. // Fields allows partial responses to be retrieved. See
  1989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1990. // for more information.
  1991. func (c *AclGetCall) Fields(s ...googleapi.Field) *AclGetCall {
  1992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1993. return c
  1994. }
  1995. // IfNoneMatch sets the optional parameter which makes the operation
  1996. // fail if the object's ETag matches the given value. This is useful for
  1997. // getting updates only after the object has changed since the last
  1998. // request. Use googleapi.IsNotModified to check whether the response
  1999. // error from Do is the result of In-None-Match.
  2000. func (c *AclGetCall) IfNoneMatch(entityTag string) *AclGetCall {
  2001. c.ifNoneMatch_ = entityTag
  2002. return c
  2003. }
  2004. // Context sets the context to be used in this call's Do method. Any
  2005. // pending HTTP request will be aborted if the provided context is
  2006. // canceled.
  2007. func (c *AclGetCall) Context(ctx context.Context) *AclGetCall {
  2008. c.ctx_ = ctx
  2009. return c
  2010. }
  2011. // Header returns an http.Header that can be modified by the caller to
  2012. // add HTTP headers to the request.
  2013. func (c *AclGetCall) Header() http.Header {
  2014. if c.header_ == nil {
  2015. c.header_ = make(http.Header)
  2016. }
  2017. return c.header_
  2018. }
  2019. func (c *AclGetCall) doRequest(alt string) (*http.Response, error) {
  2020. reqHeaders := make(http.Header)
  2021. for k, v := range c.header_ {
  2022. reqHeaders[k] = v
  2023. }
  2024. reqHeaders.Set("User-Agent", c.s.userAgent())
  2025. if c.ifNoneMatch_ != "" {
  2026. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2027. }
  2028. var body io.Reader = nil
  2029. c.urlParams_.Set("alt", alt)
  2030. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
  2031. urls += "?" + c.urlParams_.Encode()
  2032. req, _ := http.NewRequest("GET", urls, body)
  2033. req.Header = reqHeaders
  2034. googleapi.Expand(req.URL, map[string]string{
  2035. "calendarId": c.calendarId,
  2036. "ruleId": c.ruleId,
  2037. })
  2038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2039. }
  2040. // Do executes the "calendar.acl.get" call.
  2041. // Exactly one of *AclRule or error will be non-nil. Any non-2xx status
  2042. // code is an error. Response headers are in either
  2043. // *AclRule.ServerResponse.Header or (if a response was returned at all)
  2044. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2045. // check whether the returned error was because http.StatusNotModified
  2046. // was returned.
  2047. func (c *AclGetCall) Do(opts ...googleapi.CallOption) (*AclRule, error) {
  2048. gensupport.SetOptions(c.urlParams_, opts...)
  2049. res, err := c.doRequest("json")
  2050. if res != nil && res.StatusCode == http.StatusNotModified {
  2051. if res.Body != nil {
  2052. res.Body.Close()
  2053. }
  2054. return nil, &googleapi.Error{
  2055. Code: res.StatusCode,
  2056. Header: res.Header,
  2057. }
  2058. }
  2059. if err != nil {
  2060. return nil, err
  2061. }
  2062. defer googleapi.CloseBody(res)
  2063. if err := googleapi.CheckResponse(res); err != nil {
  2064. return nil, err
  2065. }
  2066. ret := &AclRule{
  2067. ServerResponse: googleapi.ServerResponse{
  2068. Header: res.Header,
  2069. HTTPStatusCode: res.StatusCode,
  2070. },
  2071. }
  2072. target := &ret
  2073. if err := gensupport.DecodeResponse(target, res); err != nil {
  2074. return nil, err
  2075. }
  2076. return ret, nil
  2077. // {
  2078. // "description": "Returns an access control rule.",
  2079. // "httpMethod": "GET",
  2080. // "id": "calendar.acl.get",
  2081. // "parameterOrder": [
  2082. // "calendarId",
  2083. // "ruleId"
  2084. // ],
  2085. // "parameters": {
  2086. // "calendarId": {
  2087. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  2088. // "location": "path",
  2089. // "required": true,
  2090. // "type": "string"
  2091. // },
  2092. // "ruleId": {
  2093. // "description": "ACL rule identifier.",
  2094. // "location": "path",
  2095. // "required": true,
  2096. // "type": "string"
  2097. // }
  2098. // },
  2099. // "path": "calendars/{calendarId}/acl/{ruleId}",
  2100. // "response": {
  2101. // "$ref": "AclRule"
  2102. // },
  2103. // "scopes": [
  2104. // "https://www.googleapis.com/auth/calendar",
  2105. // "https://www.googleapis.com/auth/calendar.readonly"
  2106. // ]
  2107. // }
  2108. }
  2109. // method id "calendar.acl.insert":
  2110. type AclInsertCall struct {
  2111. s *Service
  2112. calendarId string
  2113. aclrule *AclRule
  2114. urlParams_ gensupport.URLParams
  2115. ctx_ context.Context
  2116. header_ http.Header
  2117. }
  2118. // Insert: Creates an access control rule.
  2119. func (r *AclService) Insert(calendarId string, aclrule *AclRule) *AclInsertCall {
  2120. c := &AclInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2121. c.calendarId = calendarId
  2122. c.aclrule = aclrule
  2123. return c
  2124. }
  2125. // SendNotifications sets the optional parameter "sendNotifications":
  2126. // Whether to send notifications about the calendar sharing change. The
  2127. // default is True.
  2128. func (c *AclInsertCall) SendNotifications(sendNotifications bool) *AclInsertCall {
  2129. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  2130. return c
  2131. }
  2132. // Fields allows partial responses to be retrieved. See
  2133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2134. // for more information.
  2135. func (c *AclInsertCall) Fields(s ...googleapi.Field) *AclInsertCall {
  2136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2137. return c
  2138. }
  2139. // Context sets the context to be used in this call's Do method. Any
  2140. // pending HTTP request will be aborted if the provided context is
  2141. // canceled.
  2142. func (c *AclInsertCall) Context(ctx context.Context) *AclInsertCall {
  2143. c.ctx_ = ctx
  2144. return c
  2145. }
  2146. // Header returns an http.Header that can be modified by the caller to
  2147. // add HTTP headers to the request.
  2148. func (c *AclInsertCall) Header() http.Header {
  2149. if c.header_ == nil {
  2150. c.header_ = make(http.Header)
  2151. }
  2152. return c.header_
  2153. }
  2154. func (c *AclInsertCall) doRequest(alt string) (*http.Response, error) {
  2155. reqHeaders := make(http.Header)
  2156. for k, v := range c.header_ {
  2157. reqHeaders[k] = v
  2158. }
  2159. reqHeaders.Set("User-Agent", c.s.userAgent())
  2160. var body io.Reader = nil
  2161. body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
  2162. if err != nil {
  2163. return nil, err
  2164. }
  2165. reqHeaders.Set("Content-Type", "application/json")
  2166. c.urlParams_.Set("alt", alt)
  2167. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl")
  2168. urls += "?" + c.urlParams_.Encode()
  2169. req, _ := http.NewRequest("POST", urls, body)
  2170. req.Header = reqHeaders
  2171. googleapi.Expand(req.URL, map[string]string{
  2172. "calendarId": c.calendarId,
  2173. })
  2174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2175. }
  2176. // Do executes the "calendar.acl.insert" call.
  2177. // Exactly one of *AclRule or error will be non-nil. Any non-2xx status
  2178. // code is an error. Response headers are in either
  2179. // *AclRule.ServerResponse.Header or (if a response was returned at all)
  2180. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2181. // check whether the returned error was because http.StatusNotModified
  2182. // was returned.
  2183. func (c *AclInsertCall) Do(opts ...googleapi.CallOption) (*AclRule, error) {
  2184. gensupport.SetOptions(c.urlParams_, opts...)
  2185. res, err := c.doRequest("json")
  2186. if res != nil && res.StatusCode == http.StatusNotModified {
  2187. if res.Body != nil {
  2188. res.Body.Close()
  2189. }
  2190. return nil, &googleapi.Error{
  2191. Code: res.StatusCode,
  2192. Header: res.Header,
  2193. }
  2194. }
  2195. if err != nil {
  2196. return nil, err
  2197. }
  2198. defer googleapi.CloseBody(res)
  2199. if err := googleapi.CheckResponse(res); err != nil {
  2200. return nil, err
  2201. }
  2202. ret := &AclRule{
  2203. ServerResponse: googleapi.ServerResponse{
  2204. Header: res.Header,
  2205. HTTPStatusCode: res.StatusCode,
  2206. },
  2207. }
  2208. target := &ret
  2209. if err := gensupport.DecodeResponse(target, res); err != nil {
  2210. return nil, err
  2211. }
  2212. return ret, nil
  2213. // {
  2214. // "description": "Creates an access control rule.",
  2215. // "httpMethod": "POST",
  2216. // "id": "calendar.acl.insert",
  2217. // "parameterOrder": [
  2218. // "calendarId"
  2219. // ],
  2220. // "parameters": {
  2221. // "calendarId": {
  2222. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  2223. // "location": "path",
  2224. // "required": true,
  2225. // "type": "string"
  2226. // },
  2227. // "sendNotifications": {
  2228. // "description": "Whether to send notifications about the calendar sharing change. Optional. The default is True.",
  2229. // "location": "query",
  2230. // "type": "boolean"
  2231. // }
  2232. // },
  2233. // "path": "calendars/{calendarId}/acl",
  2234. // "request": {
  2235. // "$ref": "AclRule"
  2236. // },
  2237. // "response": {
  2238. // "$ref": "AclRule"
  2239. // },
  2240. // "scopes": [
  2241. // "https://www.googleapis.com/auth/calendar"
  2242. // ]
  2243. // }
  2244. }
  2245. // method id "calendar.acl.list":
  2246. type AclListCall struct {
  2247. s *Service
  2248. calendarId string
  2249. urlParams_ gensupport.URLParams
  2250. ifNoneMatch_ string
  2251. ctx_ context.Context
  2252. header_ http.Header
  2253. }
  2254. // List: Returns the rules in the access control list for the calendar.
  2255. func (r *AclService) List(calendarId string) *AclListCall {
  2256. c := &AclListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2257. c.calendarId = calendarId
  2258. return c
  2259. }
  2260. // MaxResults sets the optional parameter "maxResults": Maximum number
  2261. // of entries returned on one result page. By default the value is 100
  2262. // entries. The page size can never be larger than 250 entries.
  2263. func (c *AclListCall) MaxResults(maxResults int64) *AclListCall {
  2264. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2265. return c
  2266. }
  2267. // PageToken sets the optional parameter "pageToken": Token specifying
  2268. // which result page to return.
  2269. func (c *AclListCall) PageToken(pageToken string) *AclListCall {
  2270. c.urlParams_.Set("pageToken", pageToken)
  2271. return c
  2272. }
  2273. // ShowDeleted sets the optional parameter "showDeleted": Whether to
  2274. // include deleted ACLs in the result. Deleted ACLs are represented by
  2275. // role equal to "none". Deleted ACLs will always be included if
  2276. // syncToken is provided. The default is False.
  2277. func (c *AclListCall) ShowDeleted(showDeleted bool) *AclListCall {
  2278. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  2279. return c
  2280. }
  2281. // SyncToken sets the optional parameter "syncToken": Token obtained
  2282. // from the nextSyncToken field returned on the last page of results
  2283. // from the previous list request. It makes the result of this list
  2284. // request contain only entries that have changed since then. All
  2285. // entries deleted since the previous list request will always be in the
  2286. // result set and it is not allowed to set showDeleted to False.
  2287. // If the syncToken expires, the server will respond with a 410 GONE
  2288. // response code and the client should clear its storage and perform a
  2289. // full synchronization without any syncToken.
  2290. // Learn more about incremental synchronization.
  2291. // The default is to return all entries.
  2292. func (c *AclListCall) SyncToken(syncToken string) *AclListCall {
  2293. c.urlParams_.Set("syncToken", syncToken)
  2294. return c
  2295. }
  2296. // Fields allows partial responses to be retrieved. See
  2297. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2298. // for more information.
  2299. func (c *AclListCall) Fields(s ...googleapi.Field) *AclListCall {
  2300. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2301. return c
  2302. }
  2303. // IfNoneMatch sets the optional parameter which makes the operation
  2304. // fail if the object's ETag matches the given value. This is useful for
  2305. // getting updates only after the object has changed since the last
  2306. // request. Use googleapi.IsNotModified to check whether the response
  2307. // error from Do is the result of In-None-Match.
  2308. func (c *AclListCall) IfNoneMatch(entityTag string) *AclListCall {
  2309. c.ifNoneMatch_ = entityTag
  2310. return c
  2311. }
  2312. // Context sets the context to be used in this call's Do method. Any
  2313. // pending HTTP request will be aborted if the provided context is
  2314. // canceled.
  2315. func (c *AclListCall) Context(ctx context.Context) *AclListCall {
  2316. c.ctx_ = ctx
  2317. return c
  2318. }
  2319. // Header returns an http.Header that can be modified by the caller to
  2320. // add HTTP headers to the request.
  2321. func (c *AclListCall) Header() http.Header {
  2322. if c.header_ == nil {
  2323. c.header_ = make(http.Header)
  2324. }
  2325. return c.header_
  2326. }
  2327. func (c *AclListCall) doRequest(alt string) (*http.Response, error) {
  2328. reqHeaders := make(http.Header)
  2329. for k, v := range c.header_ {
  2330. reqHeaders[k] = v
  2331. }
  2332. reqHeaders.Set("User-Agent", c.s.userAgent())
  2333. if c.ifNoneMatch_ != "" {
  2334. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2335. }
  2336. var body io.Reader = nil
  2337. c.urlParams_.Set("alt", alt)
  2338. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl")
  2339. urls += "?" + c.urlParams_.Encode()
  2340. req, _ := http.NewRequest("GET", urls, body)
  2341. req.Header = reqHeaders
  2342. googleapi.Expand(req.URL, map[string]string{
  2343. "calendarId": c.calendarId,
  2344. })
  2345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2346. }
  2347. // Do executes the "calendar.acl.list" call.
  2348. // Exactly one of *Acl or error will be non-nil. Any non-2xx status code
  2349. // is an error. Response headers are in either
  2350. // *Acl.ServerResponse.Header or (if a response was returned at all) in
  2351. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2352. // whether the returned error was because http.StatusNotModified was
  2353. // returned.
  2354. func (c *AclListCall) Do(opts ...googleapi.CallOption) (*Acl, error) {
  2355. gensupport.SetOptions(c.urlParams_, opts...)
  2356. res, err := c.doRequest("json")
  2357. if res != nil && res.StatusCode == http.StatusNotModified {
  2358. if res.Body != nil {
  2359. res.Body.Close()
  2360. }
  2361. return nil, &googleapi.Error{
  2362. Code: res.StatusCode,
  2363. Header: res.Header,
  2364. }
  2365. }
  2366. if err != nil {
  2367. return nil, err
  2368. }
  2369. defer googleapi.CloseBody(res)
  2370. if err := googleapi.CheckResponse(res); err != nil {
  2371. return nil, err
  2372. }
  2373. ret := &Acl{
  2374. ServerResponse: googleapi.ServerResponse{
  2375. Header: res.Header,
  2376. HTTPStatusCode: res.StatusCode,
  2377. },
  2378. }
  2379. target := &ret
  2380. if err := gensupport.DecodeResponse(target, res); err != nil {
  2381. return nil, err
  2382. }
  2383. return ret, nil
  2384. // {
  2385. // "description": "Returns the rules in the access control list for the calendar.",
  2386. // "httpMethod": "GET",
  2387. // "id": "calendar.acl.list",
  2388. // "parameterOrder": [
  2389. // "calendarId"
  2390. // ],
  2391. // "parameters": {
  2392. // "calendarId": {
  2393. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  2394. // "location": "path",
  2395. // "required": true,
  2396. // "type": "string"
  2397. // },
  2398. // "maxResults": {
  2399. // "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.",
  2400. // "format": "int32",
  2401. // "location": "query",
  2402. // "minimum": "1",
  2403. // "type": "integer"
  2404. // },
  2405. // "pageToken": {
  2406. // "description": "Token specifying which result page to return. Optional.",
  2407. // "location": "query",
  2408. // "type": "string"
  2409. // },
  2410. // "showDeleted": {
  2411. // "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.",
  2412. // "location": "query",
  2413. // "type": "boolean"
  2414. // },
  2415. // "syncToken": {
  2416. // "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.",
  2417. // "location": "query",
  2418. // "type": "string"
  2419. // }
  2420. // },
  2421. // "path": "calendars/{calendarId}/acl",
  2422. // "response": {
  2423. // "$ref": "Acl"
  2424. // },
  2425. // "scopes": [
  2426. // "https://www.googleapis.com/auth/calendar"
  2427. // ],
  2428. // "supportsSubscription": true
  2429. // }
  2430. }
  2431. // Pages invokes f for each page of results.
  2432. // A non-nil error returned from f will halt the iteration.
  2433. // The provided context supersedes any context provided to the Context method.
  2434. func (c *AclListCall) Pages(ctx context.Context, f func(*Acl) error) error {
  2435. c.ctx_ = ctx
  2436. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2437. for {
  2438. x, err := c.Do()
  2439. if err != nil {
  2440. return err
  2441. }
  2442. if err := f(x); err != nil {
  2443. return err
  2444. }
  2445. if x.NextPageToken == "" {
  2446. return nil
  2447. }
  2448. c.PageToken(x.NextPageToken)
  2449. }
  2450. }
  2451. // method id "calendar.acl.patch":
  2452. type AclPatchCall struct {
  2453. s *Service
  2454. calendarId string
  2455. ruleId string
  2456. aclrule *AclRule
  2457. urlParams_ gensupport.URLParams
  2458. ctx_ context.Context
  2459. header_ http.Header
  2460. }
  2461. // Patch: Updates an access control rule. This method supports patch
  2462. // semantics.
  2463. func (r *AclService) Patch(calendarId string, ruleId string, aclrule *AclRule) *AclPatchCall {
  2464. c := &AclPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2465. c.calendarId = calendarId
  2466. c.ruleId = ruleId
  2467. c.aclrule = aclrule
  2468. return c
  2469. }
  2470. // SendNotifications sets the optional parameter "sendNotifications":
  2471. // Whether to send notifications about the calendar sharing change. Note
  2472. // that there are no notifications on access removal. The default is
  2473. // True.
  2474. func (c *AclPatchCall) SendNotifications(sendNotifications bool) *AclPatchCall {
  2475. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  2476. return c
  2477. }
  2478. // Fields allows partial responses to be retrieved. See
  2479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2480. // for more information.
  2481. func (c *AclPatchCall) Fields(s ...googleapi.Field) *AclPatchCall {
  2482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2483. return c
  2484. }
  2485. // Context sets the context to be used in this call's Do method. Any
  2486. // pending HTTP request will be aborted if the provided context is
  2487. // canceled.
  2488. func (c *AclPatchCall) Context(ctx context.Context) *AclPatchCall {
  2489. c.ctx_ = ctx
  2490. return c
  2491. }
  2492. // Header returns an http.Header that can be modified by the caller to
  2493. // add HTTP headers to the request.
  2494. func (c *AclPatchCall) Header() http.Header {
  2495. if c.header_ == nil {
  2496. c.header_ = make(http.Header)
  2497. }
  2498. return c.header_
  2499. }
  2500. func (c *AclPatchCall) doRequest(alt string) (*http.Response, error) {
  2501. reqHeaders := make(http.Header)
  2502. for k, v := range c.header_ {
  2503. reqHeaders[k] = v
  2504. }
  2505. reqHeaders.Set("User-Agent", c.s.userAgent())
  2506. var body io.Reader = nil
  2507. body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
  2508. if err != nil {
  2509. return nil, err
  2510. }
  2511. reqHeaders.Set("Content-Type", "application/json")
  2512. c.urlParams_.Set("alt", alt)
  2513. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
  2514. urls += "?" + c.urlParams_.Encode()
  2515. req, _ := http.NewRequest("PATCH", urls, body)
  2516. req.Header = reqHeaders
  2517. googleapi.Expand(req.URL, map[string]string{
  2518. "calendarId": c.calendarId,
  2519. "ruleId": c.ruleId,
  2520. })
  2521. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2522. }
  2523. // Do executes the "calendar.acl.patch" call.
  2524. // Exactly one of *AclRule or error will be non-nil. Any non-2xx status
  2525. // code is an error. Response headers are in either
  2526. // *AclRule.ServerResponse.Header or (if a response was returned at all)
  2527. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2528. // check whether the returned error was because http.StatusNotModified
  2529. // was returned.
  2530. func (c *AclPatchCall) Do(opts ...googleapi.CallOption) (*AclRule, error) {
  2531. gensupport.SetOptions(c.urlParams_, opts...)
  2532. res, err := c.doRequest("json")
  2533. if res != nil && res.StatusCode == http.StatusNotModified {
  2534. if res.Body != nil {
  2535. res.Body.Close()
  2536. }
  2537. return nil, &googleapi.Error{
  2538. Code: res.StatusCode,
  2539. Header: res.Header,
  2540. }
  2541. }
  2542. if err != nil {
  2543. return nil, err
  2544. }
  2545. defer googleapi.CloseBody(res)
  2546. if err := googleapi.CheckResponse(res); err != nil {
  2547. return nil, err
  2548. }
  2549. ret := &AclRule{
  2550. ServerResponse: googleapi.ServerResponse{
  2551. Header: res.Header,
  2552. HTTPStatusCode: res.StatusCode,
  2553. },
  2554. }
  2555. target := &ret
  2556. if err := gensupport.DecodeResponse(target, res); err != nil {
  2557. return nil, err
  2558. }
  2559. return ret, nil
  2560. // {
  2561. // "description": "Updates an access control rule. This method supports patch semantics.",
  2562. // "httpMethod": "PATCH",
  2563. // "id": "calendar.acl.patch",
  2564. // "parameterOrder": [
  2565. // "calendarId",
  2566. // "ruleId"
  2567. // ],
  2568. // "parameters": {
  2569. // "calendarId": {
  2570. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  2571. // "location": "path",
  2572. // "required": true,
  2573. // "type": "string"
  2574. // },
  2575. // "ruleId": {
  2576. // "description": "ACL rule identifier.",
  2577. // "location": "path",
  2578. // "required": true,
  2579. // "type": "string"
  2580. // },
  2581. // "sendNotifications": {
  2582. // "description": "Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True.",
  2583. // "location": "query",
  2584. // "type": "boolean"
  2585. // }
  2586. // },
  2587. // "path": "calendars/{calendarId}/acl/{ruleId}",
  2588. // "request": {
  2589. // "$ref": "AclRule"
  2590. // },
  2591. // "response": {
  2592. // "$ref": "AclRule"
  2593. // },
  2594. // "scopes": [
  2595. // "https://www.googleapis.com/auth/calendar"
  2596. // ]
  2597. // }
  2598. }
  2599. // method id "calendar.acl.update":
  2600. type AclUpdateCall struct {
  2601. s *Service
  2602. calendarId string
  2603. ruleId string
  2604. aclrule *AclRule
  2605. urlParams_ gensupport.URLParams
  2606. ctx_ context.Context
  2607. header_ http.Header
  2608. }
  2609. // Update: Updates an access control rule.
  2610. func (r *AclService) Update(calendarId string, ruleId string, aclrule *AclRule) *AclUpdateCall {
  2611. c := &AclUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2612. c.calendarId = calendarId
  2613. c.ruleId = ruleId
  2614. c.aclrule = aclrule
  2615. return c
  2616. }
  2617. // SendNotifications sets the optional parameter "sendNotifications":
  2618. // Whether to send notifications about the calendar sharing change. Note
  2619. // that there are no notifications on access removal. The default is
  2620. // True.
  2621. func (c *AclUpdateCall) SendNotifications(sendNotifications bool) *AclUpdateCall {
  2622. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  2623. return c
  2624. }
  2625. // Fields allows partial responses to be retrieved. See
  2626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2627. // for more information.
  2628. func (c *AclUpdateCall) Fields(s ...googleapi.Field) *AclUpdateCall {
  2629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2630. return c
  2631. }
  2632. // Context sets the context to be used in this call's Do method. Any
  2633. // pending HTTP request will be aborted if the provided context is
  2634. // canceled.
  2635. func (c *AclUpdateCall) Context(ctx context.Context) *AclUpdateCall {
  2636. c.ctx_ = ctx
  2637. return c
  2638. }
  2639. // Header returns an http.Header that can be modified by the caller to
  2640. // add HTTP headers to the request.
  2641. func (c *AclUpdateCall) Header() http.Header {
  2642. if c.header_ == nil {
  2643. c.header_ = make(http.Header)
  2644. }
  2645. return c.header_
  2646. }
  2647. func (c *AclUpdateCall) doRequest(alt string) (*http.Response, error) {
  2648. reqHeaders := make(http.Header)
  2649. for k, v := range c.header_ {
  2650. reqHeaders[k] = v
  2651. }
  2652. reqHeaders.Set("User-Agent", c.s.userAgent())
  2653. var body io.Reader = nil
  2654. body, err := googleapi.WithoutDataWrapper.JSONReader(c.aclrule)
  2655. if err != nil {
  2656. return nil, err
  2657. }
  2658. reqHeaders.Set("Content-Type", "application/json")
  2659. c.urlParams_.Set("alt", alt)
  2660. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/{ruleId}")
  2661. urls += "?" + c.urlParams_.Encode()
  2662. req, _ := http.NewRequest("PUT", urls, body)
  2663. req.Header = reqHeaders
  2664. googleapi.Expand(req.URL, map[string]string{
  2665. "calendarId": c.calendarId,
  2666. "ruleId": c.ruleId,
  2667. })
  2668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2669. }
  2670. // Do executes the "calendar.acl.update" call.
  2671. // Exactly one of *AclRule or error will be non-nil. Any non-2xx status
  2672. // code is an error. Response headers are in either
  2673. // *AclRule.ServerResponse.Header or (if a response was returned at all)
  2674. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2675. // check whether the returned error was because http.StatusNotModified
  2676. // was returned.
  2677. func (c *AclUpdateCall) Do(opts ...googleapi.CallOption) (*AclRule, error) {
  2678. gensupport.SetOptions(c.urlParams_, opts...)
  2679. res, err := c.doRequest("json")
  2680. if res != nil && res.StatusCode == http.StatusNotModified {
  2681. if res.Body != nil {
  2682. res.Body.Close()
  2683. }
  2684. return nil, &googleapi.Error{
  2685. Code: res.StatusCode,
  2686. Header: res.Header,
  2687. }
  2688. }
  2689. if err != nil {
  2690. return nil, err
  2691. }
  2692. defer googleapi.CloseBody(res)
  2693. if err := googleapi.CheckResponse(res); err != nil {
  2694. return nil, err
  2695. }
  2696. ret := &AclRule{
  2697. ServerResponse: googleapi.ServerResponse{
  2698. Header: res.Header,
  2699. HTTPStatusCode: res.StatusCode,
  2700. },
  2701. }
  2702. target := &ret
  2703. if err := gensupport.DecodeResponse(target, res); err != nil {
  2704. return nil, err
  2705. }
  2706. return ret, nil
  2707. // {
  2708. // "description": "Updates an access control rule.",
  2709. // "httpMethod": "PUT",
  2710. // "id": "calendar.acl.update",
  2711. // "parameterOrder": [
  2712. // "calendarId",
  2713. // "ruleId"
  2714. // ],
  2715. // "parameters": {
  2716. // "calendarId": {
  2717. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  2718. // "location": "path",
  2719. // "required": true,
  2720. // "type": "string"
  2721. // },
  2722. // "ruleId": {
  2723. // "description": "ACL rule identifier.",
  2724. // "location": "path",
  2725. // "required": true,
  2726. // "type": "string"
  2727. // },
  2728. // "sendNotifications": {
  2729. // "description": "Whether to send notifications about the calendar sharing change. Note that there are no notifications on access removal. Optional. The default is True.",
  2730. // "location": "query",
  2731. // "type": "boolean"
  2732. // }
  2733. // },
  2734. // "path": "calendars/{calendarId}/acl/{ruleId}",
  2735. // "request": {
  2736. // "$ref": "AclRule"
  2737. // },
  2738. // "response": {
  2739. // "$ref": "AclRule"
  2740. // },
  2741. // "scopes": [
  2742. // "https://www.googleapis.com/auth/calendar"
  2743. // ]
  2744. // }
  2745. }
  2746. // method id "calendar.acl.watch":
  2747. type AclWatchCall struct {
  2748. s *Service
  2749. calendarId string
  2750. channel *Channel
  2751. urlParams_ gensupport.URLParams
  2752. ctx_ context.Context
  2753. header_ http.Header
  2754. }
  2755. // Watch: Watch for changes to ACL resources.
  2756. func (r *AclService) Watch(calendarId string, channel *Channel) *AclWatchCall {
  2757. c := &AclWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2758. c.calendarId = calendarId
  2759. c.channel = channel
  2760. return c
  2761. }
  2762. // MaxResults sets the optional parameter "maxResults": Maximum number
  2763. // of entries returned on one result page. By default the value is 100
  2764. // entries. The page size can never be larger than 250 entries.
  2765. func (c *AclWatchCall) MaxResults(maxResults int64) *AclWatchCall {
  2766. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2767. return c
  2768. }
  2769. // PageToken sets the optional parameter "pageToken": Token specifying
  2770. // which result page to return.
  2771. func (c *AclWatchCall) PageToken(pageToken string) *AclWatchCall {
  2772. c.urlParams_.Set("pageToken", pageToken)
  2773. return c
  2774. }
  2775. // ShowDeleted sets the optional parameter "showDeleted": Whether to
  2776. // include deleted ACLs in the result. Deleted ACLs are represented by
  2777. // role equal to "none". Deleted ACLs will always be included if
  2778. // syncToken is provided. The default is False.
  2779. func (c *AclWatchCall) ShowDeleted(showDeleted bool) *AclWatchCall {
  2780. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  2781. return c
  2782. }
  2783. // SyncToken sets the optional parameter "syncToken": Token obtained
  2784. // from the nextSyncToken field returned on the last page of results
  2785. // from the previous list request. It makes the result of this list
  2786. // request contain only entries that have changed since then. All
  2787. // entries deleted since the previous list request will always be in the
  2788. // result set and it is not allowed to set showDeleted to False.
  2789. // If the syncToken expires, the server will respond with a 410 GONE
  2790. // response code and the client should clear its storage and perform a
  2791. // full synchronization without any syncToken.
  2792. // Learn more about incremental synchronization.
  2793. // The default is to return all entries.
  2794. func (c *AclWatchCall) SyncToken(syncToken string) *AclWatchCall {
  2795. c.urlParams_.Set("syncToken", syncToken)
  2796. return c
  2797. }
  2798. // Fields allows partial responses to be retrieved. See
  2799. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2800. // for more information.
  2801. func (c *AclWatchCall) Fields(s ...googleapi.Field) *AclWatchCall {
  2802. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2803. return c
  2804. }
  2805. // Context sets the context to be used in this call's Do method. Any
  2806. // pending HTTP request will be aborted if the provided context is
  2807. // canceled.
  2808. func (c *AclWatchCall) Context(ctx context.Context) *AclWatchCall {
  2809. c.ctx_ = ctx
  2810. return c
  2811. }
  2812. // Header returns an http.Header that can be modified by the caller to
  2813. // add HTTP headers to the request.
  2814. func (c *AclWatchCall) Header() http.Header {
  2815. if c.header_ == nil {
  2816. c.header_ = make(http.Header)
  2817. }
  2818. return c.header_
  2819. }
  2820. func (c *AclWatchCall) doRequest(alt string) (*http.Response, error) {
  2821. reqHeaders := make(http.Header)
  2822. for k, v := range c.header_ {
  2823. reqHeaders[k] = v
  2824. }
  2825. reqHeaders.Set("User-Agent", c.s.userAgent())
  2826. var body io.Reader = nil
  2827. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  2828. if err != nil {
  2829. return nil, err
  2830. }
  2831. reqHeaders.Set("Content-Type", "application/json")
  2832. c.urlParams_.Set("alt", alt)
  2833. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/acl/watch")
  2834. urls += "?" + c.urlParams_.Encode()
  2835. req, _ := http.NewRequest("POST", urls, body)
  2836. req.Header = reqHeaders
  2837. googleapi.Expand(req.URL, map[string]string{
  2838. "calendarId": c.calendarId,
  2839. })
  2840. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2841. }
  2842. // Do executes the "calendar.acl.watch" call.
  2843. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  2844. // code is an error. Response headers are in either
  2845. // *Channel.ServerResponse.Header or (if a response was returned at all)
  2846. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2847. // check whether the returned error was because http.StatusNotModified
  2848. // was returned.
  2849. func (c *AclWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  2850. gensupport.SetOptions(c.urlParams_, opts...)
  2851. res, err := c.doRequest("json")
  2852. if res != nil && res.StatusCode == http.StatusNotModified {
  2853. if res.Body != nil {
  2854. res.Body.Close()
  2855. }
  2856. return nil, &googleapi.Error{
  2857. Code: res.StatusCode,
  2858. Header: res.Header,
  2859. }
  2860. }
  2861. if err != nil {
  2862. return nil, err
  2863. }
  2864. defer googleapi.CloseBody(res)
  2865. if err := googleapi.CheckResponse(res); err != nil {
  2866. return nil, err
  2867. }
  2868. ret := &Channel{
  2869. ServerResponse: googleapi.ServerResponse{
  2870. Header: res.Header,
  2871. HTTPStatusCode: res.StatusCode,
  2872. },
  2873. }
  2874. target := &ret
  2875. if err := gensupport.DecodeResponse(target, res); err != nil {
  2876. return nil, err
  2877. }
  2878. return ret, nil
  2879. // {
  2880. // "description": "Watch for changes to ACL resources.",
  2881. // "httpMethod": "POST",
  2882. // "id": "calendar.acl.watch",
  2883. // "parameterOrder": [
  2884. // "calendarId"
  2885. // ],
  2886. // "parameters": {
  2887. // "calendarId": {
  2888. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  2889. // "location": "path",
  2890. // "required": true,
  2891. // "type": "string"
  2892. // },
  2893. // "maxResults": {
  2894. // "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.",
  2895. // "format": "int32",
  2896. // "location": "query",
  2897. // "minimum": "1",
  2898. // "type": "integer"
  2899. // },
  2900. // "pageToken": {
  2901. // "description": "Token specifying which result page to return. Optional.",
  2902. // "location": "query",
  2903. // "type": "string"
  2904. // },
  2905. // "showDeleted": {
  2906. // "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.",
  2907. // "location": "query",
  2908. // "type": "boolean"
  2909. // },
  2910. // "syncToken": {
  2911. // "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.",
  2912. // "location": "query",
  2913. // "type": "string"
  2914. // }
  2915. // },
  2916. // "path": "calendars/{calendarId}/acl/watch",
  2917. // "request": {
  2918. // "$ref": "Channel",
  2919. // "parameterName": "resource"
  2920. // },
  2921. // "response": {
  2922. // "$ref": "Channel"
  2923. // },
  2924. // "scopes": [
  2925. // "https://www.googleapis.com/auth/calendar"
  2926. // ],
  2927. // "supportsSubscription": true
  2928. // }
  2929. }
  2930. // method id "calendar.calendarList.delete":
  2931. type CalendarListDeleteCall struct {
  2932. s *Service
  2933. calendarId string
  2934. urlParams_ gensupport.URLParams
  2935. ctx_ context.Context
  2936. header_ http.Header
  2937. }
  2938. // Delete: Deletes an entry on the user's calendar list.
  2939. func (r *CalendarListService) Delete(calendarId string) *CalendarListDeleteCall {
  2940. c := &CalendarListDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2941. c.calendarId = calendarId
  2942. return c
  2943. }
  2944. // Fields allows partial responses to be retrieved. See
  2945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2946. // for more information.
  2947. func (c *CalendarListDeleteCall) Fields(s ...googleapi.Field) *CalendarListDeleteCall {
  2948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2949. return c
  2950. }
  2951. // Context sets the context to be used in this call's Do method. Any
  2952. // pending HTTP request will be aborted if the provided context is
  2953. // canceled.
  2954. func (c *CalendarListDeleteCall) Context(ctx context.Context) *CalendarListDeleteCall {
  2955. c.ctx_ = ctx
  2956. return c
  2957. }
  2958. // Header returns an http.Header that can be modified by the caller to
  2959. // add HTTP headers to the request.
  2960. func (c *CalendarListDeleteCall) Header() http.Header {
  2961. if c.header_ == nil {
  2962. c.header_ = make(http.Header)
  2963. }
  2964. return c.header_
  2965. }
  2966. func (c *CalendarListDeleteCall) doRequest(alt string) (*http.Response, error) {
  2967. reqHeaders := make(http.Header)
  2968. for k, v := range c.header_ {
  2969. reqHeaders[k] = v
  2970. }
  2971. reqHeaders.Set("User-Agent", c.s.userAgent())
  2972. var body io.Reader = nil
  2973. c.urlParams_.Set("alt", alt)
  2974. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
  2975. urls += "?" + c.urlParams_.Encode()
  2976. req, _ := http.NewRequest("DELETE", urls, body)
  2977. req.Header = reqHeaders
  2978. googleapi.Expand(req.URL, map[string]string{
  2979. "calendarId": c.calendarId,
  2980. })
  2981. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2982. }
  2983. // Do executes the "calendar.calendarList.delete" call.
  2984. func (c *CalendarListDeleteCall) Do(opts ...googleapi.CallOption) error {
  2985. gensupport.SetOptions(c.urlParams_, opts...)
  2986. res, err := c.doRequest("json")
  2987. if err != nil {
  2988. return err
  2989. }
  2990. defer googleapi.CloseBody(res)
  2991. if err := googleapi.CheckResponse(res); err != nil {
  2992. return err
  2993. }
  2994. return nil
  2995. // {
  2996. // "description": "Deletes an entry on the user's calendar list.",
  2997. // "httpMethod": "DELETE",
  2998. // "id": "calendar.calendarList.delete",
  2999. // "parameterOrder": [
  3000. // "calendarId"
  3001. // ],
  3002. // "parameters": {
  3003. // "calendarId": {
  3004. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  3005. // "location": "path",
  3006. // "required": true,
  3007. // "type": "string"
  3008. // }
  3009. // },
  3010. // "path": "users/me/calendarList/{calendarId}",
  3011. // "scopes": [
  3012. // "https://www.googleapis.com/auth/calendar"
  3013. // ]
  3014. // }
  3015. }
  3016. // method id "calendar.calendarList.get":
  3017. type CalendarListGetCall struct {
  3018. s *Service
  3019. calendarId string
  3020. urlParams_ gensupport.URLParams
  3021. ifNoneMatch_ string
  3022. ctx_ context.Context
  3023. header_ http.Header
  3024. }
  3025. // Get: Returns an entry on the user's calendar list.
  3026. func (r *CalendarListService) Get(calendarId string) *CalendarListGetCall {
  3027. c := &CalendarListGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3028. c.calendarId = calendarId
  3029. return c
  3030. }
  3031. // Fields allows partial responses to be retrieved. See
  3032. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3033. // for more information.
  3034. func (c *CalendarListGetCall) Fields(s ...googleapi.Field) *CalendarListGetCall {
  3035. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3036. return c
  3037. }
  3038. // IfNoneMatch sets the optional parameter which makes the operation
  3039. // fail if the object's ETag matches the given value. This is useful for
  3040. // getting updates only after the object has changed since the last
  3041. // request. Use googleapi.IsNotModified to check whether the response
  3042. // error from Do is the result of In-None-Match.
  3043. func (c *CalendarListGetCall) IfNoneMatch(entityTag string) *CalendarListGetCall {
  3044. c.ifNoneMatch_ = entityTag
  3045. return c
  3046. }
  3047. // Context sets the context to be used in this call's Do method. Any
  3048. // pending HTTP request will be aborted if the provided context is
  3049. // canceled.
  3050. func (c *CalendarListGetCall) Context(ctx context.Context) *CalendarListGetCall {
  3051. c.ctx_ = ctx
  3052. return c
  3053. }
  3054. // Header returns an http.Header that can be modified by the caller to
  3055. // add HTTP headers to the request.
  3056. func (c *CalendarListGetCall) Header() http.Header {
  3057. if c.header_ == nil {
  3058. c.header_ = make(http.Header)
  3059. }
  3060. return c.header_
  3061. }
  3062. func (c *CalendarListGetCall) doRequest(alt string) (*http.Response, error) {
  3063. reqHeaders := make(http.Header)
  3064. for k, v := range c.header_ {
  3065. reqHeaders[k] = v
  3066. }
  3067. reqHeaders.Set("User-Agent", c.s.userAgent())
  3068. if c.ifNoneMatch_ != "" {
  3069. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3070. }
  3071. var body io.Reader = nil
  3072. c.urlParams_.Set("alt", alt)
  3073. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
  3074. urls += "?" + c.urlParams_.Encode()
  3075. req, _ := http.NewRequest("GET", urls, body)
  3076. req.Header = reqHeaders
  3077. googleapi.Expand(req.URL, map[string]string{
  3078. "calendarId": c.calendarId,
  3079. })
  3080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3081. }
  3082. // Do executes the "calendar.calendarList.get" call.
  3083. // Exactly one of *CalendarListEntry or error will be non-nil. Any
  3084. // non-2xx status code is an error. Response headers are in either
  3085. // *CalendarListEntry.ServerResponse.Header or (if a response was
  3086. // returned at all) in error.(*googleapi.Error).Header. Use
  3087. // googleapi.IsNotModified to check whether the returned error was
  3088. // because http.StatusNotModified was returned.
  3089. func (c *CalendarListGetCall) Do(opts ...googleapi.CallOption) (*CalendarListEntry, error) {
  3090. gensupport.SetOptions(c.urlParams_, opts...)
  3091. res, err := c.doRequest("json")
  3092. if res != nil && res.StatusCode == http.StatusNotModified {
  3093. if res.Body != nil {
  3094. res.Body.Close()
  3095. }
  3096. return nil, &googleapi.Error{
  3097. Code: res.StatusCode,
  3098. Header: res.Header,
  3099. }
  3100. }
  3101. if err != nil {
  3102. return nil, err
  3103. }
  3104. defer googleapi.CloseBody(res)
  3105. if err := googleapi.CheckResponse(res); err != nil {
  3106. return nil, err
  3107. }
  3108. ret := &CalendarListEntry{
  3109. ServerResponse: googleapi.ServerResponse{
  3110. Header: res.Header,
  3111. HTTPStatusCode: res.StatusCode,
  3112. },
  3113. }
  3114. target := &ret
  3115. if err := gensupport.DecodeResponse(target, res); err != nil {
  3116. return nil, err
  3117. }
  3118. return ret, nil
  3119. // {
  3120. // "description": "Returns an entry on the user's calendar list.",
  3121. // "httpMethod": "GET",
  3122. // "id": "calendar.calendarList.get",
  3123. // "parameterOrder": [
  3124. // "calendarId"
  3125. // ],
  3126. // "parameters": {
  3127. // "calendarId": {
  3128. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  3129. // "location": "path",
  3130. // "required": true,
  3131. // "type": "string"
  3132. // }
  3133. // },
  3134. // "path": "users/me/calendarList/{calendarId}",
  3135. // "response": {
  3136. // "$ref": "CalendarListEntry"
  3137. // },
  3138. // "scopes": [
  3139. // "https://www.googleapis.com/auth/calendar",
  3140. // "https://www.googleapis.com/auth/calendar.readonly"
  3141. // ]
  3142. // }
  3143. }
  3144. // method id "calendar.calendarList.insert":
  3145. type CalendarListInsertCall struct {
  3146. s *Service
  3147. calendarlistentry *CalendarListEntry
  3148. urlParams_ gensupport.URLParams
  3149. ctx_ context.Context
  3150. header_ http.Header
  3151. }
  3152. // Insert: Adds an entry to the user's calendar list.
  3153. func (r *CalendarListService) Insert(calendarlistentry *CalendarListEntry) *CalendarListInsertCall {
  3154. c := &CalendarListInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3155. c.calendarlistentry = calendarlistentry
  3156. return c
  3157. }
  3158. // ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether
  3159. // to use the foregroundColor and backgroundColor fields to write the
  3160. // calendar colors (RGB). If this feature is used, the index-based
  3161. // colorId field will be set to the best matching option automatically.
  3162. // The default is False.
  3163. func (c *CalendarListInsertCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListInsertCall {
  3164. c.urlParams_.Set("colorRgbFormat", fmt.Sprint(colorRgbFormat))
  3165. return c
  3166. }
  3167. // Fields allows partial responses to be retrieved. See
  3168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3169. // for more information.
  3170. func (c *CalendarListInsertCall) Fields(s ...googleapi.Field) *CalendarListInsertCall {
  3171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3172. return c
  3173. }
  3174. // Context sets the context to be used in this call's Do method. Any
  3175. // pending HTTP request will be aborted if the provided context is
  3176. // canceled.
  3177. func (c *CalendarListInsertCall) Context(ctx context.Context) *CalendarListInsertCall {
  3178. c.ctx_ = ctx
  3179. return c
  3180. }
  3181. // Header returns an http.Header that can be modified by the caller to
  3182. // add HTTP headers to the request.
  3183. func (c *CalendarListInsertCall) Header() http.Header {
  3184. if c.header_ == nil {
  3185. c.header_ = make(http.Header)
  3186. }
  3187. return c.header_
  3188. }
  3189. func (c *CalendarListInsertCall) doRequest(alt string) (*http.Response, error) {
  3190. reqHeaders := make(http.Header)
  3191. for k, v := range c.header_ {
  3192. reqHeaders[k] = v
  3193. }
  3194. reqHeaders.Set("User-Agent", c.s.userAgent())
  3195. var body io.Reader = nil
  3196. body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
  3197. if err != nil {
  3198. return nil, err
  3199. }
  3200. reqHeaders.Set("Content-Type", "application/json")
  3201. c.urlParams_.Set("alt", alt)
  3202. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList")
  3203. urls += "?" + c.urlParams_.Encode()
  3204. req, _ := http.NewRequest("POST", urls, body)
  3205. req.Header = reqHeaders
  3206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3207. }
  3208. // Do executes the "calendar.calendarList.insert" call.
  3209. // Exactly one of *CalendarListEntry or error will be non-nil. Any
  3210. // non-2xx status code is an error. Response headers are in either
  3211. // *CalendarListEntry.ServerResponse.Header or (if a response was
  3212. // returned at all) in error.(*googleapi.Error).Header. Use
  3213. // googleapi.IsNotModified to check whether the returned error was
  3214. // because http.StatusNotModified was returned.
  3215. func (c *CalendarListInsertCall) Do(opts ...googleapi.CallOption) (*CalendarListEntry, error) {
  3216. gensupport.SetOptions(c.urlParams_, opts...)
  3217. res, err := c.doRequest("json")
  3218. if res != nil && res.StatusCode == http.StatusNotModified {
  3219. if res.Body != nil {
  3220. res.Body.Close()
  3221. }
  3222. return nil, &googleapi.Error{
  3223. Code: res.StatusCode,
  3224. Header: res.Header,
  3225. }
  3226. }
  3227. if err != nil {
  3228. return nil, err
  3229. }
  3230. defer googleapi.CloseBody(res)
  3231. if err := googleapi.CheckResponse(res); err != nil {
  3232. return nil, err
  3233. }
  3234. ret := &CalendarListEntry{
  3235. ServerResponse: googleapi.ServerResponse{
  3236. Header: res.Header,
  3237. HTTPStatusCode: res.StatusCode,
  3238. },
  3239. }
  3240. target := &ret
  3241. if err := gensupport.DecodeResponse(target, res); err != nil {
  3242. return nil, err
  3243. }
  3244. return ret, nil
  3245. // {
  3246. // "description": "Adds an entry to the user's calendar list.",
  3247. // "httpMethod": "POST",
  3248. // "id": "calendar.calendarList.insert",
  3249. // "parameters": {
  3250. // "colorRgbFormat": {
  3251. // "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.",
  3252. // "location": "query",
  3253. // "type": "boolean"
  3254. // }
  3255. // },
  3256. // "path": "users/me/calendarList",
  3257. // "request": {
  3258. // "$ref": "CalendarListEntry"
  3259. // },
  3260. // "response": {
  3261. // "$ref": "CalendarListEntry"
  3262. // },
  3263. // "scopes": [
  3264. // "https://www.googleapis.com/auth/calendar"
  3265. // ]
  3266. // }
  3267. }
  3268. // method id "calendar.calendarList.list":
  3269. type CalendarListListCall struct {
  3270. s *Service
  3271. urlParams_ gensupport.URLParams
  3272. ifNoneMatch_ string
  3273. ctx_ context.Context
  3274. header_ http.Header
  3275. }
  3276. // List: Returns entries on the user's calendar list.
  3277. func (r *CalendarListService) List() *CalendarListListCall {
  3278. c := &CalendarListListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3279. return c
  3280. }
  3281. // MaxResults sets the optional parameter "maxResults": Maximum number
  3282. // of entries returned on one result page. By default the value is 100
  3283. // entries. The page size can never be larger than 250 entries.
  3284. func (c *CalendarListListCall) MaxResults(maxResults int64) *CalendarListListCall {
  3285. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3286. return c
  3287. }
  3288. // MinAccessRole sets the optional parameter "minAccessRole": The
  3289. // minimum access role for the user in the returned entries. The
  3290. // default is no restriction.
  3291. //
  3292. // Possible values:
  3293. // "freeBusyReader" - The user can read free/busy information.
  3294. // "owner" - The user can read and modify events and access control
  3295. // lists.
  3296. // "reader" - The user can read events that are not private.
  3297. // "writer" - The user can read and modify events.
  3298. func (c *CalendarListListCall) MinAccessRole(minAccessRole string) *CalendarListListCall {
  3299. c.urlParams_.Set("minAccessRole", minAccessRole)
  3300. return c
  3301. }
  3302. // PageToken sets the optional parameter "pageToken": Token specifying
  3303. // which result page to return.
  3304. func (c *CalendarListListCall) PageToken(pageToken string) *CalendarListListCall {
  3305. c.urlParams_.Set("pageToken", pageToken)
  3306. return c
  3307. }
  3308. // ShowDeleted sets the optional parameter "showDeleted": Whether to
  3309. // include deleted calendar list entries in the result. The default is
  3310. // False.
  3311. func (c *CalendarListListCall) ShowDeleted(showDeleted bool) *CalendarListListCall {
  3312. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  3313. return c
  3314. }
  3315. // ShowHidden sets the optional parameter "showHidden": Whether to show
  3316. // hidden entries. The default is False.
  3317. func (c *CalendarListListCall) ShowHidden(showHidden bool) *CalendarListListCall {
  3318. c.urlParams_.Set("showHidden", fmt.Sprint(showHidden))
  3319. return c
  3320. }
  3321. // SyncToken sets the optional parameter "syncToken": Token obtained
  3322. // from the nextSyncToken field returned on the last page of results
  3323. // from the previous list request. It makes the result of this list
  3324. // request contain only entries that have changed since then. If only
  3325. // read-only fields such as calendar properties or ACLs have changed,
  3326. // the entry won't be returned. All entries deleted and hidden since the
  3327. // previous list request will always be in the result set and it is not
  3328. // allowed to set showDeleted neither showHidden to False.
  3329. // To ensure client state consistency minAccessRole query parameter
  3330. // cannot be specified together with nextSyncToken.
  3331. // If the syncToken expires, the server will respond with a 410 GONE
  3332. // response code and the client should clear its storage and perform a
  3333. // full synchronization without any syncToken.
  3334. // Learn more about incremental synchronization.
  3335. // The default is to return all entries.
  3336. func (c *CalendarListListCall) SyncToken(syncToken string) *CalendarListListCall {
  3337. c.urlParams_.Set("syncToken", syncToken)
  3338. return c
  3339. }
  3340. // Fields allows partial responses to be retrieved. See
  3341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3342. // for more information.
  3343. func (c *CalendarListListCall) Fields(s ...googleapi.Field) *CalendarListListCall {
  3344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3345. return c
  3346. }
  3347. // IfNoneMatch sets the optional parameter which makes the operation
  3348. // fail if the object's ETag matches the given value. This is useful for
  3349. // getting updates only after the object has changed since the last
  3350. // request. Use googleapi.IsNotModified to check whether the response
  3351. // error from Do is the result of In-None-Match.
  3352. func (c *CalendarListListCall) IfNoneMatch(entityTag string) *CalendarListListCall {
  3353. c.ifNoneMatch_ = entityTag
  3354. return c
  3355. }
  3356. // Context sets the context to be used in this call's Do method. Any
  3357. // pending HTTP request will be aborted if the provided context is
  3358. // canceled.
  3359. func (c *CalendarListListCall) Context(ctx context.Context) *CalendarListListCall {
  3360. c.ctx_ = ctx
  3361. return c
  3362. }
  3363. // Header returns an http.Header that can be modified by the caller to
  3364. // add HTTP headers to the request.
  3365. func (c *CalendarListListCall) Header() http.Header {
  3366. if c.header_ == nil {
  3367. c.header_ = make(http.Header)
  3368. }
  3369. return c.header_
  3370. }
  3371. func (c *CalendarListListCall) doRequest(alt string) (*http.Response, error) {
  3372. reqHeaders := make(http.Header)
  3373. for k, v := range c.header_ {
  3374. reqHeaders[k] = v
  3375. }
  3376. reqHeaders.Set("User-Agent", c.s.userAgent())
  3377. if c.ifNoneMatch_ != "" {
  3378. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3379. }
  3380. var body io.Reader = nil
  3381. c.urlParams_.Set("alt", alt)
  3382. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList")
  3383. urls += "?" + c.urlParams_.Encode()
  3384. req, _ := http.NewRequest("GET", urls, body)
  3385. req.Header = reqHeaders
  3386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3387. }
  3388. // Do executes the "calendar.calendarList.list" call.
  3389. // Exactly one of *CalendarList or error will be non-nil. Any non-2xx
  3390. // status code is an error. Response headers are in either
  3391. // *CalendarList.ServerResponse.Header or (if a response was returned at
  3392. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3393. // to check whether the returned error was because
  3394. // http.StatusNotModified was returned.
  3395. func (c *CalendarListListCall) Do(opts ...googleapi.CallOption) (*CalendarList, error) {
  3396. gensupport.SetOptions(c.urlParams_, opts...)
  3397. res, err := c.doRequest("json")
  3398. if res != nil && res.StatusCode == http.StatusNotModified {
  3399. if res.Body != nil {
  3400. res.Body.Close()
  3401. }
  3402. return nil, &googleapi.Error{
  3403. Code: res.StatusCode,
  3404. Header: res.Header,
  3405. }
  3406. }
  3407. if err != nil {
  3408. return nil, err
  3409. }
  3410. defer googleapi.CloseBody(res)
  3411. if err := googleapi.CheckResponse(res); err != nil {
  3412. return nil, err
  3413. }
  3414. ret := &CalendarList{
  3415. ServerResponse: googleapi.ServerResponse{
  3416. Header: res.Header,
  3417. HTTPStatusCode: res.StatusCode,
  3418. },
  3419. }
  3420. target := &ret
  3421. if err := gensupport.DecodeResponse(target, res); err != nil {
  3422. return nil, err
  3423. }
  3424. return ret, nil
  3425. // {
  3426. // "description": "Returns entries on the user's calendar list.",
  3427. // "httpMethod": "GET",
  3428. // "id": "calendar.calendarList.list",
  3429. // "parameters": {
  3430. // "maxResults": {
  3431. // "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.",
  3432. // "format": "int32",
  3433. // "location": "query",
  3434. // "minimum": "1",
  3435. // "type": "integer"
  3436. // },
  3437. // "minAccessRole": {
  3438. // "description": "The minimum access role for the user in the returned entries. Optional. The default is no restriction.",
  3439. // "enum": [
  3440. // "freeBusyReader",
  3441. // "owner",
  3442. // "reader",
  3443. // "writer"
  3444. // ],
  3445. // "enumDescriptions": [
  3446. // "The user can read free/busy information.",
  3447. // "The user can read and modify events and access control lists.",
  3448. // "The user can read events that are not private.",
  3449. // "The user can read and modify events."
  3450. // ],
  3451. // "location": "query",
  3452. // "type": "string"
  3453. // },
  3454. // "pageToken": {
  3455. // "description": "Token specifying which result page to return. Optional.",
  3456. // "location": "query",
  3457. // "type": "string"
  3458. // },
  3459. // "showDeleted": {
  3460. // "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.",
  3461. // "location": "query",
  3462. // "type": "boolean"
  3463. // },
  3464. // "showHidden": {
  3465. // "description": "Whether to show hidden entries. Optional. The default is False.",
  3466. // "location": "query",
  3467. // "type": "boolean"
  3468. // },
  3469. // "syncToken": {
  3470. // "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.",
  3471. // "location": "query",
  3472. // "type": "string"
  3473. // }
  3474. // },
  3475. // "path": "users/me/calendarList",
  3476. // "response": {
  3477. // "$ref": "CalendarList"
  3478. // },
  3479. // "scopes": [
  3480. // "https://www.googleapis.com/auth/calendar",
  3481. // "https://www.googleapis.com/auth/calendar.readonly"
  3482. // ],
  3483. // "supportsSubscription": true
  3484. // }
  3485. }
  3486. // Pages invokes f for each page of results.
  3487. // A non-nil error returned from f will halt the iteration.
  3488. // The provided context supersedes any context provided to the Context method.
  3489. func (c *CalendarListListCall) Pages(ctx context.Context, f func(*CalendarList) error) error {
  3490. c.ctx_ = ctx
  3491. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3492. for {
  3493. x, err := c.Do()
  3494. if err != nil {
  3495. return err
  3496. }
  3497. if err := f(x); err != nil {
  3498. return err
  3499. }
  3500. if x.NextPageToken == "" {
  3501. return nil
  3502. }
  3503. c.PageToken(x.NextPageToken)
  3504. }
  3505. }
  3506. // method id "calendar.calendarList.patch":
  3507. type CalendarListPatchCall struct {
  3508. s *Service
  3509. calendarId string
  3510. calendarlistentry *CalendarListEntry
  3511. urlParams_ gensupport.URLParams
  3512. ctx_ context.Context
  3513. header_ http.Header
  3514. }
  3515. // Patch: Updates an entry on the user's calendar list. This method
  3516. // supports patch semantics.
  3517. func (r *CalendarListService) Patch(calendarId string, calendarlistentry *CalendarListEntry) *CalendarListPatchCall {
  3518. c := &CalendarListPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3519. c.calendarId = calendarId
  3520. c.calendarlistentry = calendarlistentry
  3521. return c
  3522. }
  3523. // ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether
  3524. // to use the foregroundColor and backgroundColor fields to write the
  3525. // calendar colors (RGB). If this feature is used, the index-based
  3526. // colorId field will be set to the best matching option automatically.
  3527. // The default is False.
  3528. func (c *CalendarListPatchCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListPatchCall {
  3529. c.urlParams_.Set("colorRgbFormat", fmt.Sprint(colorRgbFormat))
  3530. return c
  3531. }
  3532. // Fields allows partial responses to be retrieved. See
  3533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3534. // for more information.
  3535. func (c *CalendarListPatchCall) Fields(s ...googleapi.Field) *CalendarListPatchCall {
  3536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3537. return c
  3538. }
  3539. // Context sets the context to be used in this call's Do method. Any
  3540. // pending HTTP request will be aborted if the provided context is
  3541. // canceled.
  3542. func (c *CalendarListPatchCall) Context(ctx context.Context) *CalendarListPatchCall {
  3543. c.ctx_ = ctx
  3544. return c
  3545. }
  3546. // Header returns an http.Header that can be modified by the caller to
  3547. // add HTTP headers to the request.
  3548. func (c *CalendarListPatchCall) Header() http.Header {
  3549. if c.header_ == nil {
  3550. c.header_ = make(http.Header)
  3551. }
  3552. return c.header_
  3553. }
  3554. func (c *CalendarListPatchCall) doRequest(alt string) (*http.Response, error) {
  3555. reqHeaders := make(http.Header)
  3556. for k, v := range c.header_ {
  3557. reqHeaders[k] = v
  3558. }
  3559. reqHeaders.Set("User-Agent", c.s.userAgent())
  3560. var body io.Reader = nil
  3561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
  3562. if err != nil {
  3563. return nil, err
  3564. }
  3565. reqHeaders.Set("Content-Type", "application/json")
  3566. c.urlParams_.Set("alt", alt)
  3567. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
  3568. urls += "?" + c.urlParams_.Encode()
  3569. req, _ := http.NewRequest("PATCH", urls, body)
  3570. req.Header = reqHeaders
  3571. googleapi.Expand(req.URL, map[string]string{
  3572. "calendarId": c.calendarId,
  3573. })
  3574. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3575. }
  3576. // Do executes the "calendar.calendarList.patch" call.
  3577. // Exactly one of *CalendarListEntry or error will be non-nil. Any
  3578. // non-2xx status code is an error. Response headers are in either
  3579. // *CalendarListEntry.ServerResponse.Header or (if a response was
  3580. // returned at all) in error.(*googleapi.Error).Header. Use
  3581. // googleapi.IsNotModified to check whether the returned error was
  3582. // because http.StatusNotModified was returned.
  3583. func (c *CalendarListPatchCall) Do(opts ...googleapi.CallOption) (*CalendarListEntry, error) {
  3584. gensupport.SetOptions(c.urlParams_, opts...)
  3585. res, err := c.doRequest("json")
  3586. if res != nil && res.StatusCode == http.StatusNotModified {
  3587. if res.Body != nil {
  3588. res.Body.Close()
  3589. }
  3590. return nil, &googleapi.Error{
  3591. Code: res.StatusCode,
  3592. Header: res.Header,
  3593. }
  3594. }
  3595. if err != nil {
  3596. return nil, err
  3597. }
  3598. defer googleapi.CloseBody(res)
  3599. if err := googleapi.CheckResponse(res); err != nil {
  3600. return nil, err
  3601. }
  3602. ret := &CalendarListEntry{
  3603. ServerResponse: googleapi.ServerResponse{
  3604. Header: res.Header,
  3605. HTTPStatusCode: res.StatusCode,
  3606. },
  3607. }
  3608. target := &ret
  3609. if err := gensupport.DecodeResponse(target, res); err != nil {
  3610. return nil, err
  3611. }
  3612. return ret, nil
  3613. // {
  3614. // "description": "Updates an entry on the user's calendar list. This method supports patch semantics.",
  3615. // "httpMethod": "PATCH",
  3616. // "id": "calendar.calendarList.patch",
  3617. // "parameterOrder": [
  3618. // "calendarId"
  3619. // ],
  3620. // "parameters": {
  3621. // "calendarId": {
  3622. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  3623. // "location": "path",
  3624. // "required": true,
  3625. // "type": "string"
  3626. // },
  3627. // "colorRgbFormat": {
  3628. // "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.",
  3629. // "location": "query",
  3630. // "type": "boolean"
  3631. // }
  3632. // },
  3633. // "path": "users/me/calendarList/{calendarId}",
  3634. // "request": {
  3635. // "$ref": "CalendarListEntry"
  3636. // },
  3637. // "response": {
  3638. // "$ref": "CalendarListEntry"
  3639. // },
  3640. // "scopes": [
  3641. // "https://www.googleapis.com/auth/calendar"
  3642. // ]
  3643. // }
  3644. }
  3645. // method id "calendar.calendarList.update":
  3646. type CalendarListUpdateCall struct {
  3647. s *Service
  3648. calendarId string
  3649. calendarlistentry *CalendarListEntry
  3650. urlParams_ gensupport.URLParams
  3651. ctx_ context.Context
  3652. header_ http.Header
  3653. }
  3654. // Update: Updates an entry on the user's calendar list.
  3655. func (r *CalendarListService) Update(calendarId string, calendarlistentry *CalendarListEntry) *CalendarListUpdateCall {
  3656. c := &CalendarListUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3657. c.calendarId = calendarId
  3658. c.calendarlistentry = calendarlistentry
  3659. return c
  3660. }
  3661. // ColorRgbFormat sets the optional parameter "colorRgbFormat": Whether
  3662. // to use the foregroundColor and backgroundColor fields to write the
  3663. // calendar colors (RGB). If this feature is used, the index-based
  3664. // colorId field will be set to the best matching option automatically.
  3665. // The default is False.
  3666. func (c *CalendarListUpdateCall) ColorRgbFormat(colorRgbFormat bool) *CalendarListUpdateCall {
  3667. c.urlParams_.Set("colorRgbFormat", fmt.Sprint(colorRgbFormat))
  3668. return c
  3669. }
  3670. // Fields allows partial responses to be retrieved. See
  3671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3672. // for more information.
  3673. func (c *CalendarListUpdateCall) Fields(s ...googleapi.Field) *CalendarListUpdateCall {
  3674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3675. return c
  3676. }
  3677. // Context sets the context to be used in this call's Do method. Any
  3678. // pending HTTP request will be aborted if the provided context is
  3679. // canceled.
  3680. func (c *CalendarListUpdateCall) Context(ctx context.Context) *CalendarListUpdateCall {
  3681. c.ctx_ = ctx
  3682. return c
  3683. }
  3684. // Header returns an http.Header that can be modified by the caller to
  3685. // add HTTP headers to the request.
  3686. func (c *CalendarListUpdateCall) Header() http.Header {
  3687. if c.header_ == nil {
  3688. c.header_ = make(http.Header)
  3689. }
  3690. return c.header_
  3691. }
  3692. func (c *CalendarListUpdateCall) doRequest(alt string) (*http.Response, error) {
  3693. reqHeaders := make(http.Header)
  3694. for k, v := range c.header_ {
  3695. reqHeaders[k] = v
  3696. }
  3697. reqHeaders.Set("User-Agent", c.s.userAgent())
  3698. var body io.Reader = nil
  3699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendarlistentry)
  3700. if err != nil {
  3701. return nil, err
  3702. }
  3703. reqHeaders.Set("Content-Type", "application/json")
  3704. c.urlParams_.Set("alt", alt)
  3705. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/{calendarId}")
  3706. urls += "?" + c.urlParams_.Encode()
  3707. req, _ := http.NewRequest("PUT", urls, body)
  3708. req.Header = reqHeaders
  3709. googleapi.Expand(req.URL, map[string]string{
  3710. "calendarId": c.calendarId,
  3711. })
  3712. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3713. }
  3714. // Do executes the "calendar.calendarList.update" call.
  3715. // Exactly one of *CalendarListEntry or error will be non-nil. Any
  3716. // non-2xx status code is an error. Response headers are in either
  3717. // *CalendarListEntry.ServerResponse.Header or (if a response was
  3718. // returned at all) in error.(*googleapi.Error).Header. Use
  3719. // googleapi.IsNotModified to check whether the returned error was
  3720. // because http.StatusNotModified was returned.
  3721. func (c *CalendarListUpdateCall) Do(opts ...googleapi.CallOption) (*CalendarListEntry, error) {
  3722. gensupport.SetOptions(c.urlParams_, opts...)
  3723. res, err := c.doRequest("json")
  3724. if res != nil && res.StatusCode == http.StatusNotModified {
  3725. if res.Body != nil {
  3726. res.Body.Close()
  3727. }
  3728. return nil, &googleapi.Error{
  3729. Code: res.StatusCode,
  3730. Header: res.Header,
  3731. }
  3732. }
  3733. if err != nil {
  3734. return nil, err
  3735. }
  3736. defer googleapi.CloseBody(res)
  3737. if err := googleapi.CheckResponse(res); err != nil {
  3738. return nil, err
  3739. }
  3740. ret := &CalendarListEntry{
  3741. ServerResponse: googleapi.ServerResponse{
  3742. Header: res.Header,
  3743. HTTPStatusCode: res.StatusCode,
  3744. },
  3745. }
  3746. target := &ret
  3747. if err := gensupport.DecodeResponse(target, res); err != nil {
  3748. return nil, err
  3749. }
  3750. return ret, nil
  3751. // {
  3752. // "description": "Updates an entry on the user's calendar list.",
  3753. // "httpMethod": "PUT",
  3754. // "id": "calendar.calendarList.update",
  3755. // "parameterOrder": [
  3756. // "calendarId"
  3757. // ],
  3758. // "parameters": {
  3759. // "calendarId": {
  3760. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  3761. // "location": "path",
  3762. // "required": true,
  3763. // "type": "string"
  3764. // },
  3765. // "colorRgbFormat": {
  3766. // "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.",
  3767. // "location": "query",
  3768. // "type": "boolean"
  3769. // }
  3770. // },
  3771. // "path": "users/me/calendarList/{calendarId}",
  3772. // "request": {
  3773. // "$ref": "CalendarListEntry"
  3774. // },
  3775. // "response": {
  3776. // "$ref": "CalendarListEntry"
  3777. // },
  3778. // "scopes": [
  3779. // "https://www.googleapis.com/auth/calendar"
  3780. // ]
  3781. // }
  3782. }
  3783. // method id "calendar.calendarList.watch":
  3784. type CalendarListWatchCall struct {
  3785. s *Service
  3786. channel *Channel
  3787. urlParams_ gensupport.URLParams
  3788. ctx_ context.Context
  3789. header_ http.Header
  3790. }
  3791. // Watch: Watch for changes to CalendarList resources.
  3792. func (r *CalendarListService) Watch(channel *Channel) *CalendarListWatchCall {
  3793. c := &CalendarListWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3794. c.channel = channel
  3795. return c
  3796. }
  3797. // MaxResults sets the optional parameter "maxResults": Maximum number
  3798. // of entries returned on one result page. By default the value is 100
  3799. // entries. The page size can never be larger than 250 entries.
  3800. func (c *CalendarListWatchCall) MaxResults(maxResults int64) *CalendarListWatchCall {
  3801. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  3802. return c
  3803. }
  3804. // MinAccessRole sets the optional parameter "minAccessRole": The
  3805. // minimum access role for the user in the returned entries. The
  3806. // default is no restriction.
  3807. //
  3808. // Possible values:
  3809. // "freeBusyReader" - The user can read free/busy information.
  3810. // "owner" - The user can read and modify events and access control
  3811. // lists.
  3812. // "reader" - The user can read events that are not private.
  3813. // "writer" - The user can read and modify events.
  3814. func (c *CalendarListWatchCall) MinAccessRole(minAccessRole string) *CalendarListWatchCall {
  3815. c.urlParams_.Set("minAccessRole", minAccessRole)
  3816. return c
  3817. }
  3818. // PageToken sets the optional parameter "pageToken": Token specifying
  3819. // which result page to return.
  3820. func (c *CalendarListWatchCall) PageToken(pageToken string) *CalendarListWatchCall {
  3821. c.urlParams_.Set("pageToken", pageToken)
  3822. return c
  3823. }
  3824. // ShowDeleted sets the optional parameter "showDeleted": Whether to
  3825. // include deleted calendar list entries in the result. The default is
  3826. // False.
  3827. func (c *CalendarListWatchCall) ShowDeleted(showDeleted bool) *CalendarListWatchCall {
  3828. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  3829. return c
  3830. }
  3831. // ShowHidden sets the optional parameter "showHidden": Whether to show
  3832. // hidden entries. The default is False.
  3833. func (c *CalendarListWatchCall) ShowHidden(showHidden bool) *CalendarListWatchCall {
  3834. c.urlParams_.Set("showHidden", fmt.Sprint(showHidden))
  3835. return c
  3836. }
  3837. // SyncToken sets the optional parameter "syncToken": Token obtained
  3838. // from the nextSyncToken field returned on the last page of results
  3839. // from the previous list request. It makes the result of this list
  3840. // request contain only entries that have changed since then. If only
  3841. // read-only fields such as calendar properties or ACLs have changed,
  3842. // the entry won't be returned. All entries deleted and hidden since the
  3843. // previous list request will always be in the result set and it is not
  3844. // allowed to set showDeleted neither showHidden to False.
  3845. // To ensure client state consistency minAccessRole query parameter
  3846. // cannot be specified together with nextSyncToken.
  3847. // If the syncToken expires, the server will respond with a 410 GONE
  3848. // response code and the client should clear its storage and perform a
  3849. // full synchronization without any syncToken.
  3850. // Learn more about incremental synchronization.
  3851. // The default is to return all entries.
  3852. func (c *CalendarListWatchCall) SyncToken(syncToken string) *CalendarListWatchCall {
  3853. c.urlParams_.Set("syncToken", syncToken)
  3854. return c
  3855. }
  3856. // Fields allows partial responses to be retrieved. See
  3857. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3858. // for more information.
  3859. func (c *CalendarListWatchCall) Fields(s ...googleapi.Field) *CalendarListWatchCall {
  3860. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3861. return c
  3862. }
  3863. // Context sets the context to be used in this call's Do method. Any
  3864. // pending HTTP request will be aborted if the provided context is
  3865. // canceled.
  3866. func (c *CalendarListWatchCall) Context(ctx context.Context) *CalendarListWatchCall {
  3867. c.ctx_ = ctx
  3868. return c
  3869. }
  3870. // Header returns an http.Header that can be modified by the caller to
  3871. // add HTTP headers to the request.
  3872. func (c *CalendarListWatchCall) Header() http.Header {
  3873. if c.header_ == nil {
  3874. c.header_ = make(http.Header)
  3875. }
  3876. return c.header_
  3877. }
  3878. func (c *CalendarListWatchCall) doRequest(alt string) (*http.Response, error) {
  3879. reqHeaders := make(http.Header)
  3880. for k, v := range c.header_ {
  3881. reqHeaders[k] = v
  3882. }
  3883. reqHeaders.Set("User-Agent", c.s.userAgent())
  3884. var body io.Reader = nil
  3885. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  3886. if err != nil {
  3887. return nil, err
  3888. }
  3889. reqHeaders.Set("Content-Type", "application/json")
  3890. c.urlParams_.Set("alt", alt)
  3891. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/calendarList/watch")
  3892. urls += "?" + c.urlParams_.Encode()
  3893. req, _ := http.NewRequest("POST", urls, body)
  3894. req.Header = reqHeaders
  3895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3896. }
  3897. // Do executes the "calendar.calendarList.watch" call.
  3898. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  3899. // code is an error. Response headers are in either
  3900. // *Channel.ServerResponse.Header or (if a response was returned at all)
  3901. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3902. // check whether the returned error was because http.StatusNotModified
  3903. // was returned.
  3904. func (c *CalendarListWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  3905. gensupport.SetOptions(c.urlParams_, opts...)
  3906. res, err := c.doRequest("json")
  3907. if res != nil && res.StatusCode == http.StatusNotModified {
  3908. if res.Body != nil {
  3909. res.Body.Close()
  3910. }
  3911. return nil, &googleapi.Error{
  3912. Code: res.StatusCode,
  3913. Header: res.Header,
  3914. }
  3915. }
  3916. if err != nil {
  3917. return nil, err
  3918. }
  3919. defer googleapi.CloseBody(res)
  3920. if err := googleapi.CheckResponse(res); err != nil {
  3921. return nil, err
  3922. }
  3923. ret := &Channel{
  3924. ServerResponse: googleapi.ServerResponse{
  3925. Header: res.Header,
  3926. HTTPStatusCode: res.StatusCode,
  3927. },
  3928. }
  3929. target := &ret
  3930. if err := gensupport.DecodeResponse(target, res); err != nil {
  3931. return nil, err
  3932. }
  3933. return ret, nil
  3934. // {
  3935. // "description": "Watch for changes to CalendarList resources.",
  3936. // "httpMethod": "POST",
  3937. // "id": "calendar.calendarList.watch",
  3938. // "parameters": {
  3939. // "maxResults": {
  3940. // "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.",
  3941. // "format": "int32",
  3942. // "location": "query",
  3943. // "minimum": "1",
  3944. // "type": "integer"
  3945. // },
  3946. // "minAccessRole": {
  3947. // "description": "The minimum access role for the user in the returned entries. Optional. The default is no restriction.",
  3948. // "enum": [
  3949. // "freeBusyReader",
  3950. // "owner",
  3951. // "reader",
  3952. // "writer"
  3953. // ],
  3954. // "enumDescriptions": [
  3955. // "The user can read free/busy information.",
  3956. // "The user can read and modify events and access control lists.",
  3957. // "The user can read events that are not private.",
  3958. // "The user can read and modify events."
  3959. // ],
  3960. // "location": "query",
  3961. // "type": "string"
  3962. // },
  3963. // "pageToken": {
  3964. // "description": "Token specifying which result page to return. Optional.",
  3965. // "location": "query",
  3966. // "type": "string"
  3967. // },
  3968. // "showDeleted": {
  3969. // "description": "Whether to include deleted calendar list entries in the result. Optional. The default is False.",
  3970. // "location": "query",
  3971. // "type": "boolean"
  3972. // },
  3973. // "showHidden": {
  3974. // "description": "Whether to show hidden entries. Optional. The default is False.",
  3975. // "location": "query",
  3976. // "type": "boolean"
  3977. // },
  3978. // "syncToken": {
  3979. // "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.",
  3980. // "location": "query",
  3981. // "type": "string"
  3982. // }
  3983. // },
  3984. // "path": "users/me/calendarList/watch",
  3985. // "request": {
  3986. // "$ref": "Channel",
  3987. // "parameterName": "resource"
  3988. // },
  3989. // "response": {
  3990. // "$ref": "Channel"
  3991. // },
  3992. // "scopes": [
  3993. // "https://www.googleapis.com/auth/calendar",
  3994. // "https://www.googleapis.com/auth/calendar.readonly"
  3995. // ],
  3996. // "supportsSubscription": true
  3997. // }
  3998. }
  3999. // method id "calendar.calendars.clear":
  4000. type CalendarsClearCall struct {
  4001. s *Service
  4002. calendarId string
  4003. urlParams_ gensupport.URLParams
  4004. ctx_ context.Context
  4005. header_ http.Header
  4006. }
  4007. // Clear: Clears a primary calendar. This operation deletes all events
  4008. // associated with the primary calendar of an account.
  4009. func (r *CalendarsService) Clear(calendarId string) *CalendarsClearCall {
  4010. c := &CalendarsClearCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4011. c.calendarId = calendarId
  4012. return c
  4013. }
  4014. // Fields allows partial responses to be retrieved. See
  4015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4016. // for more information.
  4017. func (c *CalendarsClearCall) Fields(s ...googleapi.Field) *CalendarsClearCall {
  4018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4019. return c
  4020. }
  4021. // Context sets the context to be used in this call's Do method. Any
  4022. // pending HTTP request will be aborted if the provided context is
  4023. // canceled.
  4024. func (c *CalendarsClearCall) Context(ctx context.Context) *CalendarsClearCall {
  4025. c.ctx_ = ctx
  4026. return c
  4027. }
  4028. // Header returns an http.Header that can be modified by the caller to
  4029. // add HTTP headers to the request.
  4030. func (c *CalendarsClearCall) Header() http.Header {
  4031. if c.header_ == nil {
  4032. c.header_ = make(http.Header)
  4033. }
  4034. return c.header_
  4035. }
  4036. func (c *CalendarsClearCall) doRequest(alt string) (*http.Response, error) {
  4037. reqHeaders := make(http.Header)
  4038. for k, v := range c.header_ {
  4039. reqHeaders[k] = v
  4040. }
  4041. reqHeaders.Set("User-Agent", c.s.userAgent())
  4042. var body io.Reader = nil
  4043. c.urlParams_.Set("alt", alt)
  4044. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/clear")
  4045. urls += "?" + c.urlParams_.Encode()
  4046. req, _ := http.NewRequest("POST", urls, body)
  4047. req.Header = reqHeaders
  4048. googleapi.Expand(req.URL, map[string]string{
  4049. "calendarId": c.calendarId,
  4050. })
  4051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4052. }
  4053. // Do executes the "calendar.calendars.clear" call.
  4054. func (c *CalendarsClearCall) Do(opts ...googleapi.CallOption) error {
  4055. gensupport.SetOptions(c.urlParams_, opts...)
  4056. res, err := c.doRequest("json")
  4057. if err != nil {
  4058. return err
  4059. }
  4060. defer googleapi.CloseBody(res)
  4061. if err := googleapi.CheckResponse(res); err != nil {
  4062. return err
  4063. }
  4064. return nil
  4065. // {
  4066. // "description": "Clears a primary calendar. This operation deletes all events associated with the primary calendar of an account.",
  4067. // "httpMethod": "POST",
  4068. // "id": "calendar.calendars.clear",
  4069. // "parameterOrder": [
  4070. // "calendarId"
  4071. // ],
  4072. // "parameters": {
  4073. // "calendarId": {
  4074. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  4075. // "location": "path",
  4076. // "required": true,
  4077. // "type": "string"
  4078. // }
  4079. // },
  4080. // "path": "calendars/{calendarId}/clear",
  4081. // "scopes": [
  4082. // "https://www.googleapis.com/auth/calendar"
  4083. // ]
  4084. // }
  4085. }
  4086. // method id "calendar.calendars.delete":
  4087. type CalendarsDeleteCall struct {
  4088. s *Service
  4089. calendarId string
  4090. urlParams_ gensupport.URLParams
  4091. ctx_ context.Context
  4092. header_ http.Header
  4093. }
  4094. // Delete: Deletes a secondary calendar. Use calendars.clear for
  4095. // clearing all events on primary calendars.
  4096. func (r *CalendarsService) Delete(calendarId string) *CalendarsDeleteCall {
  4097. c := &CalendarsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4098. c.calendarId = calendarId
  4099. return c
  4100. }
  4101. // Fields allows partial responses to be retrieved. See
  4102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4103. // for more information.
  4104. func (c *CalendarsDeleteCall) Fields(s ...googleapi.Field) *CalendarsDeleteCall {
  4105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4106. return c
  4107. }
  4108. // Context sets the context to be used in this call's Do method. Any
  4109. // pending HTTP request will be aborted if the provided context is
  4110. // canceled.
  4111. func (c *CalendarsDeleteCall) Context(ctx context.Context) *CalendarsDeleteCall {
  4112. c.ctx_ = ctx
  4113. return c
  4114. }
  4115. // Header returns an http.Header that can be modified by the caller to
  4116. // add HTTP headers to the request.
  4117. func (c *CalendarsDeleteCall) Header() http.Header {
  4118. if c.header_ == nil {
  4119. c.header_ = make(http.Header)
  4120. }
  4121. return c.header_
  4122. }
  4123. func (c *CalendarsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4124. reqHeaders := make(http.Header)
  4125. for k, v := range c.header_ {
  4126. reqHeaders[k] = v
  4127. }
  4128. reqHeaders.Set("User-Agent", c.s.userAgent())
  4129. var body io.Reader = nil
  4130. c.urlParams_.Set("alt", alt)
  4131. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
  4132. urls += "?" + c.urlParams_.Encode()
  4133. req, _ := http.NewRequest("DELETE", urls, body)
  4134. req.Header = reqHeaders
  4135. googleapi.Expand(req.URL, map[string]string{
  4136. "calendarId": c.calendarId,
  4137. })
  4138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4139. }
  4140. // Do executes the "calendar.calendars.delete" call.
  4141. func (c *CalendarsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4142. gensupport.SetOptions(c.urlParams_, opts...)
  4143. res, err := c.doRequest("json")
  4144. if err != nil {
  4145. return err
  4146. }
  4147. defer googleapi.CloseBody(res)
  4148. if err := googleapi.CheckResponse(res); err != nil {
  4149. return err
  4150. }
  4151. return nil
  4152. // {
  4153. // "description": "Deletes a secondary calendar. Use calendars.clear for clearing all events on primary calendars.",
  4154. // "httpMethod": "DELETE",
  4155. // "id": "calendar.calendars.delete",
  4156. // "parameterOrder": [
  4157. // "calendarId"
  4158. // ],
  4159. // "parameters": {
  4160. // "calendarId": {
  4161. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  4162. // "location": "path",
  4163. // "required": true,
  4164. // "type": "string"
  4165. // }
  4166. // },
  4167. // "path": "calendars/{calendarId}",
  4168. // "scopes": [
  4169. // "https://www.googleapis.com/auth/calendar"
  4170. // ]
  4171. // }
  4172. }
  4173. // method id "calendar.calendars.get":
  4174. type CalendarsGetCall struct {
  4175. s *Service
  4176. calendarId string
  4177. urlParams_ gensupport.URLParams
  4178. ifNoneMatch_ string
  4179. ctx_ context.Context
  4180. header_ http.Header
  4181. }
  4182. // Get: Returns metadata for a calendar.
  4183. func (r *CalendarsService) Get(calendarId string) *CalendarsGetCall {
  4184. c := &CalendarsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4185. c.calendarId = calendarId
  4186. return c
  4187. }
  4188. // Fields allows partial responses to be retrieved. See
  4189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4190. // for more information.
  4191. func (c *CalendarsGetCall) Fields(s ...googleapi.Field) *CalendarsGetCall {
  4192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4193. return c
  4194. }
  4195. // IfNoneMatch sets the optional parameter which makes the operation
  4196. // fail if the object's ETag matches the given value. This is useful for
  4197. // getting updates only after the object has changed since the last
  4198. // request. Use googleapi.IsNotModified to check whether the response
  4199. // error from Do is the result of In-None-Match.
  4200. func (c *CalendarsGetCall) IfNoneMatch(entityTag string) *CalendarsGetCall {
  4201. c.ifNoneMatch_ = entityTag
  4202. return c
  4203. }
  4204. // Context sets the context to be used in this call's Do method. Any
  4205. // pending HTTP request will be aborted if the provided context is
  4206. // canceled.
  4207. func (c *CalendarsGetCall) Context(ctx context.Context) *CalendarsGetCall {
  4208. c.ctx_ = ctx
  4209. return c
  4210. }
  4211. // Header returns an http.Header that can be modified by the caller to
  4212. // add HTTP headers to the request.
  4213. func (c *CalendarsGetCall) Header() http.Header {
  4214. if c.header_ == nil {
  4215. c.header_ = make(http.Header)
  4216. }
  4217. return c.header_
  4218. }
  4219. func (c *CalendarsGetCall) doRequest(alt string) (*http.Response, error) {
  4220. reqHeaders := make(http.Header)
  4221. for k, v := range c.header_ {
  4222. reqHeaders[k] = v
  4223. }
  4224. reqHeaders.Set("User-Agent", c.s.userAgent())
  4225. if c.ifNoneMatch_ != "" {
  4226. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4227. }
  4228. var body io.Reader = nil
  4229. c.urlParams_.Set("alt", alt)
  4230. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
  4231. urls += "?" + c.urlParams_.Encode()
  4232. req, _ := http.NewRequest("GET", urls, body)
  4233. req.Header = reqHeaders
  4234. googleapi.Expand(req.URL, map[string]string{
  4235. "calendarId": c.calendarId,
  4236. })
  4237. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4238. }
  4239. // Do executes the "calendar.calendars.get" call.
  4240. // Exactly one of *Calendar or error will be non-nil. Any non-2xx status
  4241. // code is an error. Response headers are in either
  4242. // *Calendar.ServerResponse.Header or (if a response was returned at
  4243. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4244. // to check whether the returned error was because
  4245. // http.StatusNotModified was returned.
  4246. func (c *CalendarsGetCall) Do(opts ...googleapi.CallOption) (*Calendar, error) {
  4247. gensupport.SetOptions(c.urlParams_, opts...)
  4248. res, err := c.doRequest("json")
  4249. if res != nil && res.StatusCode == http.StatusNotModified {
  4250. if res.Body != nil {
  4251. res.Body.Close()
  4252. }
  4253. return nil, &googleapi.Error{
  4254. Code: res.StatusCode,
  4255. Header: res.Header,
  4256. }
  4257. }
  4258. if err != nil {
  4259. return nil, err
  4260. }
  4261. defer googleapi.CloseBody(res)
  4262. if err := googleapi.CheckResponse(res); err != nil {
  4263. return nil, err
  4264. }
  4265. ret := &Calendar{
  4266. ServerResponse: googleapi.ServerResponse{
  4267. Header: res.Header,
  4268. HTTPStatusCode: res.StatusCode,
  4269. },
  4270. }
  4271. target := &ret
  4272. if err := gensupport.DecodeResponse(target, res); err != nil {
  4273. return nil, err
  4274. }
  4275. return ret, nil
  4276. // {
  4277. // "description": "Returns metadata for a calendar.",
  4278. // "httpMethod": "GET",
  4279. // "id": "calendar.calendars.get",
  4280. // "parameterOrder": [
  4281. // "calendarId"
  4282. // ],
  4283. // "parameters": {
  4284. // "calendarId": {
  4285. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  4286. // "location": "path",
  4287. // "required": true,
  4288. // "type": "string"
  4289. // }
  4290. // },
  4291. // "path": "calendars/{calendarId}",
  4292. // "response": {
  4293. // "$ref": "Calendar"
  4294. // },
  4295. // "scopes": [
  4296. // "https://www.googleapis.com/auth/calendar",
  4297. // "https://www.googleapis.com/auth/calendar.readonly"
  4298. // ]
  4299. // }
  4300. }
  4301. // method id "calendar.calendars.insert":
  4302. type CalendarsInsertCall struct {
  4303. s *Service
  4304. calendar *Calendar
  4305. urlParams_ gensupport.URLParams
  4306. ctx_ context.Context
  4307. header_ http.Header
  4308. }
  4309. // Insert: Creates a secondary calendar.
  4310. func (r *CalendarsService) Insert(calendar *Calendar) *CalendarsInsertCall {
  4311. c := &CalendarsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4312. c.calendar = calendar
  4313. return c
  4314. }
  4315. // Fields allows partial responses to be retrieved. See
  4316. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4317. // for more information.
  4318. func (c *CalendarsInsertCall) Fields(s ...googleapi.Field) *CalendarsInsertCall {
  4319. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4320. return c
  4321. }
  4322. // Context sets the context to be used in this call's Do method. Any
  4323. // pending HTTP request will be aborted if the provided context is
  4324. // canceled.
  4325. func (c *CalendarsInsertCall) Context(ctx context.Context) *CalendarsInsertCall {
  4326. c.ctx_ = ctx
  4327. return c
  4328. }
  4329. // Header returns an http.Header that can be modified by the caller to
  4330. // add HTTP headers to the request.
  4331. func (c *CalendarsInsertCall) Header() http.Header {
  4332. if c.header_ == nil {
  4333. c.header_ = make(http.Header)
  4334. }
  4335. return c.header_
  4336. }
  4337. func (c *CalendarsInsertCall) doRequest(alt string) (*http.Response, error) {
  4338. reqHeaders := make(http.Header)
  4339. for k, v := range c.header_ {
  4340. reqHeaders[k] = v
  4341. }
  4342. reqHeaders.Set("User-Agent", c.s.userAgent())
  4343. var body io.Reader = nil
  4344. body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
  4345. if err != nil {
  4346. return nil, err
  4347. }
  4348. reqHeaders.Set("Content-Type", "application/json")
  4349. c.urlParams_.Set("alt", alt)
  4350. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars")
  4351. urls += "?" + c.urlParams_.Encode()
  4352. req, _ := http.NewRequest("POST", urls, body)
  4353. req.Header = reqHeaders
  4354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4355. }
  4356. // Do executes the "calendar.calendars.insert" call.
  4357. // Exactly one of *Calendar or error will be non-nil. Any non-2xx status
  4358. // code is an error. Response headers are in either
  4359. // *Calendar.ServerResponse.Header or (if a response was returned at
  4360. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4361. // to check whether the returned error was because
  4362. // http.StatusNotModified was returned.
  4363. func (c *CalendarsInsertCall) Do(opts ...googleapi.CallOption) (*Calendar, error) {
  4364. gensupport.SetOptions(c.urlParams_, opts...)
  4365. res, err := c.doRequest("json")
  4366. if res != nil && res.StatusCode == http.StatusNotModified {
  4367. if res.Body != nil {
  4368. res.Body.Close()
  4369. }
  4370. return nil, &googleapi.Error{
  4371. Code: res.StatusCode,
  4372. Header: res.Header,
  4373. }
  4374. }
  4375. if err != nil {
  4376. return nil, err
  4377. }
  4378. defer googleapi.CloseBody(res)
  4379. if err := googleapi.CheckResponse(res); err != nil {
  4380. return nil, err
  4381. }
  4382. ret := &Calendar{
  4383. ServerResponse: googleapi.ServerResponse{
  4384. Header: res.Header,
  4385. HTTPStatusCode: res.StatusCode,
  4386. },
  4387. }
  4388. target := &ret
  4389. if err := gensupport.DecodeResponse(target, res); err != nil {
  4390. return nil, err
  4391. }
  4392. return ret, nil
  4393. // {
  4394. // "description": "Creates a secondary calendar.",
  4395. // "httpMethod": "POST",
  4396. // "id": "calendar.calendars.insert",
  4397. // "path": "calendars",
  4398. // "request": {
  4399. // "$ref": "Calendar"
  4400. // },
  4401. // "response": {
  4402. // "$ref": "Calendar"
  4403. // },
  4404. // "scopes": [
  4405. // "https://www.googleapis.com/auth/calendar"
  4406. // ]
  4407. // }
  4408. }
  4409. // method id "calendar.calendars.patch":
  4410. type CalendarsPatchCall struct {
  4411. s *Service
  4412. calendarId string
  4413. calendar *Calendar
  4414. urlParams_ gensupport.URLParams
  4415. ctx_ context.Context
  4416. header_ http.Header
  4417. }
  4418. // Patch: Updates metadata for a calendar. This method supports patch
  4419. // semantics.
  4420. func (r *CalendarsService) Patch(calendarId string, calendar *Calendar) *CalendarsPatchCall {
  4421. c := &CalendarsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4422. c.calendarId = calendarId
  4423. c.calendar = calendar
  4424. return c
  4425. }
  4426. // Fields allows partial responses to be retrieved. See
  4427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4428. // for more information.
  4429. func (c *CalendarsPatchCall) Fields(s ...googleapi.Field) *CalendarsPatchCall {
  4430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4431. return c
  4432. }
  4433. // Context sets the context to be used in this call's Do method. Any
  4434. // pending HTTP request will be aborted if the provided context is
  4435. // canceled.
  4436. func (c *CalendarsPatchCall) Context(ctx context.Context) *CalendarsPatchCall {
  4437. c.ctx_ = ctx
  4438. return c
  4439. }
  4440. // Header returns an http.Header that can be modified by the caller to
  4441. // add HTTP headers to the request.
  4442. func (c *CalendarsPatchCall) Header() http.Header {
  4443. if c.header_ == nil {
  4444. c.header_ = make(http.Header)
  4445. }
  4446. return c.header_
  4447. }
  4448. func (c *CalendarsPatchCall) doRequest(alt string) (*http.Response, error) {
  4449. reqHeaders := make(http.Header)
  4450. for k, v := range c.header_ {
  4451. reqHeaders[k] = v
  4452. }
  4453. reqHeaders.Set("User-Agent", c.s.userAgent())
  4454. var body io.Reader = nil
  4455. body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
  4456. if err != nil {
  4457. return nil, err
  4458. }
  4459. reqHeaders.Set("Content-Type", "application/json")
  4460. c.urlParams_.Set("alt", alt)
  4461. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
  4462. urls += "?" + c.urlParams_.Encode()
  4463. req, _ := http.NewRequest("PATCH", urls, body)
  4464. req.Header = reqHeaders
  4465. googleapi.Expand(req.URL, map[string]string{
  4466. "calendarId": c.calendarId,
  4467. })
  4468. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4469. }
  4470. // Do executes the "calendar.calendars.patch" call.
  4471. // Exactly one of *Calendar or error will be non-nil. Any non-2xx status
  4472. // code is an error. Response headers are in either
  4473. // *Calendar.ServerResponse.Header or (if a response was returned at
  4474. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4475. // to check whether the returned error was because
  4476. // http.StatusNotModified was returned.
  4477. func (c *CalendarsPatchCall) Do(opts ...googleapi.CallOption) (*Calendar, error) {
  4478. gensupport.SetOptions(c.urlParams_, opts...)
  4479. res, err := c.doRequest("json")
  4480. if res != nil && res.StatusCode == http.StatusNotModified {
  4481. if res.Body != nil {
  4482. res.Body.Close()
  4483. }
  4484. return nil, &googleapi.Error{
  4485. Code: res.StatusCode,
  4486. Header: res.Header,
  4487. }
  4488. }
  4489. if err != nil {
  4490. return nil, err
  4491. }
  4492. defer googleapi.CloseBody(res)
  4493. if err := googleapi.CheckResponse(res); err != nil {
  4494. return nil, err
  4495. }
  4496. ret := &Calendar{
  4497. ServerResponse: googleapi.ServerResponse{
  4498. Header: res.Header,
  4499. HTTPStatusCode: res.StatusCode,
  4500. },
  4501. }
  4502. target := &ret
  4503. if err := gensupport.DecodeResponse(target, res); err != nil {
  4504. return nil, err
  4505. }
  4506. return ret, nil
  4507. // {
  4508. // "description": "Updates metadata for a calendar. This method supports patch semantics.",
  4509. // "httpMethod": "PATCH",
  4510. // "id": "calendar.calendars.patch",
  4511. // "parameterOrder": [
  4512. // "calendarId"
  4513. // ],
  4514. // "parameters": {
  4515. // "calendarId": {
  4516. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  4517. // "location": "path",
  4518. // "required": true,
  4519. // "type": "string"
  4520. // }
  4521. // },
  4522. // "path": "calendars/{calendarId}",
  4523. // "request": {
  4524. // "$ref": "Calendar"
  4525. // },
  4526. // "response": {
  4527. // "$ref": "Calendar"
  4528. // },
  4529. // "scopes": [
  4530. // "https://www.googleapis.com/auth/calendar"
  4531. // ]
  4532. // }
  4533. }
  4534. // method id "calendar.calendars.update":
  4535. type CalendarsUpdateCall struct {
  4536. s *Service
  4537. calendarId string
  4538. calendar *Calendar
  4539. urlParams_ gensupport.URLParams
  4540. ctx_ context.Context
  4541. header_ http.Header
  4542. }
  4543. // Update: Updates metadata for a calendar.
  4544. func (r *CalendarsService) Update(calendarId string, calendar *Calendar) *CalendarsUpdateCall {
  4545. c := &CalendarsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4546. c.calendarId = calendarId
  4547. c.calendar = calendar
  4548. return c
  4549. }
  4550. // Fields allows partial responses to be retrieved. See
  4551. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4552. // for more information.
  4553. func (c *CalendarsUpdateCall) Fields(s ...googleapi.Field) *CalendarsUpdateCall {
  4554. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4555. return c
  4556. }
  4557. // Context sets the context to be used in this call's Do method. Any
  4558. // pending HTTP request will be aborted if the provided context is
  4559. // canceled.
  4560. func (c *CalendarsUpdateCall) Context(ctx context.Context) *CalendarsUpdateCall {
  4561. c.ctx_ = ctx
  4562. return c
  4563. }
  4564. // Header returns an http.Header that can be modified by the caller to
  4565. // add HTTP headers to the request.
  4566. func (c *CalendarsUpdateCall) Header() http.Header {
  4567. if c.header_ == nil {
  4568. c.header_ = make(http.Header)
  4569. }
  4570. return c.header_
  4571. }
  4572. func (c *CalendarsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4573. reqHeaders := make(http.Header)
  4574. for k, v := range c.header_ {
  4575. reqHeaders[k] = v
  4576. }
  4577. reqHeaders.Set("User-Agent", c.s.userAgent())
  4578. var body io.Reader = nil
  4579. body, err := googleapi.WithoutDataWrapper.JSONReader(c.calendar)
  4580. if err != nil {
  4581. return nil, err
  4582. }
  4583. reqHeaders.Set("Content-Type", "application/json")
  4584. c.urlParams_.Set("alt", alt)
  4585. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}")
  4586. urls += "?" + c.urlParams_.Encode()
  4587. req, _ := http.NewRequest("PUT", urls, body)
  4588. req.Header = reqHeaders
  4589. googleapi.Expand(req.URL, map[string]string{
  4590. "calendarId": c.calendarId,
  4591. })
  4592. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4593. }
  4594. // Do executes the "calendar.calendars.update" call.
  4595. // Exactly one of *Calendar or error will be non-nil. Any non-2xx status
  4596. // code is an error. Response headers are in either
  4597. // *Calendar.ServerResponse.Header or (if a response was returned at
  4598. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4599. // to check whether the returned error was because
  4600. // http.StatusNotModified was returned.
  4601. func (c *CalendarsUpdateCall) Do(opts ...googleapi.CallOption) (*Calendar, error) {
  4602. gensupport.SetOptions(c.urlParams_, opts...)
  4603. res, err := c.doRequest("json")
  4604. if res != nil && res.StatusCode == http.StatusNotModified {
  4605. if res.Body != nil {
  4606. res.Body.Close()
  4607. }
  4608. return nil, &googleapi.Error{
  4609. Code: res.StatusCode,
  4610. Header: res.Header,
  4611. }
  4612. }
  4613. if err != nil {
  4614. return nil, err
  4615. }
  4616. defer googleapi.CloseBody(res)
  4617. if err := googleapi.CheckResponse(res); err != nil {
  4618. return nil, err
  4619. }
  4620. ret := &Calendar{
  4621. ServerResponse: googleapi.ServerResponse{
  4622. Header: res.Header,
  4623. HTTPStatusCode: res.StatusCode,
  4624. },
  4625. }
  4626. target := &ret
  4627. if err := gensupport.DecodeResponse(target, res); err != nil {
  4628. return nil, err
  4629. }
  4630. return ret, nil
  4631. // {
  4632. // "description": "Updates metadata for a calendar.",
  4633. // "httpMethod": "PUT",
  4634. // "id": "calendar.calendars.update",
  4635. // "parameterOrder": [
  4636. // "calendarId"
  4637. // ],
  4638. // "parameters": {
  4639. // "calendarId": {
  4640. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  4641. // "location": "path",
  4642. // "required": true,
  4643. // "type": "string"
  4644. // }
  4645. // },
  4646. // "path": "calendars/{calendarId}",
  4647. // "request": {
  4648. // "$ref": "Calendar"
  4649. // },
  4650. // "response": {
  4651. // "$ref": "Calendar"
  4652. // },
  4653. // "scopes": [
  4654. // "https://www.googleapis.com/auth/calendar"
  4655. // ]
  4656. // }
  4657. }
  4658. // method id "calendar.channels.stop":
  4659. type ChannelsStopCall struct {
  4660. s *Service
  4661. channel *Channel
  4662. urlParams_ gensupport.URLParams
  4663. ctx_ context.Context
  4664. header_ http.Header
  4665. }
  4666. // Stop: Stop watching resources through this channel
  4667. func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
  4668. c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4669. c.channel = channel
  4670. return c
  4671. }
  4672. // Fields allows partial responses to be retrieved. See
  4673. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4674. // for more information.
  4675. func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
  4676. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4677. return c
  4678. }
  4679. // Context sets the context to be used in this call's Do method. Any
  4680. // pending HTTP request will be aborted if the provided context is
  4681. // canceled.
  4682. func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
  4683. c.ctx_ = ctx
  4684. return c
  4685. }
  4686. // Header returns an http.Header that can be modified by the caller to
  4687. // add HTTP headers to the request.
  4688. func (c *ChannelsStopCall) Header() http.Header {
  4689. if c.header_ == nil {
  4690. c.header_ = make(http.Header)
  4691. }
  4692. return c.header_
  4693. }
  4694. func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
  4695. reqHeaders := make(http.Header)
  4696. for k, v := range c.header_ {
  4697. reqHeaders[k] = v
  4698. }
  4699. reqHeaders.Set("User-Agent", c.s.userAgent())
  4700. var body io.Reader = nil
  4701. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  4702. if err != nil {
  4703. return nil, err
  4704. }
  4705. reqHeaders.Set("Content-Type", "application/json")
  4706. c.urlParams_.Set("alt", alt)
  4707. urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
  4708. urls += "?" + c.urlParams_.Encode()
  4709. req, _ := http.NewRequest("POST", urls, body)
  4710. req.Header = reqHeaders
  4711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4712. }
  4713. // Do executes the "calendar.channels.stop" call.
  4714. func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
  4715. gensupport.SetOptions(c.urlParams_, opts...)
  4716. res, err := c.doRequest("json")
  4717. if err != nil {
  4718. return err
  4719. }
  4720. defer googleapi.CloseBody(res)
  4721. if err := googleapi.CheckResponse(res); err != nil {
  4722. return err
  4723. }
  4724. return nil
  4725. // {
  4726. // "description": "Stop watching resources through this channel",
  4727. // "httpMethod": "POST",
  4728. // "id": "calendar.channels.stop",
  4729. // "path": "channels/stop",
  4730. // "request": {
  4731. // "$ref": "Channel",
  4732. // "parameterName": "resource"
  4733. // },
  4734. // "scopes": [
  4735. // "https://www.googleapis.com/auth/calendar",
  4736. // "https://www.googleapis.com/auth/calendar.readonly"
  4737. // ]
  4738. // }
  4739. }
  4740. // method id "calendar.colors.get":
  4741. type ColorsGetCall struct {
  4742. s *Service
  4743. urlParams_ gensupport.URLParams
  4744. ifNoneMatch_ string
  4745. ctx_ context.Context
  4746. header_ http.Header
  4747. }
  4748. // Get: Returns the color definitions for calendars and events.
  4749. func (r *ColorsService) Get() *ColorsGetCall {
  4750. c := &ColorsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4751. return c
  4752. }
  4753. // Fields allows partial responses to be retrieved. See
  4754. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4755. // for more information.
  4756. func (c *ColorsGetCall) Fields(s ...googleapi.Field) *ColorsGetCall {
  4757. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4758. return c
  4759. }
  4760. // IfNoneMatch sets the optional parameter which makes the operation
  4761. // fail if the object's ETag matches the given value. This is useful for
  4762. // getting updates only after the object has changed since the last
  4763. // request. Use googleapi.IsNotModified to check whether the response
  4764. // error from Do is the result of In-None-Match.
  4765. func (c *ColorsGetCall) IfNoneMatch(entityTag string) *ColorsGetCall {
  4766. c.ifNoneMatch_ = entityTag
  4767. return c
  4768. }
  4769. // Context sets the context to be used in this call's Do method. Any
  4770. // pending HTTP request will be aborted if the provided context is
  4771. // canceled.
  4772. func (c *ColorsGetCall) Context(ctx context.Context) *ColorsGetCall {
  4773. c.ctx_ = ctx
  4774. return c
  4775. }
  4776. // Header returns an http.Header that can be modified by the caller to
  4777. // add HTTP headers to the request.
  4778. func (c *ColorsGetCall) Header() http.Header {
  4779. if c.header_ == nil {
  4780. c.header_ = make(http.Header)
  4781. }
  4782. return c.header_
  4783. }
  4784. func (c *ColorsGetCall) doRequest(alt string) (*http.Response, error) {
  4785. reqHeaders := make(http.Header)
  4786. for k, v := range c.header_ {
  4787. reqHeaders[k] = v
  4788. }
  4789. reqHeaders.Set("User-Agent", c.s.userAgent())
  4790. if c.ifNoneMatch_ != "" {
  4791. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4792. }
  4793. var body io.Reader = nil
  4794. c.urlParams_.Set("alt", alt)
  4795. urls := googleapi.ResolveRelative(c.s.BasePath, "colors")
  4796. urls += "?" + c.urlParams_.Encode()
  4797. req, _ := http.NewRequest("GET", urls, body)
  4798. req.Header = reqHeaders
  4799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4800. }
  4801. // Do executes the "calendar.colors.get" call.
  4802. // Exactly one of *Colors or error will be non-nil. Any non-2xx status
  4803. // code is an error. Response headers are in either
  4804. // *Colors.ServerResponse.Header or (if a response was returned at all)
  4805. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4806. // check whether the returned error was because http.StatusNotModified
  4807. // was returned.
  4808. func (c *ColorsGetCall) Do(opts ...googleapi.CallOption) (*Colors, error) {
  4809. gensupport.SetOptions(c.urlParams_, opts...)
  4810. res, err := c.doRequest("json")
  4811. if res != nil && res.StatusCode == http.StatusNotModified {
  4812. if res.Body != nil {
  4813. res.Body.Close()
  4814. }
  4815. return nil, &googleapi.Error{
  4816. Code: res.StatusCode,
  4817. Header: res.Header,
  4818. }
  4819. }
  4820. if err != nil {
  4821. return nil, err
  4822. }
  4823. defer googleapi.CloseBody(res)
  4824. if err := googleapi.CheckResponse(res); err != nil {
  4825. return nil, err
  4826. }
  4827. ret := &Colors{
  4828. ServerResponse: googleapi.ServerResponse{
  4829. Header: res.Header,
  4830. HTTPStatusCode: res.StatusCode,
  4831. },
  4832. }
  4833. target := &ret
  4834. if err := gensupport.DecodeResponse(target, res); err != nil {
  4835. return nil, err
  4836. }
  4837. return ret, nil
  4838. // {
  4839. // "description": "Returns the color definitions for calendars and events.",
  4840. // "httpMethod": "GET",
  4841. // "id": "calendar.colors.get",
  4842. // "path": "colors",
  4843. // "response": {
  4844. // "$ref": "Colors"
  4845. // },
  4846. // "scopes": [
  4847. // "https://www.googleapis.com/auth/calendar",
  4848. // "https://www.googleapis.com/auth/calendar.readonly"
  4849. // ]
  4850. // }
  4851. }
  4852. // method id "calendar.events.delete":
  4853. type EventsDeleteCall struct {
  4854. s *Service
  4855. calendarId string
  4856. eventId string
  4857. urlParams_ gensupport.URLParams
  4858. ctx_ context.Context
  4859. header_ http.Header
  4860. }
  4861. // Delete: Deletes an event.
  4862. func (r *EventsService) Delete(calendarId string, eventId string) *EventsDeleteCall {
  4863. c := &EventsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4864. c.calendarId = calendarId
  4865. c.eventId = eventId
  4866. return c
  4867. }
  4868. // SendNotifications sets the optional parameter "sendNotifications":
  4869. // Whether to send notifications about the deletion of the event. The
  4870. // default is False.
  4871. func (c *EventsDeleteCall) SendNotifications(sendNotifications bool) *EventsDeleteCall {
  4872. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  4873. return c
  4874. }
  4875. // Fields allows partial responses to be retrieved. See
  4876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4877. // for more information.
  4878. func (c *EventsDeleteCall) Fields(s ...googleapi.Field) *EventsDeleteCall {
  4879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4880. return c
  4881. }
  4882. // Context sets the context to be used in this call's Do method. Any
  4883. // pending HTTP request will be aborted if the provided context is
  4884. // canceled.
  4885. func (c *EventsDeleteCall) Context(ctx context.Context) *EventsDeleteCall {
  4886. c.ctx_ = ctx
  4887. return c
  4888. }
  4889. // Header returns an http.Header that can be modified by the caller to
  4890. // add HTTP headers to the request.
  4891. func (c *EventsDeleteCall) Header() http.Header {
  4892. if c.header_ == nil {
  4893. c.header_ = make(http.Header)
  4894. }
  4895. return c.header_
  4896. }
  4897. func (c *EventsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4898. reqHeaders := make(http.Header)
  4899. for k, v := range c.header_ {
  4900. reqHeaders[k] = v
  4901. }
  4902. reqHeaders.Set("User-Agent", c.s.userAgent())
  4903. var body io.Reader = nil
  4904. c.urlParams_.Set("alt", alt)
  4905. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
  4906. urls += "?" + c.urlParams_.Encode()
  4907. req, _ := http.NewRequest("DELETE", urls, body)
  4908. req.Header = reqHeaders
  4909. googleapi.Expand(req.URL, map[string]string{
  4910. "calendarId": c.calendarId,
  4911. "eventId": c.eventId,
  4912. })
  4913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4914. }
  4915. // Do executes the "calendar.events.delete" call.
  4916. func (c *EventsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4917. gensupport.SetOptions(c.urlParams_, opts...)
  4918. res, err := c.doRequest("json")
  4919. if err != nil {
  4920. return err
  4921. }
  4922. defer googleapi.CloseBody(res)
  4923. if err := googleapi.CheckResponse(res); err != nil {
  4924. return err
  4925. }
  4926. return nil
  4927. // {
  4928. // "description": "Deletes an event.",
  4929. // "httpMethod": "DELETE",
  4930. // "id": "calendar.events.delete",
  4931. // "parameterOrder": [
  4932. // "calendarId",
  4933. // "eventId"
  4934. // ],
  4935. // "parameters": {
  4936. // "calendarId": {
  4937. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  4938. // "location": "path",
  4939. // "required": true,
  4940. // "type": "string"
  4941. // },
  4942. // "eventId": {
  4943. // "description": "Event identifier.",
  4944. // "location": "path",
  4945. // "required": true,
  4946. // "type": "string"
  4947. // },
  4948. // "sendNotifications": {
  4949. // "description": "Whether to send notifications about the deletion of the event. Optional. The default is False.",
  4950. // "location": "query",
  4951. // "type": "boolean"
  4952. // }
  4953. // },
  4954. // "path": "calendars/{calendarId}/events/{eventId}",
  4955. // "scopes": [
  4956. // "https://www.googleapis.com/auth/calendar"
  4957. // ]
  4958. // }
  4959. }
  4960. // method id "calendar.events.get":
  4961. type EventsGetCall struct {
  4962. s *Service
  4963. calendarId string
  4964. eventId string
  4965. urlParams_ gensupport.URLParams
  4966. ifNoneMatch_ string
  4967. ctx_ context.Context
  4968. header_ http.Header
  4969. }
  4970. // Get: Returns an event.
  4971. func (r *EventsService) Get(calendarId string, eventId string) *EventsGetCall {
  4972. c := &EventsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4973. c.calendarId = calendarId
  4974. c.eventId = eventId
  4975. return c
  4976. }
  4977. // AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
  4978. // Whether to always include a value in the email field for the
  4979. // organizer, creator and attendees, even if no real email is available
  4980. // (i.e. a generated, non-working value will be provided). The use of
  4981. // this option is discouraged and should only be used by clients which
  4982. // cannot handle the absence of an email address value in the mentioned
  4983. // places. The default is False.
  4984. func (c *EventsGetCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsGetCall {
  4985. c.urlParams_.Set("alwaysIncludeEmail", fmt.Sprint(alwaysIncludeEmail))
  4986. return c
  4987. }
  4988. // MaxAttendees sets the optional parameter "maxAttendees": The maximum
  4989. // number of attendees to include in the response. If there are more
  4990. // than the specified number of attendees, only the participant is
  4991. // returned.
  4992. func (c *EventsGetCall) MaxAttendees(maxAttendees int64) *EventsGetCall {
  4993. c.urlParams_.Set("maxAttendees", fmt.Sprint(maxAttendees))
  4994. return c
  4995. }
  4996. // TimeZone sets the optional parameter "timeZone": Time zone used in
  4997. // the response. The default is the time zone of the calendar.
  4998. func (c *EventsGetCall) TimeZone(timeZone string) *EventsGetCall {
  4999. c.urlParams_.Set("timeZone", timeZone)
  5000. return c
  5001. }
  5002. // Fields allows partial responses to be retrieved. See
  5003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5004. // for more information.
  5005. func (c *EventsGetCall) Fields(s ...googleapi.Field) *EventsGetCall {
  5006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5007. return c
  5008. }
  5009. // IfNoneMatch sets the optional parameter which makes the operation
  5010. // fail if the object's ETag matches the given value. This is useful for
  5011. // getting updates only after the object has changed since the last
  5012. // request. Use googleapi.IsNotModified to check whether the response
  5013. // error from Do is the result of In-None-Match.
  5014. func (c *EventsGetCall) IfNoneMatch(entityTag string) *EventsGetCall {
  5015. c.ifNoneMatch_ = entityTag
  5016. return c
  5017. }
  5018. // Context sets the context to be used in this call's Do method. Any
  5019. // pending HTTP request will be aborted if the provided context is
  5020. // canceled.
  5021. func (c *EventsGetCall) Context(ctx context.Context) *EventsGetCall {
  5022. c.ctx_ = ctx
  5023. return c
  5024. }
  5025. // Header returns an http.Header that can be modified by the caller to
  5026. // add HTTP headers to the request.
  5027. func (c *EventsGetCall) Header() http.Header {
  5028. if c.header_ == nil {
  5029. c.header_ = make(http.Header)
  5030. }
  5031. return c.header_
  5032. }
  5033. func (c *EventsGetCall) doRequest(alt string) (*http.Response, error) {
  5034. reqHeaders := make(http.Header)
  5035. for k, v := range c.header_ {
  5036. reqHeaders[k] = v
  5037. }
  5038. reqHeaders.Set("User-Agent", c.s.userAgent())
  5039. if c.ifNoneMatch_ != "" {
  5040. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5041. }
  5042. var body io.Reader = nil
  5043. c.urlParams_.Set("alt", alt)
  5044. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
  5045. urls += "?" + c.urlParams_.Encode()
  5046. req, _ := http.NewRequest("GET", urls, body)
  5047. req.Header = reqHeaders
  5048. googleapi.Expand(req.URL, map[string]string{
  5049. "calendarId": c.calendarId,
  5050. "eventId": c.eventId,
  5051. })
  5052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5053. }
  5054. // Do executes the "calendar.events.get" call.
  5055. // Exactly one of *Event or error will be non-nil. Any non-2xx status
  5056. // code is an error. Response headers are in either
  5057. // *Event.ServerResponse.Header or (if a response was returned at all)
  5058. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5059. // check whether the returned error was because http.StatusNotModified
  5060. // was returned.
  5061. func (c *EventsGetCall) Do(opts ...googleapi.CallOption) (*Event, error) {
  5062. gensupport.SetOptions(c.urlParams_, opts...)
  5063. res, err := c.doRequest("json")
  5064. if res != nil && res.StatusCode == http.StatusNotModified {
  5065. if res.Body != nil {
  5066. res.Body.Close()
  5067. }
  5068. return nil, &googleapi.Error{
  5069. Code: res.StatusCode,
  5070. Header: res.Header,
  5071. }
  5072. }
  5073. if err != nil {
  5074. return nil, err
  5075. }
  5076. defer googleapi.CloseBody(res)
  5077. if err := googleapi.CheckResponse(res); err != nil {
  5078. return nil, err
  5079. }
  5080. ret := &Event{
  5081. ServerResponse: googleapi.ServerResponse{
  5082. Header: res.Header,
  5083. HTTPStatusCode: res.StatusCode,
  5084. },
  5085. }
  5086. target := &ret
  5087. if err := gensupport.DecodeResponse(target, res); err != nil {
  5088. return nil, err
  5089. }
  5090. return ret, nil
  5091. // {
  5092. // "description": "Returns an event.",
  5093. // "httpMethod": "GET",
  5094. // "id": "calendar.events.get",
  5095. // "parameterOrder": [
  5096. // "calendarId",
  5097. // "eventId"
  5098. // ],
  5099. // "parameters": {
  5100. // "alwaysIncludeEmail": {
  5101. // "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.",
  5102. // "location": "query",
  5103. // "type": "boolean"
  5104. // },
  5105. // "calendarId": {
  5106. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  5107. // "location": "path",
  5108. // "required": true,
  5109. // "type": "string"
  5110. // },
  5111. // "eventId": {
  5112. // "description": "Event identifier.",
  5113. // "location": "path",
  5114. // "required": true,
  5115. // "type": "string"
  5116. // },
  5117. // "maxAttendees": {
  5118. // "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.",
  5119. // "format": "int32",
  5120. // "location": "query",
  5121. // "minimum": "1",
  5122. // "type": "integer"
  5123. // },
  5124. // "timeZone": {
  5125. // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
  5126. // "location": "query",
  5127. // "type": "string"
  5128. // }
  5129. // },
  5130. // "path": "calendars/{calendarId}/events/{eventId}",
  5131. // "response": {
  5132. // "$ref": "Event"
  5133. // },
  5134. // "scopes": [
  5135. // "https://www.googleapis.com/auth/calendar",
  5136. // "https://www.googleapis.com/auth/calendar.readonly"
  5137. // ]
  5138. // }
  5139. }
  5140. // method id "calendar.events.import":
  5141. type EventsImportCall struct {
  5142. s *Service
  5143. calendarId string
  5144. event *Event
  5145. urlParams_ gensupport.URLParams
  5146. ctx_ context.Context
  5147. header_ http.Header
  5148. }
  5149. // Import: Imports an event. This operation is used to add a private
  5150. // copy of an existing event to a calendar.
  5151. func (r *EventsService) Import(calendarId string, event *Event) *EventsImportCall {
  5152. c := &EventsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5153. c.calendarId = calendarId
  5154. c.event = event
  5155. return c
  5156. }
  5157. // ConferenceDataVersion sets the optional parameter
  5158. // "conferenceDataVersion": Version number of conference data supported
  5159. // by the API client. Version 0 assumes no conference data support and
  5160. // ignores conference data in the event's body. Version 1 enables
  5161. // support for copying of ConferenceData as well as for creating new
  5162. // conferences using the createRequest field of conferenceData. The
  5163. // default is 0.
  5164. func (c *EventsImportCall) ConferenceDataVersion(conferenceDataVersion int64) *EventsImportCall {
  5165. c.urlParams_.Set("conferenceDataVersion", fmt.Sprint(conferenceDataVersion))
  5166. return c
  5167. }
  5168. // SupportsAttachments sets the optional parameter
  5169. // "supportsAttachments": Whether API client performing operation
  5170. // supports event attachments. The default is False.
  5171. func (c *EventsImportCall) SupportsAttachments(supportsAttachments bool) *EventsImportCall {
  5172. c.urlParams_.Set("supportsAttachments", fmt.Sprint(supportsAttachments))
  5173. return c
  5174. }
  5175. // Fields allows partial responses to be retrieved. See
  5176. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5177. // for more information.
  5178. func (c *EventsImportCall) Fields(s ...googleapi.Field) *EventsImportCall {
  5179. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5180. return c
  5181. }
  5182. // Context sets the context to be used in this call's Do method. Any
  5183. // pending HTTP request will be aborted if the provided context is
  5184. // canceled.
  5185. func (c *EventsImportCall) Context(ctx context.Context) *EventsImportCall {
  5186. c.ctx_ = ctx
  5187. return c
  5188. }
  5189. // Header returns an http.Header that can be modified by the caller to
  5190. // add HTTP headers to the request.
  5191. func (c *EventsImportCall) Header() http.Header {
  5192. if c.header_ == nil {
  5193. c.header_ = make(http.Header)
  5194. }
  5195. return c.header_
  5196. }
  5197. func (c *EventsImportCall) doRequest(alt string) (*http.Response, error) {
  5198. reqHeaders := make(http.Header)
  5199. for k, v := range c.header_ {
  5200. reqHeaders[k] = v
  5201. }
  5202. reqHeaders.Set("User-Agent", c.s.userAgent())
  5203. var body io.Reader = nil
  5204. body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
  5205. if err != nil {
  5206. return nil, err
  5207. }
  5208. reqHeaders.Set("Content-Type", "application/json")
  5209. c.urlParams_.Set("alt", alt)
  5210. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/import")
  5211. urls += "?" + c.urlParams_.Encode()
  5212. req, _ := http.NewRequest("POST", urls, body)
  5213. req.Header = reqHeaders
  5214. googleapi.Expand(req.URL, map[string]string{
  5215. "calendarId": c.calendarId,
  5216. })
  5217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5218. }
  5219. // Do executes the "calendar.events.import" call.
  5220. // Exactly one of *Event or error will be non-nil. Any non-2xx status
  5221. // code is an error. Response headers are in either
  5222. // *Event.ServerResponse.Header or (if a response was returned at all)
  5223. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5224. // check whether the returned error was because http.StatusNotModified
  5225. // was returned.
  5226. func (c *EventsImportCall) Do(opts ...googleapi.CallOption) (*Event, error) {
  5227. gensupport.SetOptions(c.urlParams_, opts...)
  5228. res, err := c.doRequest("json")
  5229. if res != nil && res.StatusCode == http.StatusNotModified {
  5230. if res.Body != nil {
  5231. res.Body.Close()
  5232. }
  5233. return nil, &googleapi.Error{
  5234. Code: res.StatusCode,
  5235. Header: res.Header,
  5236. }
  5237. }
  5238. if err != nil {
  5239. return nil, err
  5240. }
  5241. defer googleapi.CloseBody(res)
  5242. if err := googleapi.CheckResponse(res); err != nil {
  5243. return nil, err
  5244. }
  5245. ret := &Event{
  5246. ServerResponse: googleapi.ServerResponse{
  5247. Header: res.Header,
  5248. HTTPStatusCode: res.StatusCode,
  5249. },
  5250. }
  5251. target := &ret
  5252. if err := gensupport.DecodeResponse(target, res); err != nil {
  5253. return nil, err
  5254. }
  5255. return ret, nil
  5256. // {
  5257. // "description": "Imports an event. This operation is used to add a private copy of an existing event to a calendar.",
  5258. // "httpMethod": "POST",
  5259. // "id": "calendar.events.import",
  5260. // "parameterOrder": [
  5261. // "calendarId"
  5262. // ],
  5263. // "parameters": {
  5264. // "calendarId": {
  5265. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  5266. // "location": "path",
  5267. // "required": true,
  5268. // "type": "string"
  5269. // },
  5270. // "conferenceDataVersion": {
  5271. // "description": "Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0.",
  5272. // "format": "int32",
  5273. // "location": "query",
  5274. // "maximum": "1",
  5275. // "minimum": "0",
  5276. // "type": "integer"
  5277. // },
  5278. // "supportsAttachments": {
  5279. // "description": "Whether API client performing operation supports event attachments. Optional. The default is False.",
  5280. // "location": "query",
  5281. // "type": "boolean"
  5282. // }
  5283. // },
  5284. // "path": "calendars/{calendarId}/events/import",
  5285. // "request": {
  5286. // "$ref": "Event"
  5287. // },
  5288. // "response": {
  5289. // "$ref": "Event"
  5290. // },
  5291. // "scopes": [
  5292. // "https://www.googleapis.com/auth/calendar"
  5293. // ]
  5294. // }
  5295. }
  5296. // method id "calendar.events.insert":
  5297. type EventsInsertCall struct {
  5298. s *Service
  5299. calendarId string
  5300. event *Event
  5301. urlParams_ gensupport.URLParams
  5302. ctx_ context.Context
  5303. header_ http.Header
  5304. }
  5305. // Insert: Creates an event.
  5306. func (r *EventsService) Insert(calendarId string, event *Event) *EventsInsertCall {
  5307. c := &EventsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5308. c.calendarId = calendarId
  5309. c.event = event
  5310. return c
  5311. }
  5312. // ConferenceDataVersion sets the optional parameter
  5313. // "conferenceDataVersion": Version number of conference data supported
  5314. // by the API client. Version 0 assumes no conference data support and
  5315. // ignores conference data in the event's body. Version 1 enables
  5316. // support for copying of ConferenceData as well as for creating new
  5317. // conferences using the createRequest field of conferenceData. The
  5318. // default is 0.
  5319. func (c *EventsInsertCall) ConferenceDataVersion(conferenceDataVersion int64) *EventsInsertCall {
  5320. c.urlParams_.Set("conferenceDataVersion", fmt.Sprint(conferenceDataVersion))
  5321. return c
  5322. }
  5323. // MaxAttendees sets the optional parameter "maxAttendees": The maximum
  5324. // number of attendees to include in the response. If there are more
  5325. // than the specified number of attendees, only the participant is
  5326. // returned.
  5327. func (c *EventsInsertCall) MaxAttendees(maxAttendees int64) *EventsInsertCall {
  5328. c.urlParams_.Set("maxAttendees", fmt.Sprint(maxAttendees))
  5329. return c
  5330. }
  5331. // SendNotifications sets the optional parameter "sendNotifications":
  5332. // Whether to send notifications about the creation of the new event.
  5333. // The default is False.
  5334. func (c *EventsInsertCall) SendNotifications(sendNotifications bool) *EventsInsertCall {
  5335. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  5336. return c
  5337. }
  5338. // SupportsAttachments sets the optional parameter
  5339. // "supportsAttachments": Whether API client performing operation
  5340. // supports event attachments. The default is False.
  5341. func (c *EventsInsertCall) SupportsAttachments(supportsAttachments bool) *EventsInsertCall {
  5342. c.urlParams_.Set("supportsAttachments", fmt.Sprint(supportsAttachments))
  5343. return c
  5344. }
  5345. // Fields allows partial responses to be retrieved. See
  5346. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5347. // for more information.
  5348. func (c *EventsInsertCall) Fields(s ...googleapi.Field) *EventsInsertCall {
  5349. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5350. return c
  5351. }
  5352. // Context sets the context to be used in this call's Do method. Any
  5353. // pending HTTP request will be aborted if the provided context is
  5354. // canceled.
  5355. func (c *EventsInsertCall) Context(ctx context.Context) *EventsInsertCall {
  5356. c.ctx_ = ctx
  5357. return c
  5358. }
  5359. // Header returns an http.Header that can be modified by the caller to
  5360. // add HTTP headers to the request.
  5361. func (c *EventsInsertCall) Header() http.Header {
  5362. if c.header_ == nil {
  5363. c.header_ = make(http.Header)
  5364. }
  5365. return c.header_
  5366. }
  5367. func (c *EventsInsertCall) doRequest(alt string) (*http.Response, error) {
  5368. reqHeaders := make(http.Header)
  5369. for k, v := range c.header_ {
  5370. reqHeaders[k] = v
  5371. }
  5372. reqHeaders.Set("User-Agent", c.s.userAgent())
  5373. var body io.Reader = nil
  5374. body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
  5375. if err != nil {
  5376. return nil, err
  5377. }
  5378. reqHeaders.Set("Content-Type", "application/json")
  5379. c.urlParams_.Set("alt", alt)
  5380. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events")
  5381. urls += "?" + c.urlParams_.Encode()
  5382. req, _ := http.NewRequest("POST", urls, body)
  5383. req.Header = reqHeaders
  5384. googleapi.Expand(req.URL, map[string]string{
  5385. "calendarId": c.calendarId,
  5386. })
  5387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5388. }
  5389. // Do executes the "calendar.events.insert" call.
  5390. // Exactly one of *Event or error will be non-nil. Any non-2xx status
  5391. // code is an error. Response headers are in either
  5392. // *Event.ServerResponse.Header or (if a response was returned at all)
  5393. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5394. // check whether the returned error was because http.StatusNotModified
  5395. // was returned.
  5396. func (c *EventsInsertCall) Do(opts ...googleapi.CallOption) (*Event, error) {
  5397. gensupport.SetOptions(c.urlParams_, opts...)
  5398. res, err := c.doRequest("json")
  5399. if res != nil && res.StatusCode == http.StatusNotModified {
  5400. if res.Body != nil {
  5401. res.Body.Close()
  5402. }
  5403. return nil, &googleapi.Error{
  5404. Code: res.StatusCode,
  5405. Header: res.Header,
  5406. }
  5407. }
  5408. if err != nil {
  5409. return nil, err
  5410. }
  5411. defer googleapi.CloseBody(res)
  5412. if err := googleapi.CheckResponse(res); err != nil {
  5413. return nil, err
  5414. }
  5415. ret := &Event{
  5416. ServerResponse: googleapi.ServerResponse{
  5417. Header: res.Header,
  5418. HTTPStatusCode: res.StatusCode,
  5419. },
  5420. }
  5421. target := &ret
  5422. if err := gensupport.DecodeResponse(target, res); err != nil {
  5423. return nil, err
  5424. }
  5425. return ret, nil
  5426. // {
  5427. // "description": "Creates an event.",
  5428. // "httpMethod": "POST",
  5429. // "id": "calendar.events.insert",
  5430. // "parameterOrder": [
  5431. // "calendarId"
  5432. // ],
  5433. // "parameters": {
  5434. // "calendarId": {
  5435. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  5436. // "location": "path",
  5437. // "required": true,
  5438. // "type": "string"
  5439. // },
  5440. // "conferenceDataVersion": {
  5441. // "description": "Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0.",
  5442. // "format": "int32",
  5443. // "location": "query",
  5444. // "maximum": "1",
  5445. // "minimum": "0",
  5446. // "type": "integer"
  5447. // },
  5448. // "maxAttendees": {
  5449. // "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.",
  5450. // "format": "int32",
  5451. // "location": "query",
  5452. // "minimum": "1",
  5453. // "type": "integer"
  5454. // },
  5455. // "sendNotifications": {
  5456. // "description": "Whether to send notifications about the creation of the new event. Optional. The default is False.",
  5457. // "location": "query",
  5458. // "type": "boolean"
  5459. // },
  5460. // "supportsAttachments": {
  5461. // "description": "Whether API client performing operation supports event attachments. Optional. The default is False.",
  5462. // "location": "query",
  5463. // "type": "boolean"
  5464. // }
  5465. // },
  5466. // "path": "calendars/{calendarId}/events",
  5467. // "request": {
  5468. // "$ref": "Event"
  5469. // },
  5470. // "response": {
  5471. // "$ref": "Event"
  5472. // },
  5473. // "scopes": [
  5474. // "https://www.googleapis.com/auth/calendar"
  5475. // ]
  5476. // }
  5477. }
  5478. // method id "calendar.events.instances":
  5479. type EventsInstancesCall struct {
  5480. s *Service
  5481. calendarId string
  5482. eventId string
  5483. urlParams_ gensupport.URLParams
  5484. ifNoneMatch_ string
  5485. ctx_ context.Context
  5486. header_ http.Header
  5487. }
  5488. // Instances: Returns instances of the specified recurring event.
  5489. func (r *EventsService) Instances(calendarId string, eventId string) *EventsInstancesCall {
  5490. c := &EventsInstancesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5491. c.calendarId = calendarId
  5492. c.eventId = eventId
  5493. return c
  5494. }
  5495. // AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
  5496. // Whether to always include a value in the email field for the
  5497. // organizer, creator and attendees, even if no real email is available
  5498. // (i.e. a generated, non-working value will be provided). The use of
  5499. // this option is discouraged and should only be used by clients which
  5500. // cannot handle the absence of an email address value in the mentioned
  5501. // places. The default is False.
  5502. func (c *EventsInstancesCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsInstancesCall {
  5503. c.urlParams_.Set("alwaysIncludeEmail", fmt.Sprint(alwaysIncludeEmail))
  5504. return c
  5505. }
  5506. // MaxAttendees sets the optional parameter "maxAttendees": The maximum
  5507. // number of attendees to include in the response. If there are more
  5508. // than the specified number of attendees, only the participant is
  5509. // returned.
  5510. func (c *EventsInstancesCall) MaxAttendees(maxAttendees int64) *EventsInstancesCall {
  5511. c.urlParams_.Set("maxAttendees", fmt.Sprint(maxAttendees))
  5512. return c
  5513. }
  5514. // MaxResults sets the optional parameter "maxResults": Maximum number
  5515. // of events returned on one result page. By default the value is 250
  5516. // events. The page size can never be larger than 2500 events.
  5517. func (c *EventsInstancesCall) MaxResults(maxResults int64) *EventsInstancesCall {
  5518. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5519. return c
  5520. }
  5521. // OriginalStart sets the optional parameter "originalStart": The
  5522. // original start time of the instance in the result.
  5523. func (c *EventsInstancesCall) OriginalStart(originalStart string) *EventsInstancesCall {
  5524. c.urlParams_.Set("originalStart", originalStart)
  5525. return c
  5526. }
  5527. // PageToken sets the optional parameter "pageToken": Token specifying
  5528. // which result page to return.
  5529. func (c *EventsInstancesCall) PageToken(pageToken string) *EventsInstancesCall {
  5530. c.urlParams_.Set("pageToken", pageToken)
  5531. return c
  5532. }
  5533. // ShowDeleted sets the optional parameter "showDeleted": Whether to
  5534. // include deleted events (with status equals "cancelled") in the
  5535. // result. Cancelled instances of recurring events will still be
  5536. // included if singleEvents is False. The default is False.
  5537. func (c *EventsInstancesCall) ShowDeleted(showDeleted bool) *EventsInstancesCall {
  5538. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  5539. return c
  5540. }
  5541. // TimeMax sets the optional parameter "timeMax": Upper bound
  5542. // (exclusive) for an event's start time to filter by. The default is
  5543. // not to filter by start time. Must be an RFC3339 timestamp with
  5544. // mandatory time zone offset.
  5545. func (c *EventsInstancesCall) TimeMax(timeMax string) *EventsInstancesCall {
  5546. c.urlParams_.Set("timeMax", timeMax)
  5547. return c
  5548. }
  5549. // TimeMin sets the optional parameter "timeMin": Lower bound
  5550. // (inclusive) for an event's end time to filter by. The default is not
  5551. // to filter by end time. Must be an RFC3339 timestamp with mandatory
  5552. // time zone offset.
  5553. func (c *EventsInstancesCall) TimeMin(timeMin string) *EventsInstancesCall {
  5554. c.urlParams_.Set("timeMin", timeMin)
  5555. return c
  5556. }
  5557. // TimeZone sets the optional parameter "timeZone": Time zone used in
  5558. // the response. The default is the time zone of the calendar.
  5559. func (c *EventsInstancesCall) TimeZone(timeZone string) *EventsInstancesCall {
  5560. c.urlParams_.Set("timeZone", timeZone)
  5561. return c
  5562. }
  5563. // Fields allows partial responses to be retrieved. See
  5564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5565. // for more information.
  5566. func (c *EventsInstancesCall) Fields(s ...googleapi.Field) *EventsInstancesCall {
  5567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5568. return c
  5569. }
  5570. // IfNoneMatch sets the optional parameter which makes the operation
  5571. // fail if the object's ETag matches the given value. This is useful for
  5572. // getting updates only after the object has changed since the last
  5573. // request. Use googleapi.IsNotModified to check whether the response
  5574. // error from Do is the result of In-None-Match.
  5575. func (c *EventsInstancesCall) IfNoneMatch(entityTag string) *EventsInstancesCall {
  5576. c.ifNoneMatch_ = entityTag
  5577. return c
  5578. }
  5579. // Context sets the context to be used in this call's Do method. Any
  5580. // pending HTTP request will be aborted if the provided context is
  5581. // canceled.
  5582. func (c *EventsInstancesCall) Context(ctx context.Context) *EventsInstancesCall {
  5583. c.ctx_ = ctx
  5584. return c
  5585. }
  5586. // Header returns an http.Header that can be modified by the caller to
  5587. // add HTTP headers to the request.
  5588. func (c *EventsInstancesCall) Header() http.Header {
  5589. if c.header_ == nil {
  5590. c.header_ = make(http.Header)
  5591. }
  5592. return c.header_
  5593. }
  5594. func (c *EventsInstancesCall) doRequest(alt string) (*http.Response, error) {
  5595. reqHeaders := make(http.Header)
  5596. for k, v := range c.header_ {
  5597. reqHeaders[k] = v
  5598. }
  5599. reqHeaders.Set("User-Agent", c.s.userAgent())
  5600. if c.ifNoneMatch_ != "" {
  5601. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5602. }
  5603. var body io.Reader = nil
  5604. c.urlParams_.Set("alt", alt)
  5605. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/instances")
  5606. urls += "?" + c.urlParams_.Encode()
  5607. req, _ := http.NewRequest("GET", urls, body)
  5608. req.Header = reqHeaders
  5609. googleapi.Expand(req.URL, map[string]string{
  5610. "calendarId": c.calendarId,
  5611. "eventId": c.eventId,
  5612. })
  5613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5614. }
  5615. // Do executes the "calendar.events.instances" call.
  5616. // Exactly one of *Events or error will be non-nil. Any non-2xx status
  5617. // code is an error. Response headers are in either
  5618. // *Events.ServerResponse.Header or (if a response was returned at all)
  5619. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5620. // check whether the returned error was because http.StatusNotModified
  5621. // was returned.
  5622. func (c *EventsInstancesCall) Do(opts ...googleapi.CallOption) (*Events, error) {
  5623. gensupport.SetOptions(c.urlParams_, opts...)
  5624. res, err := c.doRequest("json")
  5625. if res != nil && res.StatusCode == http.StatusNotModified {
  5626. if res.Body != nil {
  5627. res.Body.Close()
  5628. }
  5629. return nil, &googleapi.Error{
  5630. Code: res.StatusCode,
  5631. Header: res.Header,
  5632. }
  5633. }
  5634. if err != nil {
  5635. return nil, err
  5636. }
  5637. defer googleapi.CloseBody(res)
  5638. if err := googleapi.CheckResponse(res); err != nil {
  5639. return nil, err
  5640. }
  5641. ret := &Events{
  5642. ServerResponse: googleapi.ServerResponse{
  5643. Header: res.Header,
  5644. HTTPStatusCode: res.StatusCode,
  5645. },
  5646. }
  5647. target := &ret
  5648. if err := gensupport.DecodeResponse(target, res); err != nil {
  5649. return nil, err
  5650. }
  5651. return ret, nil
  5652. // {
  5653. // "description": "Returns instances of the specified recurring event.",
  5654. // "httpMethod": "GET",
  5655. // "id": "calendar.events.instances",
  5656. // "parameterOrder": [
  5657. // "calendarId",
  5658. // "eventId"
  5659. // ],
  5660. // "parameters": {
  5661. // "alwaysIncludeEmail": {
  5662. // "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.",
  5663. // "location": "query",
  5664. // "type": "boolean"
  5665. // },
  5666. // "calendarId": {
  5667. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  5668. // "location": "path",
  5669. // "required": true,
  5670. // "type": "string"
  5671. // },
  5672. // "eventId": {
  5673. // "description": "Recurring event identifier.",
  5674. // "location": "path",
  5675. // "required": true,
  5676. // "type": "string"
  5677. // },
  5678. // "maxAttendees": {
  5679. // "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.",
  5680. // "format": "int32",
  5681. // "location": "query",
  5682. // "minimum": "1",
  5683. // "type": "integer"
  5684. // },
  5685. // "maxResults": {
  5686. // "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.",
  5687. // "format": "int32",
  5688. // "location": "query",
  5689. // "minimum": "1",
  5690. // "type": "integer"
  5691. // },
  5692. // "originalStart": {
  5693. // "description": "The original start time of the instance in the result. Optional.",
  5694. // "location": "query",
  5695. // "type": "string"
  5696. // },
  5697. // "pageToken": {
  5698. // "description": "Token specifying which result page to return. Optional.",
  5699. // "location": "query",
  5700. // "type": "string"
  5701. // },
  5702. // "showDeleted": {
  5703. // "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.",
  5704. // "location": "query",
  5705. // "type": "boolean"
  5706. // },
  5707. // "timeMax": {
  5708. // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset.",
  5709. // "format": "date-time",
  5710. // "location": "query",
  5711. // "type": "string"
  5712. // },
  5713. // "timeMin": {
  5714. // "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset.",
  5715. // "format": "date-time",
  5716. // "location": "query",
  5717. // "type": "string"
  5718. // },
  5719. // "timeZone": {
  5720. // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
  5721. // "location": "query",
  5722. // "type": "string"
  5723. // }
  5724. // },
  5725. // "path": "calendars/{calendarId}/events/{eventId}/instances",
  5726. // "response": {
  5727. // "$ref": "Events"
  5728. // },
  5729. // "scopes": [
  5730. // "https://www.googleapis.com/auth/calendar",
  5731. // "https://www.googleapis.com/auth/calendar.readonly"
  5732. // ],
  5733. // "supportsSubscription": true
  5734. // }
  5735. }
  5736. // Pages invokes f for each page of results.
  5737. // A non-nil error returned from f will halt the iteration.
  5738. // The provided context supersedes any context provided to the Context method.
  5739. func (c *EventsInstancesCall) Pages(ctx context.Context, f func(*Events) error) error {
  5740. c.ctx_ = ctx
  5741. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5742. for {
  5743. x, err := c.Do()
  5744. if err != nil {
  5745. return err
  5746. }
  5747. if err := f(x); err != nil {
  5748. return err
  5749. }
  5750. if x.NextPageToken == "" {
  5751. return nil
  5752. }
  5753. c.PageToken(x.NextPageToken)
  5754. }
  5755. }
  5756. // method id "calendar.events.list":
  5757. type EventsListCall struct {
  5758. s *Service
  5759. calendarId string
  5760. urlParams_ gensupport.URLParams
  5761. ifNoneMatch_ string
  5762. ctx_ context.Context
  5763. header_ http.Header
  5764. }
  5765. // List: Returns events on the specified calendar.
  5766. func (r *EventsService) List(calendarId string) *EventsListCall {
  5767. c := &EventsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5768. c.calendarId = calendarId
  5769. return c
  5770. }
  5771. // AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
  5772. // Whether to always include a value in the email field for the
  5773. // organizer, creator and attendees, even if no real email is available
  5774. // (i.e. a generated, non-working value will be provided). The use of
  5775. // this option is discouraged and should only be used by clients which
  5776. // cannot handle the absence of an email address value in the mentioned
  5777. // places. The default is False.
  5778. func (c *EventsListCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsListCall {
  5779. c.urlParams_.Set("alwaysIncludeEmail", fmt.Sprint(alwaysIncludeEmail))
  5780. return c
  5781. }
  5782. // ICalUID sets the optional parameter "iCalUID": Specifies event ID in
  5783. // the iCalendar format to be included in the response.
  5784. func (c *EventsListCall) ICalUID(iCalUID string) *EventsListCall {
  5785. c.urlParams_.Set("iCalUID", iCalUID)
  5786. return c
  5787. }
  5788. // MaxAttendees sets the optional parameter "maxAttendees": The maximum
  5789. // number of attendees to include in the response. If there are more
  5790. // than the specified number of attendees, only the participant is
  5791. // returned.
  5792. func (c *EventsListCall) MaxAttendees(maxAttendees int64) *EventsListCall {
  5793. c.urlParams_.Set("maxAttendees", fmt.Sprint(maxAttendees))
  5794. return c
  5795. }
  5796. // MaxResults sets the optional parameter "maxResults": Maximum number
  5797. // of events returned on one result page. The number of events in the
  5798. // resulting page may be less than this value, or none at all, even if
  5799. // there are more events matching the query. Incomplete pages can be
  5800. // detected by a non-empty nextPageToken field in the response. By
  5801. // default the value is 250 events. The page size can never be larger
  5802. // than 2500 events.
  5803. func (c *EventsListCall) MaxResults(maxResults int64) *EventsListCall {
  5804. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5805. return c
  5806. }
  5807. // OrderBy sets the optional parameter "orderBy": The order of the
  5808. // events returned in the result. The default is an unspecified, stable
  5809. // order.
  5810. //
  5811. // Possible values:
  5812. // "startTime" - Order by the start date/time (ascending). This is
  5813. // only available when querying single events (i.e. the parameter
  5814. // singleEvents is True)
  5815. // "updated" - Order by last modification time (ascending).
  5816. func (c *EventsListCall) OrderBy(orderBy string) *EventsListCall {
  5817. c.urlParams_.Set("orderBy", orderBy)
  5818. return c
  5819. }
  5820. // PageToken sets the optional parameter "pageToken": Token specifying
  5821. // which result page to return.
  5822. func (c *EventsListCall) PageToken(pageToken string) *EventsListCall {
  5823. c.urlParams_.Set("pageToken", pageToken)
  5824. return c
  5825. }
  5826. // PrivateExtendedProperty sets the optional parameter
  5827. // "privateExtendedProperty": Extended properties constraint specified
  5828. // as propertyName=value. Matches only private properties. This
  5829. // parameter might be repeated multiple times to return events that
  5830. // match all given constraints.
  5831. func (c *EventsListCall) PrivateExtendedProperty(privateExtendedProperty ...string) *EventsListCall {
  5832. c.urlParams_.SetMulti("privateExtendedProperty", append([]string{}, privateExtendedProperty...))
  5833. return c
  5834. }
  5835. // Q sets the optional parameter "q": Free text search terms to find
  5836. // events that match these terms in any field, except for extended
  5837. // properties.
  5838. func (c *EventsListCall) Q(q string) *EventsListCall {
  5839. c.urlParams_.Set("q", q)
  5840. return c
  5841. }
  5842. // SharedExtendedProperty sets the optional parameter
  5843. // "sharedExtendedProperty": Extended properties constraint specified as
  5844. // propertyName=value. Matches only shared properties. This parameter
  5845. // might be repeated multiple times to return events that match all
  5846. // given constraints.
  5847. func (c *EventsListCall) SharedExtendedProperty(sharedExtendedProperty ...string) *EventsListCall {
  5848. c.urlParams_.SetMulti("sharedExtendedProperty", append([]string{}, sharedExtendedProperty...))
  5849. return c
  5850. }
  5851. // ShowDeleted sets the optional parameter "showDeleted": Whether to
  5852. // include deleted events (with status equals "cancelled") in the
  5853. // result. Cancelled instances of recurring events (but not the
  5854. // underlying recurring event) will still be included if showDeleted and
  5855. // singleEvents are both False. If showDeleted and singleEvents are both
  5856. // True, only single instances of deleted events (but not the underlying
  5857. // recurring events) are returned. The default is False.
  5858. func (c *EventsListCall) ShowDeleted(showDeleted bool) *EventsListCall {
  5859. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  5860. return c
  5861. }
  5862. // ShowHiddenInvitations sets the optional parameter
  5863. // "showHiddenInvitations": Whether to include hidden invitations in the
  5864. // result. The default is False.
  5865. func (c *EventsListCall) ShowHiddenInvitations(showHiddenInvitations bool) *EventsListCall {
  5866. c.urlParams_.Set("showHiddenInvitations", fmt.Sprint(showHiddenInvitations))
  5867. return c
  5868. }
  5869. // SingleEvents sets the optional parameter "singleEvents": Whether to
  5870. // expand recurring events into instances and only return single one-off
  5871. // events and instances of recurring events, but not the underlying
  5872. // recurring events themselves. The default is False.
  5873. func (c *EventsListCall) SingleEvents(singleEvents bool) *EventsListCall {
  5874. c.urlParams_.Set("singleEvents", fmt.Sprint(singleEvents))
  5875. return c
  5876. }
  5877. // SyncToken sets the optional parameter "syncToken": Token obtained
  5878. // from the nextSyncToken field returned on the last page of results
  5879. // from the previous list request. It makes the result of this list
  5880. // request contain only entries that have changed since then. All events
  5881. // deleted since the previous list request will always be in the result
  5882. // set and it is not allowed to set showDeleted to False.
  5883. // There are several query parameters that cannot be specified together
  5884. // with nextSyncToken to ensure consistency of the client state.
  5885. //
  5886. // These are:
  5887. // - iCalUID
  5888. // - orderBy
  5889. // - privateExtendedProperty
  5890. // - q
  5891. // - sharedExtendedProperty
  5892. // - timeMin
  5893. // - timeMax
  5894. // - updatedMin If the syncToken expires, the server will respond with a
  5895. // 410 GONE response code and the client should clear its storage and
  5896. // perform a full synchronization without any syncToken.
  5897. // Learn more about incremental synchronization.
  5898. // The default is to return all entries.
  5899. func (c *EventsListCall) SyncToken(syncToken string) *EventsListCall {
  5900. c.urlParams_.Set("syncToken", syncToken)
  5901. return c
  5902. }
  5903. // TimeMax sets the optional parameter "timeMax": Upper bound
  5904. // (exclusive) for an event's start time to filter by. The default is
  5905. // not to filter by start time. Must be an RFC3339 timestamp with
  5906. // mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00,
  5907. // 2011-06-03T10:00:00Z. Milliseconds may be provided but will be
  5908. // ignored. If timeMin is set, timeMax must be greater than timeMin.
  5909. func (c *EventsListCall) TimeMax(timeMax string) *EventsListCall {
  5910. c.urlParams_.Set("timeMax", timeMax)
  5911. return c
  5912. }
  5913. // TimeMin sets the optional parameter "timeMin": Lower bound
  5914. // (inclusive) for an event's end time to filter by. The default is not
  5915. // to filter by end time. Must be an RFC3339 timestamp with mandatory
  5916. // time zone offset, e.g., 2011-06-03T10:00:00-07:00,
  5917. // 2011-06-03T10:00:00Z. Milliseconds may be provided but will be
  5918. // ignored. If timeMax is set, timeMin must be smaller than timeMax.
  5919. func (c *EventsListCall) TimeMin(timeMin string) *EventsListCall {
  5920. c.urlParams_.Set("timeMin", timeMin)
  5921. return c
  5922. }
  5923. // TimeZone sets the optional parameter "timeZone": Time zone used in
  5924. // the response. The default is the time zone of the calendar.
  5925. func (c *EventsListCall) TimeZone(timeZone string) *EventsListCall {
  5926. c.urlParams_.Set("timeZone", timeZone)
  5927. return c
  5928. }
  5929. // UpdatedMin sets the optional parameter "updatedMin": Lower bound for
  5930. // an event's last modification time (as a RFC3339 timestamp) to filter
  5931. // by. When specified, entries deleted since this time will always be
  5932. // included regardless of showDeleted. The default is not to filter by
  5933. // last modification time.
  5934. func (c *EventsListCall) UpdatedMin(updatedMin string) *EventsListCall {
  5935. c.urlParams_.Set("updatedMin", updatedMin)
  5936. return c
  5937. }
  5938. // Fields allows partial responses to be retrieved. See
  5939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5940. // for more information.
  5941. func (c *EventsListCall) Fields(s ...googleapi.Field) *EventsListCall {
  5942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5943. return c
  5944. }
  5945. // IfNoneMatch sets the optional parameter which makes the operation
  5946. // fail if the object's ETag matches the given value. This is useful for
  5947. // getting updates only after the object has changed since the last
  5948. // request. Use googleapi.IsNotModified to check whether the response
  5949. // error from Do is the result of In-None-Match.
  5950. func (c *EventsListCall) IfNoneMatch(entityTag string) *EventsListCall {
  5951. c.ifNoneMatch_ = entityTag
  5952. return c
  5953. }
  5954. // Context sets the context to be used in this call's Do method. Any
  5955. // pending HTTP request will be aborted if the provided context is
  5956. // canceled.
  5957. func (c *EventsListCall) Context(ctx context.Context) *EventsListCall {
  5958. c.ctx_ = ctx
  5959. return c
  5960. }
  5961. // Header returns an http.Header that can be modified by the caller to
  5962. // add HTTP headers to the request.
  5963. func (c *EventsListCall) Header() http.Header {
  5964. if c.header_ == nil {
  5965. c.header_ = make(http.Header)
  5966. }
  5967. return c.header_
  5968. }
  5969. func (c *EventsListCall) doRequest(alt string) (*http.Response, error) {
  5970. reqHeaders := make(http.Header)
  5971. for k, v := range c.header_ {
  5972. reqHeaders[k] = v
  5973. }
  5974. reqHeaders.Set("User-Agent", c.s.userAgent())
  5975. if c.ifNoneMatch_ != "" {
  5976. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5977. }
  5978. var body io.Reader = nil
  5979. c.urlParams_.Set("alt", alt)
  5980. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events")
  5981. urls += "?" + c.urlParams_.Encode()
  5982. req, _ := http.NewRequest("GET", urls, body)
  5983. req.Header = reqHeaders
  5984. googleapi.Expand(req.URL, map[string]string{
  5985. "calendarId": c.calendarId,
  5986. })
  5987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5988. }
  5989. // Do executes the "calendar.events.list" call.
  5990. // Exactly one of *Events or error will be non-nil. Any non-2xx status
  5991. // code is an error. Response headers are in either
  5992. // *Events.ServerResponse.Header or (if a response was returned at all)
  5993. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5994. // check whether the returned error was because http.StatusNotModified
  5995. // was returned.
  5996. func (c *EventsListCall) Do(opts ...googleapi.CallOption) (*Events, error) {
  5997. gensupport.SetOptions(c.urlParams_, opts...)
  5998. res, err := c.doRequest("json")
  5999. if res != nil && res.StatusCode == http.StatusNotModified {
  6000. if res.Body != nil {
  6001. res.Body.Close()
  6002. }
  6003. return nil, &googleapi.Error{
  6004. Code: res.StatusCode,
  6005. Header: res.Header,
  6006. }
  6007. }
  6008. if err != nil {
  6009. return nil, err
  6010. }
  6011. defer googleapi.CloseBody(res)
  6012. if err := googleapi.CheckResponse(res); err != nil {
  6013. return nil, err
  6014. }
  6015. ret := &Events{
  6016. ServerResponse: googleapi.ServerResponse{
  6017. Header: res.Header,
  6018. HTTPStatusCode: res.StatusCode,
  6019. },
  6020. }
  6021. target := &ret
  6022. if err := gensupport.DecodeResponse(target, res); err != nil {
  6023. return nil, err
  6024. }
  6025. return ret, nil
  6026. // {
  6027. // "description": "Returns events on the specified calendar.",
  6028. // "httpMethod": "GET",
  6029. // "id": "calendar.events.list",
  6030. // "parameterOrder": [
  6031. // "calendarId"
  6032. // ],
  6033. // "parameters": {
  6034. // "alwaysIncludeEmail": {
  6035. // "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.",
  6036. // "location": "query",
  6037. // "type": "boolean"
  6038. // },
  6039. // "calendarId": {
  6040. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  6041. // "location": "path",
  6042. // "required": true,
  6043. // "type": "string"
  6044. // },
  6045. // "iCalUID": {
  6046. // "description": "Specifies event ID in the iCalendar format to be included in the response. Optional.",
  6047. // "location": "query",
  6048. // "type": "string"
  6049. // },
  6050. // "maxAttendees": {
  6051. // "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.",
  6052. // "format": "int32",
  6053. // "location": "query",
  6054. // "minimum": "1",
  6055. // "type": "integer"
  6056. // },
  6057. // "maxResults": {
  6058. // "default": "250",
  6059. // "description": "Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.",
  6060. // "format": "int32",
  6061. // "location": "query",
  6062. // "minimum": "1",
  6063. // "type": "integer"
  6064. // },
  6065. // "orderBy": {
  6066. // "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.",
  6067. // "enum": [
  6068. // "startTime",
  6069. // "updated"
  6070. // ],
  6071. // "enumDescriptions": [
  6072. // "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)",
  6073. // "Order by last modification time (ascending)."
  6074. // ],
  6075. // "location": "query",
  6076. // "type": "string"
  6077. // },
  6078. // "pageToken": {
  6079. // "description": "Token specifying which result page to return. Optional.",
  6080. // "location": "query",
  6081. // "type": "string"
  6082. // },
  6083. // "privateExtendedProperty": {
  6084. // "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.",
  6085. // "location": "query",
  6086. // "repeated": true,
  6087. // "type": "string"
  6088. // },
  6089. // "q": {
  6090. // "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.",
  6091. // "location": "query",
  6092. // "type": "string"
  6093. // },
  6094. // "sharedExtendedProperty": {
  6095. // "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.",
  6096. // "location": "query",
  6097. // "repeated": true,
  6098. // "type": "string"
  6099. // },
  6100. // "showDeleted": {
  6101. // "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.",
  6102. // "location": "query",
  6103. // "type": "boolean"
  6104. // },
  6105. // "showHiddenInvitations": {
  6106. // "description": "Whether to include hidden invitations in the result. Optional. The default is False.",
  6107. // "location": "query",
  6108. // "type": "boolean"
  6109. // },
  6110. // "singleEvents": {
  6111. // "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.",
  6112. // "location": "query",
  6113. // "type": "boolean"
  6114. // },
  6115. // "syncToken": {
  6116. // "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.",
  6117. // "location": "query",
  6118. // "type": "string"
  6119. // },
  6120. // "timeMax": {
  6121. // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin.",
  6122. // "format": "date-time",
  6123. // "location": "query",
  6124. // "type": "string"
  6125. // },
  6126. // "timeMin": {
  6127. // "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax.",
  6128. // "format": "date-time",
  6129. // "location": "query",
  6130. // "type": "string"
  6131. // },
  6132. // "timeZone": {
  6133. // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
  6134. // "location": "query",
  6135. // "type": "string"
  6136. // },
  6137. // "updatedMin": {
  6138. // "description": "Lower bound for an event's last modification time (as a RFC3339 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.",
  6139. // "format": "date-time",
  6140. // "location": "query",
  6141. // "type": "string"
  6142. // }
  6143. // },
  6144. // "path": "calendars/{calendarId}/events",
  6145. // "response": {
  6146. // "$ref": "Events"
  6147. // },
  6148. // "scopes": [
  6149. // "https://www.googleapis.com/auth/calendar",
  6150. // "https://www.googleapis.com/auth/calendar.readonly"
  6151. // ],
  6152. // "supportsSubscription": true
  6153. // }
  6154. }
  6155. // Pages invokes f for each page of results.
  6156. // A non-nil error returned from f will halt the iteration.
  6157. // The provided context supersedes any context provided to the Context method.
  6158. func (c *EventsListCall) Pages(ctx context.Context, f func(*Events) error) error {
  6159. c.ctx_ = ctx
  6160. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6161. for {
  6162. x, err := c.Do()
  6163. if err != nil {
  6164. return err
  6165. }
  6166. if err := f(x); err != nil {
  6167. return err
  6168. }
  6169. if x.NextPageToken == "" {
  6170. return nil
  6171. }
  6172. c.PageToken(x.NextPageToken)
  6173. }
  6174. }
  6175. // method id "calendar.events.move":
  6176. type EventsMoveCall struct {
  6177. s *Service
  6178. calendarId string
  6179. eventId string
  6180. urlParams_ gensupport.URLParams
  6181. ctx_ context.Context
  6182. header_ http.Header
  6183. }
  6184. // Move: Moves an event to another calendar, i.e. changes an event's
  6185. // organizer.
  6186. func (r *EventsService) Move(calendarId string, eventId string, destinationid string) *EventsMoveCall {
  6187. c := &EventsMoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6188. c.calendarId = calendarId
  6189. c.eventId = eventId
  6190. c.urlParams_.Set("destination", destinationid)
  6191. return c
  6192. }
  6193. // SendNotifications sets the optional parameter "sendNotifications":
  6194. // Whether to send notifications about the change of the event's
  6195. // organizer. The default is False.
  6196. func (c *EventsMoveCall) SendNotifications(sendNotifications bool) *EventsMoveCall {
  6197. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  6198. return c
  6199. }
  6200. // Fields allows partial responses to be retrieved. See
  6201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6202. // for more information.
  6203. func (c *EventsMoveCall) Fields(s ...googleapi.Field) *EventsMoveCall {
  6204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6205. return c
  6206. }
  6207. // Context sets the context to be used in this call's Do method. Any
  6208. // pending HTTP request will be aborted if the provided context is
  6209. // canceled.
  6210. func (c *EventsMoveCall) Context(ctx context.Context) *EventsMoveCall {
  6211. c.ctx_ = ctx
  6212. return c
  6213. }
  6214. // Header returns an http.Header that can be modified by the caller to
  6215. // add HTTP headers to the request.
  6216. func (c *EventsMoveCall) Header() http.Header {
  6217. if c.header_ == nil {
  6218. c.header_ = make(http.Header)
  6219. }
  6220. return c.header_
  6221. }
  6222. func (c *EventsMoveCall) doRequest(alt string) (*http.Response, error) {
  6223. reqHeaders := make(http.Header)
  6224. for k, v := range c.header_ {
  6225. reqHeaders[k] = v
  6226. }
  6227. reqHeaders.Set("User-Agent", c.s.userAgent())
  6228. var body io.Reader = nil
  6229. c.urlParams_.Set("alt", alt)
  6230. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}/move")
  6231. urls += "?" + c.urlParams_.Encode()
  6232. req, _ := http.NewRequest("POST", urls, body)
  6233. req.Header = reqHeaders
  6234. googleapi.Expand(req.URL, map[string]string{
  6235. "calendarId": c.calendarId,
  6236. "eventId": c.eventId,
  6237. })
  6238. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6239. }
  6240. // Do executes the "calendar.events.move" call.
  6241. // Exactly one of *Event or error will be non-nil. Any non-2xx status
  6242. // code is an error. Response headers are in either
  6243. // *Event.ServerResponse.Header or (if a response was returned at all)
  6244. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6245. // check whether the returned error was because http.StatusNotModified
  6246. // was returned.
  6247. func (c *EventsMoveCall) Do(opts ...googleapi.CallOption) (*Event, error) {
  6248. gensupport.SetOptions(c.urlParams_, opts...)
  6249. res, err := c.doRequest("json")
  6250. if res != nil && res.StatusCode == http.StatusNotModified {
  6251. if res.Body != nil {
  6252. res.Body.Close()
  6253. }
  6254. return nil, &googleapi.Error{
  6255. Code: res.StatusCode,
  6256. Header: res.Header,
  6257. }
  6258. }
  6259. if err != nil {
  6260. return nil, err
  6261. }
  6262. defer googleapi.CloseBody(res)
  6263. if err := googleapi.CheckResponse(res); err != nil {
  6264. return nil, err
  6265. }
  6266. ret := &Event{
  6267. ServerResponse: googleapi.ServerResponse{
  6268. Header: res.Header,
  6269. HTTPStatusCode: res.StatusCode,
  6270. },
  6271. }
  6272. target := &ret
  6273. if err := gensupport.DecodeResponse(target, res); err != nil {
  6274. return nil, err
  6275. }
  6276. return ret, nil
  6277. // {
  6278. // "description": "Moves an event to another calendar, i.e. changes an event's organizer.",
  6279. // "httpMethod": "POST",
  6280. // "id": "calendar.events.move",
  6281. // "parameterOrder": [
  6282. // "calendarId",
  6283. // "eventId",
  6284. // "destination"
  6285. // ],
  6286. // "parameters": {
  6287. // "calendarId": {
  6288. // "description": "Calendar identifier of the source calendar where the event currently is on.",
  6289. // "location": "path",
  6290. // "required": true,
  6291. // "type": "string"
  6292. // },
  6293. // "destination": {
  6294. // "description": "Calendar identifier of the target calendar where the event is to be moved to.",
  6295. // "location": "query",
  6296. // "required": true,
  6297. // "type": "string"
  6298. // },
  6299. // "eventId": {
  6300. // "description": "Event identifier.",
  6301. // "location": "path",
  6302. // "required": true,
  6303. // "type": "string"
  6304. // },
  6305. // "sendNotifications": {
  6306. // "description": "Whether to send notifications about the change of the event's organizer. Optional. The default is False.",
  6307. // "location": "query",
  6308. // "type": "boolean"
  6309. // }
  6310. // },
  6311. // "path": "calendars/{calendarId}/events/{eventId}/move",
  6312. // "response": {
  6313. // "$ref": "Event"
  6314. // },
  6315. // "scopes": [
  6316. // "https://www.googleapis.com/auth/calendar"
  6317. // ]
  6318. // }
  6319. }
  6320. // method id "calendar.events.patch":
  6321. type EventsPatchCall struct {
  6322. s *Service
  6323. calendarId string
  6324. eventId string
  6325. event *Event
  6326. urlParams_ gensupport.URLParams
  6327. ctx_ context.Context
  6328. header_ http.Header
  6329. }
  6330. // Patch: Updates an event. This method supports patch semantics.
  6331. func (r *EventsService) Patch(calendarId string, eventId string, event *Event) *EventsPatchCall {
  6332. c := &EventsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6333. c.calendarId = calendarId
  6334. c.eventId = eventId
  6335. c.event = event
  6336. return c
  6337. }
  6338. // AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
  6339. // Whether to always include a value in the email field for the
  6340. // organizer, creator and attendees, even if no real email is available
  6341. // (i.e. a generated, non-working value will be provided). The use of
  6342. // this option is discouraged and should only be used by clients which
  6343. // cannot handle the absence of an email address value in the mentioned
  6344. // places. The default is False.
  6345. func (c *EventsPatchCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsPatchCall {
  6346. c.urlParams_.Set("alwaysIncludeEmail", fmt.Sprint(alwaysIncludeEmail))
  6347. return c
  6348. }
  6349. // ConferenceDataVersion sets the optional parameter
  6350. // "conferenceDataVersion": Version number of conference data supported
  6351. // by the API client. Version 0 assumes no conference data support and
  6352. // ignores conference data in the event's body. Version 1 enables
  6353. // support for copying of ConferenceData as well as for creating new
  6354. // conferences using the createRequest field of conferenceData. The
  6355. // default is 0.
  6356. func (c *EventsPatchCall) ConferenceDataVersion(conferenceDataVersion int64) *EventsPatchCall {
  6357. c.urlParams_.Set("conferenceDataVersion", fmt.Sprint(conferenceDataVersion))
  6358. return c
  6359. }
  6360. // MaxAttendees sets the optional parameter "maxAttendees": The maximum
  6361. // number of attendees to include in the response. If there are more
  6362. // than the specified number of attendees, only the participant is
  6363. // returned.
  6364. func (c *EventsPatchCall) MaxAttendees(maxAttendees int64) *EventsPatchCall {
  6365. c.urlParams_.Set("maxAttendees", fmt.Sprint(maxAttendees))
  6366. return c
  6367. }
  6368. // SendNotifications sets the optional parameter "sendNotifications":
  6369. // Whether to send notifications about the event update (e.g. attendee's
  6370. // responses, title changes, etc.). The default is False.
  6371. func (c *EventsPatchCall) SendNotifications(sendNotifications bool) *EventsPatchCall {
  6372. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  6373. return c
  6374. }
  6375. // SupportsAttachments sets the optional parameter
  6376. // "supportsAttachments": Whether API client performing operation
  6377. // supports event attachments. The default is False.
  6378. func (c *EventsPatchCall) SupportsAttachments(supportsAttachments bool) *EventsPatchCall {
  6379. c.urlParams_.Set("supportsAttachments", fmt.Sprint(supportsAttachments))
  6380. return c
  6381. }
  6382. // Fields allows partial responses to be retrieved. See
  6383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6384. // for more information.
  6385. func (c *EventsPatchCall) Fields(s ...googleapi.Field) *EventsPatchCall {
  6386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6387. return c
  6388. }
  6389. // Context sets the context to be used in this call's Do method. Any
  6390. // pending HTTP request will be aborted if the provided context is
  6391. // canceled.
  6392. func (c *EventsPatchCall) Context(ctx context.Context) *EventsPatchCall {
  6393. c.ctx_ = ctx
  6394. return c
  6395. }
  6396. // Header returns an http.Header that can be modified by the caller to
  6397. // add HTTP headers to the request.
  6398. func (c *EventsPatchCall) Header() http.Header {
  6399. if c.header_ == nil {
  6400. c.header_ = make(http.Header)
  6401. }
  6402. return c.header_
  6403. }
  6404. func (c *EventsPatchCall) doRequest(alt string) (*http.Response, error) {
  6405. reqHeaders := make(http.Header)
  6406. for k, v := range c.header_ {
  6407. reqHeaders[k] = v
  6408. }
  6409. reqHeaders.Set("User-Agent", c.s.userAgent())
  6410. var body io.Reader = nil
  6411. body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
  6412. if err != nil {
  6413. return nil, err
  6414. }
  6415. reqHeaders.Set("Content-Type", "application/json")
  6416. c.urlParams_.Set("alt", alt)
  6417. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
  6418. urls += "?" + c.urlParams_.Encode()
  6419. req, _ := http.NewRequest("PATCH", urls, body)
  6420. req.Header = reqHeaders
  6421. googleapi.Expand(req.URL, map[string]string{
  6422. "calendarId": c.calendarId,
  6423. "eventId": c.eventId,
  6424. })
  6425. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6426. }
  6427. // Do executes the "calendar.events.patch" call.
  6428. // Exactly one of *Event or error will be non-nil. Any non-2xx status
  6429. // code is an error. Response headers are in either
  6430. // *Event.ServerResponse.Header or (if a response was returned at all)
  6431. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6432. // check whether the returned error was because http.StatusNotModified
  6433. // was returned.
  6434. func (c *EventsPatchCall) Do(opts ...googleapi.CallOption) (*Event, error) {
  6435. gensupport.SetOptions(c.urlParams_, opts...)
  6436. res, err := c.doRequest("json")
  6437. if res != nil && res.StatusCode == http.StatusNotModified {
  6438. if res.Body != nil {
  6439. res.Body.Close()
  6440. }
  6441. return nil, &googleapi.Error{
  6442. Code: res.StatusCode,
  6443. Header: res.Header,
  6444. }
  6445. }
  6446. if err != nil {
  6447. return nil, err
  6448. }
  6449. defer googleapi.CloseBody(res)
  6450. if err := googleapi.CheckResponse(res); err != nil {
  6451. return nil, err
  6452. }
  6453. ret := &Event{
  6454. ServerResponse: googleapi.ServerResponse{
  6455. Header: res.Header,
  6456. HTTPStatusCode: res.StatusCode,
  6457. },
  6458. }
  6459. target := &ret
  6460. if err := gensupport.DecodeResponse(target, res); err != nil {
  6461. return nil, err
  6462. }
  6463. return ret, nil
  6464. // {
  6465. // "description": "Updates an event. This method supports patch semantics.",
  6466. // "httpMethod": "PATCH",
  6467. // "id": "calendar.events.patch",
  6468. // "parameterOrder": [
  6469. // "calendarId",
  6470. // "eventId"
  6471. // ],
  6472. // "parameters": {
  6473. // "alwaysIncludeEmail": {
  6474. // "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.",
  6475. // "location": "query",
  6476. // "type": "boolean"
  6477. // },
  6478. // "calendarId": {
  6479. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  6480. // "location": "path",
  6481. // "required": true,
  6482. // "type": "string"
  6483. // },
  6484. // "conferenceDataVersion": {
  6485. // "description": "Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0.",
  6486. // "format": "int32",
  6487. // "location": "query",
  6488. // "maximum": "1",
  6489. // "minimum": "0",
  6490. // "type": "integer"
  6491. // },
  6492. // "eventId": {
  6493. // "description": "Event identifier.",
  6494. // "location": "path",
  6495. // "required": true,
  6496. // "type": "string"
  6497. // },
  6498. // "maxAttendees": {
  6499. // "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.",
  6500. // "format": "int32",
  6501. // "location": "query",
  6502. // "minimum": "1",
  6503. // "type": "integer"
  6504. // },
  6505. // "sendNotifications": {
  6506. // "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.",
  6507. // "location": "query",
  6508. // "type": "boolean"
  6509. // },
  6510. // "supportsAttachments": {
  6511. // "description": "Whether API client performing operation supports event attachments. Optional. The default is False.",
  6512. // "location": "query",
  6513. // "type": "boolean"
  6514. // }
  6515. // },
  6516. // "path": "calendars/{calendarId}/events/{eventId}",
  6517. // "request": {
  6518. // "$ref": "Event"
  6519. // },
  6520. // "response": {
  6521. // "$ref": "Event"
  6522. // },
  6523. // "scopes": [
  6524. // "https://www.googleapis.com/auth/calendar"
  6525. // ]
  6526. // }
  6527. }
  6528. // method id "calendar.events.quickAdd":
  6529. type EventsQuickAddCall struct {
  6530. s *Service
  6531. calendarId string
  6532. urlParams_ gensupport.URLParams
  6533. ctx_ context.Context
  6534. header_ http.Header
  6535. }
  6536. // QuickAdd: Creates an event based on a simple text string.
  6537. func (r *EventsService) QuickAdd(calendarId string, text string) *EventsQuickAddCall {
  6538. c := &EventsQuickAddCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6539. c.calendarId = calendarId
  6540. c.urlParams_.Set("text", text)
  6541. return c
  6542. }
  6543. // SendNotifications sets the optional parameter "sendNotifications":
  6544. // Whether to send notifications about the creation of the event. The
  6545. // default is False.
  6546. func (c *EventsQuickAddCall) SendNotifications(sendNotifications bool) *EventsQuickAddCall {
  6547. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  6548. return c
  6549. }
  6550. // Fields allows partial responses to be retrieved. See
  6551. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6552. // for more information.
  6553. func (c *EventsQuickAddCall) Fields(s ...googleapi.Field) *EventsQuickAddCall {
  6554. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6555. return c
  6556. }
  6557. // Context sets the context to be used in this call's Do method. Any
  6558. // pending HTTP request will be aborted if the provided context is
  6559. // canceled.
  6560. func (c *EventsQuickAddCall) Context(ctx context.Context) *EventsQuickAddCall {
  6561. c.ctx_ = ctx
  6562. return c
  6563. }
  6564. // Header returns an http.Header that can be modified by the caller to
  6565. // add HTTP headers to the request.
  6566. func (c *EventsQuickAddCall) Header() http.Header {
  6567. if c.header_ == nil {
  6568. c.header_ = make(http.Header)
  6569. }
  6570. return c.header_
  6571. }
  6572. func (c *EventsQuickAddCall) doRequest(alt string) (*http.Response, error) {
  6573. reqHeaders := make(http.Header)
  6574. for k, v := range c.header_ {
  6575. reqHeaders[k] = v
  6576. }
  6577. reqHeaders.Set("User-Agent", c.s.userAgent())
  6578. var body io.Reader = nil
  6579. c.urlParams_.Set("alt", alt)
  6580. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/quickAdd")
  6581. urls += "?" + c.urlParams_.Encode()
  6582. req, _ := http.NewRequest("POST", urls, body)
  6583. req.Header = reqHeaders
  6584. googleapi.Expand(req.URL, map[string]string{
  6585. "calendarId": c.calendarId,
  6586. })
  6587. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6588. }
  6589. // Do executes the "calendar.events.quickAdd" call.
  6590. // Exactly one of *Event or error will be non-nil. Any non-2xx status
  6591. // code is an error. Response headers are in either
  6592. // *Event.ServerResponse.Header or (if a response was returned at all)
  6593. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6594. // check whether the returned error was because http.StatusNotModified
  6595. // was returned.
  6596. func (c *EventsQuickAddCall) Do(opts ...googleapi.CallOption) (*Event, error) {
  6597. gensupport.SetOptions(c.urlParams_, opts...)
  6598. res, err := c.doRequest("json")
  6599. if res != nil && res.StatusCode == http.StatusNotModified {
  6600. if res.Body != nil {
  6601. res.Body.Close()
  6602. }
  6603. return nil, &googleapi.Error{
  6604. Code: res.StatusCode,
  6605. Header: res.Header,
  6606. }
  6607. }
  6608. if err != nil {
  6609. return nil, err
  6610. }
  6611. defer googleapi.CloseBody(res)
  6612. if err := googleapi.CheckResponse(res); err != nil {
  6613. return nil, err
  6614. }
  6615. ret := &Event{
  6616. ServerResponse: googleapi.ServerResponse{
  6617. Header: res.Header,
  6618. HTTPStatusCode: res.StatusCode,
  6619. },
  6620. }
  6621. target := &ret
  6622. if err := gensupport.DecodeResponse(target, res); err != nil {
  6623. return nil, err
  6624. }
  6625. return ret, nil
  6626. // {
  6627. // "description": "Creates an event based on a simple text string.",
  6628. // "httpMethod": "POST",
  6629. // "id": "calendar.events.quickAdd",
  6630. // "parameterOrder": [
  6631. // "calendarId",
  6632. // "text"
  6633. // ],
  6634. // "parameters": {
  6635. // "calendarId": {
  6636. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  6637. // "location": "path",
  6638. // "required": true,
  6639. // "type": "string"
  6640. // },
  6641. // "sendNotifications": {
  6642. // "description": "Whether to send notifications about the creation of the event. Optional. The default is False.",
  6643. // "location": "query",
  6644. // "type": "boolean"
  6645. // },
  6646. // "text": {
  6647. // "description": "The text describing the event to be created.",
  6648. // "location": "query",
  6649. // "required": true,
  6650. // "type": "string"
  6651. // }
  6652. // },
  6653. // "path": "calendars/{calendarId}/events/quickAdd",
  6654. // "response": {
  6655. // "$ref": "Event"
  6656. // },
  6657. // "scopes": [
  6658. // "https://www.googleapis.com/auth/calendar"
  6659. // ]
  6660. // }
  6661. }
  6662. // method id "calendar.events.update":
  6663. type EventsUpdateCall struct {
  6664. s *Service
  6665. calendarId string
  6666. eventId string
  6667. event *Event
  6668. urlParams_ gensupport.URLParams
  6669. ctx_ context.Context
  6670. header_ http.Header
  6671. }
  6672. // Update: Updates an event.
  6673. func (r *EventsService) Update(calendarId string, eventId string, event *Event) *EventsUpdateCall {
  6674. c := &EventsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6675. c.calendarId = calendarId
  6676. c.eventId = eventId
  6677. c.event = event
  6678. return c
  6679. }
  6680. // AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
  6681. // Whether to always include a value in the email field for the
  6682. // organizer, creator and attendees, even if no real email is available
  6683. // (i.e. a generated, non-working value will be provided). The use of
  6684. // this option is discouraged and should only be used by clients which
  6685. // cannot handle the absence of an email address value in the mentioned
  6686. // places. The default is False.
  6687. func (c *EventsUpdateCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsUpdateCall {
  6688. c.urlParams_.Set("alwaysIncludeEmail", fmt.Sprint(alwaysIncludeEmail))
  6689. return c
  6690. }
  6691. // ConferenceDataVersion sets the optional parameter
  6692. // "conferenceDataVersion": Version number of conference data supported
  6693. // by the API client. Version 0 assumes no conference data support and
  6694. // ignores conference data in the event's body. Version 1 enables
  6695. // support for copying of ConferenceData as well as for creating new
  6696. // conferences using the createRequest field of conferenceData. The
  6697. // default is 0.
  6698. func (c *EventsUpdateCall) ConferenceDataVersion(conferenceDataVersion int64) *EventsUpdateCall {
  6699. c.urlParams_.Set("conferenceDataVersion", fmt.Sprint(conferenceDataVersion))
  6700. return c
  6701. }
  6702. // MaxAttendees sets the optional parameter "maxAttendees": The maximum
  6703. // number of attendees to include in the response. If there are more
  6704. // than the specified number of attendees, only the participant is
  6705. // returned.
  6706. func (c *EventsUpdateCall) MaxAttendees(maxAttendees int64) *EventsUpdateCall {
  6707. c.urlParams_.Set("maxAttendees", fmt.Sprint(maxAttendees))
  6708. return c
  6709. }
  6710. // SendNotifications sets the optional parameter "sendNotifications":
  6711. // Whether to send notifications about the event update (e.g. attendee's
  6712. // responses, title changes, etc.). The default is False.
  6713. func (c *EventsUpdateCall) SendNotifications(sendNotifications bool) *EventsUpdateCall {
  6714. c.urlParams_.Set("sendNotifications", fmt.Sprint(sendNotifications))
  6715. return c
  6716. }
  6717. // SupportsAttachments sets the optional parameter
  6718. // "supportsAttachments": Whether API client performing operation
  6719. // supports event attachments. The default is False.
  6720. func (c *EventsUpdateCall) SupportsAttachments(supportsAttachments bool) *EventsUpdateCall {
  6721. c.urlParams_.Set("supportsAttachments", fmt.Sprint(supportsAttachments))
  6722. return c
  6723. }
  6724. // Fields allows partial responses to be retrieved. See
  6725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6726. // for more information.
  6727. func (c *EventsUpdateCall) Fields(s ...googleapi.Field) *EventsUpdateCall {
  6728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6729. return c
  6730. }
  6731. // Context sets the context to be used in this call's Do method. Any
  6732. // pending HTTP request will be aborted if the provided context is
  6733. // canceled.
  6734. func (c *EventsUpdateCall) Context(ctx context.Context) *EventsUpdateCall {
  6735. c.ctx_ = ctx
  6736. return c
  6737. }
  6738. // Header returns an http.Header that can be modified by the caller to
  6739. // add HTTP headers to the request.
  6740. func (c *EventsUpdateCall) Header() http.Header {
  6741. if c.header_ == nil {
  6742. c.header_ = make(http.Header)
  6743. }
  6744. return c.header_
  6745. }
  6746. func (c *EventsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6747. reqHeaders := make(http.Header)
  6748. for k, v := range c.header_ {
  6749. reqHeaders[k] = v
  6750. }
  6751. reqHeaders.Set("User-Agent", c.s.userAgent())
  6752. var body io.Reader = nil
  6753. body, err := googleapi.WithoutDataWrapper.JSONReader(c.event)
  6754. if err != nil {
  6755. return nil, err
  6756. }
  6757. reqHeaders.Set("Content-Type", "application/json")
  6758. c.urlParams_.Set("alt", alt)
  6759. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/{eventId}")
  6760. urls += "?" + c.urlParams_.Encode()
  6761. req, _ := http.NewRequest("PUT", urls, body)
  6762. req.Header = reqHeaders
  6763. googleapi.Expand(req.URL, map[string]string{
  6764. "calendarId": c.calendarId,
  6765. "eventId": c.eventId,
  6766. })
  6767. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6768. }
  6769. // Do executes the "calendar.events.update" call.
  6770. // Exactly one of *Event or error will be non-nil. Any non-2xx status
  6771. // code is an error. Response headers are in either
  6772. // *Event.ServerResponse.Header or (if a response was returned at all)
  6773. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6774. // check whether the returned error was because http.StatusNotModified
  6775. // was returned.
  6776. func (c *EventsUpdateCall) Do(opts ...googleapi.CallOption) (*Event, error) {
  6777. gensupport.SetOptions(c.urlParams_, opts...)
  6778. res, err := c.doRequest("json")
  6779. if res != nil && res.StatusCode == http.StatusNotModified {
  6780. if res.Body != nil {
  6781. res.Body.Close()
  6782. }
  6783. return nil, &googleapi.Error{
  6784. Code: res.StatusCode,
  6785. Header: res.Header,
  6786. }
  6787. }
  6788. if err != nil {
  6789. return nil, err
  6790. }
  6791. defer googleapi.CloseBody(res)
  6792. if err := googleapi.CheckResponse(res); err != nil {
  6793. return nil, err
  6794. }
  6795. ret := &Event{
  6796. ServerResponse: googleapi.ServerResponse{
  6797. Header: res.Header,
  6798. HTTPStatusCode: res.StatusCode,
  6799. },
  6800. }
  6801. target := &ret
  6802. if err := gensupport.DecodeResponse(target, res); err != nil {
  6803. return nil, err
  6804. }
  6805. return ret, nil
  6806. // {
  6807. // "description": "Updates an event.",
  6808. // "httpMethod": "PUT",
  6809. // "id": "calendar.events.update",
  6810. // "parameterOrder": [
  6811. // "calendarId",
  6812. // "eventId"
  6813. // ],
  6814. // "parameters": {
  6815. // "alwaysIncludeEmail": {
  6816. // "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.",
  6817. // "location": "query",
  6818. // "type": "boolean"
  6819. // },
  6820. // "calendarId": {
  6821. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  6822. // "location": "path",
  6823. // "required": true,
  6824. // "type": "string"
  6825. // },
  6826. // "conferenceDataVersion": {
  6827. // "description": "Version number of conference data supported by the API client. Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData as well as for creating new conferences using the createRequest field of conferenceData. The default is 0.",
  6828. // "format": "int32",
  6829. // "location": "query",
  6830. // "maximum": "1",
  6831. // "minimum": "0",
  6832. // "type": "integer"
  6833. // },
  6834. // "eventId": {
  6835. // "description": "Event identifier.",
  6836. // "location": "path",
  6837. // "required": true,
  6838. // "type": "string"
  6839. // },
  6840. // "maxAttendees": {
  6841. // "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.",
  6842. // "format": "int32",
  6843. // "location": "query",
  6844. // "minimum": "1",
  6845. // "type": "integer"
  6846. // },
  6847. // "sendNotifications": {
  6848. // "description": "Whether to send notifications about the event update (e.g. attendee's responses, title changes, etc.). Optional. The default is False.",
  6849. // "location": "query",
  6850. // "type": "boolean"
  6851. // },
  6852. // "supportsAttachments": {
  6853. // "description": "Whether API client performing operation supports event attachments. Optional. The default is False.",
  6854. // "location": "query",
  6855. // "type": "boolean"
  6856. // }
  6857. // },
  6858. // "path": "calendars/{calendarId}/events/{eventId}",
  6859. // "request": {
  6860. // "$ref": "Event"
  6861. // },
  6862. // "response": {
  6863. // "$ref": "Event"
  6864. // },
  6865. // "scopes": [
  6866. // "https://www.googleapis.com/auth/calendar"
  6867. // ]
  6868. // }
  6869. }
  6870. // method id "calendar.events.watch":
  6871. type EventsWatchCall struct {
  6872. s *Service
  6873. calendarId string
  6874. channel *Channel
  6875. urlParams_ gensupport.URLParams
  6876. ctx_ context.Context
  6877. header_ http.Header
  6878. }
  6879. // Watch: Watch for changes to Events resources.
  6880. func (r *EventsService) Watch(calendarId string, channel *Channel) *EventsWatchCall {
  6881. c := &EventsWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6882. c.calendarId = calendarId
  6883. c.channel = channel
  6884. return c
  6885. }
  6886. // AlwaysIncludeEmail sets the optional parameter "alwaysIncludeEmail":
  6887. // Whether to always include a value in the email field for the
  6888. // organizer, creator and attendees, even if no real email is available
  6889. // (i.e. a generated, non-working value will be provided). The use of
  6890. // this option is discouraged and should only be used by clients which
  6891. // cannot handle the absence of an email address value in the mentioned
  6892. // places. The default is False.
  6893. func (c *EventsWatchCall) AlwaysIncludeEmail(alwaysIncludeEmail bool) *EventsWatchCall {
  6894. c.urlParams_.Set("alwaysIncludeEmail", fmt.Sprint(alwaysIncludeEmail))
  6895. return c
  6896. }
  6897. // ICalUID sets the optional parameter "iCalUID": Specifies event ID in
  6898. // the iCalendar format to be included in the response.
  6899. func (c *EventsWatchCall) ICalUID(iCalUID string) *EventsWatchCall {
  6900. c.urlParams_.Set("iCalUID", iCalUID)
  6901. return c
  6902. }
  6903. // MaxAttendees sets the optional parameter "maxAttendees": The maximum
  6904. // number of attendees to include in the response. If there are more
  6905. // than the specified number of attendees, only the participant is
  6906. // returned.
  6907. func (c *EventsWatchCall) MaxAttendees(maxAttendees int64) *EventsWatchCall {
  6908. c.urlParams_.Set("maxAttendees", fmt.Sprint(maxAttendees))
  6909. return c
  6910. }
  6911. // MaxResults sets the optional parameter "maxResults": Maximum number
  6912. // of events returned on one result page. The number of events in the
  6913. // resulting page may be less than this value, or none at all, even if
  6914. // there are more events matching the query. Incomplete pages can be
  6915. // detected by a non-empty nextPageToken field in the response. By
  6916. // default the value is 250 events. The page size can never be larger
  6917. // than 2500 events.
  6918. func (c *EventsWatchCall) MaxResults(maxResults int64) *EventsWatchCall {
  6919. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6920. return c
  6921. }
  6922. // OrderBy sets the optional parameter "orderBy": The order of the
  6923. // events returned in the result. The default is an unspecified, stable
  6924. // order.
  6925. //
  6926. // Possible values:
  6927. // "startTime" - Order by the start date/time (ascending). This is
  6928. // only available when querying single events (i.e. the parameter
  6929. // singleEvents is True)
  6930. // "updated" - Order by last modification time (ascending).
  6931. func (c *EventsWatchCall) OrderBy(orderBy string) *EventsWatchCall {
  6932. c.urlParams_.Set("orderBy", orderBy)
  6933. return c
  6934. }
  6935. // PageToken sets the optional parameter "pageToken": Token specifying
  6936. // which result page to return.
  6937. func (c *EventsWatchCall) PageToken(pageToken string) *EventsWatchCall {
  6938. c.urlParams_.Set("pageToken", pageToken)
  6939. return c
  6940. }
  6941. // PrivateExtendedProperty sets the optional parameter
  6942. // "privateExtendedProperty": Extended properties constraint specified
  6943. // as propertyName=value. Matches only private properties. This
  6944. // parameter might be repeated multiple times to return events that
  6945. // match all given constraints.
  6946. func (c *EventsWatchCall) PrivateExtendedProperty(privateExtendedProperty ...string) *EventsWatchCall {
  6947. c.urlParams_.SetMulti("privateExtendedProperty", append([]string{}, privateExtendedProperty...))
  6948. return c
  6949. }
  6950. // Q sets the optional parameter "q": Free text search terms to find
  6951. // events that match these terms in any field, except for extended
  6952. // properties.
  6953. func (c *EventsWatchCall) Q(q string) *EventsWatchCall {
  6954. c.urlParams_.Set("q", q)
  6955. return c
  6956. }
  6957. // SharedExtendedProperty sets the optional parameter
  6958. // "sharedExtendedProperty": Extended properties constraint specified as
  6959. // propertyName=value. Matches only shared properties. This parameter
  6960. // might be repeated multiple times to return events that match all
  6961. // given constraints.
  6962. func (c *EventsWatchCall) SharedExtendedProperty(sharedExtendedProperty ...string) *EventsWatchCall {
  6963. c.urlParams_.SetMulti("sharedExtendedProperty", append([]string{}, sharedExtendedProperty...))
  6964. return c
  6965. }
  6966. // ShowDeleted sets the optional parameter "showDeleted": Whether to
  6967. // include deleted events (with status equals "cancelled") in the
  6968. // result. Cancelled instances of recurring events (but not the
  6969. // underlying recurring event) will still be included if showDeleted and
  6970. // singleEvents are both False. If showDeleted and singleEvents are both
  6971. // True, only single instances of deleted events (but not the underlying
  6972. // recurring events) are returned. The default is False.
  6973. func (c *EventsWatchCall) ShowDeleted(showDeleted bool) *EventsWatchCall {
  6974. c.urlParams_.Set("showDeleted", fmt.Sprint(showDeleted))
  6975. return c
  6976. }
  6977. // ShowHiddenInvitations sets the optional parameter
  6978. // "showHiddenInvitations": Whether to include hidden invitations in the
  6979. // result. The default is False.
  6980. func (c *EventsWatchCall) ShowHiddenInvitations(showHiddenInvitations bool) *EventsWatchCall {
  6981. c.urlParams_.Set("showHiddenInvitations", fmt.Sprint(showHiddenInvitations))
  6982. return c
  6983. }
  6984. // SingleEvents sets the optional parameter "singleEvents": Whether to
  6985. // expand recurring events into instances and only return single one-off
  6986. // events and instances of recurring events, but not the underlying
  6987. // recurring events themselves. The default is False.
  6988. func (c *EventsWatchCall) SingleEvents(singleEvents bool) *EventsWatchCall {
  6989. c.urlParams_.Set("singleEvents", fmt.Sprint(singleEvents))
  6990. return c
  6991. }
  6992. // SyncToken sets the optional parameter "syncToken": Token obtained
  6993. // from the nextSyncToken field returned on the last page of results
  6994. // from the previous list request. It makes the result of this list
  6995. // request contain only entries that have changed since then. All events
  6996. // deleted since the previous list request will always be in the result
  6997. // set and it is not allowed to set showDeleted to False.
  6998. // There are several query parameters that cannot be specified together
  6999. // with nextSyncToken to ensure consistency of the client state.
  7000. //
  7001. // These are:
  7002. // - iCalUID
  7003. // - orderBy
  7004. // - privateExtendedProperty
  7005. // - q
  7006. // - sharedExtendedProperty
  7007. // - timeMin
  7008. // - timeMax
  7009. // - updatedMin If the syncToken expires, the server will respond with a
  7010. // 410 GONE response code and the client should clear its storage and
  7011. // perform a full synchronization without any syncToken.
  7012. // Learn more about incremental synchronization.
  7013. // The default is to return all entries.
  7014. func (c *EventsWatchCall) SyncToken(syncToken string) *EventsWatchCall {
  7015. c.urlParams_.Set("syncToken", syncToken)
  7016. return c
  7017. }
  7018. // TimeMax sets the optional parameter "timeMax": Upper bound
  7019. // (exclusive) for an event's start time to filter by. The default is
  7020. // not to filter by start time. Must be an RFC3339 timestamp with
  7021. // mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00,
  7022. // 2011-06-03T10:00:00Z. Milliseconds may be provided but will be
  7023. // ignored. If timeMin is set, timeMax must be greater than timeMin.
  7024. func (c *EventsWatchCall) TimeMax(timeMax string) *EventsWatchCall {
  7025. c.urlParams_.Set("timeMax", timeMax)
  7026. return c
  7027. }
  7028. // TimeMin sets the optional parameter "timeMin": Lower bound
  7029. // (inclusive) for an event's end time to filter by. The default is not
  7030. // to filter by end time. Must be an RFC3339 timestamp with mandatory
  7031. // time zone offset, e.g., 2011-06-03T10:00:00-07:00,
  7032. // 2011-06-03T10:00:00Z. Milliseconds may be provided but will be
  7033. // ignored. If timeMax is set, timeMin must be smaller than timeMax.
  7034. func (c *EventsWatchCall) TimeMin(timeMin string) *EventsWatchCall {
  7035. c.urlParams_.Set("timeMin", timeMin)
  7036. return c
  7037. }
  7038. // TimeZone sets the optional parameter "timeZone": Time zone used in
  7039. // the response. The default is the time zone of the calendar.
  7040. func (c *EventsWatchCall) TimeZone(timeZone string) *EventsWatchCall {
  7041. c.urlParams_.Set("timeZone", timeZone)
  7042. return c
  7043. }
  7044. // UpdatedMin sets the optional parameter "updatedMin": Lower bound for
  7045. // an event's last modification time (as a RFC3339 timestamp) to filter
  7046. // by. When specified, entries deleted since this time will always be
  7047. // included regardless of showDeleted. The default is not to filter by
  7048. // last modification time.
  7049. func (c *EventsWatchCall) UpdatedMin(updatedMin string) *EventsWatchCall {
  7050. c.urlParams_.Set("updatedMin", updatedMin)
  7051. return c
  7052. }
  7053. // Fields allows partial responses to be retrieved. See
  7054. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7055. // for more information.
  7056. func (c *EventsWatchCall) Fields(s ...googleapi.Field) *EventsWatchCall {
  7057. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7058. return c
  7059. }
  7060. // Context sets the context to be used in this call's Do method. Any
  7061. // pending HTTP request will be aborted if the provided context is
  7062. // canceled.
  7063. func (c *EventsWatchCall) Context(ctx context.Context) *EventsWatchCall {
  7064. c.ctx_ = ctx
  7065. return c
  7066. }
  7067. // Header returns an http.Header that can be modified by the caller to
  7068. // add HTTP headers to the request.
  7069. func (c *EventsWatchCall) Header() http.Header {
  7070. if c.header_ == nil {
  7071. c.header_ = make(http.Header)
  7072. }
  7073. return c.header_
  7074. }
  7075. func (c *EventsWatchCall) doRequest(alt string) (*http.Response, error) {
  7076. reqHeaders := make(http.Header)
  7077. for k, v := range c.header_ {
  7078. reqHeaders[k] = v
  7079. }
  7080. reqHeaders.Set("User-Agent", c.s.userAgent())
  7081. var body io.Reader = nil
  7082. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  7083. if err != nil {
  7084. return nil, err
  7085. }
  7086. reqHeaders.Set("Content-Type", "application/json")
  7087. c.urlParams_.Set("alt", alt)
  7088. urls := googleapi.ResolveRelative(c.s.BasePath, "calendars/{calendarId}/events/watch")
  7089. urls += "?" + c.urlParams_.Encode()
  7090. req, _ := http.NewRequest("POST", urls, body)
  7091. req.Header = reqHeaders
  7092. googleapi.Expand(req.URL, map[string]string{
  7093. "calendarId": c.calendarId,
  7094. })
  7095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7096. }
  7097. // Do executes the "calendar.events.watch" call.
  7098. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  7099. // code is an error. Response headers are in either
  7100. // *Channel.ServerResponse.Header or (if a response was returned at all)
  7101. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7102. // check whether the returned error was because http.StatusNotModified
  7103. // was returned.
  7104. func (c *EventsWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  7105. gensupport.SetOptions(c.urlParams_, opts...)
  7106. res, err := c.doRequest("json")
  7107. if res != nil && res.StatusCode == http.StatusNotModified {
  7108. if res.Body != nil {
  7109. res.Body.Close()
  7110. }
  7111. return nil, &googleapi.Error{
  7112. Code: res.StatusCode,
  7113. Header: res.Header,
  7114. }
  7115. }
  7116. if err != nil {
  7117. return nil, err
  7118. }
  7119. defer googleapi.CloseBody(res)
  7120. if err := googleapi.CheckResponse(res); err != nil {
  7121. return nil, err
  7122. }
  7123. ret := &Channel{
  7124. ServerResponse: googleapi.ServerResponse{
  7125. Header: res.Header,
  7126. HTTPStatusCode: res.StatusCode,
  7127. },
  7128. }
  7129. target := &ret
  7130. if err := gensupport.DecodeResponse(target, res); err != nil {
  7131. return nil, err
  7132. }
  7133. return ret, nil
  7134. // {
  7135. // "description": "Watch for changes to Events resources.",
  7136. // "httpMethod": "POST",
  7137. // "id": "calendar.events.watch",
  7138. // "parameterOrder": [
  7139. // "calendarId"
  7140. // ],
  7141. // "parameters": {
  7142. // "alwaysIncludeEmail": {
  7143. // "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.",
  7144. // "location": "query",
  7145. // "type": "boolean"
  7146. // },
  7147. // "calendarId": {
  7148. // "description": "Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the \"primary\" keyword.",
  7149. // "location": "path",
  7150. // "required": true,
  7151. // "type": "string"
  7152. // },
  7153. // "iCalUID": {
  7154. // "description": "Specifies event ID in the iCalendar format to be included in the response. Optional.",
  7155. // "location": "query",
  7156. // "type": "string"
  7157. // },
  7158. // "maxAttendees": {
  7159. // "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.",
  7160. // "format": "int32",
  7161. // "location": "query",
  7162. // "minimum": "1",
  7163. // "type": "integer"
  7164. // },
  7165. // "maxResults": {
  7166. // "default": "250",
  7167. // "description": "Maximum number of events returned on one result page. The number of events in the resulting page may be less than this value, or none at all, even if there are more events matching the query. Incomplete pages can be detected by a non-empty nextPageToken field in the response. By default the value is 250 events. The page size can never be larger than 2500 events. Optional.",
  7168. // "format": "int32",
  7169. // "location": "query",
  7170. // "minimum": "1",
  7171. // "type": "integer"
  7172. // },
  7173. // "orderBy": {
  7174. // "description": "The order of the events returned in the result. Optional. The default is an unspecified, stable order.",
  7175. // "enum": [
  7176. // "startTime",
  7177. // "updated"
  7178. // ],
  7179. // "enumDescriptions": [
  7180. // "Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)",
  7181. // "Order by last modification time (ascending)."
  7182. // ],
  7183. // "location": "query",
  7184. // "type": "string"
  7185. // },
  7186. // "pageToken": {
  7187. // "description": "Token specifying which result page to return. Optional.",
  7188. // "location": "query",
  7189. // "type": "string"
  7190. // },
  7191. // "privateExtendedProperty": {
  7192. // "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.",
  7193. // "location": "query",
  7194. // "repeated": true,
  7195. // "type": "string"
  7196. // },
  7197. // "q": {
  7198. // "description": "Free text search terms to find events that match these terms in any field, except for extended properties. Optional.",
  7199. // "location": "query",
  7200. // "type": "string"
  7201. // },
  7202. // "sharedExtendedProperty": {
  7203. // "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.",
  7204. // "location": "query",
  7205. // "repeated": true,
  7206. // "type": "string"
  7207. // },
  7208. // "showDeleted": {
  7209. // "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.",
  7210. // "location": "query",
  7211. // "type": "boolean"
  7212. // },
  7213. // "showHiddenInvitations": {
  7214. // "description": "Whether to include hidden invitations in the result. Optional. The default is False.",
  7215. // "location": "query",
  7216. // "type": "boolean"
  7217. // },
  7218. // "singleEvents": {
  7219. // "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.",
  7220. // "location": "query",
  7221. // "type": "boolean"
  7222. // },
  7223. // "syncToken": {
  7224. // "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.",
  7225. // "location": "query",
  7226. // "type": "string"
  7227. // },
  7228. // "timeMax": {
  7229. // "description": "Upper bound (exclusive) for an event's start time to filter by. Optional. The default is not to filter by start time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMin is set, timeMax must be greater than timeMin.",
  7230. // "format": "date-time",
  7231. // "location": "query",
  7232. // "type": "string"
  7233. // },
  7234. // "timeMin": {
  7235. // "description": "Lower bound (inclusive) for an event's end time to filter by. Optional. The default is not to filter by end time. Must be an RFC3339 timestamp with mandatory time zone offset, e.g., 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided but will be ignored. If timeMax is set, timeMin must be smaller than timeMax.",
  7236. // "format": "date-time",
  7237. // "location": "query",
  7238. // "type": "string"
  7239. // },
  7240. // "timeZone": {
  7241. // "description": "Time zone used in the response. Optional. The default is the time zone of the calendar.",
  7242. // "location": "query",
  7243. // "type": "string"
  7244. // },
  7245. // "updatedMin": {
  7246. // "description": "Lower bound for an event's last modification time (as a RFC3339 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.",
  7247. // "format": "date-time",
  7248. // "location": "query",
  7249. // "type": "string"
  7250. // }
  7251. // },
  7252. // "path": "calendars/{calendarId}/events/watch",
  7253. // "request": {
  7254. // "$ref": "Channel",
  7255. // "parameterName": "resource"
  7256. // },
  7257. // "response": {
  7258. // "$ref": "Channel"
  7259. // },
  7260. // "scopes": [
  7261. // "https://www.googleapis.com/auth/calendar",
  7262. // "https://www.googleapis.com/auth/calendar.readonly"
  7263. // ],
  7264. // "supportsSubscription": true
  7265. // }
  7266. }
  7267. // method id "calendar.freebusy.query":
  7268. type FreebusyQueryCall struct {
  7269. s *Service
  7270. freebusyrequest *FreeBusyRequest
  7271. urlParams_ gensupport.URLParams
  7272. ctx_ context.Context
  7273. header_ http.Header
  7274. }
  7275. // Query: Returns free/busy information for a set of calendars.
  7276. func (r *FreebusyService) Query(freebusyrequest *FreeBusyRequest) *FreebusyQueryCall {
  7277. c := &FreebusyQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7278. c.freebusyrequest = freebusyrequest
  7279. return c
  7280. }
  7281. // Fields allows partial responses to be retrieved. See
  7282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7283. // for more information.
  7284. func (c *FreebusyQueryCall) Fields(s ...googleapi.Field) *FreebusyQueryCall {
  7285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7286. return c
  7287. }
  7288. // Context sets the context to be used in this call's Do method. Any
  7289. // pending HTTP request will be aborted if the provided context is
  7290. // canceled.
  7291. func (c *FreebusyQueryCall) Context(ctx context.Context) *FreebusyQueryCall {
  7292. c.ctx_ = ctx
  7293. return c
  7294. }
  7295. // Header returns an http.Header that can be modified by the caller to
  7296. // add HTTP headers to the request.
  7297. func (c *FreebusyQueryCall) Header() http.Header {
  7298. if c.header_ == nil {
  7299. c.header_ = make(http.Header)
  7300. }
  7301. return c.header_
  7302. }
  7303. func (c *FreebusyQueryCall) doRequest(alt string) (*http.Response, error) {
  7304. reqHeaders := make(http.Header)
  7305. for k, v := range c.header_ {
  7306. reqHeaders[k] = v
  7307. }
  7308. reqHeaders.Set("User-Agent", c.s.userAgent())
  7309. var body io.Reader = nil
  7310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.freebusyrequest)
  7311. if err != nil {
  7312. return nil, err
  7313. }
  7314. reqHeaders.Set("Content-Type", "application/json")
  7315. c.urlParams_.Set("alt", alt)
  7316. urls := googleapi.ResolveRelative(c.s.BasePath, "freeBusy")
  7317. urls += "?" + c.urlParams_.Encode()
  7318. req, _ := http.NewRequest("POST", urls, body)
  7319. req.Header = reqHeaders
  7320. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7321. }
  7322. // Do executes the "calendar.freebusy.query" call.
  7323. // Exactly one of *FreeBusyResponse or error will be non-nil. Any
  7324. // non-2xx status code is an error. Response headers are in either
  7325. // *FreeBusyResponse.ServerResponse.Header or (if a response was
  7326. // returned at all) in error.(*googleapi.Error).Header. Use
  7327. // googleapi.IsNotModified to check whether the returned error was
  7328. // because http.StatusNotModified was returned.
  7329. func (c *FreebusyQueryCall) Do(opts ...googleapi.CallOption) (*FreeBusyResponse, error) {
  7330. gensupport.SetOptions(c.urlParams_, opts...)
  7331. res, err := c.doRequest("json")
  7332. if res != nil && res.StatusCode == http.StatusNotModified {
  7333. if res.Body != nil {
  7334. res.Body.Close()
  7335. }
  7336. return nil, &googleapi.Error{
  7337. Code: res.StatusCode,
  7338. Header: res.Header,
  7339. }
  7340. }
  7341. if err != nil {
  7342. return nil, err
  7343. }
  7344. defer googleapi.CloseBody(res)
  7345. if err := googleapi.CheckResponse(res); err != nil {
  7346. return nil, err
  7347. }
  7348. ret := &FreeBusyResponse{
  7349. ServerResponse: googleapi.ServerResponse{
  7350. Header: res.Header,
  7351. HTTPStatusCode: res.StatusCode,
  7352. },
  7353. }
  7354. target := &ret
  7355. if err := gensupport.DecodeResponse(target, res); err != nil {
  7356. return nil, err
  7357. }
  7358. return ret, nil
  7359. // {
  7360. // "description": "Returns free/busy information for a set of calendars.",
  7361. // "httpMethod": "POST",
  7362. // "id": "calendar.freebusy.query",
  7363. // "path": "freeBusy",
  7364. // "request": {
  7365. // "$ref": "FreeBusyRequest"
  7366. // },
  7367. // "response": {
  7368. // "$ref": "FreeBusyResponse"
  7369. // },
  7370. // "scopes": [
  7371. // "https://www.googleapis.com/auth/calendar",
  7372. // "https://www.googleapis.com/auth/calendar.readonly"
  7373. // ]
  7374. // }
  7375. }
  7376. // method id "calendar.settings.get":
  7377. type SettingsGetCall struct {
  7378. s *Service
  7379. setting string
  7380. urlParams_ gensupport.URLParams
  7381. ifNoneMatch_ string
  7382. ctx_ context.Context
  7383. header_ http.Header
  7384. }
  7385. // Get: Returns a single user setting.
  7386. func (r *SettingsService) Get(setting string) *SettingsGetCall {
  7387. c := &SettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7388. c.setting = setting
  7389. return c
  7390. }
  7391. // Fields allows partial responses to be retrieved. See
  7392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7393. // for more information.
  7394. func (c *SettingsGetCall) Fields(s ...googleapi.Field) *SettingsGetCall {
  7395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7396. return c
  7397. }
  7398. // IfNoneMatch sets the optional parameter which makes the operation
  7399. // fail if the object's ETag matches the given value. This is useful for
  7400. // getting updates only after the object has changed since the last
  7401. // request. Use googleapi.IsNotModified to check whether the response
  7402. // error from Do is the result of In-None-Match.
  7403. func (c *SettingsGetCall) IfNoneMatch(entityTag string) *SettingsGetCall {
  7404. c.ifNoneMatch_ = entityTag
  7405. return c
  7406. }
  7407. // Context sets the context to be used in this call's Do method. Any
  7408. // pending HTTP request will be aborted if the provided context is
  7409. // canceled.
  7410. func (c *SettingsGetCall) Context(ctx context.Context) *SettingsGetCall {
  7411. c.ctx_ = ctx
  7412. return c
  7413. }
  7414. // Header returns an http.Header that can be modified by the caller to
  7415. // add HTTP headers to the request.
  7416. func (c *SettingsGetCall) Header() http.Header {
  7417. if c.header_ == nil {
  7418. c.header_ = make(http.Header)
  7419. }
  7420. return c.header_
  7421. }
  7422. func (c *SettingsGetCall) doRequest(alt string) (*http.Response, error) {
  7423. reqHeaders := make(http.Header)
  7424. for k, v := range c.header_ {
  7425. reqHeaders[k] = v
  7426. }
  7427. reqHeaders.Set("User-Agent", c.s.userAgent())
  7428. if c.ifNoneMatch_ != "" {
  7429. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7430. }
  7431. var body io.Reader = nil
  7432. c.urlParams_.Set("alt", alt)
  7433. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/{setting}")
  7434. urls += "?" + c.urlParams_.Encode()
  7435. req, _ := http.NewRequest("GET", urls, body)
  7436. req.Header = reqHeaders
  7437. googleapi.Expand(req.URL, map[string]string{
  7438. "setting": c.setting,
  7439. })
  7440. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7441. }
  7442. // Do executes the "calendar.settings.get" call.
  7443. // Exactly one of *Setting or error will be non-nil. Any non-2xx status
  7444. // code is an error. Response headers are in either
  7445. // *Setting.ServerResponse.Header or (if a response was returned at all)
  7446. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7447. // check whether the returned error was because http.StatusNotModified
  7448. // was returned.
  7449. func (c *SettingsGetCall) Do(opts ...googleapi.CallOption) (*Setting, error) {
  7450. gensupport.SetOptions(c.urlParams_, opts...)
  7451. res, err := c.doRequest("json")
  7452. if res != nil && res.StatusCode == http.StatusNotModified {
  7453. if res.Body != nil {
  7454. res.Body.Close()
  7455. }
  7456. return nil, &googleapi.Error{
  7457. Code: res.StatusCode,
  7458. Header: res.Header,
  7459. }
  7460. }
  7461. if err != nil {
  7462. return nil, err
  7463. }
  7464. defer googleapi.CloseBody(res)
  7465. if err := googleapi.CheckResponse(res); err != nil {
  7466. return nil, err
  7467. }
  7468. ret := &Setting{
  7469. ServerResponse: googleapi.ServerResponse{
  7470. Header: res.Header,
  7471. HTTPStatusCode: res.StatusCode,
  7472. },
  7473. }
  7474. target := &ret
  7475. if err := gensupport.DecodeResponse(target, res); err != nil {
  7476. return nil, err
  7477. }
  7478. return ret, nil
  7479. // {
  7480. // "description": "Returns a single user setting.",
  7481. // "httpMethod": "GET",
  7482. // "id": "calendar.settings.get",
  7483. // "parameterOrder": [
  7484. // "setting"
  7485. // ],
  7486. // "parameters": {
  7487. // "setting": {
  7488. // "description": "The id of the user setting.",
  7489. // "location": "path",
  7490. // "required": true,
  7491. // "type": "string"
  7492. // }
  7493. // },
  7494. // "path": "users/me/settings/{setting}",
  7495. // "response": {
  7496. // "$ref": "Setting"
  7497. // },
  7498. // "scopes": [
  7499. // "https://www.googleapis.com/auth/calendar",
  7500. // "https://www.googleapis.com/auth/calendar.readonly"
  7501. // ]
  7502. // }
  7503. }
  7504. // method id "calendar.settings.list":
  7505. type SettingsListCall struct {
  7506. s *Service
  7507. urlParams_ gensupport.URLParams
  7508. ifNoneMatch_ string
  7509. ctx_ context.Context
  7510. header_ http.Header
  7511. }
  7512. // List: Returns all user settings for the authenticated user.
  7513. func (r *SettingsService) List() *SettingsListCall {
  7514. c := &SettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7515. return c
  7516. }
  7517. // MaxResults sets the optional parameter "maxResults": Maximum number
  7518. // of entries returned on one result page. By default the value is 100
  7519. // entries. The page size can never be larger than 250 entries.
  7520. func (c *SettingsListCall) MaxResults(maxResults int64) *SettingsListCall {
  7521. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7522. return c
  7523. }
  7524. // PageToken sets the optional parameter "pageToken": Token specifying
  7525. // which result page to return.
  7526. func (c *SettingsListCall) PageToken(pageToken string) *SettingsListCall {
  7527. c.urlParams_.Set("pageToken", pageToken)
  7528. return c
  7529. }
  7530. // SyncToken sets the optional parameter "syncToken": Token obtained
  7531. // from the nextSyncToken field returned on the last page of results
  7532. // from the previous list request. It makes the result of this list
  7533. // request contain only entries that have changed since then.
  7534. // If the syncToken expires, the server will respond with a 410 GONE
  7535. // response code and the client should clear its storage and perform a
  7536. // full synchronization without any syncToken.
  7537. // Learn more about incremental synchronization.
  7538. // The default is to return all entries.
  7539. func (c *SettingsListCall) SyncToken(syncToken string) *SettingsListCall {
  7540. c.urlParams_.Set("syncToken", syncToken)
  7541. return c
  7542. }
  7543. // Fields allows partial responses to be retrieved. See
  7544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7545. // for more information.
  7546. func (c *SettingsListCall) Fields(s ...googleapi.Field) *SettingsListCall {
  7547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7548. return c
  7549. }
  7550. // IfNoneMatch sets the optional parameter which makes the operation
  7551. // fail if the object's ETag matches the given value. This is useful for
  7552. // getting updates only after the object has changed since the last
  7553. // request. Use googleapi.IsNotModified to check whether the response
  7554. // error from Do is the result of In-None-Match.
  7555. func (c *SettingsListCall) IfNoneMatch(entityTag string) *SettingsListCall {
  7556. c.ifNoneMatch_ = entityTag
  7557. return c
  7558. }
  7559. // Context sets the context to be used in this call's Do method. Any
  7560. // pending HTTP request will be aborted if the provided context is
  7561. // canceled.
  7562. func (c *SettingsListCall) Context(ctx context.Context) *SettingsListCall {
  7563. c.ctx_ = ctx
  7564. return c
  7565. }
  7566. // Header returns an http.Header that can be modified by the caller to
  7567. // add HTTP headers to the request.
  7568. func (c *SettingsListCall) Header() http.Header {
  7569. if c.header_ == nil {
  7570. c.header_ = make(http.Header)
  7571. }
  7572. return c.header_
  7573. }
  7574. func (c *SettingsListCall) doRequest(alt string) (*http.Response, error) {
  7575. reqHeaders := make(http.Header)
  7576. for k, v := range c.header_ {
  7577. reqHeaders[k] = v
  7578. }
  7579. reqHeaders.Set("User-Agent", c.s.userAgent())
  7580. if c.ifNoneMatch_ != "" {
  7581. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7582. }
  7583. var body io.Reader = nil
  7584. c.urlParams_.Set("alt", alt)
  7585. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings")
  7586. urls += "?" + c.urlParams_.Encode()
  7587. req, _ := http.NewRequest("GET", urls, body)
  7588. req.Header = reqHeaders
  7589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7590. }
  7591. // Do executes the "calendar.settings.list" call.
  7592. // Exactly one of *Settings or error will be non-nil. Any non-2xx status
  7593. // code is an error. Response headers are in either
  7594. // *Settings.ServerResponse.Header or (if a response was returned at
  7595. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7596. // to check whether the returned error was because
  7597. // http.StatusNotModified was returned.
  7598. func (c *SettingsListCall) Do(opts ...googleapi.CallOption) (*Settings, error) {
  7599. gensupport.SetOptions(c.urlParams_, opts...)
  7600. res, err := c.doRequest("json")
  7601. if res != nil && res.StatusCode == http.StatusNotModified {
  7602. if res.Body != nil {
  7603. res.Body.Close()
  7604. }
  7605. return nil, &googleapi.Error{
  7606. Code: res.StatusCode,
  7607. Header: res.Header,
  7608. }
  7609. }
  7610. if err != nil {
  7611. return nil, err
  7612. }
  7613. defer googleapi.CloseBody(res)
  7614. if err := googleapi.CheckResponse(res); err != nil {
  7615. return nil, err
  7616. }
  7617. ret := &Settings{
  7618. ServerResponse: googleapi.ServerResponse{
  7619. Header: res.Header,
  7620. HTTPStatusCode: res.StatusCode,
  7621. },
  7622. }
  7623. target := &ret
  7624. if err := gensupport.DecodeResponse(target, res); err != nil {
  7625. return nil, err
  7626. }
  7627. return ret, nil
  7628. // {
  7629. // "description": "Returns all user settings for the authenticated user.",
  7630. // "httpMethod": "GET",
  7631. // "id": "calendar.settings.list",
  7632. // "parameters": {
  7633. // "maxResults": {
  7634. // "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.",
  7635. // "format": "int32",
  7636. // "location": "query",
  7637. // "minimum": "1",
  7638. // "type": "integer"
  7639. // },
  7640. // "pageToken": {
  7641. // "description": "Token specifying which result page to return. Optional.",
  7642. // "location": "query",
  7643. // "type": "string"
  7644. // },
  7645. // "syncToken": {
  7646. // "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.",
  7647. // "location": "query",
  7648. // "type": "string"
  7649. // }
  7650. // },
  7651. // "path": "users/me/settings",
  7652. // "response": {
  7653. // "$ref": "Settings"
  7654. // },
  7655. // "scopes": [
  7656. // "https://www.googleapis.com/auth/calendar",
  7657. // "https://www.googleapis.com/auth/calendar.readonly"
  7658. // ],
  7659. // "supportsSubscription": true
  7660. // }
  7661. }
  7662. // Pages invokes f for each page of results.
  7663. // A non-nil error returned from f will halt the iteration.
  7664. // The provided context supersedes any context provided to the Context method.
  7665. func (c *SettingsListCall) Pages(ctx context.Context, f func(*Settings) error) error {
  7666. c.ctx_ = ctx
  7667. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7668. for {
  7669. x, err := c.Do()
  7670. if err != nil {
  7671. return err
  7672. }
  7673. if err := f(x); err != nil {
  7674. return err
  7675. }
  7676. if x.NextPageToken == "" {
  7677. return nil
  7678. }
  7679. c.PageToken(x.NextPageToken)
  7680. }
  7681. }
  7682. // method id "calendar.settings.watch":
  7683. type SettingsWatchCall struct {
  7684. s *Service
  7685. channel *Channel
  7686. urlParams_ gensupport.URLParams
  7687. ctx_ context.Context
  7688. header_ http.Header
  7689. }
  7690. // Watch: Watch for changes to Settings resources.
  7691. func (r *SettingsService) Watch(channel *Channel) *SettingsWatchCall {
  7692. c := &SettingsWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7693. c.channel = channel
  7694. return c
  7695. }
  7696. // MaxResults sets the optional parameter "maxResults": Maximum number
  7697. // of entries returned on one result page. By default the value is 100
  7698. // entries. The page size can never be larger than 250 entries.
  7699. func (c *SettingsWatchCall) MaxResults(maxResults int64) *SettingsWatchCall {
  7700. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7701. return c
  7702. }
  7703. // PageToken sets the optional parameter "pageToken": Token specifying
  7704. // which result page to return.
  7705. func (c *SettingsWatchCall) PageToken(pageToken string) *SettingsWatchCall {
  7706. c.urlParams_.Set("pageToken", pageToken)
  7707. return c
  7708. }
  7709. // SyncToken sets the optional parameter "syncToken": Token obtained
  7710. // from the nextSyncToken field returned on the last page of results
  7711. // from the previous list request. It makes the result of this list
  7712. // request contain only entries that have changed since then.
  7713. // If the syncToken expires, the server will respond with a 410 GONE
  7714. // response code and the client should clear its storage and perform a
  7715. // full synchronization without any syncToken.
  7716. // Learn more about incremental synchronization.
  7717. // The default is to return all entries.
  7718. func (c *SettingsWatchCall) SyncToken(syncToken string) *SettingsWatchCall {
  7719. c.urlParams_.Set("syncToken", syncToken)
  7720. return c
  7721. }
  7722. // Fields allows partial responses to be retrieved. See
  7723. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7724. // for more information.
  7725. func (c *SettingsWatchCall) Fields(s ...googleapi.Field) *SettingsWatchCall {
  7726. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7727. return c
  7728. }
  7729. // Context sets the context to be used in this call's Do method. Any
  7730. // pending HTTP request will be aborted if the provided context is
  7731. // canceled.
  7732. func (c *SettingsWatchCall) Context(ctx context.Context) *SettingsWatchCall {
  7733. c.ctx_ = ctx
  7734. return c
  7735. }
  7736. // Header returns an http.Header that can be modified by the caller to
  7737. // add HTTP headers to the request.
  7738. func (c *SettingsWatchCall) Header() http.Header {
  7739. if c.header_ == nil {
  7740. c.header_ = make(http.Header)
  7741. }
  7742. return c.header_
  7743. }
  7744. func (c *SettingsWatchCall) doRequest(alt string) (*http.Response, error) {
  7745. reqHeaders := make(http.Header)
  7746. for k, v := range c.header_ {
  7747. reqHeaders[k] = v
  7748. }
  7749. reqHeaders.Set("User-Agent", c.s.userAgent())
  7750. var body io.Reader = nil
  7751. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  7752. if err != nil {
  7753. return nil, err
  7754. }
  7755. reqHeaders.Set("Content-Type", "application/json")
  7756. c.urlParams_.Set("alt", alt)
  7757. urls := googleapi.ResolveRelative(c.s.BasePath, "users/me/settings/watch")
  7758. urls += "?" + c.urlParams_.Encode()
  7759. req, _ := http.NewRequest("POST", urls, body)
  7760. req.Header = reqHeaders
  7761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7762. }
  7763. // Do executes the "calendar.settings.watch" call.
  7764. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  7765. // code is an error. Response headers are in either
  7766. // *Channel.ServerResponse.Header or (if a response was returned at all)
  7767. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7768. // check whether the returned error was because http.StatusNotModified
  7769. // was returned.
  7770. func (c *SettingsWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  7771. gensupport.SetOptions(c.urlParams_, opts...)
  7772. res, err := c.doRequest("json")
  7773. if res != nil && res.StatusCode == http.StatusNotModified {
  7774. if res.Body != nil {
  7775. res.Body.Close()
  7776. }
  7777. return nil, &googleapi.Error{
  7778. Code: res.StatusCode,
  7779. Header: res.Header,
  7780. }
  7781. }
  7782. if err != nil {
  7783. return nil, err
  7784. }
  7785. defer googleapi.CloseBody(res)
  7786. if err := googleapi.CheckResponse(res); err != nil {
  7787. return nil, err
  7788. }
  7789. ret := &Channel{
  7790. ServerResponse: googleapi.ServerResponse{
  7791. Header: res.Header,
  7792. HTTPStatusCode: res.StatusCode,
  7793. },
  7794. }
  7795. target := &ret
  7796. if err := gensupport.DecodeResponse(target, res); err != nil {
  7797. return nil, err
  7798. }
  7799. return ret, nil
  7800. // {
  7801. // "description": "Watch for changes to Settings resources.",
  7802. // "httpMethod": "POST",
  7803. // "id": "calendar.settings.watch",
  7804. // "parameters": {
  7805. // "maxResults": {
  7806. // "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.",
  7807. // "format": "int32",
  7808. // "location": "query",
  7809. // "minimum": "1",
  7810. // "type": "integer"
  7811. // },
  7812. // "pageToken": {
  7813. // "description": "Token specifying which result page to return. Optional.",
  7814. // "location": "query",
  7815. // "type": "string"
  7816. // },
  7817. // "syncToken": {
  7818. // "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.",
  7819. // "location": "query",
  7820. // "type": "string"
  7821. // }
  7822. // },
  7823. // "path": "users/me/settings/watch",
  7824. // "request": {
  7825. // "$ref": "Channel",
  7826. // "parameterName": "resource"
  7827. // },
  7828. // "response": {
  7829. // "$ref": "Channel"
  7830. // },
  7831. // "scopes": [
  7832. // "https://www.googleapis.com/auth/calendar",
  7833. // "https://www.googleapis.com/auth/calendar.readonly"
  7834. // ],
  7835. // "supportsSubscription": true
  7836. // }
  7837. }