-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathuser.go
596 lines (513 loc) · 24.9 KB
/
user.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
package eventbrite
import (
"fmt"
"golang.org/x/net/context"
)
// User is an object representing an Eventbrite user
//
// https://www.eventbrite.com/developer/v3/response_formats/user/#ebapi-std:format-user
type User struct {
ID string `json:"id"`
// The user’s name. Use this in preference to first_name/last_name if possible for forward compatibility with non-Western names
Name string `json:"name"`
// The user’s first name
FirstName string `json:"first_name"`
// The user’s last name
LastName string `json:"last_name"`
// A list of user emails
Emails []Email `json:"emails"`
}
type Contact struct {
// The contact’s name. Use this in preference to first_name/last_name if possible for
// forward compatability with non-Western names
Name string `json:"name"`
// The contact’s first name
FirstName string `json:"first_name"`
// The contact’s last name
LastName string `json:"last_name"`
// The contact’s email address
Email string `json:"email"`
// When this contact was created
Created DateTime `json:"created"`
}
// https://www.eventbrite.com/developer/v3/response_formats/user/#ebapi-contact-list
type ContactList struct {
// The name of the contact list
Name string `json:"name"`
// The user who owns this contact list
UserID string `json:"user_id"`
}
// Email contains a list of email objects giving information on the user’s email addresses
//
// https://www.eventbrite.com/developer/v3/response_formats/user/#ebapi-user-emails
type Email struct {
Email string `json:"email"`
Verified bool `json:"verified"`
Primary bool `json:"primary"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id1
type GetUserOrdersRequest struct {
// Only return resource changed on or after the time given
ChangedSince string `json:"changed_since"`
// Limits results to either past or current & future events / orders.
// (Valid choices are: all, past, or current_future)
TimeFilter string `json:"time_filter"`
}
// An assortment is a package/pricing plan associated with an Eventbrite organizer.
// This plan determines the features available to the organizer and the pricing model
// applied to their event tickets.
//
// https://www.eventbrite.com/developer/v3/response_formats/assortments/#ebapi-fields
type Assortment struct {
// The assortment plan associated with this user
Plan string `json:"plan"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id3
type GetUserOrganizersRequest struct {
// True: Will hide organizers flagged as “unsaved” False: Will show organizers
// regardless of unsaved flag (Default value)
HideUnsaved bool `json:"hide_unsaved"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id5
type GetUserOwnedEvents struct {
// How to order the results (Valid choices are: start_asc, start_desc, created_asc,
// created_desc, name_asc, or name_desc)
OrderBy string `json:"order_by"`
// True: Will show parent of a serie instead of children False: Will show children of a serie (Default value)
ShowSeriesParent bool `json:"show_series_parent"`
// Filter by events with a specific status set. This should be a comma delimited string of status.
// Valid status: all, draft, live, canceled, started, ended.
Status string `json:"status"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id7
type GetUserEvents struct {
// Filter event results by name
NameFilter string `json:"name_filter"`
// Filter event results by currency
CurrencyFilter string `json:"currency_filter"`
// How to order the results (Valid choices are: start_asc, start_desc, created_asc,
// created_desc, name_asc, or name_desc)
OrderBy string `json:"order_by"`
// True: Will show parent of a serie instead of children False: Will show children of a serie (Default value)
ShowSeriesParent bool `json:"show_series_parent"`
// Filter by events with a specific status set. This should be a comma delimited string of status.
// Valid status: all, draft, live, canceled, started, ended
Status string `json:"status"`
// Filter event results by event_group_id
EventGroupID string `json:"event_group_id"`
// Number of records in each page
PageSize int `json:"page_size"`
// Limits results to either past or current & future events / orders. (Valid choices are: all, past, or current_future
TimeFilter string `json:"time_filter"`
// Filter event results by venue IDs
VenueFilter []interface{} `json:"venue_filter"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id9
type CreateOrganizationEventRequest struct {
// The name of the event. Value cannot be empty nor whitespace.
NameHtml string `json:"event.name.html" validate:"required"`
// The ID of the organizer of this event
DescriptionHtml string `json:"event.description.html" validate:"required"`
// The ID of the organizer of this event
OrganizerId string `json:"event.organizer_id" validate:"required"`
// The start time of the event
StartUtc string `json:"event.start.utc" validate:"required"`
// Yes Start time timezone (Olson format)
EventStartTimezone string `json:"event.start.timezone" validate:"required"`
// The end time of the event
EventEndUtc string `json:"event.end.utc" validate:"required"`
// End time timezone (Olson format)
EventEndTimezone string `json:"event.end.timezone" validate:"required"`
// Whether the start date should be hidden
EventHideStartDate bool `json:"event.hide_start_date"`
// Whether the end date should be hidden
EventHideEndDate bool `json:"event.hide_end_date"`
// Event currency (3 letter code)
EventCurrency string `json:"event.currency" validate:"required"`
// The ID of a previously-created venue to associate with this event. You can omit this field or
// set it to null if you set online_event.
VenueId string `json:"event.venue_id"`
// Is the event online-only (no venue)?
OnlineEvent bool `json:"event.online_event"`
// If the event is publicly listed and searchable. Defaults to True.
Listed bool `json:"event.listed"`
// The logo for the event
LogoId string `json:"event.logo_id"`
// The category (vertical) of the event
CategoryId string `json:"event.category_id"`
// The subcategory of the event (US only)
SubcategoryId string `json:"event.subcategory_id"`
// The format (general type) of the event
FormatId string `json:"event.format_id"`
// If users can share the event on social media
Sharable bool `json:"event.shareable"`
// Only invited users can see the event page
InviteOnly bool `json:"event.invite_only"`
// Password needed to see the event in unlisted mode
Password string `json:"event.password"`
// Set specific capacity (if omitted, sums ticket capacities)
Capacity int `json:"event.capacity"`
// If the remaining number of tickets is publicly visible on the event page
ShowRemaining bool `json:"event.show_remaining"`
// If the event is reserved seating
IsReservedSeating bool `json:"event.is_reserved_seating"`
// Source of the event (defaults to API)
Source string `json:"event.source"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-venues
type GetUserVenuesResult struct {
Pagination Pagination `json:"pagination"`
Venues []Venue `json:"venues"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id13
type CreateOrganizationVenueRequest struct {
// The name of the venue
Name string `json:"venue.name" validate:"required"`
// The organizer this venue belongs to (optional - leave this off to use the default organizer)
OrganizerID string `json:"venue.organizer_id"`
// The first line of the address
Address1 string `json:"venue.address.address_1"`
// The second line of the address
Address2 string `json:"venue.address.address_2"`
// The city where the venue is
City string `json:"venue.address.city"`
// The region where the venue is
Region string `json:"venue.address.region"`
// The postal_code where the venue is
PostalCode string `json:"venue.address.postal_code"`
// The country where the venue is
Country string `json:"venue.address.country"`
// The latitude of the coordinates for the venue
Latitude float64 `json:"venue.address.latitude"`
// The longitude of the coordinates for the venue
Longitude float64 `json:"venue.address.longitude"`
// The age restrictions for the venue
AgeRestriction string `json:"venue.age_restriction"`
// The max capacity for the venue
Capacity int `json:"venue.capacity"`
}
// UserEventAttendeesRequest is the request structure to get a user owned event attendees
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id15
type UserEventAttendeesRequest struct {
// Limits results to either confirmed attendees or cancelled/refunded/etc. attendees
// (Valid choices are: attending, or not_attending)
Status string `json:"status"`
// Only return resource changed on or after the time given
ChangedSince string `json:"changed_since"`
}
// UserEventAttendeesResponse is the response structure to get a user owned event attendees
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-get-users-id-owned-event-attendees
type UserEventAttendeesResponse struct {
Pagination Pagination `json:"pagination"`
Attendees []Attendee `json:"attendee"`
}
// UserEventOrders is the request structure to get all order placed under
// the user
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id17
type UserEventOrders struct {
// Limits results to either past or current & future events / orders.
// (Valid choices are: all, past, or current_future)
TimeFilter string `json:"time_filter"`
// Only return resource changed on or after the time given
ChangedSince string `json:"changed_since"`
}
// GetUserOrdersResult is the response structure for user orders
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-get-users-id-orders
type UserOrdersResult struct {
Pagination Pagination `json:"pagination"`
Orders []Order `json:"orders"`
}
// UserOrganizerRequest is the request structure to get all organizer objects that are owned by the user
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-id3
type UserOrganizerRequest struct {
// True: Will hide organizers flagged as “unsaved” False: Will show organizers
// regardless of unsaved flag (Default value)
HideUnsaved bool `json:"hide_unsaved"`
}
// UserOrganizerResponse is the response structure for all organizer objects that are owned by the user
type UserOrganizerResponse struct {
Pagination Pagination `json:"pagination"`
Organizers []Organizer `json:"organizers"`
}
// UserOwnedEventsRequest is the request structure to get user owned events
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-id5
type UserOwnedEventsRequest struct {
// How to order the results (Valid choices are: start_asc, start_desc, created_asc,
// created_desc, name_asc, or name_desc)
OrderBy string `json:"order_by"`
// True: Will show parent of a serie instead of children False: Will show children of a serie (Default value)
ShowSeriesParent bool `json:"show_series_parent"`
// Filter by events with a specific status set. This should be a comma delimited string of status.
// Valid status: all, draft, live, canceled, started, ended
Status string `json:"status"`
}
// UserOwnedEventResponse is the response structure to get user owned events
type UserOwnedEventResponse struct {
Pagination Pagination `json:"pagination"`
Events []Event `json:"events"`
}
type UserEventsRequest struct {
}
type UserEventsResponse struct {
// Filter event results by name
NameFilter string `json:"name_filter"`
// Filter event results by currency
CurrencyFilter string `json:"currency_filter"`
// How to order the results (Valid choices are: start_asc, start_desc, created_asc, created_desc, name_asc, or name_desc)
OrderBy string `json:"order_by"`
// True: Will show parent of a serie instead of children False: Will show children of a serie (Default value)
ShowSeriesParent bool `json:"show_series_parent"`
// Filter by events with a specific status set. This should be a comma delimited string of
// status. Valid status: all, draft, live, canceled, started, ended.
Status string `json:"status"`
// Filter event results by event_group_id
EventGroupID string `json:"event_group_id"`
// Number of records in each page.
PageSize int `json:"page_size"`
// Limits results to either past or current & future events / orders. (Valid choices are: all, past, or current_future)
TimeFilter string `json:"time_filter"`
// Filter event results by venue IDs
VenueFilter []interface{} `json:"venue_filter"`
}
// UserVenuesResponse is the response structure to get user owned venues
type UserVenuesResponse struct {
Pagination Pagination `json:"pagination"`
Venues []Venue `json:"venues"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id17
type UserEventOrdersRequest struct {
Status string `json:"status"`
OnlyEmails []string `json:"only_emails"`
ExcludeEmails []string `json:"exclude_emails"`
ChangedSince DateTime `json:"datetime"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-owned-event-orders
type UserEventOrdersResponse struct {
Pagination Pagination `json:"pagination"`
Orders []Order `json:"orders"`
}
// UserContactListsResponse is the response structure to get user contact lists
type UserContactListsResponse struct {
Pagination Pagination `json:"pagination"`
ContactList []ContactList `json:"contact_lists"`
}
type UserCreateContactListsRequest struct {
Name string `json:"contact_list.name" validate:"required"`
}
type UserUpdateContactListRequest struct {
Name string `json:"contact_list.name" validate:"required"`
}
type UserAddContactListContactRequest struct {
// Contact’s email address
Email string `json:"email" validate:"required"`
// Contact’s first name (or full name)
FirstName string `json:"first_name"`
// Contact’s last name
LastName string `json:"last_name"`
}
type UserDeleteContactListContactRequest struct {
// Email address to remove
Email string `json:"email"`
}
type UserContactListContacts struct {
Pagination Pagination `json:"pagination"`
Contacts []Contact `json:"contacts"`
}
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-id35
type UserBookmarksRequest struct {
// Optional bookmark list id to fetch all bookmarks from
BookmarkListID string `json:"bookmark_list_id"`
}
type UserBookmarksResponse struct {
Pagination Pagination `json:"pagination"`
Events []Event `json:"events"`
}
type UserSaveBookmarkRequest struct {
// Event id to bookmark for the user
EventID int `json:"event_id"`
// Event ids to batch bookmark for the user
EventIDs []string `json:"event_ids"`
// Optional Bookmark list id to save the bookmark(s) to
BookmarkListID string `json:"bookmark_list_id"`
}
type UserUnSaveBookmarkRequest struct {
// Event id to bookmark for the user
EventID int `json:"event_id"`
// Event ids to batch bookmark for the user
EventIDs []string `json:"event_ids"`
// Optional Bookmark list id to save the bookmark(s) to
BookmarkListID string `json:"bookmark_list_id"`
}
type UserTicketGroupsRequest struct {
// Limits results to groups with the specific status (Valid choices are: live, archived, deleted, or all)
Status string `json:"status"`
}
type UserTicketGroupResponse struct {
Pagination Pagination `json:"pagination"`
TicketGroups []*TicketGroup
}
type UserSetAssortmentRequest struct {
// The assortments package to upgrade/downgrade to. (Valid choices are: package1, or package2)
Plan string `json:"plan" validate:"required"`
}
// UserGet returns a user for the specified user as user. If you want to get details about the
// currently authenticated user, use /users/me/
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-get-users-id
func (c *Client) User(ctx context.Context, id string) (*User, error) {
u := new(User)
return u, c.getJSON(ctx, fmt.Sprintf("/users/%s/", id), nil, u)
}
// UserOrders returns a paginated response of orders, under the key orders, of all orders
// the user has placed (i.e. where the user was the person buying the tickets).
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-get-users-id-orders
func (c *Client) UserOrders(ctx context.Context, id string, req *UserEventOrders) (*UserOrdersResult, error) {
r := new(UserOrdersResult)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/orders/", id), req, r)
}
// UserOrganizers returns a paginated response of organizer objects that are owned by the user.
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-get-users-id-organizers
func (c *Client) UserOrganizers(ctx context.Context, id string, req *UserOrganizerRequest) (*UserOrganizerResponse, error) {
r := new(UserOrganizerResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/organizers/", id), req, r)
}
// UserOrganizers returns a paginated response of organizer objects that are owned by the user.
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-get-users-id-organizers
func (c *Client) UserOwnedEvents(ctx context.Context, id string, req *UserOwnedEventsRequest) (*UserOwnedEventResponse, error) {
r := new(UserOwnedEventResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/owned_events/", id), req, r)
}
// UserEvents returns a paginated response of events, under the key events, of all events the user has access to
//
// https://www.eventbrite.co.uk/developer/v3/endpoints/users/#ebapi-get-users-id-events
func (c *Client) UserEvents(ctx context.Context, id string, req UserEventsRequest) (*UserEventsResponse, error) {
r := new(UserEventsResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/events/", id), req, r)
}
// UserVenues returns a paginated response of venue objects that are owned by the user
func (c *Client) UserVenues(ctx context.Context, id string) (*UserVenuesResponse, error) {
r := new(UserVenuesResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/events/", id), nil, r)
}
// UserEventAttendees returns a paginated response of attendees, under the key attendees, of attendees visiting
// any of the events the user owns (events that would be returned from /users/:id/owned_events/)
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-owned-event-attendees
func (c *Client) UserEventAttendees(ctx context.Context, id string, request *UserEventAttendeesRequest) (*UserEventAttendeesResponse, error) {
r := new(UserEventAttendeesResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/owned_event_attendees/", id), request, r)
}
// UserEventOrders returns a paginated response of orders, under the key orders, of orders placed against any of
// the events the user owns (events that would be returned from /users/:id/owned_events/)
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-owned-event-orders
func (c *Client) UserEventOrders(ctx context.Context, id string, request *UserEventOrdersRequest) (*UserEventOrdersResponse, error) {
r := new(UserEventOrdersResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/owned_event_orders/", id), request, r)
}
// UserContactLists returns a list of contact_list that the user owns as the key contact_lists
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-contact-lists
func (c *Client) UserContactLists(ctx context.Context, id string) (*UserContactListsResponse, error) {
r := new(UserContactListsResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/contact_lists/", id), nil, r)
}
// UserCreateContactList makes a new contact_list for the user and returns it as contact_list
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-post-users-id-contact-lists
func (c *Client) UserCreateContactList(ctx context.Context, id string, request *UserCreateContactListsRequest) (*UserContactListsResponse, error) {
r := new(UserContactListsResponse)
return r, c.postJSON(ctx, fmt.Sprintf("/users/%s/owned_event_orders/", id), request, r)
}
// UserContactList gets a user’s contact_list by ID as contact_list
//
// hhttps://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-contact-lists-contact-list-id
func (c *Client) UserContactList(ctx context.Context, id, contactListID string, request *UserCreateContactListsRequest) (*UserContactListsResponse, error) {
r := new(UserContactListsResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/contact_lists/%s/", id, contactListID), request, r)
}
// UserUpdateContactList updates the contact_list and returns it as contact_list
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-post-users-id-contact-lists-contact-list-id
func (c *Client) UserUpdateContactList(ctx context.Context, id, contactListID string, request *UserUpdateContactListRequest) (*UserContactListsResponse, error) {
r := new(UserContactListsResponse)
return r, c.postJSON(ctx, fmt.Sprintf("/users/%s/contact_lists/%s/", id, contactListID), request, r)
}
// UserDeleteContactList deletes the contact list. Returns {"deleted": true}
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-delete-users-id-contact-lists-contact-list-id
func (c *Client) UserDeleteContactList(ctx context.Context, id, contactListID string) (interface{}, error) {
var r interface{}
return r, c.deleteJSON(ctx, fmt.Sprintf("/users/%s/contact_lists/%s/", id, contactListID), r)
}
// UserContactListContacts returns the contacts on the contact list as contacts
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-contact-lists-contact-list-id-contacts
func (c *Client) UserListContactContacts(ctx context.Context, id, contactListID string) (*UserContactListContacts, error) {
r := new(UserContactListContacts)
return r, c.postJSON(ctx, fmt.Sprintf("/users/%s/contact_lists/%s/contacts/", id, contactListID), nil, r)
}
// UserContactListContacts adds a new contact to the contact list. Returns {"created": true}
// There is no way to update entries in the list; just delete the old one and add the updated version.
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-contact-lists-contact-list-id-contacts
func (c *Client) UserListContactAddContacts(ctx context.Context, id, contactListID string, req *UserAddContactListContactRequest) (*UserContactListContacts, error) {
r := new(UserContactListContacts)
return r, c.postJSON(ctx, fmt.Sprintf("/users/%s/contact_lists/%s/contacts/", id, contactListID), req, r)
}
// UserContactListContacts adds a new contact to the contact list. Returns {"created": true}
// There is no way to update entries in the list; just delete the old one and add the updated version.
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-contact-lists-contact-list-id-contacts
func (c *Client) UserListContactDeleteContacts(ctx context.Context, id, contactListID string) (interface{}, error) {
r := new(UserContactListContacts)
return r, c.deleteJSON(ctx, fmt.Sprintf("/users/%s/contact_lists/%s/contacts/", id, contactListID), r)
}
// UserBookmarks gets all the user’s saved events.
// In order to update the saved events list, the user must unsave or save each event.
// A user is authorized to only see his/her saved events.
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-bookmarks
func (c *Client) UserBookmarks(ctx context.Context, id string, req *UserBookmarksRequest) (*UserBookmarksResponse, error) {
r := new(UserBookmarksResponse)
return r, c.getJSON(ctx, fmt.Sprintf("/users/%s/bookmarks/", id), req, r)
}
// UserSaveBookmarks adds a new bookmark for the user. Returns {"created": true}.
// A user is only authorized to save his/her own events.
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-post-users-id-bookmarks-save
func (c *Client) UserSaveBookmarks(ctx context.Context, id string, req *UserSaveBookmarkRequest) (interface{}, error) {
var v interface{}
return v, c.getJSON(ctx, fmt.Sprintf("/users/%s/bookmarks/save", id), req, v)
}
// UserUnSaveBookmarks removes the specified bookmark from the event for the user. Returns {"deleted": true}.
// A user is only authorized to unsave his/her own events.
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-post-users-id-bookmarks-unsave
func (c *Client) UserUnSaveBookmarks(ctx context.Context, id string, req *UserUnSaveBookmarkRequest) (interface{}, error) {
var v interface{}
return v, c.getJSON(ctx, fmt.Sprintf("/users/%s/bookmarks/unsave", id), req, v)
}
// UserAssortments retrieve the assortment for the user
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-assortment
func (c *Client) UserAssortments(ctx context.Context, id string) (*Assortment, error) {
a := new(Assortment)
return a, c.getJSON(ctx, fmt.Sprintf("/users/%s/assortment/", id), nil, a)
}
// UserSetAssortments set a user’s assortment and returns the assortment for the specified user.
//
// https://www.eventbrite.com/developer/v3/endpoints/users/#ebapi-get-users-id-assortment
func (c *Client) UserSetAssortments(ctx context.Context, id string, req *UserSetAssortmentRequest) (*Assortment, error) {
a := new(Assortment)
return a, c.postJSON(ctx, fmt.Sprintf("/users/%s/assortment/", id), req, a)
}