I realise my initial post was woefully inadequate and I apologise. Hopefully this followup will clarify.
I am using go version go1.11 linux/amd64 and the latest version of the Calendar API https://godoc.org/google.golang.org/api)/[calendar](https://godoc.org/google.golang.org/api/calendar/v3
I am trying to create an event that contains remainders as illustrated below and this code produces:
2018/10/31 08:14:27 The err googleapi: Error 400: Cannot specify both default reminders and overrides at
the same time., cannotUseDefaultRemindersAndSpecifyOverride
I have tried adding the UserDefault = false and setting the newEvent.ForceSendFields = []string{“UseDefault”} to no avail.
If I completely remove the remainders section the the call is successful and picks up the calendar default notifications even if I include the reminders UseDefault= false.
Using the API Explorer with the raw api works as expected so I am led to believe there is something wrong in the library.
You assistance is appreciated.
Thanks
newEvent := &calendar.Event{
ConferenceData: &calendar.ConferenceData{
CreateRequest: &calendar.CreateConferenceRequest{
ConferenceSolutionKey: &calendar.ConferenceSolutionKey{
Type: "hangoutsMeet",
},
RequestId: "1234",
},
},
Reminders: &calendar.EventReminders{
Overrides: []*calendar.EventReminder{
&calendar.EventReminder{
Method: "email",
Minutes: 120,
},
&calendar.EventReminder{
Method: "email",
Minutes: 90,
},
&calendar.EventReminder{
Method: "popup",
Minutes: 30,
},
},
},
}
newEvent.Summary = "Client Name Type of Service"
newEvent.Description = "Link to create notes, Link to book next appointment. Instructions HTML Formatted"
var dt [2]calendar.EventDateTime
dt[0].TimeZone = theSlot.TimeZone
dt[1].TimeZone = theSlot.TimeZone
dt[0].DateTime = theSlot.StartTime.Format("2006-01-02T15:04:05-07:00")
newEvent.Start = &dt[0]
dt[1].DateTime = theSlot.EndTime.Format("2006-01-02T15:04:05-07:00")
newEvent.End = &dt[1]
_, err :=
srv.Events.Insert("hasubehaviouralhealth.ca_mcbpge4nm5s8ddgsvn4o99atoc@group.calendar.google.com",
newEvent).ConferenceDataVersion(1).Do()
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/john/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/john/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build319526860=/tmp/go-build -gno-record-gcc-switches"