client

package
v0.0.0-...-6fa130f Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCalendarPath

func CreateCalendarPath() string

CreateCalendarPath computes a request path to the create action of calendar.

func DeleteCalendarPath

func DeleteCalendarPath(id string) string

DeleteCalendarPath computes a request path to the delete action of calendar.

func EditCalendarPath

func EditCalendarPath(id string) string

EditCalendarPath computes a request path to the edit action of calendar.

func ListCalendarPath

func ListCalendarPath() string

ListCalendarPath computes a request path to the list action of calendar.

func LoginAuthPath

func LoginAuthPath() string

LoginAuthPath computes a request path to the login action of auth.

func ResetAuthPath

func ResetAuthPath() string

ResetAuthPath computes a request path to the reset action of auth.

func ShowCalendarPath

func ShowCalendarPath(id string) string

ShowCalendarPath computes a request path to the show action of calendar.

Types

type Appointment

type Appointment struct {
	// The email of who's requesting it
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
	// Internal notes about the Appointment
	Notes *string `form:"notes,omitempty" json:"notes,omitempty" xml:"notes,omitempty"`
	// The phone of the client
	Phone *string `form:"phone,omitempty" json:"phone,omitempty" xml:"phone,omitempty"`
	// Option specifying that the work is problematic for some reason
	Problematic bool `form:"problematic" json:"problematic" xml:"problematic"`
	// Option to send email to the client
	SendEmail bool `form:"send_email" json:"send_email" xml:"send_email"`
	// Option to send sms to the client
	SendSms bool `form:"send_sms" json:"send_sms" xml:"send_sms"`
	// The status of the work. Can be one of todo/doing/done
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Option specifying that the work is to be done now
	Urgent bool `form:"urgent" json:"urgent" xml:"urgent"`
	// What is the purpose of the appointment
	What string `form:"what" json:"what" xml:"what"`
	// When is the appointment scheduled
	When time.Time `form:"when" json:"when" xml:"when"`
	// Where is the appointment scheduled
	Where string `form:"where" json:"where" xml:"where"`
	// Who is requesting the appointment
	Who string `form:"who" json:"who" xml:"who"`
}

Appointment user type.

func (*Appointment) Validate

func (ut *Appointment) Validate() (err error)

Validate validates the Appointment type instance.

type Client

type Client struct {
	*goaclient.Client
	JWTSigner goaclient.Signer
	Encoder   *goa.HTTPEncoder
	Decoder   *goa.HTTPDecoder
}

Client is the mara service client.

func New

func New(c goaclient.Doer) *Client

New instantiates the client.

func (*Client) CreateCalendar

func (c *Client) CreateCalendar(ctx context.Context, path string, payload *CreateCalendarPayload, contentType string) (*http.Response, error)

create a new appointment

func (*Client) DecodeMaraAppointment

func (c *Client) DecodeMaraAppointment(resp *http.Response) (*MaraAppointment, error)

DecodeMaraAppointment decodes the MaraAppointment instance encoded in resp body.

func (*Client) DecodeMaraAppointmentCollection

func (c *Client) DecodeMaraAppointmentCollection(resp *http.Response) (MaraAppointmentCollection, error)

DecodeMaraAppointmentCollection decodes the MaraAppointmentCollection instance encoded in resp body.

func (*Client) DecodeMaraToken

func (c *Client) DecodeMaraToken(resp *http.Response) (*MaraToken, error)

DecodeMaraToken decodes the MaraToken instance encoded in resp body.

func (*Client) DeleteCalendar

func (c *Client) DeleteCalendar(ctx context.Context, path string) (*http.Response, error)

deletes a single appointment

func (*Client) EditCalendar

func (c *Client) EditCalendar(ctx context.Context, path string, payload *EditCalendarPayload, contentType string) (*http.Response, error)

change properties of a single appointment

func (*Client) ListCalendar

func (c *Client) ListCalendar(ctx context.Context, path string) (*http.Response, error)

show a list of appointments for the selected week

func (*Client) LoginAuth

func (c *Client) LoginAuth(ctx context.Context, path string, payload *LoginAuthPayload, contentType string) (*http.Response, error)

Login with username and password and obtain a token

func (*Client) NewCreateCalendarRequest

func (c *Client) NewCreateCalendarRequest(ctx context.Context, path string, payload *CreateCalendarPayload, contentType string) (*http.Request, error)

NewCreateCalendarRequest create the request corresponding to the create action endpoint of the calendar resource.

func (*Client) NewDeleteCalendarRequest

func (c *Client) NewDeleteCalendarRequest(ctx context.Context, path string) (*http.Request, error)

NewDeleteCalendarRequest create the request corresponding to the delete action endpoint of the calendar resource.

func (*Client) NewEditCalendarRequest

func (c *Client) NewEditCalendarRequest(ctx context.Context, path string, payload *EditCalendarPayload, contentType string) (*http.Request, error)

NewEditCalendarRequest create the request corresponding to the edit action endpoint of the calendar resource.

func (*Client) NewListCalendarRequest

func (c *Client) NewListCalendarRequest(ctx context.Context, path string) (*http.Request, error)

NewListCalendarRequest create the request corresponding to the list action endpoint of the calendar resource.

func (*Client) NewLoginAuthRequest

func (c *Client) NewLoginAuthRequest(ctx context.Context, path string, payload *LoginAuthPayload, contentType string) (*http.Request, error)

NewLoginAuthRequest create the request corresponding to the login action endpoint of the auth resource.

func (*Client) NewResetAuthRequest

func (c *Client) NewResetAuthRequest(ctx context.Context, path string, payload *ResetAuthPayload, contentType string) (*http.Request, error)

NewResetAuthRequest create the request corresponding to the reset action endpoint of the auth resource.

func (*Client) NewShowCalendarRequest

func (c *Client) NewShowCalendarRequest(ctx context.Context, path string) (*http.Request, error)

NewShowCalendarRequest create the request corresponding to the show action endpoint of the calendar resource.

func (*Client) ResetAuth

func (c *Client) ResetAuth(ctx context.Context, path string, payload *ResetAuthPayload, contentType string) (*http.Response, error)

Send a new password to the email specified

func (*Client) SetJWTSigner

func (c *Client) SetJWTSigner(signer goaclient.Signer)

SetJWTSigner sets the request signer for the jwt security scheme.

func (*Client) ShowCalendar

func (c *Client) ShowCalendar(ctx context.Context, path string) (*http.Response, error)

show the details of a single appointment

type CreateCalendarPayload

type CreateCalendarPayload struct {
	// The email of who's requesting it
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
	// Internal notes about the Appointment
	Notes *string `form:"notes,omitempty" json:"notes,omitempty" xml:"notes,omitempty"`
	// The phone of the client
	Phone *string `form:"phone,omitempty" json:"phone,omitempty" xml:"phone,omitempty"`
	// Option specifying that the work is problematic for some reason
	Problematic bool `form:"problematic" json:"problematic" xml:"problematic"`
	// Option to send email to the client
	SendEmail bool `form:"send_email" json:"send_email" xml:"send_email"`
	// Option to send sms to the client
	SendSms bool `form:"send_sms" json:"send_sms" xml:"send_sms"`
	// The status of the work. Can be one of todo/doing/done
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Option specifying that the work is to be done now
	Urgent bool `form:"urgent" json:"urgent" xml:"urgent"`
	// What is the purpose of the appointment
	What string `form:"what" json:"what" xml:"what"`
	// When is the appointment scheduled
	When time.Time `form:"when" json:"when" xml:"when"`
	// Where is the appointment scheduled
	Where string `form:"where" json:"where" xml:"where"`
	// Who is requesting the appointment
	Who string `form:"who" json:"who" xml:"who"`
}

CreateCalendarPayload is the calendar create action payload.

type EditCalendarPayload

type EditCalendarPayload struct {
	// The email of who's requesting it
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
	// Internal notes about the Appointment
	Notes *string `form:"notes,omitempty" json:"notes,omitempty" xml:"notes,omitempty"`
	// The phone of the client
	Phone *string `form:"phone,omitempty" json:"phone,omitempty" xml:"phone,omitempty"`
	// Option specifying that the work is problematic for some reason
	Problematic bool `form:"problematic" json:"problematic" xml:"problematic"`
	// Option to send email to the client
	SendEmail bool `form:"send_email" json:"send_email" xml:"send_email"`
	// Option to send sms to the client
	SendSms bool `form:"send_sms" json:"send_sms" xml:"send_sms"`
	// The status of the work. Can be one of todo/doing/done
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Option specifying that the work is to be done now
	Urgent bool `form:"urgent" json:"urgent" xml:"urgent"`
	// What is the purpose of the appointment
	What string `form:"what" json:"what" xml:"what"`
	// When is the appointment scheduled
	When time.Time `form:"when" json:"when" xml:"when"`
	// Where is the appointment scheduled
	Where string `form:"where" json:"where" xml:"where"`
	// Who is requesting the appointment
	Who string `form:"who" json:"who" xml:"who"`
}

EditCalendarPayload is the calendar edit action payload.

type Login

type Login struct {
	// The password
	Password *string `form:"password,omitempty" json:"password,omitempty" xml:"password,omitempty"`
	// The username
	User *string `form:"user,omitempty" json:"user,omitempty" xml:"user,omitempty"`
}

Login user type.

type LoginAuthPayload

type LoginAuthPayload struct {
	// The password
	Password *string `form:"password,omitempty" json:"password,omitempty" xml:"password,omitempty"`
	// The username
	User *string `form:"user,omitempty" json:"user,omitempty" xml:"user,omitempty"`
}

LoginAuthPayload is the auth login action payload.

type MaraAppointment

type MaraAppointment struct {
	// The email of who's requesting it
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
	// The url of the appointment
	Href *string `form:"href,omitempty" json:"href,omitempty" xml:"href,omitempty"`
	// The id of the appointment
	ID *uuid.UUID `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Internal notes about the Appointment
	Notes *string `form:"notes,omitempty" json:"notes,omitempty" xml:"notes,omitempty"`
	// The phone of the client
	Phone *string `form:"phone,omitempty" json:"phone,omitempty" xml:"phone,omitempty"`
	// Option specifying that the work is problematic for some reason
	Problematic bool `form:"problematic" json:"problematic" xml:"problematic"`
	// Option to send email to the client
	SendEmail bool `form:"send_email" json:"send_email" xml:"send_email"`
	// Option to send sms to the client
	SendSms bool `form:"send_sms" json:"send_sms" xml:"send_sms"`
	// The status of the work. Can be one of todo/doing/done
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Option specifying that the work is to be done now
	Urgent bool `form:"urgent" json:"urgent" xml:"urgent"`
	// What is the purpose of the appointment
	What *string `form:"what,omitempty" json:"what,omitempty" xml:"what,omitempty"`
	// When is the appointment scheduled
	When *time.Time `form:"when,omitempty" json:"when,omitempty" xml:"when,omitempty"`
	// Where is the appointment scheduled
	Where *string `form:"where,omitempty" json:"where,omitempty" xml:"where,omitempty"`
	// Who is requesting the appointment
	Who *string `form:"who,omitempty" json:"who,omitempty" xml:"who,omitempty"`
}

MaraAppointment media type (default view)

Identifier: application/vnd.mara.appointment

func (*MaraAppointment) Validate

func (mt *MaraAppointment) Validate() (err error)

Validate validates the MaraAppointment media type instance.

type MaraAppointmentCollection

type MaraAppointmentCollection []*MaraAppointment

MaraAppointmentCollection is the media type for an array of MaraAppointment (default view)

Identifier: application/vnd.mara.appointment; type=collection

func (MaraAppointmentCollection) Validate

func (mt MaraAppointmentCollection) Validate() (err error)

Validate validates the MaraAppointmentCollection media type instance.

type MaraToken

type MaraToken struct {
	// The token to use in subsequent api calls
	Token *string `form:"token,omitempty" json:"token,omitempty" xml:"token,omitempty"`
}

MaraToken media type (default view)

Identifier: application/vnd.mara.token

type Reset

type Reset struct {
	// The email that will receive the new password
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
}

Reset user type.

func (*Reset) Validate

func (ut *Reset) Validate() (err error)

Validate validates the Reset type instance.

type ResetAuthPayload

type ResetAuthPayload struct {
	// The email that will receive the new password
	Email *string `form:"email,omitempty" json:"email,omitempty" xml:"email,omitempty"`
}

ResetAuthPayload is the auth reset action payload.

Jump to

Keyboard shortcuts

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