resengo

package module
v0.0.0-...-e0e8395 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BaseURL = url.URL{
		Scheme: "https",
		Host:   "{{.api}}.resengo.com",
		Path:   "",
	}
)

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the Client response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. Client error responses are expected to have either no response body, or a json response body that maps to ErrorResponse. Any other response body will be silently ignored.

Types

type AccessTokenPathParams

type AccessTokenPathParams struct{}

func (AccessTokenPathParams) Params

func (pp AccessTokenPathParams) Params() map[string]string

type BookerSummary

type BookerSummary struct {
	PersonID    int    `json:"personId"`
	BookerName  string `json:"bookerName"`
	PhoneNumber string `json:"phoneNumber"`
	NoVisits    int    `json:"noVisits"`
	NoNoShows   int    `json:"noNoShows"`
	Email       string `json:"email"`
	Avatar      string `json:"avatar"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client manages communication with Exact Globe Client

func NewClient

func NewClient(httpClient *http.Client, companyID int, clientID string, clientSecret string) *Client

NewClient returns a new Exact Globe Client client

func (Client) BaseURL

func (c Client) BaseURL() url.URL

func (Client) Charset

func (c Client) Charset() string

func (Client) ClientID

func (c Client) ClientID() string

func (Client) ClientSecret

func (c Client) ClientSecret() string

func (Client) CompanyID

func (c Client) CompanyID() int

func (Client) Debug

func (c Client) Debug() bool

func (*Client) DefaultClient

func (c *Client) DefaultClient() *http.Client

func (*Client) Do

func (c *Client) Do(req *http.Request, responseBody interface{}) (*http.Response, error)

Do sends an Client request and returns the Client response. The Client response is json decoded and stored in the value pointed to by v, or returned as an error if an Client error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) GetEndpointURL

func (c *Client) GetEndpointURL(path string, pathParams PathParams) url.URL

func (Client) MediaType

func (c Client) MediaType() string

func (*Client) NewDeleteEventReservationsRequest

func (c *Client) NewDeleteEventReservationsRequest() DeleteEventReservationsRequest

func (*Client) NewGetEventReservationsRequest

func (c *Client) NewGetEventReservationsRequest() GetEventReservationsRequest

func (*Client) NewGetPersonsRequest

func (c *Client) NewGetPersonsRequest() GetPersonsRequest

func (*Client) NewPostEventReservationsRequest

func (c *Client) NewPostEventReservationsRequest() PostEventReservationsRequest

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, method string, URL url.URL, body interface{}) (*http.Request, error)

func (*Client) Scopes

func (c *Client) Scopes() []string

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL url.URL)

func (*Client) SetCharset

func (c *Client) SetCharset(charset string)

func (*Client) SetClientID

func (c *Client) SetClientID(ClientID string)

func (*Client) SetClientSecret

func (c *Client) SetClientSecret(ClientSecret string)

func (*Client) SetCompanyID

func (c *Client) SetCompanyID(companyID int)

func (*Client) SetDebug

func (c *Client) SetDebug(debug bool)

func (*Client) SetDisallowUnknownFields

func (c *Client) SetDisallowUnknownFields(disallowUnknownFields bool)

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client)

func (*Client) SetMediaType

func (c *Client) SetMediaType(mediaType string)

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(userAgent string)

func (*Client) Unmarshal

func (c *Client) Unmarshal(r io.Reader, vv ...interface{}) error

func (Client) UserAgent

func (c Client) UserAgent() string

type Date

type Date struct {
	time.Time
}

func (Date) IsEmpty

func (d Date) IsEmpty() bool

func (*Date) MarshalJSON

func (d *Date) MarshalJSON() ([]byte, error)

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(text []byte) (err error)

type DateTime

type DateTime struct {
	time.Time
}

func (DateTime) IsEmpty

func (d DateTime) IsEmpty() bool

func (*DateTime) MarshalJSON

func (d *DateTime) MarshalJSON() ([]byte, error)

func (DateTime) String

func (d DateTime) String() string

func (*DateTime) UnmarshalJSON

func (d *DateTime) UnmarshalJSON(text []byte) (err error)

type DeleteEventReservationsPathParams

type DeleteEventReservationsPathParams struct {
	EventReservationID int `schema:"eventreservation_id"`
}

func (*DeleteEventReservationsPathParams) Params

type DeleteEventReservationsQueryParams

type DeleteEventReservationsQueryParams struct{}

func (DeleteEventReservationsQueryParams) ToURLValues

type DeleteEventReservationsRequest

type DeleteEventReservationsRequest struct {
	// contains filtered or unexported fields
}

func (*DeleteEventReservationsRequest) Do

func (*DeleteEventReservationsRequest) Method

func (DeleteEventReservationsRequest) NewDeleteEventReservationsPathParams

func (r DeleteEventReservationsRequest) NewDeleteEventReservationsPathParams() *DeleteEventReservationsPathParams

func (DeleteEventReservationsRequest) NewDeleteEventReservationsQueryParams

func (r DeleteEventReservationsRequest) NewDeleteEventReservationsQueryParams() *DeleteEventReservationsQueryParams

func (DeleteEventReservationsRequest) NewDeleteEventReservationsRequestBody

func (r DeleteEventReservationsRequest) NewDeleteEventReservationsRequestBody() DeleteEventReservationsRequestBody

func (*DeleteEventReservationsRequest) NewResponseBody

func (*DeleteEventReservationsRequest) PathParams

func (*DeleteEventReservationsRequest) QueryParams

func (*DeleteEventReservationsRequest) RequestBody

func (*DeleteEventReservationsRequest) SetMethod

func (r *DeleteEventReservationsRequest) SetMethod(method string)

func (*DeleteEventReservationsRequest) SetRequestBody

func (*DeleteEventReservationsRequest) URL

type DeleteEventReservationsRequestBody

type DeleteEventReservationsRequestBody struct{}

type DeleteEventReservationsResponseBody

type DeleteEventReservationsResponseBody struct{}

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response `json:"-"`

	Errors  error  `json:"errors"`
	Type    string `json:"type"`
	Title   string `json:"title"`
	Status  int    `json:"status"`
	TraceID string `json:"traceId"`
}

func (ErrorResponse) Error

func (r ErrorResponse) Error() string

type Errors

type Errors struct {
	SMSReceptionStatus   []string `json:"smsReceptionStatus"`
	CommunicationStatus  []string `json:"communicationStatus"`
	EmailReceptionStatus []string `json:"emailReceptionStatus"`
}

func (Errors) Error

func (e Errors) Error() string

type EventReservation

type EventReservation struct {
	ID                          int           `json:"id"`
	CompanyID                   int           `json:"companyId,omitempty"`
	TimeZone                    string        `json:"timeZone"`
	StartTimeLocal              LocalTime     `json:"startTimeLocal"`
	EventCategoryID             int           `json:"eventCategoryId"`
	PartnerID                   int           `json:"partnerId"`
	NumberOfPersons             int           `json:"numberOfPersons"`
	StatusID                    int           `json:"statusId"`
	Index                       int           `json:"index"`
	EventID                     int           `json:"eventId"`
	ResourceIdsAreFixedChoice   bool          `json:"resourceIdsAreFixedChoice"`
	WaitingListPosition         int           `json:"waitingListPosition"`
	EndTimeLocal                LocalTime     `json:"endTimeLocal"`
	InternalRemark              string        `json:"internalRemark"`
	KitchenRemark               string        `json:"kitchenRemark"`
	Passage                     bool          `json:"passage"`
	LastGuestRemarkTreatDateUtc time.Time     `json:"lastGuestRemarkTreatDateUtc"`
	ExternalReservationID       string        `json:"externalReservationId"`
	CommunicationStatus         string        `json:"communicationStatus"`
	EmailReceptionStatus        string        `json:"emailReceptionStatus"`
	SMSReceptionStatus          string        `json:"smsReceptionStatus"`
	InsertDateUtc               time.Time     `json:"insertDateUtc"`
	UpdateDateUtc               time.Time     `json:"updateDateUtc"`
	GuestSummary                GuestSummary  `json:"guestSummary"`
	BookerSummary               BookerSummary `json:"bookerSummary"`
	GuestRemarks                GuestRemarks  `json:"guestRemarks"`
	Includes                    struct {
		Resources Resources `json:"resources"`
	} `json:"includes"`
	ManualAssignedResources bool `json:"manualAssignedResources"`
}

type EventReservations

type EventReservations []EventReservation

type GetEventReservationsPathParams

type GetEventReservationsPathParams struct {
}

func (*GetEventReservationsPathParams) Params

type GetEventReservationsQueryParams

type GetEventReservationsQueryParams struct {
	Page      int `schema:"Page,omitempty"`
	PageSize  int `schema:"PageSize,omitempty"`
	GuestName string
}

func (GetEventReservationsQueryParams) ToURLValues

func (p GetEventReservationsQueryParams) ToURLValues() (url.Values, error)

type GetEventReservationsRequest

type GetEventReservationsRequest struct {
	// contains filtered or unexported fields
}

func (*GetEventReservationsRequest) Do

func (*GetEventReservationsRequest) Method

func (r *GetEventReservationsRequest) Method() string

func (GetEventReservationsRequest) NewGetEventReservationsPathParams

func (r GetEventReservationsRequest) NewGetEventReservationsPathParams() *GetEventReservationsPathParams

func (GetEventReservationsRequest) NewGetEventReservationsQueryParams

func (r GetEventReservationsRequest) NewGetEventReservationsQueryParams() *GetEventReservationsQueryParams

func (GetEventReservationsRequest) NewGetEventReservationsRequestBody

func (r GetEventReservationsRequest) NewGetEventReservationsRequestBody() GetEventReservationsRequestBody

func (*GetEventReservationsRequest) NewResponseBody

func (*GetEventReservationsRequest) PathParams

func (*GetEventReservationsRequest) QueryParams

func (*GetEventReservationsRequest) RequestBody

func (*GetEventReservationsRequest) SetMethod

func (r *GetEventReservationsRequest) SetMethod(method string)

func (*GetEventReservationsRequest) SetRequestBody

func (*GetEventReservationsRequest) URL

type GetEventReservationsRequestBody

type GetEventReservationsRequestBody struct{}

type GetEventReservationsResponseBody

type GetEventReservationsResponseBody EventReservations

type GetPersonsPathParams

type GetPersonsPathParams struct {
}

func (*GetPersonsPathParams) Params

func (p *GetPersonsPathParams) Params() map[string]string

type GetPersonsQueryParams

type GetPersonsQueryParams struct {
	Page      int    `schema:"Page,omitempty"`
	PageSize  int    `schema:"PageSize,omitempty"`
	GuestName string `schema:"GuestName,omitempty"`
}

func (GetPersonsQueryParams) ToURLValues

func (p GetPersonsQueryParams) ToURLValues() (url.Values, error)

type GetPersonsRequest

type GetPersonsRequest struct {
	// contains filtered or unexported fields
}

func (*GetPersonsRequest) Do

func (*GetPersonsRequest) Method

func (r *GetPersonsRequest) Method() string

func (GetPersonsRequest) NewGetPersonsPathParams

func (r GetPersonsRequest) NewGetPersonsPathParams() *GetPersonsPathParams

func (GetPersonsRequest) NewGetPersonsQueryParams

func (r GetPersonsRequest) NewGetPersonsQueryParams() *GetPersonsQueryParams

func (GetPersonsRequest) NewGetPersonsRequestBody

func (r GetPersonsRequest) NewGetPersonsRequestBody() GetPersonsRequestBody

func (*GetPersonsRequest) NewResponseBody

func (r *GetPersonsRequest) NewResponseBody() *GetPersonsResponseBody

func (*GetPersonsRequest) PathParams

func (r *GetPersonsRequest) PathParams() *GetPersonsPathParams

func (*GetPersonsRequest) QueryParams

func (r *GetPersonsRequest) QueryParams() *GetPersonsQueryParams

func (*GetPersonsRequest) RequestBody

func (r *GetPersonsRequest) RequestBody() *GetPersonsRequestBody

func (*GetPersonsRequest) SetMethod

func (r *GetPersonsRequest) SetMethod(method string)

func (*GetPersonsRequest) SetRequestBody

func (r *GetPersonsRequest) SetRequestBody(body GetPersonsRequestBody)

func (*GetPersonsRequest) URL

func (r *GetPersonsRequest) URL() url.URL

type GetPersonsRequestBody

type GetPersonsRequestBody struct{}

type GetPersonsResponseBody

type GetPersonsResponseBody Persons

type GuestRemark

type GuestRemark struct {
	ID            int       `json:"id"`
	ReservationID int       `json:"reservationId"`
	PersonID      int       `json:"personId"`
	Owner         string    `json:"owner"`
	UpdateDateUtc time.Time `json:"updateDateUtc"`
	Remark        string    `json:"remark"`
}

type GuestRemarks

type GuestRemarks []GuestRemark

type GuestSummary

type GuestSummary struct {
	PersonID    int    `json:"personId,omitempty"`
	GuestName   string `json:"guestName"`
	PhoneNumber string `json:"phoneNumber"`
	NoVisits    int    `json:"noVisits"`
	NoNoShows   int    `json:"noNoShows"`
	Email       string `json:"email"`
	Avatar      string `json:"avatar"`
}

type LocalTime

type LocalTime struct {
	time.Time
}

func (LocalTime) IsEmpty

func (d LocalTime) IsEmpty() bool

func (*LocalTime) MarshalJSON

func (d *LocalTime) MarshalJSON() ([]byte, error)

func (LocalTime) String

func (d LocalTime) String() string

func (*LocalTime) UnmarshalJSON

func (d *LocalTime) UnmarshalJSON(text []byte) (err error)

type MetaInformation

type MetaInformation struct {
	TotalResources int `json:"@TotalResources"`
	TotalPages     int `json:"@TotalPages"`
	CurrentPage    int `json:"@CurrentPage"`
}

type Number

type Number float64

func (Number) MarshalJSON

func (i Number) MarshalJSON() ([]byte, error)

func (*Number) UnmarshalJSON

func (i *Number) UnmarshalJSON(data []byte) error

type PathParams

type PathParams interface {
	Params() map[string]string
}

type Person

type Person struct {
}

type Persons

type Persons []Person

type PostEventReservationsPathParams

type PostEventReservationsPathParams struct {
}

func (*PostEventReservationsPathParams) Params

type PostEventReservationsQueryParams

type PostEventReservationsQueryParams struct {
}

func (PostEventReservationsQueryParams) ToURLValues

func (p PostEventReservationsQueryParams) ToURLValues() (url.Values, error)

type PostEventReservationsRequest

type PostEventReservationsRequest struct {
	// contains filtered or unexported fields
}

func (*PostEventReservationsRequest) Do

func (*PostEventReservationsRequest) Method

func (PostEventReservationsRequest) NewPostEventReservationsPathParams

func (r PostEventReservationsRequest) NewPostEventReservationsPathParams() *PostEventReservationsPathParams

func (PostEventReservationsRequest) NewPostEventReservationsQueryParams

func (r PostEventReservationsRequest) NewPostEventReservationsQueryParams() *PostEventReservationsQueryParams

func (PostEventReservationsRequest) NewPostEventReservationsRequestBody

func (r PostEventReservationsRequest) NewPostEventReservationsRequestBody() PostEventReservationsRequestBody

func (*PostEventReservationsRequest) NewResponseBody

func (*PostEventReservationsRequest) PathParams

func (*PostEventReservationsRequest) QueryParams

func (*PostEventReservationsRequest) RequestBody

func (*PostEventReservationsRequest) SetMethod

func (r *PostEventReservationsRequest) SetMethod(method string)

func (*PostEventReservationsRequest) SetRequestBody

func (*PostEventReservationsRequest) URL

type PostEventReservationsRequestBody

type PostEventReservationsRequestBody EventReservation

type PostEventReservationsResponseBody

type PostEventReservationsResponseBody EventReservation

type RequestCompletionCallback

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type Resource

type Resource struct {
	ResourceID      int    `json:"resourceId"`
	ResourceName    string `json:"resourceName"`
	NumberOfPersons int    `json:"numberOfPersons"`
	Remark          string `json:"remark"`
}

type Resources

type Resources []Resource

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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