companies

package
v1.0.1-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

func NewHandler

func NewHandler(databaseWrite SQL.InterfaceWrite, databaseRead SQL.InterfaceRead,
	broker brokerLib.IBroker, appConfig app.IAppConfig) *Handler

func (*Handler) Create

func (h *Handler) Create(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description create company! @ID create-company @Accept json @Produce json @Param Company body account.Company true "company info" @Success 201 {object} http.Response{content=string} "CREATED" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies [post] @Security ApiKeyAuth

func (*Handler) Delete

func (h *Handler) Delete(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description delete company! @ID delete-company @Accept json @Produce json @Param companyID path string true "companyID of the company" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID} [delete] @Security ApiKeyAuth

func (*Handler) Get

func (h *Handler) Get(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description get company! @ID get-company @Accept json @Produce json @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID} [get] @Security ApiKeyAuth

func (*Handler) GetAccounts

func (h *Handler) GetAccounts(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description get all accounts in a company! @ID get-company-accounts @Accept json @Produce json @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/roles [get] @Security ApiKeyAuth

func (*Handler) InviteUser

func (h *Handler) InviteUser(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description invite user to company! @ID invite-user @Accept json @Produce json @Param InviteUser body account.InviteUser true "invite user info" @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 409 {object} http.Response{content=string} "CONFLICT" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/roles [post] @Security ApiKeyAuth

func (*Handler) List

func (h *Handler) List(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description list companies! @ID list-companies @Accept json @Produce json @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 401 {object} http.Response{content=string} "UNAUTHORIZED" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies [get] @Security ApiKeyAuth

func (*Handler) RemoveUser

func (h *Handler) RemoveUser(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description remove user from company! @ID remove-user @Accept json @Produce json @Param companyID path string true "companyID of the company" @Param accountID path string true "accountID of the account" @Success 204 {object} http.Response{content=string} "NO CONTENT" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 404 {object} http.Response{content=string} "NOT FOUND" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/roles/{accountID} [delete] @Security ApiKeyAuth

func (*Handler) Update

func (h *Handler) Update(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description update company! @ID update-company @Accept json @Produce json @Param Company body account.Company true "company info" @Param companyID path string true "companyID of the company" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID} [patch] @Security ApiKeyAuth

func (*Handler) UpdateAccountCompany

func (h *Handler) UpdateAccountCompany(w http.ResponseWriter, r *http.Request)

@Tags Companies @Description update account company! @ID update-account-company @Accept json @Produce json @Param AccountCompany body roles.AccountCompany true "account company info" @Param companyID path string true "companyID of the company" @Param accountID path string true "accountID of the account" @Success 200 {object} http.Response{content=string} "OK" @Failure 400 {object} http.Response{content=string} "BAD REQUEST" @Failure 500 {object} http.Response{content=string} "INTERNAL SERVER ERROR" @Router /api/companies/{companyID}/roles/{accountID} [patch] @Security ApiKeyAuth

Jump to

Keyboard shortcuts

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