Documentation ¶
Overview ¶
Posts scheduled events in a calendar.
Index ¶
- Variables
- type NewPostCalendarEvents
- type PostCalendarEvents
- func (r *PostCalendarEvents) CalendarId(calendarid string) *PostCalendarEvents
- func (r PostCalendarEvents) Do(ctx context.Context) (*Response, error)
- func (r *PostCalendarEvents) Events(events ...types.CalendarEvent) *PostCalendarEvents
- func (r *PostCalendarEvents) Header(key, value string) *PostCalendarEvents
- func (r *PostCalendarEvents) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r PostCalendarEvents) Perform(ctx context.Context) (*http.Response, error)
- func (r *PostCalendarEvents) Raw(raw io.Reader) *PostCalendarEvents
- func (r *PostCalendarEvents) Request(req *Request) *PostCalendarEvents
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")
ErrBuildPath is returned in case of missing parameters within the build of the request.
Functions ¶
This section is empty.
Types ¶
type NewPostCalendarEvents ¶
type NewPostCalendarEvents func(calendarid string) *PostCalendarEvents
NewPostCalendarEvents type alias for index.
func NewPostCalendarEventsFunc ¶
func NewPostCalendarEventsFunc(tp elastictransport.Interface) NewPostCalendarEvents
NewPostCalendarEventsFunc returns a new instance of PostCalendarEvents with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.
type PostCalendarEvents ¶
type PostCalendarEvents struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *PostCalendarEvents
Posts scheduled events in a calendar.
https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html
func (*PostCalendarEvents) CalendarId ¶
func (r *PostCalendarEvents) CalendarId(calendarid string) *PostCalendarEvents
CalendarId A string that uniquely identifies a calendar. API Name: calendarid
func (PostCalendarEvents) Do ¶
func (r PostCalendarEvents) Do(ctx context.Context) (*Response, error)
Do runs the request through the transport, handle the response and returns a postcalendarevents.Response
func (*PostCalendarEvents) Events ¶ added in v8.9.0
func (r *PostCalendarEvents) Events(events ...types.CalendarEvent) *PostCalendarEvents
Events A list of one of more scheduled events. The event’s start and end times can be specified as integer milliseconds since the epoch or as a string in ISO 8601 format. API name: events
func (*PostCalendarEvents) Header ¶
func (r *PostCalendarEvents) Header(key, value string) *PostCalendarEvents
Header set a key, value pair in the PostCalendarEvents headers map.
func (*PostCalendarEvents) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (PostCalendarEvents) Perform ¶ added in v8.7.0
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*PostCalendarEvents) Raw ¶
func (r *PostCalendarEvents) Raw(raw io.Reader) *PostCalendarEvents
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*PostCalendarEvents) Request ¶
func (r *PostCalendarEvents) Request(req *Request) *PostCalendarEvents
Request allows to set the request property with the appropriate payload.
type Request ¶
type Request struct { // Events A list of one of more scheduled events. The event’s start and end times can // be specified as integer milliseconds since the epoch or as a string in ISO // 8601 format. Events []types.CalendarEvent `json:"events"` }
Request holds the request body struct for the package postcalendarevents
type Response ¶ added in v8.7.0
type Response struct {
Events []types.CalendarEvent `json:"events"`
}