Documentation ¶
Index ¶
- Variables
- type APIError
- type Client
- func (c Client) StoreProperty(ctx context.Context, r StorePropertyReq) (*StorePropertyRes, error)
- func (c Client) With429Retry(retries int) Client
- func (c Client) WithBaseURL(host string) Client
- func (c Client) WithCredentials(key, secret string) Client
- func (c Client) WithLogger(ll httputil.LevelLogger) Client
- func (c Client) WithRateLimiter(rl *httputil.RateLimiter) Client
- func (c Client) WithSetHeader(k string, vals ...string) Client
- type ErrorResponse
- type Property
- type StorePropertyReq
- type StorePropertyRes
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStreetRequired = errors.New("missing street")
)
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) StoreProperty ¶
func (c Client) StoreProperty(ctx context.Context, r StorePropertyReq) (*StorePropertyRes, error)
StoreProperty attempts to store a property using the RPM API when the response code is >=400 you will get an ErrorResponse as the error
func (Client) With429Retry ¶
func (Client) WithBaseURL ¶
func (Client) WithCredentials ¶
func (Client) WithLogger ¶
func (c Client) WithLogger(ll httputil.LevelLogger) Client
func (Client) WithRateLimiter ¶
func (c Client) WithRateLimiter(rl *httputil.RateLimiter) Client
type ErrorResponse ¶
type ErrorResponse struct {
APIError APIError `json:"error"`
}
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
func (ErrorResponse) ErrorOrNil ¶
func (e ErrorResponse) ErrorOrNil() error
func (ErrorResponse) IsZero ¶
func (e ErrorResponse) IsZero() bool
type StorePropertyReq ¶
type StorePropertyReq struct { httputil.ReqHeaders `json:"-"` Property struct { ID string `json:"-"` // path arg Street string `json:"street"` City string `json:"city"` State string `json:"state"` Zip string `json:"zip"` } `json:"property"` }
func NewStorePropertyReq ¶
func NewStorePropertyReq(p Property) StorePropertyReq
func (StorePropertyReq) Path ¶
func (req StorePropertyReq) Path() httputil.Path
func (StorePropertyReq) Validate ¶
func (req StorePropertyReq) Validate() error
type StorePropertyRes ¶
type StorePropertyRes struct {
Property `json:"property"`
}
Click to show internal directories.
Click to hide internal directories.