當前位置: 首頁>>代碼示例>>Golang>>正文


Golang gmws.Parameters類代碼示例

本文整理匯總了Golang中github.com/svvu/gomws/gmws.Parameters的典型用法代碼示例。如果您正苦於以下問題:Golang Parameters類的具體用法?Golang Parameters怎麽用?Golang Parameters使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Parameters類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: GetOrder

// GetOrder Returns orders based on the AmazonOrderId values that you specify.
// Maximum 50 ids.
// http://docs.developer.amazonservices.com/en_US/orders/2013-09-01/Orders_GetOrder.html
func (o Orders) GetOrder(amazonOrderIds []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetOrder",
		"AmazonOrderId": amazonOrderIds,
	}
	structuredParams := params.StructureKeys("AmazonOrderId", "Id")

	return o.SendRequest(structuredParams)
}
開發者ID:svvu,項目名稱:gomws,代碼行數:12,代碼來源:orders.go

示例2: GetCompetitivePricingForSKU

// GetCompetitivePricingForSKU Returns the current competitive price of a product, based on SellerSKU.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetCompetitivePricingForSKU.html
func (p Products) GetCompetitivePricingForSKU(sellerSKUList []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetCompetitivePricingForSKU",
		"SellerSKUList": sellerSKUList,
		"MarketplaceId": p.MarketPlaceId,
	}
	structuredParams := params.StructureKeys("SellerSKUList", "SellerSKU")

	return p.SendRequest(structuredParams)
}
開發者ID:svvu,項目名稱:gomws,代碼行數:12,代碼來源:products.go

示例3: GetMatchingProduct

// GetMatchingProduct Returns a list of products and their attributes, based on a list of ASIN values.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProduct.html
func (p Products) GetMatchingProduct(asinList []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetMatchingProduct",
		"ASINList":      asinList,
		"MarketplaceId": p.MarketPlaceId,
	}
	structuredParams := params.StructureKeys("ASINList", "ASIN")

	return p.SendRequest(structuredParams)
}
開發者ID:svvu,項目名稱:gomws,代碼行數:12,代碼來源:products.go

示例4: GetMatchingProductForId

// GetMatchingProductForId Returns a list of products and their attributes, based on a list of ASIN, GCID, SellerSKU, UPC, EAN, ISBN, and JAN values.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetMatchingProductForId.html
func (p Products) GetMatchingProductForId(idType string, idList []string) *mwsHttps.Response {
	params := gmws.Parameters{
		"Action":        "GetMatchingProductForId",
		"IdType":        idType,
		"IdList":        idList,
		"MarketplaceId": p.MarketPlaceId,
	}
	structuredParams := params.StructureKeys("IdList", "Id")

	return p.SendRequest(structuredParams)
}
開發者ID:svvu,項目名稱:gomws,代碼行數:13,代碼來源:products.go

示例5: GetMyPriceForASIN

// GetMyPriceForASIN Returns pricing information for your own offer listings, based on ASIN.
// http://docs.developer.amazonservices.com/en_US/products/Products_GetMyPriceForASIN.html
func (p Products) GetMyPriceForASIN(asinList []string, optional ...gmws.Parameters) *mwsHttps.Response {
	op := gmws.OptionalParams([]string{"ItemCondition"}, optional)
	params := gmws.Parameters{
		"Action":        "GetMyPriceForASIN",
		"ASINList":      asinList,
		"MarketplaceId": p.MarketPlaceId,
	}.Merge(op)
	structuredParams := params.StructureKeys("ASINList", "ASIN")

	return p.SendRequest(structuredParams)
}
開發者ID:svvu,項目名稱:gomws,代碼行數:13,代碼來源:products.go

示例6: GetLowestOfferListingsForSKU

// GetLowestOfferListingsForSKU Returns pricing information for the lowest-price active offer listings for up to 20 products, based on SellerSKU.
// Optional Parameters:
// 	ItemCondition - string
// 	ExcludeMe - bool
// http://docs.developer.amazonservices.com/en_US/products/Products_GetLowestOfferListingsForSKU.html
func (p Products) GetLowestOfferListingsForSKU(sellerSKUList []string, optional ...gmws.Parameters) *mwsHttps.Response {
	op := gmws.OptionalParams([]string{"ItemCondition", "ExcludeMe"}, optional)
	params := gmws.Parameters{
		"Action":        "GetLowestOfferListingsForSKU",
		"SellerSKUList": sellerSKUList,
		"MarketplaceId": p.MarketPlaceId,
	}.Merge(op)
	structuredParams := params.StructureKeys("SellerSKUList", "SellerSKU")

	return p.SendRequest(structuredParams)
}
開發者ID:svvu,項目名稱:gomws,代碼行數:16,代碼來源:products.go

示例7: ListOrders

// ListOrders Returns orders created or updated during a time frame that you specify.
//
// Note: When calling this operation, either CreatedAfter or LastUpdatedAfter must be specify.
// Specify both will return an error.
//
// other params:
// 	CreatedAfter - string, ISO-8601 date format.
// 		Required, if LastUpdatedAfter is not specified.
// 	CreatedBefore - string, ISO-8601 date format.
// 		Can only be specified if CreatedAfter is specified.
//	LastUpdatedAfter - string, ISO-8601 date format.
// 		Required, if CreatedAfter is not specified.
// 		If LastUpdatedAfter is specified, then BuyerEmail and SellerOrderId cannot be specified.
// 	LastUpdatedBefore - string, ISO-8601 date format.
// 		Can only be specified if LastUpdatedAfter is specified.
// 	OrderStatus - []string.
// 		Values: PendingAvailability, Pending, Unshipped, PartiallyShipped, Shipped,
// 		InvoiceUnconfirmed, Canceled, Unfulfillable. Default: All.
//	FulfillmentChannel - []string.
// 		Values: AFN, MFN. Default: All.
// 	PaymentMethod - []string.
// 		Values: COD, CVS, Other. Default: All.
// 	BuyerEmail - string.
// 		If BuyerEmail is specified, then FulfillmentChannel, OrderStatus, PaymentMethod,
// 		LastUpdatedAfter, LastUpdatedBefore, and SellerOrderId cannot be specified.
// 	SellerOrderId - string.
// 		If SellerOrderId is specified, then FulfillmentChannel, OrderStatus,
// 		PaymentMethod, LastUpdatedAfter, LastUpdatedBefore, and BuyerEmail cannot be specified.
// 	MaxResultsPerPage - int.
// 		Value 1 - 100. Default 100.
// 	TFMShipmentStatus - []string.
// 		Values: PendingPickUp, LabelCanceled, PickedUp, AtDestinationFC,
// 		Delivered, RejectedByBuyer, Undeliverable, ReturnedToSeller, Lost.
func (o Orders) ListOrders(others ...gmws.Parameters) *mwsHttps.Response {
	op := gmws.OptionalParams([]string{
		"CreatedAfter", "CreatedBefore",
		"LastUpdatedAfter", "LastUpdatedBefore",
		"OrderStatus", "FulfillmentChannel", "PaymentMethod",
		"SellerOrderId", "BuyerEmail",
		"TFMShipmentStatus", "MaxResultsPerPage",
	}, others)
	params := gmws.Parameters{
		"Action":        "ListOrders",
		"MarketplaceId": []string{o.MarketPlaceId},
	}.Merge(op)

	structuredParams := params.StructureKeys("MarketplaceId", "Id")
	if _, ok := structuredParams["OrderStatus"]; ok {
		structuredParams = params.StructureKeys("OrderStatus", "Status")
	}
	if _, ok := structuredParams["FulfillmentChannel"]; ok {
		structuredParams = params.StructureKeys("FulfillmentChannel", "Channel")
	}
	if _, ok := structuredParams["OrderStatus"]; ok {
		structuredParams = params.StructureKeys("PaymentMethod", "Method")
	}
	if _, ok := structuredParams["OrderStatus"]; ok {
		structuredParams = params.StructureKeys("TFMShipmentStatus", "Status")
	}

	return o.SendRequest(structuredParams)
}
開發者ID:svvu,項目名稱:gomws,代碼行數:62,代碼來源:orders.go


注:本文中的github.com/svvu/gomws/gmws.Parameters類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。