You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

9162 line
332 KiB

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