You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

8095 lines
304 KiB

  1. // Package content provides access to the Content API for Shopping.
  2. //
  3. // See https://developers.google.com/shopping-content
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/content/v2sandbox"
  8. // ...
  9. // contentService, err := content.New(oauthHttpClient)
  10. package content // import "google.golang.org/api/content/v2sandbox"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "content:v2sandbox"
  41. const apiName = "content"
  42. const apiVersion = "v2sandbox"
  43. const basePath = "https://www.googleapis.com/content/v2sandbox/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your product listings and accounts for Google Shopping
  47. ContentScope = "https://www.googleapis.com/auth/content"
  48. )
  49. func New(client *http.Client) (*APIService, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &APIService{client: client, BasePath: basePath}
  54. s.Orderinvoices = NewOrderinvoicesService(s)
  55. s.Orderpayments = NewOrderpaymentsService(s)
  56. s.Orders = NewOrdersService(s)
  57. return s, nil
  58. }
  59. type APIService struct {
  60. client *http.Client
  61. BasePath string // API endpoint base URL
  62. UserAgent string // optional additional User-Agent fragment
  63. Orderinvoices *OrderinvoicesService
  64. Orderpayments *OrderpaymentsService
  65. Orders *OrdersService
  66. }
  67. func (s *APIService) userAgent() string {
  68. if s.UserAgent == "" {
  69. return googleapi.UserAgent
  70. }
  71. return googleapi.UserAgent + " " + s.UserAgent
  72. }
  73. func NewOrderinvoicesService(s *APIService) *OrderinvoicesService {
  74. rs := &OrderinvoicesService{s: s}
  75. return rs
  76. }
  77. type OrderinvoicesService struct {
  78. s *APIService
  79. }
  80. func NewOrderpaymentsService(s *APIService) *OrderpaymentsService {
  81. rs := &OrderpaymentsService{s: s}
  82. return rs
  83. }
  84. type OrderpaymentsService struct {
  85. s *APIService
  86. }
  87. func NewOrdersService(s *APIService) *OrdersService {
  88. rs := &OrdersService{s: s}
  89. return rs
  90. }
  91. type OrdersService struct {
  92. s *APIService
  93. }
  94. type Amount struct {
  95. // Pretax: Value before taxes.
  96. Pretax *Price `json:"pretax,omitempty"`
  97. // Tax: Tax value.
  98. Tax *Price `json:"tax,omitempty"`
  99. // ForceSendFields is a list of field names (e.g. "Pretax") to
  100. // unconditionally include in API requests. By default, fields with
  101. // empty values are omitted from API requests. However, any non-pointer,
  102. // non-interface field appearing in ForceSendFields will be sent to the
  103. // server regardless of whether the field is empty or not. This may be
  104. // used to include empty fields in Patch requests.
  105. ForceSendFields []string `json:"-"`
  106. // NullFields is a list of field names (e.g. "Pretax") to include in API
  107. // requests with the JSON null value. By default, fields with empty
  108. // values are omitted from API requests. However, any field with an
  109. // empty value appearing in NullFields will be sent to the server as
  110. // null. It is an error if a field in this list has a non-empty value.
  111. // This may be used to include null fields in Patch requests.
  112. NullFields []string `json:"-"`
  113. }
  114. func (s *Amount) MarshalJSON() ([]byte, error) {
  115. type NoMethod Amount
  116. raw := NoMethod(*s)
  117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  118. }
  119. // Error: An error returned by the API.
  120. type Error struct {
  121. // Domain: The domain of the error.
  122. Domain string `json:"domain,omitempty"`
  123. // Message: A description of the error.
  124. Message string `json:"message,omitempty"`
  125. // Reason: The error code.
  126. Reason string `json:"reason,omitempty"`
  127. // ForceSendFields is a list of field names (e.g. "Domain") to
  128. // unconditionally include in API requests. By default, fields with
  129. // empty values are omitted from API requests. However, any non-pointer,
  130. // non-interface field appearing in ForceSendFields will be sent to the
  131. // server regardless of whether the field is empty or not. This may be
  132. // used to include empty fields in Patch requests.
  133. ForceSendFields []string `json:"-"`
  134. // NullFields is a list of field names (e.g. "Domain") to include in API
  135. // requests with the JSON null value. By default, fields with empty
  136. // values are omitted from API requests. However, any field with an
  137. // empty value appearing in NullFields will be sent to the server as
  138. // null. It is an error if a field in this list has a non-empty value.
  139. // This may be used to include null fields in Patch requests.
  140. NullFields []string `json:"-"`
  141. }
  142. func (s *Error) MarshalJSON() ([]byte, error) {
  143. type NoMethod Error
  144. raw := NoMethod(*s)
  145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  146. }
  147. // Errors: A list of errors returned by a failed batch entry.
  148. type Errors struct {
  149. // Code: The HTTP status of the first error in errors.
  150. Code int64 `json:"code,omitempty"`
  151. // Errors: A list of errors.
  152. Errors []*Error `json:"errors,omitempty"`
  153. // Message: The message of the first error in errors.
  154. Message string `json:"message,omitempty"`
  155. // ForceSendFields is a list of field names (e.g. "Code") to
  156. // unconditionally include in API requests. By default, fields with
  157. // empty values are omitted from API requests. However, any non-pointer,
  158. // non-interface field appearing in ForceSendFields will be sent to the
  159. // server regardless of whether the field is empty or not. This may be
  160. // used to include empty fields in Patch requests.
  161. ForceSendFields []string `json:"-"`
  162. // NullFields is a list of field names (e.g. "Code") to include in API
  163. // requests with the JSON null value. By default, fields with empty
  164. // values are omitted from API requests. However, any field with an
  165. // empty value appearing in NullFields will be sent to the server as
  166. // null. It is an error if a field in this list has a non-empty value.
  167. // This may be used to include null fields in Patch requests.
  168. NullFields []string `json:"-"`
  169. }
  170. func (s *Errors) MarshalJSON() ([]byte, error) {
  171. type NoMethod Errors
  172. raw := NoMethod(*s)
  173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  174. }
  175. type InvoiceSummary struct {
  176. // AdditionalChargeSummaries: Summary of the total amounts of the
  177. // additional charges.
  178. AdditionalChargeSummaries []*InvoiceSummaryAdditionalChargeSummary `json:"additionalChargeSummaries,omitempty"`
  179. // CustomerBalance: Customer balance on this invoice. A positive amount
  180. // means the customer is paying, a negative one means the customer is
  181. // receiving money. Note that it must always be true that
  182. // merchant_balance + customer_balance + google_balance = 0.
  183. CustomerBalance *Amount `json:"customerBalance,omitempty"`
  184. // GoogleBalance: Google balance on this invoice. A positive amount
  185. // means Google is paying, a negative one means Google is receiving
  186. // money. Note that it must always be true that merchant_balance +
  187. // customer_balance + google_balance = 0.
  188. GoogleBalance *Amount `json:"googleBalance,omitempty"`
  189. // MerchantBalance: Merchant balance on this invoice. A positive amount
  190. // means the merchant is paying, a negative one means the merchant is
  191. // receiving money. Note that it must always be true that
  192. // merchant_balance + customer_balance + google_balance = 0.
  193. MerchantBalance *Amount `json:"merchantBalance,omitempty"`
  194. // ProductTotal: Total price for the product.
  195. ProductTotal *Amount `json:"productTotal,omitempty"`
  196. // PromotionSummaries: Summary for each promotion.
  197. PromotionSummaries []*Promotion `json:"promotionSummaries,omitempty"`
  198. // ForceSendFields is a list of field names (e.g.
  199. // "AdditionalChargeSummaries") to unconditionally include in API
  200. // requests. By default, fields with empty values are omitted from API
  201. // requests. However, any non-pointer, non-interface field appearing in
  202. // ForceSendFields will be sent to the server regardless of whether the
  203. // field is empty or not. This may be used to include empty fields in
  204. // Patch requests.
  205. ForceSendFields []string `json:"-"`
  206. // NullFields is a list of field names (e.g.
  207. // "AdditionalChargeSummaries") to include in API requests with the JSON
  208. // null value. By default, fields with empty values are omitted from API
  209. // requests. However, any field with an empty value appearing in
  210. // NullFields will be sent to the server as null. It is an error if a
  211. // field in this list has a non-empty value. This may be used to include
  212. // null fields in Patch requests.
  213. NullFields []string `json:"-"`
  214. }
  215. func (s *InvoiceSummary) MarshalJSON() ([]byte, error) {
  216. type NoMethod InvoiceSummary
  217. raw := NoMethod(*s)
  218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  219. }
  220. type InvoiceSummaryAdditionalChargeSummary struct {
  221. // TotalAmount: Total additional charge for this type.
  222. TotalAmount *Amount `json:"totalAmount,omitempty"`
  223. // Type: Type of the additional charge.
  224. Type string `json:"type,omitempty"`
  225. // ForceSendFields is a list of field names (e.g. "TotalAmount") to
  226. // unconditionally include in API requests. By default, fields with
  227. // empty values are omitted from API requests. However, any non-pointer,
  228. // non-interface field appearing in ForceSendFields will be sent to the
  229. // server regardless of whether the field is empty or not. This may be
  230. // used to include empty fields in Patch requests.
  231. ForceSendFields []string `json:"-"`
  232. // NullFields is a list of field names (e.g. "TotalAmount") to include
  233. // in API requests with the JSON null value. By default, fields with
  234. // empty values are omitted from API requests. However, any field with
  235. // an empty value appearing in NullFields will be sent to the server as
  236. // null. It is an error if a field in this list has a non-empty value.
  237. // This may be used to include null fields in Patch requests.
  238. NullFields []string `json:"-"`
  239. }
  240. func (s *InvoiceSummaryAdditionalChargeSummary) MarshalJSON() ([]byte, error) {
  241. type NoMethod InvoiceSummaryAdditionalChargeSummary
  242. raw := NoMethod(*s)
  243. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  244. }
  245. type Order struct {
  246. // Acknowledged: Whether the order was acknowledged.
  247. Acknowledged bool `json:"acknowledged,omitempty"`
  248. // ChannelType: The channel type of the order: "purchaseOnGoogle" or
  249. // "googleExpress".
  250. ChannelType string `json:"channelType,omitempty"`
  251. // Customer: The details of the customer who placed the order.
  252. Customer *OrderCustomer `json:"customer,omitempty"`
  253. // DeliveryDetails: The details for the delivery.
  254. DeliveryDetails *OrderDeliveryDetails `json:"deliveryDetails,omitempty"`
  255. // Id: The REST id of the order. Globally unique.
  256. Id string `json:"id,omitempty"`
  257. // Kind: Identifies what kind of resource this is. Value: the fixed
  258. // string "content#order".
  259. Kind string `json:"kind,omitempty"`
  260. // LineItems: Line items that are ordered.
  261. LineItems []*OrderLineItem `json:"lineItems,omitempty"`
  262. MerchantId uint64 `json:"merchantId,omitempty,string"`
  263. // MerchantOrderId: Merchant-provided id of the order.
  264. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  265. // NetAmount: The net amount for the order. For example, if an order was
  266. // originally for a grand total of $100 and a refund was issued for $20,
  267. // the net amount will be $80.
  268. NetAmount *Price `json:"netAmount,omitempty"`
  269. // PaymentMethod: The details of the payment method.
  270. PaymentMethod *OrderPaymentMethod `json:"paymentMethod,omitempty"`
  271. // PaymentStatus: The status of the payment.
  272. PaymentStatus string `json:"paymentStatus,omitempty"`
  273. // PlacedDate: The date when the order was placed, in ISO 8601 format.
  274. PlacedDate string `json:"placedDate,omitempty"`
  275. // Promotions: The details of the merchant provided promotions applied
  276. // to the order. More details about the program are here.
  277. Promotions []*OrderPromotion `json:"promotions,omitempty"`
  278. // Refunds: Refunds for the order.
  279. Refunds []*OrderRefund `json:"refunds,omitempty"`
  280. // Shipments: Shipments of the order.
  281. Shipments []*OrderShipment `json:"shipments,omitempty"`
  282. // ShippingCost: The total cost of shipping for all items.
  283. ShippingCost *Price `json:"shippingCost,omitempty"`
  284. // ShippingCostTax: The tax for the total shipping cost.
  285. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  286. // ShippingOption: The requested shipping option.
  287. ShippingOption string `json:"shippingOption,omitempty"`
  288. // Status: The status of the order.
  289. Status string `json:"status,omitempty"`
  290. // ServerResponse contains the HTTP response code and headers from the
  291. // server.
  292. googleapi.ServerResponse `json:"-"`
  293. // ForceSendFields is a list of field names (e.g. "Acknowledged") to
  294. // unconditionally include in API requests. By default, fields with
  295. // empty values are omitted from API requests. However, any non-pointer,
  296. // non-interface field appearing in ForceSendFields will be sent to the
  297. // server regardless of whether the field is empty or not. This may be
  298. // used to include empty fields in Patch requests.
  299. ForceSendFields []string `json:"-"`
  300. // NullFields is a list of field names (e.g. "Acknowledged") to include
  301. // in API requests with the JSON null value. By default, fields with
  302. // empty values are omitted from API requests. However, any field with
  303. // an empty value appearing in NullFields will be sent to the server as
  304. // null. It is an error if a field in this list has a non-empty value.
  305. // This may be used to include null fields in Patch requests.
  306. NullFields []string `json:"-"`
  307. }
  308. func (s *Order) MarshalJSON() ([]byte, error) {
  309. type NoMethod Order
  310. raw := NoMethod(*s)
  311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  312. }
  313. type OrderAddress struct {
  314. // Country: CLDR country code (e.g. "US").
  315. Country string `json:"country,omitempty"`
  316. // FullAddress: Strings representing the lines of the printed label for
  317. // mailing the order, for example:
  318. // John Smith
  319. // 1600 Amphitheatre Parkway
  320. // Mountain View, CA, 94043
  321. // United States
  322. FullAddress []string `json:"fullAddress,omitempty"`
  323. // IsPostOfficeBox: Whether the address is a post office box.
  324. IsPostOfficeBox bool `json:"isPostOfficeBox,omitempty"`
  325. // Locality: City, town or commune. May also include dependent
  326. // localities or sublocalities (e.g. neighborhoods or suburbs).
  327. Locality string `json:"locality,omitempty"`
  328. // PostalCode: Postal Code or ZIP (e.g. "94043").
  329. PostalCode string `json:"postalCode,omitempty"`
  330. // RecipientName: Name of the recipient.
  331. RecipientName string `json:"recipientName,omitempty"`
  332. // Region: Top-level administrative subdivision of the country (e.g.
  333. // "CA").
  334. Region string `json:"region,omitempty"`
  335. // StreetAddress: Street-level part of the address.
  336. StreetAddress []string `json:"streetAddress,omitempty"`
  337. // ForceSendFields is a list of field names (e.g. "Country") to
  338. // unconditionally include in API requests. By default, fields with
  339. // empty values are omitted from API requests. However, any non-pointer,
  340. // non-interface field appearing in ForceSendFields will be sent to the
  341. // server regardless of whether the field is empty or not. This may be
  342. // used to include empty fields in Patch requests.
  343. ForceSendFields []string `json:"-"`
  344. // NullFields is a list of field names (e.g. "Country") to include in
  345. // API requests with the JSON null value. By default, fields with empty
  346. // values are omitted from API requests. However, any field with an
  347. // empty value appearing in NullFields will be sent to the server as
  348. // null. It is an error if a field in this list has a non-empty value.
  349. // This may be used to include null fields in Patch requests.
  350. NullFields []string `json:"-"`
  351. }
  352. func (s *OrderAddress) MarshalJSON() ([]byte, error) {
  353. type NoMethod OrderAddress
  354. raw := NoMethod(*s)
  355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  356. }
  357. type OrderCancellation struct {
  358. // Actor: The actor that created the cancellation.
  359. Actor string `json:"actor,omitempty"`
  360. // CreationDate: Date on which the cancellation has been created, in ISO
  361. // 8601 format.
  362. CreationDate string `json:"creationDate,omitempty"`
  363. // Quantity: The quantity that was canceled.
  364. Quantity int64 `json:"quantity,omitempty"`
  365. // Reason: The reason for the cancellation. Orders that are cancelled
  366. // with a noInventory reason will lead to the removal of the product
  367. // from Shopping Actions until you make an update to that product. This
  368. // will not affect your Shopping ads.
  369. Reason string `json:"reason,omitempty"`
  370. // ReasonText: The explanation of the reason.
  371. ReasonText string `json:"reasonText,omitempty"`
  372. // ForceSendFields is a list of field names (e.g. "Actor") to
  373. // unconditionally include in API requests. By default, fields with
  374. // empty values are omitted from API requests. However, any non-pointer,
  375. // non-interface field appearing in ForceSendFields will be sent to the
  376. // server regardless of whether the field is empty or not. This may be
  377. // used to include empty fields in Patch requests.
  378. ForceSendFields []string `json:"-"`
  379. // NullFields is a list of field names (e.g. "Actor") to include in API
  380. // requests with the JSON null value. By default, fields with empty
  381. // values are omitted from API requests. However, any field with an
  382. // empty value appearing in NullFields will be sent to the server as
  383. // null. It is an error if a field in this list has a non-empty value.
  384. // This may be used to include null fields in Patch requests.
  385. NullFields []string `json:"-"`
  386. }
  387. func (s *OrderCancellation) MarshalJSON() ([]byte, error) {
  388. type NoMethod OrderCancellation
  389. raw := NoMethod(*s)
  390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  391. }
  392. type OrderCustomer struct {
  393. // Email: Email address that should be used for order related
  394. // communications. In certain cases this might not be a real users
  395. // email, but a proxy email.
  396. Email string `json:"email,omitempty"`
  397. // ExplicitMarketingPreference: Deprecated. Please use
  398. // marketingRightsInfo instead.
  399. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  400. // FullName: Full name of the customer.
  401. FullName string `json:"fullName,omitempty"`
  402. // MarketingRightsInfo: Customer's marketing preferences.
  403. MarketingRightsInfo *OrderCustomerMarketingRightsInfo `json:"marketingRightsInfo,omitempty"`
  404. // ForceSendFields is a list of field names (e.g. "Email") to
  405. // unconditionally include in API requests. By default, fields with
  406. // empty values are omitted from API requests. However, any non-pointer,
  407. // non-interface field appearing in ForceSendFields will be sent to the
  408. // server regardless of whether the field is empty or not. This may be
  409. // used to include empty fields in Patch requests.
  410. ForceSendFields []string `json:"-"`
  411. // NullFields is a list of field names (e.g. "Email") to include in API
  412. // requests with the JSON null value. By default, fields with empty
  413. // values are omitted from API requests. However, any field with an
  414. // empty value appearing in NullFields will be sent to the server as
  415. // null. It is an error if a field in this list has a non-empty value.
  416. // This may be used to include null fields in Patch requests.
  417. NullFields []string `json:"-"`
  418. }
  419. func (s *OrderCustomer) MarshalJSON() ([]byte, error) {
  420. type NoMethod OrderCustomer
  421. raw := NoMethod(*s)
  422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  423. }
  424. type OrderCustomerMarketingRightsInfo struct {
  425. // ExplicitMarketingPreference: Last known user selection regarding
  426. // marketing preferences. In certain cases this selection might not be
  427. // known, so this field would be empty.
  428. ExplicitMarketingPreference string `json:"explicitMarketingPreference,omitempty"`
  429. // LastUpdatedTimestamp: Timestamp when last time marketing preference
  430. // was updated. Could be empty, if user wasn't offered a selection yet.
  431. LastUpdatedTimestamp string `json:"lastUpdatedTimestamp,omitempty"`
  432. // MarketingEmailAddress: Email address that can be used for marketing
  433. // purposes. This field is only filled when explicitMarketingPreference
  434. // is equal to 'granted'.
  435. MarketingEmailAddress string `json:"marketingEmailAddress,omitempty"`
  436. // ForceSendFields is a list of field names (e.g.
  437. // "ExplicitMarketingPreference") to unconditionally include in API
  438. // requests. By default, fields with empty values are omitted from API
  439. // requests. However, any non-pointer, non-interface field appearing in
  440. // ForceSendFields will be sent to the server regardless of whether the
  441. // field is empty or not. This may be used to include empty fields in
  442. // Patch requests.
  443. ForceSendFields []string `json:"-"`
  444. // NullFields is a list of field names (e.g.
  445. // "ExplicitMarketingPreference") to include in API requests with the
  446. // JSON null value. By default, fields with empty values are omitted
  447. // from API requests. However, any field with an empty value appearing
  448. // in NullFields will be sent to the server as null. It is an error if a
  449. // field in this list has a non-empty value. This may be used to include
  450. // null fields in Patch requests.
  451. NullFields []string `json:"-"`
  452. }
  453. func (s *OrderCustomerMarketingRightsInfo) MarshalJSON() ([]byte, error) {
  454. type NoMethod OrderCustomerMarketingRightsInfo
  455. raw := NoMethod(*s)
  456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  457. }
  458. type OrderDeliveryDetails struct {
  459. // Address: The delivery address
  460. Address *OrderAddress `json:"address,omitempty"`
  461. // PhoneNumber: The phone number of the person receiving the delivery.
  462. PhoneNumber string `json:"phoneNumber,omitempty"`
  463. // ForceSendFields is a list of field names (e.g. "Address") to
  464. // unconditionally include in API requests. By default, fields with
  465. // empty values are omitted from API requests. However, any non-pointer,
  466. // non-interface field appearing in ForceSendFields will be sent to the
  467. // server regardless of whether the field is empty or not. This may be
  468. // used to include empty fields in Patch requests.
  469. ForceSendFields []string `json:"-"`
  470. // NullFields is a list of field names (e.g. "Address") to include in
  471. // API requests with the JSON null value. By default, fields with empty
  472. // values are omitted from API requests. However, any field with an
  473. // empty value appearing in NullFields will be sent to the server as
  474. // null. It is an error if a field in this list has a non-empty value.
  475. // This may be used to include null fields in Patch requests.
  476. NullFields []string `json:"-"`
  477. }
  478. func (s *OrderDeliveryDetails) MarshalJSON() ([]byte, error) {
  479. type NoMethod OrderDeliveryDetails
  480. raw := NoMethod(*s)
  481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  482. }
  483. type OrderLineItem struct {
  484. // Annotations: Annotations that are attached to the line item.
  485. Annotations []*OrderMerchantProvidedAnnotation `json:"annotations,omitempty"`
  486. // Cancellations: Cancellations of the line item.
  487. Cancellations []*OrderCancellation `json:"cancellations,omitempty"`
  488. // Id: The id of the line item.
  489. Id string `json:"id,omitempty"`
  490. // Price: Total price for the line item. For example, if two items for
  491. // $10 are purchased, the total price will be $20.
  492. Price *Price `json:"price,omitempty"`
  493. // Product: Product data from the time of the order placement.
  494. Product *OrderLineItemProduct `json:"product,omitempty"`
  495. // QuantityCanceled: Number of items canceled.
  496. QuantityCanceled int64 `json:"quantityCanceled,omitempty"`
  497. // QuantityDelivered: Number of items delivered.
  498. QuantityDelivered int64 `json:"quantityDelivered,omitempty"`
  499. // QuantityOrdered: Number of items ordered.
  500. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  501. // QuantityPending: Number of items pending.
  502. QuantityPending int64 `json:"quantityPending,omitempty"`
  503. // QuantityReturned: Number of items returned.
  504. QuantityReturned int64 `json:"quantityReturned,omitempty"`
  505. // QuantityShipped: Number of items shipped.
  506. QuantityShipped int64 `json:"quantityShipped,omitempty"`
  507. // ReturnInfo: Details of the return policy for the line item.
  508. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  509. // Returns: Returns of the line item.
  510. Returns []*OrderReturn `json:"returns,omitempty"`
  511. // ShippingDetails: Details of the requested shipping for the line item.
  512. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  513. // Tax: Total tax amount for the line item. For example, if two items
  514. // are purchased, and each have a cost tax of $2, the total tax amount
  515. // will be $4.
  516. Tax *Price `json:"tax,omitempty"`
  517. // ForceSendFields is a list of field names (e.g. "Annotations") to
  518. // unconditionally include in API requests. By default, fields with
  519. // empty values are omitted from API requests. However, any non-pointer,
  520. // non-interface field appearing in ForceSendFields will be sent to the
  521. // server regardless of whether the field is empty or not. This may be
  522. // used to include empty fields in Patch requests.
  523. ForceSendFields []string `json:"-"`
  524. // NullFields is a list of field names (e.g. "Annotations") to include
  525. // in API requests with the JSON null value. By default, fields with
  526. // empty values are omitted from API requests. However, any field with
  527. // an empty value appearing in NullFields will be sent to the server as
  528. // null. It is an error if a field in this list has a non-empty value.
  529. // This may be used to include null fields in Patch requests.
  530. NullFields []string `json:"-"`
  531. }
  532. func (s *OrderLineItem) MarshalJSON() ([]byte, error) {
  533. type NoMethod OrderLineItem
  534. raw := NoMethod(*s)
  535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  536. }
  537. type OrderLineItemProduct struct {
  538. // Brand: Brand of the item.
  539. Brand string `json:"brand,omitempty"`
  540. // Channel: The item's channel (online or local).
  541. Channel string `json:"channel,omitempty"`
  542. // Condition: Condition or state of the item.
  543. Condition string `json:"condition,omitempty"`
  544. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  545. ContentLanguage string `json:"contentLanguage,omitempty"`
  546. // Gtin: Global Trade Item Number (GTIN) of the item.
  547. Gtin string `json:"gtin,omitempty"`
  548. // Id: The REST id of the product.
  549. Id string `json:"id,omitempty"`
  550. // ImageLink: URL of an image of the item.
  551. ImageLink string `json:"imageLink,omitempty"`
  552. // ItemGroupId: Shared identifier for all variants of the same product.
  553. ItemGroupId string `json:"itemGroupId,omitempty"`
  554. // Mpn: Manufacturer Part Number (MPN) of the item.
  555. Mpn string `json:"mpn,omitempty"`
  556. // OfferId: An identifier of the item.
  557. OfferId string `json:"offerId,omitempty"`
  558. // Price: Price of the item.
  559. Price *Price `json:"price,omitempty"`
  560. // ShownImage: URL to the cached image shown to the user when order was
  561. // placed.
  562. ShownImage string `json:"shownImage,omitempty"`
  563. // TargetCountry: The CLDR territory code of the target country of the
  564. // product.
  565. TargetCountry string `json:"targetCountry,omitempty"`
  566. // Title: The title of the product.
  567. Title string `json:"title,omitempty"`
  568. // VariantAttributes: Variant attributes for the item. These are
  569. // dimensions of the product, such as color, gender, material, pattern,
  570. // and size. You can find a comprehensive list of variant attributes
  571. // here.
  572. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  573. // ForceSendFields is a list of field names (e.g. "Brand") to
  574. // unconditionally include in API requests. By default, fields with
  575. // empty values are omitted from API requests. However, any non-pointer,
  576. // non-interface field appearing in ForceSendFields will be sent to the
  577. // server regardless of whether the field is empty or not. This may be
  578. // used to include empty fields in Patch requests.
  579. ForceSendFields []string `json:"-"`
  580. // NullFields is a list of field names (e.g. "Brand") to include in API
  581. // requests with the JSON null value. By default, fields with empty
  582. // values are omitted from API requests. However, any field with an
  583. // empty value appearing in NullFields will be sent to the server as
  584. // null. It is an error if a field in this list has a non-empty value.
  585. // This may be used to include null fields in Patch requests.
  586. NullFields []string `json:"-"`
  587. }
  588. func (s *OrderLineItemProduct) MarshalJSON() ([]byte, error) {
  589. type NoMethod OrderLineItemProduct
  590. raw := NoMethod(*s)
  591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  592. }
  593. type OrderLineItemProductVariantAttribute struct {
  594. // Dimension: The dimension of the variant.
  595. Dimension string `json:"dimension,omitempty"`
  596. // Value: The value for the dimension.
  597. Value string `json:"value,omitempty"`
  598. // ForceSendFields is a list of field names (e.g. "Dimension") to
  599. // unconditionally include in API requests. By default, fields with
  600. // empty values are omitted from API requests. However, any non-pointer,
  601. // non-interface field appearing in ForceSendFields will be sent to the
  602. // server regardless of whether the field is empty or not. This may be
  603. // used to include empty fields in Patch requests.
  604. ForceSendFields []string `json:"-"`
  605. // NullFields is a list of field names (e.g. "Dimension") to include in
  606. // API requests with the JSON null value. By default, fields with empty
  607. // values are omitted from API requests. However, any field with an
  608. // empty value appearing in NullFields will be sent to the server as
  609. // null. It is an error if a field in this list has a non-empty value.
  610. // This may be used to include null fields in Patch requests.
  611. NullFields []string `json:"-"`
  612. }
  613. func (s *OrderLineItemProductVariantAttribute) MarshalJSON() ([]byte, error) {
  614. type NoMethod OrderLineItemProductVariantAttribute
  615. raw := NoMethod(*s)
  616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  617. }
  618. type OrderLineItemReturnInfo struct {
  619. // DaysToReturn: How many days later the item can be returned.
  620. DaysToReturn int64 `json:"daysToReturn,omitempty"`
  621. // IsReturnable: Whether the item is returnable.
  622. IsReturnable bool `json:"isReturnable,omitempty"`
  623. // PolicyUrl: URL of the item return policy.
  624. PolicyUrl string `json:"policyUrl,omitempty"`
  625. // ForceSendFields is a list of field names (e.g. "DaysToReturn") to
  626. // unconditionally include in API requests. By default, fields with
  627. // empty values are omitted from API requests. However, any non-pointer,
  628. // non-interface field appearing in ForceSendFields will be sent to the
  629. // server regardless of whether the field is empty or not. This may be
  630. // used to include empty fields in Patch requests.
  631. ForceSendFields []string `json:"-"`
  632. // NullFields is a list of field names (e.g. "DaysToReturn") to include
  633. // in API requests with the JSON null value. By default, fields with
  634. // empty values are omitted from API requests. However, any field with
  635. // an empty value appearing in NullFields will be sent to the server as
  636. // null. It is an error if a field in this list has a non-empty value.
  637. // This may be used to include null fields in Patch requests.
  638. NullFields []string `json:"-"`
  639. }
  640. func (s *OrderLineItemReturnInfo) MarshalJSON() ([]byte, error) {
  641. type NoMethod OrderLineItemReturnInfo
  642. raw := NoMethod(*s)
  643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  644. }
  645. type OrderLineItemShippingDetails struct {
  646. // DeliverByDate: The delivery by date, in ISO 8601 format.
  647. DeliverByDate string `json:"deliverByDate,omitempty"`
  648. // Method: Details of the shipping method.
  649. Method *OrderLineItemShippingDetailsMethod `json:"method,omitempty"`
  650. // ShipByDate: The ship by date, in ISO 8601 format.
  651. ShipByDate string `json:"shipByDate,omitempty"`
  652. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  653. // unconditionally include in API requests. By default, fields with
  654. // empty values are omitted from API requests. However, any non-pointer,
  655. // non-interface field appearing in ForceSendFields will be sent to the
  656. // server regardless of whether the field is empty or not. This may be
  657. // used to include empty fields in Patch requests.
  658. ForceSendFields []string `json:"-"`
  659. // NullFields is a list of field names (e.g. "DeliverByDate") to include
  660. // in API requests with the JSON null value. By default, fields with
  661. // empty values are omitted from API requests. However, any field with
  662. // an empty value appearing in NullFields will be sent to the server as
  663. // null. It is an error if a field in this list has a non-empty value.
  664. // This may be used to include null fields in Patch requests.
  665. NullFields []string `json:"-"`
  666. }
  667. func (s *OrderLineItemShippingDetails) MarshalJSON() ([]byte, error) {
  668. type NoMethod OrderLineItemShippingDetails
  669. raw := NoMethod(*s)
  670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  671. }
  672. type OrderLineItemShippingDetailsMethod struct {
  673. // Carrier: The carrier for the shipping. Optional. See
  674. // shipments[].carrier for a list of acceptable values.
  675. Carrier string `json:"carrier,omitempty"`
  676. // MaxDaysInTransit: Maximum transit time.
  677. MaxDaysInTransit int64 `json:"maxDaysInTransit,omitempty"`
  678. // MethodName: The name of the shipping method.
  679. MethodName string `json:"methodName,omitempty"`
  680. // MinDaysInTransit: Minimum transit time.
  681. MinDaysInTransit int64 `json:"minDaysInTransit,omitempty"`
  682. // ForceSendFields is a list of field names (e.g. "Carrier") to
  683. // unconditionally include in API requests. By default, fields with
  684. // empty values are omitted from API requests. However, any non-pointer,
  685. // non-interface field appearing in ForceSendFields will be sent to the
  686. // server regardless of whether the field is empty or not. This may be
  687. // used to include empty fields in Patch requests.
  688. ForceSendFields []string `json:"-"`
  689. // NullFields is a list of field names (e.g. "Carrier") to include in
  690. // API requests with the JSON null value. By default, fields with empty
  691. // values are omitted from API requests. However, any field with an
  692. // empty value appearing in NullFields will be sent to the server as
  693. // null. It is an error if a field in this list has a non-empty value.
  694. // This may be used to include null fields in Patch requests.
  695. NullFields []string `json:"-"`
  696. }
  697. func (s *OrderLineItemShippingDetailsMethod) MarshalJSON() ([]byte, error) {
  698. type NoMethod OrderLineItemShippingDetailsMethod
  699. raw := NoMethod(*s)
  700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  701. }
  702. type OrderMerchantProvidedAnnotation struct {
  703. // Key: Key for additional merchant provided (as key-value pairs)
  704. // annotation about the line item.
  705. Key string `json:"key,omitempty"`
  706. // Value: Value for additional merchant provided (as key-value pairs)
  707. // annotation about the line item.
  708. Value string `json:"value,omitempty"`
  709. // ForceSendFields is a list of field names (e.g. "Key") to
  710. // unconditionally include in API requests. By default, fields with
  711. // empty values are omitted from API requests. However, any non-pointer,
  712. // non-interface field appearing in ForceSendFields will be sent to the
  713. // server regardless of whether the field is empty or not. This may be
  714. // used to include empty fields in Patch requests.
  715. ForceSendFields []string `json:"-"`
  716. // NullFields is a list of field names (e.g. "Key") to include in API
  717. // requests with the JSON null value. By default, fields with empty
  718. // values are omitted from API requests. However, any field with an
  719. // empty value appearing in NullFields will be sent to the server as
  720. // null. It is an error if a field in this list has a non-empty value.
  721. // This may be used to include null fields in Patch requests.
  722. NullFields []string `json:"-"`
  723. }
  724. func (s *OrderMerchantProvidedAnnotation) MarshalJSON() ([]byte, error) {
  725. type NoMethod OrderMerchantProvidedAnnotation
  726. raw := NoMethod(*s)
  727. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  728. }
  729. type OrderPaymentMethod struct {
  730. // BillingAddress: The billing address.
  731. BillingAddress *OrderAddress `json:"billingAddress,omitempty"`
  732. // ExpirationMonth: The card expiration month (January = 1, February = 2
  733. // etc.).
  734. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  735. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  736. ExpirationYear int64 `json:"expirationYear,omitempty"`
  737. // LastFourDigits: The last four digits of the card number.
  738. LastFourDigits string `json:"lastFourDigits,omitempty"`
  739. // PhoneNumber: The billing phone number.
  740. PhoneNumber string `json:"phoneNumber,omitempty"`
  741. // Type: The type of instrument.
  742. //
  743. // Acceptable values are:
  744. // - "AMEX"
  745. // - "DISCOVER"
  746. // - "JCB"
  747. // - "MASTERCARD"
  748. // - "UNIONPAY"
  749. // - "VISA"
  750. // - ""
  751. Type string `json:"type,omitempty"`
  752. // ForceSendFields is a list of field names (e.g. "BillingAddress") to
  753. // unconditionally include in API requests. By default, fields with
  754. // empty values are omitted from API requests. However, any non-pointer,
  755. // non-interface field appearing in ForceSendFields will be sent to the
  756. // server regardless of whether the field is empty or not. This may be
  757. // used to include empty fields in Patch requests.
  758. ForceSendFields []string `json:"-"`
  759. // NullFields is a list of field names (e.g. "BillingAddress") to
  760. // include in API requests with the JSON null value. By default, fields
  761. // with empty values are omitted from API requests. However, any field
  762. // with an empty value appearing in NullFields will be sent to the
  763. // server as null. It is an error if a field in this list has a
  764. // non-empty value. This may be used to include null fields in Patch
  765. // requests.
  766. NullFields []string `json:"-"`
  767. }
  768. func (s *OrderPaymentMethod) MarshalJSON() ([]byte, error) {
  769. type NoMethod OrderPaymentMethod
  770. raw := NoMethod(*s)
  771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  772. }
  773. type OrderPromotion struct {
  774. Benefits []*OrderPromotionBenefit `json:"benefits,omitempty"`
  775. // EffectiveDates: The date and time frame when the promotion is active
  776. // and ready for validation review. Note that the promotion live time
  777. // may be delayed for a few hours due to the validation review.
  778. // Start date and end date are separated by a forward slash (/). The
  779. // start date is specified by the format (YYYY-MM-DD), followed by the
  780. // letter ?T?, the time of the day when the sale starts (in Greenwich
  781. // Mean Time, GMT), followed by an expression of the time zone for the
  782. // sale. The end date is in the same format.
  783. EffectiveDates string `json:"effectiveDates,omitempty"`
  784. // GenericRedemptionCode: Optional. The text code that corresponds to
  785. // the promotion when applied on the retailer?s website.
  786. GenericRedemptionCode string `json:"genericRedemptionCode,omitempty"`
  787. // Id: The unique ID of the promotion.
  788. Id string `json:"id,omitempty"`
  789. // LongTitle: The full title of the promotion.
  790. LongTitle string `json:"longTitle,omitempty"`
  791. // ProductApplicability: Whether the promotion is applicable to all
  792. // products or only specific products.
  793. ProductApplicability string `json:"productApplicability,omitempty"`
  794. // RedemptionChannel: Indicates that the promotion is valid online.
  795. RedemptionChannel string `json:"redemptionChannel,omitempty"`
  796. // ForceSendFields is a list of field names (e.g. "Benefits") to
  797. // unconditionally include in API requests. By default, fields with
  798. // empty values are omitted from API requests. However, any non-pointer,
  799. // non-interface field appearing in ForceSendFields will be sent to the
  800. // server regardless of whether the field is empty or not. This may be
  801. // used to include empty fields in Patch requests.
  802. ForceSendFields []string `json:"-"`
  803. // NullFields is a list of field names (e.g. "Benefits") to include in
  804. // API requests with the JSON null value. By default, fields with empty
  805. // values are omitted from API requests. However, any field with an
  806. // empty value appearing in NullFields will be sent to the server as
  807. // null. It is an error if a field in this list has a non-empty value.
  808. // This may be used to include null fields in Patch requests.
  809. NullFields []string `json:"-"`
  810. }
  811. func (s *OrderPromotion) MarshalJSON() ([]byte, error) {
  812. type NoMethod OrderPromotion
  813. raw := NoMethod(*s)
  814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  815. }
  816. type OrderPromotionBenefit struct {
  817. // Discount: The discount in the order price when the promotion is
  818. // applied.
  819. Discount *Price `json:"discount,omitempty"`
  820. // OfferIds: The OfferId(s) that were purchased in this order and map to
  821. // this specific benefit of the promotion.
  822. OfferIds []string `json:"offerIds,omitempty"`
  823. // SubType: Further describes the benefit of the promotion. Note that we
  824. // will expand on this enumeration as we support new promotion
  825. // sub-types.
  826. SubType string `json:"subType,omitempty"`
  827. // TaxImpact: The impact on tax when the promotion is applied.
  828. TaxImpact *Price `json:"taxImpact,omitempty"`
  829. // Type: Describes whether the promotion applies to products (e.g. 20%
  830. // off) or to shipping (e.g. Free Shipping).
  831. Type string `json:"type,omitempty"`
  832. // ForceSendFields is a list of field names (e.g. "Discount") to
  833. // unconditionally include in API requests. By default, fields with
  834. // empty values are omitted from API requests. However, any non-pointer,
  835. // non-interface field appearing in ForceSendFields will be sent to the
  836. // server regardless of whether the field is empty or not. This may be
  837. // used to include empty fields in Patch requests.
  838. ForceSendFields []string `json:"-"`
  839. // NullFields is a list of field names (e.g. "Discount") to include in
  840. // API requests with the JSON null value. By default, fields with empty
  841. // values are omitted from API requests. However, any field with an
  842. // empty value appearing in NullFields will be sent to the server as
  843. // null. It is an error if a field in this list has a non-empty value.
  844. // This may be used to include null fields in Patch requests.
  845. NullFields []string `json:"-"`
  846. }
  847. func (s *OrderPromotionBenefit) MarshalJSON() ([]byte, error) {
  848. type NoMethod OrderPromotionBenefit
  849. raw := NoMethod(*s)
  850. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  851. }
  852. type OrderRefund struct {
  853. // Actor: The actor that created the refund.
  854. Actor string `json:"actor,omitempty"`
  855. // Amount: The amount that is refunded.
  856. Amount *Price `json:"amount,omitempty"`
  857. // CreationDate: Date on which the item has been created, in ISO 8601
  858. // format.
  859. CreationDate string `json:"creationDate,omitempty"`
  860. // Reason: The reason for the refund.
  861. Reason string `json:"reason,omitempty"`
  862. // ReasonText: The explanation of the reason.
  863. ReasonText string `json:"reasonText,omitempty"`
  864. // ForceSendFields is a list of field names (e.g. "Actor") to
  865. // unconditionally include in API requests. By default, fields with
  866. // empty values are omitted from API requests. However, any non-pointer,
  867. // non-interface field appearing in ForceSendFields will be sent to the
  868. // server regardless of whether the field is empty or not. This may be
  869. // used to include empty fields in Patch requests.
  870. ForceSendFields []string `json:"-"`
  871. // NullFields is a list of field names (e.g. "Actor") to include in API
  872. // requests with the JSON null value. By default, fields with empty
  873. // values are omitted from API requests. However, any field with an
  874. // empty value appearing in NullFields will be sent to the server as
  875. // null. It is an error if a field in this list has a non-empty value.
  876. // This may be used to include null fields in Patch requests.
  877. NullFields []string `json:"-"`
  878. }
  879. func (s *OrderRefund) MarshalJSON() ([]byte, error) {
  880. type NoMethod OrderRefund
  881. raw := NoMethod(*s)
  882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  883. }
  884. type OrderReturn struct {
  885. // Actor: The actor that created the refund.
  886. Actor string `json:"actor,omitempty"`
  887. // CreationDate: Date on which the item has been created, in ISO 8601
  888. // format.
  889. CreationDate string `json:"creationDate,omitempty"`
  890. // Quantity: Quantity that is returned.
  891. Quantity int64 `json:"quantity,omitempty"`
  892. // Reason: The reason for the return.
  893. Reason string `json:"reason,omitempty"`
  894. // ReasonText: The explanation of the reason.
  895. ReasonText string `json:"reasonText,omitempty"`
  896. // ForceSendFields is a list of field names (e.g. "Actor") to
  897. // unconditionally include in API requests. By default, fields with
  898. // empty values are omitted from API requests. However, any non-pointer,
  899. // non-interface field appearing in ForceSendFields will be sent to the
  900. // server regardless of whether the field is empty or not. This may be
  901. // used to include empty fields in Patch requests.
  902. ForceSendFields []string `json:"-"`
  903. // NullFields is a list of field names (e.g. "Actor") to include in API
  904. // requests with the JSON null value. By default, fields with empty
  905. // values are omitted from API requests. However, any field with an
  906. // empty value appearing in NullFields will be sent to the server as
  907. // null. It is an error if a field in this list has a non-empty value.
  908. // This may be used to include null fields in Patch requests.
  909. NullFields []string `json:"-"`
  910. }
  911. func (s *OrderReturn) MarshalJSON() ([]byte, error) {
  912. type NoMethod OrderReturn
  913. raw := NoMethod(*s)
  914. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  915. }
  916. type OrderShipment struct {
  917. // Carrier: The carrier handling the shipment.
  918. //
  919. // Acceptable values are:
  920. // - "gsx"
  921. // - "ups"
  922. // - "usps"
  923. // - "fedex"
  924. // - "dhl"
  925. // - "ecourier"
  926. // - "cxt"
  927. // - "google"
  928. // - "ontrac"
  929. // - "emsy"
  930. // - "ont"
  931. // - "deliv"
  932. // - "dynamex"
  933. // - "lasership"
  934. // - "mpx"
  935. // - "uds"
  936. Carrier string `json:"carrier,omitempty"`
  937. // CreationDate: Date on which the shipment has been created, in ISO
  938. // 8601 format.
  939. CreationDate string `json:"creationDate,omitempty"`
  940. // DeliveryDate: Date on which the shipment has been delivered, in ISO
  941. // 8601 format. Present only if status is delievered
  942. DeliveryDate string `json:"deliveryDate,omitempty"`
  943. // Id: The id of the shipment.
  944. Id string `json:"id,omitempty"`
  945. // LineItems: The line items that are shipped.
  946. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  947. // Status: The status of the shipment.
  948. Status string `json:"status,omitempty"`
  949. // TrackingId: The tracking id for the shipment.
  950. TrackingId string `json:"trackingId,omitempty"`
  951. // ForceSendFields is a list of field names (e.g. "Carrier") to
  952. // unconditionally include in API requests. By default, fields with
  953. // empty values are omitted from API requests. However, any non-pointer,
  954. // non-interface field appearing in ForceSendFields will be sent to the
  955. // server regardless of whether the field is empty or not. This may be
  956. // used to include empty fields in Patch requests.
  957. ForceSendFields []string `json:"-"`
  958. // NullFields is a list of field names (e.g. "Carrier") to include in
  959. // API requests with the JSON null value. By default, fields with empty
  960. // values are omitted from API requests. However, any field with an
  961. // empty value appearing in NullFields will be sent to the server as
  962. // null. It is an error if a field in this list has a non-empty value.
  963. // This may be used to include null fields in Patch requests.
  964. NullFields []string `json:"-"`
  965. }
  966. func (s *OrderShipment) MarshalJSON() ([]byte, error) {
  967. type NoMethod OrderShipment
  968. raw := NoMethod(*s)
  969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  970. }
  971. type OrderShipmentLineItemShipment struct {
  972. // LineItemId: The id of the line item that is shipped. Either
  973. // lineItemId or productId is required.
  974. LineItemId string `json:"lineItemId,omitempty"`
  975. // ProductId: The ID of the product to ship. This is the REST ID used in
  976. // the products service. Either lineItemId or productId is required.
  977. ProductId string `json:"productId,omitempty"`
  978. // Quantity: The quantity that is shipped.
  979. Quantity int64 `json:"quantity,omitempty"`
  980. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  981. // unconditionally include in API requests. By default, fields with
  982. // empty values are omitted from API requests. However, any non-pointer,
  983. // non-interface field appearing in ForceSendFields will be sent to the
  984. // server regardless of whether the field is empty or not. This may be
  985. // used to include empty fields in Patch requests.
  986. ForceSendFields []string `json:"-"`
  987. // NullFields is a list of field names (e.g. "LineItemId") to include in
  988. // API requests with the JSON null value. By default, fields with empty
  989. // values are omitted from API requests. However, any field with an
  990. // empty value appearing in NullFields will be sent to the server as
  991. // null. It is an error if a field in this list has a non-empty value.
  992. // This may be used to include null fields in Patch requests.
  993. NullFields []string `json:"-"`
  994. }
  995. func (s *OrderShipmentLineItemShipment) MarshalJSON() ([]byte, error) {
  996. type NoMethod OrderShipmentLineItemShipment
  997. raw := NoMethod(*s)
  998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  999. }
  1000. type OrderinvoicesCreateChargeInvoiceRequest struct {
  1001. // InvoiceId: The ID of the invoice.
  1002. InvoiceId string `json:"invoiceId,omitempty"`
  1003. // InvoiceSummary: Invoice summary.
  1004. InvoiceSummary *InvoiceSummary `json:"invoiceSummary,omitempty"`
  1005. // LineItemInvoices: Invoice details per line item.
  1006. LineItemInvoices []*ShipmentInvoiceLineItemInvoice `json:"lineItemInvoices,omitempty"`
  1007. // OperationId: The ID of the operation, unique across all operations
  1008. // for a given order.
  1009. OperationId string `json:"operationId,omitempty"`
  1010. // ShipmentGroupId: ID of the shipment group.
  1011. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  1012. // ForceSendFields is a list of field names (e.g. "InvoiceId") to
  1013. // unconditionally include in API requests. By default, fields with
  1014. // empty values are omitted from API requests. However, any non-pointer,
  1015. // non-interface field appearing in ForceSendFields will be sent to the
  1016. // server regardless of whether the field is empty or not. This may be
  1017. // used to include empty fields in Patch requests.
  1018. ForceSendFields []string `json:"-"`
  1019. // NullFields is a list of field names (e.g. "InvoiceId") to include in
  1020. // API requests with the JSON null value. By default, fields with empty
  1021. // values are omitted from API requests. However, any field with an
  1022. // empty value appearing in NullFields will be sent to the server as
  1023. // null. It is an error if a field in this list has a non-empty value.
  1024. // This may be used to include null fields in Patch requests.
  1025. NullFields []string `json:"-"`
  1026. }
  1027. func (s *OrderinvoicesCreateChargeInvoiceRequest) MarshalJSON() ([]byte, error) {
  1028. type NoMethod OrderinvoicesCreateChargeInvoiceRequest
  1029. raw := NoMethod(*s)
  1030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1031. }
  1032. type OrderinvoicesCreateChargeInvoiceResponse struct {
  1033. // ExecutionStatus: The status of the execution.
  1034. ExecutionStatus string `json:"executionStatus,omitempty"`
  1035. // Kind: Identifies what kind of resource this is. Value: the fixed
  1036. // string "content#orderinvoicesCreateChargeInvoiceResponse".
  1037. Kind string `json:"kind,omitempty"`
  1038. // ServerResponse contains the HTTP response code and headers from the
  1039. // server.
  1040. googleapi.ServerResponse `json:"-"`
  1041. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1042. // unconditionally include in API requests. By default, fields with
  1043. // empty values are omitted from API requests. However, any non-pointer,
  1044. // non-interface field appearing in ForceSendFields will be sent to the
  1045. // server regardless of whether the field is empty or not. This may be
  1046. // used to include empty fields in Patch requests.
  1047. ForceSendFields []string `json:"-"`
  1048. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1049. // include in API requests with the JSON null value. By default, fields
  1050. // with empty values are omitted from API requests. However, any field
  1051. // with an empty value appearing in NullFields will be sent to the
  1052. // server as null. It is an error if a field in this list has a
  1053. // non-empty value. This may be used to include null fields in Patch
  1054. // requests.
  1055. NullFields []string `json:"-"`
  1056. }
  1057. func (s *OrderinvoicesCreateChargeInvoiceResponse) MarshalJSON() ([]byte, error) {
  1058. type NoMethod OrderinvoicesCreateChargeInvoiceResponse
  1059. raw := NoMethod(*s)
  1060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1061. }
  1062. type OrderinvoicesCreateRefundInvoiceRequest struct {
  1063. // InvoiceId: The ID of the invoice.
  1064. InvoiceId string `json:"invoiceId,omitempty"`
  1065. // OperationId: The ID of the operation, unique across all operations
  1066. // for a given order.
  1067. OperationId string `json:"operationId,omitempty"`
  1068. // RefundOnlyOption: Option to create a refund-only invoice. Exactly one
  1069. // of refund_option and return_option must be provided.
  1070. RefundOnlyOption *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption `json:"refundOnlyOption,omitempty"`
  1071. // ReturnOption: Option to create an invoice for a refund and mark all
  1072. // items within the invoice as returned. Exactly one of refund_option
  1073. // and return_option must be provided.
  1074. ReturnOption *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption `json:"returnOption,omitempty"`
  1075. // ShipmentInvoices: Invoice details for different shipment groups.
  1076. ShipmentInvoices []*ShipmentInvoice `json:"shipmentInvoices,omitempty"`
  1077. // ForceSendFields is a list of field names (e.g. "InvoiceId") to
  1078. // unconditionally include in API requests. By default, fields with
  1079. // empty values are omitted from API requests. However, any non-pointer,
  1080. // non-interface field appearing in ForceSendFields will be sent to the
  1081. // server regardless of whether the field is empty or not. This may be
  1082. // used to include empty fields in Patch requests.
  1083. ForceSendFields []string `json:"-"`
  1084. // NullFields is a list of field names (e.g. "InvoiceId") to include in
  1085. // API requests with the JSON null value. By default, fields with empty
  1086. // values are omitted from API requests. However, any field with an
  1087. // empty value appearing in NullFields will be sent to the server as
  1088. // null. It is an error if a field in this list has a non-empty value.
  1089. // This may be used to include null fields in Patch requests.
  1090. NullFields []string `json:"-"`
  1091. }
  1092. func (s *OrderinvoicesCreateRefundInvoiceRequest) MarshalJSON() ([]byte, error) {
  1093. type NoMethod OrderinvoicesCreateRefundInvoiceRequest
  1094. raw := NoMethod(*s)
  1095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1096. }
  1097. type OrderinvoicesCreateRefundInvoiceResponse struct {
  1098. // ExecutionStatus: The status of the execution.
  1099. ExecutionStatus string `json:"executionStatus,omitempty"`
  1100. // Kind: Identifies what kind of resource this is. Value: the fixed
  1101. // string "content#orderinvoicesCreateRefundInvoiceResponse".
  1102. Kind string `json:"kind,omitempty"`
  1103. // ServerResponse contains the HTTP response code and headers from the
  1104. // server.
  1105. googleapi.ServerResponse `json:"-"`
  1106. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1107. // unconditionally include in API requests. By default, fields with
  1108. // empty values are omitted from API requests. However, any non-pointer,
  1109. // non-interface field appearing in ForceSendFields will be sent to the
  1110. // server regardless of whether the field is empty or not. This may be
  1111. // used to include empty fields in Patch requests.
  1112. ForceSendFields []string `json:"-"`
  1113. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1114. // include in API requests with the JSON null value. By default, fields
  1115. // with empty values are omitted from API requests. However, any field
  1116. // with an empty value appearing in NullFields will be sent to the
  1117. // server as null. It is an error if a field in this list has a
  1118. // non-empty value. This may be used to include null fields in Patch
  1119. // requests.
  1120. NullFields []string `json:"-"`
  1121. }
  1122. func (s *OrderinvoicesCreateRefundInvoiceResponse) MarshalJSON() ([]byte, error) {
  1123. type NoMethod OrderinvoicesCreateRefundInvoiceResponse
  1124. raw := NoMethod(*s)
  1125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1126. }
  1127. type OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption struct {
  1128. // Description: Optional description of the refund reason.
  1129. Description string `json:"description,omitempty"`
  1130. // Reason: Reason for the refund.
  1131. Reason string `json:"reason,omitempty"`
  1132. // ForceSendFields is a list of field names (e.g. "Description") to
  1133. // unconditionally include in API requests. By default, fields with
  1134. // empty values are omitted from API requests. However, any non-pointer,
  1135. // non-interface field appearing in ForceSendFields will be sent to the
  1136. // server regardless of whether the field is empty or not. This may be
  1137. // used to include empty fields in Patch requests.
  1138. ForceSendFields []string `json:"-"`
  1139. // NullFields is a list of field names (e.g. "Description") to include
  1140. // in API requests with the JSON null value. By default, fields with
  1141. // empty values are omitted from API requests. However, any field with
  1142. // an empty value appearing in NullFields will be sent to the server as
  1143. // null. It is an error if a field in this list has a non-empty value.
  1144. // This may be used to include null fields in Patch requests.
  1145. NullFields []string `json:"-"`
  1146. }
  1147. func (s *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption) MarshalJSON() ([]byte, error) {
  1148. type NoMethod OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption
  1149. raw := NoMethod(*s)
  1150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1151. }
  1152. type OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption struct {
  1153. // Description: Optional description of the return reason.
  1154. Description string `json:"description,omitempty"`
  1155. // Reason: Reason for the return.
  1156. Reason string `json:"reason,omitempty"`
  1157. // ForceSendFields is a list of field names (e.g. "Description") to
  1158. // unconditionally include in API requests. By default, fields with
  1159. // empty values are omitted from API requests. However, any non-pointer,
  1160. // non-interface field appearing in ForceSendFields will be sent to the
  1161. // server regardless of whether the field is empty or not. This may be
  1162. // used to include empty fields in Patch requests.
  1163. ForceSendFields []string `json:"-"`
  1164. // NullFields is a list of field names (e.g. "Description") to include
  1165. // in API requests with the JSON null value. By default, fields with
  1166. // empty values are omitted from API requests. However, any field with
  1167. // an empty value appearing in NullFields will be sent to the server as
  1168. // null. It is an error if a field in this list has a non-empty value.
  1169. // This may be used to include null fields in Patch requests.
  1170. NullFields []string `json:"-"`
  1171. }
  1172. func (s *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption) MarshalJSON() ([]byte, error) {
  1173. type NoMethod OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption
  1174. raw := NoMethod(*s)
  1175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1176. }
  1177. type OrderpaymentsNotifyAuthApprovedRequest struct {
  1178. AuthAmountPretax *Price `json:"authAmountPretax,omitempty"`
  1179. AuthAmountTax *Price `json:"authAmountTax,omitempty"`
  1180. // ForceSendFields is a list of field names (e.g. "AuthAmountPretax") to
  1181. // unconditionally include in API requests. By default, fields with
  1182. // empty values are omitted from API requests. However, any non-pointer,
  1183. // non-interface field appearing in ForceSendFields will be sent to the
  1184. // server regardless of whether the field is empty or not. This may be
  1185. // used to include empty fields in Patch requests.
  1186. ForceSendFields []string `json:"-"`
  1187. // NullFields is a list of field names (e.g. "AuthAmountPretax") to
  1188. // include in API requests with the JSON null value. By default, fields
  1189. // with empty values are omitted from API requests. However, any field
  1190. // with an empty value appearing in NullFields will be sent to the
  1191. // server as null. It is an error if a field in this list has a
  1192. // non-empty value. This may be used to include null fields in Patch
  1193. // requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *OrderpaymentsNotifyAuthApprovedRequest) MarshalJSON() ([]byte, error) {
  1197. type NoMethod OrderpaymentsNotifyAuthApprovedRequest
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. type OrderpaymentsNotifyAuthApprovedResponse struct {
  1202. // ExecutionStatus: The status of the execution.
  1203. ExecutionStatus string `json:"executionStatus,omitempty"`
  1204. // Kind: Identifies what kind of resource this is. Value: the fixed
  1205. // string "content#orderpaymentsNotifyAuthApprovedResponse".
  1206. Kind string `json:"kind,omitempty"`
  1207. // ServerResponse contains the HTTP response code and headers from the
  1208. // server.
  1209. googleapi.ServerResponse `json:"-"`
  1210. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1211. // unconditionally include in API requests. By default, fields with
  1212. // empty values are omitted from API requests. However, any non-pointer,
  1213. // non-interface field appearing in ForceSendFields will be sent to the
  1214. // server regardless of whether the field is empty or not. This may be
  1215. // used to include empty fields in Patch requests.
  1216. ForceSendFields []string `json:"-"`
  1217. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1218. // include in API requests with the JSON null value. By default, fields
  1219. // with empty values are omitted from API requests. However, any field
  1220. // with an empty value appearing in NullFields will be sent to the
  1221. // server as null. It is an error if a field in this list has a
  1222. // non-empty value. This may be used to include null fields in Patch
  1223. // requests.
  1224. NullFields []string `json:"-"`
  1225. }
  1226. func (s *OrderpaymentsNotifyAuthApprovedResponse) MarshalJSON() ([]byte, error) {
  1227. type NoMethod OrderpaymentsNotifyAuthApprovedResponse
  1228. raw := NoMethod(*s)
  1229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1230. }
  1231. type OrderpaymentsNotifyAuthDeclinedRequest struct {
  1232. // DeclineReason: Reason why payment authorization was declined.
  1233. DeclineReason string `json:"declineReason,omitempty"`
  1234. // ForceSendFields is a list of field names (e.g. "DeclineReason") to
  1235. // unconditionally include in API requests. By default, fields with
  1236. // empty values are omitted from API requests. However, any non-pointer,
  1237. // non-interface field appearing in ForceSendFields will be sent to the
  1238. // server regardless of whether the field is empty or not. This may be
  1239. // used to include empty fields in Patch requests.
  1240. ForceSendFields []string `json:"-"`
  1241. // NullFields is a list of field names (e.g. "DeclineReason") to include
  1242. // in API requests with the JSON null value. By default, fields with
  1243. // empty values are omitted from API requests. However, any field with
  1244. // an empty value appearing in NullFields will be sent to the server as
  1245. // null. It is an error if a field in this list has a non-empty value.
  1246. // This may be used to include null fields in Patch requests.
  1247. NullFields []string `json:"-"`
  1248. }
  1249. func (s *OrderpaymentsNotifyAuthDeclinedRequest) MarshalJSON() ([]byte, error) {
  1250. type NoMethod OrderpaymentsNotifyAuthDeclinedRequest
  1251. raw := NoMethod(*s)
  1252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1253. }
  1254. type OrderpaymentsNotifyAuthDeclinedResponse struct {
  1255. // ExecutionStatus: The status of the execution.
  1256. ExecutionStatus string `json:"executionStatus,omitempty"`
  1257. // Kind: Identifies what kind of resource this is. Value: the fixed
  1258. // string "content#orderpaymentsNotifyAuthDeclinedResponse".
  1259. Kind string `json:"kind,omitempty"`
  1260. // ServerResponse contains the HTTP response code and headers from the
  1261. // server.
  1262. googleapi.ServerResponse `json:"-"`
  1263. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1264. // unconditionally include in API requests. By default, fields with
  1265. // empty values are omitted from API requests. However, any non-pointer,
  1266. // non-interface field appearing in ForceSendFields will be sent to the
  1267. // server regardless of whether the field is empty or not. This may be
  1268. // used to include empty fields in Patch requests.
  1269. ForceSendFields []string `json:"-"`
  1270. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1271. // include in API requests with the JSON null value. By default, fields
  1272. // with empty values are omitted from API requests. However, any field
  1273. // with an empty value appearing in NullFields will be sent to the
  1274. // server as null. It is an error if a field in this list has a
  1275. // non-empty value. This may be used to include null fields in Patch
  1276. // requests.
  1277. NullFields []string `json:"-"`
  1278. }
  1279. func (s *OrderpaymentsNotifyAuthDeclinedResponse) MarshalJSON() ([]byte, error) {
  1280. type NoMethod OrderpaymentsNotifyAuthDeclinedResponse
  1281. raw := NoMethod(*s)
  1282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1283. }
  1284. type OrderpaymentsNotifyChargeRequest struct {
  1285. // ChargeState: Whether charge was successful.
  1286. ChargeState string `json:"chargeState,omitempty"`
  1287. // InvoiceId: Invoice ID from orderInvoice service that corresponds to
  1288. // the charge.
  1289. InvoiceId string `json:"invoiceId,omitempty"`
  1290. // ForceSendFields is a list of field names (e.g. "ChargeState") to
  1291. // unconditionally include in API requests. By default, fields with
  1292. // empty values are omitted from API requests. However, any non-pointer,
  1293. // non-interface field appearing in ForceSendFields will be sent to the
  1294. // server regardless of whether the field is empty or not. This may be
  1295. // used to include empty fields in Patch requests.
  1296. ForceSendFields []string `json:"-"`
  1297. // NullFields is a list of field names (e.g. "ChargeState") to include
  1298. // in API requests with the JSON null value. By default, fields with
  1299. // empty values are omitted from API requests. However, any field with
  1300. // an empty value appearing in NullFields will be sent to the server as
  1301. // null. It is an error if a field in this list has a non-empty value.
  1302. // This may be used to include null fields in Patch requests.
  1303. NullFields []string `json:"-"`
  1304. }
  1305. func (s *OrderpaymentsNotifyChargeRequest) MarshalJSON() ([]byte, error) {
  1306. type NoMethod OrderpaymentsNotifyChargeRequest
  1307. raw := NoMethod(*s)
  1308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1309. }
  1310. type OrderpaymentsNotifyChargeResponse struct {
  1311. // ExecutionStatus: The status of the execution.
  1312. ExecutionStatus string `json:"executionStatus,omitempty"`
  1313. // Kind: Identifies what kind of resource this is. Value: the fixed
  1314. // string "content#orderpaymentsNotifyChargeResponse".
  1315. Kind string `json:"kind,omitempty"`
  1316. // ServerResponse contains the HTTP response code and headers from the
  1317. // server.
  1318. googleapi.ServerResponse `json:"-"`
  1319. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1320. // unconditionally include in API requests. By default, fields with
  1321. // empty values are omitted from API requests. However, any non-pointer,
  1322. // non-interface field appearing in ForceSendFields will be sent to the
  1323. // server regardless of whether the field is empty or not. This may be
  1324. // used to include empty fields in Patch requests.
  1325. ForceSendFields []string `json:"-"`
  1326. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1327. // include in API requests with the JSON null value. By default, fields
  1328. // with empty values are omitted from API requests. However, any field
  1329. // with an empty value appearing in NullFields will be sent to the
  1330. // server as null. It is an error if a field in this list has a
  1331. // non-empty value. This may be used to include null fields in Patch
  1332. // requests.
  1333. NullFields []string `json:"-"`
  1334. }
  1335. func (s *OrderpaymentsNotifyChargeResponse) MarshalJSON() ([]byte, error) {
  1336. type NoMethod OrderpaymentsNotifyChargeResponse
  1337. raw := NoMethod(*s)
  1338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1339. }
  1340. type OrderpaymentsNotifyRefundRequest struct {
  1341. // InvoiceId: Invoice ID from orderInvoice service that corresponds to
  1342. // the charge.
  1343. InvoiceId string `json:"invoiceId,omitempty"`
  1344. // RefundState: Whether refund was successful.
  1345. RefundState string `json:"refundState,omitempty"`
  1346. // ForceSendFields is a list of field names (e.g. "InvoiceId") to
  1347. // unconditionally include in API requests. By default, fields with
  1348. // empty values are omitted from API requests. However, any non-pointer,
  1349. // non-interface field appearing in ForceSendFields will be sent to the
  1350. // server regardless of whether the field is empty or not. This may be
  1351. // used to include empty fields in Patch requests.
  1352. ForceSendFields []string `json:"-"`
  1353. // NullFields is a list of field names (e.g. "InvoiceId") to include in
  1354. // API requests with the JSON null value. By default, fields with empty
  1355. // values are omitted from API requests. However, any field with an
  1356. // empty value appearing in NullFields will be sent to the server as
  1357. // null. It is an error if a field in this list has a non-empty value.
  1358. // This may be used to include null fields in Patch requests.
  1359. NullFields []string `json:"-"`
  1360. }
  1361. func (s *OrderpaymentsNotifyRefundRequest) MarshalJSON() ([]byte, error) {
  1362. type NoMethod OrderpaymentsNotifyRefundRequest
  1363. raw := NoMethod(*s)
  1364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1365. }
  1366. type OrderpaymentsNotifyRefundResponse struct {
  1367. // ExecutionStatus: The status of the execution.
  1368. ExecutionStatus string `json:"executionStatus,omitempty"`
  1369. // Kind: Identifies what kind of resource this is. Value: the fixed
  1370. // string "content#orderpaymentsNotifyRefundResponse".
  1371. Kind string `json:"kind,omitempty"`
  1372. // ServerResponse contains the HTTP response code and headers from the
  1373. // server.
  1374. googleapi.ServerResponse `json:"-"`
  1375. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1376. // unconditionally include in API requests. By default, fields with
  1377. // empty values are omitted from API requests. However, any non-pointer,
  1378. // non-interface field appearing in ForceSendFields will be sent to the
  1379. // server regardless of whether the field is empty or not. This may be
  1380. // used to include empty fields in Patch requests.
  1381. ForceSendFields []string `json:"-"`
  1382. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1383. // include in API requests with the JSON null value. By default, fields
  1384. // with empty values are omitted from API requests. However, any field
  1385. // with an empty value appearing in NullFields will be sent to the
  1386. // server as null. It is an error if a field in this list has a
  1387. // non-empty value. This may be used to include null fields in Patch
  1388. // requests.
  1389. NullFields []string `json:"-"`
  1390. }
  1391. func (s *OrderpaymentsNotifyRefundResponse) MarshalJSON() ([]byte, error) {
  1392. type NoMethod OrderpaymentsNotifyRefundResponse
  1393. raw := NoMethod(*s)
  1394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1395. }
  1396. type OrdersAcknowledgeRequest struct {
  1397. // OperationId: The ID of the operation. Unique across all operations
  1398. // for a given order.
  1399. OperationId string `json:"operationId,omitempty"`
  1400. // ForceSendFields is a list of field names (e.g. "OperationId") to
  1401. // unconditionally include in API requests. By default, fields with
  1402. // empty values are omitted from API requests. However, any non-pointer,
  1403. // non-interface field appearing in ForceSendFields will be sent to the
  1404. // server regardless of whether the field is empty or not. This may be
  1405. // used to include empty fields in Patch requests.
  1406. ForceSendFields []string `json:"-"`
  1407. // NullFields is a list of field names (e.g. "OperationId") to include
  1408. // in API requests with the JSON null value. By default, fields with
  1409. // empty values are omitted from API requests. However, any field with
  1410. // an empty value appearing in NullFields will be sent to the server as
  1411. // null. It is an error if a field in this list has a non-empty value.
  1412. // This may be used to include null fields in Patch requests.
  1413. NullFields []string `json:"-"`
  1414. }
  1415. func (s *OrdersAcknowledgeRequest) MarshalJSON() ([]byte, error) {
  1416. type NoMethod OrdersAcknowledgeRequest
  1417. raw := NoMethod(*s)
  1418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1419. }
  1420. type OrdersAcknowledgeResponse struct {
  1421. // ExecutionStatus: The status of the execution.
  1422. ExecutionStatus string `json:"executionStatus,omitempty"`
  1423. // Kind: Identifies what kind of resource this is. Value: the fixed
  1424. // string "content#ordersAcknowledgeResponse".
  1425. Kind string `json:"kind,omitempty"`
  1426. // ServerResponse contains the HTTP response code and headers from the
  1427. // server.
  1428. googleapi.ServerResponse `json:"-"`
  1429. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1430. // unconditionally include in API requests. By default, fields with
  1431. // empty values are omitted from API requests. However, any non-pointer,
  1432. // non-interface field appearing in ForceSendFields will be sent to the
  1433. // server regardless of whether the field is empty or not. This may be
  1434. // used to include empty fields in Patch requests.
  1435. ForceSendFields []string `json:"-"`
  1436. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1437. // include in API requests with the JSON null value. By default, fields
  1438. // with empty values are omitted from API requests. However, any field
  1439. // with an empty value appearing in NullFields will be sent to the
  1440. // server as null. It is an error if a field in this list has a
  1441. // non-empty value. This may be used to include null fields in Patch
  1442. // requests.
  1443. NullFields []string `json:"-"`
  1444. }
  1445. func (s *OrdersAcknowledgeResponse) MarshalJSON() ([]byte, error) {
  1446. type NoMethod OrdersAcknowledgeResponse
  1447. raw := NoMethod(*s)
  1448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1449. }
  1450. type OrdersAdvanceTestOrderResponse struct {
  1451. // Kind: Identifies what kind of resource this is. Value: the fixed
  1452. // string "content#ordersAdvanceTestOrderResponse".
  1453. Kind string `json:"kind,omitempty"`
  1454. // ServerResponse contains the HTTP response code and headers from the
  1455. // server.
  1456. googleapi.ServerResponse `json:"-"`
  1457. // ForceSendFields is a list of field names (e.g. "Kind") to
  1458. // unconditionally include in API requests. By default, fields with
  1459. // empty values are omitted from API requests. However, any non-pointer,
  1460. // non-interface field appearing in ForceSendFields will be sent to the
  1461. // server regardless of whether the field is empty or not. This may be
  1462. // used to include empty fields in Patch requests.
  1463. ForceSendFields []string `json:"-"`
  1464. // NullFields is a list of field names (e.g. "Kind") to include in API
  1465. // requests with the JSON null value. By default, fields with empty
  1466. // values are omitted from API requests. However, any field with an
  1467. // empty value appearing in NullFields will be sent to the server as
  1468. // null. It is an error if a field in this list has a non-empty value.
  1469. // This may be used to include null fields in Patch requests.
  1470. NullFields []string `json:"-"`
  1471. }
  1472. func (s *OrdersAdvanceTestOrderResponse) MarshalJSON() ([]byte, error) {
  1473. type NoMethod OrdersAdvanceTestOrderResponse
  1474. raw := NoMethod(*s)
  1475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1476. }
  1477. type OrdersCancelLineItemRequest struct {
  1478. // Amount: Amount to refund for the cancelation. Optional. If not set,
  1479. // Google will calculate the default based on the price and tax of the
  1480. // items involved. The amount must not be larger than the net amount
  1481. // left on the order.
  1482. Amount *Price `json:"amount,omitempty"`
  1483. // AmountPretax: Amount to refund for the cancelation. Optional. If not
  1484. // set, Google will calculate the default based on the price and tax of
  1485. // the items involved. The amount must not be larger than the net amount
  1486. // left on the order.
  1487. AmountPretax *Price `json:"amountPretax,omitempty"`
  1488. // AmountTax: Tax amount that correspond to cancellation amount in
  1489. // amountPretax.
  1490. AmountTax *Price `json:"amountTax,omitempty"`
  1491. // LineItemId: The ID of the line item to cancel. Either lineItemId or
  1492. // productId is required.
  1493. LineItemId string `json:"lineItemId,omitempty"`
  1494. // OperationId: The ID of the operation. Unique across all operations
  1495. // for a given order.
  1496. OperationId string `json:"operationId,omitempty"`
  1497. // ProductId: The ID of the product to cancel. This is the REST ID used
  1498. // in the products service. Either lineItemId or productId is required.
  1499. ProductId string `json:"productId,omitempty"`
  1500. // Quantity: The quantity to cancel.
  1501. Quantity int64 `json:"quantity,omitempty"`
  1502. // Reason: The reason for the cancellation.
  1503. Reason string `json:"reason,omitempty"`
  1504. // ReasonText: The explanation of the reason.
  1505. ReasonText string `json:"reasonText,omitempty"`
  1506. // ForceSendFields is a list of field names (e.g. "Amount") to
  1507. // unconditionally include in API requests. By default, fields with
  1508. // empty values are omitted from API requests. However, any non-pointer,
  1509. // non-interface field appearing in ForceSendFields will be sent to the
  1510. // server regardless of whether the field is empty or not. This may be
  1511. // used to include empty fields in Patch requests.
  1512. ForceSendFields []string `json:"-"`
  1513. // NullFields is a list of field names (e.g. "Amount") to include in API
  1514. // requests with the JSON null value. By default, fields with empty
  1515. // values are omitted from API requests. However, any field with an
  1516. // empty value appearing in NullFields will be sent to the server as
  1517. // null. It is an error if a field in this list has a non-empty value.
  1518. // This may be used to include null fields in Patch requests.
  1519. NullFields []string `json:"-"`
  1520. }
  1521. func (s *OrdersCancelLineItemRequest) MarshalJSON() ([]byte, error) {
  1522. type NoMethod OrdersCancelLineItemRequest
  1523. raw := NoMethod(*s)
  1524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1525. }
  1526. type OrdersCancelLineItemResponse struct {
  1527. // ExecutionStatus: The status of the execution.
  1528. ExecutionStatus string `json:"executionStatus,omitempty"`
  1529. // Kind: Identifies what kind of resource this is. Value: the fixed
  1530. // string "content#ordersCancelLineItemResponse".
  1531. Kind string `json:"kind,omitempty"`
  1532. // ServerResponse contains the HTTP response code and headers from the
  1533. // server.
  1534. googleapi.ServerResponse `json:"-"`
  1535. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1536. // unconditionally include in API requests. By default, fields with
  1537. // empty values are omitted from API requests. However, any non-pointer,
  1538. // non-interface field appearing in ForceSendFields will be sent to the
  1539. // server regardless of whether the field is empty or not. This may be
  1540. // used to include empty fields in Patch requests.
  1541. ForceSendFields []string `json:"-"`
  1542. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1543. // include in API requests with the JSON null value. By default, fields
  1544. // with empty values are omitted from API requests. However, any field
  1545. // with an empty value appearing in NullFields will be sent to the
  1546. // server as null. It is an error if a field in this list has a
  1547. // non-empty value. This may be used to include null fields in Patch
  1548. // requests.
  1549. NullFields []string `json:"-"`
  1550. }
  1551. func (s *OrdersCancelLineItemResponse) MarshalJSON() ([]byte, error) {
  1552. type NoMethod OrdersCancelLineItemResponse
  1553. raw := NoMethod(*s)
  1554. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1555. }
  1556. type OrdersCancelRequest struct {
  1557. // OperationId: The ID of the operation. Unique across all operations
  1558. // for a given order.
  1559. OperationId string `json:"operationId,omitempty"`
  1560. // Reason: The reason for the cancellation.
  1561. Reason string `json:"reason,omitempty"`
  1562. // ReasonText: The explanation of the reason.
  1563. ReasonText string `json:"reasonText,omitempty"`
  1564. // ForceSendFields is a list of field names (e.g. "OperationId") to
  1565. // unconditionally include in API requests. By default, fields with
  1566. // empty values are omitted from API requests. However, any non-pointer,
  1567. // non-interface field appearing in ForceSendFields will be sent to the
  1568. // server regardless of whether the field is empty or not. This may be
  1569. // used to include empty fields in Patch requests.
  1570. ForceSendFields []string `json:"-"`
  1571. // NullFields is a list of field names (e.g. "OperationId") to include
  1572. // in API requests with the JSON null value. By default, fields with
  1573. // empty values are omitted from API requests. However, any field with
  1574. // an empty value appearing in NullFields will be sent to the server as
  1575. // null. It is an error if a field in this list has a non-empty value.
  1576. // This may be used to include null fields in Patch requests.
  1577. NullFields []string `json:"-"`
  1578. }
  1579. func (s *OrdersCancelRequest) MarshalJSON() ([]byte, error) {
  1580. type NoMethod OrdersCancelRequest
  1581. raw := NoMethod(*s)
  1582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1583. }
  1584. type OrdersCancelResponse struct {
  1585. // ExecutionStatus: The status of the execution.
  1586. ExecutionStatus string `json:"executionStatus,omitempty"`
  1587. // Kind: Identifies what kind of resource this is. Value: the fixed
  1588. // string "content#ordersCancelResponse".
  1589. Kind string `json:"kind,omitempty"`
  1590. // ServerResponse contains the HTTP response code and headers from the
  1591. // server.
  1592. googleapi.ServerResponse `json:"-"`
  1593. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1594. // unconditionally include in API requests. By default, fields with
  1595. // empty values are omitted from API requests. However, any non-pointer,
  1596. // non-interface field appearing in ForceSendFields will be sent to the
  1597. // server regardless of whether the field is empty or not. This may be
  1598. // used to include empty fields in Patch requests.
  1599. ForceSendFields []string `json:"-"`
  1600. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  1601. // include in API requests with the JSON null value. By default, fields
  1602. // with empty values are omitted from API requests. However, any field
  1603. // with an empty value appearing in NullFields will be sent to the
  1604. // server as null. It is an error if a field in this list has a
  1605. // non-empty value. This may be used to include null fields in Patch
  1606. // requests.
  1607. NullFields []string `json:"-"`
  1608. }
  1609. func (s *OrdersCancelResponse) MarshalJSON() ([]byte, error) {
  1610. type NoMethod OrdersCancelResponse
  1611. raw := NoMethod(*s)
  1612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1613. }
  1614. type OrdersCreateTestOrderRequest struct {
  1615. // TemplateName: The test order template to use. Specify as an
  1616. // alternative to testOrder as a shortcut for retrieving a template and
  1617. // then creating an order using that template.
  1618. TemplateName string `json:"templateName,omitempty"`
  1619. // TestOrder: The test order to create.
  1620. TestOrder *TestOrder `json:"testOrder,omitempty"`
  1621. // ForceSendFields is a list of field names (e.g. "TemplateName") to
  1622. // unconditionally include in API requests. By default, fields with
  1623. // empty values are omitted from API requests. However, any non-pointer,
  1624. // non-interface field appearing in ForceSendFields will be sent to the
  1625. // server regardless of whether the field is empty or not. This may be
  1626. // used to include empty fields in Patch requests.
  1627. ForceSendFields []string `json:"-"`
  1628. // NullFields is a list of field names (e.g. "TemplateName") to include
  1629. // in API requests with the JSON null value. By default, fields with
  1630. // empty values are omitted from API requests. However, any field with
  1631. // an empty value appearing in NullFields will be sent to the server as
  1632. // null. It is an error if a field in this list has a non-empty value.
  1633. // This may be used to include null fields in Patch requests.
  1634. NullFields []string `json:"-"`
  1635. }
  1636. func (s *OrdersCreateTestOrderRequest) MarshalJSON() ([]byte, error) {
  1637. type NoMethod OrdersCreateTestOrderRequest
  1638. raw := NoMethod(*s)
  1639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1640. }
  1641. type OrdersCreateTestOrderResponse struct {
  1642. // Kind: Identifies what kind of resource this is. Value: the fixed
  1643. // string "content#ordersCreateTestOrderResponse".
  1644. Kind string `json:"kind,omitempty"`
  1645. // OrderId: The ID of the newly created test order.
  1646. OrderId string `json:"orderId,omitempty"`
  1647. // ServerResponse contains the HTTP response code and headers from the
  1648. // server.
  1649. googleapi.ServerResponse `json:"-"`
  1650. // ForceSendFields is a list of field names (e.g. "Kind") to
  1651. // unconditionally include in API requests. By default, fields with
  1652. // empty values are omitted from API requests. However, any non-pointer,
  1653. // non-interface field appearing in ForceSendFields will be sent to the
  1654. // server regardless of whether the field is empty or not. This may be
  1655. // used to include empty fields in Patch requests.
  1656. ForceSendFields []string `json:"-"`
  1657. // NullFields is a list of field names (e.g. "Kind") to include in API
  1658. // requests with the JSON null value. By default, fields with empty
  1659. // values are omitted from API requests. However, any field with an
  1660. // empty value appearing in NullFields will be sent to the server as
  1661. // null. It is an error if a field in this list has a non-empty value.
  1662. // This may be used to include null fields in Patch requests.
  1663. NullFields []string `json:"-"`
  1664. }
  1665. func (s *OrdersCreateTestOrderResponse) MarshalJSON() ([]byte, error) {
  1666. type NoMethod OrdersCreateTestOrderResponse
  1667. raw := NoMethod(*s)
  1668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1669. }
  1670. type OrdersCustomBatchRequest struct {
  1671. // Entries: The request entries to be processed in the batch.
  1672. Entries []*OrdersCustomBatchRequestEntry `json:"entries,omitempty"`
  1673. // ForceSendFields is a list of field names (e.g. "Entries") to
  1674. // unconditionally include in API requests. By default, fields with
  1675. // empty values are omitted from API requests. However, any non-pointer,
  1676. // non-interface field appearing in ForceSendFields will be sent to the
  1677. // server regardless of whether the field is empty or not. This may be
  1678. // used to include empty fields in Patch requests.
  1679. ForceSendFields []string `json:"-"`
  1680. // NullFields is a list of field names (e.g. "Entries") to include in
  1681. // API requests with the JSON null value. By default, fields with empty
  1682. // values are omitted from API requests. However, any field with an
  1683. // empty value appearing in NullFields will be sent to the server as
  1684. // null. It is an error if a field in this list has a non-empty value.
  1685. // This may be used to include null fields in Patch requests.
  1686. NullFields []string `json:"-"`
  1687. }
  1688. func (s *OrdersCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1689. type NoMethod OrdersCustomBatchRequest
  1690. raw := NoMethod(*s)
  1691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1692. }
  1693. type OrdersCustomBatchRequestEntry struct {
  1694. // BatchId: An entry ID, unique within the batch request.
  1695. BatchId int64 `json:"batchId,omitempty"`
  1696. // Cancel: Required for cancel method.
  1697. Cancel *OrdersCustomBatchRequestEntryCancel `json:"cancel,omitempty"`
  1698. // CancelLineItem: Required for cancelLineItem method.
  1699. CancelLineItem *OrdersCustomBatchRequestEntryCancelLineItem `json:"cancelLineItem,omitempty"`
  1700. // InStoreRefundLineItem: Required for inStoreReturnLineItem method.
  1701. InStoreRefundLineItem *OrdersCustomBatchRequestEntryInStoreRefundLineItem `json:"inStoreRefundLineItem,omitempty"`
  1702. // MerchantId: The ID of the managing account.
  1703. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1704. // MerchantOrderId: The merchant order id. Required for
  1705. // updateMerchantOrderId and getByMerchantOrderId methods.
  1706. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  1707. // Method: The method to apply.
  1708. Method string `json:"method,omitempty"`
  1709. // OperationId: The ID of the operation. Unique across all operations
  1710. // for a given order. Required for all methods beside get and
  1711. // getByMerchantOrderId.
  1712. OperationId string `json:"operationId,omitempty"`
  1713. // OrderId: The ID of the order. Required for all methods beside
  1714. // getByMerchantOrderId.
  1715. OrderId string `json:"orderId,omitempty"`
  1716. // Refund: Required for refund method.
  1717. Refund *OrdersCustomBatchRequestEntryRefund `json:"refund,omitempty"`
  1718. // RejectReturnLineItem: Required for rejectReturnLineItem method.
  1719. RejectReturnLineItem *OrdersCustomBatchRequestEntryRejectReturnLineItem `json:"rejectReturnLineItem,omitempty"`
  1720. // ReturnLineItem: Required for returnLineItem method.
  1721. ReturnLineItem *OrdersCustomBatchRequestEntryReturnLineItem `json:"returnLineItem,omitempty"`
  1722. // ReturnRefundLineItem: Required for returnRefundLineItem method.
  1723. ReturnRefundLineItem *OrdersCustomBatchRequestEntryReturnRefundLineItem `json:"returnRefundLineItem,omitempty"`
  1724. // SetLineItemMetadata: Required for setLineItemMetadata method.
  1725. SetLineItemMetadata *OrdersCustomBatchRequestEntrySetLineItemMetadata `json:"setLineItemMetadata,omitempty"`
  1726. // ShipLineItems: Required for shipLineItems method.
  1727. ShipLineItems *OrdersCustomBatchRequestEntryShipLineItems `json:"shipLineItems,omitempty"`
  1728. // UpdateLineItemShippingDetails: Required for
  1729. // updateLineItemShippingDate method.
  1730. UpdateLineItemShippingDetails *OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails `json:"updateLineItemShippingDetails,omitempty"`
  1731. // UpdateShipment: Required for updateShipment method.
  1732. UpdateShipment *OrdersCustomBatchRequestEntryUpdateShipment `json:"updateShipment,omitempty"`
  1733. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1734. // unconditionally include in API requests. By default, fields with
  1735. // empty values are omitted from API requests. However, any non-pointer,
  1736. // non-interface field appearing in ForceSendFields will be sent to the
  1737. // server regardless of whether the field is empty or not. This may be
  1738. // used to include empty fields in Patch requests.
  1739. ForceSendFields []string `json:"-"`
  1740. // NullFields is a list of field names (e.g. "BatchId") to include in
  1741. // API requests with the JSON null value. By default, fields with empty
  1742. // values are omitted from API requests. However, any field with an
  1743. // empty value appearing in NullFields will be sent to the server as
  1744. // null. It is an error if a field in this list has a non-empty value.
  1745. // This may be used to include null fields in Patch requests.
  1746. NullFields []string `json:"-"`
  1747. }
  1748. func (s *OrdersCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1749. type NoMethod OrdersCustomBatchRequestEntry
  1750. raw := NoMethod(*s)
  1751. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1752. }
  1753. type OrdersCustomBatchRequestEntryCancel struct {
  1754. // Reason: The reason for the cancellation.
  1755. Reason string `json:"reason,omitempty"`
  1756. // ReasonText: The explanation of the reason.
  1757. ReasonText string `json:"reasonText,omitempty"`
  1758. // ForceSendFields is a list of field names (e.g. "Reason") to
  1759. // unconditionally include in API requests. By default, fields with
  1760. // empty values are omitted from API requests. However, any non-pointer,
  1761. // non-interface field appearing in ForceSendFields will be sent to the
  1762. // server regardless of whether the field is empty or not. This may be
  1763. // used to include empty fields in Patch requests.
  1764. ForceSendFields []string `json:"-"`
  1765. // NullFields is a list of field names (e.g. "Reason") to include in API
  1766. // requests with the JSON null value. By default, fields with empty
  1767. // values are omitted from API requests. However, any field with an
  1768. // empty value appearing in NullFields will be sent to the server as
  1769. // null. It is an error if a field in this list has a non-empty value.
  1770. // This may be used to include null fields in Patch requests.
  1771. NullFields []string `json:"-"`
  1772. }
  1773. func (s *OrdersCustomBatchRequestEntryCancel) MarshalJSON() ([]byte, error) {
  1774. type NoMethod OrdersCustomBatchRequestEntryCancel
  1775. raw := NoMethod(*s)
  1776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1777. }
  1778. type OrdersCustomBatchRequestEntryCancelLineItem struct {
  1779. // Amount: Amount to refund for the cancelation. Optional. If not set,
  1780. // Google will calculate the default based on the price and tax of the
  1781. // items involved. The amount must not be larger than the net amount
  1782. // left on the order.
  1783. Amount *Price `json:"amount,omitempty"`
  1784. // AmountPretax: Amount to refund for the cancelation. Optional. If not
  1785. // set, Google will calculate the default based on the price and tax of
  1786. // the items involved. The amount must not be larger than the net amount
  1787. // left on the order.
  1788. AmountPretax *Price `json:"amountPretax,omitempty"`
  1789. // AmountTax: Tax amount that correspond to cancellation amount in
  1790. // amountPretax.
  1791. AmountTax *Price `json:"amountTax,omitempty"`
  1792. // LineItemId: The ID of the line item to cancel. Either lineItemId or
  1793. // productId is required.
  1794. LineItemId string `json:"lineItemId,omitempty"`
  1795. // ProductId: The ID of the product to cancel. This is the REST ID used
  1796. // in the products service. Either lineItemId or productId is required.
  1797. ProductId string `json:"productId,omitempty"`
  1798. // Quantity: The quantity to cancel.
  1799. Quantity int64 `json:"quantity,omitempty"`
  1800. // Reason: The reason for the cancellation.
  1801. Reason string `json:"reason,omitempty"`
  1802. // ReasonText: The explanation of the reason.
  1803. ReasonText string `json:"reasonText,omitempty"`
  1804. // ForceSendFields is a list of field names (e.g. "Amount") to
  1805. // unconditionally include in API requests. By default, fields with
  1806. // empty values are omitted from API requests. However, any non-pointer,
  1807. // non-interface field appearing in ForceSendFields will be sent to the
  1808. // server regardless of whether the field is empty or not. This may be
  1809. // used to include empty fields in Patch requests.
  1810. ForceSendFields []string `json:"-"`
  1811. // NullFields is a list of field names (e.g. "Amount") to include in API
  1812. // requests with the JSON null value. By default, fields with empty
  1813. // values are omitted from API requests. However, any field with an
  1814. // empty value appearing in NullFields will be sent to the server as
  1815. // null. It is an error if a field in this list has a non-empty value.
  1816. // This may be used to include null fields in Patch requests.
  1817. NullFields []string `json:"-"`
  1818. }
  1819. func (s *OrdersCustomBatchRequestEntryCancelLineItem) MarshalJSON() ([]byte, error) {
  1820. type NoMethod OrdersCustomBatchRequestEntryCancelLineItem
  1821. raw := NoMethod(*s)
  1822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1823. }
  1824. type OrdersCustomBatchRequestEntryInStoreRefundLineItem struct {
  1825. // AmountPretax: The amount that is refunded. Required.
  1826. AmountPretax *Price `json:"amountPretax,omitempty"`
  1827. // AmountTax: Tax amount that correspond to refund amount in
  1828. // amountPretax. Required.
  1829. AmountTax *Price `json:"amountTax,omitempty"`
  1830. // LineItemId: The ID of the line item to return. Either lineItemId or
  1831. // productId is required.
  1832. LineItemId string `json:"lineItemId,omitempty"`
  1833. // ProductId: The ID of the product to return. This is the REST ID used
  1834. // in the products service. Either lineItemId or productId is required.
  1835. ProductId string `json:"productId,omitempty"`
  1836. // Quantity: The quantity to return and refund.
  1837. Quantity int64 `json:"quantity,omitempty"`
  1838. // Reason: The reason for the return.
  1839. Reason string `json:"reason,omitempty"`
  1840. // ReasonText: The explanation of the reason.
  1841. ReasonText string `json:"reasonText,omitempty"`
  1842. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  1843. // unconditionally include in API requests. By default, fields with
  1844. // empty values are omitted from API requests. However, any non-pointer,
  1845. // non-interface field appearing in ForceSendFields will be sent to the
  1846. // server regardless of whether the field is empty or not. This may be
  1847. // used to include empty fields in Patch requests.
  1848. ForceSendFields []string `json:"-"`
  1849. // NullFields is a list of field names (e.g. "AmountPretax") to include
  1850. // in API requests with the JSON null value. By default, fields with
  1851. // empty values are omitted from API requests. However, any field with
  1852. // an empty value appearing in NullFields will be sent to the server as
  1853. // null. It is an error if a field in this list has a non-empty value.
  1854. // This may be used to include null fields in Patch requests.
  1855. NullFields []string `json:"-"`
  1856. }
  1857. func (s *OrdersCustomBatchRequestEntryInStoreRefundLineItem) MarshalJSON() ([]byte, error) {
  1858. type NoMethod OrdersCustomBatchRequestEntryInStoreRefundLineItem
  1859. raw := NoMethod(*s)
  1860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1861. }
  1862. type OrdersCustomBatchRequestEntryRefund struct {
  1863. // Amount: The amount that is refunded.
  1864. Amount *Price `json:"amount,omitempty"`
  1865. // AmountPretax: The amount that is refunded. Either amount or
  1866. // amountPretax and amountTax should be filled.
  1867. AmountPretax *Price `json:"amountPretax,omitempty"`
  1868. // AmountTax: Tax amount that correspond to refund amount in
  1869. // amountPretax.
  1870. AmountTax *Price `json:"amountTax,omitempty"`
  1871. // Reason: The reason for the refund.
  1872. Reason string `json:"reason,omitempty"`
  1873. // ReasonText: The explanation of the reason.
  1874. ReasonText string `json:"reasonText,omitempty"`
  1875. // ForceSendFields is a list of field names (e.g. "Amount") to
  1876. // unconditionally include in API requests. By default, fields with
  1877. // empty values are omitted from API requests. However, any non-pointer,
  1878. // non-interface field appearing in ForceSendFields will be sent to the
  1879. // server regardless of whether the field is empty or not. This may be
  1880. // used to include empty fields in Patch requests.
  1881. ForceSendFields []string `json:"-"`
  1882. // NullFields is a list of field names (e.g. "Amount") to include in API
  1883. // requests with the JSON null value. By default, fields with empty
  1884. // values are omitted from API requests. However, any field with an
  1885. // empty value appearing in NullFields will be sent to the server as
  1886. // null. It is an error if a field in this list has a non-empty value.
  1887. // This may be used to include null fields in Patch requests.
  1888. NullFields []string `json:"-"`
  1889. }
  1890. func (s *OrdersCustomBatchRequestEntryRefund) MarshalJSON() ([]byte, error) {
  1891. type NoMethod OrdersCustomBatchRequestEntryRefund
  1892. raw := NoMethod(*s)
  1893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1894. }
  1895. type OrdersCustomBatchRequestEntryRejectReturnLineItem struct {
  1896. // LineItemId: The ID of the line item to return. Either lineItemId or
  1897. // productId is required.
  1898. LineItemId string `json:"lineItemId,omitempty"`
  1899. // ProductId: The ID of the product to return. This is the REST ID used
  1900. // in the products service. Either lineItemId or productId is required.
  1901. ProductId string `json:"productId,omitempty"`
  1902. // Quantity: The quantity to return and refund.
  1903. Quantity int64 `json:"quantity,omitempty"`
  1904. // Reason: The reason for the return.
  1905. Reason string `json:"reason,omitempty"`
  1906. // ReasonText: The explanation of the reason.
  1907. ReasonText string `json:"reasonText,omitempty"`
  1908. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  1909. // unconditionally include in API requests. By default, fields with
  1910. // empty values are omitted from API requests. However, any non-pointer,
  1911. // non-interface field appearing in ForceSendFields will be sent to the
  1912. // server regardless of whether the field is empty or not. This may be
  1913. // used to include empty fields in Patch requests.
  1914. ForceSendFields []string `json:"-"`
  1915. // NullFields is a list of field names (e.g. "LineItemId") to include in
  1916. // API requests with the JSON null value. By default, fields with empty
  1917. // values are omitted from API requests. However, any field with an
  1918. // empty value appearing in NullFields will be sent to the server as
  1919. // null. It is an error if a field in this list has a non-empty value.
  1920. // This may be used to include null fields in Patch requests.
  1921. NullFields []string `json:"-"`
  1922. }
  1923. func (s *OrdersCustomBatchRequestEntryRejectReturnLineItem) MarshalJSON() ([]byte, error) {
  1924. type NoMethod OrdersCustomBatchRequestEntryRejectReturnLineItem
  1925. raw := NoMethod(*s)
  1926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1927. }
  1928. type OrdersCustomBatchRequestEntryReturnLineItem struct {
  1929. // LineItemId: The ID of the line item to return. Either lineItemId or
  1930. // productId is required.
  1931. LineItemId string `json:"lineItemId,omitempty"`
  1932. // ProductId: The ID of the product to return. This is the REST ID used
  1933. // in the products service. Either lineItemId or productId is required.
  1934. ProductId string `json:"productId,omitempty"`
  1935. // Quantity: The quantity to return.
  1936. Quantity int64 `json:"quantity,omitempty"`
  1937. // Reason: The reason for the return.
  1938. Reason string `json:"reason,omitempty"`
  1939. // ReasonText: The explanation of the reason.
  1940. ReasonText string `json:"reasonText,omitempty"`
  1941. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  1942. // unconditionally include in API requests. By default, fields with
  1943. // empty values are omitted from API requests. However, any non-pointer,
  1944. // non-interface field appearing in ForceSendFields will be sent to the
  1945. // server regardless of whether the field is empty or not. This may be
  1946. // used to include empty fields in Patch requests.
  1947. ForceSendFields []string `json:"-"`
  1948. // NullFields is a list of field names (e.g. "LineItemId") to include in
  1949. // API requests with the JSON null value. By default, fields with empty
  1950. // values are omitted from API requests. However, any field with an
  1951. // empty value appearing in NullFields will be sent to the server as
  1952. // null. It is an error if a field in this list has a non-empty value.
  1953. // This may be used to include null fields in Patch requests.
  1954. NullFields []string `json:"-"`
  1955. }
  1956. func (s *OrdersCustomBatchRequestEntryReturnLineItem) MarshalJSON() ([]byte, error) {
  1957. type NoMethod OrdersCustomBatchRequestEntryReturnLineItem
  1958. raw := NoMethod(*s)
  1959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1960. }
  1961. type OrdersCustomBatchRequestEntryReturnRefundLineItem struct {
  1962. // AmountPretax: The amount that is refunded. Optional, but if filled
  1963. // then both amountPretax and amountTax must be set.
  1964. AmountPretax *Price `json:"amountPretax,omitempty"`
  1965. // AmountTax: Tax amount that correspond to refund amount in
  1966. // amountPretax.
  1967. AmountTax *Price `json:"amountTax,omitempty"`
  1968. // LineItemId: The ID of the line item to return. Either lineItemId or
  1969. // productId is required.
  1970. LineItemId string `json:"lineItemId,omitempty"`
  1971. // ProductId: The ID of the product to return. This is the REST ID used
  1972. // in the products service. Either lineItemId or productId is required.
  1973. ProductId string `json:"productId,omitempty"`
  1974. // Quantity: The quantity to return and refund.
  1975. Quantity int64 `json:"quantity,omitempty"`
  1976. // Reason: The reason for the return.
  1977. Reason string `json:"reason,omitempty"`
  1978. // ReasonText: The explanation of the reason.
  1979. ReasonText string `json:"reasonText,omitempty"`
  1980. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  1981. // unconditionally include in API requests. By default, fields with
  1982. // empty values are omitted from API requests. However, any non-pointer,
  1983. // non-interface field appearing in ForceSendFields will be sent to the
  1984. // server regardless of whether the field is empty or not. This may be
  1985. // used to include empty fields in Patch requests.
  1986. ForceSendFields []string `json:"-"`
  1987. // NullFields is a list of field names (e.g. "AmountPretax") to include
  1988. // in API requests with the JSON null value. By default, fields with
  1989. // empty values are omitted from API requests. However, any field with
  1990. // an empty value appearing in NullFields will be sent to the server as
  1991. // null. It is an error if a field in this list has a non-empty value.
  1992. // This may be used to include null fields in Patch requests.
  1993. NullFields []string `json:"-"`
  1994. }
  1995. func (s *OrdersCustomBatchRequestEntryReturnRefundLineItem) MarshalJSON() ([]byte, error) {
  1996. type NoMethod OrdersCustomBatchRequestEntryReturnRefundLineItem
  1997. raw := NoMethod(*s)
  1998. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1999. }
  2000. type OrdersCustomBatchRequestEntrySetLineItemMetadata struct {
  2001. Annotations []*OrderMerchantProvidedAnnotation `json:"annotations,omitempty"`
  2002. // LineItemId: The ID of the line item to set metadata. Either
  2003. // lineItemId or productId is required.
  2004. LineItemId string `json:"lineItemId,omitempty"`
  2005. // ProductId: The ID of the product to set metadata. This is the REST ID
  2006. // used in the products service. Either lineItemId or productId is
  2007. // required.
  2008. ProductId string `json:"productId,omitempty"`
  2009. // ForceSendFields is a list of field names (e.g. "Annotations") to
  2010. // unconditionally include in API requests. By default, fields with
  2011. // empty values are omitted from API requests. However, any non-pointer,
  2012. // non-interface field appearing in ForceSendFields will be sent to the
  2013. // server regardless of whether the field is empty or not. This may be
  2014. // used to include empty fields in Patch requests.
  2015. ForceSendFields []string `json:"-"`
  2016. // NullFields is a list of field names (e.g. "Annotations") to include
  2017. // in API requests with the JSON null value. By default, fields with
  2018. // empty values are omitted from API requests. However, any field with
  2019. // an empty value appearing in NullFields will be sent to the server as
  2020. // null. It is an error if a field in this list has a non-empty value.
  2021. // This may be used to include null fields in Patch requests.
  2022. NullFields []string `json:"-"`
  2023. }
  2024. func (s *OrdersCustomBatchRequestEntrySetLineItemMetadata) MarshalJSON() ([]byte, error) {
  2025. type NoMethod OrdersCustomBatchRequestEntrySetLineItemMetadata
  2026. raw := NoMethod(*s)
  2027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2028. }
  2029. type OrdersCustomBatchRequestEntryShipLineItems struct {
  2030. // Carrier: Deprecated. Please use shipmentInfo instead. The carrier
  2031. // handling the shipment. See shipments[].carrier in the Orders
  2032. // resource representation for a list of acceptable values.
  2033. Carrier string `json:"carrier,omitempty"`
  2034. // LineItems: Line items to ship.
  2035. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  2036. // ShipmentGroupId: ID of the shipment group. Required for orders that
  2037. // use the orderinvoices service.
  2038. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  2039. // ShipmentId: Deprecated. Please use shipmentInfo instead. The ID of
  2040. // the shipment.
  2041. ShipmentId string `json:"shipmentId,omitempty"`
  2042. // ShipmentInfos: Shipment information. This field is repeated because a
  2043. // single line item can be shipped in several packages (and have several
  2044. // tracking IDs).
  2045. ShipmentInfos []*OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo `json:"shipmentInfos,omitempty"`
  2046. // TrackingId: Deprecated. Please use shipmentInfo instead. The tracking
  2047. // id for the shipment.
  2048. TrackingId string `json:"trackingId,omitempty"`
  2049. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2050. // unconditionally include in API requests. By default, fields with
  2051. // empty values are omitted from API requests. However, any non-pointer,
  2052. // non-interface field appearing in ForceSendFields will be sent to the
  2053. // server regardless of whether the field is empty or not. This may be
  2054. // used to include empty fields in Patch requests.
  2055. ForceSendFields []string `json:"-"`
  2056. // NullFields is a list of field names (e.g. "Carrier") to include in
  2057. // API requests with the JSON null value. By default, fields with empty
  2058. // values are omitted from API requests. However, any field with an
  2059. // empty value appearing in NullFields will be sent to the server as
  2060. // null. It is an error if a field in this list has a non-empty value.
  2061. // This may be used to include null fields in Patch requests.
  2062. NullFields []string `json:"-"`
  2063. }
  2064. func (s *OrdersCustomBatchRequestEntryShipLineItems) MarshalJSON() ([]byte, error) {
  2065. type NoMethod OrdersCustomBatchRequestEntryShipLineItems
  2066. raw := NoMethod(*s)
  2067. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2068. }
  2069. type OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo struct {
  2070. // Carrier: The carrier handling the shipment. See shipments[].carrier
  2071. // in the Orders resource representation for a list of acceptable
  2072. // values.
  2073. Carrier string `json:"carrier,omitempty"`
  2074. // ShipmentId: The ID of the shipment.
  2075. ShipmentId string `json:"shipmentId,omitempty"`
  2076. // TrackingId: The tracking id for the shipment.
  2077. TrackingId string `json:"trackingId,omitempty"`
  2078. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2079. // unconditionally include in API requests. By default, fields with
  2080. // empty values are omitted from API requests. However, any non-pointer,
  2081. // non-interface field appearing in ForceSendFields will be sent to the
  2082. // server regardless of whether the field is empty or not. This may be
  2083. // used to include empty fields in Patch requests.
  2084. ForceSendFields []string `json:"-"`
  2085. // NullFields is a list of field names (e.g. "Carrier") to include in
  2086. // API requests with the JSON null value. By default, fields with empty
  2087. // values are omitted from API requests. However, any field with an
  2088. // empty value appearing in NullFields will be sent to the server as
  2089. // null. It is an error if a field in this list has a non-empty value.
  2090. // This may be used to include null fields in Patch requests.
  2091. NullFields []string `json:"-"`
  2092. }
  2093. func (s *OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo) MarshalJSON() ([]byte, error) {
  2094. type NoMethod OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo
  2095. raw := NoMethod(*s)
  2096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2097. }
  2098. type OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails struct {
  2099. // DeliverByDate: Updated delivery by date, in ISO 8601 format. If not
  2100. // specified only ship by date is updated.
  2101. DeliverByDate string `json:"deliverByDate,omitempty"`
  2102. // LineItemId: The ID of the line item to set metadata. Either
  2103. // lineItemId or productId is required.
  2104. LineItemId string `json:"lineItemId,omitempty"`
  2105. // ProductId: The ID of the product to set metadata. This is the REST ID
  2106. // used in the products service. Either lineItemId or productId is
  2107. // required.
  2108. ProductId string `json:"productId,omitempty"`
  2109. // ShipByDate: Updated ship by date, in ISO 8601 format. If not
  2110. // specified only deliver by date is updated.
  2111. ShipByDate string `json:"shipByDate,omitempty"`
  2112. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  2113. // unconditionally include in API requests. By default, fields with
  2114. // empty values are omitted from API requests. However, any non-pointer,
  2115. // non-interface field appearing in ForceSendFields will be sent to the
  2116. // server regardless of whether the field is empty or not. This may be
  2117. // used to include empty fields in Patch requests.
  2118. ForceSendFields []string `json:"-"`
  2119. // NullFields is a list of field names (e.g. "DeliverByDate") to include
  2120. // in API requests with the JSON null value. By default, fields with
  2121. // empty values are omitted from API requests. However, any field with
  2122. // an empty value appearing in NullFields will be sent to the server as
  2123. // null. It is an error if a field in this list has a non-empty value.
  2124. // This may be used to include null fields in Patch requests.
  2125. NullFields []string `json:"-"`
  2126. }
  2127. func (s *OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails) MarshalJSON() ([]byte, error) {
  2128. type NoMethod OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails
  2129. raw := NoMethod(*s)
  2130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2131. }
  2132. type OrdersCustomBatchRequestEntryUpdateShipment struct {
  2133. // Carrier: The carrier handling the shipment. Not updated if missing.
  2134. // See shipments[].carrier in the Orders resource representation for a
  2135. // list of acceptable values.
  2136. Carrier string `json:"carrier,omitempty"`
  2137. // ShipmentId: The ID of the shipment.
  2138. ShipmentId string `json:"shipmentId,omitempty"`
  2139. // Status: New status for the shipment. Not updated if missing.
  2140. Status string `json:"status,omitempty"`
  2141. // TrackingId: The tracking id for the shipment. Not updated if missing.
  2142. TrackingId string `json:"trackingId,omitempty"`
  2143. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2144. // unconditionally include in API requests. By default, fields with
  2145. // empty values are omitted from API requests. However, any non-pointer,
  2146. // non-interface field appearing in ForceSendFields will be sent to the
  2147. // server regardless of whether the field is empty or not. This may be
  2148. // used to include empty fields in Patch requests.
  2149. ForceSendFields []string `json:"-"`
  2150. // NullFields is a list of field names (e.g. "Carrier") to include in
  2151. // API requests with the JSON null value. By default, fields with empty
  2152. // values are omitted from API requests. However, any field with an
  2153. // empty value appearing in NullFields will be sent to the server as
  2154. // null. It is an error if a field in this list has a non-empty value.
  2155. // This may be used to include null fields in Patch requests.
  2156. NullFields []string `json:"-"`
  2157. }
  2158. func (s *OrdersCustomBatchRequestEntryUpdateShipment) MarshalJSON() ([]byte, error) {
  2159. type NoMethod OrdersCustomBatchRequestEntryUpdateShipment
  2160. raw := NoMethod(*s)
  2161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2162. }
  2163. type OrdersCustomBatchResponse struct {
  2164. // Entries: The result of the execution of the batch requests.
  2165. Entries []*OrdersCustomBatchResponseEntry `json:"entries,omitempty"`
  2166. // Kind: Identifies what kind of resource this is. Value: the fixed
  2167. // string "content#ordersCustomBatchResponse".
  2168. Kind string `json:"kind,omitempty"`
  2169. // ServerResponse contains the HTTP response code and headers from the
  2170. // server.
  2171. googleapi.ServerResponse `json:"-"`
  2172. // ForceSendFields is a list of field names (e.g. "Entries") to
  2173. // unconditionally include in API requests. By default, fields with
  2174. // empty values are omitted from API requests. However, any non-pointer,
  2175. // non-interface field appearing in ForceSendFields will be sent to the
  2176. // server regardless of whether the field is empty or not. This may be
  2177. // used to include empty fields in Patch requests.
  2178. ForceSendFields []string `json:"-"`
  2179. // NullFields is a list of field names (e.g. "Entries") to include in
  2180. // API requests with the JSON null value. By default, fields with empty
  2181. // values are omitted from API requests. However, any field with an
  2182. // empty value appearing in NullFields will be sent to the server as
  2183. // null. It is an error if a field in this list has a non-empty value.
  2184. // This may be used to include null fields in Patch requests.
  2185. NullFields []string `json:"-"`
  2186. }
  2187. func (s *OrdersCustomBatchResponse) MarshalJSON() ([]byte, error) {
  2188. type NoMethod OrdersCustomBatchResponse
  2189. raw := NoMethod(*s)
  2190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2191. }
  2192. type OrdersCustomBatchResponseEntry struct {
  2193. // BatchId: The ID of the request entry this entry responds to.
  2194. BatchId int64 `json:"batchId,omitempty"`
  2195. // Errors: A list of errors defined if and only if the request failed.
  2196. Errors *Errors `json:"errors,omitempty"`
  2197. // ExecutionStatus: The status of the execution. Only defined if the
  2198. // method is not get or getByMerchantOrderId and if the request was
  2199. // successful.
  2200. ExecutionStatus string `json:"executionStatus,omitempty"`
  2201. // Kind: Identifies what kind of resource this is. Value: the fixed
  2202. // string "content#ordersCustomBatchResponseEntry".
  2203. Kind string `json:"kind,omitempty"`
  2204. // Order: The retrieved order. Only defined if the method is get and if
  2205. // the request was successful.
  2206. Order *Order `json:"order,omitempty"`
  2207. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2208. // unconditionally include in API requests. By default, fields with
  2209. // empty values are omitted from API requests. However, any non-pointer,
  2210. // non-interface field appearing in ForceSendFields will be sent to the
  2211. // server regardless of whether the field is empty or not. This may be
  2212. // used to include empty fields in Patch requests.
  2213. ForceSendFields []string `json:"-"`
  2214. // NullFields is a list of field names (e.g. "BatchId") to include in
  2215. // API requests with the JSON null value. By default, fields with empty
  2216. // values are omitted from API requests. However, any field with an
  2217. // empty value appearing in NullFields will be sent to the server as
  2218. // null. It is an error if a field in this list has a non-empty value.
  2219. // This may be used to include null fields in Patch requests.
  2220. NullFields []string `json:"-"`
  2221. }
  2222. func (s *OrdersCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  2223. type NoMethod OrdersCustomBatchResponseEntry
  2224. raw := NoMethod(*s)
  2225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2226. }
  2227. type OrdersGetByMerchantOrderIdResponse struct {
  2228. // Kind: Identifies what kind of resource this is. Value: the fixed
  2229. // string "content#ordersGetByMerchantOrderIdResponse".
  2230. Kind string `json:"kind,omitempty"`
  2231. // Order: The requested order.
  2232. Order *Order `json:"order,omitempty"`
  2233. // ServerResponse contains the HTTP response code and headers from the
  2234. // server.
  2235. googleapi.ServerResponse `json:"-"`
  2236. // ForceSendFields is a list of field names (e.g. "Kind") to
  2237. // unconditionally include in API requests. By default, fields with
  2238. // empty values are omitted from API requests. However, any non-pointer,
  2239. // non-interface field appearing in ForceSendFields will be sent to the
  2240. // server regardless of whether the field is empty or not. This may be
  2241. // used to include empty fields in Patch requests.
  2242. ForceSendFields []string `json:"-"`
  2243. // NullFields is a list of field names (e.g. "Kind") to include in API
  2244. // requests with the JSON null value. By default, fields with empty
  2245. // values are omitted from API requests. However, any field with an
  2246. // empty value appearing in NullFields will be sent to the server as
  2247. // null. It is an error if a field in this list has a non-empty value.
  2248. // This may be used to include null fields in Patch requests.
  2249. NullFields []string `json:"-"`
  2250. }
  2251. func (s *OrdersGetByMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  2252. type NoMethod OrdersGetByMerchantOrderIdResponse
  2253. raw := NoMethod(*s)
  2254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2255. }
  2256. type OrdersGetTestOrderTemplateResponse struct {
  2257. // Kind: Identifies what kind of resource this is. Value: the fixed
  2258. // string "content#ordersGetTestOrderTemplateResponse".
  2259. Kind string `json:"kind,omitempty"`
  2260. // Template: The requested test order template.
  2261. Template *TestOrder `json:"template,omitempty"`
  2262. // ServerResponse contains the HTTP response code and headers from the
  2263. // server.
  2264. googleapi.ServerResponse `json:"-"`
  2265. // ForceSendFields is a list of field names (e.g. "Kind") to
  2266. // unconditionally include in API requests. By default, fields with
  2267. // empty values are omitted from API requests. However, any non-pointer,
  2268. // non-interface field appearing in ForceSendFields will be sent to the
  2269. // server regardless of whether the field is empty or not. This may be
  2270. // used to include empty fields in Patch requests.
  2271. ForceSendFields []string `json:"-"`
  2272. // NullFields is a list of field names (e.g. "Kind") to include in API
  2273. // requests with the JSON null value. By default, fields with empty
  2274. // values are omitted from API requests. However, any field with an
  2275. // empty value appearing in NullFields will be sent to the server as
  2276. // null. It is an error if a field in this list has a non-empty value.
  2277. // This may be used to include null fields in Patch requests.
  2278. NullFields []string `json:"-"`
  2279. }
  2280. func (s *OrdersGetTestOrderTemplateResponse) MarshalJSON() ([]byte, error) {
  2281. type NoMethod OrdersGetTestOrderTemplateResponse
  2282. raw := NoMethod(*s)
  2283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2284. }
  2285. type OrdersInStoreRefundLineItemRequest struct {
  2286. // AmountPretax: The amount that is refunded. Required.
  2287. AmountPretax *Price `json:"amountPretax,omitempty"`
  2288. // AmountTax: Tax amount that correspond to refund amount in
  2289. // amountPretax. Required.
  2290. AmountTax *Price `json:"amountTax,omitempty"`
  2291. // LineItemId: The ID of the line item to return. Either lineItemId or
  2292. // productId is required.
  2293. LineItemId string `json:"lineItemId,omitempty"`
  2294. // OperationId: The ID of the operation. Unique across all operations
  2295. // for a given order.
  2296. OperationId string `json:"operationId,omitempty"`
  2297. // ProductId: The ID of the product to return. This is the REST ID used
  2298. // in the products service. Either lineItemId or productId is required.
  2299. ProductId string `json:"productId,omitempty"`
  2300. // Quantity: The quantity to return and refund.
  2301. Quantity int64 `json:"quantity,omitempty"`
  2302. // Reason: The reason for the return.
  2303. Reason string `json:"reason,omitempty"`
  2304. // ReasonText: The explanation of the reason.
  2305. ReasonText string `json:"reasonText,omitempty"`
  2306. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  2307. // unconditionally include in API requests. By default, fields with
  2308. // empty values are omitted from API requests. However, any non-pointer,
  2309. // non-interface field appearing in ForceSendFields will be sent to the
  2310. // server regardless of whether the field is empty or not. This may be
  2311. // used to include empty fields in Patch requests.
  2312. ForceSendFields []string `json:"-"`
  2313. // NullFields is a list of field names (e.g. "AmountPretax") to include
  2314. // in API requests with the JSON null value. By default, fields with
  2315. // empty values are omitted from API requests. However, any field with
  2316. // an empty value appearing in NullFields will be sent to the server as
  2317. // null. It is an error if a field in this list has a non-empty value.
  2318. // This may be used to include null fields in Patch requests.
  2319. NullFields []string `json:"-"`
  2320. }
  2321. func (s *OrdersInStoreRefundLineItemRequest) MarshalJSON() ([]byte, error) {
  2322. type NoMethod OrdersInStoreRefundLineItemRequest
  2323. raw := NoMethod(*s)
  2324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2325. }
  2326. type OrdersInStoreRefundLineItemResponse struct {
  2327. // ExecutionStatus: The status of the execution.
  2328. ExecutionStatus string `json:"executionStatus,omitempty"`
  2329. // Kind: Identifies what kind of resource this is. Value: the fixed
  2330. // string "content#ordersInStoreRefundLineItemResponse".
  2331. Kind string `json:"kind,omitempty"`
  2332. // ServerResponse contains the HTTP response code and headers from the
  2333. // server.
  2334. googleapi.ServerResponse `json:"-"`
  2335. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2336. // unconditionally include in API requests. By default, fields with
  2337. // empty values are omitted from API requests. However, any non-pointer,
  2338. // non-interface field appearing in ForceSendFields will be sent to the
  2339. // server regardless of whether the field is empty or not. This may be
  2340. // used to include empty fields in Patch requests.
  2341. ForceSendFields []string `json:"-"`
  2342. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2343. // include in API requests with the JSON null value. By default, fields
  2344. // with empty values are omitted from API requests. However, any field
  2345. // with an empty value appearing in NullFields will be sent to the
  2346. // server as null. It is an error if a field in this list has a
  2347. // non-empty value. This may be used to include null fields in Patch
  2348. // requests.
  2349. NullFields []string `json:"-"`
  2350. }
  2351. func (s *OrdersInStoreRefundLineItemResponse) MarshalJSON() ([]byte, error) {
  2352. type NoMethod OrdersInStoreRefundLineItemResponse
  2353. raw := NoMethod(*s)
  2354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2355. }
  2356. type OrdersListResponse struct {
  2357. // Kind: Identifies what kind of resource this is. Value: the fixed
  2358. // string "content#ordersListResponse".
  2359. Kind string `json:"kind,omitempty"`
  2360. // NextPageToken: The token for the retrieval of the next page of
  2361. // orders.
  2362. NextPageToken string `json:"nextPageToken,omitempty"`
  2363. Resources []*Order `json:"resources,omitempty"`
  2364. // ServerResponse contains the HTTP response code and headers from the
  2365. // server.
  2366. googleapi.ServerResponse `json:"-"`
  2367. // ForceSendFields is a list of field names (e.g. "Kind") to
  2368. // unconditionally include in API requests. By default, fields with
  2369. // empty values are omitted from API requests. However, any non-pointer,
  2370. // non-interface field appearing in ForceSendFields will be sent to the
  2371. // server regardless of whether the field is empty or not. This may be
  2372. // used to include empty fields in Patch requests.
  2373. ForceSendFields []string `json:"-"`
  2374. // NullFields is a list of field names (e.g. "Kind") to include in API
  2375. // requests with the JSON null value. By default, fields with empty
  2376. // values are omitted from API requests. However, any field with an
  2377. // empty value appearing in NullFields will be sent to the server as
  2378. // null. It is an error if a field in this list has a non-empty value.
  2379. // This may be used to include null fields in Patch requests.
  2380. NullFields []string `json:"-"`
  2381. }
  2382. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  2383. type NoMethod OrdersListResponse
  2384. raw := NoMethod(*s)
  2385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2386. }
  2387. type OrdersRefundRequest struct {
  2388. // Amount: The amount that is refunded.
  2389. Amount *Price `json:"amount,omitempty"`
  2390. // AmountPretax: The amount that is refunded. Either amount or
  2391. // amountPretax and amountTax should be filled.
  2392. AmountPretax *Price `json:"amountPretax,omitempty"`
  2393. // AmountTax: Tax amount that correspond to refund amount in
  2394. // amountPretax.
  2395. AmountTax *Price `json:"amountTax,omitempty"`
  2396. // OperationId: The ID of the operation. Unique across all operations
  2397. // for a given order.
  2398. OperationId string `json:"operationId,omitempty"`
  2399. // Reason: The reason for the refund.
  2400. Reason string `json:"reason,omitempty"`
  2401. // ReasonText: The explanation of the reason.
  2402. ReasonText string `json:"reasonText,omitempty"`
  2403. // ForceSendFields is a list of field names (e.g. "Amount") to
  2404. // unconditionally include in API requests. By default, fields with
  2405. // empty values are omitted from API requests. However, any non-pointer,
  2406. // non-interface field appearing in ForceSendFields will be sent to the
  2407. // server regardless of whether the field is empty or not. This may be
  2408. // used to include empty fields in Patch requests.
  2409. ForceSendFields []string `json:"-"`
  2410. // NullFields is a list of field names (e.g. "Amount") to include in API
  2411. // requests with the JSON null value. By default, fields with empty
  2412. // values are omitted from API requests. However, any field with an
  2413. // empty value appearing in NullFields will be sent to the server as
  2414. // null. It is an error if a field in this list has a non-empty value.
  2415. // This may be used to include null fields in Patch requests.
  2416. NullFields []string `json:"-"`
  2417. }
  2418. func (s *OrdersRefundRequest) MarshalJSON() ([]byte, error) {
  2419. type NoMethod OrdersRefundRequest
  2420. raw := NoMethod(*s)
  2421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2422. }
  2423. type OrdersRefundResponse struct {
  2424. // ExecutionStatus: The status of the execution.
  2425. ExecutionStatus string `json:"executionStatus,omitempty"`
  2426. // Kind: Identifies what kind of resource this is. Value: the fixed
  2427. // string "content#ordersRefundResponse".
  2428. Kind string `json:"kind,omitempty"`
  2429. // ServerResponse contains the HTTP response code and headers from the
  2430. // server.
  2431. googleapi.ServerResponse `json:"-"`
  2432. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2433. // unconditionally include in API requests. By default, fields with
  2434. // empty values are omitted from API requests. However, any non-pointer,
  2435. // non-interface field appearing in ForceSendFields will be sent to the
  2436. // server regardless of whether the field is empty or not. This may be
  2437. // used to include empty fields in Patch requests.
  2438. ForceSendFields []string `json:"-"`
  2439. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2440. // include in API requests with the JSON null value. By default, fields
  2441. // with empty values are omitted from API requests. However, any field
  2442. // with an empty value appearing in NullFields will be sent to the
  2443. // server as null. It is an error if a field in this list has a
  2444. // non-empty value. This may be used to include null fields in Patch
  2445. // requests.
  2446. NullFields []string `json:"-"`
  2447. }
  2448. func (s *OrdersRefundResponse) MarshalJSON() ([]byte, error) {
  2449. type NoMethod OrdersRefundResponse
  2450. raw := NoMethod(*s)
  2451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2452. }
  2453. type OrdersRejectReturnLineItemRequest struct {
  2454. // LineItemId: The ID of the line item to return. Either lineItemId or
  2455. // productId is required.
  2456. LineItemId string `json:"lineItemId,omitempty"`
  2457. // OperationId: The ID of the operation. Unique across all operations
  2458. // for a given order.
  2459. OperationId string `json:"operationId,omitempty"`
  2460. // ProductId: The ID of the product to return. This is the REST ID used
  2461. // in the products service. Either lineItemId or productId is required.
  2462. ProductId string `json:"productId,omitempty"`
  2463. // Quantity: The quantity to return and refund.
  2464. Quantity int64 `json:"quantity,omitempty"`
  2465. // Reason: The reason for the return.
  2466. Reason string `json:"reason,omitempty"`
  2467. // ReasonText: The explanation of the reason.
  2468. ReasonText string `json:"reasonText,omitempty"`
  2469. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  2470. // unconditionally include in API requests. By default, fields with
  2471. // empty values are omitted from API requests. However, any non-pointer,
  2472. // non-interface field appearing in ForceSendFields will be sent to the
  2473. // server regardless of whether the field is empty or not. This may be
  2474. // used to include empty fields in Patch requests.
  2475. ForceSendFields []string `json:"-"`
  2476. // NullFields is a list of field names (e.g. "LineItemId") to include in
  2477. // API requests with the JSON null value. By default, fields with empty
  2478. // values are omitted from API requests. However, any field with an
  2479. // empty value appearing in NullFields will be sent to the server as
  2480. // null. It is an error if a field in this list has a non-empty value.
  2481. // This may be used to include null fields in Patch requests.
  2482. NullFields []string `json:"-"`
  2483. }
  2484. func (s *OrdersRejectReturnLineItemRequest) MarshalJSON() ([]byte, error) {
  2485. type NoMethod OrdersRejectReturnLineItemRequest
  2486. raw := NoMethod(*s)
  2487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2488. }
  2489. type OrdersRejectReturnLineItemResponse struct {
  2490. // ExecutionStatus: The status of the execution.
  2491. ExecutionStatus string `json:"executionStatus,omitempty"`
  2492. // Kind: Identifies what kind of resource this is. Value: the fixed
  2493. // string "content#ordersRejectReturnLineItemResponse".
  2494. Kind string `json:"kind,omitempty"`
  2495. // ServerResponse contains the HTTP response code and headers from the
  2496. // server.
  2497. googleapi.ServerResponse `json:"-"`
  2498. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2499. // unconditionally include in API requests. By default, fields with
  2500. // empty values are omitted from API requests. However, any non-pointer,
  2501. // non-interface field appearing in ForceSendFields will be sent to the
  2502. // server regardless of whether the field is empty or not. This may be
  2503. // used to include empty fields in Patch requests.
  2504. ForceSendFields []string `json:"-"`
  2505. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2506. // include in API requests with the JSON null value. By default, fields
  2507. // with empty values are omitted from API requests. However, any field
  2508. // with an empty value appearing in NullFields will be sent to the
  2509. // server as null. It is an error if a field in this list has a
  2510. // non-empty value. This may be used to include null fields in Patch
  2511. // requests.
  2512. NullFields []string `json:"-"`
  2513. }
  2514. func (s *OrdersRejectReturnLineItemResponse) MarshalJSON() ([]byte, error) {
  2515. type NoMethod OrdersRejectReturnLineItemResponse
  2516. raw := NoMethod(*s)
  2517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2518. }
  2519. type OrdersReturnLineItemRequest struct {
  2520. // LineItemId: The ID of the line item to return. Either lineItemId or
  2521. // productId is required.
  2522. LineItemId string `json:"lineItemId,omitempty"`
  2523. // OperationId: The ID of the operation. Unique across all operations
  2524. // for a given order.
  2525. OperationId string `json:"operationId,omitempty"`
  2526. // ProductId: The ID of the product to return. This is the REST ID used
  2527. // in the products service. Either lineItemId or productId is required.
  2528. ProductId string `json:"productId,omitempty"`
  2529. // Quantity: The quantity to return.
  2530. Quantity int64 `json:"quantity,omitempty"`
  2531. // Reason: The reason for the return.
  2532. Reason string `json:"reason,omitempty"`
  2533. // ReasonText: The explanation of the reason.
  2534. ReasonText string `json:"reasonText,omitempty"`
  2535. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  2536. // unconditionally include in API requests. By default, fields with
  2537. // empty values are omitted from API requests. However, any non-pointer,
  2538. // non-interface field appearing in ForceSendFields will be sent to the
  2539. // server regardless of whether the field is empty or not. This may be
  2540. // used to include empty fields in Patch requests.
  2541. ForceSendFields []string `json:"-"`
  2542. // NullFields is a list of field names (e.g. "LineItemId") to include in
  2543. // API requests with the JSON null value. By default, fields with empty
  2544. // values are omitted from API requests. However, any field with an
  2545. // empty value appearing in NullFields will be sent to the server as
  2546. // null. It is an error if a field in this list has a non-empty value.
  2547. // This may be used to include null fields in Patch requests.
  2548. NullFields []string `json:"-"`
  2549. }
  2550. func (s *OrdersReturnLineItemRequest) MarshalJSON() ([]byte, error) {
  2551. type NoMethod OrdersReturnLineItemRequest
  2552. raw := NoMethod(*s)
  2553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2554. }
  2555. type OrdersReturnLineItemResponse struct {
  2556. // ExecutionStatus: The status of the execution.
  2557. ExecutionStatus string `json:"executionStatus,omitempty"`
  2558. // Kind: Identifies what kind of resource this is. Value: the fixed
  2559. // string "content#ordersReturnLineItemResponse".
  2560. Kind string `json:"kind,omitempty"`
  2561. // ServerResponse contains the HTTP response code and headers from the
  2562. // server.
  2563. googleapi.ServerResponse `json:"-"`
  2564. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2565. // unconditionally include in API requests. By default, fields with
  2566. // empty values are omitted from API requests. However, any non-pointer,
  2567. // non-interface field appearing in ForceSendFields will be sent to the
  2568. // server regardless of whether the field is empty or not. This may be
  2569. // used to include empty fields in Patch requests.
  2570. ForceSendFields []string `json:"-"`
  2571. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2572. // include in API requests with the JSON null value. By default, fields
  2573. // with empty values are omitted from API requests. However, any field
  2574. // with an empty value appearing in NullFields will be sent to the
  2575. // server as null. It is an error if a field in this list has a
  2576. // non-empty value. This may be used to include null fields in Patch
  2577. // requests.
  2578. NullFields []string `json:"-"`
  2579. }
  2580. func (s *OrdersReturnLineItemResponse) MarshalJSON() ([]byte, error) {
  2581. type NoMethod OrdersReturnLineItemResponse
  2582. raw := NoMethod(*s)
  2583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2584. }
  2585. type OrdersReturnRefundLineItemRequest struct {
  2586. // AmountPretax: The amount that is refunded. Optional, but if filled
  2587. // then both amountPretax and amountTax must be set.
  2588. AmountPretax *Price `json:"amountPretax,omitempty"`
  2589. // AmountTax: Tax amount that correspond to refund amount in
  2590. // amountPretax.
  2591. AmountTax *Price `json:"amountTax,omitempty"`
  2592. // LineItemId: The ID of the line item to return. Either lineItemId or
  2593. // productId is required.
  2594. LineItemId string `json:"lineItemId,omitempty"`
  2595. // OperationId: The ID of the operation. Unique across all operations
  2596. // for a given order.
  2597. OperationId string `json:"operationId,omitempty"`
  2598. // ProductId: The ID of the product to return. This is the REST ID used
  2599. // in the products service. Either lineItemId or productId is required.
  2600. ProductId string `json:"productId,omitempty"`
  2601. // Quantity: The quantity to return and refund.
  2602. Quantity int64 `json:"quantity,omitempty"`
  2603. // Reason: The reason for the return.
  2604. Reason string `json:"reason,omitempty"`
  2605. // ReasonText: The explanation of the reason.
  2606. ReasonText string `json:"reasonText,omitempty"`
  2607. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  2608. // unconditionally include in API requests. By default, fields with
  2609. // empty values are omitted from API requests. However, any non-pointer,
  2610. // non-interface field appearing in ForceSendFields will be sent to the
  2611. // server regardless of whether the field is empty or not. This may be
  2612. // used to include empty fields in Patch requests.
  2613. ForceSendFields []string `json:"-"`
  2614. // NullFields is a list of field names (e.g. "AmountPretax") to include
  2615. // in API requests with the JSON null value. By default, fields with
  2616. // empty values are omitted from API requests. However, any field with
  2617. // an empty value appearing in NullFields will be sent to the server as
  2618. // null. It is an error if a field in this list has a non-empty value.
  2619. // This may be used to include null fields in Patch requests.
  2620. NullFields []string `json:"-"`
  2621. }
  2622. func (s *OrdersReturnRefundLineItemRequest) MarshalJSON() ([]byte, error) {
  2623. type NoMethod OrdersReturnRefundLineItemRequest
  2624. raw := NoMethod(*s)
  2625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2626. }
  2627. type OrdersReturnRefundLineItemResponse struct {
  2628. // ExecutionStatus: The status of the execution.
  2629. ExecutionStatus string `json:"executionStatus,omitempty"`
  2630. // Kind: Identifies what kind of resource this is. Value: the fixed
  2631. // string "content#ordersReturnRefundLineItemResponse".
  2632. Kind string `json:"kind,omitempty"`
  2633. // ServerResponse contains the HTTP response code and headers from the
  2634. // server.
  2635. googleapi.ServerResponse `json:"-"`
  2636. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2637. // unconditionally include in API requests. By default, fields with
  2638. // empty values are omitted from API requests. However, any non-pointer,
  2639. // non-interface field appearing in ForceSendFields will be sent to the
  2640. // server regardless of whether the field is empty or not. This may be
  2641. // used to include empty fields in Patch requests.
  2642. ForceSendFields []string `json:"-"`
  2643. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2644. // include in API requests with the JSON null value. By default, fields
  2645. // with empty values are omitted from API requests. However, any field
  2646. // with an empty value appearing in NullFields will be sent to the
  2647. // server as null. It is an error if a field in this list has a
  2648. // non-empty value. This may be used to include null fields in Patch
  2649. // requests.
  2650. NullFields []string `json:"-"`
  2651. }
  2652. func (s *OrdersReturnRefundLineItemResponse) MarshalJSON() ([]byte, error) {
  2653. type NoMethod OrdersReturnRefundLineItemResponse
  2654. raw := NoMethod(*s)
  2655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2656. }
  2657. type OrdersSetLineItemMetadataRequest struct {
  2658. Annotations []*OrderMerchantProvidedAnnotation `json:"annotations,omitempty"`
  2659. // LineItemId: The ID of the line item to set metadata. Either
  2660. // lineItemId or productId is required.
  2661. LineItemId string `json:"lineItemId,omitempty"`
  2662. // OperationId: The ID of the operation. Unique across all operations
  2663. // for a given order.
  2664. OperationId string `json:"operationId,omitempty"`
  2665. // ProductId: The ID of the product to set metadata. This is the REST ID
  2666. // used in the products service. Either lineItemId or productId is
  2667. // required.
  2668. ProductId string `json:"productId,omitempty"`
  2669. // ForceSendFields is a list of field names (e.g. "Annotations") to
  2670. // unconditionally include in API requests. By default, fields with
  2671. // empty values are omitted from API requests. However, any non-pointer,
  2672. // non-interface field appearing in ForceSendFields will be sent to the
  2673. // server regardless of whether the field is empty or not. This may be
  2674. // used to include empty fields in Patch requests.
  2675. ForceSendFields []string `json:"-"`
  2676. // NullFields is a list of field names (e.g. "Annotations") to include
  2677. // in API requests with the JSON null value. By default, fields with
  2678. // empty values are omitted from API requests. However, any field with
  2679. // an empty value appearing in NullFields will be sent to the server as
  2680. // null. It is an error if a field in this list has a non-empty value.
  2681. // This may be used to include null fields in Patch requests.
  2682. NullFields []string `json:"-"`
  2683. }
  2684. func (s *OrdersSetLineItemMetadataRequest) MarshalJSON() ([]byte, error) {
  2685. type NoMethod OrdersSetLineItemMetadataRequest
  2686. raw := NoMethod(*s)
  2687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2688. }
  2689. type OrdersSetLineItemMetadataResponse struct {
  2690. // ExecutionStatus: The status of the execution.
  2691. ExecutionStatus string `json:"executionStatus,omitempty"`
  2692. // Kind: Identifies what kind of resource this is. Value: the fixed
  2693. // string "content#ordersSetLineItemMetadataResponse".
  2694. Kind string `json:"kind,omitempty"`
  2695. // ServerResponse contains the HTTP response code and headers from the
  2696. // server.
  2697. googleapi.ServerResponse `json:"-"`
  2698. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2699. // unconditionally include in API requests. By default, fields with
  2700. // empty values are omitted from API requests. However, any non-pointer,
  2701. // non-interface field appearing in ForceSendFields will be sent to the
  2702. // server regardless of whether the field is empty or not. This may be
  2703. // used to include empty fields in Patch requests.
  2704. ForceSendFields []string `json:"-"`
  2705. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2706. // include in API requests with the JSON null value. By default, fields
  2707. // with empty values are omitted from API requests. However, any field
  2708. // with an empty value appearing in NullFields will be sent to the
  2709. // server as null. It is an error if a field in this list has a
  2710. // non-empty value. This may be used to include null fields in Patch
  2711. // requests.
  2712. NullFields []string `json:"-"`
  2713. }
  2714. func (s *OrdersSetLineItemMetadataResponse) MarshalJSON() ([]byte, error) {
  2715. type NoMethod OrdersSetLineItemMetadataResponse
  2716. raw := NoMethod(*s)
  2717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2718. }
  2719. type OrdersShipLineItemsRequest struct {
  2720. // Carrier: Deprecated. Please use shipmentInfo instead. The carrier
  2721. // handling the shipment. See shipments[].carrier in the Orders
  2722. // resource representation for a list of acceptable values.
  2723. Carrier string `json:"carrier,omitempty"`
  2724. // LineItems: Line items to ship.
  2725. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  2726. // OperationId: The ID of the operation. Unique across all operations
  2727. // for a given order.
  2728. OperationId string `json:"operationId,omitempty"`
  2729. // ShipmentGroupId: ID of the shipment group. Required for orders that
  2730. // use the orderinvoices service.
  2731. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  2732. // ShipmentId: Deprecated. Please use shipmentInfo instead. The ID of
  2733. // the shipment.
  2734. ShipmentId string `json:"shipmentId,omitempty"`
  2735. // ShipmentInfos: Shipment information. This field is repeated because a
  2736. // single line item can be shipped in several packages (and have several
  2737. // tracking IDs).
  2738. ShipmentInfos []*OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo `json:"shipmentInfos,omitempty"`
  2739. // TrackingId: Deprecated. Please use shipmentInfo instead. The tracking
  2740. // id for the shipment.
  2741. TrackingId string `json:"trackingId,omitempty"`
  2742. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2743. // unconditionally include in API requests. By default, fields with
  2744. // empty values are omitted from API requests. However, any non-pointer,
  2745. // non-interface field appearing in ForceSendFields will be sent to the
  2746. // server regardless of whether the field is empty or not. This may be
  2747. // used to include empty fields in Patch requests.
  2748. ForceSendFields []string `json:"-"`
  2749. // NullFields is a list of field names (e.g. "Carrier") to include in
  2750. // API requests with the JSON null value. By default, fields with empty
  2751. // values are omitted from API requests. However, any field with an
  2752. // empty value appearing in NullFields will be sent to the server as
  2753. // null. It is an error if a field in this list has a non-empty value.
  2754. // This may be used to include null fields in Patch requests.
  2755. NullFields []string `json:"-"`
  2756. }
  2757. func (s *OrdersShipLineItemsRequest) MarshalJSON() ([]byte, error) {
  2758. type NoMethod OrdersShipLineItemsRequest
  2759. raw := NoMethod(*s)
  2760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2761. }
  2762. type OrdersShipLineItemsResponse struct {
  2763. // ExecutionStatus: The status of the execution.
  2764. ExecutionStatus string `json:"executionStatus,omitempty"`
  2765. // Kind: Identifies what kind of resource this is. Value: the fixed
  2766. // string "content#ordersShipLineItemsResponse".
  2767. Kind string `json:"kind,omitempty"`
  2768. // ServerResponse contains the HTTP response code and headers from the
  2769. // server.
  2770. googleapi.ServerResponse `json:"-"`
  2771. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2772. // unconditionally include in API requests. By default, fields with
  2773. // empty values are omitted from API requests. However, any non-pointer,
  2774. // non-interface field appearing in ForceSendFields will be sent to the
  2775. // server regardless of whether the field is empty or not. This may be
  2776. // used to include empty fields in Patch requests.
  2777. ForceSendFields []string `json:"-"`
  2778. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2779. // include in API requests with the JSON null value. By default, fields
  2780. // with empty values are omitted from API requests. However, any field
  2781. // with an empty value appearing in NullFields will be sent to the
  2782. // server as null. It is an error if a field in this list has a
  2783. // non-empty value. This may be used to include null fields in Patch
  2784. // requests.
  2785. NullFields []string `json:"-"`
  2786. }
  2787. func (s *OrdersShipLineItemsResponse) MarshalJSON() ([]byte, error) {
  2788. type NoMethod OrdersShipLineItemsResponse
  2789. raw := NoMethod(*s)
  2790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2791. }
  2792. type OrdersUpdateLineItemShippingDetailsRequest struct {
  2793. // DeliverByDate: Updated delivery by date, in ISO 8601 format. If not
  2794. // specified only ship by date is updated.
  2795. DeliverByDate string `json:"deliverByDate,omitempty"`
  2796. // LineItemId: The ID of the line item to set metadata. Either
  2797. // lineItemId or productId is required.
  2798. LineItemId string `json:"lineItemId,omitempty"`
  2799. // OperationId: The ID of the operation. Unique across all operations
  2800. // for a given order.
  2801. OperationId string `json:"operationId,omitempty"`
  2802. // ProductId: The ID of the product to set metadata. This is the REST ID
  2803. // used in the products service. Either lineItemId or productId is
  2804. // required.
  2805. ProductId string `json:"productId,omitempty"`
  2806. // ShipByDate: Updated ship by date, in ISO 8601 format. If not
  2807. // specified only deliver by date is updated.
  2808. ShipByDate string `json:"shipByDate,omitempty"`
  2809. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  2810. // unconditionally include in API requests. By default, fields with
  2811. // empty values are omitted from API requests. However, any non-pointer,
  2812. // non-interface field appearing in ForceSendFields will be sent to the
  2813. // server regardless of whether the field is empty or not. This may be
  2814. // used to include empty fields in Patch requests.
  2815. ForceSendFields []string `json:"-"`
  2816. // NullFields is a list of field names (e.g. "DeliverByDate") to include
  2817. // in API requests with the JSON null value. By default, fields with
  2818. // empty values are omitted from API requests. However, any field with
  2819. // an empty value appearing in NullFields will be sent to the server as
  2820. // null. It is an error if a field in this list has a non-empty value.
  2821. // This may be used to include null fields in Patch requests.
  2822. NullFields []string `json:"-"`
  2823. }
  2824. func (s *OrdersUpdateLineItemShippingDetailsRequest) MarshalJSON() ([]byte, error) {
  2825. type NoMethod OrdersUpdateLineItemShippingDetailsRequest
  2826. raw := NoMethod(*s)
  2827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2828. }
  2829. type OrdersUpdateLineItemShippingDetailsResponse struct {
  2830. // ExecutionStatus: The status of the execution.
  2831. ExecutionStatus string `json:"executionStatus,omitempty"`
  2832. // Kind: Identifies what kind of resource this is. Value: the fixed
  2833. // string "content#ordersUpdateLineItemShippingDetailsResponse".
  2834. Kind string `json:"kind,omitempty"`
  2835. // ServerResponse contains the HTTP response code and headers from the
  2836. // server.
  2837. googleapi.ServerResponse `json:"-"`
  2838. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2839. // unconditionally include in API requests. By default, fields with
  2840. // empty values are omitted from API requests. However, any non-pointer,
  2841. // non-interface field appearing in ForceSendFields will be sent to the
  2842. // server regardless of whether the field is empty or not. This may be
  2843. // used to include empty fields in Patch requests.
  2844. ForceSendFields []string `json:"-"`
  2845. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2846. // include in API requests with the JSON null value. By default, fields
  2847. // with empty values are omitted from API requests. However, any field
  2848. // with an empty value appearing in NullFields will be sent to the
  2849. // server as null. It is an error if a field in this list has a
  2850. // non-empty value. This may be used to include null fields in Patch
  2851. // requests.
  2852. NullFields []string `json:"-"`
  2853. }
  2854. func (s *OrdersUpdateLineItemShippingDetailsResponse) MarshalJSON() ([]byte, error) {
  2855. type NoMethod OrdersUpdateLineItemShippingDetailsResponse
  2856. raw := NoMethod(*s)
  2857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2858. }
  2859. type OrdersUpdateMerchantOrderIdRequest struct {
  2860. // MerchantOrderId: The merchant order id to be assigned to the order.
  2861. // Must be unique per merchant.
  2862. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  2863. // OperationId: The ID of the operation. Unique across all operations
  2864. // for a given order.
  2865. OperationId string `json:"operationId,omitempty"`
  2866. // ForceSendFields is a list of field names (e.g. "MerchantOrderId") to
  2867. // unconditionally include in API requests. By default, fields with
  2868. // empty values are omitted from API requests. However, any non-pointer,
  2869. // non-interface field appearing in ForceSendFields will be sent to the
  2870. // server regardless of whether the field is empty or not. This may be
  2871. // used to include empty fields in Patch requests.
  2872. ForceSendFields []string `json:"-"`
  2873. // NullFields is a list of field names (e.g. "MerchantOrderId") to
  2874. // include in API requests with the JSON null value. By default, fields
  2875. // with empty values are omitted from API requests. However, any field
  2876. // with an empty value appearing in NullFields will be sent to the
  2877. // server as null. It is an error if a field in this list has a
  2878. // non-empty value. This may be used to include null fields in Patch
  2879. // requests.
  2880. NullFields []string `json:"-"`
  2881. }
  2882. func (s *OrdersUpdateMerchantOrderIdRequest) MarshalJSON() ([]byte, error) {
  2883. type NoMethod OrdersUpdateMerchantOrderIdRequest
  2884. raw := NoMethod(*s)
  2885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2886. }
  2887. type OrdersUpdateMerchantOrderIdResponse struct {
  2888. // ExecutionStatus: The status of the execution.
  2889. ExecutionStatus string `json:"executionStatus,omitempty"`
  2890. // Kind: Identifies what kind of resource this is. Value: the fixed
  2891. // string "content#ordersUpdateMerchantOrderIdResponse".
  2892. Kind string `json:"kind,omitempty"`
  2893. // ServerResponse contains the HTTP response code and headers from the
  2894. // server.
  2895. googleapi.ServerResponse `json:"-"`
  2896. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2897. // unconditionally include in API requests. By default, fields with
  2898. // empty values are omitted from API requests. However, any non-pointer,
  2899. // non-interface field appearing in ForceSendFields will be sent to the
  2900. // server regardless of whether the field is empty or not. This may be
  2901. // used to include empty fields in Patch requests.
  2902. ForceSendFields []string `json:"-"`
  2903. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2904. // include in API requests with the JSON null value. By default, fields
  2905. // with empty values are omitted from API requests. However, any field
  2906. // with an empty value appearing in NullFields will be sent to the
  2907. // server as null. It is an error if a field in this list has a
  2908. // non-empty value. This may be used to include null fields in Patch
  2909. // requests.
  2910. NullFields []string `json:"-"`
  2911. }
  2912. func (s *OrdersUpdateMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  2913. type NoMethod OrdersUpdateMerchantOrderIdResponse
  2914. raw := NoMethod(*s)
  2915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2916. }
  2917. type OrdersUpdateShipmentRequest struct {
  2918. // Carrier: The carrier handling the shipment. Not updated if missing.
  2919. // See shipments[].carrier in the Orders resource representation for a
  2920. // list of acceptable values.
  2921. Carrier string `json:"carrier,omitempty"`
  2922. // OperationId: The ID of the operation. Unique across all operations
  2923. // for a given order.
  2924. OperationId string `json:"operationId,omitempty"`
  2925. // ShipmentId: The ID of the shipment.
  2926. ShipmentId string `json:"shipmentId,omitempty"`
  2927. // Status: New status for the shipment. Not updated if missing.
  2928. Status string `json:"status,omitempty"`
  2929. // TrackingId: The tracking id for the shipment. Not updated if missing.
  2930. TrackingId string `json:"trackingId,omitempty"`
  2931. // ForceSendFields is a list of field names (e.g. "Carrier") to
  2932. // unconditionally include in API requests. By default, fields with
  2933. // empty values are omitted from API requests. However, any non-pointer,
  2934. // non-interface field appearing in ForceSendFields will be sent to the
  2935. // server regardless of whether the field is empty or not. This may be
  2936. // used to include empty fields in Patch requests.
  2937. ForceSendFields []string `json:"-"`
  2938. // NullFields is a list of field names (e.g. "Carrier") to include in
  2939. // API requests with the JSON null value. By default, fields with empty
  2940. // values are omitted from API requests. However, any field with an
  2941. // empty value appearing in NullFields will be sent to the server as
  2942. // null. It is an error if a field in this list has a non-empty value.
  2943. // This may be used to include null fields in Patch requests.
  2944. NullFields []string `json:"-"`
  2945. }
  2946. func (s *OrdersUpdateShipmentRequest) MarshalJSON() ([]byte, error) {
  2947. type NoMethod OrdersUpdateShipmentRequest
  2948. raw := NoMethod(*s)
  2949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2950. }
  2951. type OrdersUpdateShipmentResponse struct {
  2952. // ExecutionStatus: The status of the execution.
  2953. ExecutionStatus string `json:"executionStatus,omitempty"`
  2954. // Kind: Identifies what kind of resource this is. Value: the fixed
  2955. // string "content#ordersUpdateShipmentResponse".
  2956. Kind string `json:"kind,omitempty"`
  2957. // ServerResponse contains the HTTP response code and headers from the
  2958. // server.
  2959. googleapi.ServerResponse `json:"-"`
  2960. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  2961. // unconditionally include in API requests. By default, fields with
  2962. // empty values are omitted from API requests. However, any non-pointer,
  2963. // non-interface field appearing in ForceSendFields will be sent to the
  2964. // server regardless of whether the field is empty or not. This may be
  2965. // used to include empty fields in Patch requests.
  2966. ForceSendFields []string `json:"-"`
  2967. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  2968. // include in API requests with the JSON null value. By default, fields
  2969. // with empty values are omitted from API requests. However, any field
  2970. // with an empty value appearing in NullFields will be sent to the
  2971. // server as null. It is an error if a field in this list has a
  2972. // non-empty value. This may be used to include null fields in Patch
  2973. // requests.
  2974. NullFields []string `json:"-"`
  2975. }
  2976. func (s *OrdersUpdateShipmentResponse) MarshalJSON() ([]byte, error) {
  2977. type NoMethod OrdersUpdateShipmentResponse
  2978. raw := NoMethod(*s)
  2979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2980. }
  2981. type Price struct {
  2982. // Currency: The currency of the price.
  2983. Currency string `json:"currency,omitempty"`
  2984. // Value: The price represented as a number.
  2985. Value string `json:"value,omitempty"`
  2986. // ForceSendFields is a list of field names (e.g. "Currency") to
  2987. // unconditionally include in API requests. By default, fields with
  2988. // empty values are omitted from API requests. However, any non-pointer,
  2989. // non-interface field appearing in ForceSendFields will be sent to the
  2990. // server regardless of whether the field is empty or not. This may be
  2991. // used to include empty fields in Patch requests.
  2992. ForceSendFields []string `json:"-"`
  2993. // NullFields is a list of field names (e.g. "Currency") to include in
  2994. // API requests with the JSON null value. By default, fields with empty
  2995. // values are omitted from API requests. However, any field with an
  2996. // empty value appearing in NullFields will be sent to the server as
  2997. // null. It is an error if a field in this list has a non-empty value.
  2998. // This may be used to include null fields in Patch requests.
  2999. NullFields []string `json:"-"`
  3000. }
  3001. func (s *Price) MarshalJSON() ([]byte, error) {
  3002. type NoMethod Price
  3003. raw := NoMethod(*s)
  3004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3005. }
  3006. type Promotion struct {
  3007. // PromotionAmount: Amount of the promotion. The values here are the
  3008. // promotion applied to the unit price pretax and to the total of the
  3009. // tax amounts.
  3010. PromotionAmount *Amount `json:"promotionAmount,omitempty"`
  3011. // PromotionId: ID of the promotion.
  3012. PromotionId string `json:"promotionId,omitempty"`
  3013. // ForceSendFields is a list of field names (e.g. "PromotionAmount") to
  3014. // unconditionally include in API requests. By default, fields with
  3015. // empty values are omitted from API requests. However, any non-pointer,
  3016. // non-interface field appearing in ForceSendFields will be sent to the
  3017. // server regardless of whether the field is empty or not. This may be
  3018. // used to include empty fields in Patch requests.
  3019. ForceSendFields []string `json:"-"`
  3020. // NullFields is a list of field names (e.g. "PromotionAmount") to
  3021. // include in API requests with the JSON null value. By default, fields
  3022. // with empty values are omitted from API requests. However, any field
  3023. // with an empty value appearing in NullFields will be sent to the
  3024. // server as null. It is an error if a field in this list has a
  3025. // non-empty value. This may be used to include null fields in Patch
  3026. // requests.
  3027. NullFields []string `json:"-"`
  3028. }
  3029. func (s *Promotion) MarshalJSON() ([]byte, error) {
  3030. type NoMethod Promotion
  3031. raw := NoMethod(*s)
  3032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3033. }
  3034. type ShipmentInvoice struct {
  3035. // InvoiceSummary: Invoice summary.
  3036. InvoiceSummary *InvoiceSummary `json:"invoiceSummary,omitempty"`
  3037. // LineItemInvoices: Invoice details per line item.
  3038. LineItemInvoices []*ShipmentInvoiceLineItemInvoice `json:"lineItemInvoices,omitempty"`
  3039. // ShipmentGroupId: ID of the shipment group.
  3040. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  3041. // ForceSendFields is a list of field names (e.g. "InvoiceSummary") to
  3042. // unconditionally include in API requests. By default, fields with
  3043. // empty values are omitted from API requests. However, any non-pointer,
  3044. // non-interface field appearing in ForceSendFields will be sent to the
  3045. // server regardless of whether the field is empty or not. This may be
  3046. // used to include empty fields in Patch requests.
  3047. ForceSendFields []string `json:"-"`
  3048. // NullFields is a list of field names (e.g. "InvoiceSummary") to
  3049. // include in API requests with the JSON null value. By default, fields
  3050. // with empty values are omitted from API requests. However, any field
  3051. // with an empty value appearing in NullFields will be sent to the
  3052. // server as null. It is an error if a field in this list has a
  3053. // non-empty value. This may be used to include null fields in Patch
  3054. // requests.
  3055. NullFields []string `json:"-"`
  3056. }
  3057. func (s *ShipmentInvoice) MarshalJSON() ([]byte, error) {
  3058. type NoMethod ShipmentInvoice
  3059. raw := NoMethod(*s)
  3060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3061. }
  3062. type ShipmentInvoiceLineItemInvoice struct {
  3063. // LineItemId: ID of the line item. Either lineItemId or productId must
  3064. // be set.
  3065. LineItemId string `json:"lineItemId,omitempty"`
  3066. // ProductId: ID of the product. This is the REST ID used in the
  3067. // products service. Either lineItemId or productId must be set.
  3068. ProductId string `json:"productId,omitempty"`
  3069. // ShipmentUnitIds: Unit IDs to define specific units within the line
  3070. // item.
  3071. ShipmentUnitIds []string `json:"shipmentUnitIds,omitempty"`
  3072. // UnitInvoice: Invoice details for a single unit.
  3073. UnitInvoice *UnitInvoice `json:"unitInvoice,omitempty"`
  3074. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  3075. // unconditionally include in API requests. By default, fields with
  3076. // empty values are omitted from API requests. However, any non-pointer,
  3077. // non-interface field appearing in ForceSendFields will be sent to the
  3078. // server regardless of whether the field is empty or not. This may be
  3079. // used to include empty fields in Patch requests.
  3080. ForceSendFields []string `json:"-"`
  3081. // NullFields is a list of field names (e.g. "LineItemId") to include in
  3082. // API requests with the JSON null value. By default, fields with empty
  3083. // values are omitted from API requests. However, any field with an
  3084. // empty value appearing in NullFields will be sent to the server as
  3085. // null. It is an error if a field in this list has a non-empty value.
  3086. // This may be used to include null fields in Patch requests.
  3087. NullFields []string `json:"-"`
  3088. }
  3089. func (s *ShipmentInvoiceLineItemInvoice) MarshalJSON() ([]byte, error) {
  3090. type NoMethod ShipmentInvoiceLineItemInvoice
  3091. raw := NoMethod(*s)
  3092. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3093. }
  3094. type TestOrder struct {
  3095. // Customer: The details of the customer who placed the order.
  3096. Customer *TestOrderCustomer `json:"customer,omitempty"`
  3097. // EnableOrderinvoices: Whether the orderinvoices service should support
  3098. // this order.
  3099. EnableOrderinvoices bool `json:"enableOrderinvoices,omitempty"`
  3100. // Kind: Identifies what kind of resource this is. Value: the fixed
  3101. // string "content#testOrder".
  3102. Kind string `json:"kind,omitempty"`
  3103. // LineItems: Line items that are ordered. At least one line item must
  3104. // be provided.
  3105. LineItems []*TestOrderLineItem `json:"lineItems,omitempty"`
  3106. // NotificationMode: Determines if test order must be pulled by merchant
  3107. // or pushed to merchant via push integration.
  3108. NotificationMode string `json:"notificationMode,omitempty"`
  3109. // PaymentMethod: The details of the payment method.
  3110. PaymentMethod *TestOrderPaymentMethod `json:"paymentMethod,omitempty"`
  3111. // PredefinedDeliveryAddress: Identifier of one of the predefined
  3112. // delivery addresses for the delivery.
  3113. PredefinedDeliveryAddress string `json:"predefinedDeliveryAddress,omitempty"`
  3114. // Promotions: The details of the merchant provided promotions applied
  3115. // to the order. More details about the program are here.
  3116. Promotions []*OrderPromotion `json:"promotions,omitempty"`
  3117. // ShippingCost: The total cost of shipping for all items.
  3118. ShippingCost *Price `json:"shippingCost,omitempty"`
  3119. // ShippingCostTax: The tax for the total shipping cost.
  3120. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  3121. // ShippingOption: The requested shipping option.
  3122. ShippingOption string `json:"shippingOption,omitempty"`
  3123. // ForceSendFields is a list of field names (e.g. "Customer") to
  3124. // unconditionally include in API requests. By default, fields with
  3125. // empty values are omitted from API requests. However, any non-pointer,
  3126. // non-interface field appearing in ForceSendFields will be sent to the
  3127. // server regardless of whether the field is empty or not. This may be
  3128. // used to include empty fields in Patch requests.
  3129. ForceSendFields []string `json:"-"`
  3130. // NullFields is a list of field names (e.g. "Customer") to include in
  3131. // API requests with the JSON null value. By default, fields with empty
  3132. // values are omitted from API requests. However, any field with an
  3133. // empty value appearing in NullFields will be sent to the server as
  3134. // null. It is an error if a field in this list has a non-empty value.
  3135. // This may be used to include null fields in Patch requests.
  3136. NullFields []string `json:"-"`
  3137. }
  3138. func (s *TestOrder) MarshalJSON() ([]byte, error) {
  3139. type NoMethod TestOrder
  3140. raw := NoMethod(*s)
  3141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3142. }
  3143. type TestOrderCustomer struct {
  3144. // Email: Email address of the customer.
  3145. Email string `json:"email,omitempty"`
  3146. // ExplicitMarketingPreference: Deprecated. Please use
  3147. // marketingRightsInfo instead.
  3148. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  3149. // FullName: Full name of the customer.
  3150. FullName string `json:"fullName,omitempty"`
  3151. // MarketingRightsInfo: Customer's marketing preferences.
  3152. MarketingRightsInfo *TestOrderCustomerMarketingRightsInfo `json:"marketingRightsInfo,omitempty"`
  3153. // ForceSendFields is a list of field names (e.g. "Email") to
  3154. // unconditionally include in API requests. By default, fields with
  3155. // empty values are omitted from API requests. However, any non-pointer,
  3156. // non-interface field appearing in ForceSendFields will be sent to the
  3157. // server regardless of whether the field is empty or not. This may be
  3158. // used to include empty fields in Patch requests.
  3159. ForceSendFields []string `json:"-"`
  3160. // NullFields is a list of field names (e.g. "Email") to include in API
  3161. // requests with the JSON null value. By default, fields with empty
  3162. // values are omitted from API requests. However, any field with an
  3163. // empty value appearing in NullFields will be sent to the server as
  3164. // null. It is an error if a field in this list has a non-empty value.
  3165. // This may be used to include null fields in Patch requests.
  3166. NullFields []string `json:"-"`
  3167. }
  3168. func (s *TestOrderCustomer) MarshalJSON() ([]byte, error) {
  3169. type NoMethod TestOrderCustomer
  3170. raw := NoMethod(*s)
  3171. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3172. }
  3173. type TestOrderCustomerMarketingRightsInfo struct {
  3174. // ExplicitMarketingPreference: Last know user use selection regards
  3175. // marketing preferences. In certain cases selection might not be known,
  3176. // so this field would be empty.
  3177. ExplicitMarketingPreference string `json:"explicitMarketingPreference,omitempty"`
  3178. // LastUpdatedTimestamp: Timestamp when last time marketing preference
  3179. // was updated. Could be empty, if user wasn't offered a selection yet.
  3180. LastUpdatedTimestamp string `json:"lastUpdatedTimestamp,omitempty"`
  3181. // ForceSendFields is a list of field names (e.g.
  3182. // "ExplicitMarketingPreference") to unconditionally include in API
  3183. // requests. By default, fields with empty values are omitted from API
  3184. // requests. However, any non-pointer, non-interface field appearing in
  3185. // ForceSendFields will be sent to the server regardless of whether the
  3186. // field is empty or not. This may be used to include empty fields in
  3187. // Patch requests.
  3188. ForceSendFields []string `json:"-"`
  3189. // NullFields is a list of field names (e.g.
  3190. // "ExplicitMarketingPreference") to include in API requests with the
  3191. // JSON null value. By default, fields with empty values are omitted
  3192. // from API requests. However, any field with an empty value appearing
  3193. // in NullFields will be sent to the server as null. It is an error if a
  3194. // field in this list has a non-empty value. This may be used to include
  3195. // null fields in Patch requests.
  3196. NullFields []string `json:"-"`
  3197. }
  3198. func (s *TestOrderCustomerMarketingRightsInfo) MarshalJSON() ([]byte, error) {
  3199. type NoMethod TestOrderCustomerMarketingRightsInfo
  3200. raw := NoMethod(*s)
  3201. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3202. }
  3203. type TestOrderLineItem struct {
  3204. // Product: Product data from the time of the order placement.
  3205. Product *TestOrderLineItemProduct `json:"product,omitempty"`
  3206. // QuantityOrdered: Number of items ordered.
  3207. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  3208. // ReturnInfo: Details of the return policy for the line item.
  3209. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  3210. // ShippingDetails: Details of the requested shipping for the line item.
  3211. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  3212. // UnitTax: Unit tax for the line item.
  3213. UnitTax *Price `json:"unitTax,omitempty"`
  3214. // ForceSendFields is a list of field names (e.g. "Product") to
  3215. // unconditionally include in API requests. By default, fields with
  3216. // empty values are omitted from API requests. However, any non-pointer,
  3217. // non-interface field appearing in ForceSendFields will be sent to the
  3218. // server regardless of whether the field is empty or not. This may be
  3219. // used to include empty fields in Patch requests.
  3220. ForceSendFields []string `json:"-"`
  3221. // NullFields is a list of field names (e.g. "Product") to include in
  3222. // API requests with the JSON null value. By default, fields with empty
  3223. // values are omitted from API requests. However, any field with an
  3224. // empty value appearing in NullFields will be sent to the server as
  3225. // null. It is an error if a field in this list has a non-empty value.
  3226. // This may be used to include null fields in Patch requests.
  3227. NullFields []string `json:"-"`
  3228. }
  3229. func (s *TestOrderLineItem) MarshalJSON() ([]byte, error) {
  3230. type NoMethod TestOrderLineItem
  3231. raw := NoMethod(*s)
  3232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3233. }
  3234. type TestOrderLineItemProduct struct {
  3235. // Brand: Brand of the item.
  3236. Brand string `json:"brand,omitempty"`
  3237. // Channel: The item's channel.
  3238. Channel string `json:"channel,omitempty"`
  3239. // Condition: Condition or state of the item.
  3240. Condition string `json:"condition,omitempty"`
  3241. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  3242. ContentLanguage string `json:"contentLanguage,omitempty"`
  3243. // Gtin: Global Trade Item Number (GTIN) of the item. Optional.
  3244. Gtin string `json:"gtin,omitempty"`
  3245. // ImageLink: URL of an image of the item.
  3246. ImageLink string `json:"imageLink,omitempty"`
  3247. // ItemGroupId: Shared identifier for all variants of the same product.
  3248. // Optional.
  3249. ItemGroupId string `json:"itemGroupId,omitempty"`
  3250. // Mpn: Manufacturer Part Number (MPN) of the item. Optional.
  3251. Mpn string `json:"mpn,omitempty"`
  3252. // OfferId: An identifier of the item.
  3253. OfferId string `json:"offerId,omitempty"`
  3254. // Price: The price for the product.
  3255. Price *Price `json:"price,omitempty"`
  3256. // TargetCountry: The CLDR territory code of the target country of the
  3257. // product.
  3258. TargetCountry string `json:"targetCountry,omitempty"`
  3259. // Title: The title of the product.
  3260. Title string `json:"title,omitempty"`
  3261. // VariantAttributes: Variant attributes for the item. Optional.
  3262. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  3263. // ForceSendFields is a list of field names (e.g. "Brand") to
  3264. // unconditionally include in API requests. By default, fields with
  3265. // empty values are omitted from API requests. However, any non-pointer,
  3266. // non-interface field appearing in ForceSendFields will be sent to the
  3267. // server regardless of whether the field is empty or not. This may be
  3268. // used to include empty fields in Patch requests.
  3269. ForceSendFields []string `json:"-"`
  3270. // NullFields is a list of field names (e.g. "Brand") to include in API
  3271. // requests with the JSON null value. By default, fields with empty
  3272. // values are omitted from API requests. However, any field with an
  3273. // empty value appearing in NullFields will be sent to the server as
  3274. // null. It is an error if a field in this list has a non-empty value.
  3275. // This may be used to include null fields in Patch requests.
  3276. NullFields []string `json:"-"`
  3277. }
  3278. func (s *TestOrderLineItemProduct) MarshalJSON() ([]byte, error) {
  3279. type NoMethod TestOrderLineItemProduct
  3280. raw := NoMethod(*s)
  3281. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3282. }
  3283. type TestOrderPaymentMethod struct {
  3284. // ExpirationMonth: The card expiration month (January = 1, February = 2
  3285. // etc.).
  3286. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  3287. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  3288. ExpirationYear int64 `json:"expirationYear,omitempty"`
  3289. // LastFourDigits: The last four digits of the card number.
  3290. LastFourDigits string `json:"lastFourDigits,omitempty"`
  3291. // PredefinedBillingAddress: The billing address.
  3292. PredefinedBillingAddress string `json:"predefinedBillingAddress,omitempty"`
  3293. // Type: The type of instrument. Note that real orders might have
  3294. // different values than the four values accepted by createTestOrder.
  3295. Type string `json:"type,omitempty"`
  3296. // ForceSendFields is a list of field names (e.g. "ExpirationMonth") to
  3297. // unconditionally include in API requests. By default, fields with
  3298. // empty values are omitted from API requests. However, any non-pointer,
  3299. // non-interface field appearing in ForceSendFields will be sent to the
  3300. // server regardless of whether the field is empty or not. This may be
  3301. // used to include empty fields in Patch requests.
  3302. ForceSendFields []string `json:"-"`
  3303. // NullFields is a list of field names (e.g. "ExpirationMonth") to
  3304. // include in API requests with the JSON null value. By default, fields
  3305. // with empty values are omitted from API requests. However, any field
  3306. // with an empty value appearing in NullFields will be sent to the
  3307. // server as null. It is an error if a field in this list has a
  3308. // non-empty value. This may be used to include null fields in Patch
  3309. // requests.
  3310. NullFields []string `json:"-"`
  3311. }
  3312. func (s *TestOrderPaymentMethod) MarshalJSON() ([]byte, error) {
  3313. type NoMethod TestOrderPaymentMethod
  3314. raw := NoMethod(*s)
  3315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3316. }
  3317. type UnitInvoice struct {
  3318. // AdditionalCharges: Additional charges for a unit, e.g. shipping
  3319. // costs.
  3320. AdditionalCharges []*UnitInvoiceAdditionalCharge `json:"additionalCharges,omitempty"`
  3321. // Promotions: Promotions applied to a unit.
  3322. Promotions []*Promotion `json:"promotions,omitempty"`
  3323. // UnitPricePretax: Price of the unit, before applying taxes.
  3324. UnitPricePretax *Price `json:"unitPricePretax,omitempty"`
  3325. // UnitPriceTaxes: Tax amounts to apply to the unit price.
  3326. UnitPriceTaxes []*UnitInvoiceTaxLine `json:"unitPriceTaxes,omitempty"`
  3327. // ForceSendFields is a list of field names (e.g. "AdditionalCharges")
  3328. // to unconditionally include in API requests. By default, fields with
  3329. // empty values are omitted from API requests. However, any non-pointer,
  3330. // non-interface field appearing in ForceSendFields will be sent to the
  3331. // server regardless of whether the field is empty or not. This may be
  3332. // used to include empty fields in Patch requests.
  3333. ForceSendFields []string `json:"-"`
  3334. // NullFields is a list of field names (e.g. "AdditionalCharges") to
  3335. // include in API requests with the JSON null value. By default, fields
  3336. // with empty values are omitted from API requests. However, any field
  3337. // with an empty value appearing in NullFields will be sent to the
  3338. // server as null. It is an error if a field in this list has a
  3339. // non-empty value. This may be used to include null fields in Patch
  3340. // requests.
  3341. NullFields []string `json:"-"`
  3342. }
  3343. func (s *UnitInvoice) MarshalJSON() ([]byte, error) {
  3344. type NoMethod UnitInvoice
  3345. raw := NoMethod(*s)
  3346. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3347. }
  3348. type UnitInvoiceAdditionalCharge struct {
  3349. // AdditionalChargeAmount: Amount of the additional charge.
  3350. AdditionalChargeAmount *Amount `json:"additionalChargeAmount,omitempty"`
  3351. // AdditionalChargePromotions: Promotions applied to the additional
  3352. // charge.
  3353. AdditionalChargePromotions []*Promotion `json:"additionalChargePromotions,omitempty"`
  3354. // Type: Type of the additional charge.
  3355. Type string `json:"type,omitempty"`
  3356. // ForceSendFields is a list of field names (e.g.
  3357. // "AdditionalChargeAmount") to unconditionally include in API requests.
  3358. // By default, fields with empty values are omitted from API requests.
  3359. // However, any non-pointer, non-interface field appearing in
  3360. // ForceSendFields will be sent to the server regardless of whether the
  3361. // field is empty or not. This may be used to include empty fields in
  3362. // Patch requests.
  3363. ForceSendFields []string `json:"-"`
  3364. // NullFields is a list of field names (e.g. "AdditionalChargeAmount")
  3365. // to include in API requests with the JSON null value. By default,
  3366. // fields with empty values are omitted from API requests. However, any
  3367. // field with an empty value appearing in NullFields will be sent to the
  3368. // server as null. It is an error if a field in this list has a
  3369. // non-empty value. This may be used to include null fields in Patch
  3370. // requests.
  3371. NullFields []string `json:"-"`
  3372. }
  3373. func (s *UnitInvoiceAdditionalCharge) MarshalJSON() ([]byte, error) {
  3374. type NoMethod UnitInvoiceAdditionalCharge
  3375. raw := NoMethod(*s)
  3376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3377. }
  3378. type UnitInvoiceTaxLine struct {
  3379. // TaxAmount: Tax amount for the tax type.
  3380. TaxAmount *Price `json:"taxAmount,omitempty"`
  3381. // TaxName: Optional name of the tax type.
  3382. TaxName string `json:"taxName,omitempty"`
  3383. // TaxType: Type of the tax.
  3384. TaxType string `json:"taxType,omitempty"`
  3385. // ForceSendFields is a list of field names (e.g. "TaxAmount") to
  3386. // unconditionally include in API requests. By default, fields with
  3387. // empty values are omitted from API requests. However, any non-pointer,
  3388. // non-interface field appearing in ForceSendFields will be sent to the
  3389. // server regardless of whether the field is empty or not. This may be
  3390. // used to include empty fields in Patch requests.
  3391. ForceSendFields []string `json:"-"`
  3392. // NullFields is a list of field names (e.g. "TaxAmount") to include in
  3393. // API requests with the JSON null value. By default, fields with empty
  3394. // values are omitted from API requests. However, any field with an
  3395. // empty value appearing in NullFields will be sent to the server as
  3396. // null. It is an error if a field in this list has a non-empty value.
  3397. // This may be used to include null fields in Patch requests.
  3398. NullFields []string `json:"-"`
  3399. }
  3400. func (s *UnitInvoiceTaxLine) MarshalJSON() ([]byte, error) {
  3401. type NoMethod UnitInvoiceTaxLine
  3402. raw := NoMethod(*s)
  3403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3404. }
  3405. // method id "content.orderinvoices.createchargeinvoice":
  3406. type OrderinvoicesCreatechargeinvoiceCall struct {
  3407. s *APIService
  3408. merchantId uint64
  3409. orderId string
  3410. orderinvoicescreatechargeinvoicerequest *OrderinvoicesCreateChargeInvoiceRequest
  3411. urlParams_ gensupport.URLParams
  3412. ctx_ context.Context
  3413. header_ http.Header
  3414. }
  3415. // Createchargeinvoice: Creates a charge invoice for a shipment group,
  3416. // and triggers a charge capture for non-facilitated payment orders.
  3417. func (r *OrderinvoicesService) Createchargeinvoice(merchantId uint64, orderId string, orderinvoicescreatechargeinvoicerequest *OrderinvoicesCreateChargeInvoiceRequest) *OrderinvoicesCreatechargeinvoiceCall {
  3418. c := &OrderinvoicesCreatechargeinvoiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3419. c.merchantId = merchantId
  3420. c.orderId = orderId
  3421. c.orderinvoicescreatechargeinvoicerequest = orderinvoicescreatechargeinvoicerequest
  3422. return c
  3423. }
  3424. // Fields allows partial responses to be retrieved. See
  3425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3426. // for more information.
  3427. func (c *OrderinvoicesCreatechargeinvoiceCall) Fields(s ...googleapi.Field) *OrderinvoicesCreatechargeinvoiceCall {
  3428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3429. return c
  3430. }
  3431. // Context sets the context to be used in this call's Do method. Any
  3432. // pending HTTP request will be aborted if the provided context is
  3433. // canceled.
  3434. func (c *OrderinvoicesCreatechargeinvoiceCall) Context(ctx context.Context) *OrderinvoicesCreatechargeinvoiceCall {
  3435. c.ctx_ = ctx
  3436. return c
  3437. }
  3438. // Header returns an http.Header that can be modified by the caller to
  3439. // add HTTP headers to the request.
  3440. func (c *OrderinvoicesCreatechargeinvoiceCall) Header() http.Header {
  3441. if c.header_ == nil {
  3442. c.header_ = make(http.Header)
  3443. }
  3444. return c.header_
  3445. }
  3446. func (c *OrderinvoicesCreatechargeinvoiceCall) doRequest(alt string) (*http.Response, error) {
  3447. reqHeaders := make(http.Header)
  3448. for k, v := range c.header_ {
  3449. reqHeaders[k] = v
  3450. }
  3451. reqHeaders.Set("User-Agent", c.s.userAgent())
  3452. var body io.Reader = nil
  3453. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderinvoicescreatechargeinvoicerequest)
  3454. if err != nil {
  3455. return nil, err
  3456. }
  3457. reqHeaders.Set("Content-Type", "application/json")
  3458. c.urlParams_.Set("alt", alt)
  3459. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderinvoices/{orderId}/createChargeInvoice")
  3460. urls += "?" + c.urlParams_.Encode()
  3461. req, _ := http.NewRequest("POST", urls, body)
  3462. req.Header = reqHeaders
  3463. googleapi.Expand(req.URL, map[string]string{
  3464. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3465. "orderId": c.orderId,
  3466. })
  3467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3468. }
  3469. // Do executes the "content.orderinvoices.createchargeinvoice" call.
  3470. // Exactly one of *OrderinvoicesCreateChargeInvoiceResponse or error
  3471. // will be non-nil. Any non-2xx status code is an error. Response
  3472. // headers are in either
  3473. // *OrderinvoicesCreateChargeInvoiceResponse.ServerResponse.Header or
  3474. // (if a response was returned at all) in
  3475. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3476. // whether the returned error was because http.StatusNotModified was
  3477. // returned.
  3478. func (c *OrderinvoicesCreatechargeinvoiceCall) Do(opts ...googleapi.CallOption) (*OrderinvoicesCreateChargeInvoiceResponse, error) {
  3479. gensupport.SetOptions(c.urlParams_, opts...)
  3480. res, err := c.doRequest("json")
  3481. if res != nil && res.StatusCode == http.StatusNotModified {
  3482. if res.Body != nil {
  3483. res.Body.Close()
  3484. }
  3485. return nil, &googleapi.Error{
  3486. Code: res.StatusCode,
  3487. Header: res.Header,
  3488. }
  3489. }
  3490. if err != nil {
  3491. return nil, err
  3492. }
  3493. defer googleapi.CloseBody(res)
  3494. if err := googleapi.CheckResponse(res); err != nil {
  3495. return nil, err
  3496. }
  3497. ret := &OrderinvoicesCreateChargeInvoiceResponse{
  3498. ServerResponse: googleapi.ServerResponse{
  3499. Header: res.Header,
  3500. HTTPStatusCode: res.StatusCode,
  3501. },
  3502. }
  3503. target := &ret
  3504. if err := gensupport.DecodeResponse(target, res); err != nil {
  3505. return nil, err
  3506. }
  3507. return ret, nil
  3508. // {
  3509. // "description": "Creates a charge invoice for a shipment group, and triggers a charge capture for non-facilitated payment orders.",
  3510. // "httpMethod": "POST",
  3511. // "id": "content.orderinvoices.createchargeinvoice",
  3512. // "parameterOrder": [
  3513. // "merchantId",
  3514. // "orderId"
  3515. // ],
  3516. // "parameters": {
  3517. // "merchantId": {
  3518. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  3519. // "format": "uint64",
  3520. // "location": "path",
  3521. // "required": true,
  3522. // "type": "string"
  3523. // },
  3524. // "orderId": {
  3525. // "description": "The ID of the order.",
  3526. // "location": "path",
  3527. // "required": true,
  3528. // "type": "string"
  3529. // }
  3530. // },
  3531. // "path": "{merchantId}/orderinvoices/{orderId}/createChargeInvoice",
  3532. // "request": {
  3533. // "$ref": "OrderinvoicesCreateChargeInvoiceRequest"
  3534. // },
  3535. // "response": {
  3536. // "$ref": "OrderinvoicesCreateChargeInvoiceResponse"
  3537. // },
  3538. // "scopes": [
  3539. // "https://www.googleapis.com/auth/content"
  3540. // ]
  3541. // }
  3542. }
  3543. // method id "content.orderinvoices.createrefundinvoice":
  3544. type OrderinvoicesCreaterefundinvoiceCall struct {
  3545. s *APIService
  3546. merchantId uint64
  3547. orderId string
  3548. orderinvoicescreaterefundinvoicerequest *OrderinvoicesCreateRefundInvoiceRequest
  3549. urlParams_ gensupport.URLParams
  3550. ctx_ context.Context
  3551. header_ http.Header
  3552. }
  3553. // Createrefundinvoice: Creates a refund invoice for one or more
  3554. // shipment groups, and triggers a refund for non-facilitated payment
  3555. // orders.
  3556. func (r *OrderinvoicesService) Createrefundinvoice(merchantId uint64, orderId string, orderinvoicescreaterefundinvoicerequest *OrderinvoicesCreateRefundInvoiceRequest) *OrderinvoicesCreaterefundinvoiceCall {
  3557. c := &OrderinvoicesCreaterefundinvoiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3558. c.merchantId = merchantId
  3559. c.orderId = orderId
  3560. c.orderinvoicescreaterefundinvoicerequest = orderinvoicescreaterefundinvoicerequest
  3561. return c
  3562. }
  3563. // Fields allows partial responses to be retrieved. See
  3564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3565. // for more information.
  3566. func (c *OrderinvoicesCreaterefundinvoiceCall) Fields(s ...googleapi.Field) *OrderinvoicesCreaterefundinvoiceCall {
  3567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3568. return c
  3569. }
  3570. // Context sets the context to be used in this call's Do method. Any
  3571. // pending HTTP request will be aborted if the provided context is
  3572. // canceled.
  3573. func (c *OrderinvoicesCreaterefundinvoiceCall) Context(ctx context.Context) *OrderinvoicesCreaterefundinvoiceCall {
  3574. c.ctx_ = ctx
  3575. return c
  3576. }
  3577. // Header returns an http.Header that can be modified by the caller to
  3578. // add HTTP headers to the request.
  3579. func (c *OrderinvoicesCreaterefundinvoiceCall) Header() http.Header {
  3580. if c.header_ == nil {
  3581. c.header_ = make(http.Header)
  3582. }
  3583. return c.header_
  3584. }
  3585. func (c *OrderinvoicesCreaterefundinvoiceCall) doRequest(alt string) (*http.Response, error) {
  3586. reqHeaders := make(http.Header)
  3587. for k, v := range c.header_ {
  3588. reqHeaders[k] = v
  3589. }
  3590. reqHeaders.Set("User-Agent", c.s.userAgent())
  3591. var body io.Reader = nil
  3592. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderinvoicescreaterefundinvoicerequest)
  3593. if err != nil {
  3594. return nil, err
  3595. }
  3596. reqHeaders.Set("Content-Type", "application/json")
  3597. c.urlParams_.Set("alt", alt)
  3598. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderinvoices/{orderId}/createRefundInvoice")
  3599. urls += "?" + c.urlParams_.Encode()
  3600. req, _ := http.NewRequest("POST", urls, body)
  3601. req.Header = reqHeaders
  3602. googleapi.Expand(req.URL, map[string]string{
  3603. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3604. "orderId": c.orderId,
  3605. })
  3606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3607. }
  3608. // Do executes the "content.orderinvoices.createrefundinvoice" call.
  3609. // Exactly one of *OrderinvoicesCreateRefundInvoiceResponse or error
  3610. // will be non-nil. Any non-2xx status code is an error. Response
  3611. // headers are in either
  3612. // *OrderinvoicesCreateRefundInvoiceResponse.ServerResponse.Header or
  3613. // (if a response was returned at all) in
  3614. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3615. // whether the returned error was because http.StatusNotModified was
  3616. // returned.
  3617. func (c *OrderinvoicesCreaterefundinvoiceCall) Do(opts ...googleapi.CallOption) (*OrderinvoicesCreateRefundInvoiceResponse, error) {
  3618. gensupport.SetOptions(c.urlParams_, opts...)
  3619. res, err := c.doRequest("json")
  3620. if res != nil && res.StatusCode == http.StatusNotModified {
  3621. if res.Body != nil {
  3622. res.Body.Close()
  3623. }
  3624. return nil, &googleapi.Error{
  3625. Code: res.StatusCode,
  3626. Header: res.Header,
  3627. }
  3628. }
  3629. if err != nil {
  3630. return nil, err
  3631. }
  3632. defer googleapi.CloseBody(res)
  3633. if err := googleapi.CheckResponse(res); err != nil {
  3634. return nil, err
  3635. }
  3636. ret := &OrderinvoicesCreateRefundInvoiceResponse{
  3637. ServerResponse: googleapi.ServerResponse{
  3638. Header: res.Header,
  3639. HTTPStatusCode: res.StatusCode,
  3640. },
  3641. }
  3642. target := &ret
  3643. if err := gensupport.DecodeResponse(target, res); err != nil {
  3644. return nil, err
  3645. }
  3646. return ret, nil
  3647. // {
  3648. // "description": "Creates a refund invoice for one or more shipment groups, and triggers a refund for non-facilitated payment orders.",
  3649. // "httpMethod": "POST",
  3650. // "id": "content.orderinvoices.createrefundinvoice",
  3651. // "parameterOrder": [
  3652. // "merchantId",
  3653. // "orderId"
  3654. // ],
  3655. // "parameters": {
  3656. // "merchantId": {
  3657. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  3658. // "format": "uint64",
  3659. // "location": "path",
  3660. // "required": true,
  3661. // "type": "string"
  3662. // },
  3663. // "orderId": {
  3664. // "description": "The ID of the order.",
  3665. // "location": "path",
  3666. // "required": true,
  3667. // "type": "string"
  3668. // }
  3669. // },
  3670. // "path": "{merchantId}/orderinvoices/{orderId}/createRefundInvoice",
  3671. // "request": {
  3672. // "$ref": "OrderinvoicesCreateRefundInvoiceRequest"
  3673. // },
  3674. // "response": {
  3675. // "$ref": "OrderinvoicesCreateRefundInvoiceResponse"
  3676. // },
  3677. // "scopes": [
  3678. // "https://www.googleapis.com/auth/content"
  3679. // ]
  3680. // }
  3681. }
  3682. // method id "content.orderpayments.notifyauthapproved":
  3683. type OrderpaymentsNotifyauthapprovedCall struct {
  3684. s *APIService
  3685. merchantId uint64
  3686. orderId string
  3687. orderpaymentsnotifyauthapprovedrequest *OrderpaymentsNotifyAuthApprovedRequest
  3688. urlParams_ gensupport.URLParams
  3689. ctx_ context.Context
  3690. header_ http.Header
  3691. }
  3692. // Notifyauthapproved: Notify about successfully authorizing user's
  3693. // payment method for a given amount.
  3694. func (r *OrderpaymentsService) Notifyauthapproved(merchantId uint64, orderId string, orderpaymentsnotifyauthapprovedrequest *OrderpaymentsNotifyAuthApprovedRequest) *OrderpaymentsNotifyauthapprovedCall {
  3695. c := &OrderpaymentsNotifyauthapprovedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3696. c.merchantId = merchantId
  3697. c.orderId = orderId
  3698. c.orderpaymentsnotifyauthapprovedrequest = orderpaymentsnotifyauthapprovedrequest
  3699. return c
  3700. }
  3701. // Fields allows partial responses to be retrieved. See
  3702. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3703. // for more information.
  3704. func (c *OrderpaymentsNotifyauthapprovedCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifyauthapprovedCall {
  3705. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3706. return c
  3707. }
  3708. // Context sets the context to be used in this call's Do method. Any
  3709. // pending HTTP request will be aborted if the provided context is
  3710. // canceled.
  3711. func (c *OrderpaymentsNotifyauthapprovedCall) Context(ctx context.Context) *OrderpaymentsNotifyauthapprovedCall {
  3712. c.ctx_ = ctx
  3713. return c
  3714. }
  3715. // Header returns an http.Header that can be modified by the caller to
  3716. // add HTTP headers to the request.
  3717. func (c *OrderpaymentsNotifyauthapprovedCall) Header() http.Header {
  3718. if c.header_ == nil {
  3719. c.header_ = make(http.Header)
  3720. }
  3721. return c.header_
  3722. }
  3723. func (c *OrderpaymentsNotifyauthapprovedCall) doRequest(alt string) (*http.Response, error) {
  3724. reqHeaders := make(http.Header)
  3725. for k, v := range c.header_ {
  3726. reqHeaders[k] = v
  3727. }
  3728. reqHeaders.Set("User-Agent", c.s.userAgent())
  3729. var body io.Reader = nil
  3730. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifyauthapprovedrequest)
  3731. if err != nil {
  3732. return nil, err
  3733. }
  3734. reqHeaders.Set("Content-Type", "application/json")
  3735. c.urlParams_.Set("alt", alt)
  3736. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyAuthApproved")
  3737. urls += "?" + c.urlParams_.Encode()
  3738. req, _ := http.NewRequest("POST", urls, body)
  3739. req.Header = reqHeaders
  3740. googleapi.Expand(req.URL, map[string]string{
  3741. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3742. "orderId": c.orderId,
  3743. })
  3744. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3745. }
  3746. // Do executes the "content.orderpayments.notifyauthapproved" call.
  3747. // Exactly one of *OrderpaymentsNotifyAuthApprovedResponse or error will
  3748. // be non-nil. Any non-2xx status code is an error. Response headers are
  3749. // in either
  3750. // *OrderpaymentsNotifyAuthApprovedResponse.ServerResponse.Header or (if
  3751. // a response was returned at all) in error.(*googleapi.Error).Header.
  3752. // Use googleapi.IsNotModified to check whether the returned error was
  3753. // because http.StatusNotModified was returned.
  3754. func (c *OrderpaymentsNotifyauthapprovedCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyAuthApprovedResponse, error) {
  3755. gensupport.SetOptions(c.urlParams_, opts...)
  3756. res, err := c.doRequest("json")
  3757. if res != nil && res.StatusCode == http.StatusNotModified {
  3758. if res.Body != nil {
  3759. res.Body.Close()
  3760. }
  3761. return nil, &googleapi.Error{
  3762. Code: res.StatusCode,
  3763. Header: res.Header,
  3764. }
  3765. }
  3766. if err != nil {
  3767. return nil, err
  3768. }
  3769. defer googleapi.CloseBody(res)
  3770. if err := googleapi.CheckResponse(res); err != nil {
  3771. return nil, err
  3772. }
  3773. ret := &OrderpaymentsNotifyAuthApprovedResponse{
  3774. ServerResponse: googleapi.ServerResponse{
  3775. Header: res.Header,
  3776. HTTPStatusCode: res.StatusCode,
  3777. },
  3778. }
  3779. target := &ret
  3780. if err := gensupport.DecodeResponse(target, res); err != nil {
  3781. return nil, err
  3782. }
  3783. return ret, nil
  3784. // {
  3785. // "description": "Notify about successfully authorizing user's payment method for a given amount.",
  3786. // "httpMethod": "POST",
  3787. // "id": "content.orderpayments.notifyauthapproved",
  3788. // "parameterOrder": [
  3789. // "merchantId",
  3790. // "orderId"
  3791. // ],
  3792. // "parameters": {
  3793. // "merchantId": {
  3794. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  3795. // "format": "uint64",
  3796. // "location": "path",
  3797. // "required": true,
  3798. // "type": "string"
  3799. // },
  3800. // "orderId": {
  3801. // "description": "The ID of the order for for which payment authorization is happening.",
  3802. // "location": "path",
  3803. // "required": true,
  3804. // "type": "string"
  3805. // }
  3806. // },
  3807. // "path": "{merchantId}/orderpayments/{orderId}/notifyAuthApproved",
  3808. // "request": {
  3809. // "$ref": "OrderpaymentsNotifyAuthApprovedRequest"
  3810. // },
  3811. // "response": {
  3812. // "$ref": "OrderpaymentsNotifyAuthApprovedResponse"
  3813. // },
  3814. // "scopes": [
  3815. // "https://www.googleapis.com/auth/content"
  3816. // ]
  3817. // }
  3818. }
  3819. // method id "content.orderpayments.notifyauthdeclined":
  3820. type OrderpaymentsNotifyauthdeclinedCall struct {
  3821. s *APIService
  3822. merchantId uint64
  3823. orderId string
  3824. orderpaymentsnotifyauthdeclinedrequest *OrderpaymentsNotifyAuthDeclinedRequest
  3825. urlParams_ gensupport.URLParams
  3826. ctx_ context.Context
  3827. header_ http.Header
  3828. }
  3829. // Notifyauthdeclined: Notify about failure to authorize user's payment
  3830. // method.
  3831. func (r *OrderpaymentsService) Notifyauthdeclined(merchantId uint64, orderId string, orderpaymentsnotifyauthdeclinedrequest *OrderpaymentsNotifyAuthDeclinedRequest) *OrderpaymentsNotifyauthdeclinedCall {
  3832. c := &OrderpaymentsNotifyauthdeclinedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3833. c.merchantId = merchantId
  3834. c.orderId = orderId
  3835. c.orderpaymentsnotifyauthdeclinedrequest = orderpaymentsnotifyauthdeclinedrequest
  3836. return c
  3837. }
  3838. // Fields allows partial responses to be retrieved. See
  3839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3840. // for more information.
  3841. func (c *OrderpaymentsNotifyauthdeclinedCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifyauthdeclinedCall {
  3842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3843. return c
  3844. }
  3845. // Context sets the context to be used in this call's Do method. Any
  3846. // pending HTTP request will be aborted if the provided context is
  3847. // canceled.
  3848. func (c *OrderpaymentsNotifyauthdeclinedCall) Context(ctx context.Context) *OrderpaymentsNotifyauthdeclinedCall {
  3849. c.ctx_ = ctx
  3850. return c
  3851. }
  3852. // Header returns an http.Header that can be modified by the caller to
  3853. // add HTTP headers to the request.
  3854. func (c *OrderpaymentsNotifyauthdeclinedCall) Header() http.Header {
  3855. if c.header_ == nil {
  3856. c.header_ = make(http.Header)
  3857. }
  3858. return c.header_
  3859. }
  3860. func (c *OrderpaymentsNotifyauthdeclinedCall) doRequest(alt string) (*http.Response, error) {
  3861. reqHeaders := make(http.Header)
  3862. for k, v := range c.header_ {
  3863. reqHeaders[k] = v
  3864. }
  3865. reqHeaders.Set("User-Agent", c.s.userAgent())
  3866. var body io.Reader = nil
  3867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifyauthdeclinedrequest)
  3868. if err != nil {
  3869. return nil, err
  3870. }
  3871. reqHeaders.Set("Content-Type", "application/json")
  3872. c.urlParams_.Set("alt", alt)
  3873. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyAuthDeclined")
  3874. urls += "?" + c.urlParams_.Encode()
  3875. req, _ := http.NewRequest("POST", urls, body)
  3876. req.Header = reqHeaders
  3877. googleapi.Expand(req.URL, map[string]string{
  3878. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3879. "orderId": c.orderId,
  3880. })
  3881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3882. }
  3883. // Do executes the "content.orderpayments.notifyauthdeclined" call.
  3884. // Exactly one of *OrderpaymentsNotifyAuthDeclinedResponse or error will
  3885. // be non-nil. Any non-2xx status code is an error. Response headers are
  3886. // in either
  3887. // *OrderpaymentsNotifyAuthDeclinedResponse.ServerResponse.Header or (if
  3888. // a response was returned at all) in error.(*googleapi.Error).Header.
  3889. // Use googleapi.IsNotModified to check whether the returned error was
  3890. // because http.StatusNotModified was returned.
  3891. func (c *OrderpaymentsNotifyauthdeclinedCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyAuthDeclinedResponse, error) {
  3892. gensupport.SetOptions(c.urlParams_, opts...)
  3893. res, err := c.doRequest("json")
  3894. if res != nil && res.StatusCode == http.StatusNotModified {
  3895. if res.Body != nil {
  3896. res.Body.Close()
  3897. }
  3898. return nil, &googleapi.Error{
  3899. Code: res.StatusCode,
  3900. Header: res.Header,
  3901. }
  3902. }
  3903. if err != nil {
  3904. return nil, err
  3905. }
  3906. defer googleapi.CloseBody(res)
  3907. if err := googleapi.CheckResponse(res); err != nil {
  3908. return nil, err
  3909. }
  3910. ret := &OrderpaymentsNotifyAuthDeclinedResponse{
  3911. ServerResponse: googleapi.ServerResponse{
  3912. Header: res.Header,
  3913. HTTPStatusCode: res.StatusCode,
  3914. },
  3915. }
  3916. target := &ret
  3917. if err := gensupport.DecodeResponse(target, res); err != nil {
  3918. return nil, err
  3919. }
  3920. return ret, nil
  3921. // {
  3922. // "description": "Notify about failure to authorize user's payment method.",
  3923. // "httpMethod": "POST",
  3924. // "id": "content.orderpayments.notifyauthdeclined",
  3925. // "parameterOrder": [
  3926. // "merchantId",
  3927. // "orderId"
  3928. // ],
  3929. // "parameters": {
  3930. // "merchantId": {
  3931. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  3932. // "format": "uint64",
  3933. // "location": "path",
  3934. // "required": true,
  3935. // "type": "string"
  3936. // },
  3937. // "orderId": {
  3938. // "description": "The ID of the order for which payment authorization was declined.",
  3939. // "location": "path",
  3940. // "required": true,
  3941. // "type": "string"
  3942. // }
  3943. // },
  3944. // "path": "{merchantId}/orderpayments/{orderId}/notifyAuthDeclined",
  3945. // "request": {
  3946. // "$ref": "OrderpaymentsNotifyAuthDeclinedRequest"
  3947. // },
  3948. // "response": {
  3949. // "$ref": "OrderpaymentsNotifyAuthDeclinedResponse"
  3950. // },
  3951. // "scopes": [
  3952. // "https://www.googleapis.com/auth/content"
  3953. // ]
  3954. // }
  3955. }
  3956. // method id "content.orderpayments.notifycharge":
  3957. type OrderpaymentsNotifychargeCall struct {
  3958. s *APIService
  3959. merchantId uint64
  3960. orderId string
  3961. orderpaymentsnotifychargerequest *OrderpaymentsNotifyChargeRequest
  3962. urlParams_ gensupport.URLParams
  3963. ctx_ context.Context
  3964. header_ http.Header
  3965. }
  3966. // Notifycharge: Notify about charge on user's selected payments method.
  3967. func (r *OrderpaymentsService) Notifycharge(merchantId uint64, orderId string, orderpaymentsnotifychargerequest *OrderpaymentsNotifyChargeRequest) *OrderpaymentsNotifychargeCall {
  3968. c := &OrderpaymentsNotifychargeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3969. c.merchantId = merchantId
  3970. c.orderId = orderId
  3971. c.orderpaymentsnotifychargerequest = orderpaymentsnotifychargerequest
  3972. return c
  3973. }
  3974. // Fields allows partial responses to be retrieved. See
  3975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3976. // for more information.
  3977. func (c *OrderpaymentsNotifychargeCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifychargeCall {
  3978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3979. return c
  3980. }
  3981. // Context sets the context to be used in this call's Do method. Any
  3982. // pending HTTP request will be aborted if the provided context is
  3983. // canceled.
  3984. func (c *OrderpaymentsNotifychargeCall) Context(ctx context.Context) *OrderpaymentsNotifychargeCall {
  3985. c.ctx_ = ctx
  3986. return c
  3987. }
  3988. // Header returns an http.Header that can be modified by the caller to
  3989. // add HTTP headers to the request.
  3990. func (c *OrderpaymentsNotifychargeCall) Header() http.Header {
  3991. if c.header_ == nil {
  3992. c.header_ = make(http.Header)
  3993. }
  3994. return c.header_
  3995. }
  3996. func (c *OrderpaymentsNotifychargeCall) doRequest(alt string) (*http.Response, error) {
  3997. reqHeaders := make(http.Header)
  3998. for k, v := range c.header_ {
  3999. reqHeaders[k] = v
  4000. }
  4001. reqHeaders.Set("User-Agent", c.s.userAgent())
  4002. var body io.Reader = nil
  4003. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifychargerequest)
  4004. if err != nil {
  4005. return nil, err
  4006. }
  4007. reqHeaders.Set("Content-Type", "application/json")
  4008. c.urlParams_.Set("alt", alt)
  4009. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyCharge")
  4010. urls += "?" + c.urlParams_.Encode()
  4011. req, _ := http.NewRequest("POST", urls, body)
  4012. req.Header = reqHeaders
  4013. googleapi.Expand(req.URL, map[string]string{
  4014. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4015. "orderId": c.orderId,
  4016. })
  4017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4018. }
  4019. // Do executes the "content.orderpayments.notifycharge" call.
  4020. // Exactly one of *OrderpaymentsNotifyChargeResponse or error will be
  4021. // non-nil. Any non-2xx status code is an error. Response headers are in
  4022. // either *OrderpaymentsNotifyChargeResponse.ServerResponse.Header or
  4023. // (if a response was returned at all) in
  4024. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4025. // whether the returned error was because http.StatusNotModified was
  4026. // returned.
  4027. func (c *OrderpaymentsNotifychargeCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyChargeResponse, error) {
  4028. gensupport.SetOptions(c.urlParams_, opts...)
  4029. res, err := c.doRequest("json")
  4030. if res != nil && res.StatusCode == http.StatusNotModified {
  4031. if res.Body != nil {
  4032. res.Body.Close()
  4033. }
  4034. return nil, &googleapi.Error{
  4035. Code: res.StatusCode,
  4036. Header: res.Header,
  4037. }
  4038. }
  4039. if err != nil {
  4040. return nil, err
  4041. }
  4042. defer googleapi.CloseBody(res)
  4043. if err := googleapi.CheckResponse(res); err != nil {
  4044. return nil, err
  4045. }
  4046. ret := &OrderpaymentsNotifyChargeResponse{
  4047. ServerResponse: googleapi.ServerResponse{
  4048. Header: res.Header,
  4049. HTTPStatusCode: res.StatusCode,
  4050. },
  4051. }
  4052. target := &ret
  4053. if err := gensupport.DecodeResponse(target, res); err != nil {
  4054. return nil, err
  4055. }
  4056. return ret, nil
  4057. // {
  4058. // "description": "Notify about charge on user's selected payments method.",
  4059. // "httpMethod": "POST",
  4060. // "id": "content.orderpayments.notifycharge",
  4061. // "parameterOrder": [
  4062. // "merchantId",
  4063. // "orderId"
  4064. // ],
  4065. // "parameters": {
  4066. // "merchantId": {
  4067. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  4068. // "format": "uint64",
  4069. // "location": "path",
  4070. // "required": true,
  4071. // "type": "string"
  4072. // },
  4073. // "orderId": {
  4074. // "description": "The ID of the order for which charge is happening.",
  4075. // "location": "path",
  4076. // "required": true,
  4077. // "type": "string"
  4078. // }
  4079. // },
  4080. // "path": "{merchantId}/orderpayments/{orderId}/notifyCharge",
  4081. // "request": {
  4082. // "$ref": "OrderpaymentsNotifyChargeRequest"
  4083. // },
  4084. // "response": {
  4085. // "$ref": "OrderpaymentsNotifyChargeResponse"
  4086. // },
  4087. // "scopes": [
  4088. // "https://www.googleapis.com/auth/content"
  4089. // ]
  4090. // }
  4091. }
  4092. // method id "content.orderpayments.notifyrefund":
  4093. type OrderpaymentsNotifyrefundCall struct {
  4094. s *APIService
  4095. merchantId uint64
  4096. orderId string
  4097. orderpaymentsnotifyrefundrequest *OrderpaymentsNotifyRefundRequest
  4098. urlParams_ gensupport.URLParams
  4099. ctx_ context.Context
  4100. header_ http.Header
  4101. }
  4102. // Notifyrefund: Notify about refund on user's selected payments method.
  4103. func (r *OrderpaymentsService) Notifyrefund(merchantId uint64, orderId string, orderpaymentsnotifyrefundrequest *OrderpaymentsNotifyRefundRequest) *OrderpaymentsNotifyrefundCall {
  4104. c := &OrderpaymentsNotifyrefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4105. c.merchantId = merchantId
  4106. c.orderId = orderId
  4107. c.orderpaymentsnotifyrefundrequest = orderpaymentsnotifyrefundrequest
  4108. return c
  4109. }
  4110. // Fields allows partial responses to be retrieved. See
  4111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4112. // for more information.
  4113. func (c *OrderpaymentsNotifyrefundCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifyrefundCall {
  4114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4115. return c
  4116. }
  4117. // Context sets the context to be used in this call's Do method. Any
  4118. // pending HTTP request will be aborted if the provided context is
  4119. // canceled.
  4120. func (c *OrderpaymentsNotifyrefundCall) Context(ctx context.Context) *OrderpaymentsNotifyrefundCall {
  4121. c.ctx_ = ctx
  4122. return c
  4123. }
  4124. // Header returns an http.Header that can be modified by the caller to
  4125. // add HTTP headers to the request.
  4126. func (c *OrderpaymentsNotifyrefundCall) Header() http.Header {
  4127. if c.header_ == nil {
  4128. c.header_ = make(http.Header)
  4129. }
  4130. return c.header_
  4131. }
  4132. func (c *OrderpaymentsNotifyrefundCall) doRequest(alt string) (*http.Response, error) {
  4133. reqHeaders := make(http.Header)
  4134. for k, v := range c.header_ {
  4135. reqHeaders[k] = v
  4136. }
  4137. reqHeaders.Set("User-Agent", c.s.userAgent())
  4138. var body io.Reader = nil
  4139. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifyrefundrequest)
  4140. if err != nil {
  4141. return nil, err
  4142. }
  4143. reqHeaders.Set("Content-Type", "application/json")
  4144. c.urlParams_.Set("alt", alt)
  4145. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyRefund")
  4146. urls += "?" + c.urlParams_.Encode()
  4147. req, _ := http.NewRequest("POST", urls, body)
  4148. req.Header = reqHeaders
  4149. googleapi.Expand(req.URL, map[string]string{
  4150. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4151. "orderId": c.orderId,
  4152. })
  4153. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4154. }
  4155. // Do executes the "content.orderpayments.notifyrefund" call.
  4156. // Exactly one of *OrderpaymentsNotifyRefundResponse or error will be
  4157. // non-nil. Any non-2xx status code is an error. Response headers are in
  4158. // either *OrderpaymentsNotifyRefundResponse.ServerResponse.Header or
  4159. // (if a response was returned at all) in
  4160. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4161. // whether the returned error was because http.StatusNotModified was
  4162. // returned.
  4163. func (c *OrderpaymentsNotifyrefundCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyRefundResponse, error) {
  4164. gensupport.SetOptions(c.urlParams_, opts...)
  4165. res, err := c.doRequest("json")
  4166. if res != nil && res.StatusCode == http.StatusNotModified {
  4167. if res.Body != nil {
  4168. res.Body.Close()
  4169. }
  4170. return nil, &googleapi.Error{
  4171. Code: res.StatusCode,
  4172. Header: res.Header,
  4173. }
  4174. }
  4175. if err != nil {
  4176. return nil, err
  4177. }
  4178. defer googleapi.CloseBody(res)
  4179. if err := googleapi.CheckResponse(res); err != nil {
  4180. return nil, err
  4181. }
  4182. ret := &OrderpaymentsNotifyRefundResponse{
  4183. ServerResponse: googleapi.ServerResponse{
  4184. Header: res.Header,
  4185. HTTPStatusCode: res.StatusCode,
  4186. },
  4187. }
  4188. target := &ret
  4189. if err := gensupport.DecodeResponse(target, res); err != nil {
  4190. return nil, err
  4191. }
  4192. return ret, nil
  4193. // {
  4194. // "description": "Notify about refund on user's selected payments method.",
  4195. // "httpMethod": "POST",
  4196. // "id": "content.orderpayments.notifyrefund",
  4197. // "parameterOrder": [
  4198. // "merchantId",
  4199. // "orderId"
  4200. // ],
  4201. // "parameters": {
  4202. // "merchantId": {
  4203. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  4204. // "format": "uint64",
  4205. // "location": "path",
  4206. // "required": true,
  4207. // "type": "string"
  4208. // },
  4209. // "orderId": {
  4210. // "description": "The ID of the order for which charge is happening.",
  4211. // "location": "path",
  4212. // "required": true,
  4213. // "type": "string"
  4214. // }
  4215. // },
  4216. // "path": "{merchantId}/orderpayments/{orderId}/notifyRefund",
  4217. // "request": {
  4218. // "$ref": "OrderpaymentsNotifyRefundRequest"
  4219. // },
  4220. // "response": {
  4221. // "$ref": "OrderpaymentsNotifyRefundResponse"
  4222. // },
  4223. // "scopes": [
  4224. // "https://www.googleapis.com/auth/content"
  4225. // ]
  4226. // }
  4227. }
  4228. // method id "content.orders.acknowledge":
  4229. type OrdersAcknowledgeCall struct {
  4230. s *APIService
  4231. merchantId uint64
  4232. orderId string
  4233. ordersacknowledgerequest *OrdersAcknowledgeRequest
  4234. urlParams_ gensupport.URLParams
  4235. ctx_ context.Context
  4236. header_ http.Header
  4237. }
  4238. // Acknowledge: Marks an order as acknowledged.
  4239. func (r *OrdersService) Acknowledge(merchantId uint64, orderId string, ordersacknowledgerequest *OrdersAcknowledgeRequest) *OrdersAcknowledgeCall {
  4240. c := &OrdersAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4241. c.merchantId = merchantId
  4242. c.orderId = orderId
  4243. c.ordersacknowledgerequest = ordersacknowledgerequest
  4244. return c
  4245. }
  4246. // Fields allows partial responses to be retrieved. See
  4247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4248. // for more information.
  4249. func (c *OrdersAcknowledgeCall) Fields(s ...googleapi.Field) *OrdersAcknowledgeCall {
  4250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4251. return c
  4252. }
  4253. // Context sets the context to be used in this call's Do method. Any
  4254. // pending HTTP request will be aborted if the provided context is
  4255. // canceled.
  4256. func (c *OrdersAcknowledgeCall) Context(ctx context.Context) *OrdersAcknowledgeCall {
  4257. c.ctx_ = ctx
  4258. return c
  4259. }
  4260. // Header returns an http.Header that can be modified by the caller to
  4261. // add HTTP headers to the request.
  4262. func (c *OrdersAcknowledgeCall) Header() http.Header {
  4263. if c.header_ == nil {
  4264. c.header_ = make(http.Header)
  4265. }
  4266. return c.header_
  4267. }
  4268. func (c *OrdersAcknowledgeCall) doRequest(alt string) (*http.Response, error) {
  4269. reqHeaders := make(http.Header)
  4270. for k, v := range c.header_ {
  4271. reqHeaders[k] = v
  4272. }
  4273. reqHeaders.Set("User-Agent", c.s.userAgent())
  4274. var body io.Reader = nil
  4275. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersacknowledgerequest)
  4276. if err != nil {
  4277. return nil, err
  4278. }
  4279. reqHeaders.Set("Content-Type", "application/json")
  4280. c.urlParams_.Set("alt", alt)
  4281. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/acknowledge")
  4282. urls += "?" + c.urlParams_.Encode()
  4283. req, _ := http.NewRequest("POST", urls, body)
  4284. req.Header = reqHeaders
  4285. googleapi.Expand(req.URL, map[string]string{
  4286. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4287. "orderId": c.orderId,
  4288. })
  4289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4290. }
  4291. // Do executes the "content.orders.acknowledge" call.
  4292. // Exactly one of *OrdersAcknowledgeResponse or error will be non-nil.
  4293. // Any non-2xx status code is an error. Response headers are in either
  4294. // *OrdersAcknowledgeResponse.ServerResponse.Header or (if a response
  4295. // was returned at all) in error.(*googleapi.Error).Header. Use
  4296. // googleapi.IsNotModified to check whether the returned error was
  4297. // because http.StatusNotModified was returned.
  4298. func (c *OrdersAcknowledgeCall) Do(opts ...googleapi.CallOption) (*OrdersAcknowledgeResponse, error) {
  4299. gensupport.SetOptions(c.urlParams_, opts...)
  4300. res, err := c.doRequest("json")
  4301. if res != nil && res.StatusCode == http.StatusNotModified {
  4302. if res.Body != nil {
  4303. res.Body.Close()
  4304. }
  4305. return nil, &googleapi.Error{
  4306. Code: res.StatusCode,
  4307. Header: res.Header,
  4308. }
  4309. }
  4310. if err != nil {
  4311. return nil, err
  4312. }
  4313. defer googleapi.CloseBody(res)
  4314. if err := googleapi.CheckResponse(res); err != nil {
  4315. return nil, err
  4316. }
  4317. ret := &OrdersAcknowledgeResponse{
  4318. ServerResponse: googleapi.ServerResponse{
  4319. Header: res.Header,
  4320. HTTPStatusCode: res.StatusCode,
  4321. },
  4322. }
  4323. target := &ret
  4324. if err := gensupport.DecodeResponse(target, res); err != nil {
  4325. return nil, err
  4326. }
  4327. return ret, nil
  4328. // {
  4329. // "description": "Marks an order as acknowledged.",
  4330. // "httpMethod": "POST",
  4331. // "id": "content.orders.acknowledge",
  4332. // "parameterOrder": [
  4333. // "merchantId",
  4334. // "orderId"
  4335. // ],
  4336. // "parameters": {
  4337. // "merchantId": {
  4338. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  4339. // "format": "uint64",
  4340. // "location": "path",
  4341. // "required": true,
  4342. // "type": "string"
  4343. // },
  4344. // "orderId": {
  4345. // "description": "The ID of the order.",
  4346. // "location": "path",
  4347. // "required": true,
  4348. // "type": "string"
  4349. // }
  4350. // },
  4351. // "path": "{merchantId}/orders/{orderId}/acknowledge",
  4352. // "request": {
  4353. // "$ref": "OrdersAcknowledgeRequest"
  4354. // },
  4355. // "response": {
  4356. // "$ref": "OrdersAcknowledgeResponse"
  4357. // },
  4358. // "scopes": [
  4359. // "https://www.googleapis.com/auth/content"
  4360. // ]
  4361. // }
  4362. }
  4363. // method id "content.orders.advancetestorder":
  4364. type OrdersAdvancetestorderCall struct {
  4365. s *APIService
  4366. merchantId uint64
  4367. orderId string
  4368. urlParams_ gensupport.URLParams
  4369. ctx_ context.Context
  4370. header_ http.Header
  4371. }
  4372. // Advancetestorder: Sandbox only. Moves a test order from state
  4373. // "inProgress" to state "pendingShipment".
  4374. func (r *OrdersService) Advancetestorder(merchantId uint64, orderId string) *OrdersAdvancetestorderCall {
  4375. c := &OrdersAdvancetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4376. c.merchantId = merchantId
  4377. c.orderId = orderId
  4378. return c
  4379. }
  4380. // Fields allows partial responses to be retrieved. See
  4381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4382. // for more information.
  4383. func (c *OrdersAdvancetestorderCall) Fields(s ...googleapi.Field) *OrdersAdvancetestorderCall {
  4384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4385. return c
  4386. }
  4387. // Context sets the context to be used in this call's Do method. Any
  4388. // pending HTTP request will be aborted if the provided context is
  4389. // canceled.
  4390. func (c *OrdersAdvancetestorderCall) Context(ctx context.Context) *OrdersAdvancetestorderCall {
  4391. c.ctx_ = ctx
  4392. return c
  4393. }
  4394. // Header returns an http.Header that can be modified by the caller to
  4395. // add HTTP headers to the request.
  4396. func (c *OrdersAdvancetestorderCall) Header() http.Header {
  4397. if c.header_ == nil {
  4398. c.header_ = make(http.Header)
  4399. }
  4400. return c.header_
  4401. }
  4402. func (c *OrdersAdvancetestorderCall) doRequest(alt string) (*http.Response, error) {
  4403. reqHeaders := make(http.Header)
  4404. for k, v := range c.header_ {
  4405. reqHeaders[k] = v
  4406. }
  4407. reqHeaders.Set("User-Agent", c.s.userAgent())
  4408. var body io.Reader = nil
  4409. c.urlParams_.Set("alt", alt)
  4410. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders/{orderId}/advance")
  4411. urls += "?" + c.urlParams_.Encode()
  4412. req, _ := http.NewRequest("POST", urls, body)
  4413. req.Header = reqHeaders
  4414. googleapi.Expand(req.URL, map[string]string{
  4415. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4416. "orderId": c.orderId,
  4417. })
  4418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4419. }
  4420. // Do executes the "content.orders.advancetestorder" call.
  4421. // Exactly one of *OrdersAdvanceTestOrderResponse or error will be
  4422. // non-nil. Any non-2xx status code is an error. Response headers are in
  4423. // either *OrdersAdvanceTestOrderResponse.ServerResponse.Header or (if a
  4424. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4425. // googleapi.IsNotModified to check whether the returned error was
  4426. // because http.StatusNotModified was returned.
  4427. func (c *OrdersAdvancetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersAdvanceTestOrderResponse, error) {
  4428. gensupport.SetOptions(c.urlParams_, opts...)
  4429. res, err := c.doRequest("json")
  4430. if res != nil && res.StatusCode == http.StatusNotModified {
  4431. if res.Body != nil {
  4432. res.Body.Close()
  4433. }
  4434. return nil, &googleapi.Error{
  4435. Code: res.StatusCode,
  4436. Header: res.Header,
  4437. }
  4438. }
  4439. if err != nil {
  4440. return nil, err
  4441. }
  4442. defer googleapi.CloseBody(res)
  4443. if err := googleapi.CheckResponse(res); err != nil {
  4444. return nil, err
  4445. }
  4446. ret := &OrdersAdvanceTestOrderResponse{
  4447. ServerResponse: googleapi.ServerResponse{
  4448. Header: res.Header,
  4449. HTTPStatusCode: res.StatusCode,
  4450. },
  4451. }
  4452. target := &ret
  4453. if err := gensupport.DecodeResponse(target, res); err != nil {
  4454. return nil, err
  4455. }
  4456. return ret, nil
  4457. // {
  4458. // "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".",
  4459. // "httpMethod": "POST",
  4460. // "id": "content.orders.advancetestorder",
  4461. // "parameterOrder": [
  4462. // "merchantId",
  4463. // "orderId"
  4464. // ],
  4465. // "parameters": {
  4466. // "merchantId": {
  4467. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  4468. // "format": "uint64",
  4469. // "location": "path",
  4470. // "required": true,
  4471. // "type": "string"
  4472. // },
  4473. // "orderId": {
  4474. // "description": "The ID of the test order to modify.",
  4475. // "location": "path",
  4476. // "required": true,
  4477. // "type": "string"
  4478. // }
  4479. // },
  4480. // "path": "{merchantId}/testorders/{orderId}/advance",
  4481. // "response": {
  4482. // "$ref": "OrdersAdvanceTestOrderResponse"
  4483. // },
  4484. // "scopes": [
  4485. // "https://www.googleapis.com/auth/content"
  4486. // ]
  4487. // }
  4488. }
  4489. // method id "content.orders.cancel":
  4490. type OrdersCancelCall struct {
  4491. s *APIService
  4492. merchantId uint64
  4493. orderId string
  4494. orderscancelrequest *OrdersCancelRequest
  4495. urlParams_ gensupport.URLParams
  4496. ctx_ context.Context
  4497. header_ http.Header
  4498. }
  4499. // Cancel: Cancels all line items in an order, making a full refund.
  4500. func (r *OrdersService) Cancel(merchantId uint64, orderId string, orderscancelrequest *OrdersCancelRequest) *OrdersCancelCall {
  4501. c := &OrdersCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4502. c.merchantId = merchantId
  4503. c.orderId = orderId
  4504. c.orderscancelrequest = orderscancelrequest
  4505. return c
  4506. }
  4507. // Fields allows partial responses to be retrieved. See
  4508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4509. // for more information.
  4510. func (c *OrdersCancelCall) Fields(s ...googleapi.Field) *OrdersCancelCall {
  4511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4512. return c
  4513. }
  4514. // Context sets the context to be used in this call's Do method. Any
  4515. // pending HTTP request will be aborted if the provided context is
  4516. // canceled.
  4517. func (c *OrdersCancelCall) Context(ctx context.Context) *OrdersCancelCall {
  4518. c.ctx_ = ctx
  4519. return c
  4520. }
  4521. // Header returns an http.Header that can be modified by the caller to
  4522. // add HTTP headers to the request.
  4523. func (c *OrdersCancelCall) Header() http.Header {
  4524. if c.header_ == nil {
  4525. c.header_ = make(http.Header)
  4526. }
  4527. return c.header_
  4528. }
  4529. func (c *OrdersCancelCall) doRequest(alt string) (*http.Response, error) {
  4530. reqHeaders := make(http.Header)
  4531. for k, v := range c.header_ {
  4532. reqHeaders[k] = v
  4533. }
  4534. reqHeaders.Set("User-Agent", c.s.userAgent())
  4535. var body io.Reader = nil
  4536. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancelrequest)
  4537. if err != nil {
  4538. return nil, err
  4539. }
  4540. reqHeaders.Set("Content-Type", "application/json")
  4541. c.urlParams_.Set("alt", alt)
  4542. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancel")
  4543. urls += "?" + c.urlParams_.Encode()
  4544. req, _ := http.NewRequest("POST", urls, body)
  4545. req.Header = reqHeaders
  4546. googleapi.Expand(req.URL, map[string]string{
  4547. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4548. "orderId": c.orderId,
  4549. })
  4550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4551. }
  4552. // Do executes the "content.orders.cancel" call.
  4553. // Exactly one of *OrdersCancelResponse or error will be non-nil. Any
  4554. // non-2xx status code is an error. Response headers are in either
  4555. // *OrdersCancelResponse.ServerResponse.Header or (if a response was
  4556. // returned at all) in error.(*googleapi.Error).Header. Use
  4557. // googleapi.IsNotModified to check whether the returned error was
  4558. // because http.StatusNotModified was returned.
  4559. func (c *OrdersCancelCall) Do(opts ...googleapi.CallOption) (*OrdersCancelResponse, error) {
  4560. gensupport.SetOptions(c.urlParams_, opts...)
  4561. res, err := c.doRequest("json")
  4562. if res != nil && res.StatusCode == http.StatusNotModified {
  4563. if res.Body != nil {
  4564. res.Body.Close()
  4565. }
  4566. return nil, &googleapi.Error{
  4567. Code: res.StatusCode,
  4568. Header: res.Header,
  4569. }
  4570. }
  4571. if err != nil {
  4572. return nil, err
  4573. }
  4574. defer googleapi.CloseBody(res)
  4575. if err := googleapi.CheckResponse(res); err != nil {
  4576. return nil, err
  4577. }
  4578. ret := &OrdersCancelResponse{
  4579. ServerResponse: googleapi.ServerResponse{
  4580. Header: res.Header,
  4581. HTTPStatusCode: res.StatusCode,
  4582. },
  4583. }
  4584. target := &ret
  4585. if err := gensupport.DecodeResponse(target, res); err != nil {
  4586. return nil, err
  4587. }
  4588. return ret, nil
  4589. // {
  4590. // "description": "Cancels all line items in an order, making a full refund.",
  4591. // "httpMethod": "POST",
  4592. // "id": "content.orders.cancel",
  4593. // "parameterOrder": [
  4594. // "merchantId",
  4595. // "orderId"
  4596. // ],
  4597. // "parameters": {
  4598. // "merchantId": {
  4599. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  4600. // "format": "uint64",
  4601. // "location": "path",
  4602. // "required": true,
  4603. // "type": "string"
  4604. // },
  4605. // "orderId": {
  4606. // "description": "The ID of the order to cancel.",
  4607. // "location": "path",
  4608. // "required": true,
  4609. // "type": "string"
  4610. // }
  4611. // },
  4612. // "path": "{merchantId}/orders/{orderId}/cancel",
  4613. // "request": {
  4614. // "$ref": "OrdersCancelRequest"
  4615. // },
  4616. // "response": {
  4617. // "$ref": "OrdersCancelResponse"
  4618. // },
  4619. // "scopes": [
  4620. // "https://www.googleapis.com/auth/content"
  4621. // ]
  4622. // }
  4623. }
  4624. // method id "content.orders.cancellineitem":
  4625. type OrdersCancellineitemCall struct {
  4626. s *APIService
  4627. merchantId uint64
  4628. orderId string
  4629. orderscancellineitemrequest *OrdersCancelLineItemRequest
  4630. urlParams_ gensupport.URLParams
  4631. ctx_ context.Context
  4632. header_ http.Header
  4633. }
  4634. // Cancellineitem: Cancels a line item, making a full refund.
  4635. func (r *OrdersService) Cancellineitem(merchantId uint64, orderId string, orderscancellineitemrequest *OrdersCancelLineItemRequest) *OrdersCancellineitemCall {
  4636. c := &OrdersCancellineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4637. c.merchantId = merchantId
  4638. c.orderId = orderId
  4639. c.orderscancellineitemrequest = orderscancellineitemrequest
  4640. return c
  4641. }
  4642. // Fields allows partial responses to be retrieved. See
  4643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4644. // for more information.
  4645. func (c *OrdersCancellineitemCall) Fields(s ...googleapi.Field) *OrdersCancellineitemCall {
  4646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4647. return c
  4648. }
  4649. // Context sets the context to be used in this call's Do method. Any
  4650. // pending HTTP request will be aborted if the provided context is
  4651. // canceled.
  4652. func (c *OrdersCancellineitemCall) Context(ctx context.Context) *OrdersCancellineitemCall {
  4653. c.ctx_ = ctx
  4654. return c
  4655. }
  4656. // Header returns an http.Header that can be modified by the caller to
  4657. // add HTTP headers to the request.
  4658. func (c *OrdersCancellineitemCall) Header() http.Header {
  4659. if c.header_ == nil {
  4660. c.header_ = make(http.Header)
  4661. }
  4662. return c.header_
  4663. }
  4664. func (c *OrdersCancellineitemCall) doRequest(alt string) (*http.Response, error) {
  4665. reqHeaders := make(http.Header)
  4666. for k, v := range c.header_ {
  4667. reqHeaders[k] = v
  4668. }
  4669. reqHeaders.Set("User-Agent", c.s.userAgent())
  4670. var body io.Reader = nil
  4671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancellineitemrequest)
  4672. if err != nil {
  4673. return nil, err
  4674. }
  4675. reqHeaders.Set("Content-Type", "application/json")
  4676. c.urlParams_.Set("alt", alt)
  4677. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancelLineItem")
  4678. urls += "?" + c.urlParams_.Encode()
  4679. req, _ := http.NewRequest("POST", urls, body)
  4680. req.Header = reqHeaders
  4681. googleapi.Expand(req.URL, map[string]string{
  4682. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4683. "orderId": c.orderId,
  4684. })
  4685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4686. }
  4687. // Do executes the "content.orders.cancellineitem" call.
  4688. // Exactly one of *OrdersCancelLineItemResponse or error will be
  4689. // non-nil. Any non-2xx status code is an error. Response headers are in
  4690. // either *OrdersCancelLineItemResponse.ServerResponse.Header or (if a
  4691. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4692. // googleapi.IsNotModified to check whether the returned error was
  4693. // because http.StatusNotModified was returned.
  4694. func (c *OrdersCancellineitemCall) Do(opts ...googleapi.CallOption) (*OrdersCancelLineItemResponse, error) {
  4695. gensupport.SetOptions(c.urlParams_, opts...)
  4696. res, err := c.doRequest("json")
  4697. if res != nil && res.StatusCode == http.StatusNotModified {
  4698. if res.Body != nil {
  4699. res.Body.Close()
  4700. }
  4701. return nil, &googleapi.Error{
  4702. Code: res.StatusCode,
  4703. Header: res.Header,
  4704. }
  4705. }
  4706. if err != nil {
  4707. return nil, err
  4708. }
  4709. defer googleapi.CloseBody(res)
  4710. if err := googleapi.CheckResponse(res); err != nil {
  4711. return nil, err
  4712. }
  4713. ret := &OrdersCancelLineItemResponse{
  4714. ServerResponse: googleapi.ServerResponse{
  4715. Header: res.Header,
  4716. HTTPStatusCode: res.StatusCode,
  4717. },
  4718. }
  4719. target := &ret
  4720. if err := gensupport.DecodeResponse(target, res); err != nil {
  4721. return nil, err
  4722. }
  4723. return ret, nil
  4724. // {
  4725. // "description": "Cancels a line item, making a full refund.",
  4726. // "httpMethod": "POST",
  4727. // "id": "content.orders.cancellineitem",
  4728. // "parameterOrder": [
  4729. // "merchantId",
  4730. // "orderId"
  4731. // ],
  4732. // "parameters": {
  4733. // "merchantId": {
  4734. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  4735. // "format": "uint64",
  4736. // "location": "path",
  4737. // "required": true,
  4738. // "type": "string"
  4739. // },
  4740. // "orderId": {
  4741. // "description": "The ID of the order.",
  4742. // "location": "path",
  4743. // "required": true,
  4744. // "type": "string"
  4745. // }
  4746. // },
  4747. // "path": "{merchantId}/orders/{orderId}/cancelLineItem",
  4748. // "request": {
  4749. // "$ref": "OrdersCancelLineItemRequest"
  4750. // },
  4751. // "response": {
  4752. // "$ref": "OrdersCancelLineItemResponse"
  4753. // },
  4754. // "scopes": [
  4755. // "https://www.googleapis.com/auth/content"
  4756. // ]
  4757. // }
  4758. }
  4759. // method id "content.orders.createtestorder":
  4760. type OrdersCreatetestorderCall struct {
  4761. s *APIService
  4762. merchantId uint64
  4763. orderscreatetestorderrequest *OrdersCreateTestOrderRequest
  4764. urlParams_ gensupport.URLParams
  4765. ctx_ context.Context
  4766. header_ http.Header
  4767. }
  4768. // Createtestorder: Sandbox only. Creates a test order.
  4769. func (r *OrdersService) Createtestorder(merchantId uint64, orderscreatetestorderrequest *OrdersCreateTestOrderRequest) *OrdersCreatetestorderCall {
  4770. c := &OrdersCreatetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4771. c.merchantId = merchantId
  4772. c.orderscreatetestorderrequest = orderscreatetestorderrequest
  4773. return c
  4774. }
  4775. // Fields allows partial responses to be retrieved. See
  4776. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4777. // for more information.
  4778. func (c *OrdersCreatetestorderCall) Fields(s ...googleapi.Field) *OrdersCreatetestorderCall {
  4779. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4780. return c
  4781. }
  4782. // Context sets the context to be used in this call's Do method. Any
  4783. // pending HTTP request will be aborted if the provided context is
  4784. // canceled.
  4785. func (c *OrdersCreatetestorderCall) Context(ctx context.Context) *OrdersCreatetestorderCall {
  4786. c.ctx_ = ctx
  4787. return c
  4788. }
  4789. // Header returns an http.Header that can be modified by the caller to
  4790. // add HTTP headers to the request.
  4791. func (c *OrdersCreatetestorderCall) Header() http.Header {
  4792. if c.header_ == nil {
  4793. c.header_ = make(http.Header)
  4794. }
  4795. return c.header_
  4796. }
  4797. func (c *OrdersCreatetestorderCall) doRequest(alt string) (*http.Response, error) {
  4798. reqHeaders := make(http.Header)
  4799. for k, v := range c.header_ {
  4800. reqHeaders[k] = v
  4801. }
  4802. reqHeaders.Set("User-Agent", c.s.userAgent())
  4803. var body io.Reader = nil
  4804. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscreatetestorderrequest)
  4805. if err != nil {
  4806. return nil, err
  4807. }
  4808. reqHeaders.Set("Content-Type", "application/json")
  4809. c.urlParams_.Set("alt", alt)
  4810. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders")
  4811. urls += "?" + c.urlParams_.Encode()
  4812. req, _ := http.NewRequest("POST", urls, body)
  4813. req.Header = reqHeaders
  4814. googleapi.Expand(req.URL, map[string]string{
  4815. "merchantId": strconv.FormatUint(c.merchantId, 10),
  4816. })
  4817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4818. }
  4819. // Do executes the "content.orders.createtestorder" call.
  4820. // Exactly one of *OrdersCreateTestOrderResponse or error will be
  4821. // non-nil. Any non-2xx status code is an error. Response headers are in
  4822. // either *OrdersCreateTestOrderResponse.ServerResponse.Header or (if a
  4823. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4824. // googleapi.IsNotModified to check whether the returned error was
  4825. // because http.StatusNotModified was returned.
  4826. func (c *OrdersCreatetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersCreateTestOrderResponse, error) {
  4827. gensupport.SetOptions(c.urlParams_, opts...)
  4828. res, err := c.doRequest("json")
  4829. if res != nil && res.StatusCode == http.StatusNotModified {
  4830. if res.Body != nil {
  4831. res.Body.Close()
  4832. }
  4833. return nil, &googleapi.Error{
  4834. Code: res.StatusCode,
  4835. Header: res.Header,
  4836. }
  4837. }
  4838. if err != nil {
  4839. return nil, err
  4840. }
  4841. defer googleapi.CloseBody(res)
  4842. if err := googleapi.CheckResponse(res); err != nil {
  4843. return nil, err
  4844. }
  4845. ret := &OrdersCreateTestOrderResponse{
  4846. ServerResponse: googleapi.ServerResponse{
  4847. Header: res.Header,
  4848. HTTPStatusCode: res.StatusCode,
  4849. },
  4850. }
  4851. target := &ret
  4852. if err := gensupport.DecodeResponse(target, res); err != nil {
  4853. return nil, err
  4854. }
  4855. return ret, nil
  4856. // {
  4857. // "description": "Sandbox only. Creates a test order.",
  4858. // "httpMethod": "POST",
  4859. // "id": "content.orders.createtestorder",
  4860. // "parameterOrder": [
  4861. // "merchantId"
  4862. // ],
  4863. // "parameters": {
  4864. // "merchantId": {
  4865. // "description": "The ID of the account that should manage the order. This cannot be a multi-client account.",
  4866. // "format": "uint64",
  4867. // "location": "path",
  4868. // "required": true,
  4869. // "type": "string"
  4870. // }
  4871. // },
  4872. // "path": "{merchantId}/testorders",
  4873. // "request": {
  4874. // "$ref": "OrdersCreateTestOrderRequest"
  4875. // },
  4876. // "response": {
  4877. // "$ref": "OrdersCreateTestOrderResponse"
  4878. // },
  4879. // "scopes": [
  4880. // "https://www.googleapis.com/auth/content"
  4881. // ]
  4882. // }
  4883. }
  4884. // method id "content.orders.custombatch":
  4885. type OrdersCustombatchCall struct {
  4886. s *APIService
  4887. orderscustombatchrequest *OrdersCustomBatchRequest
  4888. urlParams_ gensupport.URLParams
  4889. ctx_ context.Context
  4890. header_ http.Header
  4891. }
  4892. // Custombatch: Retrieves or modifies multiple orders in a single
  4893. // request.
  4894. func (r *OrdersService) Custombatch(orderscustombatchrequest *OrdersCustomBatchRequest) *OrdersCustombatchCall {
  4895. c := &OrdersCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4896. c.orderscustombatchrequest = orderscustombatchrequest
  4897. return c
  4898. }
  4899. // Fields allows partial responses to be retrieved. See
  4900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4901. // for more information.
  4902. func (c *OrdersCustombatchCall) Fields(s ...googleapi.Field) *OrdersCustombatchCall {
  4903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4904. return c
  4905. }
  4906. // Context sets the context to be used in this call's Do method. Any
  4907. // pending HTTP request will be aborted if the provided context is
  4908. // canceled.
  4909. func (c *OrdersCustombatchCall) Context(ctx context.Context) *OrdersCustombatchCall {
  4910. c.ctx_ = ctx
  4911. return c
  4912. }
  4913. // Header returns an http.Header that can be modified by the caller to
  4914. // add HTTP headers to the request.
  4915. func (c *OrdersCustombatchCall) Header() http.Header {
  4916. if c.header_ == nil {
  4917. c.header_ = make(http.Header)
  4918. }
  4919. return c.header_
  4920. }
  4921. func (c *OrdersCustombatchCall) doRequest(alt string) (*http.Response, error) {
  4922. reqHeaders := make(http.Header)
  4923. for k, v := range c.header_ {
  4924. reqHeaders[k] = v
  4925. }
  4926. reqHeaders.Set("User-Agent", c.s.userAgent())
  4927. var body io.Reader = nil
  4928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscustombatchrequest)
  4929. if err != nil {
  4930. return nil, err
  4931. }
  4932. reqHeaders.Set("Content-Type", "application/json")
  4933. c.urlParams_.Set("alt", alt)
  4934. urls := googleapi.ResolveRelative(c.s.BasePath, "orders/batch")
  4935. urls += "?" + c.urlParams_.Encode()
  4936. req, _ := http.NewRequest("POST", urls, body)
  4937. req.Header = reqHeaders
  4938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4939. }
  4940. // Do executes the "content.orders.custombatch" call.
  4941. // Exactly one of *OrdersCustomBatchResponse or error will be non-nil.
  4942. // Any non-2xx status code is an error. Response headers are in either
  4943. // *OrdersCustomBatchResponse.ServerResponse.Header or (if a response
  4944. // was returned at all) in error.(*googleapi.Error).Header. Use
  4945. // googleapi.IsNotModified to check whether the returned error was
  4946. // because http.StatusNotModified was returned.
  4947. func (c *OrdersCustombatchCall) Do(opts ...googleapi.CallOption) (*OrdersCustomBatchResponse, error) {
  4948. gensupport.SetOptions(c.urlParams_, opts...)
  4949. res, err := c.doRequest("json")
  4950. if res != nil && res.StatusCode == http.StatusNotModified {
  4951. if res.Body != nil {
  4952. res.Body.Close()
  4953. }
  4954. return nil, &googleapi.Error{
  4955. Code: res.StatusCode,
  4956. Header: res.Header,
  4957. }
  4958. }
  4959. if err != nil {
  4960. return nil, err
  4961. }
  4962. defer googleapi.CloseBody(res)
  4963. if err := googleapi.CheckResponse(res); err != nil {
  4964. return nil, err
  4965. }
  4966. ret := &OrdersCustomBatchResponse{
  4967. ServerResponse: googleapi.ServerResponse{
  4968. Header: res.Header,
  4969. HTTPStatusCode: res.StatusCode,
  4970. },
  4971. }
  4972. target := &ret
  4973. if err := gensupport.DecodeResponse(target, res); err != nil {
  4974. return nil, err
  4975. }
  4976. return ret, nil
  4977. // {
  4978. // "description": "Retrieves or modifies multiple orders in a single request.",
  4979. // "httpMethod": "POST",
  4980. // "id": "content.orders.custombatch",
  4981. // "path": "orders/batch",
  4982. // "request": {
  4983. // "$ref": "OrdersCustomBatchRequest"
  4984. // },
  4985. // "response": {
  4986. // "$ref": "OrdersCustomBatchResponse"
  4987. // },
  4988. // "scopes": [
  4989. // "https://www.googleapis.com/auth/content"
  4990. // ]
  4991. // }
  4992. }
  4993. // method id "content.orders.get":
  4994. type OrdersGetCall struct {
  4995. s *APIService
  4996. merchantId uint64
  4997. orderId string
  4998. urlParams_ gensupport.URLParams
  4999. ifNoneMatch_ string
  5000. ctx_ context.Context
  5001. header_ http.Header
  5002. }
  5003. // Get: Retrieves an order from your Merchant Center account.
  5004. func (r *OrdersService) Get(merchantId uint64, orderId string) *OrdersGetCall {
  5005. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5006. c.merchantId = merchantId
  5007. c.orderId = orderId
  5008. return c
  5009. }
  5010. // Fields allows partial responses to be retrieved. See
  5011. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5012. // for more information.
  5013. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  5014. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5015. return c
  5016. }
  5017. // IfNoneMatch sets the optional parameter which makes the operation
  5018. // fail if the object's ETag matches the given value. This is useful for
  5019. // getting updates only after the object has changed since the last
  5020. // request. Use googleapi.IsNotModified to check whether the response
  5021. // error from Do is the result of In-None-Match.
  5022. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  5023. c.ifNoneMatch_ = entityTag
  5024. return c
  5025. }
  5026. // Context sets the context to be used in this call's Do method. Any
  5027. // pending HTTP request will be aborted if the provided context is
  5028. // canceled.
  5029. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  5030. c.ctx_ = ctx
  5031. return c
  5032. }
  5033. // Header returns an http.Header that can be modified by the caller to
  5034. // add HTTP headers to the request.
  5035. func (c *OrdersGetCall) Header() http.Header {
  5036. if c.header_ == nil {
  5037. c.header_ = make(http.Header)
  5038. }
  5039. return c.header_
  5040. }
  5041. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  5042. reqHeaders := make(http.Header)
  5043. for k, v := range c.header_ {
  5044. reqHeaders[k] = v
  5045. }
  5046. reqHeaders.Set("User-Agent", c.s.userAgent())
  5047. if c.ifNoneMatch_ != "" {
  5048. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5049. }
  5050. var body io.Reader = nil
  5051. c.urlParams_.Set("alt", alt)
  5052. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}")
  5053. urls += "?" + c.urlParams_.Encode()
  5054. req, _ := http.NewRequest("GET", urls, body)
  5055. req.Header = reqHeaders
  5056. googleapi.Expand(req.URL, map[string]string{
  5057. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5058. "orderId": c.orderId,
  5059. })
  5060. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5061. }
  5062. // Do executes the "content.orders.get" call.
  5063. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  5064. // code is an error. Response headers are in either
  5065. // *Order.ServerResponse.Header or (if a response was returned at all)
  5066. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5067. // check whether the returned error was because http.StatusNotModified
  5068. // was returned.
  5069. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  5070. gensupport.SetOptions(c.urlParams_, opts...)
  5071. res, err := c.doRequest("json")
  5072. if res != nil && res.StatusCode == http.StatusNotModified {
  5073. if res.Body != nil {
  5074. res.Body.Close()
  5075. }
  5076. return nil, &googleapi.Error{
  5077. Code: res.StatusCode,
  5078. Header: res.Header,
  5079. }
  5080. }
  5081. if err != nil {
  5082. return nil, err
  5083. }
  5084. defer googleapi.CloseBody(res)
  5085. if err := googleapi.CheckResponse(res); err != nil {
  5086. return nil, err
  5087. }
  5088. ret := &Order{
  5089. ServerResponse: googleapi.ServerResponse{
  5090. Header: res.Header,
  5091. HTTPStatusCode: res.StatusCode,
  5092. },
  5093. }
  5094. target := &ret
  5095. if err := gensupport.DecodeResponse(target, res); err != nil {
  5096. return nil, err
  5097. }
  5098. return ret, nil
  5099. // {
  5100. // "description": "Retrieves an order from your Merchant Center account.",
  5101. // "httpMethod": "GET",
  5102. // "id": "content.orders.get",
  5103. // "parameterOrder": [
  5104. // "merchantId",
  5105. // "orderId"
  5106. // ],
  5107. // "parameters": {
  5108. // "merchantId": {
  5109. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  5110. // "format": "uint64",
  5111. // "location": "path",
  5112. // "required": true,
  5113. // "type": "string"
  5114. // },
  5115. // "orderId": {
  5116. // "description": "The ID of the order.",
  5117. // "location": "path",
  5118. // "required": true,
  5119. // "type": "string"
  5120. // }
  5121. // },
  5122. // "path": "{merchantId}/orders/{orderId}",
  5123. // "response": {
  5124. // "$ref": "Order"
  5125. // },
  5126. // "scopes": [
  5127. // "https://www.googleapis.com/auth/content"
  5128. // ]
  5129. // }
  5130. }
  5131. // method id "content.orders.getbymerchantorderid":
  5132. type OrdersGetbymerchantorderidCall struct {
  5133. s *APIService
  5134. merchantId uint64
  5135. merchantOrderId string
  5136. urlParams_ gensupport.URLParams
  5137. ifNoneMatch_ string
  5138. ctx_ context.Context
  5139. header_ http.Header
  5140. }
  5141. // Getbymerchantorderid: Retrieves an order using merchant order id.
  5142. func (r *OrdersService) Getbymerchantorderid(merchantId uint64, merchantOrderId string) *OrdersGetbymerchantorderidCall {
  5143. c := &OrdersGetbymerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5144. c.merchantId = merchantId
  5145. c.merchantOrderId = merchantOrderId
  5146. return c
  5147. }
  5148. // Fields allows partial responses to be retrieved. See
  5149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5150. // for more information.
  5151. func (c *OrdersGetbymerchantorderidCall) Fields(s ...googleapi.Field) *OrdersGetbymerchantorderidCall {
  5152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5153. return c
  5154. }
  5155. // IfNoneMatch sets the optional parameter which makes the operation
  5156. // fail if the object's ETag matches the given value. This is useful for
  5157. // getting updates only after the object has changed since the last
  5158. // request. Use googleapi.IsNotModified to check whether the response
  5159. // error from Do is the result of In-None-Match.
  5160. func (c *OrdersGetbymerchantorderidCall) IfNoneMatch(entityTag string) *OrdersGetbymerchantorderidCall {
  5161. c.ifNoneMatch_ = entityTag
  5162. return c
  5163. }
  5164. // Context sets the context to be used in this call's Do method. Any
  5165. // pending HTTP request will be aborted if the provided context is
  5166. // canceled.
  5167. func (c *OrdersGetbymerchantorderidCall) Context(ctx context.Context) *OrdersGetbymerchantorderidCall {
  5168. c.ctx_ = ctx
  5169. return c
  5170. }
  5171. // Header returns an http.Header that can be modified by the caller to
  5172. // add HTTP headers to the request.
  5173. func (c *OrdersGetbymerchantorderidCall) Header() http.Header {
  5174. if c.header_ == nil {
  5175. c.header_ = make(http.Header)
  5176. }
  5177. return c.header_
  5178. }
  5179. func (c *OrdersGetbymerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  5180. reqHeaders := make(http.Header)
  5181. for k, v := range c.header_ {
  5182. reqHeaders[k] = v
  5183. }
  5184. reqHeaders.Set("User-Agent", c.s.userAgent())
  5185. if c.ifNoneMatch_ != "" {
  5186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5187. }
  5188. var body io.Reader = nil
  5189. c.urlParams_.Set("alt", alt)
  5190. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/ordersbymerchantid/{merchantOrderId}")
  5191. urls += "?" + c.urlParams_.Encode()
  5192. req, _ := http.NewRequest("GET", urls, body)
  5193. req.Header = reqHeaders
  5194. googleapi.Expand(req.URL, map[string]string{
  5195. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5196. "merchantOrderId": c.merchantOrderId,
  5197. })
  5198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5199. }
  5200. // Do executes the "content.orders.getbymerchantorderid" call.
  5201. // Exactly one of *OrdersGetByMerchantOrderIdResponse or error will be
  5202. // non-nil. Any non-2xx status code is an error. Response headers are in
  5203. // either *OrdersGetByMerchantOrderIdResponse.ServerResponse.Header or
  5204. // (if a response was returned at all) in
  5205. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5206. // whether the returned error was because http.StatusNotModified was
  5207. // returned.
  5208. func (c *OrdersGetbymerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersGetByMerchantOrderIdResponse, error) {
  5209. gensupport.SetOptions(c.urlParams_, opts...)
  5210. res, err := c.doRequest("json")
  5211. if res != nil && res.StatusCode == http.StatusNotModified {
  5212. if res.Body != nil {
  5213. res.Body.Close()
  5214. }
  5215. return nil, &googleapi.Error{
  5216. Code: res.StatusCode,
  5217. Header: res.Header,
  5218. }
  5219. }
  5220. if err != nil {
  5221. return nil, err
  5222. }
  5223. defer googleapi.CloseBody(res)
  5224. if err := googleapi.CheckResponse(res); err != nil {
  5225. return nil, err
  5226. }
  5227. ret := &OrdersGetByMerchantOrderIdResponse{
  5228. ServerResponse: googleapi.ServerResponse{
  5229. Header: res.Header,
  5230. HTTPStatusCode: res.StatusCode,
  5231. },
  5232. }
  5233. target := &ret
  5234. if err := gensupport.DecodeResponse(target, res); err != nil {
  5235. return nil, err
  5236. }
  5237. return ret, nil
  5238. // {
  5239. // "description": "Retrieves an order using merchant order id.",
  5240. // "httpMethod": "GET",
  5241. // "id": "content.orders.getbymerchantorderid",
  5242. // "parameterOrder": [
  5243. // "merchantId",
  5244. // "merchantOrderId"
  5245. // ],
  5246. // "parameters": {
  5247. // "merchantId": {
  5248. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  5249. // "format": "uint64",
  5250. // "location": "path",
  5251. // "required": true,
  5252. // "type": "string"
  5253. // },
  5254. // "merchantOrderId": {
  5255. // "description": "The merchant order id to be looked for.",
  5256. // "location": "path",
  5257. // "required": true,
  5258. // "type": "string"
  5259. // }
  5260. // },
  5261. // "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}",
  5262. // "response": {
  5263. // "$ref": "OrdersGetByMerchantOrderIdResponse"
  5264. // },
  5265. // "scopes": [
  5266. // "https://www.googleapis.com/auth/content"
  5267. // ]
  5268. // }
  5269. }
  5270. // method id "content.orders.gettestordertemplate":
  5271. type OrdersGettestordertemplateCall struct {
  5272. s *APIService
  5273. merchantId uint64
  5274. templateName string
  5275. urlParams_ gensupport.URLParams
  5276. ifNoneMatch_ string
  5277. ctx_ context.Context
  5278. header_ http.Header
  5279. }
  5280. // Gettestordertemplate: Sandbox only. Retrieves an order template that
  5281. // can be used to quickly create a new order in sandbox.
  5282. func (r *OrdersService) Gettestordertemplate(merchantId uint64, templateName string) *OrdersGettestordertemplateCall {
  5283. c := &OrdersGettestordertemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5284. c.merchantId = merchantId
  5285. c.templateName = templateName
  5286. return c
  5287. }
  5288. // Fields allows partial responses to be retrieved. See
  5289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5290. // for more information.
  5291. func (c *OrdersGettestordertemplateCall) Fields(s ...googleapi.Field) *OrdersGettestordertemplateCall {
  5292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5293. return c
  5294. }
  5295. // IfNoneMatch sets the optional parameter which makes the operation
  5296. // fail if the object's ETag matches the given value. This is useful for
  5297. // getting updates only after the object has changed since the last
  5298. // request. Use googleapi.IsNotModified to check whether the response
  5299. // error from Do is the result of In-None-Match.
  5300. func (c *OrdersGettestordertemplateCall) IfNoneMatch(entityTag string) *OrdersGettestordertemplateCall {
  5301. c.ifNoneMatch_ = entityTag
  5302. return c
  5303. }
  5304. // Context sets the context to be used in this call's Do method. Any
  5305. // pending HTTP request will be aborted if the provided context is
  5306. // canceled.
  5307. func (c *OrdersGettestordertemplateCall) Context(ctx context.Context) *OrdersGettestordertemplateCall {
  5308. c.ctx_ = ctx
  5309. return c
  5310. }
  5311. // Header returns an http.Header that can be modified by the caller to
  5312. // add HTTP headers to the request.
  5313. func (c *OrdersGettestordertemplateCall) Header() http.Header {
  5314. if c.header_ == nil {
  5315. c.header_ = make(http.Header)
  5316. }
  5317. return c.header_
  5318. }
  5319. func (c *OrdersGettestordertemplateCall) doRequest(alt string) (*http.Response, error) {
  5320. reqHeaders := make(http.Header)
  5321. for k, v := range c.header_ {
  5322. reqHeaders[k] = v
  5323. }
  5324. reqHeaders.Set("User-Agent", c.s.userAgent())
  5325. if c.ifNoneMatch_ != "" {
  5326. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5327. }
  5328. var body io.Reader = nil
  5329. c.urlParams_.Set("alt", alt)
  5330. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testordertemplates/{templateName}")
  5331. urls += "?" + c.urlParams_.Encode()
  5332. req, _ := http.NewRequest("GET", urls, body)
  5333. req.Header = reqHeaders
  5334. googleapi.Expand(req.URL, map[string]string{
  5335. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5336. "templateName": c.templateName,
  5337. })
  5338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5339. }
  5340. // Do executes the "content.orders.gettestordertemplate" call.
  5341. // Exactly one of *OrdersGetTestOrderTemplateResponse or error will be
  5342. // non-nil. Any non-2xx status code is an error. Response headers are in
  5343. // either *OrdersGetTestOrderTemplateResponse.ServerResponse.Header or
  5344. // (if a response was returned at all) in
  5345. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5346. // whether the returned error was because http.StatusNotModified was
  5347. // returned.
  5348. func (c *OrdersGettestordertemplateCall) Do(opts ...googleapi.CallOption) (*OrdersGetTestOrderTemplateResponse, error) {
  5349. gensupport.SetOptions(c.urlParams_, opts...)
  5350. res, err := c.doRequest("json")
  5351. if res != nil && res.StatusCode == http.StatusNotModified {
  5352. if res.Body != nil {
  5353. res.Body.Close()
  5354. }
  5355. return nil, &googleapi.Error{
  5356. Code: res.StatusCode,
  5357. Header: res.Header,
  5358. }
  5359. }
  5360. if err != nil {
  5361. return nil, err
  5362. }
  5363. defer googleapi.CloseBody(res)
  5364. if err := googleapi.CheckResponse(res); err != nil {
  5365. return nil, err
  5366. }
  5367. ret := &OrdersGetTestOrderTemplateResponse{
  5368. ServerResponse: googleapi.ServerResponse{
  5369. Header: res.Header,
  5370. HTTPStatusCode: res.StatusCode,
  5371. },
  5372. }
  5373. target := &ret
  5374. if err := gensupport.DecodeResponse(target, res); err != nil {
  5375. return nil, err
  5376. }
  5377. return ret, nil
  5378. // {
  5379. // "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.",
  5380. // "httpMethod": "GET",
  5381. // "id": "content.orders.gettestordertemplate",
  5382. // "parameterOrder": [
  5383. // "merchantId",
  5384. // "templateName"
  5385. // ],
  5386. // "parameters": {
  5387. // "merchantId": {
  5388. // "description": "The ID of the account that should manage the order. This cannot be a multi-client account.",
  5389. // "format": "uint64",
  5390. // "location": "path",
  5391. // "required": true,
  5392. // "type": "string"
  5393. // },
  5394. // "templateName": {
  5395. // "description": "The name of the template to retrieve.",
  5396. // "enum": [
  5397. // "template1",
  5398. // "template1a",
  5399. // "template1b",
  5400. // "template2"
  5401. // ],
  5402. // "enumDescriptions": [
  5403. // "",
  5404. // "",
  5405. // "",
  5406. // ""
  5407. // ],
  5408. // "location": "path",
  5409. // "required": true,
  5410. // "type": "string"
  5411. // }
  5412. // },
  5413. // "path": "{merchantId}/testordertemplates/{templateName}",
  5414. // "response": {
  5415. // "$ref": "OrdersGetTestOrderTemplateResponse"
  5416. // },
  5417. // "scopes": [
  5418. // "https://www.googleapis.com/auth/content"
  5419. // ]
  5420. // }
  5421. }
  5422. // method id "content.orders.instorerefundlineitem":
  5423. type OrdersInstorerefundlineitemCall struct {
  5424. s *APIService
  5425. merchantId uint64
  5426. orderId string
  5427. ordersinstorerefundlineitemrequest *OrdersInStoreRefundLineItemRequest
  5428. urlParams_ gensupport.URLParams
  5429. ctx_ context.Context
  5430. header_ http.Header
  5431. }
  5432. // Instorerefundlineitem: Notifies that item return and refund was
  5433. // handled directly in store.
  5434. func (r *OrdersService) Instorerefundlineitem(merchantId uint64, orderId string, ordersinstorerefundlineitemrequest *OrdersInStoreRefundLineItemRequest) *OrdersInstorerefundlineitemCall {
  5435. c := &OrdersInstorerefundlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5436. c.merchantId = merchantId
  5437. c.orderId = orderId
  5438. c.ordersinstorerefundlineitemrequest = ordersinstorerefundlineitemrequest
  5439. return c
  5440. }
  5441. // Fields allows partial responses to be retrieved. See
  5442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5443. // for more information.
  5444. func (c *OrdersInstorerefundlineitemCall) Fields(s ...googleapi.Field) *OrdersInstorerefundlineitemCall {
  5445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5446. return c
  5447. }
  5448. // Context sets the context to be used in this call's Do method. Any
  5449. // pending HTTP request will be aborted if the provided context is
  5450. // canceled.
  5451. func (c *OrdersInstorerefundlineitemCall) Context(ctx context.Context) *OrdersInstorerefundlineitemCall {
  5452. c.ctx_ = ctx
  5453. return c
  5454. }
  5455. // Header returns an http.Header that can be modified by the caller to
  5456. // add HTTP headers to the request.
  5457. func (c *OrdersInstorerefundlineitemCall) Header() http.Header {
  5458. if c.header_ == nil {
  5459. c.header_ = make(http.Header)
  5460. }
  5461. return c.header_
  5462. }
  5463. func (c *OrdersInstorerefundlineitemCall) doRequest(alt string) (*http.Response, error) {
  5464. reqHeaders := make(http.Header)
  5465. for k, v := range c.header_ {
  5466. reqHeaders[k] = v
  5467. }
  5468. reqHeaders.Set("User-Agent", c.s.userAgent())
  5469. var body io.Reader = nil
  5470. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersinstorerefundlineitemrequest)
  5471. if err != nil {
  5472. return nil, err
  5473. }
  5474. reqHeaders.Set("Content-Type", "application/json")
  5475. c.urlParams_.Set("alt", alt)
  5476. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/inStoreRefundLineItem")
  5477. urls += "?" + c.urlParams_.Encode()
  5478. req, _ := http.NewRequest("POST", urls, body)
  5479. req.Header = reqHeaders
  5480. googleapi.Expand(req.URL, map[string]string{
  5481. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5482. "orderId": c.orderId,
  5483. })
  5484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5485. }
  5486. // Do executes the "content.orders.instorerefundlineitem" call.
  5487. // Exactly one of *OrdersInStoreRefundLineItemResponse or error will be
  5488. // non-nil. Any non-2xx status code is an error. Response headers are in
  5489. // either *OrdersInStoreRefundLineItemResponse.ServerResponse.Header or
  5490. // (if a response was returned at all) in
  5491. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5492. // whether the returned error was because http.StatusNotModified was
  5493. // returned.
  5494. func (c *OrdersInstorerefundlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersInStoreRefundLineItemResponse, error) {
  5495. gensupport.SetOptions(c.urlParams_, opts...)
  5496. res, err := c.doRequest("json")
  5497. if res != nil && res.StatusCode == http.StatusNotModified {
  5498. if res.Body != nil {
  5499. res.Body.Close()
  5500. }
  5501. return nil, &googleapi.Error{
  5502. Code: res.StatusCode,
  5503. Header: res.Header,
  5504. }
  5505. }
  5506. if err != nil {
  5507. return nil, err
  5508. }
  5509. defer googleapi.CloseBody(res)
  5510. if err := googleapi.CheckResponse(res); err != nil {
  5511. return nil, err
  5512. }
  5513. ret := &OrdersInStoreRefundLineItemResponse{
  5514. ServerResponse: googleapi.ServerResponse{
  5515. Header: res.Header,
  5516. HTTPStatusCode: res.StatusCode,
  5517. },
  5518. }
  5519. target := &ret
  5520. if err := gensupport.DecodeResponse(target, res); err != nil {
  5521. return nil, err
  5522. }
  5523. return ret, nil
  5524. // {
  5525. // "description": "Notifies that item return and refund was handled directly in store.",
  5526. // "httpMethod": "POST",
  5527. // "id": "content.orders.instorerefundlineitem",
  5528. // "parameterOrder": [
  5529. // "merchantId",
  5530. // "orderId"
  5531. // ],
  5532. // "parameters": {
  5533. // "merchantId": {
  5534. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  5535. // "format": "uint64",
  5536. // "location": "path",
  5537. // "required": true,
  5538. // "type": "string"
  5539. // },
  5540. // "orderId": {
  5541. // "description": "The ID of the order.",
  5542. // "location": "path",
  5543. // "required": true,
  5544. // "type": "string"
  5545. // }
  5546. // },
  5547. // "path": "{merchantId}/orders/{orderId}/inStoreRefundLineItem",
  5548. // "request": {
  5549. // "$ref": "OrdersInStoreRefundLineItemRequest"
  5550. // },
  5551. // "response": {
  5552. // "$ref": "OrdersInStoreRefundLineItemResponse"
  5553. // },
  5554. // "scopes": [
  5555. // "https://www.googleapis.com/auth/content"
  5556. // ]
  5557. // }
  5558. }
  5559. // method id "content.orders.list":
  5560. type OrdersListCall struct {
  5561. s *APIService
  5562. merchantId uint64
  5563. urlParams_ gensupport.URLParams
  5564. ifNoneMatch_ string
  5565. ctx_ context.Context
  5566. header_ http.Header
  5567. }
  5568. // List: Lists the orders in your Merchant Center account.
  5569. func (r *OrdersService) List(merchantId uint64) *OrdersListCall {
  5570. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5571. c.merchantId = merchantId
  5572. return c
  5573. }
  5574. // Acknowledged sets the optional parameter "acknowledged": Obtains
  5575. // orders that match the acknowledgement status. When set to true,
  5576. // obtains orders that have been acknowledged. When false, obtains
  5577. // orders that have not been acknowledged.
  5578. // We recommend using this filter set to false, in conjunction with the
  5579. // acknowledge call, such that only un-acknowledged orders are returned.
  5580. func (c *OrdersListCall) Acknowledged(acknowledged bool) *OrdersListCall {
  5581. c.urlParams_.Set("acknowledged", fmt.Sprint(acknowledged))
  5582. return c
  5583. }
  5584. // MaxResults sets the optional parameter "maxResults": The maximum
  5585. // number of orders to return in the response, used for paging. The
  5586. // default value is 25 orders per page, and the maximum allowed value is
  5587. // 250 orders per page.
  5588. // Known issue: All List calls will return all Orders without limit
  5589. // regardless of the value of this field.
  5590. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  5591. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5592. return c
  5593. }
  5594. // OrderBy sets the optional parameter "orderBy": The ordering of the
  5595. // returned list. The only supported value are placedDate desc and
  5596. // placedDate asc for now, which returns orders sorted by placement
  5597. // date. "placedDate desc" stands for listing orders by placement date,
  5598. // from oldest to most recent. "placedDate asc" stands for listing
  5599. // orders by placement date, from most recent to oldest. In future
  5600. // releases we'll support other sorting criteria.
  5601. //
  5602. // Possible values:
  5603. // "placedDate asc"
  5604. // "placedDate desc"
  5605. func (c *OrdersListCall) OrderBy(orderBy string) *OrdersListCall {
  5606. c.urlParams_.Set("orderBy", orderBy)
  5607. return c
  5608. }
  5609. // PageToken sets the optional parameter "pageToken": The token returned
  5610. // by the previous request.
  5611. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  5612. c.urlParams_.Set("pageToken", pageToken)
  5613. return c
  5614. }
  5615. // PlacedDateEnd sets the optional parameter "placedDateEnd": Obtains
  5616. // orders placed before this date (exclusively), in ISO 8601 format.
  5617. func (c *OrdersListCall) PlacedDateEnd(placedDateEnd string) *OrdersListCall {
  5618. c.urlParams_.Set("placedDateEnd", placedDateEnd)
  5619. return c
  5620. }
  5621. // PlacedDateStart sets the optional parameter "placedDateStart":
  5622. // Obtains orders placed after this date (inclusively), in ISO 8601
  5623. // format.
  5624. func (c *OrdersListCall) PlacedDateStart(placedDateStart string) *OrdersListCall {
  5625. c.urlParams_.Set("placedDateStart", placedDateStart)
  5626. return c
  5627. }
  5628. // Statuses sets the optional parameter "statuses": Obtains orders that
  5629. // match any of the specified statuses. Multiple values can be specified
  5630. // with comma separation. Additionally, please note that active is a
  5631. // shortcut for pendingShipment and partiallyShipped, and completed is a
  5632. // shortcut for shipped , partiallyDelivered, delivered,
  5633. // partiallyReturned, returned, and canceled.
  5634. //
  5635. // Possible values:
  5636. // "active"
  5637. // "canceled"
  5638. // "completed"
  5639. // "delivered"
  5640. // "inProgress"
  5641. // "partiallyDelivered"
  5642. // "partiallyReturned"
  5643. // "partiallyShipped"
  5644. // "pendingShipment"
  5645. // "returned"
  5646. // "shipped"
  5647. func (c *OrdersListCall) Statuses(statuses ...string) *OrdersListCall {
  5648. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  5649. return c
  5650. }
  5651. // Fields allows partial responses to be retrieved. See
  5652. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5653. // for more information.
  5654. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  5655. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5656. return c
  5657. }
  5658. // IfNoneMatch sets the optional parameter which makes the operation
  5659. // fail if the object's ETag matches the given value. This is useful for
  5660. // getting updates only after the object has changed since the last
  5661. // request. Use googleapi.IsNotModified to check whether the response
  5662. // error from Do is the result of In-None-Match.
  5663. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  5664. c.ifNoneMatch_ = entityTag
  5665. return c
  5666. }
  5667. // Context sets the context to be used in this call's Do method. Any
  5668. // pending HTTP request will be aborted if the provided context is
  5669. // canceled.
  5670. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  5671. c.ctx_ = ctx
  5672. return c
  5673. }
  5674. // Header returns an http.Header that can be modified by the caller to
  5675. // add HTTP headers to the request.
  5676. func (c *OrdersListCall) Header() http.Header {
  5677. if c.header_ == nil {
  5678. c.header_ = make(http.Header)
  5679. }
  5680. return c.header_
  5681. }
  5682. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  5683. reqHeaders := make(http.Header)
  5684. for k, v := range c.header_ {
  5685. reqHeaders[k] = v
  5686. }
  5687. reqHeaders.Set("User-Agent", c.s.userAgent())
  5688. if c.ifNoneMatch_ != "" {
  5689. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5690. }
  5691. var body io.Reader = nil
  5692. c.urlParams_.Set("alt", alt)
  5693. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders")
  5694. urls += "?" + c.urlParams_.Encode()
  5695. req, _ := http.NewRequest("GET", urls, body)
  5696. req.Header = reqHeaders
  5697. googleapi.Expand(req.URL, map[string]string{
  5698. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5699. })
  5700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5701. }
  5702. // Do executes the "content.orders.list" call.
  5703. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  5704. // non-2xx status code is an error. Response headers are in either
  5705. // *OrdersListResponse.ServerResponse.Header or (if a response was
  5706. // returned at all) in error.(*googleapi.Error).Header. Use
  5707. // googleapi.IsNotModified to check whether the returned error was
  5708. // because http.StatusNotModified was returned.
  5709. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  5710. gensupport.SetOptions(c.urlParams_, opts...)
  5711. res, err := c.doRequest("json")
  5712. if res != nil && res.StatusCode == http.StatusNotModified {
  5713. if res.Body != nil {
  5714. res.Body.Close()
  5715. }
  5716. return nil, &googleapi.Error{
  5717. Code: res.StatusCode,
  5718. Header: res.Header,
  5719. }
  5720. }
  5721. if err != nil {
  5722. return nil, err
  5723. }
  5724. defer googleapi.CloseBody(res)
  5725. if err := googleapi.CheckResponse(res); err != nil {
  5726. return nil, err
  5727. }
  5728. ret := &OrdersListResponse{
  5729. ServerResponse: googleapi.ServerResponse{
  5730. Header: res.Header,
  5731. HTTPStatusCode: res.StatusCode,
  5732. },
  5733. }
  5734. target := &ret
  5735. if err := gensupport.DecodeResponse(target, res); err != nil {
  5736. return nil, err
  5737. }
  5738. return ret, nil
  5739. // {
  5740. // "description": "Lists the orders in your Merchant Center account.",
  5741. // "httpMethod": "GET",
  5742. // "id": "content.orders.list",
  5743. // "parameterOrder": [
  5744. // "merchantId"
  5745. // ],
  5746. // "parameters": {
  5747. // "acknowledged": {
  5748. // "description": "Obtains orders that match the acknowledgement status. When set to true, obtains orders that have been acknowledged. When false, obtains orders that have not been acknowledged.\nWe recommend using this filter set to false, in conjunction with the acknowledge call, such that only un-acknowledged orders are returned.",
  5749. // "location": "query",
  5750. // "type": "boolean"
  5751. // },
  5752. // "maxResults": {
  5753. // "description": "The maximum number of orders to return in the response, used for paging. The default value is 25 orders per page, and the maximum allowed value is 250 orders per page.\nKnown issue: All List calls will return all Orders without limit regardless of the value of this field.",
  5754. // "format": "uint32",
  5755. // "location": "query",
  5756. // "type": "integer"
  5757. // },
  5758. // "merchantId": {
  5759. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  5760. // "format": "uint64",
  5761. // "location": "path",
  5762. // "required": true,
  5763. // "type": "string"
  5764. // },
  5765. // "orderBy": {
  5766. // "description": "The ordering of the returned list. The only supported value are placedDate desc and placedDate asc for now, which returns orders sorted by placement date. \"placedDate desc\" stands for listing orders by placement date, from oldest to most recent. \"placedDate asc\" stands for listing orders by placement date, from most recent to oldest. In future releases we'll support other sorting criteria.",
  5767. // "enum": [
  5768. // "placedDate asc",
  5769. // "placedDate desc"
  5770. // ],
  5771. // "enumDescriptions": [
  5772. // "",
  5773. // ""
  5774. // ],
  5775. // "location": "query",
  5776. // "type": "string"
  5777. // },
  5778. // "pageToken": {
  5779. // "description": "The token returned by the previous request.",
  5780. // "location": "query",
  5781. // "type": "string"
  5782. // },
  5783. // "placedDateEnd": {
  5784. // "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.",
  5785. // "location": "query",
  5786. // "type": "string"
  5787. // },
  5788. // "placedDateStart": {
  5789. // "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.",
  5790. // "location": "query",
  5791. // "type": "string"
  5792. // },
  5793. // "statuses": {
  5794. // "description": "Obtains orders that match any of the specified statuses. Multiple values can be specified with comma separation. Additionally, please note that active is a shortcut for pendingShipment and partiallyShipped, and completed is a shortcut for shipped , partiallyDelivered, delivered, partiallyReturned, returned, and canceled.",
  5795. // "enum": [
  5796. // "active",
  5797. // "canceled",
  5798. // "completed",
  5799. // "delivered",
  5800. // "inProgress",
  5801. // "partiallyDelivered",
  5802. // "partiallyReturned",
  5803. // "partiallyShipped",
  5804. // "pendingShipment",
  5805. // "returned",
  5806. // "shipped"
  5807. // ],
  5808. // "enumDescriptions": [
  5809. // "",
  5810. // "",
  5811. // "",
  5812. // "",
  5813. // "",
  5814. // "",
  5815. // "",
  5816. // "",
  5817. // "",
  5818. // "",
  5819. // ""
  5820. // ],
  5821. // "location": "query",
  5822. // "repeated": true,
  5823. // "type": "string"
  5824. // }
  5825. // },
  5826. // "path": "{merchantId}/orders",
  5827. // "response": {
  5828. // "$ref": "OrdersListResponse"
  5829. // },
  5830. // "scopes": [
  5831. // "https://www.googleapis.com/auth/content"
  5832. // ]
  5833. // }
  5834. }
  5835. // Pages invokes f for each page of results.
  5836. // A non-nil error returned from f will halt the iteration.
  5837. // The provided context supersedes any context provided to the Context method.
  5838. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  5839. c.ctx_ = ctx
  5840. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5841. for {
  5842. x, err := c.Do()
  5843. if err != nil {
  5844. return err
  5845. }
  5846. if err := f(x); err != nil {
  5847. return err
  5848. }
  5849. if x.NextPageToken == "" {
  5850. return nil
  5851. }
  5852. c.PageToken(x.NextPageToken)
  5853. }
  5854. }
  5855. // method id "content.orders.refund":
  5856. type OrdersRefundCall struct {
  5857. s *APIService
  5858. merchantId uint64
  5859. orderId string
  5860. ordersrefundrequest *OrdersRefundRequest
  5861. urlParams_ gensupport.URLParams
  5862. ctx_ context.Context
  5863. header_ http.Header
  5864. }
  5865. // Refund: Refund a portion of the order, up to the full amount paid.
  5866. func (r *OrdersService) Refund(merchantId uint64, orderId string, ordersrefundrequest *OrdersRefundRequest) *OrdersRefundCall {
  5867. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5868. c.merchantId = merchantId
  5869. c.orderId = orderId
  5870. c.ordersrefundrequest = ordersrefundrequest
  5871. return c
  5872. }
  5873. // Fields allows partial responses to be retrieved. See
  5874. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5875. // for more information.
  5876. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  5877. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5878. return c
  5879. }
  5880. // Context sets the context to be used in this call's Do method. Any
  5881. // pending HTTP request will be aborted if the provided context is
  5882. // canceled.
  5883. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  5884. c.ctx_ = ctx
  5885. return c
  5886. }
  5887. // Header returns an http.Header that can be modified by the caller to
  5888. // add HTTP headers to the request.
  5889. func (c *OrdersRefundCall) Header() http.Header {
  5890. if c.header_ == nil {
  5891. c.header_ = make(http.Header)
  5892. }
  5893. return c.header_
  5894. }
  5895. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  5896. reqHeaders := make(http.Header)
  5897. for k, v := range c.header_ {
  5898. reqHeaders[k] = v
  5899. }
  5900. reqHeaders.Set("User-Agent", c.s.userAgent())
  5901. var body io.Reader = nil
  5902. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrefundrequest)
  5903. if err != nil {
  5904. return nil, err
  5905. }
  5906. reqHeaders.Set("Content-Type", "application/json")
  5907. c.urlParams_.Set("alt", alt)
  5908. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/refund")
  5909. urls += "?" + c.urlParams_.Encode()
  5910. req, _ := http.NewRequest("POST", urls, body)
  5911. req.Header = reqHeaders
  5912. googleapi.Expand(req.URL, map[string]string{
  5913. "merchantId": strconv.FormatUint(c.merchantId, 10),
  5914. "orderId": c.orderId,
  5915. })
  5916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5917. }
  5918. // Do executes the "content.orders.refund" call.
  5919. // Exactly one of *OrdersRefundResponse or error will be non-nil. Any
  5920. // non-2xx status code is an error. Response headers are in either
  5921. // *OrdersRefundResponse.ServerResponse.Header or (if a response was
  5922. // returned at all) in error.(*googleapi.Error).Header. Use
  5923. // googleapi.IsNotModified to check whether the returned error was
  5924. // because http.StatusNotModified was returned.
  5925. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) (*OrdersRefundResponse, error) {
  5926. gensupport.SetOptions(c.urlParams_, opts...)
  5927. res, err := c.doRequest("json")
  5928. if res != nil && res.StatusCode == http.StatusNotModified {
  5929. if res.Body != nil {
  5930. res.Body.Close()
  5931. }
  5932. return nil, &googleapi.Error{
  5933. Code: res.StatusCode,
  5934. Header: res.Header,
  5935. }
  5936. }
  5937. if err != nil {
  5938. return nil, err
  5939. }
  5940. defer googleapi.CloseBody(res)
  5941. if err := googleapi.CheckResponse(res); err != nil {
  5942. return nil, err
  5943. }
  5944. ret := &OrdersRefundResponse{
  5945. ServerResponse: googleapi.ServerResponse{
  5946. Header: res.Header,
  5947. HTTPStatusCode: res.StatusCode,
  5948. },
  5949. }
  5950. target := &ret
  5951. if err := gensupport.DecodeResponse(target, res); err != nil {
  5952. return nil, err
  5953. }
  5954. return ret, nil
  5955. // {
  5956. // "description": "Refund a portion of the order, up to the full amount paid.",
  5957. // "httpMethod": "POST",
  5958. // "id": "content.orders.refund",
  5959. // "parameterOrder": [
  5960. // "merchantId",
  5961. // "orderId"
  5962. // ],
  5963. // "parameters": {
  5964. // "merchantId": {
  5965. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  5966. // "format": "uint64",
  5967. // "location": "path",
  5968. // "required": true,
  5969. // "type": "string"
  5970. // },
  5971. // "orderId": {
  5972. // "description": "The ID of the order to refund.",
  5973. // "location": "path",
  5974. // "required": true,
  5975. // "type": "string"
  5976. // }
  5977. // },
  5978. // "path": "{merchantId}/orders/{orderId}/refund",
  5979. // "request": {
  5980. // "$ref": "OrdersRefundRequest"
  5981. // },
  5982. // "response": {
  5983. // "$ref": "OrdersRefundResponse"
  5984. // },
  5985. // "scopes": [
  5986. // "https://www.googleapis.com/auth/content"
  5987. // ]
  5988. // }
  5989. }
  5990. // method id "content.orders.rejectreturnlineitem":
  5991. type OrdersRejectreturnlineitemCall struct {
  5992. s *APIService
  5993. merchantId uint64
  5994. orderId string
  5995. ordersrejectreturnlineitemrequest *OrdersRejectReturnLineItemRequest
  5996. urlParams_ gensupport.URLParams
  5997. ctx_ context.Context
  5998. header_ http.Header
  5999. }
  6000. // Rejectreturnlineitem: Rejects return on an line item.
  6001. func (r *OrdersService) Rejectreturnlineitem(merchantId uint64, orderId string, ordersrejectreturnlineitemrequest *OrdersRejectReturnLineItemRequest) *OrdersRejectreturnlineitemCall {
  6002. c := &OrdersRejectreturnlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6003. c.merchantId = merchantId
  6004. c.orderId = orderId
  6005. c.ordersrejectreturnlineitemrequest = ordersrejectreturnlineitemrequest
  6006. return c
  6007. }
  6008. // Fields allows partial responses to be retrieved. See
  6009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6010. // for more information.
  6011. func (c *OrdersRejectreturnlineitemCall) Fields(s ...googleapi.Field) *OrdersRejectreturnlineitemCall {
  6012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6013. return c
  6014. }
  6015. // Context sets the context to be used in this call's Do method. Any
  6016. // pending HTTP request will be aborted if the provided context is
  6017. // canceled.
  6018. func (c *OrdersRejectreturnlineitemCall) Context(ctx context.Context) *OrdersRejectreturnlineitemCall {
  6019. c.ctx_ = ctx
  6020. return c
  6021. }
  6022. // Header returns an http.Header that can be modified by the caller to
  6023. // add HTTP headers to the request.
  6024. func (c *OrdersRejectreturnlineitemCall) Header() http.Header {
  6025. if c.header_ == nil {
  6026. c.header_ = make(http.Header)
  6027. }
  6028. return c.header_
  6029. }
  6030. func (c *OrdersRejectreturnlineitemCall) doRequest(alt string) (*http.Response, error) {
  6031. reqHeaders := make(http.Header)
  6032. for k, v := range c.header_ {
  6033. reqHeaders[k] = v
  6034. }
  6035. reqHeaders.Set("User-Agent", c.s.userAgent())
  6036. var body io.Reader = nil
  6037. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrejectreturnlineitemrequest)
  6038. if err != nil {
  6039. return nil, err
  6040. }
  6041. reqHeaders.Set("Content-Type", "application/json")
  6042. c.urlParams_.Set("alt", alt)
  6043. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/rejectReturnLineItem")
  6044. urls += "?" + c.urlParams_.Encode()
  6045. req, _ := http.NewRequest("POST", urls, body)
  6046. req.Header = reqHeaders
  6047. googleapi.Expand(req.URL, map[string]string{
  6048. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6049. "orderId": c.orderId,
  6050. })
  6051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6052. }
  6053. // Do executes the "content.orders.rejectreturnlineitem" call.
  6054. // Exactly one of *OrdersRejectReturnLineItemResponse or error will be
  6055. // non-nil. Any non-2xx status code is an error. Response headers are in
  6056. // either *OrdersRejectReturnLineItemResponse.ServerResponse.Header or
  6057. // (if a response was returned at all) in
  6058. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6059. // whether the returned error was because http.StatusNotModified was
  6060. // returned.
  6061. func (c *OrdersRejectreturnlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersRejectReturnLineItemResponse, error) {
  6062. gensupport.SetOptions(c.urlParams_, opts...)
  6063. res, err := c.doRequest("json")
  6064. if res != nil && res.StatusCode == http.StatusNotModified {
  6065. if res.Body != nil {
  6066. res.Body.Close()
  6067. }
  6068. return nil, &googleapi.Error{
  6069. Code: res.StatusCode,
  6070. Header: res.Header,
  6071. }
  6072. }
  6073. if err != nil {
  6074. return nil, err
  6075. }
  6076. defer googleapi.CloseBody(res)
  6077. if err := googleapi.CheckResponse(res); err != nil {
  6078. return nil, err
  6079. }
  6080. ret := &OrdersRejectReturnLineItemResponse{
  6081. ServerResponse: googleapi.ServerResponse{
  6082. Header: res.Header,
  6083. HTTPStatusCode: res.StatusCode,
  6084. },
  6085. }
  6086. target := &ret
  6087. if err := gensupport.DecodeResponse(target, res); err != nil {
  6088. return nil, err
  6089. }
  6090. return ret, nil
  6091. // {
  6092. // "description": "Rejects return on an line item.",
  6093. // "httpMethod": "POST",
  6094. // "id": "content.orders.rejectreturnlineitem",
  6095. // "parameterOrder": [
  6096. // "merchantId",
  6097. // "orderId"
  6098. // ],
  6099. // "parameters": {
  6100. // "merchantId": {
  6101. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  6102. // "format": "uint64",
  6103. // "location": "path",
  6104. // "required": true,
  6105. // "type": "string"
  6106. // },
  6107. // "orderId": {
  6108. // "description": "The ID of the order.",
  6109. // "location": "path",
  6110. // "required": true,
  6111. // "type": "string"
  6112. // }
  6113. // },
  6114. // "path": "{merchantId}/orders/{orderId}/rejectReturnLineItem",
  6115. // "request": {
  6116. // "$ref": "OrdersRejectReturnLineItemRequest"
  6117. // },
  6118. // "response": {
  6119. // "$ref": "OrdersRejectReturnLineItemResponse"
  6120. // },
  6121. // "scopes": [
  6122. // "https://www.googleapis.com/auth/content"
  6123. // ]
  6124. // }
  6125. }
  6126. // method id "content.orders.returnlineitem":
  6127. type OrdersReturnlineitemCall struct {
  6128. s *APIService
  6129. merchantId uint64
  6130. orderId string
  6131. ordersreturnlineitemrequest *OrdersReturnLineItemRequest
  6132. urlParams_ gensupport.URLParams
  6133. ctx_ context.Context
  6134. header_ http.Header
  6135. }
  6136. // Returnlineitem: Returns a line item.
  6137. func (r *OrdersService) Returnlineitem(merchantId uint64, orderId string, ordersreturnlineitemrequest *OrdersReturnLineItemRequest) *OrdersReturnlineitemCall {
  6138. c := &OrdersReturnlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6139. c.merchantId = merchantId
  6140. c.orderId = orderId
  6141. c.ordersreturnlineitemrequest = ordersreturnlineitemrequest
  6142. return c
  6143. }
  6144. // Fields allows partial responses to be retrieved. See
  6145. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6146. // for more information.
  6147. func (c *OrdersReturnlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnlineitemCall {
  6148. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6149. return c
  6150. }
  6151. // Context sets the context to be used in this call's Do method. Any
  6152. // pending HTTP request will be aborted if the provided context is
  6153. // canceled.
  6154. func (c *OrdersReturnlineitemCall) Context(ctx context.Context) *OrdersReturnlineitemCall {
  6155. c.ctx_ = ctx
  6156. return c
  6157. }
  6158. // Header returns an http.Header that can be modified by the caller to
  6159. // add HTTP headers to the request.
  6160. func (c *OrdersReturnlineitemCall) Header() http.Header {
  6161. if c.header_ == nil {
  6162. c.header_ = make(http.Header)
  6163. }
  6164. return c.header_
  6165. }
  6166. func (c *OrdersReturnlineitemCall) doRequest(alt string) (*http.Response, error) {
  6167. reqHeaders := make(http.Header)
  6168. for k, v := range c.header_ {
  6169. reqHeaders[k] = v
  6170. }
  6171. reqHeaders.Set("User-Agent", c.s.userAgent())
  6172. var body io.Reader = nil
  6173. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnlineitemrequest)
  6174. if err != nil {
  6175. return nil, err
  6176. }
  6177. reqHeaders.Set("Content-Type", "application/json")
  6178. c.urlParams_.Set("alt", alt)
  6179. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnLineItem")
  6180. urls += "?" + c.urlParams_.Encode()
  6181. req, _ := http.NewRequest("POST", urls, body)
  6182. req.Header = reqHeaders
  6183. googleapi.Expand(req.URL, map[string]string{
  6184. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6185. "orderId": c.orderId,
  6186. })
  6187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6188. }
  6189. // Do executes the "content.orders.returnlineitem" call.
  6190. // Exactly one of *OrdersReturnLineItemResponse or error will be
  6191. // non-nil. Any non-2xx status code is an error. Response headers are in
  6192. // either *OrdersReturnLineItemResponse.ServerResponse.Header or (if a
  6193. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6194. // googleapi.IsNotModified to check whether the returned error was
  6195. // because http.StatusNotModified was returned.
  6196. func (c *OrdersReturnlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersReturnLineItemResponse, error) {
  6197. gensupport.SetOptions(c.urlParams_, opts...)
  6198. res, err := c.doRequest("json")
  6199. if res != nil && res.StatusCode == http.StatusNotModified {
  6200. if res.Body != nil {
  6201. res.Body.Close()
  6202. }
  6203. return nil, &googleapi.Error{
  6204. Code: res.StatusCode,
  6205. Header: res.Header,
  6206. }
  6207. }
  6208. if err != nil {
  6209. return nil, err
  6210. }
  6211. defer googleapi.CloseBody(res)
  6212. if err := googleapi.CheckResponse(res); err != nil {
  6213. return nil, err
  6214. }
  6215. ret := &OrdersReturnLineItemResponse{
  6216. ServerResponse: googleapi.ServerResponse{
  6217. Header: res.Header,
  6218. HTTPStatusCode: res.StatusCode,
  6219. },
  6220. }
  6221. target := &ret
  6222. if err := gensupport.DecodeResponse(target, res); err != nil {
  6223. return nil, err
  6224. }
  6225. return ret, nil
  6226. // {
  6227. // "description": "Returns a line item.",
  6228. // "httpMethod": "POST",
  6229. // "id": "content.orders.returnlineitem",
  6230. // "parameterOrder": [
  6231. // "merchantId",
  6232. // "orderId"
  6233. // ],
  6234. // "parameters": {
  6235. // "merchantId": {
  6236. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  6237. // "format": "uint64",
  6238. // "location": "path",
  6239. // "required": true,
  6240. // "type": "string"
  6241. // },
  6242. // "orderId": {
  6243. // "description": "The ID of the order.",
  6244. // "location": "path",
  6245. // "required": true,
  6246. // "type": "string"
  6247. // }
  6248. // },
  6249. // "path": "{merchantId}/orders/{orderId}/returnLineItem",
  6250. // "request": {
  6251. // "$ref": "OrdersReturnLineItemRequest"
  6252. // },
  6253. // "response": {
  6254. // "$ref": "OrdersReturnLineItemResponse"
  6255. // },
  6256. // "scopes": [
  6257. // "https://www.googleapis.com/auth/content"
  6258. // ]
  6259. // }
  6260. }
  6261. // method id "content.orders.returnrefundlineitem":
  6262. type OrdersReturnrefundlineitemCall struct {
  6263. s *APIService
  6264. merchantId uint64
  6265. orderId string
  6266. ordersreturnrefundlineitemrequest *OrdersReturnRefundLineItemRequest
  6267. urlParams_ gensupport.URLParams
  6268. ctx_ context.Context
  6269. header_ http.Header
  6270. }
  6271. // Returnrefundlineitem: Returns and refunds a line item. Note that this
  6272. // method can only be called on fully shipped orders.
  6273. func (r *OrdersService) Returnrefundlineitem(merchantId uint64, orderId string, ordersreturnrefundlineitemrequest *OrdersReturnRefundLineItemRequest) *OrdersReturnrefundlineitemCall {
  6274. c := &OrdersReturnrefundlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6275. c.merchantId = merchantId
  6276. c.orderId = orderId
  6277. c.ordersreturnrefundlineitemrequest = ordersreturnrefundlineitemrequest
  6278. return c
  6279. }
  6280. // Fields allows partial responses to be retrieved. See
  6281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6282. // for more information.
  6283. func (c *OrdersReturnrefundlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnrefundlineitemCall {
  6284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6285. return c
  6286. }
  6287. // Context sets the context to be used in this call's Do method. Any
  6288. // pending HTTP request will be aborted if the provided context is
  6289. // canceled.
  6290. func (c *OrdersReturnrefundlineitemCall) Context(ctx context.Context) *OrdersReturnrefundlineitemCall {
  6291. c.ctx_ = ctx
  6292. return c
  6293. }
  6294. // Header returns an http.Header that can be modified by the caller to
  6295. // add HTTP headers to the request.
  6296. func (c *OrdersReturnrefundlineitemCall) Header() http.Header {
  6297. if c.header_ == nil {
  6298. c.header_ = make(http.Header)
  6299. }
  6300. return c.header_
  6301. }
  6302. func (c *OrdersReturnrefundlineitemCall) doRequest(alt string) (*http.Response, error) {
  6303. reqHeaders := make(http.Header)
  6304. for k, v := range c.header_ {
  6305. reqHeaders[k] = v
  6306. }
  6307. reqHeaders.Set("User-Agent", c.s.userAgent())
  6308. var body io.Reader = nil
  6309. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnrefundlineitemrequest)
  6310. if err != nil {
  6311. return nil, err
  6312. }
  6313. reqHeaders.Set("Content-Type", "application/json")
  6314. c.urlParams_.Set("alt", alt)
  6315. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnRefundLineItem")
  6316. urls += "?" + c.urlParams_.Encode()
  6317. req, _ := http.NewRequest("POST", urls, body)
  6318. req.Header = reqHeaders
  6319. googleapi.Expand(req.URL, map[string]string{
  6320. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6321. "orderId": c.orderId,
  6322. })
  6323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6324. }
  6325. // Do executes the "content.orders.returnrefundlineitem" call.
  6326. // Exactly one of *OrdersReturnRefundLineItemResponse or error will be
  6327. // non-nil. Any non-2xx status code is an error. Response headers are in
  6328. // either *OrdersReturnRefundLineItemResponse.ServerResponse.Header or
  6329. // (if a response was returned at all) in
  6330. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6331. // whether the returned error was because http.StatusNotModified was
  6332. // returned.
  6333. func (c *OrdersReturnrefundlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersReturnRefundLineItemResponse, error) {
  6334. gensupport.SetOptions(c.urlParams_, opts...)
  6335. res, err := c.doRequest("json")
  6336. if res != nil && res.StatusCode == http.StatusNotModified {
  6337. if res.Body != nil {
  6338. res.Body.Close()
  6339. }
  6340. return nil, &googleapi.Error{
  6341. Code: res.StatusCode,
  6342. Header: res.Header,
  6343. }
  6344. }
  6345. if err != nil {
  6346. return nil, err
  6347. }
  6348. defer googleapi.CloseBody(res)
  6349. if err := googleapi.CheckResponse(res); err != nil {
  6350. return nil, err
  6351. }
  6352. ret := &OrdersReturnRefundLineItemResponse{
  6353. ServerResponse: googleapi.ServerResponse{
  6354. Header: res.Header,
  6355. HTTPStatusCode: res.StatusCode,
  6356. },
  6357. }
  6358. target := &ret
  6359. if err := gensupport.DecodeResponse(target, res); err != nil {
  6360. return nil, err
  6361. }
  6362. return ret, nil
  6363. // {
  6364. // "description": "Returns and refunds a line item. Note that this method can only be called on fully shipped orders.",
  6365. // "httpMethod": "POST",
  6366. // "id": "content.orders.returnrefundlineitem",
  6367. // "parameterOrder": [
  6368. // "merchantId",
  6369. // "orderId"
  6370. // ],
  6371. // "parameters": {
  6372. // "merchantId": {
  6373. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  6374. // "format": "uint64",
  6375. // "location": "path",
  6376. // "required": true,
  6377. // "type": "string"
  6378. // },
  6379. // "orderId": {
  6380. // "description": "The ID of the order.",
  6381. // "location": "path",
  6382. // "required": true,
  6383. // "type": "string"
  6384. // }
  6385. // },
  6386. // "path": "{merchantId}/orders/{orderId}/returnRefundLineItem",
  6387. // "request": {
  6388. // "$ref": "OrdersReturnRefundLineItemRequest"
  6389. // },
  6390. // "response": {
  6391. // "$ref": "OrdersReturnRefundLineItemResponse"
  6392. // },
  6393. // "scopes": [
  6394. // "https://www.googleapis.com/auth/content"
  6395. // ]
  6396. // }
  6397. }
  6398. // method id "content.orders.setlineitemmetadata":
  6399. type OrdersSetlineitemmetadataCall struct {
  6400. s *APIService
  6401. merchantId uint64
  6402. orderId string
  6403. orderssetlineitemmetadatarequest *OrdersSetLineItemMetadataRequest
  6404. urlParams_ gensupport.URLParams
  6405. ctx_ context.Context
  6406. header_ http.Header
  6407. }
  6408. // Setlineitemmetadata: Sets (overrides) merchant provided annotations
  6409. // on the line item.
  6410. func (r *OrdersService) Setlineitemmetadata(merchantId uint64, orderId string, orderssetlineitemmetadatarequest *OrdersSetLineItemMetadataRequest) *OrdersSetlineitemmetadataCall {
  6411. c := &OrdersSetlineitemmetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6412. c.merchantId = merchantId
  6413. c.orderId = orderId
  6414. c.orderssetlineitemmetadatarequest = orderssetlineitemmetadatarequest
  6415. return c
  6416. }
  6417. // Fields allows partial responses to be retrieved. See
  6418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6419. // for more information.
  6420. func (c *OrdersSetlineitemmetadataCall) Fields(s ...googleapi.Field) *OrdersSetlineitemmetadataCall {
  6421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6422. return c
  6423. }
  6424. // Context sets the context to be used in this call's Do method. Any
  6425. // pending HTTP request will be aborted if the provided context is
  6426. // canceled.
  6427. func (c *OrdersSetlineitemmetadataCall) Context(ctx context.Context) *OrdersSetlineitemmetadataCall {
  6428. c.ctx_ = ctx
  6429. return c
  6430. }
  6431. // Header returns an http.Header that can be modified by the caller to
  6432. // add HTTP headers to the request.
  6433. func (c *OrdersSetlineitemmetadataCall) Header() http.Header {
  6434. if c.header_ == nil {
  6435. c.header_ = make(http.Header)
  6436. }
  6437. return c.header_
  6438. }
  6439. func (c *OrdersSetlineitemmetadataCall) doRequest(alt string) (*http.Response, error) {
  6440. reqHeaders := make(http.Header)
  6441. for k, v := range c.header_ {
  6442. reqHeaders[k] = v
  6443. }
  6444. reqHeaders.Set("User-Agent", c.s.userAgent())
  6445. var body io.Reader = nil
  6446. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderssetlineitemmetadatarequest)
  6447. if err != nil {
  6448. return nil, err
  6449. }
  6450. reqHeaders.Set("Content-Type", "application/json")
  6451. c.urlParams_.Set("alt", alt)
  6452. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/setLineItemMetadata")
  6453. urls += "?" + c.urlParams_.Encode()
  6454. req, _ := http.NewRequest("POST", urls, body)
  6455. req.Header = reqHeaders
  6456. googleapi.Expand(req.URL, map[string]string{
  6457. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6458. "orderId": c.orderId,
  6459. })
  6460. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6461. }
  6462. // Do executes the "content.orders.setlineitemmetadata" call.
  6463. // Exactly one of *OrdersSetLineItemMetadataResponse or error will be
  6464. // non-nil. Any non-2xx status code is an error. Response headers are in
  6465. // either *OrdersSetLineItemMetadataResponse.ServerResponse.Header or
  6466. // (if a response was returned at all) in
  6467. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6468. // whether the returned error was because http.StatusNotModified was
  6469. // returned.
  6470. func (c *OrdersSetlineitemmetadataCall) Do(opts ...googleapi.CallOption) (*OrdersSetLineItemMetadataResponse, error) {
  6471. gensupport.SetOptions(c.urlParams_, opts...)
  6472. res, err := c.doRequest("json")
  6473. if res != nil && res.StatusCode == http.StatusNotModified {
  6474. if res.Body != nil {
  6475. res.Body.Close()
  6476. }
  6477. return nil, &googleapi.Error{
  6478. Code: res.StatusCode,
  6479. Header: res.Header,
  6480. }
  6481. }
  6482. if err != nil {
  6483. return nil, err
  6484. }
  6485. defer googleapi.CloseBody(res)
  6486. if err := googleapi.CheckResponse(res); err != nil {
  6487. return nil, err
  6488. }
  6489. ret := &OrdersSetLineItemMetadataResponse{
  6490. ServerResponse: googleapi.ServerResponse{
  6491. Header: res.Header,
  6492. HTTPStatusCode: res.StatusCode,
  6493. },
  6494. }
  6495. target := &ret
  6496. if err := gensupport.DecodeResponse(target, res); err != nil {
  6497. return nil, err
  6498. }
  6499. return ret, nil
  6500. // {
  6501. // "description": "Sets (overrides) merchant provided annotations on the line item.",
  6502. // "httpMethod": "POST",
  6503. // "id": "content.orders.setlineitemmetadata",
  6504. // "parameterOrder": [
  6505. // "merchantId",
  6506. // "orderId"
  6507. // ],
  6508. // "parameters": {
  6509. // "merchantId": {
  6510. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  6511. // "format": "uint64",
  6512. // "location": "path",
  6513. // "required": true,
  6514. // "type": "string"
  6515. // },
  6516. // "orderId": {
  6517. // "description": "The ID of the order.",
  6518. // "location": "path",
  6519. // "required": true,
  6520. // "type": "string"
  6521. // }
  6522. // },
  6523. // "path": "{merchantId}/orders/{orderId}/setLineItemMetadata",
  6524. // "request": {
  6525. // "$ref": "OrdersSetLineItemMetadataRequest"
  6526. // },
  6527. // "response": {
  6528. // "$ref": "OrdersSetLineItemMetadataResponse"
  6529. // },
  6530. // "scopes": [
  6531. // "https://www.googleapis.com/auth/content"
  6532. // ]
  6533. // }
  6534. }
  6535. // method id "content.orders.shiplineitems":
  6536. type OrdersShiplineitemsCall struct {
  6537. s *APIService
  6538. merchantId uint64
  6539. orderId string
  6540. ordersshiplineitemsrequest *OrdersShipLineItemsRequest
  6541. urlParams_ gensupport.URLParams
  6542. ctx_ context.Context
  6543. header_ http.Header
  6544. }
  6545. // Shiplineitems: Marks line item(s) as shipped.
  6546. func (r *OrdersService) Shiplineitems(merchantId uint64, orderId string, ordersshiplineitemsrequest *OrdersShipLineItemsRequest) *OrdersShiplineitemsCall {
  6547. c := &OrdersShiplineitemsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6548. c.merchantId = merchantId
  6549. c.orderId = orderId
  6550. c.ordersshiplineitemsrequest = ordersshiplineitemsrequest
  6551. return c
  6552. }
  6553. // Fields allows partial responses to be retrieved. See
  6554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6555. // for more information.
  6556. func (c *OrdersShiplineitemsCall) Fields(s ...googleapi.Field) *OrdersShiplineitemsCall {
  6557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6558. return c
  6559. }
  6560. // Context sets the context to be used in this call's Do method. Any
  6561. // pending HTTP request will be aborted if the provided context is
  6562. // canceled.
  6563. func (c *OrdersShiplineitemsCall) Context(ctx context.Context) *OrdersShiplineitemsCall {
  6564. c.ctx_ = ctx
  6565. return c
  6566. }
  6567. // Header returns an http.Header that can be modified by the caller to
  6568. // add HTTP headers to the request.
  6569. func (c *OrdersShiplineitemsCall) Header() http.Header {
  6570. if c.header_ == nil {
  6571. c.header_ = make(http.Header)
  6572. }
  6573. return c.header_
  6574. }
  6575. func (c *OrdersShiplineitemsCall) doRequest(alt string) (*http.Response, error) {
  6576. reqHeaders := make(http.Header)
  6577. for k, v := range c.header_ {
  6578. reqHeaders[k] = v
  6579. }
  6580. reqHeaders.Set("User-Agent", c.s.userAgent())
  6581. var body io.Reader = nil
  6582. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersshiplineitemsrequest)
  6583. if err != nil {
  6584. return nil, err
  6585. }
  6586. reqHeaders.Set("Content-Type", "application/json")
  6587. c.urlParams_.Set("alt", alt)
  6588. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/shipLineItems")
  6589. urls += "?" + c.urlParams_.Encode()
  6590. req, _ := http.NewRequest("POST", urls, body)
  6591. req.Header = reqHeaders
  6592. googleapi.Expand(req.URL, map[string]string{
  6593. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6594. "orderId": c.orderId,
  6595. })
  6596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6597. }
  6598. // Do executes the "content.orders.shiplineitems" call.
  6599. // Exactly one of *OrdersShipLineItemsResponse or error will be non-nil.
  6600. // Any non-2xx status code is an error. Response headers are in either
  6601. // *OrdersShipLineItemsResponse.ServerResponse.Header or (if a response
  6602. // was returned at all) in error.(*googleapi.Error).Header. Use
  6603. // googleapi.IsNotModified to check whether the returned error was
  6604. // because http.StatusNotModified was returned.
  6605. func (c *OrdersShiplineitemsCall) Do(opts ...googleapi.CallOption) (*OrdersShipLineItemsResponse, error) {
  6606. gensupport.SetOptions(c.urlParams_, opts...)
  6607. res, err := c.doRequest("json")
  6608. if res != nil && res.StatusCode == http.StatusNotModified {
  6609. if res.Body != nil {
  6610. res.Body.Close()
  6611. }
  6612. return nil, &googleapi.Error{
  6613. Code: res.StatusCode,
  6614. Header: res.Header,
  6615. }
  6616. }
  6617. if err != nil {
  6618. return nil, err
  6619. }
  6620. defer googleapi.CloseBody(res)
  6621. if err := googleapi.CheckResponse(res); err != nil {
  6622. return nil, err
  6623. }
  6624. ret := &OrdersShipLineItemsResponse{
  6625. ServerResponse: googleapi.ServerResponse{
  6626. Header: res.Header,
  6627. HTTPStatusCode: res.StatusCode,
  6628. },
  6629. }
  6630. target := &ret
  6631. if err := gensupport.DecodeResponse(target, res); err != nil {
  6632. return nil, err
  6633. }
  6634. return ret, nil
  6635. // {
  6636. // "description": "Marks line item(s) as shipped.",
  6637. // "httpMethod": "POST",
  6638. // "id": "content.orders.shiplineitems",
  6639. // "parameterOrder": [
  6640. // "merchantId",
  6641. // "orderId"
  6642. // ],
  6643. // "parameters": {
  6644. // "merchantId": {
  6645. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  6646. // "format": "uint64",
  6647. // "location": "path",
  6648. // "required": true,
  6649. // "type": "string"
  6650. // },
  6651. // "orderId": {
  6652. // "description": "The ID of the order.",
  6653. // "location": "path",
  6654. // "required": true,
  6655. // "type": "string"
  6656. // }
  6657. // },
  6658. // "path": "{merchantId}/orders/{orderId}/shipLineItems",
  6659. // "request": {
  6660. // "$ref": "OrdersShipLineItemsRequest"
  6661. // },
  6662. // "response": {
  6663. // "$ref": "OrdersShipLineItemsResponse"
  6664. // },
  6665. // "scopes": [
  6666. // "https://www.googleapis.com/auth/content"
  6667. // ]
  6668. // }
  6669. }
  6670. // method id "content.orders.updatelineitemshippingdetails":
  6671. type OrdersUpdatelineitemshippingdetailsCall struct {
  6672. s *APIService
  6673. merchantId uint64
  6674. orderId string
  6675. ordersupdatelineitemshippingdetailsrequest *OrdersUpdateLineItemShippingDetailsRequest
  6676. urlParams_ gensupport.URLParams
  6677. ctx_ context.Context
  6678. header_ http.Header
  6679. }
  6680. // Updatelineitemshippingdetails: Updates ship by and delivery by dates
  6681. // for a line item.
  6682. func (r *OrdersService) Updatelineitemshippingdetails(merchantId uint64, orderId string, ordersupdatelineitemshippingdetailsrequest *OrdersUpdateLineItemShippingDetailsRequest) *OrdersUpdatelineitemshippingdetailsCall {
  6683. c := &OrdersUpdatelineitemshippingdetailsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6684. c.merchantId = merchantId
  6685. c.orderId = orderId
  6686. c.ordersupdatelineitemshippingdetailsrequest = ordersupdatelineitemshippingdetailsrequest
  6687. return c
  6688. }
  6689. // Fields allows partial responses to be retrieved. See
  6690. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6691. // for more information.
  6692. func (c *OrdersUpdatelineitemshippingdetailsCall) Fields(s ...googleapi.Field) *OrdersUpdatelineitemshippingdetailsCall {
  6693. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6694. return c
  6695. }
  6696. // Context sets the context to be used in this call's Do method. Any
  6697. // pending HTTP request will be aborted if the provided context is
  6698. // canceled.
  6699. func (c *OrdersUpdatelineitemshippingdetailsCall) Context(ctx context.Context) *OrdersUpdatelineitemshippingdetailsCall {
  6700. c.ctx_ = ctx
  6701. return c
  6702. }
  6703. // Header returns an http.Header that can be modified by the caller to
  6704. // add HTTP headers to the request.
  6705. func (c *OrdersUpdatelineitemshippingdetailsCall) Header() http.Header {
  6706. if c.header_ == nil {
  6707. c.header_ = make(http.Header)
  6708. }
  6709. return c.header_
  6710. }
  6711. func (c *OrdersUpdatelineitemshippingdetailsCall) doRequest(alt string) (*http.Response, error) {
  6712. reqHeaders := make(http.Header)
  6713. for k, v := range c.header_ {
  6714. reqHeaders[k] = v
  6715. }
  6716. reqHeaders.Set("User-Agent", c.s.userAgent())
  6717. var body io.Reader = nil
  6718. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatelineitemshippingdetailsrequest)
  6719. if err != nil {
  6720. return nil, err
  6721. }
  6722. reqHeaders.Set("Content-Type", "application/json")
  6723. c.urlParams_.Set("alt", alt)
  6724. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateLineItemShippingDetails")
  6725. urls += "?" + c.urlParams_.Encode()
  6726. req, _ := http.NewRequest("POST", urls, body)
  6727. req.Header = reqHeaders
  6728. googleapi.Expand(req.URL, map[string]string{
  6729. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6730. "orderId": c.orderId,
  6731. })
  6732. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6733. }
  6734. // Do executes the "content.orders.updatelineitemshippingdetails" call.
  6735. // Exactly one of *OrdersUpdateLineItemShippingDetailsResponse or error
  6736. // will be non-nil. Any non-2xx status code is an error. Response
  6737. // headers are in either
  6738. // *OrdersUpdateLineItemShippingDetailsResponse.ServerResponse.Header or
  6739. // (if a response was returned at all) in
  6740. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6741. // whether the returned error was because http.StatusNotModified was
  6742. // returned.
  6743. func (c *OrdersUpdatelineitemshippingdetailsCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateLineItemShippingDetailsResponse, error) {
  6744. gensupport.SetOptions(c.urlParams_, opts...)
  6745. res, err := c.doRequest("json")
  6746. if res != nil && res.StatusCode == http.StatusNotModified {
  6747. if res.Body != nil {
  6748. res.Body.Close()
  6749. }
  6750. return nil, &googleapi.Error{
  6751. Code: res.StatusCode,
  6752. Header: res.Header,
  6753. }
  6754. }
  6755. if err != nil {
  6756. return nil, err
  6757. }
  6758. defer googleapi.CloseBody(res)
  6759. if err := googleapi.CheckResponse(res); err != nil {
  6760. return nil, err
  6761. }
  6762. ret := &OrdersUpdateLineItemShippingDetailsResponse{
  6763. ServerResponse: googleapi.ServerResponse{
  6764. Header: res.Header,
  6765. HTTPStatusCode: res.StatusCode,
  6766. },
  6767. }
  6768. target := &ret
  6769. if err := gensupport.DecodeResponse(target, res); err != nil {
  6770. return nil, err
  6771. }
  6772. return ret, nil
  6773. // {
  6774. // "description": "Updates ship by and delivery by dates for a line item.",
  6775. // "httpMethod": "POST",
  6776. // "id": "content.orders.updatelineitemshippingdetails",
  6777. // "parameterOrder": [
  6778. // "merchantId",
  6779. // "orderId"
  6780. // ],
  6781. // "parameters": {
  6782. // "merchantId": {
  6783. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  6784. // "format": "uint64",
  6785. // "location": "path",
  6786. // "required": true,
  6787. // "type": "string"
  6788. // },
  6789. // "orderId": {
  6790. // "description": "The ID of the order.",
  6791. // "location": "path",
  6792. // "required": true,
  6793. // "type": "string"
  6794. // }
  6795. // },
  6796. // "path": "{merchantId}/orders/{orderId}/updateLineItemShippingDetails",
  6797. // "request": {
  6798. // "$ref": "OrdersUpdateLineItemShippingDetailsRequest"
  6799. // },
  6800. // "response": {
  6801. // "$ref": "OrdersUpdateLineItemShippingDetailsResponse"
  6802. // },
  6803. // "scopes": [
  6804. // "https://www.googleapis.com/auth/content"
  6805. // ]
  6806. // }
  6807. }
  6808. // method id "content.orders.updatemerchantorderid":
  6809. type OrdersUpdatemerchantorderidCall struct {
  6810. s *APIService
  6811. merchantId uint64
  6812. orderId string
  6813. ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest
  6814. urlParams_ gensupport.URLParams
  6815. ctx_ context.Context
  6816. header_ http.Header
  6817. }
  6818. // Updatemerchantorderid: Updates the merchant order ID for a given
  6819. // order.
  6820. func (r *OrdersService) Updatemerchantorderid(merchantId uint64, orderId string, ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest) *OrdersUpdatemerchantorderidCall {
  6821. c := &OrdersUpdatemerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6822. c.merchantId = merchantId
  6823. c.orderId = orderId
  6824. c.ordersupdatemerchantorderidrequest = ordersupdatemerchantorderidrequest
  6825. return c
  6826. }
  6827. // Fields allows partial responses to be retrieved. See
  6828. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6829. // for more information.
  6830. func (c *OrdersUpdatemerchantorderidCall) Fields(s ...googleapi.Field) *OrdersUpdatemerchantorderidCall {
  6831. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6832. return c
  6833. }
  6834. // Context sets the context to be used in this call's Do method. Any
  6835. // pending HTTP request will be aborted if the provided context is
  6836. // canceled.
  6837. func (c *OrdersUpdatemerchantorderidCall) Context(ctx context.Context) *OrdersUpdatemerchantorderidCall {
  6838. c.ctx_ = ctx
  6839. return c
  6840. }
  6841. // Header returns an http.Header that can be modified by the caller to
  6842. // add HTTP headers to the request.
  6843. func (c *OrdersUpdatemerchantorderidCall) Header() http.Header {
  6844. if c.header_ == nil {
  6845. c.header_ = make(http.Header)
  6846. }
  6847. return c.header_
  6848. }
  6849. func (c *OrdersUpdatemerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  6850. reqHeaders := make(http.Header)
  6851. for k, v := range c.header_ {
  6852. reqHeaders[k] = v
  6853. }
  6854. reqHeaders.Set("User-Agent", c.s.userAgent())
  6855. var body io.Reader = nil
  6856. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatemerchantorderidrequest)
  6857. if err != nil {
  6858. return nil, err
  6859. }
  6860. reqHeaders.Set("Content-Type", "application/json")
  6861. c.urlParams_.Set("alt", alt)
  6862. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateMerchantOrderId")
  6863. urls += "?" + c.urlParams_.Encode()
  6864. req, _ := http.NewRequest("POST", urls, body)
  6865. req.Header = reqHeaders
  6866. googleapi.Expand(req.URL, map[string]string{
  6867. "merchantId": strconv.FormatUint(c.merchantId, 10),
  6868. "orderId": c.orderId,
  6869. })
  6870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6871. }
  6872. // Do executes the "content.orders.updatemerchantorderid" call.
  6873. // Exactly one of *OrdersUpdateMerchantOrderIdResponse or error will be
  6874. // non-nil. Any non-2xx status code is an error. Response headers are in
  6875. // either *OrdersUpdateMerchantOrderIdResponse.ServerResponse.Header or
  6876. // (if a response was returned at all) in
  6877. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6878. // whether the returned error was because http.StatusNotModified was
  6879. // returned.
  6880. func (c *OrdersUpdatemerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateMerchantOrderIdResponse, error) {
  6881. gensupport.SetOptions(c.urlParams_, opts...)
  6882. res, err := c.doRequest("json")
  6883. if res != nil && res.StatusCode == http.StatusNotModified {
  6884. if res.Body != nil {
  6885. res.Body.Close()
  6886. }
  6887. return nil, &googleapi.Error{
  6888. Code: res.StatusCode,
  6889. Header: res.Header,
  6890. }
  6891. }
  6892. if err != nil {
  6893. return nil, err
  6894. }
  6895. defer googleapi.CloseBody(res)
  6896. if err := googleapi.CheckResponse(res); err != nil {
  6897. return nil, err
  6898. }
  6899. ret := &OrdersUpdateMerchantOrderIdResponse{
  6900. ServerResponse: googleapi.ServerResponse{
  6901. Header: res.Header,
  6902. HTTPStatusCode: res.StatusCode,
  6903. },
  6904. }
  6905. target := &ret
  6906. if err := gensupport.DecodeResponse(target, res); err != nil {
  6907. return nil, err
  6908. }
  6909. return ret, nil
  6910. // {
  6911. // "description": "Updates the merchant order ID for a given order.",
  6912. // "httpMethod": "POST",
  6913. // "id": "content.orders.updatemerchantorderid",
  6914. // "parameterOrder": [
  6915. // "merchantId",
  6916. // "orderId"
  6917. // ],
  6918. // "parameters": {
  6919. // "merchantId": {
  6920. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  6921. // "format": "uint64",
  6922. // "location": "path",
  6923. // "required": true,
  6924. // "type": "string"
  6925. // },
  6926. // "orderId": {
  6927. // "description": "The ID of the order.",
  6928. // "location": "path",
  6929. // "required": true,
  6930. // "type": "string"
  6931. // }
  6932. // },
  6933. // "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId",
  6934. // "request": {
  6935. // "$ref": "OrdersUpdateMerchantOrderIdRequest"
  6936. // },
  6937. // "response": {
  6938. // "$ref": "OrdersUpdateMerchantOrderIdResponse"
  6939. // },
  6940. // "scopes": [
  6941. // "https://www.googleapis.com/auth/content"
  6942. // ]
  6943. // }
  6944. }
  6945. // method id "content.orders.updateshipment":
  6946. type OrdersUpdateshipmentCall struct {
  6947. s *APIService
  6948. merchantId uint64
  6949. orderId string
  6950. ordersupdateshipmentrequest *OrdersUpdateShipmentRequest
  6951. urlParams_ gensupport.URLParams
  6952. ctx_ context.Context
  6953. header_ http.Header
  6954. }
  6955. // Updateshipment: Updates a shipment's status, carrier, and/or tracking
  6956. // ID.
  6957. func (r *OrdersService) Updateshipment(merchantId uint64, orderId string, ordersupdateshipmentrequest *OrdersUpdateShipmentRequest) *OrdersUpdateshipmentCall {
  6958. c := &OrdersUpdateshipmentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6959. c.merchantId = merchantId
  6960. c.orderId = orderId
  6961. c.ordersupdateshipmentrequest = ordersupdateshipmentrequest
  6962. return c
  6963. }
  6964. // Fields allows partial responses to be retrieved. See
  6965. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6966. // for more information.
  6967. func (c *OrdersUpdateshipmentCall) Fields(s ...googleapi.Field) *OrdersUpdateshipmentCall {
  6968. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6969. return c
  6970. }
  6971. // Context sets the context to be used in this call's Do method. Any
  6972. // pending HTTP request will be aborted if the provided context is
  6973. // canceled.
  6974. func (c *OrdersUpdateshipmentCall) Context(ctx context.Context) *OrdersUpdateshipmentCall {
  6975. c.ctx_ = ctx
  6976. return c
  6977. }
  6978. // Header returns an http.Header that can be modified by the caller to
  6979. // add HTTP headers to the request.
  6980. func (c *OrdersUpdateshipmentCall) Header() http.Header {
  6981. if c.header_ == nil {
  6982. c.header_ = make(http.Header)
  6983. }
  6984. return c.header_
  6985. }
  6986. func (c *OrdersUpdateshipmentCall) doRequest(alt string) (*http.Response, error) {
  6987. reqHeaders := make(http.Header)
  6988. for k, v := range c.header_ {
  6989. reqHeaders[k] = v
  6990. }
  6991. reqHeaders.Set("User-Agent", c.s.userAgent())
  6992. var body io.Reader = nil
  6993. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdateshipmentrequest)
  6994. if err != nil {
  6995. return nil, err
  6996. }
  6997. reqHeaders.Set("Content-Type", "application/json")
  6998. c.urlParams_.Set("alt", alt)
  6999. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateShipment")
  7000. urls += "?" + c.urlParams_.Encode()
  7001. req, _ := http.NewRequest("POST", urls, body)
  7002. req.Header = reqHeaders
  7003. googleapi.Expand(req.URL, map[string]string{
  7004. "merchantId": strconv.FormatUint(c.merchantId, 10),
  7005. "orderId": c.orderId,
  7006. })
  7007. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7008. }
  7009. // Do executes the "content.orders.updateshipment" call.
  7010. // Exactly one of *OrdersUpdateShipmentResponse or error will be
  7011. // non-nil. Any non-2xx status code is an error. Response headers are in
  7012. // either *OrdersUpdateShipmentResponse.ServerResponse.Header or (if a
  7013. // response was returned at all) in error.(*googleapi.Error).Header. Use
  7014. // googleapi.IsNotModified to check whether the returned error was
  7015. // because http.StatusNotModified was returned.
  7016. func (c *OrdersUpdateshipmentCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateShipmentResponse, error) {
  7017. gensupport.SetOptions(c.urlParams_, opts...)
  7018. res, err := c.doRequest("json")
  7019. if res != nil && res.StatusCode == http.StatusNotModified {
  7020. if res.Body != nil {
  7021. res.Body.Close()
  7022. }
  7023. return nil, &googleapi.Error{
  7024. Code: res.StatusCode,
  7025. Header: res.Header,
  7026. }
  7027. }
  7028. if err != nil {
  7029. return nil, err
  7030. }
  7031. defer googleapi.CloseBody(res)
  7032. if err := googleapi.CheckResponse(res); err != nil {
  7033. return nil, err
  7034. }
  7035. ret := &OrdersUpdateShipmentResponse{
  7036. ServerResponse: googleapi.ServerResponse{
  7037. Header: res.Header,
  7038. HTTPStatusCode: res.StatusCode,
  7039. },
  7040. }
  7041. target := &ret
  7042. if err := gensupport.DecodeResponse(target, res); err != nil {
  7043. return nil, err
  7044. }
  7045. return ret, nil
  7046. // {
  7047. // "description": "Updates a shipment's status, carrier, and/or tracking ID.",
  7048. // "httpMethod": "POST",
  7049. // "id": "content.orders.updateshipment",
  7050. // "parameterOrder": [
  7051. // "merchantId",
  7052. // "orderId"
  7053. // ],
  7054. // "parameters": {
  7055. // "merchantId": {
  7056. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  7057. // "format": "uint64",
  7058. // "location": "path",
  7059. // "required": true,
  7060. // "type": "string"
  7061. // },
  7062. // "orderId": {
  7063. // "description": "The ID of the order.",
  7064. // "location": "path",
  7065. // "required": true,
  7066. // "type": "string"
  7067. // }
  7068. // },
  7069. // "path": "{merchantId}/orders/{orderId}/updateShipment",
  7070. // "request": {
  7071. // "$ref": "OrdersUpdateShipmentRequest"
  7072. // },
  7073. // "response": {
  7074. // "$ref": "OrdersUpdateShipmentResponse"
  7075. // },
  7076. // "scopes": [
  7077. // "https://www.googleapis.com/auth/content"
  7078. // ]
  7079. // }
  7080. }