Documentation
¶
Index ¶
- func ClearDeviceAuthorization() error
- func Logout() error
- type Address
- type AddressChange
- type Addresses
- type AuthStatus
- type CancelOrderResult
- type Cart
- type CartItem
- type CartMutation
- type CheckoutLineItem
- type CheckoutReview
- type Client
- func (c *Client) AddToCartAtPriceFromURL(ctx context.Context, asin, displayedPrice, productURL string) (CartMutation, error)
- func (c *Client) Addresses(ctx context.Context) (Addresses, error)
- func (c *Client) AuthStatus(ctx context.Context) (AuthStatus, error)
- func (c *Client) CancelOrder(ctx context.Context, orderID, confirmation string) (CancelOrderResult, error)
- func (c *Client) Cart(ctx context.Context) (Cart, error)
- func (c *Client) CheckoutPreview(ctx context.Context, maxTotalCents int64) (CheckoutReview, error)
- func (c *Client) CheckoutPreviewWithTip(ctx context.Context, maxTotalCents, tipCents int64) (CheckoutReview, error)
- func (c *Client) Close() error
- func (c *Client) DeliverySlots(ctx context.Context) (DeliverySlots, error)
- func (c *Client) Doctor(ctx context.Context) (DoctorResult, error)
- func (c *Client) PlaceOrder(ctx context.Context, token, confirmation string, maxTotalCents int64) (PlaceOrderResult, error)
- func (c *Client) RecentOrders(ctx context.Context) (Orders, error)
- func (c *Client) RemoveFromCart(ctx context.Context, identifier string) (CartMutation, error)
- func (c *Client) Search(ctx context.Context, query string, limit int) (SearchResult, error)
- func (c *Client) SelectDeliverySlot(ctx context.Context, index int) (DeliverySlotChange, error)
- func (c *Client) SetCartQuantity(ctx context.Context, identifier string, quantity int) (CartMutation, error)
- func (c *Client) SetCheckoutTip(ctx context.Context, tipCents int64) (CheckoutReview, error)
- func (c *Client) SetSubstitution(ctx context.Context, identifier, policy string) (SubstitutionChange, error)
- func (c *Client) Substitutions(ctx context.Context) (Substitutions, error)
- func (c *Client) UseAddress(ctx context.Context, identifier string) (AddressChange, error)
- type DeliverySlot
- type DeliverySlotChange
- type DeliverySlots
- type DeviceAuthChallenge
- type DeviceAuthResult
- type DoctorResult
- type Order
- type Orders
- type PlaceOrderResult
- type Product
- type SearchResult
- type Substitution
- type SubstitutionChange
- type Substitutions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearDeviceAuthorization ¶
func ClearDeviceAuthorization() error
Types ¶
type AddressChange ¶
type AuthStatus ¶
type CancelOrderResult ¶
type CartMutation ¶
type CheckoutLineItem ¶
type CheckoutReview ¶
type CheckoutReview struct {
ItemCount int `json:"item_count"`
DeliveryAddress string `json:"delivery_address"`
DeliveryWindow string `json:"delivery_window"`
PaymentMethod string `json:"payment_method"`
OrderTotal string `json:"order_total"`
Breakdown []CheckoutLineItem `json:"breakdown"`
MaximumTotal string `json:"maximum_total"`
ConfirmationToken string `json:"confirmation_token"`
ExpiresAt string `json:"expires_at"`
// contains filtered or unexported fields
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddToCartAtPriceFromURL ¶
func (*Client) AuthStatus ¶
func (c *Client) AuthStatus(ctx context.Context) (AuthStatus, error)
func (*Client) CancelOrder ¶
func (*Client) CheckoutPreview ¶
func (*Client) CheckoutPreviewWithTip ¶
func (*Client) DeliverySlots ¶
func (c *Client) DeliverySlots(ctx context.Context) (DeliverySlots, error)
func (*Client) PlaceOrder ¶
func (*Client) RemoveFromCart ¶
func (*Client) Search ¶
Search reproduces the Fresh-scoped search navigation seen in HAR req_0464, req_0607, and req_0724. The random browser-only crid/ref parameters are not required for the server-side result page.
func (*Client) SelectDeliverySlot ¶
func (*Client) SetCartQuantity ¶
func (*Client) SetCheckoutTip ¶
func (*Client) SetSubstitution ¶
func (*Client) Substitutions ¶
func (c *Client) Substitutions(ctx context.Context) (Substitutions, error)
func (*Client) UseAddress ¶
type DeliverySlot ¶
type DeliverySlotChange ¶
type DeliverySlotChange struct {
OK bool `json:"ok"`
Slot DeliverySlot `json:"slot"`
}
type DeliverySlots ¶
type DeliverySlots struct {
Items []DeliverySlot `json:"items"`
// contains filtered or unexported fields
}
type DeviceAuthChallenge ¶
type DeviceAuthChallenge struct {
Status string `json:"status"`
Code string `json:"code"`
URL string `json:"url"`
ExpiresAt string `json:"expires_at"`
}
func StartDeviceAuthorization ¶
func StartDeviceAuthorization(ctx context.Context) (DeviceAuthChallenge, error)
type DeviceAuthResult ¶
type DeviceAuthResult struct {
Status string `json:"status"`
Authenticated bool `json:"authenticated"`
CookiesReplaced bool `json:"cookies_replaced,omitempty"`
CookieCount int `json:"cookie_count,omitempty"`
FreshVerified bool `json:"fresh_verified,omitempty"`
AuthStatus AuthStatus `json:"auth_status,omitempty"`
}
func CompleteDeviceAuthorization ¶
func CompleteDeviceAuthorization(ctx context.Context) (DeviceAuthResult, error)
func RefreshDeviceAuthorization ¶
func RefreshDeviceAuthorization(ctx context.Context) (DeviceAuthResult, error)
type DoctorResult ¶
type PlaceOrderResult ¶
type Product ¶
type Product struct {
ASIN string `json:"asin"`
Title string `json:"title"`
Price string `json:"price,omitempty"`
UnitPrice string `json:"unit_price,omitempty"`
Promotion string `json:"promotion,omitempty"`
Availability string `json:"availability,omitempty"`
InCart int `json:"in_cart,omitempty"`
URL string `json:"url"`
}
type SearchResult ¶
type Substitution ¶
type SubstitutionChange ¶
type SubstitutionChange struct {
OK bool `json:"ok"`
Item Substitution `json:"item"`
}
type Substitutions ¶
type Substitutions struct {
Items []Substitution `json:"items"`
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.