Documentation
¶
Index ¶
- func ParseID(s string) (int64, error)
- func SplitChoreInstanceID(choreID string) (baseID, instanceDate string)
- type APIError
- type Category
- type Chore
- type ChoreCompletion
- type ChoreCreate
- type ChoreFilter
- type ChoreUpdate
- type Client
- func (c *Client) ClaimChore(ctx context.Context, frameID int64, choreID string, categoryID int64) (*Chore, error)
- func (c *Client) CreateChore(ctx context.Context, frameID int64, in ChoreCreate) (*Chore, error)
- func (c *Client) CreateRewards(ctx context.Context, frameID int64, in RewardCreate) ([]Reward, error)
- func (c *Client) CreateUpForGrabsChore(ctx context.Context, frameID int64, in ChoreCreate) (*Chore, error)
- func (c *Client) DeleteChore(ctx context.Context, frameID, choreID int64, applyTo string) error
- func (c *Client) DeleteReward(ctx context.Context, frameID, rewardID int64) error
- func (c *Client) Do(ctx context.Context, method, path string, query url.Values, body any) ([]byte, error)
- func (c *Client) GetFrame(ctx context.Context, frameID int64) (*Frame, error)
- func (c *Client) GetUser(ctx context.Context) (*User, error)
- func (c *Client) ListCategories(ctx context.Context, frameID int64) ([]Category, error)
- func (c *Client) ListChores(ctx context.Context, frameID int64, f ChoreFilter) ([]Chore, error)
- func (c *Client) ListFrames(ctx context.Context) ([]Frame, error)
- func (c *Client) ListRewardPoints(ctx context.Context, frameID int64) ([]RewardPoint, error)
- func (c *Client) ListRewards(ctx context.Context, frameID int64) ([]Reward, error)
- func (c *Client) LoginOAuth(ctx context.Context, email, password, fingerprint string) (*OAuthTokenResponse, error)
- func (c *Client) RedeemReward(ctx context.Context, frameID, rewardID int64) error
- func (c *Client) RefreshOAuthToken(ctx context.Context, refreshToken, fingerprint string) (*OAuthTokenResponse, error)
- func (c *Client) SetChoreCompletion(ctx context.Context, frameID int64, choreID string, status string) (*Chore, error)
- func (c *Client) UnredeemReward(ctx context.Context, frameID, rewardID int64) error
- func (c *Client) UpdateChore(ctx context.Context, frameID int64, choreID string, in ChoreUpdate) (*Chore, error)
- func (c *Client) UpdateReward(ctx context.Context, frameID, rewardID int64, in RewardUpdate) (*Reward, error)
- type Frame
- type OAuthTokenResponse
- type Option
- type Reward
- type RewardCreate
- type RewardPoint
- type RewardUpdate
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitChoreInstanceID ¶
Types ¶
type Chore ¶
type Chore struct {
ID string `json:"id"`
Attributes struct {
Summary string `json:"summary"`
Description *string `json:"description"`
Status string `json:"status"`
Start string `json:"start"`
RecurrenceSet []string `json:"recurrence_set"`
RecurringUntil *string `json:"recurring_until"`
CompletedOn *string `json:"completed_on"`
RewardPoints *int `json:"reward_points"`
EmojiIcon *string `json:"emoji_icon"`
UpForGrabs bool `json:"up_for_grabs"`
Recurring bool `json:"recurring"`
Position int `json:"position"`
} `json:"attributes"`
Relationships struct {
Category struct {
Data *struct {
ID string `json:"id"`
} `json:"data"`
} `json:"category"`
} `json:"relationships"`
}
type ChoreCompletion ¶
type ChoreCreate ¶
type ChoreCreate struct {
Summary string `json:"summary"`
CategoryID int64 `json:"category_id,omitempty"`
Start string `json:"start"`
RecurrenceSet []string `json:"recurrence_set,omitempty"`
UpForGrabs bool `json:"up_for_grabs"`
RewardPoints *int `json:"reward_points,omitempty"`
Description string `json:"description,omitempty"`
EmojiIcon string `json:"emoji_icon,omitempty"`
}
type ChoreFilter ¶
type ChoreUpdate ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ClaimChore ¶
func (*Client) CreateChore ¶
func (*Client) CreateRewards ¶
func (c *Client) CreateRewards(ctx context.Context, frameID int64, in RewardCreate) ([]Reward, error)
CreateRewards creates one reward per category_id; Skylight returns the array.
func (*Client) CreateUpForGrabsChore ¶
func (*Client) DeleteChore ¶
func (*Client) DeleteReward ¶
func (*Client) ListCategories ¶
func (*Client) ListChores ¶
func (*Client) ListFrames ¶ added in v0.1.1
func (*Client) ListRewardPoints ¶
func (*Client) ListRewards ¶
func (*Client) LoginOAuth ¶
func (*Client) RedeemReward ¶
func (*Client) RefreshOAuthToken ¶
func (*Client) SetChoreCompletion ¶
func (*Client) UnredeemReward ¶
func (*Client) UpdateChore ¶
func (*Client) UpdateReward ¶
type Frame ¶
type Frame struct {
ID string `json:"id"`
Attributes struct {
Name string `json:"name"`
HouseholdName string `json:"household_name"`
Timezone string `json:"timezone"`
HardwareModel string `json:"hardware_model"`
Mine bool `json:"mine"`
Plus bool `json:"plus"`
Activated bool `json:"activated"`
} `json:"attributes"`
}
type OAuthTokenResponse ¶
type Option ¶
type Option func(*Client)
func WithAPIVersion ¶
func WithAuthScheme ¶
func WithDryRun ¶
func WithReadOnly ¶ added in v0.1.6
WithReadOnly makes Do refuse non-GET requests. This backstops the CLI-level command allowlist so --readonly cannot be bypassed by argv parsing drift.
func WithTimeout ¶
func WithUserAgent ¶
type Reward ¶
type Reward struct {
ID string `json:"id"`
Attributes struct {
Name string `json:"name"`
EmojiIcon *string `json:"emoji_icon"`
Description *string `json:"description"`
PointValue int `json:"point_value"`
RespawnOnRedemption bool `json:"respawn_on_redemption"`
RedeemedAt *string `json:"redeemed_at"`
} `json:"attributes"`
Relationships struct {
Category struct {
Data *struct {
ID string `json:"id"`
} `json:"data"`
} `json:"category"`
} `json:"relationships"`
}
type RewardCreate ¶
type RewardPoint ¶
type RewardUpdate ¶
Click to show internal directories.
Click to hide internal directories.