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.
 
 
 

9333 lines
347 KiB

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