objects

package
v0.0.0-...-739355d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MaxListLimit = 200

MaxListLimit holds the maximum number of listings.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelRequest

type CancelRequest struct {
	ID string `json:"id"`
}

CancelRequest is for canceling an existing Event.

type CreateRequest

type CreateRequest struct {
	Event *Event `json:"event"`
}

CreateRequest is for creating a new Event.

type DeleteRequest

type DeleteRequest struct {
	ID string `json:"id"`
}

DeleteRequest is for deleting an existing Event.

type Event

type Event struct {
	ID string `gorm:"primary_key" json:"id,omitempty"`

	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Website     string `json:"website,omitempty"`
	Address     string `json:"address,omitempty"`
	PhoneNumber string `json:"phone-number,omitempty"`

	TimeSlot *TimeSlot `gorm:"embedded" json:"time-slot,omitempty"`

	Status EventStatus `json:"status,omitempty"`

	CreatedAt     time.Time `json:"created-at,omitempty"`
	UpdatedAt     time.Time `json:"updated-at,omitempty"`
	CanceledAt    time.Time `json:"canceled-at,omitempty"`
	RescheduledAt time.Time `json:"rescheduled-at,omitempty"`
}

Event object for the API.

type EventResponse

type EventResponse struct {
	Event  *Event   `json:"event,omitempty"`
	Events []*Event `json:"events,omitempty"`
	Code   int      `json:"-"`
}

EventResponse holds the response to any event request.

func (*EventResponse) Json

func (e *EventResponse) Json() []byte

func (*EventResponse) StatusCode

func (e *EventResponse) StatusCode() int

StatusCode returns the HTTP status code of an EventResponse.

type EventStatus

type EventStatus string

EventStatus holds the status of the event.

const (
	Original    EventStatus = "original"
	Canceled    EventStatus = "canceled"
	Rescheduled EventStatus = "rescheduled"
)

Default event statuses.

type GetRequest

type GetRequest struct {
	ID string `json:"id"`
}

GetRequest is for retrieving a single Event.

type ListRequest

type ListRequest struct {
	Limit int    `json:"limit"`
	After string `json:"after"` // for paging
	Name  string `json:"name"`  // optional name matching
}

ListRequest is for getting a list of Events.

type RescheduleRequest

type RescheduleRequest struct {
	ID          string    `json:"id"`
	NewTimeSlot *TimeSlot `json:"new-time-slot"`
}

RescheduleRequest is for rescheduling an existing Event.

type TimeSlot

type TimeSlot struct {
	Start time.Time `json:"start,omitempty"`
	End   time.Time `json:"end,omitempty"`
}

TimeSlot holds the start and end times for the event.

type UpdateRequest

type UpdateRequest struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Website     string `json:"website"`
	Address     string `json:"address"`
	PhoneNumber string `json:"phone-number"`
}

UpdateRequest is for updating an existing Event.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL