Documentation ¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
Index ¶
- Constants
- Variables
- func FromPhones(in ...Phone) []entity.Phone
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type AddPropertyJSONRequestBody
- type AddTenantJSONRequestBody
- type Address
- type ChiServerOptions
- type Date
- type Error
- type ErrorResponse
- type GetLeaseRes
- type GetPropertyRes
- type GetTenantRes
- type InvalidParamFormatError
- type Lease
- type LeaseList
- type LeasePropertyJSONRequestBody
- type LeasePropertyReq
- type LeaseRentInterval
- type ListPropertiesParams
- type ListPropertiesRes
- type MiddlewareFunc
- type MinLease
- type MinLeaseRentInterval
- type MinTenant
- type Phone
- type Property
- type PropertyFilter
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) AddProperty(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) AddTenant(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteProperty(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetLease(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetPropertyById(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetTenant(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) LeaseProperty(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListLeases(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListProperties(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListTenants(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StoreProperty(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) StoreTenant(w http.ResponseWriter, r *http.Request)
- type StorePropertyJSONRequestBody
- type StorePropertyReq
- type StorePropertyRes
- type StoreTenantJSONRequestBody
- type StoreTenantReq
- type StoreTenantRes
- type Tenant
- type TenantList
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type Unimplemented
- func (_ Unimplemented) AddProperty(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) AddTenant(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) DeleteProperty(w http.ResponseWriter, r *http.Request, propertyID string)
- func (_ Unimplemented) GetLease(w http.ResponseWriter, r *http.Request, leaseID string)
- func (_ Unimplemented) GetPropertyById(w http.ResponseWriter, r *http.Request, propertyID string)
- func (_ Unimplemented) GetTenant(w http.ResponseWriter, r *http.Request, tenantID string)
- func (_ Unimplemented) LeaseProperty(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListLeases(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) ListProperties(w http.ResponseWriter, r *http.Request, params ListPropertiesParams)
- func (_ Unimplemented) ListTenants(w http.ResponseWriter, r *http.Request)
- func (_ Unimplemented) StoreProperty(w http.ResponseWriter, r *http.Request, propertyID string)
- func (_ Unimplemented) StoreTenant(w http.ResponseWriter, r *http.Request, tenantID string)
- type UnmarshalingParamError
Constants ¶
const ( KeyScopes = "key.Scopes" SecretScopes = "secret.Scopes" )
Variables ¶
var (
NewStorePropertyRes = NewGetPropertyRes
)
Functions ¶
func FromPhones ¶
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type AddPropertyJSONRequestBody ¶
type AddPropertyJSONRequestBody = StorePropertyReq
AddPropertyJSONRequestBody defines body for AddProperty for application/json ContentType.
type AddTenantJSONRequestBody ¶
type AddTenantJSONRequestBody = StoreTenantReq
AddTenantJSONRequestBody defines body for AddTenant for application/json ContentType.
type Address ¶
type Address struct { City string `json:"city"` State string `json:"state"` Street string `json:"street"` Zip string `json:"zip"` }
Address defines model for Address.
func (*Address) ToProperty ¶
type ChiServerOptions ¶
type ChiServerOptions struct { BaseURL string BaseRouter chi.Router Middlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
type Error ¶
type Error struct { Code int32 `json:"code"` Message string `json:"message"` Type string `json:"type"` }
Error defines model for Error.
type ErrorResponse ¶
type ErrorResponse struct {
Error Error `json:"error"`
}
ErrorResponse defines model for ErrorResponse.
type GetLeaseRes ¶
type GetLeaseRes struct {
Lease Lease `json:"lease"`
}
GetLeaseRes defines model for GetLeaseRes.
type GetPropertyRes ¶
type GetPropertyRes struct {
Property Property `json:"property"`
}
GetPropertyRes defines model for GetPropertyRes.
func NewGetPropertyRes ¶
func NewGetPropertyRes(in entity.Property) GetPropertyRes
type GetTenantRes ¶
type GetTenantRes struct {
Tenant Tenant `json:"tenant"`
}
GetTenantRes defines model for GetTenantRes.
func NewGetTenantRes ¶
func NewGetTenantRes(in entity.Tenant) GetTenantRes
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Lease ¶
type Lease struct { // Currency will default to USD when empty Currency string `json:"currency"` Deposit int `json:"deposit"` EndDate openapi_types.Date `json:"endDate"` Id string `json:"id"` PropertyID string `json:"propertyID"` RentAmount *int `json:"rentAmount,omitempty"` RentInterval LeaseRentInterval `json:"rentInterval"` StartDate openapi_types.Date `json:"startDate"` TenantIDs *[]string `json:"tenantIDs,omitempty"` }
Lease defines model for Lease.
type LeaseList ¶
type LeaseList struct {
Leases []Lease `json:"leases"`
}
LeaseList defines model for LeaseList.
type LeasePropertyJSONRequestBody ¶
type LeasePropertyJSONRequestBody = LeasePropertyReq
LeasePropertyJSONRequestBody defines body for LeaseProperty for application/json ContentType.
type LeasePropertyReq ¶
type LeasePropertyReq struct {
Lease MinLease `json:"lease"`
}
LeasePropertyReq defines model for LeasePropertyReq.
type LeaseRentInterval ¶
type LeaseRentInterval string
LeaseRentInterval defines model for Lease.RentInterval.
const ( LeaseRentIntervalDaily LeaseRentInterval = "daily" LeaseRentIntervalMonthly LeaseRentInterval = "monthly" LeaseRentIntervalWeekly LeaseRentInterval = "weekly" )
Defines values for LeaseRentInterval.
type ListPropertiesParams ¶
type ListPropertiesParams struct { // Search This will search the address for any substring. Search *string `form:"search,omitempty" json:"search,omitempty"` }
ListPropertiesParams defines parameters for ListProperties.
func (*ListPropertiesParams) ToFilter ¶
func (x *ListPropertiesParams) ToFilter() usecase.PropertyFilter
type ListPropertiesRes ¶
type ListPropertiesRes struct { Filter *PropertyFilter `json:"filter,omitempty"` Properties []Property `json:"properties"` }
ListPropertiesRes defines model for ListPropertiesRes.
func NewListPropertiesRes ¶
func NewListPropertiesRes(in ...entity.Property) ListPropertiesRes
func (*ListPropertiesRes) ToProperties ¶
func (x *ListPropertiesRes) ToProperties() []entity.Property
type MinLease ¶
type MinLease struct { // Currency will default to USD when empty Currency string `json:"currency"` Deposit int `json:"deposit"` EndDate openapi_types.Date `json:"endDate"` PropertyID string `json:"propertyID"` RentAmount *int `json:"rentAmount,omitempty"` RentInterval MinLeaseRentInterval `json:"rentInterval"` StartDate openapi_types.Date `json:"startDate"` TenantIDs *[]string `json:"tenantIDs,omitempty"` }
MinLease defines model for MinLease.
type MinLeaseRentInterval ¶
type MinLeaseRentInterval string
MinLeaseRentInterval defines model for MinLease.RentInterval.
const ( MinLeaseRentIntervalDaily MinLeaseRentInterval = "daily" MinLeaseRentIntervalMonthly MinLeaseRentInterval = "monthly" MinLeaseRentIntervalWeekly MinLeaseRentInterval = "weekly" )
Defines values for MinLeaseRentInterval.
type MinTenant ¶
type MinTenant struct { DlNum string `json:"dlNum"` DlState string `json:"dlState"` Dob openapi_types.Date `json:"dob"` FullName string `json:"fullName"` Phones []Phone `json:"phones"` }
MinTenant defines model for MinTenant.
type Property ¶
type Property struct { City string `json:"city"` Id string `json:"id"` State string `json:"state"` Street string `json:"street"` Zip string `json:"zip"` }
Property defines model for Property.
func ToProperty ¶
func (*Property) ToProperty ¶
type PropertyFilter ¶
type PropertyFilter struct {
Search *string `json:"search,omitempty"`
}
PropertyFilter defines model for PropertyFilter.
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ServerInterface ¶
type ServerInterface interface { // List leases // (GET /lease) ListLeases(w http.ResponseWriter, r *http.Request) // Lease property // (POST /lease) LeaseProperty(w http.ResponseWriter, r *http.Request) // Get Lease // (GET /lease/{leaseID}) GetLease(w http.ResponseWriter, r *http.Request, leaseID string) // List properties // (GET /property) ListProperties(w http.ResponseWriter, r *http.Request, params ListPropertiesParams) // Add Property // (POST /property) AddProperty(w http.ResponseWriter, r *http.Request) // Deletes a property // (DELETE /property/{propertyID}) DeleteProperty(w http.ResponseWriter, r *http.Request, propertyID string) // Find property by ID // (GET /property/{propertyID}) GetPropertyById(w http.ResponseWriter, r *http.Request, propertyID string) // Store Property // (PUT /property/{propertyID}) StoreProperty(w http.ResponseWriter, r *http.Request, propertyID string) // List Tenants // (GET /tenant) ListTenants(w http.ResponseWriter, r *http.Request) // Add Tenant // (POST /tenant) AddTenant(w http.ResponseWriter, r *http.Request) // Get Tenant // (GET /tenant/{tenantID}) GetTenant(w http.ResponseWriter, r *http.Request, tenantID string) // Store Tenant // (PUT /tenant/{tenantID}) StoreTenant(w http.ResponseWriter, r *http.Request, tenantID string) }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct { Handler ServerInterface HandlerMiddlewares []MiddlewareFunc ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error) }
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) AddProperty ¶
func (siw *ServerInterfaceWrapper) AddProperty(w http.ResponseWriter, r *http.Request)
AddProperty operation middleware
func (*ServerInterfaceWrapper) AddTenant ¶
func (siw *ServerInterfaceWrapper) AddTenant(w http.ResponseWriter, r *http.Request)
AddTenant operation middleware
func (*ServerInterfaceWrapper) DeleteProperty ¶
func (siw *ServerInterfaceWrapper) DeleteProperty(w http.ResponseWriter, r *http.Request)
DeleteProperty operation middleware
func (*ServerInterfaceWrapper) GetLease ¶
func (siw *ServerInterfaceWrapper) GetLease(w http.ResponseWriter, r *http.Request)
GetLease operation middleware
func (*ServerInterfaceWrapper) GetPropertyById ¶
func (siw *ServerInterfaceWrapper) GetPropertyById(w http.ResponseWriter, r *http.Request)
GetPropertyById operation middleware
func (*ServerInterfaceWrapper) GetTenant ¶
func (siw *ServerInterfaceWrapper) GetTenant(w http.ResponseWriter, r *http.Request)
GetTenant operation middleware
func (*ServerInterfaceWrapper) LeaseProperty ¶
func (siw *ServerInterfaceWrapper) LeaseProperty(w http.ResponseWriter, r *http.Request)
LeaseProperty operation middleware
func (*ServerInterfaceWrapper) ListLeases ¶
func (siw *ServerInterfaceWrapper) ListLeases(w http.ResponseWriter, r *http.Request)
ListLeases operation middleware
func (*ServerInterfaceWrapper) ListProperties ¶
func (siw *ServerInterfaceWrapper) ListProperties(w http.ResponseWriter, r *http.Request)
ListProperties operation middleware
func (*ServerInterfaceWrapper) ListTenants ¶
func (siw *ServerInterfaceWrapper) ListTenants(w http.ResponseWriter, r *http.Request)
ListTenants operation middleware
func (*ServerInterfaceWrapper) StoreProperty ¶
func (siw *ServerInterfaceWrapper) StoreProperty(w http.ResponseWriter, r *http.Request)
StoreProperty operation middleware
func (*ServerInterfaceWrapper) StoreTenant ¶
func (siw *ServerInterfaceWrapper) StoreTenant(w http.ResponseWriter, r *http.Request)
StoreTenant operation middleware
type StorePropertyJSONRequestBody ¶
type StorePropertyJSONRequestBody = StorePropertyReq
StorePropertyJSONRequestBody defines body for StoreProperty for application/json ContentType.
type StorePropertyReq ¶
type StorePropertyReq struct {
Property Address `json:"property"`
}
StorePropertyReq defines model for StorePropertyReq.
func NewStorePropertyReq ¶
func NewStorePropertyReq(p entity.Property) *StorePropertyReq
func (*StorePropertyReq) ToProperty ¶
func (x *StorePropertyReq) ToProperty() entity.Property
type StorePropertyRes ¶
type StorePropertyRes = GetPropertyRes
type StoreTenantJSONRequestBody ¶
type StoreTenantJSONRequestBody = StoreTenantReq
StoreTenantJSONRequestBody defines body for StoreTenant for application/json ContentType.
type StoreTenantReq ¶
type StoreTenantReq struct {
Tenant MinTenant `json:"tenant"`
}
StoreTenantReq defines model for StoreTenantReq.
func NewStoreTenantReq ¶
func NewStoreTenantReq(in entity.Tenant) *StoreTenantReq
func (*StoreTenantReq) JSON ¶
func (x *StoreTenantReq) JSON() []byte
type StoreTenantRes ¶
type StoreTenantRes = GetTenantRes
type Tenant ¶
type Tenant struct { DlNum string `json:"dlNum"` DlState string `json:"dlState"` Dob openapi_types.Date `json:"dob"` FullName string `json:"fullName"` Id string `json:"id"` Phones []Phone `json:"phones"` }
Tenant defines model for Tenant.
type TenantList ¶
type TenantList struct {
Tenants []Tenant `json:"tenants"`
}
TenantList defines model for TenantList.
func ToTenantList ¶
func ToTenantList(in ...entity.Tenant) TenantList
func (TenantList) ToTenantMap ¶
func (x TenantList) ToTenantMap() map[entity.ID]entity.Tenant
func (TenantList) ToTenants ¶
func (x TenantList) ToTenants() []entity.Tenant
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) AddProperty ¶
func (_ Unimplemented) AddProperty(w http.ResponseWriter, r *http.Request)
Add Property (POST /property)
func (Unimplemented) AddTenant ¶
func (_ Unimplemented) AddTenant(w http.ResponseWriter, r *http.Request)
Add Tenant (POST /tenant)
func (Unimplemented) DeleteProperty ¶
func (_ Unimplemented) DeleteProperty(w http.ResponseWriter, r *http.Request, propertyID string)
Deletes a property (DELETE /property/{propertyID})
func (Unimplemented) GetLease ¶
func (_ Unimplemented) GetLease(w http.ResponseWriter, r *http.Request, leaseID string)
Get Lease (GET /lease/{leaseID})
func (Unimplemented) GetPropertyById ¶
func (_ Unimplemented) GetPropertyById(w http.ResponseWriter, r *http.Request, propertyID string)
Find property by ID (GET /property/{propertyID})
func (Unimplemented) GetTenant ¶
func (_ Unimplemented) GetTenant(w http.ResponseWriter, r *http.Request, tenantID string)
Get Tenant (GET /tenant/{tenantID})
func (Unimplemented) LeaseProperty ¶
func (_ Unimplemented) LeaseProperty(w http.ResponseWriter, r *http.Request)
Lease property (POST /lease)
func (Unimplemented) ListLeases ¶
func (_ Unimplemented) ListLeases(w http.ResponseWriter, r *http.Request)
List leases (GET /lease)
func (Unimplemented) ListProperties ¶
func (_ Unimplemented) ListProperties(w http.ResponseWriter, r *http.Request, params ListPropertiesParams)
List properties (GET /property)
func (Unimplemented) ListTenants ¶
func (_ Unimplemented) ListTenants(w http.ResponseWriter, r *http.Request)
List Tenants (GET /tenant)
func (Unimplemented) StoreProperty ¶
func (_ Unimplemented) StoreProperty(w http.ResponseWriter, r *http.Request, propertyID string)
Store Property (PUT /property/{propertyID})
func (Unimplemented) StoreTenant ¶
func (_ Unimplemented) StoreTenant(w http.ResponseWriter, r *http.Request, tenantID string)
Store Tenant (PUT /tenant/{tenantID})
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error