api

package
v1.1.25 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientApi *http.Client = &http.Client{
	Transport: &http.Transport{
		MaxIdleConnsPerHost: 5,
	},
	Timeout: 30 * time.Second,
}

Functions

func CreateFormFile

func CreateFormFile(w *multipart.Writer, name string, filename string) (io.Writer, error)

Types

type AccountBalance added in v1.0.2

type AccountBalance struct {
	BalanceStr string `json:"balanceStr"`
	Typename   string `json:"__typename"`
}

type AccountCta added in v1.0.2

type AccountCta struct {
	Text     string `json:"text"`
	URL      string `json:"url"`
	Typename string `json:"__typename"`
}

type AccountData added in v1.0.2

type AccountData struct {
	User                   *AccountUser                   `json:"user"`
	UserShopInfo           *AccountUserShopInfo           `json:"userShopInfo"`
	Wallet                 *AccountWallet                 `json:"wallet"`
	WalletPending          *AccountWalletPending          `json:"walletPending"`
	Balance                *AccountBalance                `json:"balance"`
	Tokopoints             *AccountTokopoints             `json:"tokopoints"`
	TokopointsShortcutList *AccountTokopointsShortcutList `json:"tokopointsShortcutList"`
	TokopointsSumCoupon    *AccountTokopointsSumCoupon    `json:"tokopointsSumCoupon"`
}

type AccountInfo added in v1.0.2

type AccountInfo struct {
	ShopID     string `json:"shopId"`
	ShopName   string `json:"shopName"`
	ShopDomain string `json:"shopDomain"`
	ShopAvatar string `json:"shopAvatar"`
	IsOfficial string `json:"isOfficial"`
	Typename   string `json:"__typename"`
}

type AccountOwner added in v1.0.2

type AccountOwner struct {
	IsPowerMerchant bool   `json:"isPowerMerchant"`
	PmStatus        string `json:"pmStatus"`
	Typename        string `json:"__typename"`
}

type AccountRes added in v1.0.2

type AccountRes struct {
	Data *AccountData `json:"data"`
}

type AccountShortcutGroupList added in v1.0.2

type AccountShortcutGroupList struct {
	ShortcutList []*AccountShortcutList `json:"shortcutList"`
	Typename     string                 `json:"__typename"`
}

type AccountShortcutList added in v1.0.2

type AccountShortcutList struct {
	ID          int         `json:"id"`
	Cta         *AccountCta `json:"cta"`
	Description string      `json:"description"`
	Typename    string      `json:"__typename"`
}

type AccountTier added in v1.0.2

type AccountTier struct {
	NameDesc    string `json:"nameDesc"`
	EggImageURL string `json:"eggImageURL"`
	Typename    string `json:"__typename"`
}

type AccountTokopoints added in v1.0.2

type AccountTokopoints struct {
	Status   *Status `json:"status"`
	Typename string  `json:"__typename"`
}

type AccountTokopointsShortcutList added in v1.0.2

type AccountTokopointsShortcutList struct {
	ShortcutGroupList []*AccountShortcutGroupList `json:"shortcutGroupList"`
	Typename          string                      `json:"__typename"`
}

type AccountTokopointsSumCoupon added in v1.0.2

type AccountTokopointsSumCoupon struct {
	SumCouponStr string `json:"sumCouponStr"`
	Typename     string `json:"__typename"`
}

type AccountUser added in v1.0.2

type AccountUser struct {
	ID             string `json:"id"`
	IsLoggedIn     bool   `json:"isLoggedIn"`
	Name           string `json:"name"`
	ProfilePicture string `json:"profilePicture"`
	Completion     int    `json:"completion"`
	PhoneVerified  bool   `json:"phoneVerified"`
	Typename       string `json:"__typename"`
}

type AccountUserShopInfo added in v1.0.2

type AccountUserShopInfo struct {
	Info     *AccountInfo  `json:"info"`
	Owner    *AccountOwner `json:"owner"`
	Typename string        `json:"__typename"`
}

type AccountWallet added in v1.0.2

type AccountWallet struct {
	OvoCash   string `json:"ovoCash"`
	OvoPoints string `json:"ovoPoints"`
	Linked    bool   `json:"linked"`
	Typename  string `json:"__typename"`
}

type AccountWalletPending added in v1.0.2

type AccountWalletPending struct {
	PendingBalance string `json:"pendingBalance"`
	Typename       string `json:"__typename"`
}

type AddShopShowcase added in v1.0.1

type AddShopShowcase struct {
	Success   bool   `json:"success"`
	Message   string `json:"message"`
	CreatedID string `json:"createdId"`
	Typename  string `json:"__typename"`
}

type AddShopShowcaseData added in v1.0.1

type AddShopShowcaseData struct {
	AddShopShowcase AddShopShowcase `json:"addShopShowcase"`
}

type AddShopShowcaseInput added in v1.0.1

type AddShopShowcaseInput struct {
	Name string `json:"name"`
}

type AddShopShowcaseRes added in v1.0.1

type AddShopShowcaseRes struct {
	Data *AddShopShowcaseData `json:"data"`
}

type AddShopShowcaseVar added in v1.0.1

type AddShopShowcaseVar struct {
	Input *AddShopShowcaseInput `json:"input"`
}

type Category added in v1.0.1

type Category struct {
	ID       int         `json:"id"`
	Name     string      `json:"name"`
	URL      string      `json:"url"`
	Children []*Category `json:"children"`
	Typename string      `json:"__typename"`
}

type CategoryAllListLite added in v1.0.1

type CategoryAllListLite struct {
	Categories []*Category `json:"categories"`
	Typename   string      `json:"__typename"`
}

type CategoryAllListLiteData added in v1.0.1

type CategoryAllListLiteData struct {
	CategoryAllListLite *CategoryAllListLite `json:"categoryAllListLite"`
}

type CategoryAllListLiteRes added in v1.0.1

type CategoryAllListLiteRes struct {
	Data CategoryAllListLiteData `json:"data"`
}

type Data added in v1.0.1

type Data struct {
	DeleteShopShowcase *DeleteShopShowcase `json:"deleteShopShowcase"`
}

type DeleteShopShowcase added in v1.0.1

type DeleteShopShowcase struct {
	Success  bool   `json:"success"`
	Message  string `json:"message"`
	Typename string `json:"__typename"`
}

type DeleteShopShowcaseInput added in v1.0.1

type DeleteShopShowcaseInput struct {
	ID string `json:"id"`
}

type DeleteShopShowcaseRes added in v1.0.1

type DeleteShopShowcaseRes struct {
	Data *Data `json:"data"`
}

type DeleteShopShowcaseVar added in v1.0.1

type DeleteShopShowcaseVar struct {
	Input *DeleteShopShowcaseInput `json:"input"`
}

type Error added in v1.0.1

type Error struct {
	Message  string `json:"message"`
	Typename string `json:"__typename"`
}

type GetShopScoreLevelRes

type GetShopScoreLevelRes struct {
	Data struct {
		ShopScoreLevel struct {
			Result struct {
				ShopID          string  `json:"shopID"`
				ShopScore       float32 `json:"shopScore"`
				ShopLevel       int     `json:"shopLevel"`
				ShopScoreDetail []struct {
					Title        string  `json:"title"`
					Identifier   string  `json:"identifier"`
					Value        float32 `json:"value"`
					RawValue     float32 `json:"rawValue"`
					NextMinValue float64 `json:"nextMinValue"`
					ColorText    string  `json:"colorText"`
					Typename     string  `json:"__typename"`
				} `json:"shopScoreDetail"`
				Period     string `json:"period"`
				NextUpdate string `json:"nextUpdate"`
				Typename   string `json:"__typename"`
			} `json:"result"`
			Error struct {
				Message  string `json:"message"`
				Typename string `json:"__typename"`
			} `json:"error"`
			Typename string `json:"__typename"`
		} `json:"shopScoreLevel"`
		ShopLevel struct {
			Result struct {
				ShopID     string `json:"shopID"`
				Period     string `json:"period"`
				NextUpdate string `json:"nextUpdate"`
				ShopLevel  int    `json:"shopLevel"`
				ItemSold   int    `json:"itemSold"`
				Niv        int    `json:"niv"`
				Typename   string `json:"__typename"`
			} `json:"result"`
			Error struct {
				Message  string `json:"message"`
				Typename string `json:"__typename"`
			} `json:"error"`
			Typename string `json:"__typename"`
		} `json:"shopLevel"`
	} `json:"data"`
}

type GetShopScoreLevelVar

type GetShopScoreLevelVar struct {
	ShopIDStr       string `json:"shopIDStr"`
	Source          string `json:"source"`
	CalculateScore  bool   `json:"calculateScore"`
	GetNextMinValue bool   `json:"getNextMinValue"`
	IncludeRawData  bool   `json:"includeRawData"`
}

type GoldGetPMOSStatusRes

type GoldGetPMOSStatusRes struct {
	Data struct {
		GoldGetPMOSStatus struct {
			Data struct {
				PowerMerchant struct {
					Status     string `json:"status"`
					AutoExtend struct {
						Status        string `json:"status"`
						TkpdProductID int    `json:"tkpd_product_id"`
						Typename      string `json:"__typename"`
					} `json:"auto_extend"`
					PmTier      int    `json:"pm_tier"`
					ExpiredTime string `json:"expired_time"`
					Typename    string `json:"__typename"`
				} `json:"power_merchant"`
				Typename string `json:"__typename"`
			} `json:"data"`
			Header struct {
				ErrorCode string `json:"error_code"`
				Typename  string `json:"__typename"`
			} `json:"header"`
			Typename string `json:"__typename"`
		} `json:"goldGetPMOSStatus"`
	} `json:"data"`
}

type GoldGetPMOSStatusVar

type GoldGetPMOSStatusVar struct {
	ShopID int64 `json:"shopId"`
}

type GraphqlPayload

type GraphqlPayload struct {
	OperationName string      `json:"operationName"`
	Variables     interface{} `json:"variables"`
	Query         string      `json:"query"`
}
type Header struct {
	ProcessTime float64  `json:"processTime,omitempty"`
	Messages    []string `json:"messages"`
	Reason      string   `json:"reason"`
	ErrorCode   string   `json:"errorCode"`
	Typename    string   `json:"__typename"`
}

func (*Header) Error

func (head *Header) Error() string

type ImageChatRes

type ImageChatRes struct {
	Data struct {
		URLImage string `json:"url_image"`
	} `json:"data"`
	ServerProcessTime float64 `json:"server_process_time"`
	Server            string  `json:"server"`
	Status            string  `json:"status"`
	Success           int     `json:"success"`
}

type IsAtuheticatedData

type IsAtuheticatedData struct {
	IsAuthenticated int           `json:"isAuthenticated"`
	UserShopInfo    *UserShopInfo `json:"userShopInfo"`
	User            struct {
		Email          string `json:"email"`
		ID             string `json:"id"`
		Name           string `json:"name"`
		FullName       string `json:"full_name"`
		ProfilePicture string `json:"profilePicture"`
		Typename       string `json:"__typename"`
	} `json:"user"`
}

type IsAuthenticatedRes

type IsAuthenticatedRes struct {
	Data IsAtuheticatedData `json:"data"`
}

type NotificationCounterRes

type NotificationCounterRes struct {
	Data struct {
		Notifications struct {
			Resolution   int `json:"resolution"`
			ResolutionAs struct {
				Seller   int    `json:"seller"`
				Typename string `json:"__typename"`
			} `json:"resolutionAs"`
			NotifcenterTrxUnread struct {
				NotifUnreadSellerInt int    `json:"notif_unread_seller_int"`
				Typename             string `json:"__typename"`
			} `json:"notifcenter_trx_unread"`
			NotifcenterUnread struct {
				NotifUnreadSellerInt int    `json:"notif_unread_seller_int"`
				Typename             string `json:"__typename"`
			} `json:"notifcenter_unread"`
			SellerOrderStatus struct {
				NewOrder            int    `json:"newOrder"`
				ReadyToShip         int    `json:"readyToShip"`
				Shipped             int    `json:"shipped"`
				ArriveAtDestination int    `json:"arriveAtDestination"`
				Typename            string `json:"__typename"`
			} `json:"sellerOrderStatus"`
			Inbox struct {
				TalkSeller int    `json:"talk_seller"`
				Ticket     int    `json:"ticket"`
				Review     int    `json:"review"`
				Reputation int    `json:"reputation"`
				Typename   string `json:"__typename"`
			} `json:"inbox"`
			Chat struct {
				UnreadsSeller int    `json:"unreadsSeller"`
				Typename      string `json:"__typename"`
			} `json:"chat"`
			Typename string `json:"__typename"`
		} `json:"notifications"`
	} `json:"data"`
}

type NotificationCounterVar

type NotificationCounterVar struct {
	ShopID string `json:"shopId"`
}

type Points added in v1.0.2

type Points struct {
	Reward   int    `json:"reward"`
	Typename string `json:"__typename"`
}

type ProductDetail added in v1.0.1

type ProductDetail struct {
	ID       int    `json:"id"`
	Name     string `json:"name"`
	Typename string `json:"__typename"`
}

type ProductListMetaRes

type ProductListMetaRes struct {
	Data struct {
		ProductListMeta struct {
			Header struct {
				ProcessTime float64 `json:"processTime"`
				Messages    []any   `json:"messages"`
				Reason      string  `json:"reason"`
				ErrorCode   string  `json:"errorCode"`
				Typename    string  `json:"__typename"`
			} `json:"header"`
			Data struct {
				Tab []struct {
					ID       string `json:"id"`
					Name     string `json:"name"`
					Value    int    `json:"value"`
					Typename string `json:"__typename"`
				} `json:"tab"`
				Filter []struct {
					ID       string `json:"id"`
					Name     string `json:"name"`
					Value    []any  `json:"value"`
					Typename string `json:"__typename"`
				} `json:"filter"`
				Sort []struct {
					ID       string `json:"id"`
					Name     string `json:"name"`
					Value    string `json:"value"`
					Typename string `json:"__typename"`
				} `json:"sort"`
				ShopCategories []struct {
					ID       string `json:"id"`
					Name     string `json:"name"`
					Typename string `json:"__typename"`
				} `json:"shopCategories"`
				Access []struct {
					ID       string `json:"id"`
					Name     string `json:"name"`
					Value    string `json:"value"`
					Typename string `json:"__typename"`
				} `json:"access"`
				Typename string `json:"__typename"`
			} `json:"data"`
			Typename string `json:"__typename"`
		} `json:"ProductListMeta"`
	} `json:"data"`
}

type ProductListMetaVar

type ProductListMetaVar struct {
	ShopID      string   `json:"shopID"`
	ExtraInfo   []string `json:"extraInfo"`
	WareHouseID string   `json:"warehouseID"`
}

type Session

type Session interface {
	Sync() error
	Update(cookies []*http.Cookie) error
	AddToHttpRequest(req *http.Request)
	UserAgent() string
	GetCookies() []*http.Cookie
}

type ShopInfoByIDRes

type ShopInfoByIDRes struct {
	Data struct {
		ShopInfoByID struct {
			Result []struct {
				FavoriteData struct {
					TotalFavorite int    `json:"totalFavorite"`
					Typename      string `json:"__typename"`
				} `json:"favoriteData"`
				GoldOS struct {
					IsGold           int    `json:"isGold"`
					IsOfficial       int    `json:"isOfficial"`
					Badge            string `json:"badge"`
					ShopTier         int    `json:"shopTier"`
					ShopTierWording  string `json:"shopTierWording"`
					ShopGrade        int    `json:"shopGrade"`
					ShopGradeWording string `json:"shopGradeWording"`
					Typename         string `json:"__typename"`
				} `json:"goldOS"`
				Location   string `json:"location"`
				ShopAssets struct {
					Avatar       string `json:"avatar"`
					Cover        string `json:"cover"`
					DefaultCover []struct {
						ID       string `json:"id"`
						Path     string `json:"path"`
						Typename string `json:"__typename"`
					} `json:"defaultCover"`
					Typename string `json:"__typename"`
				} `json:"shopAssets"`
				IsAllowManage int `json:"isAllowManage"`
				IsOwner       int `json:"isOwner"`
				ShopCore      struct {
					Name        string `json:"name"`
					ShopID      string `json:"shopID"`
					Domain      string `json:"domain"`
					Description string `json:"description"`
					TagLine     string `json:"tagLine"`
					Typename    string `json:"__typename"`
				} `json:"shopCore"`
				ShopHomeType string `json:"shopHomeType"`
				ClosedInfo   struct {
					ClosedNote string `json:"closedNote"`
					Until      string `json:"until"`
					Detail     struct {
						StartDate string `json:"startDate"`
						EndDate   string `json:"endDate"`
						OpenDate  string `json:"openDate"`
						Status    int    `json:"status"`
						Typename  string `json:"__typename"`
					} `json:"detail"`
					Typename string `json:"__typename"`
				} `json:"closedInfo"`
				StatusInfo struct {
					ShopStatus int    `json:"shopStatus"`
					StatusName string `json:"statusName"`
					Typename   string `json:"__typename"`
				} `json:"statusInfo"`
				Os struct {
					IsOfficial int    `json:"isOfficial"`
					Expired    string `json:"expired"`
					Typename   string `json:"__typename"`
				} `json:"os"`
				Typename string `json:"__typename"`
			} `json:"result"`
			Typename string `json:"__typename"`
		} `json:"shopInfoByID"`
	} `json:"data"`
}

type ShopInfoByIDVar

type ShopInfoByIDVar struct {
	ShopIDs []int64  `json:"shopIDs"`
	Fields  []string `json:"fields"`
}

type ShopScorePenaltyDetail added in v1.0.1

type ShopScorePenaltyDetail struct {
	Result   []*ShopScorePenaltyDetailResult `json:"result"`
	HasNext  bool                            `json:"hasNext"`
	HasPrev  bool                            `json:"hasPrev"`
	Error    *Error                          `json:"error"`
	Typename string                          `json:"__typename"`
}

type ShopScorePenaltyDetailData added in v1.0.1

type ShopScorePenaltyDetailData struct {
	ShopScorePenaltyDetail *ShopScorePenaltyDetail `json:"shopScorePenaltyDetail"`
}

type ShopScorePenaltyDetailRes added in v1.0.1

type ShopScorePenaltyDetailRes struct {
	Data *ShopScorePenaltyDetailData `json:"data"`
}

type ShopScorePenaltyDetailResult added in v1.0.1

type ShopScorePenaltyDetailResult struct {
	ShopPenaltyID         string        `json:"shopPenaltyID"`
	InvoiceNumber         string        `json:"invoiceNumber"`
	Reason                string        `json:"reason"`
	Score                 int           `json:"score"`
	CreateTime            string        `json:"createTime"`
	TypeID                int           `json:"typeID"`
	TypeName              string        `json:"typeName"`
	PenaltyStartDate      string        `json:"penaltyStartDate"`
	PenaltyExpirationDate string        `json:"penaltyExpirationDate"`
	Status                string        `json:"status"`
	ProductDetail         ProductDetail `json:"productDetail"`
	PenaltyTypeGroup      int           `json:"penaltyTypeGroup"`
	Typename              string        `json:"__typename"`
}

type ShopScorePenaltyDetailVar added in v1.0.1

type ShopScorePenaltyDetailVar struct {
	ShopID    string    `json:"shopID"`
	Page      int       `json:"page"`
	Total     int       `json:"total"`
	StartDate time.Time `json:"startDate"`
	EndDate   time.Time `json:"endDate"`
	Sort      int       `json:"sort"`
	Source    string    `json:"source"`
}

func (*ShopScorePenaltyDetailVar) MarshalJSON added in v1.0.1

func (u *ShopScorePenaltyDetailVar) MarshalJSON() ([]byte, error)

type ShopScorePenaltySummary added in v1.0.1

type ShopScorePenaltySummary struct {
	Result   *ShopScorePenaltySummaryResult `json:"result"`
	Error    *ShopScorePenaltySummaryError  `json:"error"`
	Typename string                         `json:"__typename"`
}

type ShopScorePenaltySummaryData added in v1.0.1

type ShopScorePenaltySummaryData struct {
	ShopScorePenaltySummary *ShopScorePenaltySummary `json:"shopScorePenaltySummary"`
}

type ShopScorePenaltySummaryError added in v1.0.1

type ShopScorePenaltySummaryError struct {
	Message  string `json:"message"`
	Typename string `json:"__typename"`
}

func (*ShopScorePenaltySummaryError) Error added in v1.0.1

type ShopScorePenaltySummaryRes added in v1.0.1

type ShopScorePenaltySummaryRes struct {
	Data *ShopScorePenaltySummaryData `json:"data"`
}

type ShopScorePenaltySummaryResult added in v1.0.1

type ShopScorePenaltySummaryResult struct {
	Penalty       int    `json:"penalty"`
	PenaltyAmount int    `json:"penaltyAmount"`
	Typename      string `json:"__typename"`
}

type ShopScorePenaltySummaryVar added in v1.0.1

type ShopScorePenaltySummaryVar struct {
	StartDate time.Time `json:"startDate"` // "2023-07-14"
	EndDate   time.Time `json:"endDate"`
	ShopID    string    `json:"shopID"`
	Source    string    `json:"source"`
}

func (*ShopScorePenaltySummaryVar) MarshalJSON added in v1.0.1

func (u *ShopScorePenaltySummaryVar) MarshalJSON() ([]byte, error)

type ShopShowcaseData added in v1.0.1

type ShopShowcaseData struct {
	ShopShowcases ShopShowcases `json:"shopShowcases"`
}

type ShopShowcaseError added in v1.0.1

type ShopShowcaseError struct {
	Message  string `json:"message"`
	Typename string `json:"__typename"`
}

type ShopShowcaseRes added in v1.0.1

type ShopShowcaseRes struct {
	Data *ShopShowcaseData `json:"data"`
}

type ShopShowcaseResult added in v1.0.1

type ShopShowcaseResult struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Count    int    `json:"count"`
	URI      string `json:"uri"`
	Typename string `json:"__typename"`
}

type ShopShowcaseVar added in v1.0.1

type ShopShowcaseVar struct {
	WithDefault bool `json:"withDefault"`
}

type ShopShowcases added in v1.0.1

type ShopShowcases struct {
	Result   []*ShopShowcaseResult `json:"result"`
	Error    *ShopShowcaseError    `json:"error"`
	Typename string                `json:"__typename"`
}

type Status added in v1.0.2

type Status struct {
	Tier     AccountTier `json:"tier"`
	Points   Points      `json:"points"`
	Typename string      `json:"__typename"`
}

type TokopediaApi

type TokopediaApi struct {
	Session Session

	AuthenticatedData *IsAtuheticatedData
	// contains filtered or unexported fields
}

func NewTokopediaApi

func NewTokopediaApi(session Session) *TokopediaApi

func (*TokopediaApi) AccountInfo added in v1.0.2

func (api *TokopediaApi) AccountInfo() (*AccountRes, error)

func (*TokopediaApi) AddShopShowcase added in v1.0.1

func (api *TokopediaApi) AddShopShowcase(name string) (*AddShopShowcaseRes, error)

func (*TokopediaApi) BulkProductEditV3

func (api *TokopediaApi) BulkProductEditV3(payload *model.BulkProductEditV3Var) (*model.BulkProductEditV3Resp, error)

func (*TokopediaApi) CategoryAllListLite added in v1.0.1

func (api *TokopediaApi) CategoryAllListLite() (*CategoryAllListLiteRes, error)

func (*TokopediaApi) ChatGetBundleSticker

func (api *TokopediaApi) ChatGetBundleSticker(payload *model.ChatGetBundleStickerVar) (*model.ChatGetBundleStickerResp, error)

func (*TokopediaApi) ChatGetGroupSticker

func (api *TokopediaApi) ChatGetGroupSticker(payload *model.TypeVar) (*model.ChatGetGroupStickerResp, error)

func (*TokopediaApi) DeleteShopShowcase added in v1.0.1

func (api *TokopediaApi) DeleteShopShowcase(id string) (*DeleteShopShowcaseRes, error)

func (*TokopediaApi) GetProductV3

func (api *TokopediaApi) GetProductV3(payload *model.GetProductV3Var) (*model.GetProductV3Resp, error)

func (*TokopediaApi) GetShopScoreLevel

func (api *TokopediaApi) GetShopScoreLevel() (*GetShopScoreLevelRes, error)

func (*TokopediaApi) GoldGetPMOSStatus

func (api *TokopediaApi) GoldGetPMOSStatus() (*GoldGetPMOSStatusRes, error)

func (*TokopediaApi) IsAutheticated

func (api *TokopediaApi) IsAutheticated() (*IsAuthenticatedRes, error)

func (*TokopediaApi) NewGraphqlReq

func (api *TokopediaApi) NewGraphqlReq(payload *GraphqlPayload) *http.Request

func (*TokopediaApi) NewRequest

func (api *TokopediaApi) NewRequest(method, ur string, query any, body io.Reader) *http.Request

func (*TokopediaApi) NotificationCounter

func (api *TokopediaApi) NotificationCounter() (*NotificationCounterRes, error)

func (*TokopediaApi) ProductAdd

func (api *TokopediaApi) ProductAdd(variables *model.ProductAddVar) (*model.ProductAddResp, error)

func (*TokopediaApi) ProductList

func (api *TokopediaApi) ProductList(payload *model.ProductListVar) (*model.ProductListResp, error)

func (*TokopediaApi) ProductListMeta

func (api *TokopediaApi) ProductListMeta() (*ProductListMetaRes, error)

func (*TokopediaApi) ProductUpdate

func (api *TokopediaApi) ProductUpdate(payload *model.ProductUpdateVar) (*model.ProductUpdateResp, error)

func (*TokopediaApi) SendRequest

func (api *TokopediaApi) SendRequest(req *http.Request, hasil any) error

func (*TokopediaApi) ShopInfoByID

func (api *TokopediaApi) ShopInfoByID() (*ShopInfoByIDRes, error)

func (*TokopediaApi) ShopScorePenaltyDetail added in v1.0.1

func (api *TokopediaApi) ShopScorePenaltyDetail(payload *ShopScorePenaltyDetailVar) (*ShopScorePenaltyDetailRes, error)

func (*TokopediaApi) ShopScorePenaltySummary added in v1.0.1

func (api *TokopediaApi) ShopScorePenaltySummary(payload *ShopScorePenaltySummaryVar) (*ShopScorePenaltySummaryRes, error)

func (*TokopediaApi) ShopShowcase added in v1.0.1

func (api *TokopediaApi) ShopShowcase() (*ShopShowcaseRes, error)

func (*TokopediaApi) UploadImageChat

func (api *TokopediaApi) UploadImageChat(msgId string, locfile string) (*ImageChatRes, error)

func (*TokopediaApi) UploadImageFromUrl

func (api *TokopediaApi) UploadImageFromUrl(uri string) (*UploadMediaResp, error)

func (*TokopediaApi) UploadProductImage

func (api *TokopediaApi) UploadProductImage(content io.Reader) (*UploadMediaResp, error)

type UpImageHeader

type UpImageHeader struct {
	ProcessTime float64  `json:"process_time"`
	Reason      string   `json:"reason"`
	ErrorCode   string   `json:"error_code"`
	IsSuccess   bool     `json:"is_success"`
	Messages    []string `json:"messages"`
}

func (*UpImageHeader) Error

func (head *UpImageHeader) Error() string

type UploadMediaResp

type UploadMediaResp struct {
	Header *UpImageHeader `json:"header"`
	Data   struct {
		UploadID string `json:"upload_id"`
		ImageURL string `json:"image_url"`
	} `json:"data"`
}

type UserShopInfo

type UserShopInfo struct {
	Info struct {
		ShopID         int64  `json:"shop_id,string"`
		ShopDomain     string `json:"shop_domain"`
		ShopName       string `json:"shop_name"`
		ShopAvatar     string `json:"shop_avatar"`
		ShopIsOfficial string `json:"shop_is_official"`
		ShopScore      int    `json:"shop_score"`
		ShopLocation   string `json:"shop_location"`
		Typename       string `json:"__typename"`
	} `json:"info"`
	Owner struct {
		OwnerID        int    `json:"owner_id"`
		IsGoldMerchant bool   `json:"is_gold_merchant"`
		PmStatus       string `json:"pm_status"`
		Typename       string `json:"__typename"`
	} `json:"owner"`
	Typename string `json:"__typename"`
}

Jump to

Keyboard shortcuts

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