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.
 
 
 

26736 lines
973 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package content provides access to the Content API for Shopping.
  6. //
  7. // For product documentation, see: https://developers.google.com/shopping-content
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/content/v2"
  14. // ...
  15. // ctx := context.Background()
  16. // contentService, err := content.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // contentService, err := content.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // contentService, err := content.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package content // import "google.golang.org/api/content/v2"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "content:v2"
  67. const apiName = "content"
  68. const apiVersion = "v2"
  69. const basePath = "https://www.googleapis.com/content/v2/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // Manage your product listings and accounts for Google Shopping
  73. ContentScope = "https://www.googleapis.com/auth/content"
  74. )
  75. // NewService creates a new APIService.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*APIService, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/content",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new APIService. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*APIService, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &APIService{client: client, BasePath: basePath}
  105. s.Accounts = NewAccountsService(s)
  106. s.Accountstatuses = NewAccountstatusesService(s)
  107. s.Accounttax = NewAccounttaxService(s)
  108. s.Datafeeds = NewDatafeedsService(s)
  109. s.Datafeedstatuses = NewDatafeedstatusesService(s)
  110. s.Inventory = NewInventoryService(s)
  111. s.Liasettings = NewLiasettingsService(s)
  112. s.Orderinvoices = NewOrderinvoicesService(s)
  113. s.Orderpayments = NewOrderpaymentsService(s)
  114. s.Orderreports = NewOrderreportsService(s)
  115. s.Orderreturns = NewOrderreturnsService(s)
  116. s.Orders = NewOrdersService(s)
  117. s.Pos = NewPosService(s)
  118. s.Products = NewProductsService(s)
  119. s.Productstatuses = NewProductstatusesService(s)
  120. s.Shippingsettings = NewShippingsettingsService(s)
  121. return s, nil
  122. }
  123. type APIService struct {
  124. client *http.Client
  125. BasePath string // API endpoint base URL
  126. UserAgent string // optional additional User-Agent fragment
  127. Accounts *AccountsService
  128. Accountstatuses *AccountstatusesService
  129. Accounttax *AccounttaxService
  130. Datafeeds *DatafeedsService
  131. Datafeedstatuses *DatafeedstatusesService
  132. Inventory *InventoryService
  133. Liasettings *LiasettingsService
  134. Orderinvoices *OrderinvoicesService
  135. Orderpayments *OrderpaymentsService
  136. Orderreports *OrderreportsService
  137. Orderreturns *OrderreturnsService
  138. Orders *OrdersService
  139. Pos *PosService
  140. Products *ProductsService
  141. Productstatuses *ProductstatusesService
  142. Shippingsettings *ShippingsettingsService
  143. }
  144. func (s *APIService) userAgent() string {
  145. if s.UserAgent == "" {
  146. return googleapi.UserAgent
  147. }
  148. return googleapi.UserAgent + " " + s.UserAgent
  149. }
  150. func NewAccountsService(s *APIService) *AccountsService {
  151. rs := &AccountsService{s: s}
  152. return rs
  153. }
  154. type AccountsService struct {
  155. s *APIService
  156. }
  157. func NewAccountstatusesService(s *APIService) *AccountstatusesService {
  158. rs := &AccountstatusesService{s: s}
  159. return rs
  160. }
  161. type AccountstatusesService struct {
  162. s *APIService
  163. }
  164. func NewAccounttaxService(s *APIService) *AccounttaxService {
  165. rs := &AccounttaxService{s: s}
  166. return rs
  167. }
  168. type AccounttaxService struct {
  169. s *APIService
  170. }
  171. func NewDatafeedsService(s *APIService) *DatafeedsService {
  172. rs := &DatafeedsService{s: s}
  173. return rs
  174. }
  175. type DatafeedsService struct {
  176. s *APIService
  177. }
  178. func NewDatafeedstatusesService(s *APIService) *DatafeedstatusesService {
  179. rs := &DatafeedstatusesService{s: s}
  180. return rs
  181. }
  182. type DatafeedstatusesService struct {
  183. s *APIService
  184. }
  185. func NewInventoryService(s *APIService) *InventoryService {
  186. rs := &InventoryService{s: s}
  187. return rs
  188. }
  189. type InventoryService struct {
  190. s *APIService
  191. }
  192. func NewLiasettingsService(s *APIService) *LiasettingsService {
  193. rs := &LiasettingsService{s: s}
  194. return rs
  195. }
  196. type LiasettingsService struct {
  197. s *APIService
  198. }
  199. func NewOrderinvoicesService(s *APIService) *OrderinvoicesService {
  200. rs := &OrderinvoicesService{s: s}
  201. return rs
  202. }
  203. type OrderinvoicesService struct {
  204. s *APIService
  205. }
  206. func NewOrderpaymentsService(s *APIService) *OrderpaymentsService {
  207. rs := &OrderpaymentsService{s: s}
  208. return rs
  209. }
  210. type OrderpaymentsService struct {
  211. s *APIService
  212. }
  213. func NewOrderreportsService(s *APIService) *OrderreportsService {
  214. rs := &OrderreportsService{s: s}
  215. return rs
  216. }
  217. type OrderreportsService struct {
  218. s *APIService
  219. }
  220. func NewOrderreturnsService(s *APIService) *OrderreturnsService {
  221. rs := &OrderreturnsService{s: s}
  222. return rs
  223. }
  224. type OrderreturnsService struct {
  225. s *APIService
  226. }
  227. func NewOrdersService(s *APIService) *OrdersService {
  228. rs := &OrdersService{s: s}
  229. return rs
  230. }
  231. type OrdersService struct {
  232. s *APIService
  233. }
  234. func NewPosService(s *APIService) *PosService {
  235. rs := &PosService{s: s}
  236. return rs
  237. }
  238. type PosService struct {
  239. s *APIService
  240. }
  241. func NewProductsService(s *APIService) *ProductsService {
  242. rs := &ProductsService{s: s}
  243. return rs
  244. }
  245. type ProductsService struct {
  246. s *APIService
  247. }
  248. func NewProductstatusesService(s *APIService) *ProductstatusesService {
  249. rs := &ProductstatusesService{s: s}
  250. return rs
  251. }
  252. type ProductstatusesService struct {
  253. s *APIService
  254. }
  255. func NewShippingsettingsService(s *APIService) *ShippingsettingsService {
  256. rs := &ShippingsettingsService{s: s}
  257. return rs
  258. }
  259. type ShippingsettingsService struct {
  260. s *APIService
  261. }
  262. // Account: Account data. After the creation of a new account it may
  263. // take a few minutes before it is fully operational. The methods
  264. // delete, insert, patch, and update require the admin role.
  265. type Account struct {
  266. // AdultContent: Indicates whether the merchant sells adult content.
  267. AdultContent bool `json:"adultContent,omitempty"`
  268. // AdwordsLinks: List of linked AdWords accounts that are active or
  269. // pending approval. To create a new link request, add a new link with
  270. // status active to the list. It will remain in a pending state until
  271. // approved or rejected either in the AdWords interface or through the
  272. // AdWords API. To delete an active link, or to cancel a link request,
  273. // remove it from the list.
  274. AdwordsLinks []*AccountAdwordsLink `json:"adwordsLinks,omitempty"`
  275. // BusinessInformation: The business information of the account.
  276. BusinessInformation *AccountBusinessInformation `json:"businessInformation,omitempty"`
  277. // GoogleMyBusinessLink: The GMB account which is linked or in the
  278. // process of being linked with the Merchant Center account.
  279. GoogleMyBusinessLink *AccountGoogleMyBusinessLink `json:"googleMyBusinessLink,omitempty"`
  280. // Id: Merchant Center account ID.
  281. Id uint64 `json:"id,omitempty,string"`
  282. // Kind: Identifies what kind of resource this is. Value: the fixed
  283. // string "content#account".
  284. Kind string `json:"kind,omitempty"`
  285. // Name: Display name for the account.
  286. Name string `json:"name,omitempty"`
  287. // ReviewsUrl: [DEPRECATED] This field is never returned and will be
  288. // ignored if provided.
  289. ReviewsUrl string `json:"reviewsUrl,omitempty"`
  290. // SellerId: Client-specific, locally-unique, internal ID for the child
  291. // account.
  292. SellerId string `json:"sellerId,omitempty"`
  293. // Users: Users with access to the account. Every account (except for
  294. // subaccounts) must have at least one admin user.
  295. Users []*AccountUser `json:"users,omitempty"`
  296. // WebsiteUrl: The merchant's website.
  297. WebsiteUrl string `json:"websiteUrl,omitempty"`
  298. // YoutubeChannelLinks: List of linked YouTube channels that are active
  299. // or pending approval. To create a new link request, add a new link
  300. // with status active to the list. It will remain in a pending state
  301. // until approved or rejected in the YT Creator Studio interface. To
  302. // delete an active link, or to cancel a link request, remove it from
  303. // the list.
  304. YoutubeChannelLinks []*AccountYouTubeChannelLink `json:"youtubeChannelLinks,omitempty"`
  305. // ServerResponse contains the HTTP response code and headers from the
  306. // server.
  307. googleapi.ServerResponse `json:"-"`
  308. // ForceSendFields is a list of field names (e.g. "AdultContent") to
  309. // unconditionally include in API requests. By default, fields with
  310. // empty values are omitted from API requests. However, any non-pointer,
  311. // non-interface field appearing in ForceSendFields will be sent to the
  312. // server regardless of whether the field is empty or not. This may be
  313. // used to include empty fields in Patch requests.
  314. ForceSendFields []string `json:"-"`
  315. // NullFields is a list of field names (e.g. "AdultContent") to include
  316. // in API requests with the JSON null value. By default, fields with
  317. // empty values are omitted from API requests. However, any field with
  318. // an empty value appearing in NullFields will be sent to the server as
  319. // null. It is an error if a field in this list has a non-empty value.
  320. // This may be used to include null fields in Patch requests.
  321. NullFields []string `json:"-"`
  322. }
  323. func (s *Account) MarshalJSON() ([]byte, error) {
  324. type NoMethod Account
  325. raw := NoMethod(*s)
  326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  327. }
  328. type AccountAddress struct {
  329. // Country: CLDR country code (e.g. "US").
  330. Country string `json:"country,omitempty"`
  331. // Locality: City, town or commune. May also include dependent
  332. // localities or sublocalities (e.g. neighborhoods or suburbs).
  333. Locality string `json:"locality,omitempty"`
  334. // PostalCode: Postal code or ZIP (e.g. "94043").
  335. PostalCode string `json:"postalCode,omitempty"`
  336. // Region: Top-level administrative subdivision of the country. For
  337. // example, a state like California ("CA") or a province like Quebec
  338. // ("QC").
  339. Region string `json:"region,omitempty"`
  340. // StreetAddress: Street-level part of the address.
  341. StreetAddress string `json:"streetAddress,omitempty"`
  342. // ForceSendFields is a list of field names (e.g. "Country") to
  343. // unconditionally include in API requests. By default, fields with
  344. // empty values are omitted from API requests. However, any non-pointer,
  345. // non-interface field appearing in ForceSendFields will be sent to the
  346. // server regardless of whether the field is empty or not. This may be
  347. // used to include empty fields in Patch requests.
  348. ForceSendFields []string `json:"-"`
  349. // NullFields is a list of field names (e.g. "Country") to include in
  350. // API requests with the JSON null value. By default, fields with empty
  351. // values are omitted from API requests. However, any field with an
  352. // empty value appearing in NullFields will be sent to the server as
  353. // null. It is an error if a field in this list has a non-empty value.
  354. // This may be used to include null fields in Patch requests.
  355. NullFields []string `json:"-"`
  356. }
  357. func (s *AccountAddress) MarshalJSON() ([]byte, error) {
  358. type NoMethod AccountAddress
  359. raw := NoMethod(*s)
  360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  361. }
  362. type AccountAdwordsLink struct {
  363. // AdwordsId: Customer ID of the AdWords account.
  364. AdwordsId uint64 `json:"adwordsId,omitempty,string"`
  365. // Status: Status of the link between this Merchant Center account and
  366. // the AdWords account. Upon retrieval, it represents the actual status
  367. // of the link and can be either active if it was approved in Google
  368. // AdWords or pending if it's pending approval. Upon insertion, it
  369. // represents the intended status of the link. Re-uploading a link with
  370. // status active when it's still pending or with status pending when
  371. // it's already active will have no effect: the status will remain
  372. // unchanged. Re-uploading a link with deprecated status inactive is
  373. // equivalent to not submitting the link at all and will delete the link
  374. // if it was active or cancel the link request if it was pending.
  375. Status string `json:"status,omitempty"`
  376. // ForceSendFields is a list of field names (e.g. "AdwordsId") to
  377. // unconditionally include in API requests. By default, fields with
  378. // empty values are omitted from API requests. However, any non-pointer,
  379. // non-interface field appearing in ForceSendFields will be sent to the
  380. // server regardless of whether the field is empty or not. This may be
  381. // used to include empty fields in Patch requests.
  382. ForceSendFields []string `json:"-"`
  383. // NullFields is a list of field names (e.g. "AdwordsId") to include in
  384. // API requests with the JSON null value. By default, fields with empty
  385. // values are omitted from API requests. However, any field with an
  386. // empty value appearing in NullFields will be sent to the server as
  387. // null. It is an error if a field in this list has a non-empty value.
  388. // This may be used to include null fields in Patch requests.
  389. NullFields []string `json:"-"`
  390. }
  391. func (s *AccountAdwordsLink) MarshalJSON() ([]byte, error) {
  392. type NoMethod AccountAdwordsLink
  393. raw := NoMethod(*s)
  394. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  395. }
  396. type AccountBusinessInformation struct {
  397. // Address: The address of the business.
  398. Address *AccountAddress `json:"address,omitempty"`
  399. // CustomerService: The customer service information of the business.
  400. CustomerService *AccountCustomerService `json:"customerService,omitempty"`
  401. // PhoneNumber: The phone number of the business.
  402. PhoneNumber string `json:"phoneNumber,omitempty"`
  403. // ForceSendFields is a list of field names (e.g. "Address") to
  404. // unconditionally include in API requests. By default, fields with
  405. // empty values are omitted from API requests. However, any non-pointer,
  406. // non-interface field appearing in ForceSendFields will be sent to the
  407. // server regardless of whether the field is empty or not. This may be
  408. // used to include empty fields in Patch requests.
  409. ForceSendFields []string `json:"-"`
  410. // NullFields is a list of field names (e.g. "Address") to include in
  411. // API requests with the JSON null value. By default, fields with empty
  412. // values are omitted from API requests. However, any field with an
  413. // empty value appearing in NullFields will be sent to the server as
  414. // null. It is an error if a field in this list has a non-empty value.
  415. // This may be used to include null fields in Patch requests.
  416. NullFields []string `json:"-"`
  417. }
  418. func (s *AccountBusinessInformation) MarshalJSON() ([]byte, error) {
  419. type NoMethod AccountBusinessInformation
  420. raw := NoMethod(*s)
  421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  422. }
  423. type AccountCustomerService struct {
  424. // Email: Customer service email.
  425. Email string `json:"email,omitempty"`
  426. // PhoneNumber: Customer service phone number.
  427. PhoneNumber string `json:"phoneNumber,omitempty"`
  428. // Url: Customer service URL.
  429. Url string `json:"url,omitempty"`
  430. // ForceSendFields is a list of field names (e.g. "Email") to
  431. // unconditionally include in API requests. By default, fields with
  432. // empty values are omitted from API requests. However, any non-pointer,
  433. // non-interface field appearing in ForceSendFields will be sent to the
  434. // server regardless of whether the field is empty or not. This may be
  435. // used to include empty fields in Patch requests.
  436. ForceSendFields []string `json:"-"`
  437. // NullFields is a list of field names (e.g. "Email") to include in API
  438. // requests with the JSON null value. By default, fields with empty
  439. // values are omitted from API requests. However, any field with an
  440. // empty value appearing in NullFields will be sent to the server as
  441. // null. It is an error if a field in this list has a non-empty value.
  442. // This may be used to include null fields in Patch requests.
  443. NullFields []string `json:"-"`
  444. }
  445. func (s *AccountCustomerService) MarshalJSON() ([]byte, error) {
  446. type NoMethod AccountCustomerService
  447. raw := NoMethod(*s)
  448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  449. }
  450. type AccountGoogleMyBusinessLink struct {
  451. // GmbEmail: The GMB email address of which a specific account within a
  452. // GMB account. A sample account within a GMB account could be a
  453. // business account with set of locations, managed under the GMB
  454. // account.
  455. GmbEmail string `json:"gmbEmail,omitempty"`
  456. // Status: Status of the link between this Merchant Center account and
  457. // the GMB account.
  458. Status string `json:"status,omitempty"`
  459. // ForceSendFields is a list of field names (e.g. "GmbEmail") to
  460. // unconditionally include in API requests. By default, fields with
  461. // empty values are omitted from API requests. However, any non-pointer,
  462. // non-interface field appearing in ForceSendFields will be sent to the
  463. // server regardless of whether the field is empty or not. This may be
  464. // used to include empty fields in Patch requests.
  465. ForceSendFields []string `json:"-"`
  466. // NullFields is a list of field names (e.g. "GmbEmail") to include in
  467. // API requests with the JSON null value. By default, fields with empty
  468. // values are omitted from API requests. However, any field with an
  469. // empty value appearing in NullFields will be sent to the server as
  470. // null. It is an error if a field in this list has a non-empty value.
  471. // This may be used to include null fields in Patch requests.
  472. NullFields []string `json:"-"`
  473. }
  474. func (s *AccountGoogleMyBusinessLink) MarshalJSON() ([]byte, error) {
  475. type NoMethod AccountGoogleMyBusinessLink
  476. raw := NoMethod(*s)
  477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  478. }
  479. type AccountIdentifier struct {
  480. // AggregatorId: The aggregator ID, set for aggregators and subaccounts
  481. // (in that case, it represents the aggregator of the subaccount).
  482. AggregatorId uint64 `json:"aggregatorId,omitempty,string"`
  483. // MerchantId: The merchant account ID, set for individual accounts and
  484. // subaccounts.
  485. MerchantId uint64 `json:"merchantId,omitempty,string"`
  486. // ForceSendFields is a list of field names (e.g. "AggregatorId") to
  487. // unconditionally include in API requests. By default, fields with
  488. // empty values are omitted from API requests. However, any non-pointer,
  489. // non-interface field appearing in ForceSendFields will be sent to the
  490. // server regardless of whether the field is empty or not. This may be
  491. // used to include empty fields in Patch requests.
  492. ForceSendFields []string `json:"-"`
  493. // NullFields is a list of field names (e.g. "AggregatorId") to include
  494. // in API requests with the JSON null value. By default, fields with
  495. // empty values are omitted from API requests. However, any field with
  496. // an empty value appearing in NullFields will be sent to the server as
  497. // null. It is an error if a field in this list has a non-empty value.
  498. // This may be used to include null fields in Patch requests.
  499. NullFields []string `json:"-"`
  500. }
  501. func (s *AccountIdentifier) MarshalJSON() ([]byte, error) {
  502. type NoMethod AccountIdentifier
  503. raw := NoMethod(*s)
  504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  505. }
  506. // AccountStatus: The status of an account, i.e., information about its
  507. // products, which is computed offline and not returned immediately at
  508. // insertion time.
  509. type AccountStatus struct {
  510. // AccountId: The ID of the account for which the status is reported.
  511. AccountId string `json:"accountId,omitempty"`
  512. // AccountLevelIssues: A list of account level issues.
  513. AccountLevelIssues []*AccountStatusAccountLevelIssue `json:"accountLevelIssues,omitempty"`
  514. // DataQualityIssues: DEPRECATED - never populated.
  515. DataQualityIssues []*AccountStatusDataQualityIssue `json:"dataQualityIssues,omitempty"`
  516. // Kind: Identifies what kind of resource this is. Value: the fixed
  517. // string "content#accountStatus".
  518. Kind string `json:"kind,omitempty"`
  519. // Products: List of product-related data by channel, destination, and
  520. // country. Data in this field may be delayed by up to 30 minutes.
  521. Products []*AccountStatusProducts `json:"products,omitempty"`
  522. // WebsiteClaimed: Whether the account's website is claimed or not.
  523. WebsiteClaimed bool `json:"websiteClaimed,omitempty"`
  524. // ServerResponse contains the HTTP response code and headers from the
  525. // server.
  526. googleapi.ServerResponse `json:"-"`
  527. // ForceSendFields is a list of field names (e.g. "AccountId") to
  528. // unconditionally include in API requests. By default, fields with
  529. // empty values are omitted from API requests. However, any non-pointer,
  530. // non-interface field appearing in ForceSendFields will be sent to the
  531. // server regardless of whether the field is empty or not. This may be
  532. // used to include empty fields in Patch requests.
  533. ForceSendFields []string `json:"-"`
  534. // NullFields is a list of field names (e.g. "AccountId") to include in
  535. // API requests with the JSON null value. By default, fields with empty
  536. // values are omitted from API requests. However, any field with an
  537. // empty value appearing in NullFields will be sent to the server as
  538. // null. It is an error if a field in this list has a non-empty value.
  539. // This may be used to include null fields in Patch requests.
  540. NullFields []string `json:"-"`
  541. }
  542. func (s *AccountStatus) MarshalJSON() ([]byte, error) {
  543. type NoMethod AccountStatus
  544. raw := NoMethod(*s)
  545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  546. }
  547. type AccountStatusAccountLevelIssue struct {
  548. // Country: Country for which this issue is reported.
  549. Country string `json:"country,omitempty"`
  550. // Destination: The destination the issue applies to.
  551. Destination string `json:"destination,omitempty"`
  552. // Detail: Additional details about the issue.
  553. Detail string `json:"detail,omitempty"`
  554. // Documentation: The URL of a web page to help resolving this issue.
  555. Documentation string `json:"documentation,omitempty"`
  556. // Id: Issue identifier.
  557. Id string `json:"id,omitempty"`
  558. // Severity: Severity of the issue.
  559. Severity string `json:"severity,omitempty"`
  560. // Title: Short description of the issue.
  561. Title string `json:"title,omitempty"`
  562. // ForceSendFields is a list of field names (e.g. "Country") to
  563. // unconditionally include in API requests. By default, fields with
  564. // empty values are omitted from API requests. However, any non-pointer,
  565. // non-interface field appearing in ForceSendFields will be sent to the
  566. // server regardless of whether the field is empty or not. This may be
  567. // used to include empty fields in Patch requests.
  568. ForceSendFields []string `json:"-"`
  569. // NullFields is a list of field names (e.g. "Country") to include in
  570. // API requests with the JSON null value. By default, fields with empty
  571. // values are omitted from API requests. However, any field with an
  572. // empty value appearing in NullFields will be sent to the server as
  573. // null. It is an error if a field in this list has a non-empty value.
  574. // This may be used to include null fields in Patch requests.
  575. NullFields []string `json:"-"`
  576. }
  577. func (s *AccountStatusAccountLevelIssue) MarshalJSON() ([]byte, error) {
  578. type NoMethod AccountStatusAccountLevelIssue
  579. raw := NoMethod(*s)
  580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  581. }
  582. type AccountStatusDataQualityIssue struct {
  583. Country string `json:"country,omitempty"`
  584. Destination string `json:"destination,omitempty"`
  585. Detail string `json:"detail,omitempty"`
  586. DisplayedValue string `json:"displayedValue,omitempty"`
  587. ExampleItems []*AccountStatusExampleItem `json:"exampleItems,omitempty"`
  588. Id string `json:"id,omitempty"`
  589. LastChecked string `json:"lastChecked,omitempty"`
  590. Location string `json:"location,omitempty"`
  591. NumItems int64 `json:"numItems,omitempty"`
  592. Severity string `json:"severity,omitempty"`
  593. SubmittedValue string `json:"submittedValue,omitempty"`
  594. // ForceSendFields is a list of field names (e.g. "Country") to
  595. // unconditionally include in API requests. By default, fields with
  596. // empty values are omitted from API requests. However, any non-pointer,
  597. // non-interface field appearing in ForceSendFields will be sent to the
  598. // server regardless of whether the field is empty or not. This may be
  599. // used to include empty fields in Patch requests.
  600. ForceSendFields []string `json:"-"`
  601. // NullFields is a list of field names (e.g. "Country") to include in
  602. // API requests with the JSON null value. By default, fields with empty
  603. // values are omitted from API requests. However, any field with an
  604. // empty value appearing in NullFields will be sent to the server as
  605. // null. It is an error if a field in this list has a non-empty value.
  606. // This may be used to include null fields in Patch requests.
  607. NullFields []string `json:"-"`
  608. }
  609. func (s *AccountStatusDataQualityIssue) MarshalJSON() ([]byte, error) {
  610. type NoMethod AccountStatusDataQualityIssue
  611. raw := NoMethod(*s)
  612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  613. }
  614. type AccountStatusExampleItem struct {
  615. ItemId string `json:"itemId,omitempty"`
  616. Link string `json:"link,omitempty"`
  617. SubmittedValue string `json:"submittedValue,omitempty"`
  618. Title string `json:"title,omitempty"`
  619. ValueOnLandingPage string `json:"valueOnLandingPage,omitempty"`
  620. // ForceSendFields is a list of field names (e.g. "ItemId") to
  621. // unconditionally include in API requests. By default, fields with
  622. // empty values are omitted from API requests. However, any non-pointer,
  623. // non-interface field appearing in ForceSendFields will be sent to the
  624. // server regardless of whether the field is empty or not. This may be
  625. // used to include empty fields in Patch requests.
  626. ForceSendFields []string `json:"-"`
  627. // NullFields is a list of field names (e.g. "ItemId") to include in API
  628. // requests with the JSON null value. By default, fields with empty
  629. // values are omitted from API requests. However, any field with an
  630. // empty value appearing in NullFields will be sent to the server as
  631. // null. It is an error if a field in this list has a non-empty value.
  632. // This may be used to include null fields in Patch requests.
  633. NullFields []string `json:"-"`
  634. }
  635. func (s *AccountStatusExampleItem) MarshalJSON() ([]byte, error) {
  636. type NoMethod AccountStatusExampleItem
  637. raw := NoMethod(*s)
  638. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  639. }
  640. type AccountStatusItemLevelIssue struct {
  641. // AttributeName: The attribute's name, if the issue is caused by a
  642. // single attribute.
  643. AttributeName string `json:"attributeName,omitempty"`
  644. // Code: The error code of the issue.
  645. Code string `json:"code,omitempty"`
  646. // Description: A short issue description in English.
  647. Description string `json:"description,omitempty"`
  648. // Detail: A detailed issue description in English.
  649. Detail string `json:"detail,omitempty"`
  650. // Documentation: The URL of a web page to help with resolving this
  651. // issue.
  652. Documentation string `json:"documentation,omitempty"`
  653. // NumItems: Number of items with this issue.
  654. NumItems int64 `json:"numItems,omitempty,string"`
  655. // Resolution: Whether the issue can be resolved by the merchant.
  656. Resolution string `json:"resolution,omitempty"`
  657. // Servability: How this issue affects serving of the offer.
  658. Servability string `json:"servability,omitempty"`
  659. // ForceSendFields is a list of field names (e.g. "AttributeName") to
  660. // unconditionally include in API requests. By default, fields with
  661. // empty values are omitted from API requests. However, any non-pointer,
  662. // non-interface field appearing in ForceSendFields will be sent to the
  663. // server regardless of whether the field is empty or not. This may be
  664. // used to include empty fields in Patch requests.
  665. ForceSendFields []string `json:"-"`
  666. // NullFields is a list of field names (e.g. "AttributeName") to include
  667. // in API requests with the JSON null value. By default, fields with
  668. // empty values are omitted from API requests. However, any field with
  669. // an empty value appearing in NullFields will be sent to the server as
  670. // null. It is an error if a field in this list has a non-empty value.
  671. // This may be used to include null fields in Patch requests.
  672. NullFields []string `json:"-"`
  673. }
  674. func (s *AccountStatusItemLevelIssue) MarshalJSON() ([]byte, error) {
  675. type NoMethod AccountStatusItemLevelIssue
  676. raw := NoMethod(*s)
  677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  678. }
  679. type AccountStatusProducts struct {
  680. // Channel: The channel the data applies to.
  681. Channel string `json:"channel,omitempty"`
  682. // Country: The country the data applies to.
  683. Country string `json:"country,omitempty"`
  684. // Destination: The destination the data applies to.
  685. Destination string `json:"destination,omitempty"`
  686. // ItemLevelIssues: List of item-level issues.
  687. ItemLevelIssues []*AccountStatusItemLevelIssue `json:"itemLevelIssues,omitempty"`
  688. // Statistics: Aggregated product statistics.
  689. Statistics *AccountStatusStatistics `json:"statistics,omitempty"`
  690. // ForceSendFields is a list of field names (e.g. "Channel") to
  691. // unconditionally include in API requests. By default, fields with
  692. // empty values are omitted from API requests. However, any non-pointer,
  693. // non-interface field appearing in ForceSendFields will be sent to the
  694. // server regardless of whether the field is empty or not. This may be
  695. // used to include empty fields in Patch requests.
  696. ForceSendFields []string `json:"-"`
  697. // NullFields is a list of field names (e.g. "Channel") to include in
  698. // API requests with the JSON null value. By default, fields with empty
  699. // values are omitted from API requests. However, any field with an
  700. // empty value appearing in NullFields will be sent to the server as
  701. // null. It is an error if a field in this list has a non-empty value.
  702. // This may be used to include null fields in Patch requests.
  703. NullFields []string `json:"-"`
  704. }
  705. func (s *AccountStatusProducts) MarshalJSON() ([]byte, error) {
  706. type NoMethod AccountStatusProducts
  707. raw := NoMethod(*s)
  708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  709. }
  710. type AccountStatusStatistics struct {
  711. // Active: Number of active offers.
  712. Active int64 `json:"active,omitempty,string"`
  713. // Disapproved: Number of disapproved offers.
  714. Disapproved int64 `json:"disapproved,omitempty,string"`
  715. // Expiring: Number of expiring offers.
  716. Expiring int64 `json:"expiring,omitempty,string"`
  717. // Pending: Number of pending offers.
  718. Pending int64 `json:"pending,omitempty,string"`
  719. // ForceSendFields is a list of field names (e.g. "Active") to
  720. // unconditionally include in API requests. By default, fields with
  721. // empty values are omitted from API requests. However, any non-pointer,
  722. // non-interface field appearing in ForceSendFields will be sent to the
  723. // server regardless of whether the field is empty or not. This may be
  724. // used to include empty fields in Patch requests.
  725. ForceSendFields []string `json:"-"`
  726. // NullFields is a list of field names (e.g. "Active") to include in API
  727. // requests with the JSON null value. By default, fields with empty
  728. // values are omitted from API requests. However, any field with an
  729. // empty value appearing in NullFields will be sent to the server as
  730. // null. It is an error if a field in this list has a non-empty value.
  731. // This may be used to include null fields in Patch requests.
  732. NullFields []string `json:"-"`
  733. }
  734. func (s *AccountStatusStatistics) MarshalJSON() ([]byte, error) {
  735. type NoMethod AccountStatusStatistics
  736. raw := NoMethod(*s)
  737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  738. }
  739. // AccountTax: The tax settings of a merchant account. All methods
  740. // require the admin role.
  741. type AccountTax struct {
  742. // AccountId: The ID of the account to which these account tax settings
  743. // belong.
  744. AccountId uint64 `json:"accountId,omitempty,string"`
  745. // Kind: Identifies what kind of resource this is. Value: the fixed
  746. // string "content#accountTax".
  747. Kind string `json:"kind,omitempty"`
  748. // Rules: Tax rules. Updating the tax rules will enable US taxes (not
  749. // reversible). Defining no rules is equivalent to not charging tax at
  750. // all.
  751. Rules []*AccountTaxTaxRule `json:"rules,omitempty"`
  752. // ServerResponse contains the HTTP response code and headers from the
  753. // server.
  754. googleapi.ServerResponse `json:"-"`
  755. // ForceSendFields is a list of field names (e.g. "AccountId") to
  756. // unconditionally include in API requests. By default, fields with
  757. // empty values are omitted from API requests. However, any non-pointer,
  758. // non-interface field appearing in ForceSendFields will be sent to the
  759. // server regardless of whether the field is empty or not. This may be
  760. // used to include empty fields in Patch requests.
  761. ForceSendFields []string `json:"-"`
  762. // NullFields is a list of field names (e.g. "AccountId") to include in
  763. // API requests with the JSON null value. By default, fields with empty
  764. // values are omitted from API requests. However, any field with an
  765. // empty value appearing in NullFields will be sent to the server as
  766. // null. It is an error if a field in this list has a non-empty value.
  767. // This may be used to include null fields in Patch requests.
  768. NullFields []string `json:"-"`
  769. }
  770. func (s *AccountTax) MarshalJSON() ([]byte, error) {
  771. type NoMethod AccountTax
  772. raw := NoMethod(*s)
  773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  774. }
  775. // AccountTaxTaxRule: Tax calculation rule to apply in a state or
  776. // province (USA only).
  777. type AccountTaxTaxRule struct {
  778. // Country: Country code in which tax is applicable.
  779. Country string `json:"country,omitempty"`
  780. // LocationId: State (or province) is which the tax is applicable,
  781. // described by its location ID (also called criteria ID).
  782. LocationId uint64 `json:"locationId,omitempty,string"`
  783. // RatePercent: Explicit tax rate in percent, represented as a floating
  784. // point number without the percentage character. Must not be negative.
  785. RatePercent string `json:"ratePercent,omitempty"`
  786. // ShippingTaxed: If true, shipping charges are also taxed.
  787. ShippingTaxed bool `json:"shippingTaxed,omitempty"`
  788. // UseGlobalRate: Whether the tax rate is taken from a global tax table
  789. // or specified explicitly.
  790. UseGlobalRate bool `json:"useGlobalRate,omitempty"`
  791. // ForceSendFields is a list of field names (e.g. "Country") to
  792. // unconditionally include in API requests. By default, fields with
  793. // empty values are omitted from API requests. However, any non-pointer,
  794. // non-interface field appearing in ForceSendFields will be sent to the
  795. // server regardless of whether the field is empty or not. This may be
  796. // used to include empty fields in Patch requests.
  797. ForceSendFields []string `json:"-"`
  798. // NullFields is a list of field names (e.g. "Country") to include in
  799. // API requests with the JSON null value. By default, fields with empty
  800. // values are omitted from API requests. However, any field with an
  801. // empty value appearing in NullFields will be sent to the server as
  802. // null. It is an error if a field in this list has a non-empty value.
  803. // This may be used to include null fields in Patch requests.
  804. NullFields []string `json:"-"`
  805. }
  806. func (s *AccountTaxTaxRule) MarshalJSON() ([]byte, error) {
  807. type NoMethod AccountTaxTaxRule
  808. raw := NoMethod(*s)
  809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  810. }
  811. type AccountUser struct {
  812. // Admin: Whether user is an admin.
  813. Admin *bool `json:"admin,omitempty"`
  814. // EmailAddress: User's email address.
  815. EmailAddress string `json:"emailAddress,omitempty"`
  816. // OrderManager: Whether user is an order manager.
  817. OrderManager bool `json:"orderManager,omitempty"`
  818. // PaymentsAnalyst: Whether user can access payment statements.
  819. PaymentsAnalyst bool `json:"paymentsAnalyst,omitempty"`
  820. // PaymentsManager: Whether user can manage payment settings.
  821. PaymentsManager bool `json:"paymentsManager,omitempty"`
  822. // ForceSendFields is a list of field names (e.g. "Admin") to
  823. // unconditionally include in API requests. By default, fields with
  824. // empty values are omitted from API requests. However, any non-pointer,
  825. // non-interface field appearing in ForceSendFields will be sent to the
  826. // server regardless of whether the field is empty or not. This may be
  827. // used to include empty fields in Patch requests.
  828. ForceSendFields []string `json:"-"`
  829. // NullFields is a list of field names (e.g. "Admin") to include in API
  830. // requests with the JSON null value. By default, fields with empty
  831. // values are omitted from API requests. However, any field with an
  832. // empty value appearing in NullFields will be sent to the server as
  833. // null. It is an error if a field in this list has a non-empty value.
  834. // This may be used to include null fields in Patch requests.
  835. NullFields []string `json:"-"`
  836. }
  837. func (s *AccountUser) MarshalJSON() ([]byte, error) {
  838. type NoMethod AccountUser
  839. raw := NoMethod(*s)
  840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  841. }
  842. type AccountYouTubeChannelLink struct {
  843. // ChannelId: Channel ID.
  844. ChannelId string `json:"channelId,omitempty"`
  845. // Status: Status of the link between this Merchant Center account and
  846. // the YouTube channel. Upon retrieval, it represents the actual status
  847. // of the link and can be either active if it was approved in YT Creator
  848. // Studio or pending if it's pending approval. Upon insertion, it
  849. // represents the intended status of the link. Re-uploading a link with
  850. // status active when it's still pending or with status pending when
  851. // it's already active will have no effect: the status will remain
  852. // unchanged. Re-uploading a link with deprecated status inactive is
  853. // equivalent to not submitting the link at all and will delete the link
  854. // if it was active or cancel the link request if it was pending.
  855. Status string `json:"status,omitempty"`
  856. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  857. // unconditionally include in API requests. By default, fields with
  858. // empty values are omitted from API requests. However, any non-pointer,
  859. // non-interface field appearing in ForceSendFields will be sent to the
  860. // server regardless of whether the field is empty or not. This may be
  861. // used to include empty fields in Patch requests.
  862. ForceSendFields []string `json:"-"`
  863. // NullFields is a list of field names (e.g. "ChannelId") to include in
  864. // API requests with the JSON null value. By default, fields with empty
  865. // values are omitted from API requests. However, any field with an
  866. // empty value appearing in NullFields will be sent to the server as
  867. // null. It is an error if a field in this list has a non-empty value.
  868. // This may be used to include null fields in Patch requests.
  869. NullFields []string `json:"-"`
  870. }
  871. func (s *AccountYouTubeChannelLink) MarshalJSON() ([]byte, error) {
  872. type NoMethod AccountYouTubeChannelLink
  873. raw := NoMethod(*s)
  874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  875. }
  876. type AccountsAuthInfoResponse struct {
  877. // AccountIdentifiers: The account identifiers corresponding to the
  878. // authenticated user.
  879. // - For an individual account: only the merchant ID is defined
  880. // - For an aggregator: only the aggregator ID is defined
  881. // - For a subaccount of an MCA: both the merchant ID and the aggregator
  882. // ID are defined.
  883. AccountIdentifiers []*AccountIdentifier `json:"accountIdentifiers,omitempty"`
  884. // Kind: Identifies what kind of resource this is. Value: the fixed
  885. // string "content#accountsAuthInfoResponse".
  886. Kind string `json:"kind,omitempty"`
  887. // ServerResponse contains the HTTP response code and headers from the
  888. // server.
  889. googleapi.ServerResponse `json:"-"`
  890. // ForceSendFields is a list of field names (e.g. "AccountIdentifiers")
  891. // to unconditionally include in API requests. By default, fields with
  892. // empty values are omitted from API requests. However, any non-pointer,
  893. // non-interface field appearing in ForceSendFields will be sent to the
  894. // server regardless of whether the field is empty or not. This may be
  895. // used to include empty fields in Patch requests.
  896. ForceSendFields []string `json:"-"`
  897. // NullFields is a list of field names (e.g. "AccountIdentifiers") to
  898. // include in API requests with the JSON null value. By default, fields
  899. // with empty values are omitted from API requests. However, any field
  900. // with an empty value appearing in NullFields will be sent to the
  901. // server as null. It is an error if a field in this list has a
  902. // non-empty value. This may be used to include null fields in Patch
  903. // requests.
  904. NullFields []string `json:"-"`
  905. }
  906. func (s *AccountsAuthInfoResponse) MarshalJSON() ([]byte, error) {
  907. type NoMethod AccountsAuthInfoResponse
  908. raw := NoMethod(*s)
  909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  910. }
  911. type AccountsClaimWebsiteResponse struct {
  912. // Kind: Identifies what kind of resource this is. Value: the fixed
  913. // string "content#accountsClaimWebsiteResponse".
  914. Kind string `json:"kind,omitempty"`
  915. // ServerResponse contains the HTTP response code and headers from the
  916. // server.
  917. googleapi.ServerResponse `json:"-"`
  918. // ForceSendFields is a list of field names (e.g. "Kind") to
  919. // unconditionally include in API requests. By default, fields with
  920. // empty values are omitted from API requests. However, any non-pointer,
  921. // non-interface field appearing in ForceSendFields will be sent to the
  922. // server regardless of whether the field is empty or not. This may be
  923. // used to include empty fields in Patch requests.
  924. ForceSendFields []string `json:"-"`
  925. // NullFields is a list of field names (e.g. "Kind") to include in API
  926. // requests with the JSON null value. By default, fields with empty
  927. // values are omitted from API requests. However, any field with an
  928. // empty value appearing in NullFields will be sent to the server as
  929. // null. It is an error if a field in this list has a non-empty value.
  930. // This may be used to include null fields in Patch requests.
  931. NullFields []string `json:"-"`
  932. }
  933. func (s *AccountsClaimWebsiteResponse) MarshalJSON() ([]byte, error) {
  934. type NoMethod AccountsClaimWebsiteResponse
  935. raw := NoMethod(*s)
  936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  937. }
  938. type AccountsCustomBatchRequest struct {
  939. // Entries: The request entries to be processed in the batch.
  940. Entries []*AccountsCustomBatchRequestEntry `json:"entries,omitempty"`
  941. // ForceSendFields is a list of field names (e.g. "Entries") to
  942. // unconditionally include in API requests. By default, fields with
  943. // empty values are omitted from API requests. However, any non-pointer,
  944. // non-interface field appearing in ForceSendFields will be sent to the
  945. // server regardless of whether the field is empty or not. This may be
  946. // used to include empty fields in Patch requests.
  947. ForceSendFields []string `json:"-"`
  948. // NullFields is a list of field names (e.g. "Entries") to include in
  949. // API requests with the JSON null value. By default, fields with empty
  950. // values are omitted from API requests. However, any field with an
  951. // empty value appearing in NullFields will be sent to the server as
  952. // null. It is an error if a field in this list has a non-empty value.
  953. // This may be used to include null fields in Patch requests.
  954. NullFields []string `json:"-"`
  955. }
  956. func (s *AccountsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  957. type NoMethod AccountsCustomBatchRequest
  958. raw := NoMethod(*s)
  959. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  960. }
  961. // AccountsCustomBatchRequestEntry: A batch entry encoding a single
  962. // non-batch accounts request.
  963. type AccountsCustomBatchRequestEntry struct {
  964. // Account: The account to create or update. Only defined if the method
  965. // is insert or update.
  966. Account *Account `json:"account,omitempty"`
  967. // AccountId: The ID of the targeted account. Only defined if the method
  968. // is not insert.
  969. AccountId uint64 `json:"accountId,omitempty,string"`
  970. // BatchId: An entry ID, unique within the batch request.
  971. BatchId int64 `json:"batchId,omitempty"`
  972. // Force: Whether the account should be deleted if the account has
  973. // offers. Only applicable if the method is delete.
  974. Force bool `json:"force,omitempty"`
  975. // LinkRequest: Details about the link request.
  976. LinkRequest *AccountsCustomBatchRequestEntryLinkRequest `json:"linkRequest,omitempty"`
  977. // MerchantId: The ID of the managing account.
  978. MerchantId uint64 `json:"merchantId,omitempty,string"`
  979. // Method: The method of the batch entry.
  980. Method string `json:"method,omitempty"`
  981. // Overwrite: Only applicable if the method is claimwebsite. Indicates
  982. // whether or not to take the claim from another account in case there
  983. // is a conflict.
  984. Overwrite bool `json:"overwrite,omitempty"`
  985. // ForceSendFields is a list of field names (e.g. "Account") to
  986. // unconditionally include in API requests. By default, fields with
  987. // empty values are omitted from API requests. However, any non-pointer,
  988. // non-interface field appearing in ForceSendFields will be sent to the
  989. // server regardless of whether the field is empty or not. This may be
  990. // used to include empty fields in Patch requests.
  991. ForceSendFields []string `json:"-"`
  992. // NullFields is a list of field names (e.g. "Account") to include in
  993. // API requests with the JSON null value. By default, fields with empty
  994. // values are omitted from API requests. However, any field with an
  995. // empty value appearing in NullFields will be sent to the server as
  996. // null. It is an error if a field in this list has a non-empty value.
  997. // This may be used to include null fields in Patch requests.
  998. NullFields []string `json:"-"`
  999. }
  1000. func (s *AccountsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1001. type NoMethod AccountsCustomBatchRequestEntry
  1002. raw := NoMethod(*s)
  1003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1004. }
  1005. type AccountsCustomBatchRequestEntryLinkRequest struct {
  1006. // Action: Action to perform for this link. The "request" action is only
  1007. // available to select merchants.
  1008. Action string `json:"action,omitempty"`
  1009. // LinkType: Type of the link between the two accounts.
  1010. LinkType string `json:"linkType,omitempty"`
  1011. // LinkedAccountId: The ID of the linked account.
  1012. LinkedAccountId string `json:"linkedAccountId,omitempty"`
  1013. // ForceSendFields is a list of field names (e.g. "Action") to
  1014. // unconditionally include in API requests. By default, fields with
  1015. // empty values are omitted from API requests. However, any non-pointer,
  1016. // non-interface field appearing in ForceSendFields will be sent to the
  1017. // server regardless of whether the field is empty or not. This may be
  1018. // used to include empty fields in Patch requests.
  1019. ForceSendFields []string `json:"-"`
  1020. // NullFields is a list of field names (e.g. "Action") to include in API
  1021. // requests with the JSON null value. By default, fields with empty
  1022. // values are omitted from API requests. However, any field with an
  1023. // empty value appearing in NullFields will be sent to the server as
  1024. // null. It is an error if a field in this list has a non-empty value.
  1025. // This may be used to include null fields in Patch requests.
  1026. NullFields []string `json:"-"`
  1027. }
  1028. func (s *AccountsCustomBatchRequestEntryLinkRequest) MarshalJSON() ([]byte, error) {
  1029. type NoMethod AccountsCustomBatchRequestEntryLinkRequest
  1030. raw := NoMethod(*s)
  1031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1032. }
  1033. type AccountsCustomBatchResponse struct {
  1034. // Entries: The result of the execution of the batch requests.
  1035. Entries []*AccountsCustomBatchResponseEntry `json:"entries,omitempty"`
  1036. // Kind: Identifies what kind of resource this is. Value: the fixed
  1037. // string "content#accountsCustomBatchResponse".
  1038. Kind string `json:"kind,omitempty"`
  1039. // ServerResponse contains the HTTP response code and headers from the
  1040. // server.
  1041. googleapi.ServerResponse `json:"-"`
  1042. // ForceSendFields is a list of field names (e.g. "Entries") to
  1043. // unconditionally include in API requests. By default, fields with
  1044. // empty values are omitted from API requests. However, any non-pointer,
  1045. // non-interface field appearing in ForceSendFields will be sent to the
  1046. // server regardless of whether the field is empty or not. This may be
  1047. // used to include empty fields in Patch requests.
  1048. ForceSendFields []string `json:"-"`
  1049. // NullFields is a list of field names (e.g. "Entries") to include in
  1050. // API requests with the JSON null value. By default, fields with empty
  1051. // values are omitted from API requests. However, any field with an
  1052. // empty value appearing in NullFields will be sent to the server as
  1053. // null. It is an error if a field in this list has a non-empty value.
  1054. // This may be used to include null fields in Patch requests.
  1055. NullFields []string `json:"-"`
  1056. }
  1057. func (s *AccountsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1058. type NoMethod AccountsCustomBatchResponse
  1059. raw := NoMethod(*s)
  1060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1061. }
  1062. // AccountsCustomBatchResponseEntry: A batch entry encoding a single
  1063. // non-batch accounts response.
  1064. type AccountsCustomBatchResponseEntry struct {
  1065. // Account: The retrieved, created, or updated account. Not defined if
  1066. // the method was delete, claimwebsite or link.
  1067. Account *Account `json:"account,omitempty"`
  1068. // BatchId: The ID of the request entry this entry responds to.
  1069. BatchId int64 `json:"batchId,omitempty"`
  1070. // Errors: A list of errors defined if and only if the request failed.
  1071. Errors *Errors `json:"errors,omitempty"`
  1072. // Kind: Identifies what kind of resource this is. Value: the fixed
  1073. // string "content#accountsCustomBatchResponseEntry".
  1074. Kind string `json:"kind,omitempty"`
  1075. // LinkStatus: Deprecated. This field is never set.
  1076. LinkStatus string `json:"linkStatus,omitempty"`
  1077. // ForceSendFields is a list of field names (e.g. "Account") 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. "Account") 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 *AccountsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1093. type NoMethod AccountsCustomBatchResponseEntry
  1094. raw := NoMethod(*s)
  1095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1096. }
  1097. type AccountsLinkRequest struct {
  1098. // Action: Action to perform for this link. The "request" action is only
  1099. // available to select merchants.
  1100. Action string `json:"action,omitempty"`
  1101. // LinkType: Type of the link between the two accounts.
  1102. LinkType string `json:"linkType,omitempty"`
  1103. // LinkedAccountId: The ID of the linked account.
  1104. LinkedAccountId string `json:"linkedAccountId,omitempty"`
  1105. // ForceSendFields is a list of field names (e.g. "Action") to
  1106. // unconditionally include in API requests. By default, fields with
  1107. // empty values are omitted from API requests. However, any non-pointer,
  1108. // non-interface field appearing in ForceSendFields will be sent to the
  1109. // server regardless of whether the field is empty or not. This may be
  1110. // used to include empty fields in Patch requests.
  1111. ForceSendFields []string `json:"-"`
  1112. // NullFields is a list of field names (e.g. "Action") to include in API
  1113. // requests with the JSON null value. By default, fields with empty
  1114. // values are omitted from API requests. However, any field with an
  1115. // empty value appearing in NullFields will be sent to the server as
  1116. // null. It is an error if a field in this list has a non-empty value.
  1117. // This may be used to include null fields in Patch requests.
  1118. NullFields []string `json:"-"`
  1119. }
  1120. func (s *AccountsLinkRequest) MarshalJSON() ([]byte, error) {
  1121. type NoMethod AccountsLinkRequest
  1122. raw := NoMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1124. }
  1125. type AccountsLinkResponse struct {
  1126. // Kind: Identifies what kind of resource this is. Value: the fixed
  1127. // string "content#accountsLinkResponse".
  1128. Kind string `json:"kind,omitempty"`
  1129. // ServerResponse contains the HTTP response code and headers from the
  1130. // server.
  1131. googleapi.ServerResponse `json:"-"`
  1132. // ForceSendFields is a list of field names (e.g. "Kind") to
  1133. // unconditionally include in API requests. By default, fields with
  1134. // empty values are omitted from API requests. However, any non-pointer,
  1135. // non-interface field appearing in ForceSendFields will be sent to the
  1136. // server regardless of whether the field is empty or not. This may be
  1137. // used to include empty fields in Patch requests.
  1138. ForceSendFields []string `json:"-"`
  1139. // NullFields is a list of field names (e.g. "Kind") to include in API
  1140. // requests with the JSON null value. By default, fields with empty
  1141. // values are omitted from API requests. However, any field with an
  1142. // empty value appearing in NullFields will be sent to the server as
  1143. // null. It is an error if a field in this list has a non-empty value.
  1144. // This may be used to include null fields in Patch requests.
  1145. NullFields []string `json:"-"`
  1146. }
  1147. func (s *AccountsLinkResponse) MarshalJSON() ([]byte, error) {
  1148. type NoMethod AccountsLinkResponse
  1149. raw := NoMethod(*s)
  1150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1151. }
  1152. type AccountsListResponse struct {
  1153. // Kind: Identifies what kind of resource this is. Value: the fixed
  1154. // string "content#accountsListResponse".
  1155. Kind string `json:"kind,omitempty"`
  1156. // NextPageToken: The token for the retrieval of the next page of
  1157. // accounts.
  1158. NextPageToken string `json:"nextPageToken,omitempty"`
  1159. Resources []*Account `json:"resources,omitempty"`
  1160. // ServerResponse contains the HTTP response code and headers from the
  1161. // server.
  1162. googleapi.ServerResponse `json:"-"`
  1163. // ForceSendFields is a list of field names (e.g. "Kind") to
  1164. // unconditionally include in API requests. By default, fields with
  1165. // empty values are omitted from API requests. However, any non-pointer,
  1166. // non-interface field appearing in ForceSendFields will be sent to the
  1167. // server regardless of whether the field is empty or not. This may be
  1168. // used to include empty fields in Patch requests.
  1169. ForceSendFields []string `json:"-"`
  1170. // NullFields is a list of field names (e.g. "Kind") to include in API
  1171. // requests with the JSON null value. By default, fields with empty
  1172. // values are omitted from API requests. However, any field with an
  1173. // empty value appearing in NullFields will be sent to the server as
  1174. // null. It is an error if a field in this list has a non-empty value.
  1175. // This may be used to include null fields in Patch requests.
  1176. NullFields []string `json:"-"`
  1177. }
  1178. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1179. type NoMethod AccountsListResponse
  1180. raw := NoMethod(*s)
  1181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1182. }
  1183. type AccountstatusesCustomBatchRequest struct {
  1184. // Entries: The request entries to be processed in the batch.
  1185. Entries []*AccountstatusesCustomBatchRequestEntry `json:"entries,omitempty"`
  1186. // ForceSendFields is a list of field names (e.g. "Entries") to
  1187. // unconditionally include in API requests. By default, fields with
  1188. // empty values are omitted from API requests. However, any non-pointer,
  1189. // non-interface field appearing in ForceSendFields will be sent to the
  1190. // server regardless of whether the field is empty or not. This may be
  1191. // used to include empty fields in Patch requests.
  1192. ForceSendFields []string `json:"-"`
  1193. // NullFields is a list of field names (e.g. "Entries") to include in
  1194. // API requests with the JSON null value. By default, fields with empty
  1195. // values are omitted from API requests. However, any field with an
  1196. // empty value appearing in NullFields will be sent to the server as
  1197. // null. It is an error if a field in this list has a non-empty value.
  1198. // This may be used to include null fields in Patch requests.
  1199. NullFields []string `json:"-"`
  1200. }
  1201. func (s *AccountstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1202. type NoMethod AccountstatusesCustomBatchRequest
  1203. raw := NoMethod(*s)
  1204. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1205. }
  1206. // AccountstatusesCustomBatchRequestEntry: A batch entry encoding a
  1207. // single non-batch accountstatuses request.
  1208. type AccountstatusesCustomBatchRequestEntry struct {
  1209. // AccountId: The ID of the (sub-)account whose status to get.
  1210. AccountId uint64 `json:"accountId,omitempty,string"`
  1211. // BatchId: An entry ID, unique within the batch request.
  1212. BatchId int64 `json:"batchId,omitempty"`
  1213. // Destinations: If set, only issues for the specified destinations are
  1214. // returned, otherwise only issues for the Shopping destination.
  1215. Destinations []string `json:"destinations,omitempty"`
  1216. // MerchantId: The ID of the managing account.
  1217. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1218. // Method: The method (get).
  1219. Method string `json:"method,omitempty"`
  1220. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1221. // unconditionally include in API requests. By default, fields with
  1222. // empty values are omitted from API requests. However, any non-pointer,
  1223. // non-interface field appearing in ForceSendFields will be sent to the
  1224. // server regardless of whether the field is empty or not. This may be
  1225. // used to include empty fields in Patch requests.
  1226. ForceSendFields []string `json:"-"`
  1227. // NullFields is a list of field names (e.g. "AccountId") to include in
  1228. // API requests with the JSON null value. By default, fields with empty
  1229. // values are omitted from API requests. However, any field with an
  1230. // empty value appearing in NullFields will be sent to the server as
  1231. // null. It is an error if a field in this list has a non-empty value.
  1232. // This may be used to include null fields in Patch requests.
  1233. NullFields []string `json:"-"`
  1234. }
  1235. func (s *AccountstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1236. type NoMethod AccountstatusesCustomBatchRequestEntry
  1237. raw := NoMethod(*s)
  1238. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1239. }
  1240. type AccountstatusesCustomBatchResponse struct {
  1241. // Entries: The result of the execution of the batch requests.
  1242. Entries []*AccountstatusesCustomBatchResponseEntry `json:"entries,omitempty"`
  1243. // Kind: Identifies what kind of resource this is. Value: the fixed
  1244. // string "content#accountstatusesCustomBatchResponse".
  1245. Kind string `json:"kind,omitempty"`
  1246. // ServerResponse contains the HTTP response code and headers from the
  1247. // server.
  1248. googleapi.ServerResponse `json:"-"`
  1249. // ForceSendFields is a list of field names (e.g. "Entries") to
  1250. // unconditionally include in API requests. By default, fields with
  1251. // empty values are omitted from API requests. However, any non-pointer,
  1252. // non-interface field appearing in ForceSendFields will be sent to the
  1253. // server regardless of whether the field is empty or not. This may be
  1254. // used to include empty fields in Patch requests.
  1255. ForceSendFields []string `json:"-"`
  1256. // NullFields is a list of field names (e.g. "Entries") to include in
  1257. // API requests with the JSON null value. By default, fields with empty
  1258. // values are omitted from API requests. However, any field with an
  1259. // empty value appearing in NullFields will be sent to the server as
  1260. // null. It is an error if a field in this list has a non-empty value.
  1261. // This may be used to include null fields in Patch requests.
  1262. NullFields []string `json:"-"`
  1263. }
  1264. func (s *AccountstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1265. type NoMethod AccountstatusesCustomBatchResponse
  1266. raw := NoMethod(*s)
  1267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1268. }
  1269. // AccountstatusesCustomBatchResponseEntry: A batch entry encoding a
  1270. // single non-batch accountstatuses response.
  1271. type AccountstatusesCustomBatchResponseEntry struct {
  1272. // AccountStatus: The requested account status. Defined if and only if
  1273. // the request was successful.
  1274. AccountStatus *AccountStatus `json:"accountStatus,omitempty"`
  1275. // BatchId: The ID of the request entry this entry responds to.
  1276. BatchId int64 `json:"batchId,omitempty"`
  1277. // Errors: A list of errors defined if and only if the request failed.
  1278. Errors *Errors `json:"errors,omitempty"`
  1279. // ForceSendFields is a list of field names (e.g. "AccountStatus") to
  1280. // unconditionally include in API requests. By default, fields with
  1281. // empty values are omitted from API requests. However, any non-pointer,
  1282. // non-interface field appearing in ForceSendFields will be sent to the
  1283. // server regardless of whether the field is empty or not. This may be
  1284. // used to include empty fields in Patch requests.
  1285. ForceSendFields []string `json:"-"`
  1286. // NullFields is a list of field names (e.g. "AccountStatus") to include
  1287. // in API requests with the JSON null value. By default, fields with
  1288. // empty values are omitted from API requests. However, any field with
  1289. // an empty value appearing in NullFields will be sent to the server as
  1290. // null. It is an error if a field in this list has a non-empty value.
  1291. // This may be used to include null fields in Patch requests.
  1292. NullFields []string `json:"-"`
  1293. }
  1294. func (s *AccountstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1295. type NoMethod AccountstatusesCustomBatchResponseEntry
  1296. raw := NoMethod(*s)
  1297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1298. }
  1299. type AccountstatusesListResponse struct {
  1300. // Kind: Identifies what kind of resource this is. Value: the fixed
  1301. // string "content#accountstatusesListResponse".
  1302. Kind string `json:"kind,omitempty"`
  1303. // NextPageToken: The token for the retrieval of the next page of
  1304. // account statuses.
  1305. NextPageToken string `json:"nextPageToken,omitempty"`
  1306. Resources []*AccountStatus `json:"resources,omitempty"`
  1307. // ServerResponse contains the HTTP response code and headers from the
  1308. // server.
  1309. googleapi.ServerResponse `json:"-"`
  1310. // ForceSendFields is a list of field names (e.g. "Kind") to
  1311. // unconditionally include in API requests. By default, fields with
  1312. // empty values are omitted from API requests. However, any non-pointer,
  1313. // non-interface field appearing in ForceSendFields will be sent to the
  1314. // server regardless of whether the field is empty or not. This may be
  1315. // used to include empty fields in Patch requests.
  1316. ForceSendFields []string `json:"-"`
  1317. // NullFields is a list of field names (e.g. "Kind") to include in API
  1318. // requests with the JSON null value. By default, fields with empty
  1319. // values are omitted from API requests. However, any field with an
  1320. // empty value appearing in NullFields will be sent to the server as
  1321. // null. It is an error if a field in this list has a non-empty value.
  1322. // This may be used to include null fields in Patch requests.
  1323. NullFields []string `json:"-"`
  1324. }
  1325. func (s *AccountstatusesListResponse) MarshalJSON() ([]byte, error) {
  1326. type NoMethod AccountstatusesListResponse
  1327. raw := NoMethod(*s)
  1328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1329. }
  1330. type AccounttaxCustomBatchRequest struct {
  1331. // Entries: The request entries to be processed in the batch.
  1332. Entries []*AccounttaxCustomBatchRequestEntry `json:"entries,omitempty"`
  1333. // ForceSendFields is a list of field names (e.g. "Entries") to
  1334. // unconditionally include in API requests. By default, fields with
  1335. // empty values are omitted from API requests. However, any non-pointer,
  1336. // non-interface field appearing in ForceSendFields will be sent to the
  1337. // server regardless of whether the field is empty or not. This may be
  1338. // used to include empty fields in Patch requests.
  1339. ForceSendFields []string `json:"-"`
  1340. // NullFields is a list of field names (e.g. "Entries") to include in
  1341. // API requests with the JSON null value. By default, fields with empty
  1342. // values are omitted from API requests. However, any field with an
  1343. // empty value appearing in NullFields will be sent to the server as
  1344. // null. It is an error if a field in this list has a non-empty value.
  1345. // This may be used to include null fields in Patch requests.
  1346. NullFields []string `json:"-"`
  1347. }
  1348. func (s *AccounttaxCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1349. type NoMethod AccounttaxCustomBatchRequest
  1350. raw := NoMethod(*s)
  1351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1352. }
  1353. // AccounttaxCustomBatchRequestEntry: A batch entry encoding a single
  1354. // non-batch accounttax request.
  1355. type AccounttaxCustomBatchRequestEntry struct {
  1356. // AccountId: The ID of the account for which to get/update account tax
  1357. // settings.
  1358. AccountId uint64 `json:"accountId,omitempty,string"`
  1359. // AccountTax: The account tax settings to update. Only defined if the
  1360. // method is update.
  1361. AccountTax *AccountTax `json:"accountTax,omitempty"`
  1362. // BatchId: An entry ID, unique within the batch request.
  1363. BatchId int64 `json:"batchId,omitempty"`
  1364. // MerchantId: The ID of the managing account.
  1365. MerchantId uint64 `json:"merchantId,omitempty,string"`
  1366. Method string `json:"method,omitempty"`
  1367. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1368. // unconditionally include in API requests. By default, fields with
  1369. // empty values are omitted from API requests. However, any non-pointer,
  1370. // non-interface field appearing in ForceSendFields will be sent to the
  1371. // server regardless of whether the field is empty or not. This may be
  1372. // used to include empty fields in Patch requests.
  1373. ForceSendFields []string `json:"-"`
  1374. // NullFields is a list of field names (e.g. "AccountId") to include in
  1375. // API requests with the JSON null value. By default, fields with empty
  1376. // values are omitted from API requests. However, any field with an
  1377. // empty value appearing in NullFields will be sent to the server as
  1378. // null. It is an error if a field in this list has a non-empty value.
  1379. // This may be used to include null fields in Patch requests.
  1380. NullFields []string `json:"-"`
  1381. }
  1382. func (s *AccounttaxCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  1383. type NoMethod AccounttaxCustomBatchRequestEntry
  1384. raw := NoMethod(*s)
  1385. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1386. }
  1387. type AccounttaxCustomBatchResponse struct {
  1388. // Entries: The result of the execution of the batch requests.
  1389. Entries []*AccounttaxCustomBatchResponseEntry `json:"entries,omitempty"`
  1390. // Kind: Identifies what kind of resource this is. Value: the fixed
  1391. // string "content#accounttaxCustomBatchResponse".
  1392. Kind string `json:"kind,omitempty"`
  1393. // ServerResponse contains the HTTP response code and headers from the
  1394. // server.
  1395. googleapi.ServerResponse `json:"-"`
  1396. // ForceSendFields is a list of field names (e.g. "Entries") to
  1397. // unconditionally include in API requests. By default, fields with
  1398. // empty values are omitted from API requests. However, any non-pointer,
  1399. // non-interface field appearing in ForceSendFields will be sent to the
  1400. // server regardless of whether the field is empty or not. This may be
  1401. // used to include empty fields in Patch requests.
  1402. ForceSendFields []string `json:"-"`
  1403. // NullFields is a list of field names (e.g. "Entries") to include in
  1404. // API requests with the JSON null value. By default, fields with empty
  1405. // values are omitted from API requests. However, any field with an
  1406. // empty value appearing in NullFields will be sent to the server as
  1407. // null. It is an error if a field in this list has a non-empty value.
  1408. // This may be used to include null fields in Patch requests.
  1409. NullFields []string `json:"-"`
  1410. }
  1411. func (s *AccounttaxCustomBatchResponse) MarshalJSON() ([]byte, error) {
  1412. type NoMethod AccounttaxCustomBatchResponse
  1413. raw := NoMethod(*s)
  1414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1415. }
  1416. // AccounttaxCustomBatchResponseEntry: A batch entry encoding a single
  1417. // non-batch accounttax response.
  1418. type AccounttaxCustomBatchResponseEntry struct {
  1419. // AccountTax: The retrieved or updated account tax settings.
  1420. AccountTax *AccountTax `json:"accountTax,omitempty"`
  1421. // BatchId: The ID of the request entry this entry responds to.
  1422. BatchId int64 `json:"batchId,omitempty"`
  1423. // Errors: A list of errors defined if and only if the request failed.
  1424. Errors *Errors `json:"errors,omitempty"`
  1425. // Kind: Identifies what kind of resource this is. Value: the fixed
  1426. // string "content#accounttaxCustomBatchResponseEntry".
  1427. Kind string `json:"kind,omitempty"`
  1428. // ForceSendFields is a list of field names (e.g. "AccountTax") to
  1429. // unconditionally include in API requests. By default, fields with
  1430. // empty values are omitted from API requests. However, any non-pointer,
  1431. // non-interface field appearing in ForceSendFields will be sent to the
  1432. // server regardless of whether the field is empty or not. This may be
  1433. // used to include empty fields in Patch requests.
  1434. ForceSendFields []string `json:"-"`
  1435. // NullFields is a list of field names (e.g. "AccountTax") to include in
  1436. // API requests with the JSON null value. By default, fields with empty
  1437. // values are omitted from API requests. However, any field with an
  1438. // empty value appearing in NullFields will be sent to the server as
  1439. // null. It is an error if a field in this list has a non-empty value.
  1440. // This may be used to include null fields in Patch requests.
  1441. NullFields []string `json:"-"`
  1442. }
  1443. func (s *AccounttaxCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1444. type NoMethod AccounttaxCustomBatchResponseEntry
  1445. raw := NoMethod(*s)
  1446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1447. }
  1448. type AccounttaxListResponse struct {
  1449. // Kind: Identifies what kind of resource this is. Value: the fixed
  1450. // string "content#accounttaxListResponse".
  1451. Kind string `json:"kind,omitempty"`
  1452. // NextPageToken: The token for the retrieval of the next page of
  1453. // account tax settings.
  1454. NextPageToken string `json:"nextPageToken,omitempty"`
  1455. Resources []*AccountTax `json:"resources,omitempty"`
  1456. // ServerResponse contains the HTTP response code and headers from the
  1457. // server.
  1458. googleapi.ServerResponse `json:"-"`
  1459. // ForceSendFields is a list of field names (e.g. "Kind") to
  1460. // unconditionally include in API requests. By default, fields with
  1461. // empty values are omitted from API requests. However, any non-pointer,
  1462. // non-interface field appearing in ForceSendFields will be sent to the
  1463. // server regardless of whether the field is empty or not. This may be
  1464. // used to include empty fields in Patch requests.
  1465. ForceSendFields []string `json:"-"`
  1466. // NullFields is a list of field names (e.g. "Kind") to include in API
  1467. // requests with the JSON null value. By default, fields with empty
  1468. // values are omitted from API requests. However, any field with an
  1469. // empty value appearing in NullFields will be sent to the server as
  1470. // null. It is an error if a field in this list has a non-empty value.
  1471. // This may be used to include null fields in Patch requests.
  1472. NullFields []string `json:"-"`
  1473. }
  1474. func (s *AccounttaxListResponse) MarshalJSON() ([]byte, error) {
  1475. type NoMethod AccounttaxListResponse
  1476. raw := NoMethod(*s)
  1477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1478. }
  1479. type Amount struct {
  1480. // Pretax: [required] Value before taxes.
  1481. Pretax *Price `json:"pretax,omitempty"`
  1482. // Tax: [required] Tax value.
  1483. Tax *Price `json:"tax,omitempty"`
  1484. // ForceSendFields is a list of field names (e.g. "Pretax") to
  1485. // unconditionally include in API requests. By default, fields with
  1486. // empty values are omitted from API requests. However, any non-pointer,
  1487. // non-interface field appearing in ForceSendFields will be sent to the
  1488. // server regardless of whether the field is empty or not. This may be
  1489. // used to include empty fields in Patch requests.
  1490. ForceSendFields []string `json:"-"`
  1491. // NullFields is a list of field names (e.g. "Pretax") to include in API
  1492. // requests with the JSON null value. By default, fields with empty
  1493. // values are omitted from API requests. However, any field with an
  1494. // empty value appearing in NullFields will be sent to the server as
  1495. // null. It is an error if a field in this list has a non-empty value.
  1496. // This may be used to include null fields in Patch requests.
  1497. NullFields []string `json:"-"`
  1498. }
  1499. func (s *Amount) MarshalJSON() ([]byte, error) {
  1500. type NoMethod Amount
  1501. raw := NoMethod(*s)
  1502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1503. }
  1504. type CarrierRate struct {
  1505. // CarrierName: Carrier service, such as "UPS" or "Fedex". The list of
  1506. // supported carriers can be retrieved via the getSupportedCarriers
  1507. // method. Required.
  1508. CarrierName string `json:"carrierName,omitempty"`
  1509. // CarrierService: Carrier service, such as "ground" or "2 days". The
  1510. // list of supported services for a carrier can be retrieved via the
  1511. // getSupportedCarriers method. Required.
  1512. CarrierService string `json:"carrierService,omitempty"`
  1513. // FlatAdjustment: Additive shipping rate modifier. Can be negative. For
  1514. // example { "value": "1", "currency" : "USD" } adds $1 to the rate, {
  1515. // "value": "-3", "currency" : "USD" } removes $3 from the rate.
  1516. // Optional.
  1517. FlatAdjustment *Price `json:"flatAdjustment,omitempty"`
  1518. // Name: Name of the carrier rate. Must be unique per rate group.
  1519. // Required.
  1520. Name string `json:"name,omitempty"`
  1521. // OriginPostalCode: Shipping origin for this carrier rate. Required.
  1522. OriginPostalCode string `json:"originPostalCode,omitempty"`
  1523. // PercentageAdjustment: Multiplicative shipping rate modifier as a
  1524. // number in decimal notation. Can be negative. For example "5.4"
  1525. // increases the rate by 5.4%, "-3" decreases the rate by 3%. Optional.
  1526. PercentageAdjustment string `json:"percentageAdjustment,omitempty"`
  1527. // ForceSendFields is a list of field names (e.g. "CarrierName") to
  1528. // unconditionally include in API requests. By default, fields with
  1529. // empty values are omitted from API requests. However, any non-pointer,
  1530. // non-interface field appearing in ForceSendFields will be sent to the
  1531. // server regardless of whether the field is empty or not. This may be
  1532. // used to include empty fields in Patch requests.
  1533. ForceSendFields []string `json:"-"`
  1534. // NullFields is a list of field names (e.g. "CarrierName") to include
  1535. // in API requests with the JSON null value. By default, fields with
  1536. // empty values are omitted from API requests. However, any field with
  1537. // an empty value appearing in NullFields will be sent to the server as
  1538. // null. It is an error if a field in this list has a non-empty value.
  1539. // This may be used to include null fields in Patch requests.
  1540. NullFields []string `json:"-"`
  1541. }
  1542. func (s *CarrierRate) MarshalJSON() ([]byte, error) {
  1543. type NoMethod CarrierRate
  1544. raw := NoMethod(*s)
  1545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1546. }
  1547. type CarriersCarrier struct {
  1548. // Country: The CLDR country code of the carrier (e.g., "US"). Always
  1549. // present.
  1550. Country string `json:"country,omitempty"`
  1551. // Name: The name of the carrier (e.g., "UPS"). Always present.
  1552. Name string `json:"name,omitempty"`
  1553. // Services: A list of supported services (e.g., "ground") for that
  1554. // carrier. Contains at least one service.
  1555. Services []string `json:"services,omitempty"`
  1556. // ForceSendFields is a list of field names (e.g. "Country") to
  1557. // unconditionally include in API requests. By default, fields with
  1558. // empty values are omitted from API requests. However, any non-pointer,
  1559. // non-interface field appearing in ForceSendFields will be sent to the
  1560. // server regardless of whether the field is empty or not. This may be
  1561. // used to include empty fields in Patch requests.
  1562. ForceSendFields []string `json:"-"`
  1563. // NullFields is a list of field names (e.g. "Country") to include in
  1564. // API requests with the JSON null value. By default, fields with empty
  1565. // values are omitted from API requests. However, any field with an
  1566. // empty value appearing in NullFields will be sent to the server as
  1567. // null. It is an error if a field in this list has a non-empty value.
  1568. // This may be used to include null fields in Patch requests.
  1569. NullFields []string `json:"-"`
  1570. }
  1571. func (s *CarriersCarrier) MarshalJSON() ([]byte, error) {
  1572. type NoMethod CarriersCarrier
  1573. raw := NoMethod(*s)
  1574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1575. }
  1576. type CustomAttribute struct {
  1577. // Name: The name of the attribute. Underscores will be replaced by
  1578. // spaces upon insertion.
  1579. Name string `json:"name,omitempty"`
  1580. // Type: The type of the attribute.
  1581. Type string `json:"type,omitempty"`
  1582. // Unit: Free-form unit of the attribute. Unit can only be used for
  1583. // values of type int, float, or price.
  1584. Unit string `json:"unit,omitempty"`
  1585. // Value: The value of the attribute.
  1586. Value string `json:"value,omitempty"`
  1587. // ForceSendFields is a list of field names (e.g. "Name") to
  1588. // unconditionally include in API requests. By default, fields with
  1589. // empty values are omitted from API requests. However, any non-pointer,
  1590. // non-interface field appearing in ForceSendFields will be sent to the
  1591. // server regardless of whether the field is empty or not. This may be
  1592. // used to include empty fields in Patch requests.
  1593. ForceSendFields []string `json:"-"`
  1594. // NullFields is a list of field names (e.g. "Name") to include in API
  1595. // requests with the JSON null value. By default, fields with empty
  1596. // values are omitted from API requests. However, any field with an
  1597. // empty value appearing in NullFields will be sent to the server as
  1598. // null. It is an error if a field in this list has a non-empty value.
  1599. // This may be used to include null fields in Patch requests.
  1600. NullFields []string `json:"-"`
  1601. }
  1602. func (s *CustomAttribute) MarshalJSON() ([]byte, error) {
  1603. type NoMethod CustomAttribute
  1604. raw := NoMethod(*s)
  1605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1606. }
  1607. type CustomGroup struct {
  1608. // Attributes: The sub-attributes.
  1609. Attributes []*CustomAttribute `json:"attributes,omitempty"`
  1610. // Name: The name of the group. Underscores will be replaced by spaces
  1611. // upon insertion.
  1612. Name string `json:"name,omitempty"`
  1613. // ForceSendFields is a list of field names (e.g. "Attributes") to
  1614. // unconditionally include in API requests. By default, fields with
  1615. // empty values are omitted from API requests. However, any non-pointer,
  1616. // non-interface field appearing in ForceSendFields will be sent to the
  1617. // server regardless of whether the field is empty or not. This may be
  1618. // used to include empty fields in Patch requests.
  1619. ForceSendFields []string `json:"-"`
  1620. // NullFields is a list of field names (e.g. "Attributes") to include in
  1621. // API requests with the JSON null value. By default, fields with empty
  1622. // values are omitted from API requests. However, any field with an
  1623. // empty value appearing in NullFields will be sent to the server as
  1624. // null. It is an error if a field in this list has a non-empty value.
  1625. // This may be used to include null fields in Patch requests.
  1626. NullFields []string `json:"-"`
  1627. }
  1628. func (s *CustomGroup) MarshalJSON() ([]byte, error) {
  1629. type NoMethod CustomGroup
  1630. raw := NoMethod(*s)
  1631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1632. }
  1633. type CustomerReturnReason struct {
  1634. Description string `json:"description,omitempty"`
  1635. ReasonCode string `json:"reasonCode,omitempty"`
  1636. // ForceSendFields is a list of field names (e.g. "Description") to
  1637. // unconditionally include in API requests. By default, fields with
  1638. // empty values are omitted from API requests. However, any non-pointer,
  1639. // non-interface field appearing in ForceSendFields will be sent to the
  1640. // server regardless of whether the field is empty or not. This may be
  1641. // used to include empty fields in Patch requests.
  1642. ForceSendFields []string `json:"-"`
  1643. // NullFields is a list of field names (e.g. "Description") to include
  1644. // in API requests with the JSON null value. By default, fields with
  1645. // empty values are omitted from API requests. However, any field with
  1646. // an empty value appearing in NullFields will be sent to the server as
  1647. // null. It is an error if a field in this list has a non-empty value.
  1648. // This may be used to include null fields in Patch requests.
  1649. NullFields []string `json:"-"`
  1650. }
  1651. func (s *CustomerReturnReason) MarshalJSON() ([]byte, error) {
  1652. type NoMethod CustomerReturnReason
  1653. raw := NoMethod(*s)
  1654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1655. }
  1656. type CutoffTime struct {
  1657. // Hour: Hour of the cutoff time until which an order has to be placed
  1658. // to be processed in the same day. Required.
  1659. Hour int64 `json:"hour,omitempty"`
  1660. // Minute: Minute of the cutoff time until which an order has to be
  1661. // placed to be processed in the same day. Required.
  1662. Minute int64 `json:"minute,omitempty"`
  1663. // Timezone: Timezone identifier for the cutoff time. A list of
  1664. // identifiers can be found in the AdWords API documentation. E.g.
  1665. // "Europe/Zurich". Required.
  1666. Timezone string `json:"timezone,omitempty"`
  1667. // ForceSendFields is a list of field names (e.g. "Hour") to
  1668. // unconditionally include in API requests. By default, fields with
  1669. // empty values are omitted from API requests. However, any non-pointer,
  1670. // non-interface field appearing in ForceSendFields will be sent to the
  1671. // server regardless of whether the field is empty or not. This may be
  1672. // used to include empty fields in Patch requests.
  1673. ForceSendFields []string `json:"-"`
  1674. // NullFields is a list of field names (e.g. "Hour") to include in API
  1675. // requests with the JSON null value. By default, fields with empty
  1676. // values are omitted from API requests. However, any field with an
  1677. // empty value appearing in NullFields will be sent to the server as
  1678. // null. It is an error if a field in this list has a non-empty value.
  1679. // This may be used to include null fields in Patch requests.
  1680. NullFields []string `json:"-"`
  1681. }
  1682. func (s *CutoffTime) MarshalJSON() ([]byte, error) {
  1683. type NoMethod CutoffTime
  1684. raw := NoMethod(*s)
  1685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1686. }
  1687. // Datafeed: Datafeed configuration data.
  1688. type Datafeed struct {
  1689. // AttributeLanguage: The two-letter ISO 639-1 language in which the
  1690. // attributes are defined in the data feed.
  1691. AttributeLanguage string `json:"attributeLanguage,omitempty"`
  1692. // ContentLanguage: [DEPRECATED] Please use targets[].language instead.
  1693. // The two-letter ISO 639-1 language of the items in the feed. Must be a
  1694. // valid language for targetCountry.
  1695. ContentLanguage string `json:"contentLanguage,omitempty"`
  1696. // ContentType: The type of data feed. For product inventory feeds, only
  1697. // feeds for local stores, not online stores, are supported.
  1698. ContentType string `json:"contentType,omitempty"`
  1699. // FetchSchedule: Fetch schedule for the feed file.
  1700. FetchSchedule *DatafeedFetchSchedule `json:"fetchSchedule,omitempty"`
  1701. // FileName: The filename of the feed. All feeds must have a unique file
  1702. // name.
  1703. FileName string `json:"fileName,omitempty"`
  1704. // Format: Format of the feed file.
  1705. Format *DatafeedFormat `json:"format,omitempty"`
  1706. // Id: The ID of the data feed.
  1707. Id int64 `json:"id,omitempty,string"`
  1708. // IntendedDestinations: [DEPRECATED] Please use
  1709. // targets[].includedDestinations instead. The list of intended
  1710. // destinations (corresponds to checked check boxes in Merchant Center).
  1711. IntendedDestinations []string `json:"intendedDestinations,omitempty"`
  1712. // Kind: Identifies what kind of resource this is. Value: the fixed
  1713. // string "content#datafeed".
  1714. Kind string `json:"kind,omitempty"`
  1715. // Name: A descriptive name of the data feed.
  1716. Name string `json:"name,omitempty"`
  1717. // TargetCountry: [DEPRECATED] Please use targets[].country instead. The
  1718. // country where the items in the feed will be included in the search
  1719. // index, represented as a CLDR territory code.
  1720. TargetCountry string `json:"targetCountry,omitempty"`
  1721. // Targets: The targets this feed should apply to (country, language,
  1722. // destinations).
  1723. Targets []*DatafeedTarget `json:"targets,omitempty"`
  1724. // ServerResponse contains the HTTP response code and headers from the
  1725. // server.
  1726. googleapi.ServerResponse `json:"-"`
  1727. // ForceSendFields is a list of field names (e.g. "AttributeLanguage")
  1728. // to unconditionally include in API requests. By default, fields with
  1729. // empty values are omitted from API requests. However, any non-pointer,
  1730. // non-interface field appearing in ForceSendFields will be sent to the
  1731. // server regardless of whether the field is empty or not. This may be
  1732. // used to include empty fields in Patch requests.
  1733. ForceSendFields []string `json:"-"`
  1734. // NullFields is a list of field names (e.g. "AttributeLanguage") to
  1735. // include in API requests with the JSON null value. By default, fields
  1736. // with empty values are omitted from API requests. However, any field
  1737. // with an empty value appearing in NullFields will be sent to the
  1738. // server as null. It is an error if a field in this list has a
  1739. // non-empty value. This may be used to include null fields in Patch
  1740. // requests.
  1741. NullFields []string `json:"-"`
  1742. }
  1743. func (s *Datafeed) MarshalJSON() ([]byte, error) {
  1744. type NoMethod Datafeed
  1745. raw := NoMethod(*s)
  1746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1747. }
  1748. // DatafeedFetchSchedule: The required fields vary based on the
  1749. // frequency of fetching. For a monthly fetch schedule, day_of_month and
  1750. // hour are required. For a weekly fetch schedule, weekday and hour are
  1751. // required. For a daily fetch schedule, only hour is required.
  1752. type DatafeedFetchSchedule struct {
  1753. // DayOfMonth: The day of the month the feed file should be fetched
  1754. // (1-31).
  1755. DayOfMonth int64 `json:"dayOfMonth,omitempty"`
  1756. // FetchUrl: The URL where the feed file can be fetched. Google Merchant
  1757. // Center will support automatic scheduled uploads using the HTTP,
  1758. // HTTPS, FTP, or SFTP protocols, so the value will need to be a valid
  1759. // link using one of those four protocols.
  1760. FetchUrl string `json:"fetchUrl,omitempty"`
  1761. // Hour: The hour of the day the feed file should be fetched (0-23).
  1762. Hour int64 `json:"hour,omitempty"`
  1763. // MinuteOfHour: The minute of the hour the feed file should be fetched
  1764. // (0-59). Read-only.
  1765. MinuteOfHour int64 `json:"minuteOfHour,omitempty"`
  1766. // Password: An optional password for fetch_url.
  1767. Password string `json:"password,omitempty"`
  1768. // Paused: Whether the scheduled fetch is paused or not.
  1769. Paused bool `json:"paused,omitempty"`
  1770. // TimeZone: Time zone used for schedule. UTC by default. E.g.,
  1771. // "America/Los_Angeles".
  1772. TimeZone string `json:"timeZone,omitempty"`
  1773. // Username: An optional user name for fetch_url.
  1774. Username string `json:"username,omitempty"`
  1775. // Weekday: The day of the week the feed file should be fetched.
  1776. Weekday string `json:"weekday,omitempty"`
  1777. // ForceSendFields is a list of field names (e.g. "DayOfMonth") to
  1778. // unconditionally include in API requests. By default, fields with
  1779. // empty values are omitted from API requests. However, any non-pointer,
  1780. // non-interface field appearing in ForceSendFields will be sent to the
  1781. // server regardless of whether the field is empty or not. This may be
  1782. // used to include empty fields in Patch requests.
  1783. ForceSendFields []string `json:"-"`
  1784. // NullFields is a list of field names (e.g. "DayOfMonth") to include in
  1785. // API requests with the JSON null value. By default, fields with empty
  1786. // values are omitted from API requests. However, any field with an
  1787. // empty value appearing in NullFields will be sent to the server as
  1788. // null. It is an error if a field in this list has a non-empty value.
  1789. // This may be used to include null fields in Patch requests.
  1790. NullFields []string `json:"-"`
  1791. }
  1792. func (s *DatafeedFetchSchedule) MarshalJSON() ([]byte, error) {
  1793. type NoMethod DatafeedFetchSchedule
  1794. raw := NoMethod(*s)
  1795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1796. }
  1797. type DatafeedFormat struct {
  1798. // ColumnDelimiter: Delimiter for the separation of values in a
  1799. // delimiter-separated values feed. If not specified, the delimiter will
  1800. // be auto-detected. Ignored for non-DSV data feeds.
  1801. ColumnDelimiter string `json:"columnDelimiter,omitempty"`
  1802. // FileEncoding: Character encoding scheme of the data feed. If not
  1803. // specified, the encoding will be auto-detected.
  1804. FileEncoding string `json:"fileEncoding,omitempty"`
  1805. // QuotingMode: Specifies how double quotes are interpreted. If not
  1806. // specified, the mode will be auto-detected. Ignored for non-DSV data
  1807. // feeds.
  1808. QuotingMode string `json:"quotingMode,omitempty"`
  1809. // ForceSendFields is a list of field names (e.g. "ColumnDelimiter") 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. "ColumnDelimiter") to
  1817. // include in API requests with the JSON null value. By default, fields
  1818. // with empty values are omitted from API requests. However, any field
  1819. // with an empty value appearing in NullFields will be sent to the
  1820. // server as null. It is an error if a field in this list has a
  1821. // non-empty value. This may be used to include null fields in Patch
  1822. // requests.
  1823. NullFields []string `json:"-"`
  1824. }
  1825. func (s *DatafeedFormat) MarshalJSON() ([]byte, error) {
  1826. type NoMethod DatafeedFormat
  1827. raw := NoMethod(*s)
  1828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1829. }
  1830. // DatafeedStatus: The status of a datafeed, i.e., the result of the
  1831. // last retrieval of the datafeed computed asynchronously when the feed
  1832. // processing is finished.
  1833. type DatafeedStatus struct {
  1834. // Country: The country for which the status is reported, represented as
  1835. // a CLDR territory code.
  1836. Country string `json:"country,omitempty"`
  1837. // DatafeedId: The ID of the feed for which the status is reported.
  1838. DatafeedId uint64 `json:"datafeedId,omitempty,string"`
  1839. // Errors: The list of errors occurring in the feed.
  1840. Errors []*DatafeedStatusError `json:"errors,omitempty"`
  1841. // ItemsTotal: The number of items in the feed that were processed.
  1842. ItemsTotal uint64 `json:"itemsTotal,omitempty,string"`
  1843. // ItemsValid: The number of items in the feed that were valid.
  1844. ItemsValid uint64 `json:"itemsValid,omitempty,string"`
  1845. // Kind: Identifies what kind of resource this is. Value: the fixed
  1846. // string "content#datafeedStatus".
  1847. Kind string `json:"kind,omitempty"`
  1848. // Language: The two-letter ISO 639-1 language for which the status is
  1849. // reported.
  1850. Language string `json:"language,omitempty"`
  1851. // LastUploadDate: The last date at which the feed was uploaded.
  1852. LastUploadDate string `json:"lastUploadDate,omitempty"`
  1853. // ProcessingStatus: The processing status of the feed.
  1854. ProcessingStatus string `json:"processingStatus,omitempty"`
  1855. // Warnings: The list of errors occurring in the feed.
  1856. Warnings []*DatafeedStatusError `json:"warnings,omitempty"`
  1857. // ServerResponse contains the HTTP response code and headers from the
  1858. // server.
  1859. googleapi.ServerResponse `json:"-"`
  1860. // ForceSendFields is a list of field names (e.g. "Country") to
  1861. // unconditionally include in API requests. By default, fields with
  1862. // empty values are omitted from API requests. However, any non-pointer,
  1863. // non-interface field appearing in ForceSendFields will be sent to the
  1864. // server regardless of whether the field is empty or not. This may be
  1865. // used to include empty fields in Patch requests.
  1866. ForceSendFields []string `json:"-"`
  1867. // NullFields is a list of field names (e.g. "Country") to include in
  1868. // API requests with the JSON null value. By default, fields with empty
  1869. // values are omitted from API requests. However, any field with an
  1870. // empty value appearing in NullFields will be sent to the server as
  1871. // null. It is an error if a field in this list has a non-empty value.
  1872. // This may be used to include null fields in Patch requests.
  1873. NullFields []string `json:"-"`
  1874. }
  1875. func (s *DatafeedStatus) MarshalJSON() ([]byte, error) {
  1876. type NoMethod DatafeedStatus
  1877. raw := NoMethod(*s)
  1878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1879. }
  1880. // DatafeedStatusError: An error occurring in the feed, like "invalid
  1881. // price".
  1882. type DatafeedStatusError struct {
  1883. // Code: The code of the error, e.g., "validation/invalid_value".
  1884. Code string `json:"code,omitempty"`
  1885. // Count: The number of occurrences of the error in the feed.
  1886. Count uint64 `json:"count,omitempty,string"`
  1887. // Examples: A list of example occurrences of the error, grouped by
  1888. // product.
  1889. Examples []*DatafeedStatusExample `json:"examples,omitempty"`
  1890. // Message: The error message, e.g., "Invalid price".
  1891. Message string `json:"message,omitempty"`
  1892. // ForceSendFields is a list of field names (e.g. "Code") to
  1893. // unconditionally include in API requests. By default, fields with
  1894. // empty values are omitted from API requests. However, any non-pointer,
  1895. // non-interface field appearing in ForceSendFields will be sent to the
  1896. // server regardless of whether the field is empty or not. This may be
  1897. // used to include empty fields in Patch requests.
  1898. ForceSendFields []string `json:"-"`
  1899. // NullFields is a list of field names (e.g. "Code") to include in API
  1900. // requests with the JSON null value. By default, fields with empty
  1901. // values are omitted from API requests. However, any field with an
  1902. // empty value appearing in NullFields will be sent to the server as
  1903. // null. It is an error if a field in this list has a non-empty value.
  1904. // This may be used to include null fields in Patch requests.
  1905. NullFields []string `json:"-"`
  1906. }
  1907. func (s *DatafeedStatusError) MarshalJSON() ([]byte, error) {
  1908. type NoMethod DatafeedStatusError
  1909. raw := NoMethod(*s)
  1910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1911. }
  1912. // DatafeedStatusExample: An example occurrence for a particular error.
  1913. type DatafeedStatusExample struct {
  1914. // ItemId: The ID of the example item.
  1915. ItemId string `json:"itemId,omitempty"`
  1916. // LineNumber: Line number in the data feed where the example is found.
  1917. LineNumber uint64 `json:"lineNumber,omitempty,string"`
  1918. // Value: The problematic value.
  1919. Value string `json:"value,omitempty"`
  1920. // ForceSendFields is a list of field names (e.g. "ItemId") to
  1921. // unconditionally include in API requests. By default, fields with
  1922. // empty values are omitted from API requests. However, any non-pointer,
  1923. // non-interface field appearing in ForceSendFields will be sent to the
  1924. // server regardless of whether the field is empty or not. This may be
  1925. // used to include empty fields in Patch requests.
  1926. ForceSendFields []string `json:"-"`
  1927. // NullFields is a list of field names (e.g. "ItemId") to include in API
  1928. // requests with the JSON null value. By default, fields with empty
  1929. // values are omitted from API requests. However, any field with an
  1930. // empty value appearing in NullFields will be sent to the server as
  1931. // null. It is an error if a field in this list has a non-empty value.
  1932. // This may be used to include null fields in Patch requests.
  1933. NullFields []string `json:"-"`
  1934. }
  1935. func (s *DatafeedStatusExample) MarshalJSON() ([]byte, error) {
  1936. type NoMethod DatafeedStatusExample
  1937. raw := NoMethod(*s)
  1938. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1939. }
  1940. type DatafeedTarget struct {
  1941. // Country: The country where the items in the feed will be included in
  1942. // the search index, represented as a CLDR territory code.
  1943. Country string `json:"country,omitempty"`
  1944. // ExcludedDestinations: The list of destinations to exclude for this
  1945. // target (corresponds to unchecked check boxes in Merchant Center).
  1946. ExcludedDestinations []string `json:"excludedDestinations,omitempty"`
  1947. // IncludedDestinations: The list of destinations to include for this
  1948. // target (corresponds to checked check boxes in Merchant Center).
  1949. // Default destinations are always included unless provided in the
  1950. // excluded_destination field.
  1951. IncludedDestinations []string `json:"includedDestinations,omitempty"`
  1952. // Language: The two-letter ISO 639-1 language of the items in the feed.
  1953. // Must be a valid language for targets[].country.
  1954. Language string `json:"language,omitempty"`
  1955. // ForceSendFields is a list of field names (e.g. "Country") to
  1956. // unconditionally include in API requests. By default, fields with
  1957. // empty values are omitted from API requests. However, any non-pointer,
  1958. // non-interface field appearing in ForceSendFields will be sent to the
  1959. // server regardless of whether the field is empty or not. This may be
  1960. // used to include empty fields in Patch requests.
  1961. ForceSendFields []string `json:"-"`
  1962. // NullFields is a list of field names (e.g. "Country") to include in
  1963. // API requests with the JSON null value. By default, fields with empty
  1964. // values are omitted from API requests. However, any field with an
  1965. // empty value appearing in NullFields will be sent to the server as
  1966. // null. It is an error if a field in this list has a non-empty value.
  1967. // This may be used to include null fields in Patch requests.
  1968. NullFields []string `json:"-"`
  1969. }
  1970. func (s *DatafeedTarget) MarshalJSON() ([]byte, error) {
  1971. type NoMethod DatafeedTarget
  1972. raw := NoMethod(*s)
  1973. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1974. }
  1975. type DatafeedsCustomBatchRequest struct {
  1976. // Entries: The request entries to be processed in the batch.
  1977. Entries []*DatafeedsCustomBatchRequestEntry `json:"entries,omitempty"`
  1978. // ForceSendFields is a list of field names (e.g. "Entries") to
  1979. // unconditionally include in API requests. By default, fields with
  1980. // empty values are omitted from API requests. However, any non-pointer,
  1981. // non-interface field appearing in ForceSendFields will be sent to the
  1982. // server regardless of whether the field is empty or not. This may be
  1983. // used to include empty fields in Patch requests.
  1984. ForceSendFields []string `json:"-"`
  1985. // NullFields is a list of field names (e.g. "Entries") to include in
  1986. // API requests with the JSON null value. By default, fields with empty
  1987. // values are omitted from API requests. However, any field with an
  1988. // empty value appearing in NullFields will be sent to the server as
  1989. // null. It is an error if a field in this list has a non-empty value.
  1990. // This may be used to include null fields in Patch requests.
  1991. NullFields []string `json:"-"`
  1992. }
  1993. func (s *DatafeedsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  1994. type NoMethod DatafeedsCustomBatchRequest
  1995. raw := NoMethod(*s)
  1996. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1997. }
  1998. // DatafeedsCustomBatchRequestEntry: A batch entry encoding a single
  1999. // non-batch datafeeds request.
  2000. type DatafeedsCustomBatchRequestEntry struct {
  2001. // BatchId: An entry ID, unique within the batch request.
  2002. BatchId int64 `json:"batchId,omitempty"`
  2003. // Datafeed: The data feed to insert.
  2004. Datafeed *Datafeed `json:"datafeed,omitempty"`
  2005. // DatafeedId: The ID of the data feed to get, delete or fetch.
  2006. DatafeedId uint64 `json:"datafeedId,omitempty,string"`
  2007. // MerchantId: The ID of the managing account.
  2008. MerchantId uint64 `json:"merchantId,omitempty,string"`
  2009. Method string `json:"method,omitempty"`
  2010. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2011. // unconditionally include in API requests. By default, fields with
  2012. // empty values are omitted from API requests. However, any non-pointer,
  2013. // non-interface field appearing in ForceSendFields will be sent to the
  2014. // server regardless of whether the field is empty or not. This may be
  2015. // used to include empty fields in Patch requests.
  2016. ForceSendFields []string `json:"-"`
  2017. // NullFields is a list of field names (e.g. "BatchId") to include in
  2018. // API requests with the JSON null value. By default, fields with empty
  2019. // values are omitted from API requests. However, any field with an
  2020. // empty value appearing in NullFields will be sent to the server as
  2021. // null. It is an error if a field in this list has a non-empty value.
  2022. // This may be used to include null fields in Patch requests.
  2023. NullFields []string `json:"-"`
  2024. }
  2025. func (s *DatafeedsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  2026. type NoMethod DatafeedsCustomBatchRequestEntry
  2027. raw := NoMethod(*s)
  2028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2029. }
  2030. type DatafeedsCustomBatchResponse struct {
  2031. // Entries: The result of the execution of the batch requests.
  2032. Entries []*DatafeedsCustomBatchResponseEntry `json:"entries,omitempty"`
  2033. // Kind: Identifies what kind of resource this is. Value: the fixed
  2034. // string "content#datafeedsCustomBatchResponse".
  2035. Kind string `json:"kind,omitempty"`
  2036. // ServerResponse contains the HTTP response code and headers from the
  2037. // server.
  2038. googleapi.ServerResponse `json:"-"`
  2039. // ForceSendFields is a list of field names (e.g. "Entries") to
  2040. // unconditionally include in API requests. By default, fields with
  2041. // empty values are omitted from API requests. However, any non-pointer,
  2042. // non-interface field appearing in ForceSendFields will be sent to the
  2043. // server regardless of whether the field is empty or not. This may be
  2044. // used to include empty fields in Patch requests.
  2045. ForceSendFields []string `json:"-"`
  2046. // NullFields is a list of field names (e.g. "Entries") to include in
  2047. // API requests with the JSON null value. By default, fields with empty
  2048. // values are omitted from API requests. However, any field with an
  2049. // empty value appearing in NullFields will be sent to the server as
  2050. // null. It is an error if a field in this list has a non-empty value.
  2051. // This may be used to include null fields in Patch requests.
  2052. NullFields []string `json:"-"`
  2053. }
  2054. func (s *DatafeedsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  2055. type NoMethod DatafeedsCustomBatchResponse
  2056. raw := NoMethod(*s)
  2057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2058. }
  2059. // DatafeedsCustomBatchResponseEntry: A batch entry encoding a single
  2060. // non-batch datafeeds response.
  2061. type DatafeedsCustomBatchResponseEntry struct {
  2062. // BatchId: The ID of the request entry this entry responds to.
  2063. BatchId int64 `json:"batchId,omitempty"`
  2064. // Datafeed: The requested data feed. Defined if and only if the request
  2065. // was successful.
  2066. Datafeed *Datafeed `json:"datafeed,omitempty"`
  2067. // Errors: A list of errors defined if and only if the request failed.
  2068. Errors *Errors `json:"errors,omitempty"`
  2069. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2070. // unconditionally include in API requests. By default, fields with
  2071. // empty values are omitted from API requests. However, any non-pointer,
  2072. // non-interface field appearing in ForceSendFields will be sent to the
  2073. // server regardless of whether the field is empty or not. This may be
  2074. // used to include empty fields in Patch requests.
  2075. ForceSendFields []string `json:"-"`
  2076. // NullFields is a list of field names (e.g. "BatchId") to include in
  2077. // API requests with the JSON null value. By default, fields with empty
  2078. // values are omitted from API requests. However, any field with an
  2079. // empty value appearing in NullFields will be sent to the server as
  2080. // null. It is an error if a field in this list has a non-empty value.
  2081. // This may be used to include null fields in Patch requests.
  2082. NullFields []string `json:"-"`
  2083. }
  2084. func (s *DatafeedsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  2085. type NoMethod DatafeedsCustomBatchResponseEntry
  2086. raw := NoMethod(*s)
  2087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2088. }
  2089. type DatafeedsFetchNowResponse struct {
  2090. // Kind: Identifies what kind of resource this is. Value: the fixed
  2091. // string "content#datafeedsFetchNowResponse".
  2092. Kind string `json:"kind,omitempty"`
  2093. // ServerResponse contains the HTTP response code and headers from the
  2094. // server.
  2095. googleapi.ServerResponse `json:"-"`
  2096. // ForceSendFields is a list of field names (e.g. "Kind") to
  2097. // unconditionally include in API requests. By default, fields with
  2098. // empty values are omitted from API requests. However, any non-pointer,
  2099. // non-interface field appearing in ForceSendFields will be sent to the
  2100. // server regardless of whether the field is empty or not. This may be
  2101. // used to include empty fields in Patch requests.
  2102. ForceSendFields []string `json:"-"`
  2103. // NullFields is a list of field names (e.g. "Kind") to include in API
  2104. // requests with the JSON null value. By default, fields with empty
  2105. // values are omitted from API requests. However, any field with an
  2106. // empty value appearing in NullFields will be sent to the server as
  2107. // null. It is an error if a field in this list has a non-empty value.
  2108. // This may be used to include null fields in Patch requests.
  2109. NullFields []string `json:"-"`
  2110. }
  2111. func (s *DatafeedsFetchNowResponse) MarshalJSON() ([]byte, error) {
  2112. type NoMethod DatafeedsFetchNowResponse
  2113. raw := NoMethod(*s)
  2114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2115. }
  2116. type DatafeedsListResponse struct {
  2117. // Kind: Identifies what kind of resource this is. Value: the fixed
  2118. // string "content#datafeedsListResponse".
  2119. Kind string `json:"kind,omitempty"`
  2120. // NextPageToken: The token for the retrieval of the next page of
  2121. // datafeeds.
  2122. NextPageToken string `json:"nextPageToken,omitempty"`
  2123. Resources []*Datafeed `json:"resources,omitempty"`
  2124. // ServerResponse contains the HTTP response code and headers from the
  2125. // server.
  2126. googleapi.ServerResponse `json:"-"`
  2127. // ForceSendFields is a list of field names (e.g. "Kind") to
  2128. // unconditionally include in API requests. By default, fields with
  2129. // empty values are omitted from API requests. However, any non-pointer,
  2130. // non-interface field appearing in ForceSendFields will be sent to the
  2131. // server regardless of whether the field is empty or not. This may be
  2132. // used to include empty fields in Patch requests.
  2133. ForceSendFields []string `json:"-"`
  2134. // NullFields is a list of field names (e.g. "Kind") to include in API
  2135. // requests with the JSON null value. By default, fields with empty
  2136. // values are omitted from API requests. However, any field with an
  2137. // empty value appearing in NullFields will be sent to the server as
  2138. // null. It is an error if a field in this list has a non-empty value.
  2139. // This may be used to include null fields in Patch requests.
  2140. NullFields []string `json:"-"`
  2141. }
  2142. func (s *DatafeedsListResponse) MarshalJSON() ([]byte, error) {
  2143. type NoMethod DatafeedsListResponse
  2144. raw := NoMethod(*s)
  2145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2146. }
  2147. type DatafeedstatusesCustomBatchRequest struct {
  2148. // Entries: The request entries to be processed in the batch.
  2149. Entries []*DatafeedstatusesCustomBatchRequestEntry `json:"entries,omitempty"`
  2150. // ForceSendFields is a list of field names (e.g. "Entries") to
  2151. // unconditionally include in API requests. By default, fields with
  2152. // empty values are omitted from API requests. However, any non-pointer,
  2153. // non-interface field appearing in ForceSendFields will be sent to the
  2154. // server regardless of whether the field is empty or not. This may be
  2155. // used to include empty fields in Patch requests.
  2156. ForceSendFields []string `json:"-"`
  2157. // NullFields is a list of field names (e.g. "Entries") to include in
  2158. // API requests with the JSON null value. By default, fields with empty
  2159. // values are omitted from API requests. However, any field with an
  2160. // empty value appearing in NullFields will be sent to the server as
  2161. // null. It is an error if a field in this list has a non-empty value.
  2162. // This may be used to include null fields in Patch requests.
  2163. NullFields []string `json:"-"`
  2164. }
  2165. func (s *DatafeedstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) {
  2166. type NoMethod DatafeedstatusesCustomBatchRequest
  2167. raw := NoMethod(*s)
  2168. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2169. }
  2170. // DatafeedstatusesCustomBatchRequestEntry: A batch entry encoding a
  2171. // single non-batch datafeedstatuses request.
  2172. type DatafeedstatusesCustomBatchRequestEntry struct {
  2173. // BatchId: An entry ID, unique within the batch request.
  2174. BatchId int64 `json:"batchId,omitempty"`
  2175. // Country: The country for which to get the datafeed status. If this
  2176. // parameter is provided then language must also be provided. Note that
  2177. // for multi-target datafeeds this parameter is required.
  2178. Country string `json:"country,omitempty"`
  2179. // DatafeedId: The ID of the data feed to get.
  2180. DatafeedId uint64 `json:"datafeedId,omitempty,string"`
  2181. // Language: The language for which to get the datafeed status. If this
  2182. // parameter is provided then country must also be provided. Note that
  2183. // for multi-target datafeeds this parameter is required.
  2184. Language string `json:"language,omitempty"`
  2185. // MerchantId: The ID of the managing account.
  2186. MerchantId uint64 `json:"merchantId,omitempty,string"`
  2187. Method string `json:"method,omitempty"`
  2188. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2189. // unconditionally include in API requests. By default, fields with
  2190. // empty values are omitted from API requests. However, any non-pointer,
  2191. // non-interface field appearing in ForceSendFields will be sent to the
  2192. // server regardless of whether the field is empty or not. This may be
  2193. // used to include empty fields in Patch requests.
  2194. ForceSendFields []string `json:"-"`
  2195. // NullFields is a list of field names (e.g. "BatchId") to include in
  2196. // API requests with the JSON null value. By default, fields with empty
  2197. // values are omitted from API requests. However, any field with an
  2198. // empty value appearing in NullFields will be sent to the server as
  2199. // null. It is an error if a field in this list has a non-empty value.
  2200. // This may be used to include null fields in Patch requests.
  2201. NullFields []string `json:"-"`
  2202. }
  2203. func (s *DatafeedstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  2204. type NoMethod DatafeedstatusesCustomBatchRequestEntry
  2205. raw := NoMethod(*s)
  2206. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2207. }
  2208. type DatafeedstatusesCustomBatchResponse struct {
  2209. // Entries: The result of the execution of the batch requests.
  2210. Entries []*DatafeedstatusesCustomBatchResponseEntry `json:"entries,omitempty"`
  2211. // Kind: Identifies what kind of resource this is. Value: the fixed
  2212. // string "content#datafeedstatusesCustomBatchResponse".
  2213. Kind string `json:"kind,omitempty"`
  2214. // ServerResponse contains the HTTP response code and headers from the
  2215. // server.
  2216. googleapi.ServerResponse `json:"-"`
  2217. // ForceSendFields is a list of field names (e.g. "Entries") to
  2218. // unconditionally include in API requests. By default, fields with
  2219. // empty values are omitted from API requests. However, any non-pointer,
  2220. // non-interface field appearing in ForceSendFields will be sent to the
  2221. // server regardless of whether the field is empty or not. This may be
  2222. // used to include empty fields in Patch requests.
  2223. ForceSendFields []string `json:"-"`
  2224. // NullFields is a list of field names (e.g. "Entries") to include in
  2225. // API requests with the JSON null value. By default, fields with empty
  2226. // values are omitted from API requests. However, any field with an
  2227. // empty value appearing in NullFields will be sent to the server as
  2228. // null. It is an error if a field in this list has a non-empty value.
  2229. // This may be used to include null fields in Patch requests.
  2230. NullFields []string `json:"-"`
  2231. }
  2232. func (s *DatafeedstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) {
  2233. type NoMethod DatafeedstatusesCustomBatchResponse
  2234. raw := NoMethod(*s)
  2235. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2236. }
  2237. // DatafeedstatusesCustomBatchResponseEntry: A batch entry encoding a
  2238. // single non-batch datafeedstatuses response.
  2239. type DatafeedstatusesCustomBatchResponseEntry struct {
  2240. // BatchId: The ID of the request entry this entry responds to.
  2241. BatchId int64 `json:"batchId,omitempty"`
  2242. // DatafeedStatus: The requested data feed status. Defined if and only
  2243. // if the request was successful.
  2244. DatafeedStatus *DatafeedStatus `json:"datafeedStatus,omitempty"`
  2245. // Errors: A list of errors defined if and only if the request failed.
  2246. Errors *Errors `json:"errors,omitempty"`
  2247. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2248. // unconditionally include in API requests. By default, fields with
  2249. // empty values are omitted from API requests. However, any non-pointer,
  2250. // non-interface field appearing in ForceSendFields will be sent to the
  2251. // server regardless of whether the field is empty or not. This may be
  2252. // used to include empty fields in Patch requests.
  2253. ForceSendFields []string `json:"-"`
  2254. // NullFields is a list of field names (e.g. "BatchId") to include in
  2255. // API requests with the JSON null value. By default, fields with empty
  2256. // values are omitted from API requests. However, any field with an
  2257. // empty value appearing in NullFields will be sent to the server as
  2258. // null. It is an error if a field in this list has a non-empty value.
  2259. // This may be used to include null fields in Patch requests.
  2260. NullFields []string `json:"-"`
  2261. }
  2262. func (s *DatafeedstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  2263. type NoMethod DatafeedstatusesCustomBatchResponseEntry
  2264. raw := NoMethod(*s)
  2265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2266. }
  2267. type DatafeedstatusesListResponse struct {
  2268. // Kind: Identifies what kind of resource this is. Value: the fixed
  2269. // string "content#datafeedstatusesListResponse".
  2270. Kind string `json:"kind,omitempty"`
  2271. // NextPageToken: The token for the retrieval of the next page of
  2272. // datafeed statuses.
  2273. NextPageToken string `json:"nextPageToken,omitempty"`
  2274. Resources []*DatafeedStatus `json:"resources,omitempty"`
  2275. // ServerResponse contains the HTTP response code and headers from the
  2276. // server.
  2277. googleapi.ServerResponse `json:"-"`
  2278. // ForceSendFields is a list of field names (e.g. "Kind") to
  2279. // unconditionally include in API requests. By default, fields with
  2280. // empty values are omitted from API requests. However, any non-pointer,
  2281. // non-interface field appearing in ForceSendFields will be sent to the
  2282. // server regardless of whether the field is empty or not. This may be
  2283. // used to include empty fields in Patch requests.
  2284. ForceSendFields []string `json:"-"`
  2285. // NullFields is a list of field names (e.g. "Kind") to include in API
  2286. // requests with the JSON null value. By default, fields with empty
  2287. // values are omitted from API requests. However, any field with an
  2288. // empty value appearing in NullFields will be sent to the server as
  2289. // null. It is an error if a field in this list has a non-empty value.
  2290. // This may be used to include null fields in Patch requests.
  2291. NullFields []string `json:"-"`
  2292. }
  2293. func (s *DatafeedstatusesListResponse) MarshalJSON() ([]byte, error) {
  2294. type NoMethod DatafeedstatusesListResponse
  2295. raw := NoMethod(*s)
  2296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2297. }
  2298. type DeliveryTime struct {
  2299. // CutoffTime: Business days cutoff time definition. If not configured
  2300. // the cutoff time will be defaulted to 8AM PST.
  2301. CutoffTime *CutoffTime `json:"cutoffTime,omitempty"`
  2302. // HolidayCutoffs: Holiday cutoff definitions. If configured, they
  2303. // specify order cutoff times for holiday-specific shipping.
  2304. HolidayCutoffs []*HolidayCutoff `json:"holidayCutoffs,omitempty"`
  2305. // MaxHandlingTimeInDays: Maximum number of business days spent before
  2306. // an order is shipped. 0 means same day shipped, 1 means next day
  2307. // shipped. Must be greater than or equal to minHandlingTimeInDays.
  2308. MaxHandlingTimeInDays int64 `json:"maxHandlingTimeInDays,omitempty"`
  2309. // MaxTransitTimeInDays: Maximum number of business days that is spent
  2310. // in transit. 0 means same day delivery, 1 means next day delivery.
  2311. // Must be greater than or equal to minTransitTimeInDays.
  2312. MaxTransitTimeInDays int64 `json:"maxTransitTimeInDays,omitempty"`
  2313. // MinHandlingTimeInDays: Minimum number of business days spent before
  2314. // an order is shipped. 0 means same day shipped, 1 means next day
  2315. // shipped.
  2316. MinHandlingTimeInDays int64 `json:"minHandlingTimeInDays,omitempty"`
  2317. // MinTransitTimeInDays: Minimum number of business days that is spent
  2318. // in transit. 0 means same day delivery, 1 means next day delivery.
  2319. // Either {min,max}transitTimeInDays or transitTimeTable must be set,
  2320. // but not both.
  2321. MinTransitTimeInDays int64 `json:"minTransitTimeInDays,omitempty"`
  2322. // TransitTimeTable: Transit time table, number of business days spent
  2323. // in transit based on row and column dimensions. Either
  2324. // {min,max}transitTimeInDays or transitTimeTable can be set, but not
  2325. // both.
  2326. TransitTimeTable *TransitTable `json:"transitTimeTable,omitempty"`
  2327. // ForceSendFields is a list of field names (e.g. "CutoffTime") to
  2328. // unconditionally include in API requests. By default, fields with
  2329. // empty values are omitted from API requests. However, any non-pointer,
  2330. // non-interface field appearing in ForceSendFields will be sent to the
  2331. // server regardless of whether the field is empty or not. This may be
  2332. // used to include empty fields in Patch requests.
  2333. ForceSendFields []string `json:"-"`
  2334. // NullFields is a list of field names (e.g. "CutoffTime") to include in
  2335. // API requests with the JSON null value. By default, fields with empty
  2336. // values are omitted from API requests. However, any field with an
  2337. // empty value appearing in NullFields will be sent to the server as
  2338. // null. It is an error if a field in this list has a non-empty value.
  2339. // This may be used to include null fields in Patch requests.
  2340. NullFields []string `json:"-"`
  2341. }
  2342. func (s *DeliveryTime) MarshalJSON() ([]byte, error) {
  2343. type NoMethod DeliveryTime
  2344. raw := NoMethod(*s)
  2345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2346. }
  2347. // Error: An error returned by the API.
  2348. type Error struct {
  2349. // Domain: The domain of the error.
  2350. Domain string `json:"domain,omitempty"`
  2351. // Message: A description of the error.
  2352. Message string `json:"message,omitempty"`
  2353. // Reason: The error code.
  2354. Reason string `json:"reason,omitempty"`
  2355. // ForceSendFields is a list of field names (e.g. "Domain") to
  2356. // unconditionally include in API requests. By default, fields with
  2357. // empty values are omitted from API requests. However, any non-pointer,
  2358. // non-interface field appearing in ForceSendFields will be sent to the
  2359. // server regardless of whether the field is empty or not. This may be
  2360. // used to include empty fields in Patch requests.
  2361. ForceSendFields []string `json:"-"`
  2362. // NullFields is a list of field names (e.g. "Domain") to include in API
  2363. // requests with the JSON null value. By default, fields with empty
  2364. // values are omitted from API requests. However, any field with an
  2365. // empty value appearing in NullFields will be sent to the server as
  2366. // null. It is an error if a field in this list has a non-empty value.
  2367. // This may be used to include null fields in Patch requests.
  2368. NullFields []string `json:"-"`
  2369. }
  2370. func (s *Error) MarshalJSON() ([]byte, error) {
  2371. type NoMethod Error
  2372. raw := NoMethod(*s)
  2373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2374. }
  2375. // Errors: A list of errors returned by a failed batch entry.
  2376. type Errors struct {
  2377. // Code: The HTTP status of the first error in errors.
  2378. Code int64 `json:"code,omitempty"`
  2379. // Errors: A list of errors.
  2380. Errors []*Error `json:"errors,omitempty"`
  2381. // Message: The message of the first error in errors.
  2382. Message string `json:"message,omitempty"`
  2383. // ForceSendFields is a list of field names (e.g. "Code") to
  2384. // unconditionally include in API requests. By default, fields with
  2385. // empty values are omitted from API requests. However, any non-pointer,
  2386. // non-interface field appearing in ForceSendFields will be sent to the
  2387. // server regardless of whether the field is empty or not. This may be
  2388. // used to include empty fields in Patch requests.
  2389. ForceSendFields []string `json:"-"`
  2390. // NullFields is a list of field names (e.g. "Code") to include in API
  2391. // requests with the JSON null value. By default, fields with empty
  2392. // values are omitted from API requests. However, any field with an
  2393. // empty value appearing in NullFields will be sent to the server as
  2394. // null. It is an error if a field in this list has a non-empty value.
  2395. // This may be used to include null fields in Patch requests.
  2396. NullFields []string `json:"-"`
  2397. }
  2398. func (s *Errors) MarshalJSON() ([]byte, error) {
  2399. type NoMethod Errors
  2400. raw := NoMethod(*s)
  2401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2402. }
  2403. type GmbAccounts struct {
  2404. // AccountId: The ID of the account.
  2405. AccountId uint64 `json:"accountId,omitempty,string"`
  2406. // GmbAccounts: A list of GMB accounts which are available to the
  2407. // merchant.
  2408. GmbAccounts []*GmbAccountsGmbAccount `json:"gmbAccounts,omitempty"`
  2409. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2410. // unconditionally include in API requests. By default, fields with
  2411. // empty values are omitted from API requests. However, any non-pointer,
  2412. // non-interface field appearing in ForceSendFields will be sent to the
  2413. // server regardless of whether the field is empty or not. This may be
  2414. // used to include empty fields in Patch requests.
  2415. ForceSendFields []string `json:"-"`
  2416. // NullFields is a list of field names (e.g. "AccountId") to include in
  2417. // API requests with the JSON null value. By default, fields with empty
  2418. // values are omitted from API requests. However, any field with an
  2419. // empty value appearing in NullFields will be sent to the server as
  2420. // null. It is an error if a field in this list has a non-empty value.
  2421. // This may be used to include null fields in Patch requests.
  2422. NullFields []string `json:"-"`
  2423. }
  2424. func (s *GmbAccounts) MarshalJSON() ([]byte, error) {
  2425. type NoMethod GmbAccounts
  2426. raw := NoMethod(*s)
  2427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2428. }
  2429. type GmbAccountsGmbAccount struct {
  2430. // Email: The email which identifies the GMB account.
  2431. Email string `json:"email,omitempty"`
  2432. // ListingCount: Number of listings under this account.
  2433. ListingCount uint64 `json:"listingCount,omitempty,string"`
  2434. // Name: The name of the GMB account.
  2435. Name string `json:"name,omitempty"`
  2436. // Type: The type of the GMB account (User or Business).
  2437. Type string `json:"type,omitempty"`
  2438. // ForceSendFields is a list of field names (e.g. "Email") to
  2439. // unconditionally include in API requests. By default, fields with
  2440. // empty values are omitted from API requests. However, any non-pointer,
  2441. // non-interface field appearing in ForceSendFields will be sent to the
  2442. // server regardless of whether the field is empty or not. This may be
  2443. // used to include empty fields in Patch requests.
  2444. ForceSendFields []string `json:"-"`
  2445. // NullFields is a list of field names (e.g. "Email") to include in API
  2446. // requests with the JSON null value. By default, fields with empty
  2447. // values are omitted from API requests. However, any field with an
  2448. // empty value appearing in NullFields will be sent to the server as
  2449. // null. It is an error if a field in this list has a non-empty value.
  2450. // This may be used to include null fields in Patch requests.
  2451. NullFields []string `json:"-"`
  2452. }
  2453. func (s *GmbAccountsGmbAccount) MarshalJSON() ([]byte, error) {
  2454. type NoMethod GmbAccountsGmbAccount
  2455. raw := NoMethod(*s)
  2456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2457. }
  2458. // Headers: A non-empty list of row or column headers for a table.
  2459. // Exactly one of prices, weights, numItems, postalCodeGroupNames, or
  2460. // location must be set.
  2461. type Headers struct {
  2462. // Locations: A list of location ID sets. Must be non-empty. Can only be
  2463. // set if all other fields are not set.
  2464. Locations []*LocationIdSet `json:"locations,omitempty"`
  2465. // NumberOfItems: A list of inclusive number of items upper bounds. The
  2466. // last value can be "infinity". For example ["10", "50", "infinity"]
  2467. // represents the headers "<= 10 items", " 50 items". Must be non-empty.
  2468. // Can only be set if all other fields are not set.
  2469. NumberOfItems []string `json:"numberOfItems,omitempty"`
  2470. // PostalCodeGroupNames: A list of postal group names. The last value
  2471. // can be "all other locations". Example: ["zone 1", "zone 2", "all
  2472. // other locations"]. The referred postal code groups must match the
  2473. // delivery country of the service. Must be non-empty. Can only be set
  2474. // if all other fields are not set.
  2475. PostalCodeGroupNames []string `json:"postalCodeGroupNames,omitempty"`
  2476. // Prices: A list of inclusive order price upper bounds. The last
  2477. // price's value can be "infinity". For example [{"value": "10",
  2478. // "currency": "USD"}, {"value": "500", "currency": "USD"}, {"value":
  2479. // "infinity", "currency": "USD"}] represents the headers "<= $10", "
  2480. // $500". All prices within a service must have the same currency. Must
  2481. // be non-empty. Can only be set if all other fields are not set.
  2482. Prices []*Price `json:"prices,omitempty"`
  2483. // Weights: A list of inclusive order weight upper bounds. The last
  2484. // weight's value can be "infinity". For example [{"value": "10",
  2485. // "unit": "kg"}, {"value": "50", "unit": "kg"}, {"value": "infinity",
  2486. // "unit": "kg"}] represents the headers "<= 10kg", " 50kg". All weights
  2487. // within a service must have the same unit. Must be non-empty. Can only
  2488. // be set if all other fields are not set.
  2489. Weights []*Weight `json:"weights,omitempty"`
  2490. // ForceSendFields is a list of field names (e.g. "Locations") to
  2491. // unconditionally include in API requests. By default, fields with
  2492. // empty values are omitted from API requests. However, any non-pointer,
  2493. // non-interface field appearing in ForceSendFields will be sent to the
  2494. // server regardless of whether the field is empty or not. This may be
  2495. // used to include empty fields in Patch requests.
  2496. ForceSendFields []string `json:"-"`
  2497. // NullFields is a list of field names (e.g. "Locations") to include in
  2498. // API requests with the JSON null value. By default, fields with empty
  2499. // values are omitted from API requests. However, any field with an
  2500. // empty value appearing in NullFields will be sent to the server as
  2501. // null. It is an error if a field in this list has a non-empty value.
  2502. // This may be used to include null fields in Patch requests.
  2503. NullFields []string `json:"-"`
  2504. }
  2505. func (s *Headers) MarshalJSON() ([]byte, error) {
  2506. type NoMethod Headers
  2507. raw := NoMethod(*s)
  2508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2509. }
  2510. type HolidayCutoff struct {
  2511. // DeadlineDate: Date of the order deadline, in ISO 8601 format. E.g.
  2512. // "2016-11-29" for 29th November 2016. Required.
  2513. DeadlineDate string `json:"deadlineDate,omitempty"`
  2514. // DeadlineHour: Hour of the day on the deadline date until which the
  2515. // order has to be placed to qualify for the delivery guarantee.
  2516. // Possible values are: 0 (midnight), 1, ..., 12 (noon), 13, ..., 23.
  2517. // Required.
  2518. DeadlineHour int64 `json:"deadlineHour,omitempty"`
  2519. // DeadlineTimezone: Timezone identifier for the deadline hour. A list
  2520. // of identifiers can be found in the AdWords API documentation. E.g.
  2521. // "Europe/Zurich". Required.
  2522. DeadlineTimezone string `json:"deadlineTimezone,omitempty"`
  2523. // HolidayId: Unique identifier for the holiday. Required.
  2524. HolidayId string `json:"holidayId,omitempty"`
  2525. // VisibleFromDate: Date on which the deadline will become visible to
  2526. // consumers in ISO 8601 format. E.g. "2016-10-31" for 31st October
  2527. // 2016. Required.
  2528. VisibleFromDate string `json:"visibleFromDate,omitempty"`
  2529. // ForceSendFields is a list of field names (e.g. "DeadlineDate") to
  2530. // unconditionally include in API requests. By default, fields with
  2531. // empty values are omitted from API requests. However, any non-pointer,
  2532. // non-interface field appearing in ForceSendFields will be sent to the
  2533. // server regardless of whether the field is empty or not. This may be
  2534. // used to include empty fields in Patch requests.
  2535. ForceSendFields []string `json:"-"`
  2536. // NullFields is a list of field names (e.g. "DeadlineDate") to include
  2537. // in API requests with the JSON null value. By default, fields with
  2538. // empty values are omitted from API requests. However, any field with
  2539. // an empty value appearing in NullFields will be sent to the server as
  2540. // null. It is an error if a field in this list has a non-empty value.
  2541. // This may be used to include null fields in Patch requests.
  2542. NullFields []string `json:"-"`
  2543. }
  2544. func (s *HolidayCutoff) MarshalJSON() ([]byte, error) {
  2545. type NoMethod HolidayCutoff
  2546. raw := NoMethod(*s)
  2547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2548. }
  2549. type HolidaysHoliday struct {
  2550. // CountryCode: The CLDR territory code of the country in which the
  2551. // holiday is available. E.g. "US", "DE", "GB". A holiday cutoff can
  2552. // only be configured in a shipping settings service with matching
  2553. // delivery country. Always present.
  2554. CountryCode string `json:"countryCode,omitempty"`
  2555. // Date: Date of the holiday, in ISO 8601 format. E.g. "2016-12-25" for
  2556. // Christmas 2016. Always present.
  2557. Date string `json:"date,omitempty"`
  2558. // DeliveryGuaranteeDate: Date on which the order has to arrive at the
  2559. // customer's, in ISO 8601 format. E.g. "2016-12-24" for 24th December
  2560. // 2016. Always present.
  2561. DeliveryGuaranteeDate string `json:"deliveryGuaranteeDate,omitempty"`
  2562. // DeliveryGuaranteeHour: Hour of the day in the delivery location's
  2563. // timezone on the guaranteed delivery date by which the order has to
  2564. // arrive at the customer's. Possible values are: 0 (midnight), 1, ...,
  2565. // 12 (noon), 13, ..., 23. Always present.
  2566. DeliveryGuaranteeHour uint64 `json:"deliveryGuaranteeHour,omitempty,string"`
  2567. // Id: Unique identifier for the holiday to be used when configuring
  2568. // holiday cutoffs. Always present.
  2569. Id string `json:"id,omitempty"`
  2570. // Type: The holiday type. Always present.
  2571. Type string `json:"type,omitempty"`
  2572. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2573. // unconditionally include in API requests. By default, fields with
  2574. // empty values are omitted from API requests. However, any non-pointer,
  2575. // non-interface field appearing in ForceSendFields will be sent to the
  2576. // server regardless of whether the field is empty or not. This may be
  2577. // used to include empty fields in Patch requests.
  2578. ForceSendFields []string `json:"-"`
  2579. // NullFields is a list of field names (e.g. "CountryCode") to include
  2580. // in API requests with the JSON null value. By default, fields with
  2581. // empty values are omitted from API requests. However, any field with
  2582. // an empty value appearing in NullFields will be sent to the server as
  2583. // null. It is an error if a field in this list has a non-empty value.
  2584. // This may be used to include null fields in Patch requests.
  2585. NullFields []string `json:"-"`
  2586. }
  2587. func (s *HolidaysHoliday) MarshalJSON() ([]byte, error) {
  2588. type NoMethod HolidaysHoliday
  2589. raw := NoMethod(*s)
  2590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2591. }
  2592. type Installment struct {
  2593. // Amount: The amount the buyer has to pay per month.
  2594. Amount *Price `json:"amount,omitempty"`
  2595. // Months: The number of installments the buyer has to pay.
  2596. Months int64 `json:"months,omitempty,string"`
  2597. // ForceSendFields is a list of field names (e.g. "Amount") to
  2598. // unconditionally include in API requests. By default, fields with
  2599. // empty values are omitted from API requests. However, any non-pointer,
  2600. // non-interface field appearing in ForceSendFields will be sent to the
  2601. // server regardless of whether the field is empty or not. This may be
  2602. // used to include empty fields in Patch requests.
  2603. ForceSendFields []string `json:"-"`
  2604. // NullFields is a list of field names (e.g. "Amount") to include in API
  2605. // requests with the JSON null value. By default, fields with empty
  2606. // values are omitted from API requests. However, any field with an
  2607. // empty value appearing in NullFields will be sent to the server as
  2608. // null. It is an error if a field in this list has a non-empty value.
  2609. // This may be used to include null fields in Patch requests.
  2610. NullFields []string `json:"-"`
  2611. }
  2612. func (s *Installment) MarshalJSON() ([]byte, error) {
  2613. type NoMethod Installment
  2614. raw := NoMethod(*s)
  2615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2616. }
  2617. type Inventory struct {
  2618. // Availability: The availability of the product.
  2619. Availability string `json:"availability,omitempty"`
  2620. // CustomLabel0: Custom label 0 for custom grouping of items in a
  2621. // Shopping campaign. Only supported for online products.
  2622. CustomLabel0 string `json:"customLabel0,omitempty"`
  2623. // CustomLabel1: Custom label 1 for custom grouping of items in a
  2624. // Shopping campaign. Only supported for online products.
  2625. CustomLabel1 string `json:"customLabel1,omitempty"`
  2626. // CustomLabel2: Custom label 2 for custom grouping of items in a
  2627. // Shopping campaign. Only supported for online products.
  2628. CustomLabel2 string `json:"customLabel2,omitempty"`
  2629. // CustomLabel3: Custom label 3 for custom grouping of items in a
  2630. // Shopping campaign. Only supported for online products.
  2631. CustomLabel3 string `json:"customLabel3,omitempty"`
  2632. // CustomLabel4: Custom label 3 for custom grouping of items in a
  2633. // Shopping campaign. Only supported for online products.
  2634. CustomLabel4 string `json:"customLabel4,omitempty"`
  2635. // Installment: Number and amount of installments to pay for an item.
  2636. // Brazil only.
  2637. Installment *Installment `json:"installment,omitempty"`
  2638. // InstoreProductLocation: The instore product location. Supported only
  2639. // for local products.
  2640. InstoreProductLocation string `json:"instoreProductLocation,omitempty"`
  2641. // Kind: Identifies what kind of resource this is. Value: the fixed
  2642. // string "content#inventory".
  2643. Kind string `json:"kind,omitempty"`
  2644. // LoyaltyPoints: Loyalty points that users receive after purchasing the
  2645. // item. Japan only.
  2646. LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"`
  2647. // Pickup: Store pickup information. Only supported for local inventory.
  2648. // Not setting pickup means "don't update" while setting it to the empty
  2649. // value ({} in JSON) means "delete". Otherwise, pickupMethod and
  2650. // pickupSla must be set together, unless pickupMethod is "not
  2651. // supported".
  2652. Pickup *InventoryPickup `json:"pickup,omitempty"`
  2653. // Price: The price of the product.
  2654. Price *Price `json:"price,omitempty"`
  2655. // Quantity: The quantity of the product. Must be equal to or greater
  2656. // than zero. Supported only for local products.
  2657. Quantity int64 `json:"quantity,omitempty"`
  2658. // SalePrice: The sale price of the product. Mandatory if
  2659. // sale_price_effective_date is defined.
  2660. SalePrice *Price `json:"salePrice,omitempty"`
  2661. // SalePriceEffectiveDate: A date range represented by a pair of ISO
  2662. // 8601 dates separated by a space, comma, or slash. Both dates might be
  2663. // specified as 'null' if undecided.
  2664. SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"`
  2665. // SellOnGoogleQuantity: The quantity of the product that is available
  2666. // for selling on Google. Supported only for online products.
  2667. SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty"`
  2668. // ForceSendFields is a list of field names (e.g. "Availability") to
  2669. // unconditionally include in API requests. By default, fields with
  2670. // empty values are omitted from API requests. However, any non-pointer,
  2671. // non-interface field appearing in ForceSendFields will be sent to the
  2672. // server regardless of whether the field is empty or not. This may be
  2673. // used to include empty fields in Patch requests.
  2674. ForceSendFields []string `json:"-"`
  2675. // NullFields is a list of field names (e.g. "Availability") to include
  2676. // in API requests with the JSON null value. By default, fields with
  2677. // empty values are omitted from API requests. However, any field with
  2678. // an empty value appearing in NullFields will be sent to the server as
  2679. // null. It is an error if a field in this list has a non-empty value.
  2680. // This may be used to include null fields in Patch requests.
  2681. NullFields []string `json:"-"`
  2682. }
  2683. func (s *Inventory) MarshalJSON() ([]byte, error) {
  2684. type NoMethod Inventory
  2685. raw := NoMethod(*s)
  2686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2687. }
  2688. type InventoryCustomBatchRequest struct {
  2689. // Entries: The request entries to be processed in the batch.
  2690. Entries []*InventoryCustomBatchRequestEntry `json:"entries,omitempty"`
  2691. // ForceSendFields is a list of field names (e.g. "Entries") to
  2692. // unconditionally include in API requests. By default, fields with
  2693. // empty values are omitted from API requests. However, any non-pointer,
  2694. // non-interface field appearing in ForceSendFields will be sent to the
  2695. // server regardless of whether the field is empty or not. This may be
  2696. // used to include empty fields in Patch requests.
  2697. ForceSendFields []string `json:"-"`
  2698. // NullFields is a list of field names (e.g. "Entries") to include in
  2699. // API requests with the JSON null value. By default, fields with empty
  2700. // values are omitted from API requests. However, any field with an
  2701. // empty value appearing in NullFields will be sent to the server as
  2702. // null. It is an error if a field in this list has a non-empty value.
  2703. // This may be used to include null fields in Patch requests.
  2704. NullFields []string `json:"-"`
  2705. }
  2706. func (s *InventoryCustomBatchRequest) MarshalJSON() ([]byte, error) {
  2707. type NoMethod InventoryCustomBatchRequest
  2708. raw := NoMethod(*s)
  2709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2710. }
  2711. // InventoryCustomBatchRequestEntry: A batch entry encoding a single
  2712. // non-batch inventory request.
  2713. type InventoryCustomBatchRequestEntry struct {
  2714. // BatchId: An entry ID, unique within the batch request.
  2715. BatchId int64 `json:"batchId,omitempty"`
  2716. // Inventory: Price and availability of the product.
  2717. Inventory *Inventory `json:"inventory,omitempty"`
  2718. // MerchantId: The ID of the managing account.
  2719. MerchantId uint64 `json:"merchantId,omitempty,string"`
  2720. // ProductId: The ID of the product for which to update price and
  2721. // availability.
  2722. ProductId string `json:"productId,omitempty"`
  2723. // StoreCode: The code of the store for which to update price and
  2724. // availability. Use online to update price and availability of an
  2725. // online product.
  2726. StoreCode string `json:"storeCode,omitempty"`
  2727. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2728. // unconditionally include in API requests. By default, fields with
  2729. // empty values are omitted from API requests. However, any non-pointer,
  2730. // non-interface field appearing in ForceSendFields will be sent to the
  2731. // server regardless of whether the field is empty or not. This may be
  2732. // used to include empty fields in Patch requests.
  2733. ForceSendFields []string `json:"-"`
  2734. // NullFields is a list of field names (e.g. "BatchId") to include in
  2735. // API requests with the JSON null value. By default, fields with empty
  2736. // values are omitted from API requests. However, any field with an
  2737. // empty value appearing in NullFields will be sent to the server as
  2738. // null. It is an error if a field in this list has a non-empty value.
  2739. // This may be used to include null fields in Patch requests.
  2740. NullFields []string `json:"-"`
  2741. }
  2742. func (s *InventoryCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  2743. type NoMethod InventoryCustomBatchRequestEntry
  2744. raw := NoMethod(*s)
  2745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2746. }
  2747. type InventoryCustomBatchResponse struct {
  2748. // Entries: The result of the execution of the batch requests.
  2749. Entries []*InventoryCustomBatchResponseEntry `json:"entries,omitempty"`
  2750. // Kind: Identifies what kind of resource this is. Value: the fixed
  2751. // string "content#inventoryCustomBatchResponse".
  2752. Kind string `json:"kind,omitempty"`
  2753. // ServerResponse contains the HTTP response code and headers from the
  2754. // server.
  2755. googleapi.ServerResponse `json:"-"`
  2756. // ForceSendFields is a list of field names (e.g. "Entries") to
  2757. // unconditionally include in API requests. By default, fields with
  2758. // empty values are omitted from API requests. However, any non-pointer,
  2759. // non-interface field appearing in ForceSendFields will be sent to the
  2760. // server regardless of whether the field is empty or not. This may be
  2761. // used to include empty fields in Patch requests.
  2762. ForceSendFields []string `json:"-"`
  2763. // NullFields is a list of field names (e.g. "Entries") to include in
  2764. // API requests with the JSON null value. By default, fields with empty
  2765. // values are omitted from API requests. However, any field with an
  2766. // empty value appearing in NullFields will be sent to the server as
  2767. // null. It is an error if a field in this list has a non-empty value.
  2768. // This may be used to include null fields in Patch requests.
  2769. NullFields []string `json:"-"`
  2770. }
  2771. func (s *InventoryCustomBatchResponse) MarshalJSON() ([]byte, error) {
  2772. type NoMethod InventoryCustomBatchResponse
  2773. raw := NoMethod(*s)
  2774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2775. }
  2776. // InventoryCustomBatchResponseEntry: A batch entry encoding a single
  2777. // non-batch inventory response.
  2778. type InventoryCustomBatchResponseEntry struct {
  2779. // BatchId: The ID of the request entry this entry responds to.
  2780. BatchId int64 `json:"batchId,omitempty"`
  2781. // Errors: A list of errors defined if and only if the request failed.
  2782. Errors *Errors `json:"errors,omitempty"`
  2783. // Kind: Identifies what kind of resource this is. Value: the fixed
  2784. // string "content#inventoryCustomBatchResponseEntry".
  2785. Kind string `json:"kind,omitempty"`
  2786. // ForceSendFields is a list of field names (e.g. "BatchId") to
  2787. // unconditionally include in API requests. By default, fields with
  2788. // empty values are omitted from API requests. However, any non-pointer,
  2789. // non-interface field appearing in ForceSendFields will be sent to the
  2790. // server regardless of whether the field is empty or not. This may be
  2791. // used to include empty fields in Patch requests.
  2792. ForceSendFields []string `json:"-"`
  2793. // NullFields is a list of field names (e.g. "BatchId") to include in
  2794. // API requests with the JSON null value. By default, fields with empty
  2795. // values are omitted from API requests. However, any field with an
  2796. // empty value appearing in NullFields will be sent to the server as
  2797. // null. It is an error if a field in this list has a non-empty value.
  2798. // This may be used to include null fields in Patch requests.
  2799. NullFields []string `json:"-"`
  2800. }
  2801. func (s *InventoryCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  2802. type NoMethod InventoryCustomBatchResponseEntry
  2803. raw := NoMethod(*s)
  2804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2805. }
  2806. type InventoryPickup struct {
  2807. // PickupMethod: Whether store pickup is available for this offer and
  2808. // whether the pickup option should be shown as buy, reserve, or not
  2809. // supported. Only supported for local inventory. Unless the value is
  2810. // "not supported", must be submitted together with pickupSla.
  2811. PickupMethod string `json:"pickupMethod,omitempty"`
  2812. // PickupSla: The expected date that an order will be ready for pickup,
  2813. // relative to when the order is placed. Only supported for local
  2814. // inventory. Must be submitted together with pickupMethod.
  2815. PickupSla string `json:"pickupSla,omitempty"`
  2816. // ForceSendFields is a list of field names (e.g. "PickupMethod") to
  2817. // unconditionally include in API requests. By default, fields with
  2818. // empty values are omitted from API requests. However, any non-pointer,
  2819. // non-interface field appearing in ForceSendFields will be sent to the
  2820. // server regardless of whether the field is empty or not. This may be
  2821. // used to include empty fields in Patch requests.
  2822. ForceSendFields []string `json:"-"`
  2823. // NullFields is a list of field names (e.g. "PickupMethod") to include
  2824. // in API requests with the JSON null value. By default, fields with
  2825. // empty values are omitted from API requests. However, any field with
  2826. // an empty value appearing in NullFields will be sent to the server as
  2827. // null. It is an error if a field in this list has a non-empty value.
  2828. // This may be used to include null fields in Patch requests.
  2829. NullFields []string `json:"-"`
  2830. }
  2831. func (s *InventoryPickup) MarshalJSON() ([]byte, error) {
  2832. type NoMethod InventoryPickup
  2833. raw := NoMethod(*s)
  2834. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2835. }
  2836. type InventorySetRequest struct {
  2837. // Availability: The availability of the product.
  2838. Availability string `json:"availability,omitempty"`
  2839. // CustomLabel0: Custom label 0 for custom grouping of items in a
  2840. // Shopping campaign. Only supported for online products.
  2841. CustomLabel0 string `json:"customLabel0,omitempty"`
  2842. // CustomLabel1: Custom label 1 for custom grouping of items in a
  2843. // Shopping campaign. Only supported for online products.
  2844. CustomLabel1 string `json:"customLabel1,omitempty"`
  2845. // CustomLabel2: Custom label 2 for custom grouping of items in a
  2846. // Shopping campaign. Only supported for online products.
  2847. CustomLabel2 string `json:"customLabel2,omitempty"`
  2848. // CustomLabel3: Custom label 3 for custom grouping of items in a
  2849. // Shopping campaign. Only supported for online products.
  2850. CustomLabel3 string `json:"customLabel3,omitempty"`
  2851. // CustomLabel4: Custom label 3 for custom grouping of items in a
  2852. // Shopping campaign. Only supported for online products.
  2853. CustomLabel4 string `json:"customLabel4,omitempty"`
  2854. // Installment: Number and amount of installments to pay for an item.
  2855. // Brazil only.
  2856. Installment *Installment `json:"installment,omitempty"`
  2857. // InstoreProductLocation: The instore product location. Supported only
  2858. // for local products.
  2859. InstoreProductLocation string `json:"instoreProductLocation,omitempty"`
  2860. // LoyaltyPoints: Loyalty points that users receive after purchasing the
  2861. // item. Japan only.
  2862. LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"`
  2863. // Pickup: Store pickup information. Only supported for local inventory.
  2864. // Not setting pickup means "don't update" while setting it to the empty
  2865. // value ({} in JSON) means "delete". Otherwise, pickupMethod and
  2866. // pickupSla must be set together, unless pickupMethod is "not
  2867. // supported".
  2868. Pickup *InventoryPickup `json:"pickup,omitempty"`
  2869. // Price: The price of the product.
  2870. Price *Price `json:"price,omitempty"`
  2871. // Quantity: The quantity of the product. Must be equal to or greater
  2872. // than zero. Supported only for local products.
  2873. Quantity int64 `json:"quantity,omitempty"`
  2874. // SalePrice: The sale price of the product. Mandatory if
  2875. // sale_price_effective_date is defined.
  2876. SalePrice *Price `json:"salePrice,omitempty"`
  2877. // SalePriceEffectiveDate: A date range represented by a pair of ISO
  2878. // 8601 dates separated by a space, comma, or slash. Both dates might be
  2879. // specified as 'null' if undecided.
  2880. SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"`
  2881. // SellOnGoogleQuantity: The quantity of the product that is available
  2882. // for selling on Google. Supported only for online products.
  2883. SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty"`
  2884. // ForceSendFields is a list of field names (e.g. "Availability") to
  2885. // unconditionally include in API requests. By default, fields with
  2886. // empty values are omitted from API requests. However, any non-pointer,
  2887. // non-interface field appearing in ForceSendFields will be sent to the
  2888. // server regardless of whether the field is empty or not. This may be
  2889. // used to include empty fields in Patch requests.
  2890. ForceSendFields []string `json:"-"`
  2891. // NullFields is a list of field names (e.g. "Availability") to include
  2892. // in API requests with the JSON null value. By default, fields with
  2893. // empty values are omitted from API requests. However, any field with
  2894. // an empty value appearing in NullFields will be sent to the server as
  2895. // null. It is an error if a field in this list has a non-empty value.
  2896. // This may be used to include null fields in Patch requests.
  2897. NullFields []string `json:"-"`
  2898. }
  2899. func (s *InventorySetRequest) MarshalJSON() ([]byte, error) {
  2900. type NoMethod InventorySetRequest
  2901. raw := NoMethod(*s)
  2902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2903. }
  2904. type InventorySetResponse struct {
  2905. // Kind: Identifies what kind of resource this is. Value: the fixed
  2906. // string "content#inventorySetResponse".
  2907. Kind string `json:"kind,omitempty"`
  2908. // ServerResponse contains the HTTP response code and headers from the
  2909. // server.
  2910. googleapi.ServerResponse `json:"-"`
  2911. // ForceSendFields is a list of field names (e.g. "Kind") to
  2912. // unconditionally include in API requests. By default, fields with
  2913. // empty values are omitted from API requests. However, any non-pointer,
  2914. // non-interface field appearing in ForceSendFields will be sent to the
  2915. // server regardless of whether the field is empty or not. This may be
  2916. // used to include empty fields in Patch requests.
  2917. ForceSendFields []string `json:"-"`
  2918. // NullFields is a list of field names (e.g. "Kind") to include in API
  2919. // requests with the JSON null value. By default, fields with empty
  2920. // values are omitted from API requests. However, any field with an
  2921. // empty value appearing in NullFields will be sent to the server as
  2922. // null. It is an error if a field in this list has a non-empty value.
  2923. // This may be used to include null fields in Patch requests.
  2924. NullFields []string `json:"-"`
  2925. }
  2926. func (s *InventorySetResponse) MarshalJSON() ([]byte, error) {
  2927. type NoMethod InventorySetResponse
  2928. raw := NoMethod(*s)
  2929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2930. }
  2931. type InvoiceSummary struct {
  2932. // AdditionalChargeSummaries: Summary of the total amounts of the
  2933. // additional charges.
  2934. AdditionalChargeSummaries []*InvoiceSummaryAdditionalChargeSummary `json:"additionalChargeSummaries,omitempty"`
  2935. // CustomerBalance: Deprecated.
  2936. CustomerBalance *Amount `json:"customerBalance,omitempty"`
  2937. // GoogleBalance: Deprecated.
  2938. GoogleBalance *Amount `json:"googleBalance,omitempty"`
  2939. // MerchantBalance: Deprecated.
  2940. MerchantBalance *Amount `json:"merchantBalance,omitempty"`
  2941. // ProductTotal: [required] Total price for the product.
  2942. ProductTotal *Amount `json:"productTotal,omitempty"`
  2943. // PromotionSummaries: Deprecated.
  2944. PromotionSummaries []*Promotion `json:"promotionSummaries,omitempty"`
  2945. // ForceSendFields is a list of field names (e.g.
  2946. // "AdditionalChargeSummaries") to unconditionally include in API
  2947. // requests. By default, fields with empty values are omitted from API
  2948. // requests. However, any non-pointer, non-interface field appearing in
  2949. // ForceSendFields will be sent to the server regardless of whether the
  2950. // field is empty or not. This may be used to include empty fields in
  2951. // Patch requests.
  2952. ForceSendFields []string `json:"-"`
  2953. // NullFields is a list of field names (e.g.
  2954. // "AdditionalChargeSummaries") to include in API requests with the JSON
  2955. // null value. By default, fields with empty values are omitted from API
  2956. // requests. However, any field with an empty value appearing in
  2957. // NullFields will be sent to the server as null. It is an error if a
  2958. // field in this list has a non-empty value. This may be used to include
  2959. // null fields in Patch requests.
  2960. NullFields []string `json:"-"`
  2961. }
  2962. func (s *InvoiceSummary) MarshalJSON() ([]byte, error) {
  2963. type NoMethod InvoiceSummary
  2964. raw := NoMethod(*s)
  2965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2966. }
  2967. type InvoiceSummaryAdditionalChargeSummary struct {
  2968. // TotalAmount: [required] Total additional charge for this type.
  2969. TotalAmount *Amount `json:"totalAmount,omitempty"`
  2970. // Type: [required] Type of the additional charge.
  2971. Type string `json:"type,omitempty"`
  2972. // ForceSendFields is a list of field names (e.g. "TotalAmount") to
  2973. // unconditionally include in API requests. By default, fields with
  2974. // empty values are omitted from API requests. However, any non-pointer,
  2975. // non-interface field appearing in ForceSendFields will be sent to the
  2976. // server regardless of whether the field is empty or not. This may be
  2977. // used to include empty fields in Patch requests.
  2978. ForceSendFields []string `json:"-"`
  2979. // NullFields is a list of field names (e.g. "TotalAmount") to include
  2980. // in API requests with the JSON null value. By default, fields with
  2981. // empty values are omitted from API requests. However, any field with
  2982. // an empty value appearing in NullFields will be sent to the server as
  2983. // null. It is an error if a field in this list has a non-empty value.
  2984. // This may be used to include null fields in Patch requests.
  2985. NullFields []string `json:"-"`
  2986. }
  2987. func (s *InvoiceSummaryAdditionalChargeSummary) MarshalJSON() ([]byte, error) {
  2988. type NoMethod InvoiceSummaryAdditionalChargeSummary
  2989. raw := NoMethod(*s)
  2990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2991. }
  2992. type LiaAboutPageSettings struct {
  2993. // Status: The status of the verification process for the About page.
  2994. Status string `json:"status,omitempty"`
  2995. // Url: The URL for the About page.
  2996. Url string `json:"url,omitempty"`
  2997. // ForceSendFields is a list of field names (e.g. "Status") to
  2998. // unconditionally include in API requests. By default, fields with
  2999. // empty values are omitted from API requests. However, any non-pointer,
  3000. // non-interface field appearing in ForceSendFields will be sent to the
  3001. // server regardless of whether the field is empty or not. This may be
  3002. // used to include empty fields in Patch requests.
  3003. ForceSendFields []string `json:"-"`
  3004. // NullFields is a list of field names (e.g. "Status") to include in API
  3005. // requests with the JSON null value. By default, fields with empty
  3006. // values are omitted from API requests. However, any field with an
  3007. // empty value appearing in NullFields will be sent to the server as
  3008. // null. It is an error if a field in this list has a non-empty value.
  3009. // This may be used to include null fields in Patch requests.
  3010. NullFields []string `json:"-"`
  3011. }
  3012. func (s *LiaAboutPageSettings) MarshalJSON() ([]byte, error) {
  3013. type NoMethod LiaAboutPageSettings
  3014. raw := NoMethod(*s)
  3015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3016. }
  3017. type LiaCountrySettings struct {
  3018. // About: The settings for the About page.
  3019. About *LiaAboutPageSettings `json:"about,omitempty"`
  3020. // Country: CLDR country code (e.g. "US").
  3021. Country string `json:"country,omitempty"`
  3022. // HostedLocalStorefrontActive: The status of the "Merchant hosted local
  3023. // storefront" feature.
  3024. HostedLocalStorefrontActive bool `json:"hostedLocalStorefrontActive,omitempty"`
  3025. // Inventory: LIA inventory verification settings.
  3026. Inventory *LiaInventorySettings `json:"inventory,omitempty"`
  3027. // OnDisplayToOrder: LIA "On Display To Order" settings.
  3028. OnDisplayToOrder *LiaOnDisplayToOrderSettings `json:"onDisplayToOrder,omitempty"`
  3029. // PosDataProvider: The POS data provider linked with this country.
  3030. PosDataProvider *LiaPosDataProvider `json:"posDataProvider,omitempty"`
  3031. // StorePickupActive: The status of the "Store pickup" feature.
  3032. StorePickupActive bool `json:"storePickupActive,omitempty"`
  3033. // ForceSendFields is a list of field names (e.g. "About") to
  3034. // unconditionally include in API requests. By default, fields with
  3035. // empty values are omitted from API requests. However, any non-pointer,
  3036. // non-interface field appearing in ForceSendFields will be sent to the
  3037. // server regardless of whether the field is empty or not. This may be
  3038. // used to include empty fields in Patch requests.
  3039. ForceSendFields []string `json:"-"`
  3040. // NullFields is a list of field names (e.g. "About") to include in API
  3041. // requests with the JSON null value. By default, fields with empty
  3042. // values are omitted from API requests. However, any field with an
  3043. // empty value appearing in NullFields will be sent to the server as
  3044. // null. It is an error if a field in this list has a non-empty value.
  3045. // This may be used to include null fields in Patch requests.
  3046. NullFields []string `json:"-"`
  3047. }
  3048. func (s *LiaCountrySettings) MarshalJSON() ([]byte, error) {
  3049. type NoMethod LiaCountrySettings
  3050. raw := NoMethod(*s)
  3051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3052. }
  3053. type LiaInventorySettings struct {
  3054. // InventoryVerificationContactEmail: The email of the contact for the
  3055. // inventory verification process.
  3056. InventoryVerificationContactEmail string `json:"inventoryVerificationContactEmail,omitempty"`
  3057. // InventoryVerificationContactName: The name of the contact for the
  3058. // inventory verification process.
  3059. InventoryVerificationContactName string `json:"inventoryVerificationContactName,omitempty"`
  3060. // InventoryVerificationContactStatus: The status of the verification
  3061. // contact.
  3062. InventoryVerificationContactStatus string `json:"inventoryVerificationContactStatus,omitempty"`
  3063. // Status: The status of the inventory verification process.
  3064. Status string `json:"status,omitempty"`
  3065. // ForceSendFields is a list of field names (e.g.
  3066. // "InventoryVerificationContactEmail") to unconditionally include in
  3067. // API requests. By default, fields with empty values are omitted from
  3068. // API requests. However, any non-pointer, non-interface field appearing
  3069. // in ForceSendFields will be sent to the server regardless of whether
  3070. // the field is empty or not. This may be used to include empty fields
  3071. // in Patch requests.
  3072. ForceSendFields []string `json:"-"`
  3073. // NullFields is a list of field names (e.g.
  3074. // "InventoryVerificationContactEmail") to include in API requests with
  3075. // the JSON null value. By default, fields with empty values are omitted
  3076. // from API requests. However, any field with an empty value appearing
  3077. // in NullFields will be sent to the server as null. It is an error if a
  3078. // field in this list has a non-empty value. This may be used to include
  3079. // null fields in Patch requests.
  3080. NullFields []string `json:"-"`
  3081. }
  3082. func (s *LiaInventorySettings) MarshalJSON() ([]byte, error) {
  3083. type NoMethod LiaInventorySettings
  3084. raw := NoMethod(*s)
  3085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3086. }
  3087. type LiaOnDisplayToOrderSettings struct {
  3088. // ShippingCostPolicyUrl: Shipping cost and policy URL.
  3089. ShippingCostPolicyUrl string `json:"shippingCostPolicyUrl,omitempty"`
  3090. // Status: The status of the ?On display to order? feature.
  3091. Status string `json:"status,omitempty"`
  3092. // ForceSendFields is a list of field names (e.g.
  3093. // "ShippingCostPolicyUrl") to unconditionally include in API requests.
  3094. // By default, fields with empty values are omitted from API requests.
  3095. // However, any non-pointer, non-interface field appearing in
  3096. // ForceSendFields will be sent to the server regardless of whether the
  3097. // field is empty or not. This may be used to include empty fields in
  3098. // Patch requests.
  3099. ForceSendFields []string `json:"-"`
  3100. // NullFields is a list of field names (e.g. "ShippingCostPolicyUrl") to
  3101. // include in API requests with the JSON null value. By default, fields
  3102. // with empty values are omitted from API requests. However, any field
  3103. // with an empty value appearing in NullFields will be sent to the
  3104. // server as null. It is an error if a field in this list has a
  3105. // non-empty value. This may be used to include null fields in Patch
  3106. // requests.
  3107. NullFields []string `json:"-"`
  3108. }
  3109. func (s *LiaOnDisplayToOrderSettings) MarshalJSON() ([]byte, error) {
  3110. type NoMethod LiaOnDisplayToOrderSettings
  3111. raw := NoMethod(*s)
  3112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3113. }
  3114. type LiaPosDataProvider struct {
  3115. // PosDataProviderId: The ID of the POS data provider.
  3116. PosDataProviderId uint64 `json:"posDataProviderId,omitempty,string"`
  3117. // PosExternalAccountId: The account ID by which this merchant is known
  3118. // to the POS data provider.
  3119. PosExternalAccountId string `json:"posExternalAccountId,omitempty"`
  3120. // ForceSendFields is a list of field names (e.g. "PosDataProviderId")
  3121. // to unconditionally include in API requests. By default, fields with
  3122. // empty values are omitted from API requests. However, any non-pointer,
  3123. // non-interface field appearing in ForceSendFields will be sent to the
  3124. // server regardless of whether the field is empty or not. This may be
  3125. // used to include empty fields in Patch requests.
  3126. ForceSendFields []string `json:"-"`
  3127. // NullFields is a list of field names (e.g. "PosDataProviderId") to
  3128. // include in API requests with the JSON null value. By default, fields
  3129. // with empty values are omitted from API requests. However, any field
  3130. // with an empty value appearing in NullFields will be sent to the
  3131. // server as null. It is an error if a field in this list has a
  3132. // non-empty value. This may be used to include null fields in Patch
  3133. // requests.
  3134. NullFields []string `json:"-"`
  3135. }
  3136. func (s *LiaPosDataProvider) MarshalJSON() ([]byte, error) {
  3137. type NoMethod LiaPosDataProvider
  3138. raw := NoMethod(*s)
  3139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3140. }
  3141. // LiaSettings: Local Inventory ads (LIA) settings. All methods except
  3142. // listposdataproviders require the admin role.
  3143. type LiaSettings struct {
  3144. // AccountId: The ID of the account to which these LIA settings belong.
  3145. // Ignored upon update, always present in get request responses.
  3146. AccountId uint64 `json:"accountId,omitempty,string"`
  3147. // CountrySettings: The LIA settings for each country.
  3148. CountrySettings []*LiaCountrySettings `json:"countrySettings,omitempty"`
  3149. // Kind: Identifies what kind of resource this is. Value: the fixed
  3150. // string "content#liaSettings".
  3151. Kind string `json:"kind,omitempty"`
  3152. // ServerResponse contains the HTTP response code and headers from the
  3153. // server.
  3154. googleapi.ServerResponse `json:"-"`
  3155. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3156. // unconditionally include in API requests. By default, fields with
  3157. // empty values are omitted from API requests. However, any non-pointer,
  3158. // non-interface field appearing in ForceSendFields will be sent to the
  3159. // server regardless of whether the field is empty or not. This may be
  3160. // used to include empty fields in Patch requests.
  3161. ForceSendFields []string `json:"-"`
  3162. // NullFields is a list of field names (e.g. "AccountId") to include in
  3163. // API requests with the JSON null value. By default, fields with empty
  3164. // values are omitted from API requests. However, any field with an
  3165. // empty value appearing in NullFields will be sent to the server as
  3166. // null. It is an error if a field in this list has a non-empty value.
  3167. // This may be used to include null fields in Patch requests.
  3168. NullFields []string `json:"-"`
  3169. }
  3170. func (s *LiaSettings) MarshalJSON() ([]byte, error) {
  3171. type NoMethod LiaSettings
  3172. raw := NoMethod(*s)
  3173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3174. }
  3175. type LiasettingsCustomBatchRequest struct {
  3176. // Entries: The request entries to be processed in the batch.
  3177. Entries []*LiasettingsCustomBatchRequestEntry `json:"entries,omitempty"`
  3178. // ForceSendFields is a list of field names (e.g. "Entries") to
  3179. // unconditionally include in API requests. By default, fields with
  3180. // empty values are omitted from API requests. However, any non-pointer,
  3181. // non-interface field appearing in ForceSendFields will be sent to the
  3182. // server regardless of whether the field is empty or not. This may be
  3183. // used to include empty fields in Patch requests.
  3184. ForceSendFields []string `json:"-"`
  3185. // NullFields is a list of field names (e.g. "Entries") to include in
  3186. // API requests with the JSON null value. By default, fields with empty
  3187. // values are omitted from API requests. However, any field with an
  3188. // empty value appearing in NullFields will be sent to the server as
  3189. // null. It is an error if a field in this list has a non-empty value.
  3190. // This may be used to include null fields in Patch requests.
  3191. NullFields []string `json:"-"`
  3192. }
  3193. func (s *LiasettingsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  3194. type NoMethod LiasettingsCustomBatchRequest
  3195. raw := NoMethod(*s)
  3196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3197. }
  3198. type LiasettingsCustomBatchRequestEntry struct {
  3199. // AccountId: The ID of the account for which to get/update account
  3200. // shipping settings.
  3201. AccountId uint64 `json:"accountId,omitempty,string"`
  3202. // BatchId: An entry ID, unique within the batch request.
  3203. BatchId int64 `json:"batchId,omitempty"`
  3204. // ContactEmail: Inventory validation contact email. Required only for
  3205. // SetInventoryValidationContact.
  3206. ContactEmail string `json:"contactEmail,omitempty"`
  3207. // ContactName: Inventory validation contact name. Required only for
  3208. // SetInventoryValidationContact.
  3209. ContactName string `json:"contactName,omitempty"`
  3210. // Country: The country code. Required only for
  3211. // RequestInventoryVerification.
  3212. Country string `json:"country,omitempty"`
  3213. // GmbEmail: The GMB account. Required only for RequestGmbAccess.
  3214. GmbEmail string `json:"gmbEmail,omitempty"`
  3215. // LiaSettings: The account Lia settings to update. Only defined if the
  3216. // method is update.
  3217. LiaSettings *LiaSettings `json:"liaSettings,omitempty"`
  3218. // MerchantId: The ID of the managing account.
  3219. MerchantId uint64 `json:"merchantId,omitempty,string"`
  3220. Method string `json:"method,omitempty"`
  3221. // PosDataProviderId: The ID of POS data provider. Required only for
  3222. // SetPosProvider.
  3223. PosDataProviderId uint64 `json:"posDataProviderId,omitempty,string"`
  3224. // PosExternalAccountId: The account ID by which this merchant is known
  3225. // to the POS provider.
  3226. PosExternalAccountId string `json:"posExternalAccountId,omitempty"`
  3227. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3228. // unconditionally include in API requests. By default, fields with
  3229. // empty values are omitted from API requests. However, any non-pointer,
  3230. // non-interface field appearing in ForceSendFields will be sent to the
  3231. // server regardless of whether the field is empty or not. This may be
  3232. // used to include empty fields in Patch requests.
  3233. ForceSendFields []string `json:"-"`
  3234. // NullFields is a list of field names (e.g. "AccountId") to include in
  3235. // API requests with the JSON null value. By default, fields with empty
  3236. // values are omitted from API requests. However, any field with an
  3237. // empty value appearing in NullFields will be sent to the server as
  3238. // null. It is an error if a field in this list has a non-empty value.
  3239. // This may be used to include null fields in Patch requests.
  3240. NullFields []string `json:"-"`
  3241. }
  3242. func (s *LiasettingsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  3243. type NoMethod LiasettingsCustomBatchRequestEntry
  3244. raw := NoMethod(*s)
  3245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3246. }
  3247. type LiasettingsCustomBatchResponse struct {
  3248. // Entries: The result of the execution of the batch requests.
  3249. Entries []*LiasettingsCustomBatchResponseEntry `json:"entries,omitempty"`
  3250. // Kind: Identifies what kind of resource this is. Value: the fixed
  3251. // string "content#liasettingsCustomBatchResponse".
  3252. Kind string `json:"kind,omitempty"`
  3253. // ServerResponse contains the HTTP response code and headers from the
  3254. // server.
  3255. googleapi.ServerResponse `json:"-"`
  3256. // ForceSendFields is a list of field names (e.g. "Entries") to
  3257. // unconditionally include in API requests. By default, fields with
  3258. // empty values are omitted from API requests. However, any non-pointer,
  3259. // non-interface field appearing in ForceSendFields will be sent to the
  3260. // server regardless of whether the field is empty or not. This may be
  3261. // used to include empty fields in Patch requests.
  3262. ForceSendFields []string `json:"-"`
  3263. // NullFields is a list of field names (e.g. "Entries") to include in
  3264. // API requests with the JSON null value. By default, fields with empty
  3265. // values are omitted from API requests. However, any field with an
  3266. // empty value appearing in NullFields will be sent to the server as
  3267. // null. It is an error if a field in this list has a non-empty value.
  3268. // This may be used to include null fields in Patch requests.
  3269. NullFields []string `json:"-"`
  3270. }
  3271. func (s *LiasettingsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  3272. type NoMethod LiasettingsCustomBatchResponse
  3273. raw := NoMethod(*s)
  3274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3275. }
  3276. type LiasettingsCustomBatchResponseEntry struct {
  3277. // BatchId: The ID of the request entry to which this entry responds.
  3278. BatchId int64 `json:"batchId,omitempty"`
  3279. // Errors: A list of errors defined if, and only if, the request failed.
  3280. Errors *Errors `json:"errors,omitempty"`
  3281. // GmbAccounts: The the list of accessible GMB accounts.
  3282. GmbAccounts *GmbAccounts `json:"gmbAccounts,omitempty"`
  3283. // Kind: Identifies what kind of resource this is. Value: the fixed
  3284. // string "content#liasettingsCustomBatchResponseEntry".
  3285. Kind string `json:"kind,omitempty"`
  3286. // LiaSettings: The retrieved or updated Lia settings.
  3287. LiaSettings *LiaSettings `json:"liaSettings,omitempty"`
  3288. // PosDataProviders: The list of POS data providers.
  3289. PosDataProviders []*PosDataProviders `json:"posDataProviders,omitempty"`
  3290. // ForceSendFields is a list of field names (e.g. "BatchId") to
  3291. // unconditionally include in API requests. By default, fields with
  3292. // empty values are omitted from API requests. However, any non-pointer,
  3293. // non-interface field appearing in ForceSendFields will be sent to the
  3294. // server regardless of whether the field is empty or not. This may be
  3295. // used to include empty fields in Patch requests.
  3296. ForceSendFields []string `json:"-"`
  3297. // NullFields is a list of field names (e.g. "BatchId") to include in
  3298. // API requests with the JSON null value. By default, fields with empty
  3299. // values are omitted from API requests. However, any field with an
  3300. // empty value appearing in NullFields will be sent to the server as
  3301. // null. It is an error if a field in this list has a non-empty value.
  3302. // This may be used to include null fields in Patch requests.
  3303. NullFields []string `json:"-"`
  3304. }
  3305. func (s *LiasettingsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  3306. type NoMethod LiasettingsCustomBatchResponseEntry
  3307. raw := NoMethod(*s)
  3308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3309. }
  3310. type LiasettingsGetAccessibleGmbAccountsResponse struct {
  3311. // AccountId: The ID of the account.
  3312. AccountId uint64 `json:"accountId,omitempty,string"`
  3313. // GmbAccounts: A list of GMB accounts which are available to the
  3314. // merchant.
  3315. GmbAccounts []*GmbAccountsGmbAccount `json:"gmbAccounts,omitempty"`
  3316. // Kind: Identifies what kind of resource this is. Value: the fixed
  3317. // string "content#liasettingsGetAccessibleGmbAccountsResponse".
  3318. Kind string `json:"kind,omitempty"`
  3319. // ServerResponse contains the HTTP response code and headers from the
  3320. // server.
  3321. googleapi.ServerResponse `json:"-"`
  3322. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3323. // unconditionally include in API requests. By default, fields with
  3324. // empty values are omitted from API requests. However, any non-pointer,
  3325. // non-interface field appearing in ForceSendFields will be sent to the
  3326. // server regardless of whether the field is empty or not. This may be
  3327. // used to include empty fields in Patch requests.
  3328. ForceSendFields []string `json:"-"`
  3329. // NullFields is a list of field names (e.g. "AccountId") to include in
  3330. // API requests with the JSON null value. By default, fields with empty
  3331. // values are omitted from API requests. However, any field with an
  3332. // empty value appearing in NullFields will be sent to the server as
  3333. // null. It is an error if a field in this list has a non-empty value.
  3334. // This may be used to include null fields in Patch requests.
  3335. NullFields []string `json:"-"`
  3336. }
  3337. func (s *LiasettingsGetAccessibleGmbAccountsResponse) MarshalJSON() ([]byte, error) {
  3338. type NoMethod LiasettingsGetAccessibleGmbAccountsResponse
  3339. raw := NoMethod(*s)
  3340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3341. }
  3342. type LiasettingsListPosDataProvidersResponse struct {
  3343. // Kind: Identifies what kind of resource this is. Value: the fixed
  3344. // string "content#liasettingsListPosDataProvidersResponse".
  3345. Kind string `json:"kind,omitempty"`
  3346. // PosDataProviders: The list of POS data providers for each eligible
  3347. // country
  3348. PosDataProviders []*PosDataProviders `json:"posDataProviders,omitempty"`
  3349. // ServerResponse contains the HTTP response code and headers from the
  3350. // server.
  3351. googleapi.ServerResponse `json:"-"`
  3352. // ForceSendFields is a list of field names (e.g. "Kind") to
  3353. // unconditionally include in API requests. By default, fields with
  3354. // empty values are omitted from API requests. However, any non-pointer,
  3355. // non-interface field appearing in ForceSendFields will be sent to the
  3356. // server regardless of whether the field is empty or not. This may be
  3357. // used to include empty fields in Patch requests.
  3358. ForceSendFields []string `json:"-"`
  3359. // NullFields is a list of field names (e.g. "Kind") to include in API
  3360. // requests with the JSON null value. By default, fields with empty
  3361. // values are omitted from API requests. However, any field with an
  3362. // empty value appearing in NullFields will be sent to the server as
  3363. // null. It is an error if a field in this list has a non-empty value.
  3364. // This may be used to include null fields in Patch requests.
  3365. NullFields []string `json:"-"`
  3366. }
  3367. func (s *LiasettingsListPosDataProvidersResponse) MarshalJSON() ([]byte, error) {
  3368. type NoMethod LiasettingsListPosDataProvidersResponse
  3369. raw := NoMethod(*s)
  3370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3371. }
  3372. type LiasettingsListResponse struct {
  3373. // Kind: Identifies what kind of resource this is. Value: the fixed
  3374. // string "content#liasettingsListResponse".
  3375. Kind string `json:"kind,omitempty"`
  3376. // NextPageToken: The token for the retrieval of the next page of LIA
  3377. // settings.
  3378. NextPageToken string `json:"nextPageToken,omitempty"`
  3379. Resources []*LiaSettings `json:"resources,omitempty"`
  3380. // ServerResponse contains the HTTP response code and headers from the
  3381. // server.
  3382. googleapi.ServerResponse `json:"-"`
  3383. // ForceSendFields is a list of field names (e.g. "Kind") to
  3384. // unconditionally include in API requests. By default, fields with
  3385. // empty values are omitted from API requests. However, any non-pointer,
  3386. // non-interface field appearing in ForceSendFields will be sent to the
  3387. // server regardless of whether the field is empty or not. This may be
  3388. // used to include empty fields in Patch requests.
  3389. ForceSendFields []string `json:"-"`
  3390. // NullFields is a list of field names (e.g. "Kind") to include in API
  3391. // requests with the JSON null value. By default, fields with empty
  3392. // values are omitted from API requests. However, any field with an
  3393. // empty value appearing in NullFields will be sent to the server as
  3394. // null. It is an error if a field in this list has a non-empty value.
  3395. // This may be used to include null fields in Patch requests.
  3396. NullFields []string `json:"-"`
  3397. }
  3398. func (s *LiasettingsListResponse) MarshalJSON() ([]byte, error) {
  3399. type NoMethod LiasettingsListResponse
  3400. raw := NoMethod(*s)
  3401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3402. }
  3403. type LiasettingsRequestGmbAccessResponse struct {
  3404. // Kind: Identifies what kind of resource this is. Value: the fixed
  3405. // string "content#liasettingsRequestGmbAccessResponse".
  3406. Kind string `json:"kind,omitempty"`
  3407. // ServerResponse contains the HTTP response code and headers from the
  3408. // server.
  3409. googleapi.ServerResponse `json:"-"`
  3410. // ForceSendFields is a list of field names (e.g. "Kind") to
  3411. // unconditionally include in API requests. By default, fields with
  3412. // empty values are omitted from API requests. However, any non-pointer,
  3413. // non-interface field appearing in ForceSendFields will be sent to the
  3414. // server regardless of whether the field is empty or not. This may be
  3415. // used to include empty fields in Patch requests.
  3416. ForceSendFields []string `json:"-"`
  3417. // NullFields is a list of field names (e.g. "Kind") to include in API
  3418. // requests with the JSON null value. By default, fields with empty
  3419. // values are omitted from API requests. However, any field with an
  3420. // empty value appearing in NullFields will be sent to the server as
  3421. // null. It is an error if a field in this list has a non-empty value.
  3422. // This may be used to include null fields in Patch requests.
  3423. NullFields []string `json:"-"`
  3424. }
  3425. func (s *LiasettingsRequestGmbAccessResponse) MarshalJSON() ([]byte, error) {
  3426. type NoMethod LiasettingsRequestGmbAccessResponse
  3427. raw := NoMethod(*s)
  3428. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3429. }
  3430. type LiasettingsRequestInventoryVerificationResponse struct {
  3431. // Kind: Identifies what kind of resource this is. Value: the fixed
  3432. // string "content#liasettingsRequestInventoryVerificationResponse".
  3433. Kind string `json:"kind,omitempty"`
  3434. // ServerResponse contains the HTTP response code and headers from the
  3435. // server.
  3436. googleapi.ServerResponse `json:"-"`
  3437. // ForceSendFields is a list of field names (e.g. "Kind") to
  3438. // unconditionally include in API requests. By default, fields with
  3439. // empty values are omitted from API requests. However, any non-pointer,
  3440. // non-interface field appearing in ForceSendFields will be sent to the
  3441. // server regardless of whether the field is empty or not. This may be
  3442. // used to include empty fields in Patch requests.
  3443. ForceSendFields []string `json:"-"`
  3444. // NullFields is a list of field names (e.g. "Kind") to include in API
  3445. // requests with the JSON null value. By default, fields with empty
  3446. // values are omitted from API requests. However, any field with an
  3447. // empty value appearing in NullFields will be sent to the server as
  3448. // null. It is an error if a field in this list has a non-empty value.
  3449. // This may be used to include null fields in Patch requests.
  3450. NullFields []string `json:"-"`
  3451. }
  3452. func (s *LiasettingsRequestInventoryVerificationResponse) MarshalJSON() ([]byte, error) {
  3453. type NoMethod LiasettingsRequestInventoryVerificationResponse
  3454. raw := NoMethod(*s)
  3455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3456. }
  3457. type LiasettingsSetInventoryVerificationContactResponse struct {
  3458. // Kind: Identifies what kind of resource this is. Value: the fixed
  3459. // string "content#liasettingsSetInventoryVerificationContactResponse".
  3460. Kind string `json:"kind,omitempty"`
  3461. // ServerResponse contains the HTTP response code and headers from the
  3462. // server.
  3463. googleapi.ServerResponse `json:"-"`
  3464. // ForceSendFields is a list of field names (e.g. "Kind") to
  3465. // unconditionally include in API requests. By default, fields with
  3466. // empty values are omitted from API requests. However, any non-pointer,
  3467. // non-interface field appearing in ForceSendFields will be sent to the
  3468. // server regardless of whether the field is empty or not. This may be
  3469. // used to include empty fields in Patch requests.
  3470. ForceSendFields []string `json:"-"`
  3471. // NullFields is a list of field names (e.g. "Kind") to include in API
  3472. // requests with the JSON null value. By default, fields with empty
  3473. // values are omitted from API requests. However, any field with an
  3474. // empty value appearing in NullFields will be sent to the server as
  3475. // null. It is an error if a field in this list has a non-empty value.
  3476. // This may be used to include null fields in Patch requests.
  3477. NullFields []string `json:"-"`
  3478. }
  3479. func (s *LiasettingsSetInventoryVerificationContactResponse) MarshalJSON() ([]byte, error) {
  3480. type NoMethod LiasettingsSetInventoryVerificationContactResponse
  3481. raw := NoMethod(*s)
  3482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3483. }
  3484. type LiasettingsSetPosDataProviderResponse struct {
  3485. // Kind: Identifies what kind of resource this is. Value: the fixed
  3486. // string "content#liasettingsSetPosDataProviderResponse".
  3487. Kind string `json:"kind,omitempty"`
  3488. // ServerResponse contains the HTTP response code and headers from the
  3489. // server.
  3490. googleapi.ServerResponse `json:"-"`
  3491. // ForceSendFields is a list of field names (e.g. "Kind") to
  3492. // unconditionally include in API requests. By default, fields with
  3493. // empty values are omitted from API requests. However, any non-pointer,
  3494. // non-interface field appearing in ForceSendFields will be sent to the
  3495. // server regardless of whether the field is empty or not. This may be
  3496. // used to include empty fields in Patch requests.
  3497. ForceSendFields []string `json:"-"`
  3498. // NullFields is a list of field names (e.g. "Kind") to include in API
  3499. // requests with the JSON null value. By default, fields with empty
  3500. // values are omitted from API requests. However, any field with an
  3501. // empty value appearing in NullFields will be sent to the server as
  3502. // null. It is an error if a field in this list has a non-empty value.
  3503. // This may be used to include null fields in Patch requests.
  3504. NullFields []string `json:"-"`
  3505. }
  3506. func (s *LiasettingsSetPosDataProviderResponse) MarshalJSON() ([]byte, error) {
  3507. type NoMethod LiasettingsSetPosDataProviderResponse
  3508. raw := NoMethod(*s)
  3509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3510. }
  3511. type LocationIdSet struct {
  3512. // LocationIds: A non-empty list of location IDs. They must all be of
  3513. // the same location type (e.g., state).
  3514. LocationIds []string `json:"locationIds,omitempty"`
  3515. // ForceSendFields is a list of field names (e.g. "LocationIds") to
  3516. // unconditionally include in API requests. By default, fields with
  3517. // empty values are omitted from API requests. However, any non-pointer,
  3518. // non-interface field appearing in ForceSendFields will be sent to the
  3519. // server regardless of whether the field is empty or not. This may be
  3520. // used to include empty fields in Patch requests.
  3521. ForceSendFields []string `json:"-"`
  3522. // NullFields is a list of field names (e.g. "LocationIds") to include
  3523. // in API requests with the JSON null value. By default, fields with
  3524. // empty values are omitted from API requests. However, any field with
  3525. // an empty value appearing in NullFields will be sent to the server as
  3526. // null. It is an error if a field in this list has a non-empty value.
  3527. // This may be used to include null fields in Patch requests.
  3528. NullFields []string `json:"-"`
  3529. }
  3530. func (s *LocationIdSet) MarshalJSON() ([]byte, error) {
  3531. type NoMethod LocationIdSet
  3532. raw := NoMethod(*s)
  3533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3534. }
  3535. type LoyaltyPoints struct {
  3536. // Name: Name of loyalty points program. It is recommended to limit the
  3537. // name to 12 full-width characters or 24 Roman characters.
  3538. Name string `json:"name,omitempty"`
  3539. // PointsValue: The retailer's loyalty points in absolute value.
  3540. PointsValue int64 `json:"pointsValue,omitempty,string"`
  3541. // Ratio: The ratio of a point when converted to currency. Google
  3542. // assumes currency based on Merchant Center settings. If ratio is left
  3543. // out, it defaults to 1.0.
  3544. Ratio float64 `json:"ratio,omitempty"`
  3545. // ForceSendFields is a list of field names (e.g. "Name") to
  3546. // unconditionally include in API requests. By default, fields with
  3547. // empty values are omitted from API requests. However, any non-pointer,
  3548. // non-interface field appearing in ForceSendFields will be sent to the
  3549. // server regardless of whether the field is empty or not. This may be
  3550. // used to include empty fields in Patch requests.
  3551. ForceSendFields []string `json:"-"`
  3552. // NullFields is a list of field names (e.g. "Name") to include in API
  3553. // requests with the JSON null value. By default, fields with empty
  3554. // values are omitted from API requests. However, any field with an
  3555. // empty value appearing in NullFields will be sent to the server as
  3556. // null. It is an error if a field in this list has a non-empty value.
  3557. // This may be used to include null fields in Patch requests.
  3558. NullFields []string `json:"-"`
  3559. }
  3560. func (s *LoyaltyPoints) MarshalJSON() ([]byte, error) {
  3561. type NoMethod LoyaltyPoints
  3562. raw := NoMethod(*s)
  3563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3564. }
  3565. func (s *LoyaltyPoints) UnmarshalJSON(data []byte) error {
  3566. type NoMethod LoyaltyPoints
  3567. var s1 struct {
  3568. Ratio gensupport.JSONFloat64 `json:"ratio"`
  3569. *NoMethod
  3570. }
  3571. s1.NoMethod = (*NoMethod)(s)
  3572. if err := json.Unmarshal(data, &s1); err != nil {
  3573. return err
  3574. }
  3575. s.Ratio = float64(s1.Ratio)
  3576. return nil
  3577. }
  3578. type MerchantOrderReturn struct {
  3579. CreationDate string `json:"creationDate,omitempty"`
  3580. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  3581. OrderId string `json:"orderId,omitempty"`
  3582. OrderReturnId string `json:"orderReturnId,omitempty"`
  3583. ReturnItems []*MerchantOrderReturnItem `json:"returnItems,omitempty"`
  3584. ReturnShipments []*ReturnShipment `json:"returnShipments,omitempty"`
  3585. // ServerResponse contains the HTTP response code and headers from the
  3586. // server.
  3587. googleapi.ServerResponse `json:"-"`
  3588. // ForceSendFields is a list of field names (e.g. "CreationDate") to
  3589. // unconditionally include in API requests. By default, fields with
  3590. // empty values are omitted from API requests. However, any non-pointer,
  3591. // non-interface field appearing in ForceSendFields will be sent to the
  3592. // server regardless of whether the field is empty or not. This may be
  3593. // used to include empty fields in Patch requests.
  3594. ForceSendFields []string `json:"-"`
  3595. // NullFields is a list of field names (e.g. "CreationDate") to include
  3596. // in API requests with the JSON null value. By default, fields with
  3597. // empty values are omitted from API requests. However, any field with
  3598. // an empty value appearing in NullFields will be sent to the server as
  3599. // null. It is an error if a field in this list has a non-empty value.
  3600. // This may be used to include null fields in Patch requests.
  3601. NullFields []string `json:"-"`
  3602. }
  3603. func (s *MerchantOrderReturn) MarshalJSON() ([]byte, error) {
  3604. type NoMethod MerchantOrderReturn
  3605. raw := NoMethod(*s)
  3606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3607. }
  3608. type MerchantOrderReturnItem struct {
  3609. CustomerReturnReason *CustomerReturnReason `json:"customerReturnReason,omitempty"`
  3610. ItemId string `json:"itemId,omitempty"`
  3611. MerchantReturnReason *RefundReason `json:"merchantReturnReason,omitempty"`
  3612. Product *OrderLineItemProduct `json:"product,omitempty"`
  3613. ReturnShipmentIds []string `json:"returnShipmentIds,omitempty"`
  3614. State string `json:"state,omitempty"`
  3615. // ForceSendFields is a list of field names (e.g.
  3616. // "CustomerReturnReason") to unconditionally include in API requests.
  3617. // By default, fields with empty values are omitted from API requests.
  3618. // However, any non-pointer, non-interface field appearing in
  3619. // ForceSendFields will be sent to the server regardless of whether the
  3620. // field is empty or not. This may be used to include empty fields in
  3621. // Patch requests.
  3622. ForceSendFields []string `json:"-"`
  3623. // NullFields is a list of field names (e.g. "CustomerReturnReason") to
  3624. // include in API requests with the JSON null value. By default, fields
  3625. // with empty values are omitted from API requests. However, any field
  3626. // with an empty value appearing in NullFields will be sent to the
  3627. // server as null. It is an error if a field in this list has a
  3628. // non-empty value. This may be used to include null fields in Patch
  3629. // requests.
  3630. NullFields []string `json:"-"`
  3631. }
  3632. func (s *MerchantOrderReturnItem) MarshalJSON() ([]byte, error) {
  3633. type NoMethod MerchantOrderReturnItem
  3634. raw := NoMethod(*s)
  3635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3636. }
  3637. // Order: Order. All methods require the order manager role.
  3638. type Order struct {
  3639. // Acknowledged: Whether the order was acknowledged.
  3640. Acknowledged bool `json:"acknowledged,omitempty"`
  3641. // ChannelType: Deprecated.
  3642. ChannelType string `json:"channelType,omitempty"`
  3643. // Customer: The details of the customer who placed the order.
  3644. Customer *OrderCustomer `json:"customer,omitempty"`
  3645. // DeliveryDetails: The details for the delivery.
  3646. DeliveryDetails *OrderDeliveryDetails `json:"deliveryDetails,omitempty"`
  3647. // Id: The REST ID of the order. Globally unique.
  3648. Id string `json:"id,omitempty"`
  3649. // Kind: Identifies what kind of resource this is. Value: the fixed
  3650. // string "content#order".
  3651. Kind string `json:"kind,omitempty"`
  3652. // LineItems: Line items that are ordered.
  3653. LineItems []*OrderLineItem `json:"lineItems,omitempty"`
  3654. MerchantId uint64 `json:"merchantId,omitempty,string"`
  3655. // MerchantOrderId: Merchant-provided ID of the order.
  3656. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  3657. // NetAmount: The net amount for the order. For example, if an order was
  3658. // originally for a grand total of $100 and a refund was issued for $20,
  3659. // the net amount will be $80.
  3660. NetAmount *Price `json:"netAmount,omitempty"`
  3661. // PaymentMethod: The details of the payment method.
  3662. PaymentMethod *OrderPaymentMethod `json:"paymentMethod,omitempty"`
  3663. // PaymentStatus: The status of the payment.
  3664. PaymentStatus string `json:"paymentStatus,omitempty"`
  3665. // PlacedDate: The date when the order was placed, in ISO 8601 format.
  3666. PlacedDate string `json:"placedDate,omitempty"`
  3667. // Promotions: The details of the merchant provided promotions applied
  3668. // to the order. More details about the program are here.
  3669. Promotions []*OrderLegacyPromotion `json:"promotions,omitempty"`
  3670. // Refunds: Refunds for the order.
  3671. Refunds []*OrderRefund `json:"refunds,omitempty"`
  3672. // Shipments: Shipments of the order.
  3673. Shipments []*OrderShipment `json:"shipments,omitempty"`
  3674. // ShippingCost: The total cost of shipping for all items.
  3675. ShippingCost *Price `json:"shippingCost,omitempty"`
  3676. // ShippingCostTax: The tax for the total shipping cost.
  3677. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  3678. // ShippingOption: Deprecated. Shipping details are provided with line
  3679. // items instead.
  3680. ShippingOption string `json:"shippingOption,omitempty"`
  3681. // Status: The status of the order.
  3682. Status string `json:"status,omitempty"`
  3683. // TaxCollector: The party responsible for collecting and remitting
  3684. // taxes.
  3685. TaxCollector string `json:"taxCollector,omitempty"`
  3686. // ServerResponse contains the HTTP response code and headers from the
  3687. // server.
  3688. googleapi.ServerResponse `json:"-"`
  3689. // ForceSendFields is a list of field names (e.g. "Acknowledged") to
  3690. // unconditionally include in API requests. By default, fields with
  3691. // empty values are omitted from API requests. However, any non-pointer,
  3692. // non-interface field appearing in ForceSendFields will be sent to the
  3693. // server regardless of whether the field is empty or not. This may be
  3694. // used to include empty fields in Patch requests.
  3695. ForceSendFields []string `json:"-"`
  3696. // NullFields is a list of field names (e.g. "Acknowledged") to include
  3697. // in API requests with the JSON null value. By default, fields with
  3698. // empty values are omitted from API requests. However, any field with
  3699. // an empty value appearing in NullFields will be sent to the server as
  3700. // null. It is an error if a field in this list has a non-empty value.
  3701. // This may be used to include null fields in Patch requests.
  3702. NullFields []string `json:"-"`
  3703. }
  3704. func (s *Order) MarshalJSON() ([]byte, error) {
  3705. type NoMethod Order
  3706. raw := NoMethod(*s)
  3707. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3708. }
  3709. type OrderAddress struct {
  3710. // Country: CLDR country code (e.g. "US").
  3711. Country string `json:"country,omitempty"`
  3712. // FullAddress: Strings representing the lines of the printed label for
  3713. // mailing the order, for example:
  3714. // John Smith
  3715. // 1600 Amphitheatre Parkway
  3716. // Mountain View, CA, 94043
  3717. // United States
  3718. FullAddress []string `json:"fullAddress,omitempty"`
  3719. // IsPostOfficeBox: Whether the address is a post office box.
  3720. IsPostOfficeBox bool `json:"isPostOfficeBox,omitempty"`
  3721. // Locality: City, town or commune. May also include dependent
  3722. // localities or sublocalities (e.g. neighborhoods or suburbs).
  3723. Locality string `json:"locality,omitempty"`
  3724. // PostalCode: Postal Code or ZIP (e.g. "94043").
  3725. PostalCode string `json:"postalCode,omitempty"`
  3726. // RecipientName: Name of the recipient.
  3727. RecipientName string `json:"recipientName,omitempty"`
  3728. // Region: Top-level administrative subdivision of the country. For
  3729. // example, a state like California ("CA") or a province like Quebec
  3730. // ("QC").
  3731. Region string `json:"region,omitempty"`
  3732. // StreetAddress: Street-level part of the address.
  3733. StreetAddress []string `json:"streetAddress,omitempty"`
  3734. // ForceSendFields is a list of field names (e.g. "Country") to
  3735. // unconditionally include in API requests. By default, fields with
  3736. // empty values are omitted from API requests. However, any non-pointer,
  3737. // non-interface field appearing in ForceSendFields will be sent to the
  3738. // server regardless of whether the field is empty or not. This may be
  3739. // used to include empty fields in Patch requests.
  3740. ForceSendFields []string `json:"-"`
  3741. // NullFields is a list of field names (e.g. "Country") to include in
  3742. // API requests with the JSON null value. By default, fields with empty
  3743. // values are omitted from API requests. However, any field with an
  3744. // empty value appearing in NullFields will be sent to the server as
  3745. // null. It is an error if a field in this list has a non-empty value.
  3746. // This may be used to include null fields in Patch requests.
  3747. NullFields []string `json:"-"`
  3748. }
  3749. func (s *OrderAddress) MarshalJSON() ([]byte, error) {
  3750. type NoMethod OrderAddress
  3751. raw := NoMethod(*s)
  3752. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3753. }
  3754. type OrderCancellation struct {
  3755. // Actor: The actor that created the cancellation.
  3756. Actor string `json:"actor,omitempty"`
  3757. // CreationDate: Date on which the cancellation has been created, in ISO
  3758. // 8601 format.
  3759. CreationDate string `json:"creationDate,omitempty"`
  3760. // Quantity: The quantity that was canceled.
  3761. Quantity int64 `json:"quantity,omitempty"`
  3762. // Reason: The reason for the cancellation. Orders that are cancelled
  3763. // with a noInventory reason will lead to the removal of the product
  3764. // from Shopping Actions until you make an update to that product. This
  3765. // will not affect your Shopping ads.
  3766. Reason string `json:"reason,omitempty"`
  3767. // ReasonText: The explanation of the reason.
  3768. ReasonText string `json:"reasonText,omitempty"`
  3769. // ForceSendFields is a list of field names (e.g. "Actor") to
  3770. // unconditionally include in API requests. By default, fields with
  3771. // empty values are omitted from API requests. However, any non-pointer,
  3772. // non-interface field appearing in ForceSendFields will be sent to the
  3773. // server regardless of whether the field is empty or not. This may be
  3774. // used to include empty fields in Patch requests.
  3775. ForceSendFields []string `json:"-"`
  3776. // NullFields is a list of field names (e.g. "Actor") to include in API
  3777. // requests with the JSON null value. By default, fields with empty
  3778. // values are omitted from API requests. However, any field with an
  3779. // empty value appearing in NullFields will be sent to the server as
  3780. // null. It is an error if a field in this list has a non-empty value.
  3781. // This may be used to include null fields in Patch requests.
  3782. NullFields []string `json:"-"`
  3783. }
  3784. func (s *OrderCancellation) MarshalJSON() ([]byte, error) {
  3785. type NoMethod OrderCancellation
  3786. raw := NoMethod(*s)
  3787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3788. }
  3789. type OrderCustomer struct {
  3790. // Email: Deprecated.
  3791. Email string `json:"email,omitempty"`
  3792. // ExplicitMarketingPreference: Deprecated. Please use
  3793. // marketingRightsInfo instead.
  3794. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  3795. // FullName: Full name of the customer.
  3796. FullName string `json:"fullName,omitempty"`
  3797. // MarketingRightsInfo: Customer's marketing preferences.
  3798. MarketingRightsInfo *OrderCustomerMarketingRightsInfo `json:"marketingRightsInfo,omitempty"`
  3799. // ForceSendFields is a list of field names (e.g. "Email") to
  3800. // unconditionally include in API requests. By default, fields with
  3801. // empty values are omitted from API requests. However, any non-pointer,
  3802. // non-interface field appearing in ForceSendFields will be sent to the
  3803. // server regardless of whether the field is empty or not. This may be
  3804. // used to include empty fields in Patch requests.
  3805. ForceSendFields []string `json:"-"`
  3806. // NullFields is a list of field names (e.g. "Email") to include in API
  3807. // requests with the JSON null value. By default, fields with empty
  3808. // values are omitted from API requests. However, any field with an
  3809. // empty value appearing in NullFields will be sent to the server as
  3810. // null. It is an error if a field in this list has a non-empty value.
  3811. // This may be used to include null fields in Patch requests.
  3812. NullFields []string `json:"-"`
  3813. }
  3814. func (s *OrderCustomer) MarshalJSON() ([]byte, error) {
  3815. type NoMethod OrderCustomer
  3816. raw := NoMethod(*s)
  3817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3818. }
  3819. type OrderCustomerMarketingRightsInfo struct {
  3820. // ExplicitMarketingPreference: Last known user selection regarding
  3821. // marketing preferences. In certain cases this selection might not be
  3822. // known, so this field would be empty.
  3823. ExplicitMarketingPreference string `json:"explicitMarketingPreference,omitempty"`
  3824. // LastUpdatedTimestamp: Timestamp when last time marketing preference
  3825. // was updated. Could be empty, if user wasn't offered a selection yet.
  3826. LastUpdatedTimestamp string `json:"lastUpdatedTimestamp,omitempty"`
  3827. // MarketingEmailAddress: Email address that can be used for marketing
  3828. // purposes. The field may be empty even if explicitMarketingPreference
  3829. // is 'granted'. This happens when retrieving an old order from the
  3830. // customer who deleted their account.
  3831. MarketingEmailAddress string `json:"marketingEmailAddress,omitempty"`
  3832. // ForceSendFields is a list of field names (e.g.
  3833. // "ExplicitMarketingPreference") to unconditionally include in API
  3834. // requests. By default, fields with empty values are omitted from API
  3835. // requests. However, any non-pointer, non-interface field appearing in
  3836. // ForceSendFields will be sent to the server regardless of whether the
  3837. // field is empty or not. This may be used to include empty fields in
  3838. // Patch requests.
  3839. ForceSendFields []string `json:"-"`
  3840. // NullFields is a list of field names (e.g.
  3841. // "ExplicitMarketingPreference") to include in API requests with the
  3842. // JSON null value. By default, fields with empty values are omitted
  3843. // from API requests. However, any field with an empty value appearing
  3844. // in NullFields will be sent to the server as null. It is an error if a
  3845. // field in this list has a non-empty value. This may be used to include
  3846. // null fields in Patch requests.
  3847. NullFields []string `json:"-"`
  3848. }
  3849. func (s *OrderCustomerMarketingRightsInfo) MarshalJSON() ([]byte, error) {
  3850. type NoMethod OrderCustomerMarketingRightsInfo
  3851. raw := NoMethod(*s)
  3852. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3853. }
  3854. type OrderDeliveryDetails struct {
  3855. // Address: The delivery address
  3856. Address *OrderAddress `json:"address,omitempty"`
  3857. // PhoneNumber: The phone number of the person receiving the delivery.
  3858. PhoneNumber string `json:"phoneNumber,omitempty"`
  3859. // ForceSendFields is a list of field names (e.g. "Address") to
  3860. // unconditionally include in API requests. By default, fields with
  3861. // empty values are omitted from API requests. However, any non-pointer,
  3862. // non-interface field appearing in ForceSendFields will be sent to the
  3863. // server regardless of whether the field is empty or not. This may be
  3864. // used to include empty fields in Patch requests.
  3865. ForceSendFields []string `json:"-"`
  3866. // NullFields is a list of field names (e.g. "Address") to include in
  3867. // API requests with the JSON null value. By default, fields with empty
  3868. // values are omitted from API requests. However, any field with an
  3869. // empty value appearing in NullFields will be sent to the server as
  3870. // null. It is an error if a field in this list has a non-empty value.
  3871. // This may be used to include null fields in Patch requests.
  3872. NullFields []string `json:"-"`
  3873. }
  3874. func (s *OrderDeliveryDetails) MarshalJSON() ([]byte, error) {
  3875. type NoMethod OrderDeliveryDetails
  3876. raw := NoMethod(*s)
  3877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3878. }
  3879. type OrderLegacyPromotion struct {
  3880. Benefits []*OrderLegacyPromotionBenefit `json:"benefits,omitempty"`
  3881. // EffectiveDates: The date and time frame when the promotion is active
  3882. // and ready for validation review. Note that the promotion live time
  3883. // may be delayed for a few hours due to the validation review.
  3884. // Start date and end date are separated by a forward slash (/). The
  3885. // start date is specified by the format (YYYY-MM-DD), followed by the
  3886. // letter ?T?, the time of the day when the sale starts (in Greenwich
  3887. // Mean Time, GMT), followed by an expression of the time zone for the
  3888. // sale. The end date is in the same format.
  3889. EffectiveDates string `json:"effectiveDates,omitempty"`
  3890. // GenericRedemptionCode: Optional. The text code that corresponds to
  3891. // the promotion when applied on the retailer?s website.
  3892. GenericRedemptionCode string `json:"genericRedemptionCode,omitempty"`
  3893. // Id: The unique ID of the promotion.
  3894. Id string `json:"id,omitempty"`
  3895. // LongTitle: The full title of the promotion.
  3896. LongTitle string `json:"longTitle,omitempty"`
  3897. // ProductApplicability: Whether the promotion is applicable to all
  3898. // products or only specific products.
  3899. ProductApplicability string `json:"productApplicability,omitempty"`
  3900. // RedemptionChannel: Indicates that the promotion is valid online.
  3901. RedemptionChannel string `json:"redemptionChannel,omitempty"`
  3902. // ForceSendFields is a list of field names (e.g. "Benefits") to
  3903. // unconditionally include in API requests. By default, fields with
  3904. // empty values are omitted from API requests. However, any non-pointer,
  3905. // non-interface field appearing in ForceSendFields will be sent to the
  3906. // server regardless of whether the field is empty or not. This may be
  3907. // used to include empty fields in Patch requests.
  3908. ForceSendFields []string `json:"-"`
  3909. // NullFields is a list of field names (e.g. "Benefits") to include in
  3910. // API requests with the JSON null value. By default, fields with empty
  3911. // values are omitted from API requests. However, any field with an
  3912. // empty value appearing in NullFields will be sent to the server as
  3913. // null. It is an error if a field in this list has a non-empty value.
  3914. // This may be used to include null fields in Patch requests.
  3915. NullFields []string `json:"-"`
  3916. }
  3917. func (s *OrderLegacyPromotion) MarshalJSON() ([]byte, error) {
  3918. type NoMethod OrderLegacyPromotion
  3919. raw := NoMethod(*s)
  3920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3921. }
  3922. type OrderLegacyPromotionBenefit struct {
  3923. // Discount: The discount in the order price when the promotion is
  3924. // applied.
  3925. Discount *Price `json:"discount,omitempty"`
  3926. // OfferIds: The OfferId(s) that were purchased in this order and map to
  3927. // this specific benefit of the promotion.
  3928. OfferIds []string `json:"offerIds,omitempty"`
  3929. // SubType: Further describes the benefit of the promotion. Note that we
  3930. // will expand on this enumeration as we support new promotion
  3931. // sub-types.
  3932. SubType string `json:"subType,omitempty"`
  3933. // TaxImpact: The impact on tax when the promotion is applied.
  3934. TaxImpact *Price `json:"taxImpact,omitempty"`
  3935. // Type: Describes whether the promotion applies to products (e.g. 20%
  3936. // off) or to shipping (e.g. Free Shipping).
  3937. Type string `json:"type,omitempty"`
  3938. // ForceSendFields is a list of field names (e.g. "Discount") to
  3939. // unconditionally include in API requests. By default, fields with
  3940. // empty values are omitted from API requests. However, any non-pointer,
  3941. // non-interface field appearing in ForceSendFields will be sent to the
  3942. // server regardless of whether the field is empty or not. This may be
  3943. // used to include empty fields in Patch requests.
  3944. ForceSendFields []string `json:"-"`
  3945. // NullFields is a list of field names (e.g. "Discount") to include in
  3946. // API requests with the JSON null value. By default, fields with empty
  3947. // values are omitted from API requests. However, any field with an
  3948. // empty value appearing in NullFields will be sent to the server as
  3949. // null. It is an error if a field in this list has a non-empty value.
  3950. // This may be used to include null fields in Patch requests.
  3951. NullFields []string `json:"-"`
  3952. }
  3953. func (s *OrderLegacyPromotionBenefit) MarshalJSON() ([]byte, error) {
  3954. type NoMethod OrderLegacyPromotionBenefit
  3955. raw := NoMethod(*s)
  3956. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3957. }
  3958. type OrderLineItem struct {
  3959. // Annotations: Annotations that are attached to the line item.
  3960. Annotations []*OrderMerchantProvidedAnnotation `json:"annotations,omitempty"`
  3961. // Cancellations: Cancellations of the line item.
  3962. Cancellations []*OrderCancellation `json:"cancellations,omitempty"`
  3963. // Id: The ID of the line item.
  3964. Id string `json:"id,omitempty"`
  3965. // Price: Total price for the line item. For example, if two items for
  3966. // $10 are purchased, the total price will be $20.
  3967. Price *Price `json:"price,omitempty"`
  3968. // Product: Product data as seen by customer from the time of the order
  3969. // placement. Note that certain attributes values (e.g. title or gtin)
  3970. // might be reformatted and no longer match values submitted via product
  3971. // feed.
  3972. Product *OrderLineItemProduct `json:"product,omitempty"`
  3973. // QuantityCanceled: Number of items canceled.
  3974. QuantityCanceled int64 `json:"quantityCanceled,omitempty"`
  3975. // QuantityDelivered: Number of items delivered.
  3976. QuantityDelivered int64 `json:"quantityDelivered,omitempty"`
  3977. // QuantityOrdered: Number of items ordered.
  3978. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  3979. // QuantityPending: Number of items pending.
  3980. QuantityPending int64 `json:"quantityPending,omitempty"`
  3981. // QuantityReturned: Number of items returned.
  3982. QuantityReturned int64 `json:"quantityReturned,omitempty"`
  3983. // QuantityShipped: Number of items shipped.
  3984. QuantityShipped int64 `json:"quantityShipped,omitempty"`
  3985. // ReturnInfo: Details of the return policy for the line item.
  3986. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  3987. // Returns: Returns of the line item.
  3988. Returns []*OrderReturn `json:"returns,omitempty"`
  3989. // ShippingDetails: Details of the requested shipping for the line item.
  3990. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  3991. // Tax: Total tax amount for the line item. For example, if two items
  3992. // are purchased, and each have a cost tax of $2, the total tax amount
  3993. // will be $4.
  3994. Tax *Price `json:"tax,omitempty"`
  3995. // ForceSendFields is a list of field names (e.g. "Annotations") to
  3996. // unconditionally include in API requests. By default, fields with
  3997. // empty values are omitted from API requests. However, any non-pointer,
  3998. // non-interface field appearing in ForceSendFields will be sent to the
  3999. // server regardless of whether the field is empty or not. This may be
  4000. // used to include empty fields in Patch requests.
  4001. ForceSendFields []string `json:"-"`
  4002. // NullFields is a list of field names (e.g. "Annotations") to include
  4003. // in API requests with the JSON null value. By default, fields with
  4004. // empty values are omitted from API requests. However, any field with
  4005. // an empty value appearing in NullFields will be sent to the server as
  4006. // null. It is an error if a field in this list has a non-empty value.
  4007. // This may be used to include null fields in Patch requests.
  4008. NullFields []string `json:"-"`
  4009. }
  4010. func (s *OrderLineItem) MarshalJSON() ([]byte, error) {
  4011. type NoMethod OrderLineItem
  4012. raw := NoMethod(*s)
  4013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4014. }
  4015. type OrderLineItemProduct struct {
  4016. // Brand: Brand of the item.
  4017. Brand string `json:"brand,omitempty"`
  4018. // Channel: The item's channel (online or local).
  4019. Channel string `json:"channel,omitempty"`
  4020. // Condition: Condition or state of the item.
  4021. Condition string `json:"condition,omitempty"`
  4022. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  4023. ContentLanguage string `json:"contentLanguage,omitempty"`
  4024. // Fees: Associated fees at order creation time.
  4025. Fees []*OrderLineItemProductFee `json:"fees,omitempty"`
  4026. // Gtin: Global Trade Item Number (GTIN) of the item.
  4027. Gtin string `json:"gtin,omitempty"`
  4028. // Id: The REST ID of the product.
  4029. Id string `json:"id,omitempty"`
  4030. // ImageLink: URL of an image of the item.
  4031. ImageLink string `json:"imageLink,omitempty"`
  4032. // ItemGroupId: Shared identifier for all variants of the same product.
  4033. ItemGroupId string `json:"itemGroupId,omitempty"`
  4034. // Mpn: Manufacturer Part Number (MPN) of the item.
  4035. Mpn string `json:"mpn,omitempty"`
  4036. // OfferId: An identifier of the item.
  4037. OfferId string `json:"offerId,omitempty"`
  4038. // Price: Price of the item.
  4039. Price *Price `json:"price,omitempty"`
  4040. // ShownImage: URL to the cached image shown to the user when order was
  4041. // placed.
  4042. ShownImage string `json:"shownImage,omitempty"`
  4043. // TargetCountry: The CLDR territory code of the target country of the
  4044. // product.
  4045. TargetCountry string `json:"targetCountry,omitempty"`
  4046. // Title: The title of the product.
  4047. Title string `json:"title,omitempty"`
  4048. // VariantAttributes: Variant attributes for the item. These are
  4049. // dimensions of the product, such as color, gender, material, pattern,
  4050. // and size. You can find a comprehensive list of variant attributes
  4051. // here.
  4052. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  4053. // ForceSendFields is a list of field names (e.g. "Brand") to
  4054. // unconditionally include in API requests. By default, fields with
  4055. // empty values are omitted from API requests. However, any non-pointer,
  4056. // non-interface field appearing in ForceSendFields will be sent to the
  4057. // server regardless of whether the field is empty or not. This may be
  4058. // used to include empty fields in Patch requests.
  4059. ForceSendFields []string `json:"-"`
  4060. // NullFields is a list of field names (e.g. "Brand") to include in API
  4061. // requests with the JSON null value. By default, fields with empty
  4062. // values are omitted from API requests. However, any field with an
  4063. // empty value appearing in NullFields will be sent to the server as
  4064. // null. It is an error if a field in this list has a non-empty value.
  4065. // This may be used to include null fields in Patch requests.
  4066. NullFields []string `json:"-"`
  4067. }
  4068. func (s *OrderLineItemProduct) MarshalJSON() ([]byte, error) {
  4069. type NoMethod OrderLineItemProduct
  4070. raw := NoMethod(*s)
  4071. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4072. }
  4073. type OrderLineItemProductFee struct {
  4074. // Amount: Amount of the fee.
  4075. Amount *Price `json:"amount,omitempty"`
  4076. // Name: Name of the fee.
  4077. Name string `json:"name,omitempty"`
  4078. // ForceSendFields is a list of field names (e.g. "Amount") to
  4079. // unconditionally include in API requests. By default, fields with
  4080. // empty values are omitted from API requests. However, any non-pointer,
  4081. // non-interface field appearing in ForceSendFields will be sent to the
  4082. // server regardless of whether the field is empty or not. This may be
  4083. // used to include empty fields in Patch requests.
  4084. ForceSendFields []string `json:"-"`
  4085. // NullFields is a list of field names (e.g. "Amount") to include in API
  4086. // requests with the JSON null value. By default, fields with empty
  4087. // values are omitted from API requests. However, any field with an
  4088. // empty value appearing in NullFields will be sent to the server as
  4089. // null. It is an error if a field in this list has a non-empty value.
  4090. // This may be used to include null fields in Patch requests.
  4091. NullFields []string `json:"-"`
  4092. }
  4093. func (s *OrderLineItemProductFee) MarshalJSON() ([]byte, error) {
  4094. type NoMethod OrderLineItemProductFee
  4095. raw := NoMethod(*s)
  4096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4097. }
  4098. type OrderLineItemProductVariantAttribute struct {
  4099. // Dimension: The dimension of the variant.
  4100. Dimension string `json:"dimension,omitempty"`
  4101. // Value: The value for the dimension.
  4102. Value string `json:"value,omitempty"`
  4103. // ForceSendFields is a list of field names (e.g. "Dimension") to
  4104. // unconditionally include in API requests. By default, fields with
  4105. // empty values are omitted from API requests. However, any non-pointer,
  4106. // non-interface field appearing in ForceSendFields will be sent to the
  4107. // server regardless of whether the field is empty or not. This may be
  4108. // used to include empty fields in Patch requests.
  4109. ForceSendFields []string `json:"-"`
  4110. // NullFields is a list of field names (e.g. "Dimension") to include in
  4111. // API requests with the JSON null value. By default, fields with empty
  4112. // values are omitted from API requests. However, any field with an
  4113. // empty value appearing in NullFields will be sent to the server as
  4114. // null. It is an error if a field in this list has a non-empty value.
  4115. // This may be used to include null fields in Patch requests.
  4116. NullFields []string `json:"-"`
  4117. }
  4118. func (s *OrderLineItemProductVariantAttribute) MarshalJSON() ([]byte, error) {
  4119. type NoMethod OrderLineItemProductVariantAttribute
  4120. raw := NoMethod(*s)
  4121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4122. }
  4123. type OrderLineItemReturnInfo struct {
  4124. // DaysToReturn: How many days later the item can be returned.
  4125. DaysToReturn int64 `json:"daysToReturn,omitempty"`
  4126. // IsReturnable: Whether the item is returnable.
  4127. IsReturnable bool `json:"isReturnable,omitempty"`
  4128. // PolicyUrl: URL of the item return policy.
  4129. PolicyUrl string `json:"policyUrl,omitempty"`
  4130. // ForceSendFields is a list of field names (e.g. "DaysToReturn") to
  4131. // unconditionally include in API requests. By default, fields with
  4132. // empty values are omitted from API requests. However, any non-pointer,
  4133. // non-interface field appearing in ForceSendFields will be sent to the
  4134. // server regardless of whether the field is empty or not. This may be
  4135. // used to include empty fields in Patch requests.
  4136. ForceSendFields []string `json:"-"`
  4137. // NullFields is a list of field names (e.g. "DaysToReturn") to include
  4138. // in API requests with the JSON null value. By default, fields with
  4139. // empty values are omitted from API requests. However, any field with
  4140. // an empty value appearing in NullFields will be sent to the server as
  4141. // null. It is an error if a field in this list has a non-empty value.
  4142. // This may be used to include null fields in Patch requests.
  4143. NullFields []string `json:"-"`
  4144. }
  4145. func (s *OrderLineItemReturnInfo) MarshalJSON() ([]byte, error) {
  4146. type NoMethod OrderLineItemReturnInfo
  4147. raw := NoMethod(*s)
  4148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4149. }
  4150. type OrderLineItemShippingDetails struct {
  4151. // DeliverByDate: The delivery by date, in ISO 8601 format.
  4152. DeliverByDate string `json:"deliverByDate,omitempty"`
  4153. // Method: Details of the shipping method.
  4154. Method *OrderLineItemShippingDetailsMethod `json:"method,omitempty"`
  4155. // ShipByDate: The ship by date, in ISO 8601 format.
  4156. ShipByDate string `json:"shipByDate,omitempty"`
  4157. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  4158. // unconditionally include in API requests. By default, fields with
  4159. // empty values are omitted from API requests. However, any non-pointer,
  4160. // non-interface field appearing in ForceSendFields will be sent to the
  4161. // server regardless of whether the field is empty or not. This may be
  4162. // used to include empty fields in Patch requests.
  4163. ForceSendFields []string `json:"-"`
  4164. // NullFields is a list of field names (e.g. "DeliverByDate") to include
  4165. // in API requests with the JSON null value. By default, fields with
  4166. // empty values are omitted from API requests. However, any field with
  4167. // an empty value appearing in NullFields will be sent to the server as
  4168. // null. It is an error if a field in this list has a non-empty value.
  4169. // This may be used to include null fields in Patch requests.
  4170. NullFields []string `json:"-"`
  4171. }
  4172. func (s *OrderLineItemShippingDetails) MarshalJSON() ([]byte, error) {
  4173. type NoMethod OrderLineItemShippingDetails
  4174. raw := NoMethod(*s)
  4175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4176. }
  4177. type OrderLineItemShippingDetailsMethod struct {
  4178. // Carrier: The carrier for the shipping. Optional. See
  4179. // shipments[].carrier for a list of acceptable values.
  4180. Carrier string `json:"carrier,omitempty"`
  4181. // MaxDaysInTransit: Maximum transit time.
  4182. MaxDaysInTransit int64 `json:"maxDaysInTransit,omitempty"`
  4183. // MethodName: The name of the shipping method.
  4184. MethodName string `json:"methodName,omitempty"`
  4185. // MinDaysInTransit: Minimum transit time.
  4186. MinDaysInTransit int64 `json:"minDaysInTransit,omitempty"`
  4187. // ForceSendFields is a list of field names (e.g. "Carrier") to
  4188. // unconditionally include in API requests. By default, fields with
  4189. // empty values are omitted from API requests. However, any non-pointer,
  4190. // non-interface field appearing in ForceSendFields will be sent to the
  4191. // server regardless of whether the field is empty or not. This may be
  4192. // used to include empty fields in Patch requests.
  4193. ForceSendFields []string `json:"-"`
  4194. // NullFields is a list of field names (e.g. "Carrier") to include in
  4195. // API requests with the JSON null value. By default, fields with empty
  4196. // values are omitted from API requests. However, any field with an
  4197. // empty value appearing in NullFields will be sent to the server as
  4198. // null. It is an error if a field in this list has a non-empty value.
  4199. // This may be used to include null fields in Patch requests.
  4200. NullFields []string `json:"-"`
  4201. }
  4202. func (s *OrderLineItemShippingDetailsMethod) MarshalJSON() ([]byte, error) {
  4203. type NoMethod OrderLineItemShippingDetailsMethod
  4204. raw := NoMethod(*s)
  4205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4206. }
  4207. type OrderMerchantProvidedAnnotation struct {
  4208. // Key: Key for additional merchant provided (as key-value pairs)
  4209. // annotation about the line item.
  4210. Key string `json:"key,omitempty"`
  4211. // Value: Value for additional merchant provided (as key-value pairs)
  4212. // annotation about the line item.
  4213. Value string `json:"value,omitempty"`
  4214. // ForceSendFields is a list of field names (e.g. "Key") to
  4215. // unconditionally include in API requests. By default, fields with
  4216. // empty values are omitted from API requests. However, any non-pointer,
  4217. // non-interface field appearing in ForceSendFields will be sent to the
  4218. // server regardless of whether the field is empty or not. This may be
  4219. // used to include empty fields in Patch requests.
  4220. ForceSendFields []string `json:"-"`
  4221. // NullFields is a list of field names (e.g. "Key") to include in API
  4222. // requests with the JSON null value. By default, fields with empty
  4223. // values are omitted from API requests. However, any field with an
  4224. // empty value appearing in NullFields will be sent to the server as
  4225. // null. It is an error if a field in this list has a non-empty value.
  4226. // This may be used to include null fields in Patch requests.
  4227. NullFields []string `json:"-"`
  4228. }
  4229. func (s *OrderMerchantProvidedAnnotation) MarshalJSON() ([]byte, error) {
  4230. type NoMethod OrderMerchantProvidedAnnotation
  4231. raw := NoMethod(*s)
  4232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4233. }
  4234. type OrderPaymentMethod struct {
  4235. // BillingAddress: The billing address.
  4236. BillingAddress *OrderAddress `json:"billingAddress,omitempty"`
  4237. // ExpirationMonth: The card expiration month (January = 1, February = 2
  4238. // etc.).
  4239. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  4240. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  4241. ExpirationYear int64 `json:"expirationYear,omitempty"`
  4242. // LastFourDigits: The last four digits of the card number.
  4243. LastFourDigits string `json:"lastFourDigits,omitempty"`
  4244. // PhoneNumber: The billing phone number.
  4245. PhoneNumber string `json:"phoneNumber,omitempty"`
  4246. // Type: The type of instrument.
  4247. //
  4248. // Acceptable values are:
  4249. // - "AMEX"
  4250. // - "DISCOVER"
  4251. // - "JCB"
  4252. // - "MASTERCARD"
  4253. // - "UNIONPAY"
  4254. // - "VISA"
  4255. // - ""
  4256. Type string `json:"type,omitempty"`
  4257. // ForceSendFields is a list of field names (e.g. "BillingAddress") to
  4258. // unconditionally include in API requests. By default, fields with
  4259. // empty values are omitted from API requests. However, any non-pointer,
  4260. // non-interface field appearing in ForceSendFields will be sent to the
  4261. // server regardless of whether the field is empty or not. This may be
  4262. // used to include empty fields in Patch requests.
  4263. ForceSendFields []string `json:"-"`
  4264. // NullFields is a list of field names (e.g. "BillingAddress") to
  4265. // include in API requests with the JSON null value. By default, fields
  4266. // with empty values are omitted from API requests. However, any field
  4267. // with an empty value appearing in NullFields will be sent to the
  4268. // server as null. It is an error if a field in this list has a
  4269. // non-empty value. This may be used to include null fields in Patch
  4270. // requests.
  4271. NullFields []string `json:"-"`
  4272. }
  4273. func (s *OrderPaymentMethod) MarshalJSON() ([]byte, error) {
  4274. type NoMethod OrderPaymentMethod
  4275. raw := NoMethod(*s)
  4276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4277. }
  4278. type OrderRefund struct {
  4279. // Actor: The actor that created the refund.
  4280. Actor string `json:"actor,omitempty"`
  4281. // Amount: The amount that is refunded.
  4282. Amount *Price `json:"amount,omitempty"`
  4283. // CreationDate: Date on which the item has been created, in ISO 8601
  4284. // format.
  4285. CreationDate string `json:"creationDate,omitempty"`
  4286. // Reason: The reason for the refund.
  4287. Reason string `json:"reason,omitempty"`
  4288. // ReasonText: The explanation of the reason.
  4289. ReasonText string `json:"reasonText,omitempty"`
  4290. // ForceSendFields is a list of field names (e.g. "Actor") to
  4291. // unconditionally include in API requests. By default, fields with
  4292. // empty values are omitted from API requests. However, any non-pointer,
  4293. // non-interface field appearing in ForceSendFields will be sent to the
  4294. // server regardless of whether the field is empty or not. This may be
  4295. // used to include empty fields in Patch requests.
  4296. ForceSendFields []string `json:"-"`
  4297. // NullFields is a list of field names (e.g. "Actor") to include in API
  4298. // requests with the JSON null value. By default, fields with empty
  4299. // values are omitted from API requests. However, any field with an
  4300. // empty value appearing in NullFields will be sent to the server as
  4301. // null. It is an error if a field in this list has a non-empty value.
  4302. // This may be used to include null fields in Patch requests.
  4303. NullFields []string `json:"-"`
  4304. }
  4305. func (s *OrderRefund) MarshalJSON() ([]byte, error) {
  4306. type NoMethod OrderRefund
  4307. raw := NoMethod(*s)
  4308. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4309. }
  4310. // OrderReportDisbursement: Order disbursement. All methods require the
  4311. // payment analyst role.
  4312. type OrderReportDisbursement struct {
  4313. // DisbursementAmount: The disbursement amount.
  4314. DisbursementAmount *Price `json:"disbursementAmount,omitempty"`
  4315. // DisbursementCreationDate: The disbursement date, in ISO 8601 format.
  4316. DisbursementCreationDate string `json:"disbursementCreationDate,omitempty"`
  4317. // DisbursementDate: The date the disbursement was initiated, in ISO
  4318. // 8601 format.
  4319. DisbursementDate string `json:"disbursementDate,omitempty"`
  4320. // DisbursementId: The ID of the disbursement.
  4321. DisbursementId string `json:"disbursementId,omitempty"`
  4322. // MerchantId: The ID of the managing account.
  4323. MerchantId uint64 `json:"merchantId,omitempty,string"`
  4324. // ForceSendFields is a list of field names (e.g. "DisbursementAmount")
  4325. // to unconditionally include in API requests. By default, fields with
  4326. // empty values are omitted from API requests. However, any non-pointer,
  4327. // non-interface field appearing in ForceSendFields will be sent to the
  4328. // server regardless of whether the field is empty or not. This may be
  4329. // used to include empty fields in Patch requests.
  4330. ForceSendFields []string `json:"-"`
  4331. // NullFields is a list of field names (e.g. "DisbursementAmount") to
  4332. // include in API requests with the JSON null value. By default, fields
  4333. // with empty values are omitted from API requests. However, any field
  4334. // with an empty value appearing in NullFields will be sent to the
  4335. // server as null. It is an error if a field in this list has a
  4336. // non-empty value. This may be used to include null fields in Patch
  4337. // requests.
  4338. NullFields []string `json:"-"`
  4339. }
  4340. func (s *OrderReportDisbursement) MarshalJSON() ([]byte, error) {
  4341. type NoMethod OrderReportDisbursement
  4342. raw := NoMethod(*s)
  4343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4344. }
  4345. type OrderReportTransaction struct {
  4346. // DisbursementAmount: The disbursement amount.
  4347. DisbursementAmount *Price `json:"disbursementAmount,omitempty"`
  4348. // DisbursementCreationDate: The date the disbursement was created, in
  4349. // ISO 8601 format.
  4350. DisbursementCreationDate string `json:"disbursementCreationDate,omitempty"`
  4351. // DisbursementDate: The date the disbursement was initiated, in ISO
  4352. // 8601 format.
  4353. DisbursementDate string `json:"disbursementDate,omitempty"`
  4354. // DisbursementId: The ID of the disbursement.
  4355. DisbursementId string `json:"disbursementId,omitempty"`
  4356. // MerchantId: The ID of the managing account.
  4357. MerchantId uint64 `json:"merchantId,omitempty,string"`
  4358. // MerchantOrderId: Merchant-provided ID of the order.
  4359. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  4360. // OrderId: The ID of the order.
  4361. OrderId string `json:"orderId,omitempty"`
  4362. // ProductAmount: Total amount for the items.
  4363. ProductAmount *Amount `json:"productAmount,omitempty"`
  4364. // ProductAmountWithRemittedTax: Total amount with remitted tax for the
  4365. // items.
  4366. ProductAmountWithRemittedTax *ProductAmount `json:"productAmountWithRemittedTax,omitempty"`
  4367. // TransactionDate: The date of the transaction, in ISO 8601 format.
  4368. TransactionDate string `json:"transactionDate,omitempty"`
  4369. // ForceSendFields is a list of field names (e.g. "DisbursementAmount")
  4370. // to unconditionally include in API requests. By default, fields with
  4371. // empty values are omitted from API requests. However, any non-pointer,
  4372. // non-interface field appearing in ForceSendFields will be sent to the
  4373. // server regardless of whether the field is empty or not. This may be
  4374. // used to include empty fields in Patch requests.
  4375. ForceSendFields []string `json:"-"`
  4376. // NullFields is a list of field names (e.g. "DisbursementAmount") to
  4377. // include in API requests with the JSON null value. By default, fields
  4378. // with empty values are omitted from API requests. However, any field
  4379. // with an empty value appearing in NullFields will be sent to the
  4380. // server as null. It is an error if a field in this list has a
  4381. // non-empty value. This may be used to include null fields in Patch
  4382. // requests.
  4383. NullFields []string `json:"-"`
  4384. }
  4385. func (s *OrderReportTransaction) MarshalJSON() ([]byte, error) {
  4386. type NoMethod OrderReportTransaction
  4387. raw := NoMethod(*s)
  4388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4389. }
  4390. type OrderReturn struct {
  4391. // Actor: The actor that created the refund.
  4392. Actor string `json:"actor,omitempty"`
  4393. // CreationDate: Date on which the item has been created, in ISO 8601
  4394. // format.
  4395. CreationDate string `json:"creationDate,omitempty"`
  4396. // Quantity: Quantity that is returned.
  4397. Quantity int64 `json:"quantity,omitempty"`
  4398. // Reason: The reason for the return.
  4399. Reason string `json:"reason,omitempty"`
  4400. // ReasonText: The explanation of the reason.
  4401. ReasonText string `json:"reasonText,omitempty"`
  4402. // ForceSendFields is a list of field names (e.g. "Actor") to
  4403. // unconditionally include in API requests. By default, fields with
  4404. // empty values are omitted from API requests. However, any non-pointer,
  4405. // non-interface field appearing in ForceSendFields will be sent to the
  4406. // server regardless of whether the field is empty or not. This may be
  4407. // used to include empty fields in Patch requests.
  4408. ForceSendFields []string `json:"-"`
  4409. // NullFields is a list of field names (e.g. "Actor") to include in API
  4410. // requests with the JSON null value. By default, fields with empty
  4411. // values are omitted from API requests. However, any field with an
  4412. // empty value appearing in NullFields will be sent to the server as
  4413. // null. It is an error if a field in this list has a non-empty value.
  4414. // This may be used to include null fields in Patch requests.
  4415. NullFields []string `json:"-"`
  4416. }
  4417. func (s *OrderReturn) MarshalJSON() ([]byte, error) {
  4418. type NoMethod OrderReturn
  4419. raw := NoMethod(*s)
  4420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4421. }
  4422. type OrderShipment struct {
  4423. // Carrier: The carrier handling the shipment.
  4424. //
  4425. // Acceptable values for US are:
  4426. // - "gsx"
  4427. // - "ups"
  4428. // - "usps"
  4429. // - "fedex"
  4430. // - "dhl"
  4431. // - "ecourier"
  4432. // - "cxt"
  4433. // - "google"
  4434. // - "ontrac"
  4435. // - "emsy"
  4436. // - "ont"
  4437. // - "deliv"
  4438. // - "dynamex"
  4439. // - "lasership"
  4440. // - "mpx"
  4441. // - "uds"
  4442. //
  4443. // Acceptable values for FR are:
  4444. // - "colissimo"
  4445. // - "chronopost"
  4446. Carrier string `json:"carrier,omitempty"`
  4447. // CreationDate: Date on which the shipment has been created, in ISO
  4448. // 8601 format.
  4449. CreationDate string `json:"creationDate,omitempty"`
  4450. // DeliveryDate: Date on which the shipment has been delivered, in ISO
  4451. // 8601 format. Present only if status is delivered
  4452. DeliveryDate string `json:"deliveryDate,omitempty"`
  4453. // Id: The ID of the shipment.
  4454. Id string `json:"id,omitempty"`
  4455. // LineItems: The line items that are shipped.
  4456. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  4457. // Status: The status of the shipment.
  4458. Status string `json:"status,omitempty"`
  4459. // TrackingId: The tracking ID for the shipment.
  4460. TrackingId string `json:"trackingId,omitempty"`
  4461. // ForceSendFields is a list of field names (e.g. "Carrier") to
  4462. // unconditionally include in API requests. By default, fields with
  4463. // empty values are omitted from API requests. However, any non-pointer,
  4464. // non-interface field appearing in ForceSendFields will be sent to the
  4465. // server regardless of whether the field is empty or not. This may be
  4466. // used to include empty fields in Patch requests.
  4467. ForceSendFields []string `json:"-"`
  4468. // NullFields is a list of field names (e.g. "Carrier") to include in
  4469. // API requests with the JSON null value. By default, fields with empty
  4470. // values are omitted from API requests. However, any field with an
  4471. // empty value appearing in NullFields will be sent to the server as
  4472. // null. It is an error if a field in this list has a non-empty value.
  4473. // This may be used to include null fields in Patch requests.
  4474. NullFields []string `json:"-"`
  4475. }
  4476. func (s *OrderShipment) MarshalJSON() ([]byte, error) {
  4477. type NoMethod OrderShipment
  4478. raw := NoMethod(*s)
  4479. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4480. }
  4481. type OrderShipmentLineItemShipment struct {
  4482. // LineItemId: The ID of the line item that is shipped. Either
  4483. // lineItemId or productId is required.
  4484. LineItemId string `json:"lineItemId,omitempty"`
  4485. // ProductId: The ID of the product to ship. This is the REST ID used in
  4486. // the products service. Either lineItemId or productId is required.
  4487. ProductId string `json:"productId,omitempty"`
  4488. // Quantity: The quantity that is shipped.
  4489. Quantity int64 `json:"quantity,omitempty"`
  4490. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  4491. // unconditionally include in API requests. By default, fields with
  4492. // empty values are omitted from API requests. However, any non-pointer,
  4493. // non-interface field appearing in ForceSendFields will be sent to the
  4494. // server regardless of whether the field is empty or not. This may be
  4495. // used to include empty fields in Patch requests.
  4496. ForceSendFields []string `json:"-"`
  4497. // NullFields is a list of field names (e.g. "LineItemId") to include in
  4498. // API requests with the JSON null value. By default, fields with empty
  4499. // values are omitted from API requests. However, any field with an
  4500. // empty value appearing in NullFields will be sent to the server as
  4501. // null. It is an error if a field in this list has a non-empty value.
  4502. // This may be used to include null fields in Patch requests.
  4503. NullFields []string `json:"-"`
  4504. }
  4505. func (s *OrderShipmentLineItemShipment) MarshalJSON() ([]byte, error) {
  4506. type NoMethod OrderShipmentLineItemShipment
  4507. raw := NoMethod(*s)
  4508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4509. }
  4510. type OrderinvoicesCreateChargeInvoiceRequest struct {
  4511. // InvoiceId: [required] The ID of the invoice.
  4512. InvoiceId string `json:"invoiceId,omitempty"`
  4513. // InvoiceSummary: [required] Invoice summary.
  4514. InvoiceSummary *InvoiceSummary `json:"invoiceSummary,omitempty"`
  4515. // LineItemInvoices: [required] Invoice details per line item.
  4516. LineItemInvoices []*ShipmentInvoiceLineItemInvoice `json:"lineItemInvoices,omitempty"`
  4517. // OperationId: [required] The ID of the operation, unique across all
  4518. // operations for a given order.
  4519. OperationId string `json:"operationId,omitempty"`
  4520. // ShipmentGroupId: [required] ID of the shipment group.
  4521. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  4522. // ForceSendFields is a list of field names (e.g. "InvoiceId") to
  4523. // unconditionally include in API requests. By default, fields with
  4524. // empty values are omitted from API requests. However, any non-pointer,
  4525. // non-interface field appearing in ForceSendFields will be sent to the
  4526. // server regardless of whether the field is empty or not. This may be
  4527. // used to include empty fields in Patch requests.
  4528. ForceSendFields []string `json:"-"`
  4529. // NullFields is a list of field names (e.g. "InvoiceId") to include in
  4530. // API requests with the JSON null value. By default, fields with empty
  4531. // values are omitted from API requests. However, any field with an
  4532. // empty value appearing in NullFields will be sent to the server as
  4533. // null. It is an error if a field in this list has a non-empty value.
  4534. // This may be used to include null fields in Patch requests.
  4535. NullFields []string `json:"-"`
  4536. }
  4537. func (s *OrderinvoicesCreateChargeInvoiceRequest) MarshalJSON() ([]byte, error) {
  4538. type NoMethod OrderinvoicesCreateChargeInvoiceRequest
  4539. raw := NoMethod(*s)
  4540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4541. }
  4542. type OrderinvoicesCreateChargeInvoiceResponse struct {
  4543. // ExecutionStatus: The status of the execution.
  4544. ExecutionStatus string `json:"executionStatus,omitempty"`
  4545. // Kind: Identifies what kind of resource this is. Value: the fixed
  4546. // string "content#orderinvoicesCreateChargeInvoiceResponse".
  4547. Kind string `json:"kind,omitempty"`
  4548. // ServerResponse contains the HTTP response code and headers from the
  4549. // server.
  4550. googleapi.ServerResponse `json:"-"`
  4551. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  4552. // unconditionally include in API requests. By default, fields with
  4553. // empty values are omitted from API requests. However, any non-pointer,
  4554. // non-interface field appearing in ForceSendFields will be sent to the
  4555. // server regardless of whether the field is empty or not. This may be
  4556. // used to include empty fields in Patch requests.
  4557. ForceSendFields []string `json:"-"`
  4558. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  4559. // include in API requests with the JSON null value. By default, fields
  4560. // with empty values are omitted from API requests. However, any field
  4561. // with an empty value appearing in NullFields will be sent to the
  4562. // server as null. It is an error if a field in this list has a
  4563. // non-empty value. This may be used to include null fields in Patch
  4564. // requests.
  4565. NullFields []string `json:"-"`
  4566. }
  4567. func (s *OrderinvoicesCreateChargeInvoiceResponse) MarshalJSON() ([]byte, error) {
  4568. type NoMethod OrderinvoicesCreateChargeInvoiceResponse
  4569. raw := NoMethod(*s)
  4570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4571. }
  4572. type OrderinvoicesCreateRefundInvoiceRequest struct {
  4573. // InvoiceId: [required] The ID of the invoice.
  4574. InvoiceId string `json:"invoiceId,omitempty"`
  4575. // OperationId: [required] The ID of the operation, unique across all
  4576. // operations for a given order.
  4577. OperationId string `json:"operationId,omitempty"`
  4578. // RefundOnlyOption: Option to create a refund-only invoice. Exactly one
  4579. // of refundOnlyOption or returnOption must be provided.
  4580. RefundOnlyOption *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption `json:"refundOnlyOption,omitempty"`
  4581. // ReturnOption: Option to create an invoice for a refund and mark all
  4582. // items within the invoice as returned. Exactly one of refundOnlyOption
  4583. // or returnOption must be provided.
  4584. ReturnOption *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption `json:"returnOption,omitempty"`
  4585. // ShipmentInvoices: Invoice details for different shipment groups.
  4586. ShipmentInvoices []*ShipmentInvoice `json:"shipmentInvoices,omitempty"`
  4587. // ForceSendFields is a list of field names (e.g. "InvoiceId") to
  4588. // unconditionally include in API requests. By default, fields with
  4589. // empty values are omitted from API requests. However, any non-pointer,
  4590. // non-interface field appearing in ForceSendFields will be sent to the
  4591. // server regardless of whether the field is empty or not. This may be
  4592. // used to include empty fields in Patch requests.
  4593. ForceSendFields []string `json:"-"`
  4594. // NullFields is a list of field names (e.g. "InvoiceId") to include in
  4595. // API requests with the JSON null value. By default, fields with empty
  4596. // values are omitted from API requests. However, any field with an
  4597. // empty value appearing in NullFields will be sent to the server as
  4598. // null. It is an error if a field in this list has a non-empty value.
  4599. // This may be used to include null fields in Patch requests.
  4600. NullFields []string `json:"-"`
  4601. }
  4602. func (s *OrderinvoicesCreateRefundInvoiceRequest) MarshalJSON() ([]byte, error) {
  4603. type NoMethod OrderinvoicesCreateRefundInvoiceRequest
  4604. raw := NoMethod(*s)
  4605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4606. }
  4607. type OrderinvoicesCreateRefundInvoiceResponse struct {
  4608. // ExecutionStatus: The status of the execution.
  4609. ExecutionStatus string `json:"executionStatus,omitempty"`
  4610. // Kind: Identifies what kind of resource this is. Value: the fixed
  4611. // string "content#orderinvoicesCreateRefundInvoiceResponse".
  4612. Kind string `json:"kind,omitempty"`
  4613. // ServerResponse contains the HTTP response code and headers from the
  4614. // server.
  4615. googleapi.ServerResponse `json:"-"`
  4616. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  4617. // unconditionally include in API requests. By default, fields with
  4618. // empty values are omitted from API requests. However, any non-pointer,
  4619. // non-interface field appearing in ForceSendFields will be sent to the
  4620. // server regardless of whether the field is empty or not. This may be
  4621. // used to include empty fields in Patch requests.
  4622. ForceSendFields []string `json:"-"`
  4623. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  4624. // include in API requests with the JSON null value. By default, fields
  4625. // with empty values are omitted from API requests. However, any field
  4626. // with an empty value appearing in NullFields will be sent to the
  4627. // server as null. It is an error if a field in this list has a
  4628. // non-empty value. This may be used to include null fields in Patch
  4629. // requests.
  4630. NullFields []string `json:"-"`
  4631. }
  4632. func (s *OrderinvoicesCreateRefundInvoiceResponse) MarshalJSON() ([]byte, error) {
  4633. type NoMethod OrderinvoicesCreateRefundInvoiceResponse
  4634. raw := NoMethod(*s)
  4635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4636. }
  4637. type OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption struct {
  4638. // Description: Optional description of the refund reason.
  4639. Description string `json:"description,omitempty"`
  4640. // Reason: [required] Reason for the refund.
  4641. Reason string `json:"reason,omitempty"`
  4642. // ForceSendFields is a list of field names (e.g. "Description") to
  4643. // unconditionally include in API requests. By default, fields with
  4644. // empty values are omitted from API requests. However, any non-pointer,
  4645. // non-interface field appearing in ForceSendFields will be sent to the
  4646. // server regardless of whether the field is empty or not. This may be
  4647. // used to include empty fields in Patch requests.
  4648. ForceSendFields []string `json:"-"`
  4649. // NullFields is a list of field names (e.g. "Description") to include
  4650. // in API requests with the JSON null value. By default, fields with
  4651. // empty values are omitted from API requests. However, any field with
  4652. // an empty value appearing in NullFields will be sent to the server as
  4653. // null. It is an error if a field in this list has a non-empty value.
  4654. // This may be used to include null fields in Patch requests.
  4655. NullFields []string `json:"-"`
  4656. }
  4657. func (s *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption) MarshalJSON() ([]byte, error) {
  4658. type NoMethod OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceRefundOption
  4659. raw := NoMethod(*s)
  4660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4661. }
  4662. type OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption struct {
  4663. // Description: Optional description of the return reason.
  4664. Description string `json:"description,omitempty"`
  4665. // Reason: [required] Reason for the return.
  4666. Reason string `json:"reason,omitempty"`
  4667. // ForceSendFields is a list of field names (e.g. "Description") to
  4668. // unconditionally include in API requests. By default, fields with
  4669. // empty values are omitted from API requests. However, any non-pointer,
  4670. // non-interface field appearing in ForceSendFields will be sent to the
  4671. // server regardless of whether the field is empty or not. This may be
  4672. // used to include empty fields in Patch requests.
  4673. ForceSendFields []string `json:"-"`
  4674. // NullFields is a list of field names (e.g. "Description") to include
  4675. // in API requests with the JSON null value. By default, fields with
  4676. // empty values are omitted from API requests. However, any field with
  4677. // an empty value appearing in NullFields will be sent to the server as
  4678. // null. It is an error if a field in this list has a non-empty value.
  4679. // This may be used to include null fields in Patch requests.
  4680. NullFields []string `json:"-"`
  4681. }
  4682. func (s *OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption) MarshalJSON() ([]byte, error) {
  4683. type NoMethod OrderinvoicesCustomBatchRequestEntryCreateRefundInvoiceReturnOption
  4684. raw := NoMethod(*s)
  4685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4686. }
  4687. type OrderpaymentsNotifyAuthApprovedRequest struct {
  4688. // AuthAmountPretax: Authorized amount for pre-tax charge on user's
  4689. // credit card.
  4690. AuthAmountPretax *Price `json:"authAmountPretax,omitempty"`
  4691. // AuthAmountTax: Authorized amount for tax charge on user's credit
  4692. // card.
  4693. AuthAmountTax *Price `json:"authAmountTax,omitempty"`
  4694. // ForceSendFields is a list of field names (e.g. "AuthAmountPretax") to
  4695. // unconditionally include in API requests. By default, fields with
  4696. // empty values are omitted from API requests. However, any non-pointer,
  4697. // non-interface field appearing in ForceSendFields will be sent to the
  4698. // server regardless of whether the field is empty or not. This may be
  4699. // used to include empty fields in Patch requests.
  4700. ForceSendFields []string `json:"-"`
  4701. // NullFields is a list of field names (e.g. "AuthAmountPretax") to
  4702. // include in API requests with the JSON null value. By default, fields
  4703. // with empty values are omitted from API requests. However, any field
  4704. // with an empty value appearing in NullFields will be sent to the
  4705. // server as null. It is an error if a field in this list has a
  4706. // non-empty value. This may be used to include null fields in Patch
  4707. // requests.
  4708. NullFields []string `json:"-"`
  4709. }
  4710. func (s *OrderpaymentsNotifyAuthApprovedRequest) MarshalJSON() ([]byte, error) {
  4711. type NoMethod OrderpaymentsNotifyAuthApprovedRequest
  4712. raw := NoMethod(*s)
  4713. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4714. }
  4715. type OrderpaymentsNotifyAuthApprovedResponse struct {
  4716. // ExecutionStatus: The status of the execution.
  4717. ExecutionStatus string `json:"executionStatus,omitempty"`
  4718. // Kind: Identifies what kind of resource this is. Value: the fixed
  4719. // string "content#orderpaymentsNotifyAuthApprovedResponse".
  4720. Kind string `json:"kind,omitempty"`
  4721. // ServerResponse contains the HTTP response code and headers from the
  4722. // server.
  4723. googleapi.ServerResponse `json:"-"`
  4724. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  4725. // unconditionally include in API requests. By default, fields with
  4726. // empty values are omitted from API requests. However, any non-pointer,
  4727. // non-interface field appearing in ForceSendFields will be sent to the
  4728. // server regardless of whether the field is empty or not. This may be
  4729. // used to include empty fields in Patch requests.
  4730. ForceSendFields []string `json:"-"`
  4731. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  4732. // include in API requests with the JSON null value. By default, fields
  4733. // with empty values are omitted from API requests. However, any field
  4734. // with an empty value appearing in NullFields will be sent to the
  4735. // server as null. It is an error if a field in this list has a
  4736. // non-empty value. This may be used to include null fields in Patch
  4737. // requests.
  4738. NullFields []string `json:"-"`
  4739. }
  4740. func (s *OrderpaymentsNotifyAuthApprovedResponse) MarshalJSON() ([]byte, error) {
  4741. type NoMethod OrderpaymentsNotifyAuthApprovedResponse
  4742. raw := NoMethod(*s)
  4743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4744. }
  4745. type OrderpaymentsNotifyAuthDeclinedRequest struct {
  4746. // DeclineReason: Reason why payment authorization was declined.
  4747. DeclineReason string `json:"declineReason,omitempty"`
  4748. // ForceSendFields is a list of field names (e.g. "DeclineReason") to
  4749. // unconditionally include in API requests. By default, fields with
  4750. // empty values are omitted from API requests. However, any non-pointer,
  4751. // non-interface field appearing in ForceSendFields will be sent to the
  4752. // server regardless of whether the field is empty or not. This may be
  4753. // used to include empty fields in Patch requests.
  4754. ForceSendFields []string `json:"-"`
  4755. // NullFields is a list of field names (e.g. "DeclineReason") to include
  4756. // in API requests with the JSON null value. By default, fields with
  4757. // empty values are omitted from API requests. However, any field with
  4758. // an empty value appearing in NullFields will be sent to the server as
  4759. // null. It is an error if a field in this list has a non-empty value.
  4760. // This may be used to include null fields in Patch requests.
  4761. NullFields []string `json:"-"`
  4762. }
  4763. func (s *OrderpaymentsNotifyAuthDeclinedRequest) MarshalJSON() ([]byte, error) {
  4764. type NoMethod OrderpaymentsNotifyAuthDeclinedRequest
  4765. raw := NoMethod(*s)
  4766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4767. }
  4768. type OrderpaymentsNotifyAuthDeclinedResponse struct {
  4769. // ExecutionStatus: The status of the execution.
  4770. ExecutionStatus string `json:"executionStatus,omitempty"`
  4771. // Kind: Identifies what kind of resource this is. Value: the fixed
  4772. // string "content#orderpaymentsNotifyAuthDeclinedResponse".
  4773. Kind string `json:"kind,omitempty"`
  4774. // ServerResponse contains the HTTP response code and headers from the
  4775. // server.
  4776. googleapi.ServerResponse `json:"-"`
  4777. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  4778. // unconditionally include in API requests. By default, fields with
  4779. // empty values are omitted from API requests. However, any non-pointer,
  4780. // non-interface field appearing in ForceSendFields will be sent to the
  4781. // server regardless of whether the field is empty or not. This may be
  4782. // used to include empty fields in Patch requests.
  4783. ForceSendFields []string `json:"-"`
  4784. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  4785. // include in API requests with the JSON null value. By default, fields
  4786. // with empty values are omitted from API requests. However, any field
  4787. // with an empty value appearing in NullFields will be sent to the
  4788. // server as null. It is an error if a field in this list has a
  4789. // non-empty value. This may be used to include null fields in Patch
  4790. // requests.
  4791. NullFields []string `json:"-"`
  4792. }
  4793. func (s *OrderpaymentsNotifyAuthDeclinedResponse) MarshalJSON() ([]byte, error) {
  4794. type NoMethod OrderpaymentsNotifyAuthDeclinedResponse
  4795. raw := NoMethod(*s)
  4796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4797. }
  4798. type OrderpaymentsNotifyChargeRequest struct {
  4799. // ChargeState: Whether charge was successful.
  4800. ChargeState string `json:"chargeState,omitempty"`
  4801. // InvoiceId: Deprecated. Please use invoiceIds instead.
  4802. InvoiceId string `json:"invoiceId,omitempty"`
  4803. // InvoiceIds: Invoice IDs from the orderinvoices service that
  4804. // correspond to the charge.
  4805. InvoiceIds []string `json:"invoiceIds,omitempty"`
  4806. // ForceSendFields is a list of field names (e.g. "ChargeState") to
  4807. // unconditionally include in API requests. By default, fields with
  4808. // empty values are omitted from API requests. However, any non-pointer,
  4809. // non-interface field appearing in ForceSendFields will be sent to the
  4810. // server regardless of whether the field is empty or not. This may be
  4811. // used to include empty fields in Patch requests.
  4812. ForceSendFields []string `json:"-"`
  4813. // NullFields is a list of field names (e.g. "ChargeState") to include
  4814. // in API requests with the JSON null value. By default, fields with
  4815. // empty values are omitted from API requests. However, any field with
  4816. // an empty value appearing in NullFields will be sent to the server as
  4817. // null. It is an error if a field in this list has a non-empty value.
  4818. // This may be used to include null fields in Patch requests.
  4819. NullFields []string `json:"-"`
  4820. }
  4821. func (s *OrderpaymentsNotifyChargeRequest) MarshalJSON() ([]byte, error) {
  4822. type NoMethod OrderpaymentsNotifyChargeRequest
  4823. raw := NoMethod(*s)
  4824. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4825. }
  4826. type OrderpaymentsNotifyChargeResponse struct {
  4827. // ExecutionStatus: The status of the execution.
  4828. ExecutionStatus string `json:"executionStatus,omitempty"`
  4829. // Kind: Identifies what kind of resource this is. Value: the fixed
  4830. // string "content#orderpaymentsNotifyChargeResponse".
  4831. Kind string `json:"kind,omitempty"`
  4832. // ServerResponse contains the HTTP response code and headers from the
  4833. // server.
  4834. googleapi.ServerResponse `json:"-"`
  4835. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  4836. // unconditionally include in API requests. By default, fields with
  4837. // empty values are omitted from API requests. However, any non-pointer,
  4838. // non-interface field appearing in ForceSendFields will be sent to the
  4839. // server regardless of whether the field is empty or not. This may be
  4840. // used to include empty fields in Patch requests.
  4841. ForceSendFields []string `json:"-"`
  4842. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  4843. // include in API requests with the JSON null value. By default, fields
  4844. // with empty values are omitted from API requests. However, any field
  4845. // with an empty value appearing in NullFields will be sent to the
  4846. // server as null. It is an error if a field in this list has a
  4847. // non-empty value. This may be used to include null fields in Patch
  4848. // requests.
  4849. NullFields []string `json:"-"`
  4850. }
  4851. func (s *OrderpaymentsNotifyChargeResponse) MarshalJSON() ([]byte, error) {
  4852. type NoMethod OrderpaymentsNotifyChargeResponse
  4853. raw := NoMethod(*s)
  4854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4855. }
  4856. type OrderpaymentsNotifyRefundRequest struct {
  4857. // InvoiceId: Deprecated. Please use invoiceIds instead.
  4858. InvoiceId string `json:"invoiceId,omitempty"`
  4859. // InvoiceIds: Invoice IDs from the orderinvoices service that
  4860. // correspond to the refund.
  4861. InvoiceIds []string `json:"invoiceIds,omitempty"`
  4862. // RefundState: Whether refund was successful.
  4863. RefundState string `json:"refundState,omitempty"`
  4864. // ForceSendFields is a list of field names (e.g. "InvoiceId") to
  4865. // unconditionally include in API requests. By default, fields with
  4866. // empty values are omitted from API requests. However, any non-pointer,
  4867. // non-interface field appearing in ForceSendFields will be sent to the
  4868. // server regardless of whether the field is empty or not. This may be
  4869. // used to include empty fields in Patch requests.
  4870. ForceSendFields []string `json:"-"`
  4871. // NullFields is a list of field names (e.g. "InvoiceId") to include in
  4872. // API requests with the JSON null value. By default, fields with empty
  4873. // values are omitted from API requests. However, any field with an
  4874. // empty value appearing in NullFields will be sent to the server as
  4875. // null. It is an error if a field in this list has a non-empty value.
  4876. // This may be used to include null fields in Patch requests.
  4877. NullFields []string `json:"-"`
  4878. }
  4879. func (s *OrderpaymentsNotifyRefundRequest) MarshalJSON() ([]byte, error) {
  4880. type NoMethod OrderpaymentsNotifyRefundRequest
  4881. raw := NoMethod(*s)
  4882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4883. }
  4884. type OrderpaymentsNotifyRefundResponse struct {
  4885. // ExecutionStatus: The status of the execution.
  4886. ExecutionStatus string `json:"executionStatus,omitempty"`
  4887. // Kind: Identifies what kind of resource this is. Value: the fixed
  4888. // string "content#orderpaymentsNotifyRefundResponse".
  4889. Kind string `json:"kind,omitempty"`
  4890. // ServerResponse contains the HTTP response code and headers from the
  4891. // server.
  4892. googleapi.ServerResponse `json:"-"`
  4893. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  4894. // unconditionally include in API requests. By default, fields with
  4895. // empty values are omitted from API requests. However, any non-pointer,
  4896. // non-interface field appearing in ForceSendFields will be sent to the
  4897. // server regardless of whether the field is empty or not. This may be
  4898. // used to include empty fields in Patch requests.
  4899. ForceSendFields []string `json:"-"`
  4900. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  4901. // include in API requests with the JSON null value. By default, fields
  4902. // with empty values are omitted from API requests. However, any field
  4903. // with an empty value appearing in NullFields will be sent to the
  4904. // server as null. It is an error if a field in this list has a
  4905. // non-empty value. This may be used to include null fields in Patch
  4906. // requests.
  4907. NullFields []string `json:"-"`
  4908. }
  4909. func (s *OrderpaymentsNotifyRefundResponse) MarshalJSON() ([]byte, error) {
  4910. type NoMethod OrderpaymentsNotifyRefundResponse
  4911. raw := NoMethod(*s)
  4912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4913. }
  4914. type OrderreportsListDisbursementsResponse struct {
  4915. // Disbursements: The list of disbursements.
  4916. Disbursements []*OrderReportDisbursement `json:"disbursements,omitempty"`
  4917. // Kind: Identifies what kind of resource this is. Value: the fixed
  4918. // string "content#orderreportsListDisbursementsResponse".
  4919. Kind string `json:"kind,omitempty"`
  4920. // NextPageToken: The token for the retrieval of the next page of
  4921. // disbursements.
  4922. NextPageToken string `json:"nextPageToken,omitempty"`
  4923. // ServerResponse contains the HTTP response code and headers from the
  4924. // server.
  4925. googleapi.ServerResponse `json:"-"`
  4926. // ForceSendFields is a list of field names (e.g. "Disbursements") to
  4927. // unconditionally include in API requests. By default, fields with
  4928. // empty values are omitted from API requests. However, any non-pointer,
  4929. // non-interface field appearing in ForceSendFields will be sent to the
  4930. // server regardless of whether the field is empty or not. This may be
  4931. // used to include empty fields in Patch requests.
  4932. ForceSendFields []string `json:"-"`
  4933. // NullFields is a list of field names (e.g. "Disbursements") to include
  4934. // in API requests with the JSON null value. By default, fields with
  4935. // empty values are omitted from API requests. However, any field with
  4936. // an empty value appearing in NullFields will be sent to the server as
  4937. // null. It is an error if a field in this list has a non-empty value.
  4938. // This may be used to include null fields in Patch requests.
  4939. NullFields []string `json:"-"`
  4940. }
  4941. func (s *OrderreportsListDisbursementsResponse) MarshalJSON() ([]byte, error) {
  4942. type NoMethod OrderreportsListDisbursementsResponse
  4943. raw := NoMethod(*s)
  4944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4945. }
  4946. type OrderreportsListTransactionsResponse struct {
  4947. // Kind: Identifies what kind of resource this is. Value: the fixed
  4948. // string "content#orderreportsListTransactionsResponse".
  4949. Kind string `json:"kind,omitempty"`
  4950. // NextPageToken: The token for the retrieval of the next page of
  4951. // transactions.
  4952. NextPageToken string `json:"nextPageToken,omitempty"`
  4953. // Transactions: The list of transactions.
  4954. Transactions []*OrderReportTransaction `json:"transactions,omitempty"`
  4955. // ServerResponse contains the HTTP response code and headers from the
  4956. // server.
  4957. googleapi.ServerResponse `json:"-"`
  4958. // ForceSendFields is a list of field names (e.g. "Kind") to
  4959. // unconditionally include in API requests. By default, fields with
  4960. // empty values are omitted from API requests. However, any non-pointer,
  4961. // non-interface field appearing in ForceSendFields will be sent to the
  4962. // server regardless of whether the field is empty or not. This may be
  4963. // used to include empty fields in Patch requests.
  4964. ForceSendFields []string `json:"-"`
  4965. // NullFields is a list of field names (e.g. "Kind") to include in API
  4966. // requests with the JSON null value. By default, fields with empty
  4967. // values are omitted from API requests. However, any field with an
  4968. // empty value appearing in NullFields will be sent to the server as
  4969. // null. It is an error if a field in this list has a non-empty value.
  4970. // This may be used to include null fields in Patch requests.
  4971. NullFields []string `json:"-"`
  4972. }
  4973. func (s *OrderreportsListTransactionsResponse) MarshalJSON() ([]byte, error) {
  4974. type NoMethod OrderreportsListTransactionsResponse
  4975. raw := NoMethod(*s)
  4976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4977. }
  4978. type OrderreturnsListResponse struct {
  4979. // Kind: Identifies what kind of resource this is. Value: the fixed
  4980. // string "content#orderreturnsListResponse".
  4981. Kind string `json:"kind,omitempty"`
  4982. // NextPageToken: The token for the retrieval of the next page of
  4983. // returns.
  4984. NextPageToken string `json:"nextPageToken,omitempty"`
  4985. Resources []*MerchantOrderReturn `json:"resources,omitempty"`
  4986. // ServerResponse contains the HTTP response code and headers from the
  4987. // server.
  4988. googleapi.ServerResponse `json:"-"`
  4989. // ForceSendFields is a list of field names (e.g. "Kind") to
  4990. // unconditionally include in API requests. By default, fields with
  4991. // empty values are omitted from API requests. However, any non-pointer,
  4992. // non-interface field appearing in ForceSendFields will be sent to the
  4993. // server regardless of whether the field is empty or not. This may be
  4994. // used to include empty fields in Patch requests.
  4995. ForceSendFields []string `json:"-"`
  4996. // NullFields is a list of field names (e.g. "Kind") to include in API
  4997. // requests with the JSON null value. By default, fields with empty
  4998. // values are omitted from API requests. However, any field with an
  4999. // empty value appearing in NullFields will be sent to the server as
  5000. // null. It is an error if a field in this list has a non-empty value.
  5001. // This may be used to include null fields in Patch requests.
  5002. NullFields []string `json:"-"`
  5003. }
  5004. func (s *OrderreturnsListResponse) MarshalJSON() ([]byte, error) {
  5005. type NoMethod OrderreturnsListResponse
  5006. raw := NoMethod(*s)
  5007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5008. }
  5009. type OrdersAcknowledgeRequest struct {
  5010. // OperationId: The ID of the operation. Unique across all operations
  5011. // for a given order.
  5012. OperationId string `json:"operationId,omitempty"`
  5013. // ForceSendFields is a list of field names (e.g. "OperationId") to
  5014. // unconditionally include in API requests. By default, fields with
  5015. // empty values are omitted from API requests. However, any non-pointer,
  5016. // non-interface field appearing in ForceSendFields will be sent to the
  5017. // server regardless of whether the field is empty or not. This may be
  5018. // used to include empty fields in Patch requests.
  5019. ForceSendFields []string `json:"-"`
  5020. // NullFields is a list of field names (e.g. "OperationId") to include
  5021. // in API requests with the JSON null value. By default, fields with
  5022. // empty values are omitted from API requests. However, any field with
  5023. // an empty value appearing in NullFields will be sent to the server as
  5024. // null. It is an error if a field in this list has a non-empty value.
  5025. // This may be used to include null fields in Patch requests.
  5026. NullFields []string `json:"-"`
  5027. }
  5028. func (s *OrdersAcknowledgeRequest) MarshalJSON() ([]byte, error) {
  5029. type NoMethod OrdersAcknowledgeRequest
  5030. raw := NoMethod(*s)
  5031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5032. }
  5033. type OrdersAcknowledgeResponse struct {
  5034. // ExecutionStatus: The status of the execution.
  5035. ExecutionStatus string `json:"executionStatus,omitempty"`
  5036. // Kind: Identifies what kind of resource this is. Value: the fixed
  5037. // string "content#ordersAcknowledgeResponse".
  5038. Kind string `json:"kind,omitempty"`
  5039. // ServerResponse contains the HTTP response code and headers from the
  5040. // server.
  5041. googleapi.ServerResponse `json:"-"`
  5042. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  5043. // unconditionally include in API requests. By default, fields with
  5044. // empty values are omitted from API requests. However, any non-pointer,
  5045. // non-interface field appearing in ForceSendFields will be sent to the
  5046. // server regardless of whether the field is empty or not. This may be
  5047. // used to include empty fields in Patch requests.
  5048. ForceSendFields []string `json:"-"`
  5049. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  5050. // include in API requests with the JSON null value. By default, fields
  5051. // with empty values are omitted from API requests. However, any field
  5052. // with an empty value appearing in NullFields will be sent to the
  5053. // server as null. It is an error if a field in this list has a
  5054. // non-empty value. This may be used to include null fields in Patch
  5055. // requests.
  5056. NullFields []string `json:"-"`
  5057. }
  5058. func (s *OrdersAcknowledgeResponse) MarshalJSON() ([]byte, error) {
  5059. type NoMethod OrdersAcknowledgeResponse
  5060. raw := NoMethod(*s)
  5061. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5062. }
  5063. type OrdersAdvanceTestOrderResponse struct {
  5064. // Kind: Identifies what kind of resource this is. Value: the fixed
  5065. // string "content#ordersAdvanceTestOrderResponse".
  5066. Kind string `json:"kind,omitempty"`
  5067. // ServerResponse contains the HTTP response code and headers from the
  5068. // server.
  5069. googleapi.ServerResponse `json:"-"`
  5070. // ForceSendFields is a list of field names (e.g. "Kind") to
  5071. // unconditionally include in API requests. By default, fields with
  5072. // empty values are omitted from API requests. However, any non-pointer,
  5073. // non-interface field appearing in ForceSendFields will be sent to the
  5074. // server regardless of whether the field is empty or not. This may be
  5075. // used to include empty fields in Patch requests.
  5076. ForceSendFields []string `json:"-"`
  5077. // NullFields is a list of field names (e.g. "Kind") to include in API
  5078. // requests with the JSON null value. By default, fields with empty
  5079. // values are omitted from API requests. However, any field with an
  5080. // empty value appearing in NullFields will be sent to the server as
  5081. // null. It is an error if a field in this list has a non-empty value.
  5082. // This may be used to include null fields in Patch requests.
  5083. NullFields []string `json:"-"`
  5084. }
  5085. func (s *OrdersAdvanceTestOrderResponse) MarshalJSON() ([]byte, error) {
  5086. type NoMethod OrdersAdvanceTestOrderResponse
  5087. raw := NoMethod(*s)
  5088. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5089. }
  5090. type OrdersCancelLineItemRequest struct {
  5091. // Amount: Deprecated. Please use amountPretax and amountTax instead.
  5092. Amount *Price `json:"amount,omitempty"`
  5093. // AmountPretax: Amount to refund for the cancelation. Optional. If not
  5094. // set, Google will calculate the default based on the price and tax of
  5095. // the items involved. The amount must not be larger than the net amount
  5096. // left on the order.
  5097. AmountPretax *Price `json:"amountPretax,omitempty"`
  5098. // AmountTax: Tax amount that corresponds to cancellation amount in
  5099. // amountPretax. Optional, but if filled, then amountPretax must be set.
  5100. // Calculated automatically if not provided.
  5101. AmountTax *Price `json:"amountTax,omitempty"`
  5102. // LineItemId: The ID of the line item to cancel. Either lineItemId or
  5103. // productId is required.
  5104. LineItemId string `json:"lineItemId,omitempty"`
  5105. // OperationId: The ID of the operation. Unique across all operations
  5106. // for a given order.
  5107. OperationId string `json:"operationId,omitempty"`
  5108. // ProductId: The ID of the product to cancel. This is the REST ID used
  5109. // in the products service. Either lineItemId or productId is required.
  5110. ProductId string `json:"productId,omitempty"`
  5111. // Quantity: The quantity to cancel.
  5112. Quantity int64 `json:"quantity,omitempty"`
  5113. // Reason: The reason for the cancellation.
  5114. Reason string `json:"reason,omitempty"`
  5115. // ReasonText: The explanation of the reason.
  5116. ReasonText string `json:"reasonText,omitempty"`
  5117. // ForceSendFields is a list of field names (e.g. "Amount") to
  5118. // unconditionally include in API requests. By default, fields with
  5119. // empty values are omitted from API requests. However, any non-pointer,
  5120. // non-interface field appearing in ForceSendFields will be sent to the
  5121. // server regardless of whether the field is empty or not. This may be
  5122. // used to include empty fields in Patch requests.
  5123. ForceSendFields []string `json:"-"`
  5124. // NullFields is a list of field names (e.g. "Amount") to include in API
  5125. // requests with the JSON null value. By default, fields with empty
  5126. // values are omitted from API requests. However, any field with an
  5127. // empty value appearing in NullFields will be sent to the server as
  5128. // null. It is an error if a field in this list has a non-empty value.
  5129. // This may be used to include null fields in Patch requests.
  5130. NullFields []string `json:"-"`
  5131. }
  5132. func (s *OrdersCancelLineItemRequest) MarshalJSON() ([]byte, error) {
  5133. type NoMethod OrdersCancelLineItemRequest
  5134. raw := NoMethod(*s)
  5135. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5136. }
  5137. type OrdersCancelLineItemResponse struct {
  5138. // ExecutionStatus: The status of the execution.
  5139. ExecutionStatus string `json:"executionStatus,omitempty"`
  5140. // Kind: Identifies what kind of resource this is. Value: the fixed
  5141. // string "content#ordersCancelLineItemResponse".
  5142. Kind string `json:"kind,omitempty"`
  5143. // ServerResponse contains the HTTP response code and headers from the
  5144. // server.
  5145. googleapi.ServerResponse `json:"-"`
  5146. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  5147. // unconditionally include in API requests. By default, fields with
  5148. // empty values are omitted from API requests. However, any non-pointer,
  5149. // non-interface field appearing in ForceSendFields will be sent to the
  5150. // server regardless of whether the field is empty or not. This may be
  5151. // used to include empty fields in Patch requests.
  5152. ForceSendFields []string `json:"-"`
  5153. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  5154. // include in API requests with the JSON null value. By default, fields
  5155. // with empty values are omitted from API requests. However, any field
  5156. // with an empty value appearing in NullFields will be sent to the
  5157. // server as null. It is an error if a field in this list has a
  5158. // non-empty value. This may be used to include null fields in Patch
  5159. // requests.
  5160. NullFields []string `json:"-"`
  5161. }
  5162. func (s *OrdersCancelLineItemResponse) MarshalJSON() ([]byte, error) {
  5163. type NoMethod OrdersCancelLineItemResponse
  5164. raw := NoMethod(*s)
  5165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5166. }
  5167. type OrdersCancelRequest struct {
  5168. // OperationId: The ID of the operation. Unique across all operations
  5169. // for a given order.
  5170. OperationId string `json:"operationId,omitempty"`
  5171. // Reason: The reason for the cancellation.
  5172. Reason string `json:"reason,omitempty"`
  5173. // ReasonText: The explanation of the reason.
  5174. ReasonText string `json:"reasonText,omitempty"`
  5175. // ForceSendFields is a list of field names (e.g. "OperationId") to
  5176. // unconditionally include in API requests. By default, fields with
  5177. // empty values are omitted from API requests. However, any non-pointer,
  5178. // non-interface field appearing in ForceSendFields will be sent to the
  5179. // server regardless of whether the field is empty or not. This may be
  5180. // used to include empty fields in Patch requests.
  5181. ForceSendFields []string `json:"-"`
  5182. // NullFields is a list of field names (e.g. "OperationId") to include
  5183. // in API requests with the JSON null value. By default, fields with
  5184. // empty values are omitted from API requests. However, any field with
  5185. // an empty value appearing in NullFields will be sent to the server as
  5186. // null. It is an error if a field in this list has a non-empty value.
  5187. // This may be used to include null fields in Patch requests.
  5188. NullFields []string `json:"-"`
  5189. }
  5190. func (s *OrdersCancelRequest) MarshalJSON() ([]byte, error) {
  5191. type NoMethod OrdersCancelRequest
  5192. raw := NoMethod(*s)
  5193. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5194. }
  5195. type OrdersCancelResponse struct {
  5196. // ExecutionStatus: The status of the execution.
  5197. ExecutionStatus string `json:"executionStatus,omitempty"`
  5198. // Kind: Identifies what kind of resource this is. Value: the fixed
  5199. // string "content#ordersCancelResponse".
  5200. Kind string `json:"kind,omitempty"`
  5201. // ServerResponse contains the HTTP response code and headers from the
  5202. // server.
  5203. googleapi.ServerResponse `json:"-"`
  5204. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  5205. // unconditionally include in API requests. By default, fields with
  5206. // empty values are omitted from API requests. However, any non-pointer,
  5207. // non-interface field appearing in ForceSendFields will be sent to the
  5208. // server regardless of whether the field is empty or not. This may be
  5209. // used to include empty fields in Patch requests.
  5210. ForceSendFields []string `json:"-"`
  5211. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  5212. // include in API requests with the JSON null value. By default, fields
  5213. // with empty values are omitted from API requests. However, any field
  5214. // with an empty value appearing in NullFields will be sent to the
  5215. // server as null. It is an error if a field in this list has a
  5216. // non-empty value. This may be used to include null fields in Patch
  5217. // requests.
  5218. NullFields []string `json:"-"`
  5219. }
  5220. func (s *OrdersCancelResponse) MarshalJSON() ([]byte, error) {
  5221. type NoMethod OrdersCancelResponse
  5222. raw := NoMethod(*s)
  5223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5224. }
  5225. type OrdersCancelTestOrderByCustomerRequest struct {
  5226. // Reason: The reason for the cancellation.
  5227. Reason string `json:"reason,omitempty"`
  5228. // ForceSendFields is a list of field names (e.g. "Reason") to
  5229. // unconditionally include in API requests. By default, fields with
  5230. // empty values are omitted from API requests. However, any non-pointer,
  5231. // non-interface field appearing in ForceSendFields will be sent to the
  5232. // server regardless of whether the field is empty or not. This may be
  5233. // used to include empty fields in Patch requests.
  5234. ForceSendFields []string `json:"-"`
  5235. // NullFields is a list of field names (e.g. "Reason") to include in API
  5236. // requests with the JSON null value. By default, fields with empty
  5237. // values are omitted from API requests. However, any field with an
  5238. // empty value appearing in NullFields will be sent to the server as
  5239. // null. It is an error if a field in this list has a non-empty value.
  5240. // This may be used to include null fields in Patch requests.
  5241. NullFields []string `json:"-"`
  5242. }
  5243. func (s *OrdersCancelTestOrderByCustomerRequest) MarshalJSON() ([]byte, error) {
  5244. type NoMethod OrdersCancelTestOrderByCustomerRequest
  5245. raw := NoMethod(*s)
  5246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5247. }
  5248. type OrdersCancelTestOrderByCustomerResponse struct {
  5249. // Kind: Identifies what kind of resource this is. Value: the fixed
  5250. // string "content#ordersCancelTestOrderByCustomerResponse".
  5251. Kind string `json:"kind,omitempty"`
  5252. // ServerResponse contains the HTTP response code and headers from the
  5253. // server.
  5254. googleapi.ServerResponse `json:"-"`
  5255. // ForceSendFields is a list of field names (e.g. "Kind") to
  5256. // unconditionally include in API requests. By default, fields with
  5257. // empty values are omitted from API requests. However, any non-pointer,
  5258. // non-interface field appearing in ForceSendFields will be sent to the
  5259. // server regardless of whether the field is empty or not. This may be
  5260. // used to include empty fields in Patch requests.
  5261. ForceSendFields []string `json:"-"`
  5262. // NullFields is a list of field names (e.g. "Kind") to include in API
  5263. // requests with the JSON null value. By default, fields with empty
  5264. // values are omitted from API requests. However, any field with an
  5265. // empty value appearing in NullFields will be sent to the server as
  5266. // null. It is an error if a field in this list has a non-empty value.
  5267. // This may be used to include null fields in Patch requests.
  5268. NullFields []string `json:"-"`
  5269. }
  5270. func (s *OrdersCancelTestOrderByCustomerResponse) MarshalJSON() ([]byte, error) {
  5271. type NoMethod OrdersCancelTestOrderByCustomerResponse
  5272. raw := NoMethod(*s)
  5273. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5274. }
  5275. type OrdersCreateTestOrderRequest struct {
  5276. // Country: The CLDR territory code of the country of the test order to
  5277. // create. Affects the currency and addresses of orders created via
  5278. // template_name, or the addresses of orders created via
  5279. // test_order.
  5280. //
  5281. // Acceptable values are:
  5282. // - "US"
  5283. // - "FR" Defaults to US.
  5284. Country string `json:"country,omitempty"`
  5285. // TemplateName: The test order template to use. Specify as an
  5286. // alternative to testOrder as a shortcut for retrieving a template and
  5287. // then creating an order using that template.
  5288. TemplateName string `json:"templateName,omitempty"`
  5289. // TestOrder: The test order to create.
  5290. TestOrder *TestOrder `json:"testOrder,omitempty"`
  5291. // ForceSendFields is a list of field names (e.g. "Country") to
  5292. // unconditionally include in API requests. By default, fields with
  5293. // empty values are omitted from API requests. However, any non-pointer,
  5294. // non-interface field appearing in ForceSendFields will be sent to the
  5295. // server regardless of whether the field is empty or not. This may be
  5296. // used to include empty fields in Patch requests.
  5297. ForceSendFields []string `json:"-"`
  5298. // NullFields is a list of field names (e.g. "Country") to include in
  5299. // API requests with the JSON null value. By default, fields with empty
  5300. // values are omitted from API requests. However, any field with an
  5301. // empty value appearing in NullFields will be sent to the server as
  5302. // null. It is an error if a field in this list has a non-empty value.
  5303. // This may be used to include null fields in Patch requests.
  5304. NullFields []string `json:"-"`
  5305. }
  5306. func (s *OrdersCreateTestOrderRequest) MarshalJSON() ([]byte, error) {
  5307. type NoMethod OrdersCreateTestOrderRequest
  5308. raw := NoMethod(*s)
  5309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5310. }
  5311. type OrdersCreateTestOrderResponse struct {
  5312. // Kind: Identifies what kind of resource this is. Value: the fixed
  5313. // string "content#ordersCreateTestOrderResponse".
  5314. Kind string `json:"kind,omitempty"`
  5315. // OrderId: The ID of the newly created test order.
  5316. OrderId string `json:"orderId,omitempty"`
  5317. // ServerResponse contains the HTTP response code and headers from the
  5318. // server.
  5319. googleapi.ServerResponse `json:"-"`
  5320. // ForceSendFields is a list of field names (e.g. "Kind") to
  5321. // unconditionally include in API requests. By default, fields with
  5322. // empty values are omitted from API requests. However, any non-pointer,
  5323. // non-interface field appearing in ForceSendFields will be sent to the
  5324. // server regardless of whether the field is empty or not. This may be
  5325. // used to include empty fields in Patch requests.
  5326. ForceSendFields []string `json:"-"`
  5327. // NullFields is a list of field names (e.g. "Kind") to include in API
  5328. // requests with the JSON null value. By default, fields with empty
  5329. // values are omitted from API requests. However, any field with an
  5330. // empty value appearing in NullFields will be sent to the server as
  5331. // null. It is an error if a field in this list has a non-empty value.
  5332. // This may be used to include null fields in Patch requests.
  5333. NullFields []string `json:"-"`
  5334. }
  5335. func (s *OrdersCreateTestOrderResponse) MarshalJSON() ([]byte, error) {
  5336. type NoMethod OrdersCreateTestOrderResponse
  5337. raw := NoMethod(*s)
  5338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5339. }
  5340. type OrdersCreateTestReturnRequest struct {
  5341. // Items: Returned items.
  5342. Items []*OrdersCustomBatchRequestEntryCreateTestReturnReturnItem `json:"items,omitempty"`
  5343. // ForceSendFields is a list of field names (e.g. "Items") to
  5344. // unconditionally include in API requests. By default, fields with
  5345. // empty values are omitted from API requests. However, any non-pointer,
  5346. // non-interface field appearing in ForceSendFields will be sent to the
  5347. // server regardless of whether the field is empty or not. This may be
  5348. // used to include empty fields in Patch requests.
  5349. ForceSendFields []string `json:"-"`
  5350. // NullFields is a list of field names (e.g. "Items") to include in API
  5351. // requests with the JSON null value. By default, fields with empty
  5352. // values are omitted from API requests. However, any field with an
  5353. // empty value appearing in NullFields will be sent to the server as
  5354. // null. It is an error if a field in this list has a non-empty value.
  5355. // This may be used to include null fields in Patch requests.
  5356. NullFields []string `json:"-"`
  5357. }
  5358. func (s *OrdersCreateTestReturnRequest) MarshalJSON() ([]byte, error) {
  5359. type NoMethod OrdersCreateTestReturnRequest
  5360. raw := NoMethod(*s)
  5361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5362. }
  5363. type OrdersCreateTestReturnResponse struct {
  5364. // Kind: Identifies what kind of resource this is. Value: the fixed
  5365. // string "content#ordersCreateTestReturnResponse".
  5366. Kind string `json:"kind,omitempty"`
  5367. // ReturnId: The ID of the newly created test order return.
  5368. ReturnId string `json:"returnId,omitempty"`
  5369. // ServerResponse contains the HTTP response code and headers from the
  5370. // server.
  5371. googleapi.ServerResponse `json:"-"`
  5372. // ForceSendFields is a list of field names (e.g. "Kind") to
  5373. // unconditionally include in API requests. By default, fields with
  5374. // empty values are omitted from API requests. However, any non-pointer,
  5375. // non-interface field appearing in ForceSendFields will be sent to the
  5376. // server regardless of whether the field is empty or not. This may be
  5377. // used to include empty fields in Patch requests.
  5378. ForceSendFields []string `json:"-"`
  5379. // NullFields is a list of field names (e.g. "Kind") to include in API
  5380. // requests with the JSON null value. By default, fields with empty
  5381. // values are omitted from API requests. However, any field with an
  5382. // empty value appearing in NullFields will be sent to the server as
  5383. // null. It is an error if a field in this list has a non-empty value.
  5384. // This may be used to include null fields in Patch requests.
  5385. NullFields []string `json:"-"`
  5386. }
  5387. func (s *OrdersCreateTestReturnResponse) MarshalJSON() ([]byte, error) {
  5388. type NoMethod OrdersCreateTestReturnResponse
  5389. raw := NoMethod(*s)
  5390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5391. }
  5392. type OrdersCustomBatchRequest struct {
  5393. // Entries: The request entries to be processed in the batch.
  5394. Entries []*OrdersCustomBatchRequestEntry `json:"entries,omitempty"`
  5395. // ForceSendFields is a list of field names (e.g. "Entries") to
  5396. // unconditionally include in API requests. By default, fields with
  5397. // empty values are omitted from API requests. However, any non-pointer,
  5398. // non-interface field appearing in ForceSendFields will be sent to the
  5399. // server regardless of whether the field is empty or not. This may be
  5400. // used to include empty fields in Patch requests.
  5401. ForceSendFields []string `json:"-"`
  5402. // NullFields is a list of field names (e.g. "Entries") to include in
  5403. // API requests with the JSON null value. By default, fields with empty
  5404. // values are omitted from API requests. However, any field with an
  5405. // empty value appearing in NullFields will be sent to the server as
  5406. // null. It is an error if a field in this list has a non-empty value.
  5407. // This may be used to include null fields in Patch requests.
  5408. NullFields []string `json:"-"`
  5409. }
  5410. func (s *OrdersCustomBatchRequest) MarshalJSON() ([]byte, error) {
  5411. type NoMethod OrdersCustomBatchRequest
  5412. raw := NoMethod(*s)
  5413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5414. }
  5415. type OrdersCustomBatchRequestEntry struct {
  5416. // BatchId: An entry ID, unique within the batch request.
  5417. BatchId int64 `json:"batchId,omitempty"`
  5418. // Cancel: Required for cancel method.
  5419. Cancel *OrdersCustomBatchRequestEntryCancel `json:"cancel,omitempty"`
  5420. // CancelLineItem: Required for cancelLineItem method.
  5421. CancelLineItem *OrdersCustomBatchRequestEntryCancelLineItem `json:"cancelLineItem,omitempty"`
  5422. // InStoreRefundLineItem: Required for inStoreReturnLineItem method.
  5423. InStoreRefundLineItem *OrdersCustomBatchRequestEntryInStoreRefundLineItem `json:"inStoreRefundLineItem,omitempty"`
  5424. // MerchantId: The ID of the managing account.
  5425. MerchantId uint64 `json:"merchantId,omitempty,string"`
  5426. // MerchantOrderId: The merchant order ID. Required for
  5427. // updateMerchantOrderId and getByMerchantOrderId methods.
  5428. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  5429. // Method: The method to apply.
  5430. Method string `json:"method,omitempty"`
  5431. // OperationId: The ID of the operation. Unique across all operations
  5432. // for a given order. Required for all methods beside get and
  5433. // getByMerchantOrderId.
  5434. OperationId string `json:"operationId,omitempty"`
  5435. // OrderId: The ID of the order. Required for all methods beside
  5436. // getByMerchantOrderId.
  5437. OrderId string `json:"orderId,omitempty"`
  5438. // Refund: Required for refund method.
  5439. Refund *OrdersCustomBatchRequestEntryRefund `json:"refund,omitempty"`
  5440. // RejectReturnLineItem: Required for rejectReturnLineItem method.
  5441. RejectReturnLineItem *OrdersCustomBatchRequestEntryRejectReturnLineItem `json:"rejectReturnLineItem,omitempty"`
  5442. // ReturnLineItem: Required for returnLineItem method.
  5443. ReturnLineItem *OrdersCustomBatchRequestEntryReturnLineItem `json:"returnLineItem,omitempty"`
  5444. // ReturnRefundLineItem: Required for returnRefundLineItem method.
  5445. ReturnRefundLineItem *OrdersCustomBatchRequestEntryReturnRefundLineItem `json:"returnRefundLineItem,omitempty"`
  5446. // SetLineItemMetadata: Required for setLineItemMetadata method.
  5447. SetLineItemMetadata *OrdersCustomBatchRequestEntrySetLineItemMetadata `json:"setLineItemMetadata,omitempty"`
  5448. // ShipLineItems: Required for shipLineItems method.
  5449. ShipLineItems *OrdersCustomBatchRequestEntryShipLineItems `json:"shipLineItems,omitempty"`
  5450. // UpdateLineItemShippingDetails: Required for
  5451. // updateLineItemShippingDate method.
  5452. UpdateLineItemShippingDetails *OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails `json:"updateLineItemShippingDetails,omitempty"`
  5453. // UpdateShipment: Required for updateShipment method.
  5454. UpdateShipment *OrdersCustomBatchRequestEntryUpdateShipment `json:"updateShipment,omitempty"`
  5455. // ForceSendFields is a list of field names (e.g. "BatchId") to
  5456. // unconditionally include in API requests. By default, fields with
  5457. // empty values are omitted from API requests. However, any non-pointer,
  5458. // non-interface field appearing in ForceSendFields will be sent to the
  5459. // server regardless of whether the field is empty or not. This may be
  5460. // used to include empty fields in Patch requests.
  5461. ForceSendFields []string `json:"-"`
  5462. // NullFields is a list of field names (e.g. "BatchId") to include in
  5463. // API requests with the JSON null value. By default, fields with empty
  5464. // values are omitted from API requests. However, any field with an
  5465. // empty value appearing in NullFields will be sent to the server as
  5466. // null. It is an error if a field in this list has a non-empty value.
  5467. // This may be used to include null fields in Patch requests.
  5468. NullFields []string `json:"-"`
  5469. }
  5470. func (s *OrdersCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  5471. type NoMethod OrdersCustomBatchRequestEntry
  5472. raw := NoMethod(*s)
  5473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5474. }
  5475. type OrdersCustomBatchRequestEntryCancel struct {
  5476. // Reason: The reason for the cancellation.
  5477. Reason string `json:"reason,omitempty"`
  5478. // ReasonText: The explanation of the reason.
  5479. ReasonText string `json:"reasonText,omitempty"`
  5480. // ForceSendFields is a list of field names (e.g. "Reason") to
  5481. // unconditionally include in API requests. By default, fields with
  5482. // empty values are omitted from API requests. However, any non-pointer,
  5483. // non-interface field appearing in ForceSendFields will be sent to the
  5484. // server regardless of whether the field is empty or not. This may be
  5485. // used to include empty fields in Patch requests.
  5486. ForceSendFields []string `json:"-"`
  5487. // NullFields is a list of field names (e.g. "Reason") to include in API
  5488. // requests with the JSON null value. By default, fields with empty
  5489. // values are omitted from API requests. However, any field with an
  5490. // empty value appearing in NullFields will be sent to the server as
  5491. // null. It is an error if a field in this list has a non-empty value.
  5492. // This may be used to include null fields in Patch requests.
  5493. NullFields []string `json:"-"`
  5494. }
  5495. func (s *OrdersCustomBatchRequestEntryCancel) MarshalJSON() ([]byte, error) {
  5496. type NoMethod OrdersCustomBatchRequestEntryCancel
  5497. raw := NoMethod(*s)
  5498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5499. }
  5500. type OrdersCustomBatchRequestEntryCancelLineItem struct {
  5501. // Amount: Deprecated. Please use amountPretax and amountTax instead.
  5502. Amount *Price `json:"amount,omitempty"`
  5503. // AmountPretax: Amount to refund for the cancelation. Optional. If not
  5504. // set, Google will calculate the default based on the price and tax of
  5505. // the items involved. The amount must not be larger than the net amount
  5506. // left on the order.
  5507. AmountPretax *Price `json:"amountPretax,omitempty"`
  5508. // AmountTax: Tax amount that corresponds to cancellation amount in
  5509. // amountPretax. Optional, but if filled, then amountPretax must be set.
  5510. // Calculated automatically if not provided.
  5511. AmountTax *Price `json:"amountTax,omitempty"`
  5512. // LineItemId: The ID of the line item to cancel. Either lineItemId or
  5513. // productId is required.
  5514. LineItemId string `json:"lineItemId,omitempty"`
  5515. // ProductId: The ID of the product to cancel. This is the REST ID used
  5516. // in the products service. Either lineItemId or productId is required.
  5517. ProductId string `json:"productId,omitempty"`
  5518. // Quantity: The quantity to cancel.
  5519. Quantity int64 `json:"quantity,omitempty"`
  5520. // Reason: The reason for the cancellation.
  5521. Reason string `json:"reason,omitempty"`
  5522. // ReasonText: The explanation of the reason.
  5523. ReasonText string `json:"reasonText,omitempty"`
  5524. // ForceSendFields is a list of field names (e.g. "Amount") to
  5525. // unconditionally include in API requests. By default, fields with
  5526. // empty values are omitted from API requests. However, any non-pointer,
  5527. // non-interface field appearing in ForceSendFields will be sent to the
  5528. // server regardless of whether the field is empty or not. This may be
  5529. // used to include empty fields in Patch requests.
  5530. ForceSendFields []string `json:"-"`
  5531. // NullFields is a list of field names (e.g. "Amount") to include in API
  5532. // requests with the JSON null value. By default, fields with empty
  5533. // values are omitted from API requests. However, any field with an
  5534. // empty value appearing in NullFields will be sent to the server as
  5535. // null. It is an error if a field in this list has a non-empty value.
  5536. // This may be used to include null fields in Patch requests.
  5537. NullFields []string `json:"-"`
  5538. }
  5539. func (s *OrdersCustomBatchRequestEntryCancelLineItem) MarshalJSON() ([]byte, error) {
  5540. type NoMethod OrdersCustomBatchRequestEntryCancelLineItem
  5541. raw := NoMethod(*s)
  5542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5543. }
  5544. type OrdersCustomBatchRequestEntryCreateTestReturnReturnItem struct {
  5545. // LineItemId: The ID of the line item to return.
  5546. LineItemId string `json:"lineItemId,omitempty"`
  5547. // Quantity: Quantity that is returned.
  5548. Quantity int64 `json:"quantity,omitempty"`
  5549. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  5550. // unconditionally include in API requests. By default, fields with
  5551. // empty values are omitted from API requests. However, any non-pointer,
  5552. // non-interface field appearing in ForceSendFields will be sent to the
  5553. // server regardless of whether the field is empty or not. This may be
  5554. // used to include empty fields in Patch requests.
  5555. ForceSendFields []string `json:"-"`
  5556. // NullFields is a list of field names (e.g. "LineItemId") to include in
  5557. // API requests with the JSON null value. By default, fields with empty
  5558. // values are omitted from API requests. However, any field with an
  5559. // empty value appearing in NullFields will be sent to the server as
  5560. // null. It is an error if a field in this list has a non-empty value.
  5561. // This may be used to include null fields in Patch requests.
  5562. NullFields []string `json:"-"`
  5563. }
  5564. func (s *OrdersCustomBatchRequestEntryCreateTestReturnReturnItem) MarshalJSON() ([]byte, error) {
  5565. type NoMethod OrdersCustomBatchRequestEntryCreateTestReturnReturnItem
  5566. raw := NoMethod(*s)
  5567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5568. }
  5569. type OrdersCustomBatchRequestEntryInStoreRefundLineItem struct {
  5570. // AmountPretax: The amount that is refunded. Required.
  5571. AmountPretax *Price `json:"amountPretax,omitempty"`
  5572. // AmountTax: Tax amount that correspond to refund amount in
  5573. // amountPretax. Required.
  5574. AmountTax *Price `json:"amountTax,omitempty"`
  5575. // LineItemId: The ID of the line item to return. Either lineItemId or
  5576. // productId is required.
  5577. LineItemId string `json:"lineItemId,omitempty"`
  5578. // ProductId: The ID of the product to return. This is the REST ID used
  5579. // in the products service. Either lineItemId or productId is required.
  5580. ProductId string `json:"productId,omitempty"`
  5581. // Quantity: The quantity to return and refund.
  5582. Quantity int64 `json:"quantity,omitempty"`
  5583. // Reason: The reason for the return.
  5584. Reason string `json:"reason,omitempty"`
  5585. // ReasonText: The explanation of the reason.
  5586. ReasonText string `json:"reasonText,omitempty"`
  5587. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  5588. // unconditionally include in API requests. By default, fields with
  5589. // empty values are omitted from API requests. However, any non-pointer,
  5590. // non-interface field appearing in ForceSendFields will be sent to the
  5591. // server regardless of whether the field is empty or not. This may be
  5592. // used to include empty fields in Patch requests.
  5593. ForceSendFields []string `json:"-"`
  5594. // NullFields is a list of field names (e.g. "AmountPretax") to include
  5595. // in API requests with the JSON null value. By default, fields with
  5596. // empty values are omitted from API requests. However, any field with
  5597. // an empty value appearing in NullFields will be sent to the server as
  5598. // null. It is an error if a field in this list has a non-empty value.
  5599. // This may be used to include null fields in Patch requests.
  5600. NullFields []string `json:"-"`
  5601. }
  5602. func (s *OrdersCustomBatchRequestEntryInStoreRefundLineItem) MarshalJSON() ([]byte, error) {
  5603. type NoMethod OrdersCustomBatchRequestEntryInStoreRefundLineItem
  5604. raw := NoMethod(*s)
  5605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5606. }
  5607. type OrdersCustomBatchRequestEntryRefund struct {
  5608. // Amount: Deprecated. Please use amountPretax and amountTax instead.
  5609. Amount *Price `json:"amount,omitempty"`
  5610. // AmountPretax: The amount that is refunded. Either amount or
  5611. // amountPretax should be filled.
  5612. AmountPretax *Price `json:"amountPretax,omitempty"`
  5613. // AmountTax: Tax amount that corresponds to refund amount in
  5614. // amountPretax. Optional, but if filled, amountPretax must be set.
  5615. // Calculated automatically if not provided.
  5616. AmountTax *Price `json:"amountTax,omitempty"`
  5617. // Reason: The reason for the refund.
  5618. Reason string `json:"reason,omitempty"`
  5619. // ReasonText: The explanation of the reason.
  5620. ReasonText string `json:"reasonText,omitempty"`
  5621. // ForceSendFields is a list of field names (e.g. "Amount") to
  5622. // unconditionally include in API requests. By default, fields with
  5623. // empty values are omitted from API requests. However, any non-pointer,
  5624. // non-interface field appearing in ForceSendFields will be sent to the
  5625. // server regardless of whether the field is empty or not. This may be
  5626. // used to include empty fields in Patch requests.
  5627. ForceSendFields []string `json:"-"`
  5628. // NullFields is a list of field names (e.g. "Amount") to include in API
  5629. // requests with the JSON null value. By default, fields with empty
  5630. // values are omitted from API requests. However, any field with an
  5631. // empty value appearing in NullFields will be sent to the server as
  5632. // null. It is an error if a field in this list has a non-empty value.
  5633. // This may be used to include null fields in Patch requests.
  5634. NullFields []string `json:"-"`
  5635. }
  5636. func (s *OrdersCustomBatchRequestEntryRefund) MarshalJSON() ([]byte, error) {
  5637. type NoMethod OrdersCustomBatchRequestEntryRefund
  5638. raw := NoMethod(*s)
  5639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5640. }
  5641. type OrdersCustomBatchRequestEntryRejectReturnLineItem struct {
  5642. // LineItemId: The ID of the line item to return. Either lineItemId or
  5643. // productId is required.
  5644. LineItemId string `json:"lineItemId,omitempty"`
  5645. // ProductId: The ID of the product to return. This is the REST ID used
  5646. // in the products service. Either lineItemId or productId is required.
  5647. ProductId string `json:"productId,omitempty"`
  5648. // Quantity: The quantity to return and refund.
  5649. Quantity int64 `json:"quantity,omitempty"`
  5650. // Reason: The reason for the return.
  5651. Reason string `json:"reason,omitempty"`
  5652. // ReasonText: The explanation of the reason.
  5653. ReasonText string `json:"reasonText,omitempty"`
  5654. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  5655. // unconditionally include in API requests. By default, fields with
  5656. // empty values are omitted from API requests. However, any non-pointer,
  5657. // non-interface field appearing in ForceSendFields will be sent to the
  5658. // server regardless of whether the field is empty or not. This may be
  5659. // used to include empty fields in Patch requests.
  5660. ForceSendFields []string `json:"-"`
  5661. // NullFields is a list of field names (e.g. "LineItemId") to include in
  5662. // API requests with the JSON null value. By default, fields with empty
  5663. // values are omitted from API requests. However, any field with an
  5664. // empty value appearing in NullFields will be sent to the server as
  5665. // null. It is an error if a field in this list has a non-empty value.
  5666. // This may be used to include null fields in Patch requests.
  5667. NullFields []string `json:"-"`
  5668. }
  5669. func (s *OrdersCustomBatchRequestEntryRejectReturnLineItem) MarshalJSON() ([]byte, error) {
  5670. type NoMethod OrdersCustomBatchRequestEntryRejectReturnLineItem
  5671. raw := NoMethod(*s)
  5672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5673. }
  5674. type OrdersCustomBatchRequestEntryReturnLineItem struct {
  5675. // LineItemId: The ID of the line item to return. Either lineItemId or
  5676. // productId is required.
  5677. LineItemId string `json:"lineItemId,omitempty"`
  5678. // ProductId: The ID of the product to return. This is the REST ID used
  5679. // in the products service. Either lineItemId or productId is required.
  5680. ProductId string `json:"productId,omitempty"`
  5681. // Quantity: The quantity to return.
  5682. Quantity int64 `json:"quantity,omitempty"`
  5683. // Reason: The reason for the return.
  5684. Reason string `json:"reason,omitempty"`
  5685. // ReasonText: The explanation of the reason.
  5686. ReasonText string `json:"reasonText,omitempty"`
  5687. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  5688. // unconditionally include in API requests. By default, fields with
  5689. // empty values are omitted from API requests. However, any non-pointer,
  5690. // non-interface field appearing in ForceSendFields will be sent to the
  5691. // server regardless of whether the field is empty or not. This may be
  5692. // used to include empty fields in Patch requests.
  5693. ForceSendFields []string `json:"-"`
  5694. // NullFields is a list of field names (e.g. "LineItemId") to include in
  5695. // API requests with the JSON null value. By default, fields with empty
  5696. // values are omitted from API requests. However, any field with an
  5697. // empty value appearing in NullFields will be sent to the server as
  5698. // null. It is an error if a field in this list has a non-empty value.
  5699. // This may be used to include null fields in Patch requests.
  5700. NullFields []string `json:"-"`
  5701. }
  5702. func (s *OrdersCustomBatchRequestEntryReturnLineItem) MarshalJSON() ([]byte, error) {
  5703. type NoMethod OrdersCustomBatchRequestEntryReturnLineItem
  5704. raw := NoMethod(*s)
  5705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5706. }
  5707. type OrdersCustomBatchRequestEntryReturnRefundLineItem struct {
  5708. // AmountPretax: The amount that is refunded. If omitted, refundless
  5709. // return is assumed (same as calling returnLineItem method).
  5710. AmountPretax *Price `json:"amountPretax,omitempty"`
  5711. // AmountTax: Tax amount that corresponds to refund amount in
  5712. // amountPretax. Optional, but if filled, then amountPretax must be set.
  5713. // Calculated automatically if not provided.
  5714. AmountTax *Price `json:"amountTax,omitempty"`
  5715. // LineItemId: The ID of the line item to return. Either lineItemId or
  5716. // productId is required.
  5717. LineItemId string `json:"lineItemId,omitempty"`
  5718. // ProductId: The ID of the product to return. This is the REST ID used
  5719. // in the products service. Either lineItemId or productId is required.
  5720. ProductId string `json:"productId,omitempty"`
  5721. // Quantity: The quantity to return and refund.
  5722. Quantity int64 `json:"quantity,omitempty"`
  5723. // Reason: The reason for the return.
  5724. Reason string `json:"reason,omitempty"`
  5725. // ReasonText: The explanation of the reason.
  5726. ReasonText string `json:"reasonText,omitempty"`
  5727. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  5728. // unconditionally include in API requests. By default, fields with
  5729. // empty values are omitted from API requests. However, any non-pointer,
  5730. // non-interface field appearing in ForceSendFields will be sent to the
  5731. // server regardless of whether the field is empty or not. This may be
  5732. // used to include empty fields in Patch requests.
  5733. ForceSendFields []string `json:"-"`
  5734. // NullFields is a list of field names (e.g. "AmountPretax") to include
  5735. // in API requests with the JSON null value. By default, fields with
  5736. // empty values are omitted from API requests. However, any field with
  5737. // an empty value appearing in NullFields will be sent to the server as
  5738. // null. It is an error if a field in this list has a non-empty value.
  5739. // This may be used to include null fields in Patch requests.
  5740. NullFields []string `json:"-"`
  5741. }
  5742. func (s *OrdersCustomBatchRequestEntryReturnRefundLineItem) MarshalJSON() ([]byte, error) {
  5743. type NoMethod OrdersCustomBatchRequestEntryReturnRefundLineItem
  5744. raw := NoMethod(*s)
  5745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5746. }
  5747. type OrdersCustomBatchRequestEntrySetLineItemMetadata struct {
  5748. Annotations []*OrderMerchantProvidedAnnotation `json:"annotations,omitempty"`
  5749. // LineItemId: The ID of the line item to set metadata. Either
  5750. // lineItemId or productId is required.
  5751. LineItemId string `json:"lineItemId,omitempty"`
  5752. // ProductId: The ID of the product to set metadata. This is the REST ID
  5753. // used in the products service. Either lineItemId or productId is
  5754. // required.
  5755. ProductId string `json:"productId,omitempty"`
  5756. // ForceSendFields is a list of field names (e.g. "Annotations") to
  5757. // unconditionally include in API requests. By default, fields with
  5758. // empty values are omitted from API requests. However, any non-pointer,
  5759. // non-interface field appearing in ForceSendFields will be sent to the
  5760. // server regardless of whether the field is empty or not. This may be
  5761. // used to include empty fields in Patch requests.
  5762. ForceSendFields []string `json:"-"`
  5763. // NullFields is a list of field names (e.g. "Annotations") to include
  5764. // in API requests with the JSON null value. By default, fields with
  5765. // empty values are omitted from API requests. However, any field with
  5766. // an empty value appearing in NullFields will be sent to the server as
  5767. // null. It is an error if a field in this list has a non-empty value.
  5768. // This may be used to include null fields in Patch requests.
  5769. NullFields []string `json:"-"`
  5770. }
  5771. func (s *OrdersCustomBatchRequestEntrySetLineItemMetadata) MarshalJSON() ([]byte, error) {
  5772. type NoMethod OrdersCustomBatchRequestEntrySetLineItemMetadata
  5773. raw := NoMethod(*s)
  5774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5775. }
  5776. type OrdersCustomBatchRequestEntryShipLineItems struct {
  5777. // Carrier: Deprecated. Please use shipmentInfo instead. The carrier
  5778. // handling the shipment. See shipments[].carrier in the Orders
  5779. // resource representation for a list of acceptable values.
  5780. Carrier string `json:"carrier,omitempty"`
  5781. // LineItems: Line items to ship.
  5782. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  5783. // ShipmentGroupId: ID of the shipment group. Required for orders that
  5784. // use the orderinvoices service.
  5785. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  5786. // ShipmentId: Deprecated. Please use shipmentInfo instead. The ID of
  5787. // the shipment.
  5788. ShipmentId string `json:"shipmentId,omitempty"`
  5789. // ShipmentInfos: Shipment information. This field is repeated because a
  5790. // single line item can be shipped in several packages (and have several
  5791. // tracking IDs).
  5792. ShipmentInfos []*OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo `json:"shipmentInfos,omitempty"`
  5793. // TrackingId: Deprecated. Please use shipmentInfo instead. The tracking
  5794. // ID for the shipment.
  5795. TrackingId string `json:"trackingId,omitempty"`
  5796. // ForceSendFields is a list of field names (e.g. "Carrier") to
  5797. // unconditionally include in API requests. By default, fields with
  5798. // empty values are omitted from API requests. However, any non-pointer,
  5799. // non-interface field appearing in ForceSendFields will be sent to the
  5800. // server regardless of whether the field is empty or not. This may be
  5801. // used to include empty fields in Patch requests.
  5802. ForceSendFields []string `json:"-"`
  5803. // NullFields is a list of field names (e.g. "Carrier") to include in
  5804. // API requests with the JSON null value. By default, fields with empty
  5805. // values are omitted from API requests. However, any field with an
  5806. // empty value appearing in NullFields will be sent to the server as
  5807. // null. It is an error if a field in this list has a non-empty value.
  5808. // This may be used to include null fields in Patch requests.
  5809. NullFields []string `json:"-"`
  5810. }
  5811. func (s *OrdersCustomBatchRequestEntryShipLineItems) MarshalJSON() ([]byte, error) {
  5812. type NoMethod OrdersCustomBatchRequestEntryShipLineItems
  5813. raw := NoMethod(*s)
  5814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5815. }
  5816. type OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo struct {
  5817. // Carrier: The carrier handling the shipment. See shipments[].carrier
  5818. // in the Orders resource representation for a list of acceptable
  5819. // values.
  5820. Carrier string `json:"carrier,omitempty"`
  5821. // ShipmentId: The ID of the shipment. This is assigned by the merchant
  5822. // and is unique to each shipment.
  5823. ShipmentId string `json:"shipmentId,omitempty"`
  5824. // TrackingId: The tracking ID for the shipment.
  5825. TrackingId string `json:"trackingId,omitempty"`
  5826. // ForceSendFields is a list of field names (e.g. "Carrier") to
  5827. // unconditionally include in API requests. By default, fields with
  5828. // empty values are omitted from API requests. However, any non-pointer,
  5829. // non-interface field appearing in ForceSendFields will be sent to the
  5830. // server regardless of whether the field is empty or not. This may be
  5831. // used to include empty fields in Patch requests.
  5832. ForceSendFields []string `json:"-"`
  5833. // NullFields is a list of field names (e.g. "Carrier") to include in
  5834. // API requests with the JSON null value. By default, fields with empty
  5835. // values are omitted from API requests. However, any field with an
  5836. // empty value appearing in NullFields will be sent to the server as
  5837. // null. It is an error if a field in this list has a non-empty value.
  5838. // This may be used to include null fields in Patch requests.
  5839. NullFields []string `json:"-"`
  5840. }
  5841. func (s *OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo) MarshalJSON() ([]byte, error) {
  5842. type NoMethod OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo
  5843. raw := NoMethod(*s)
  5844. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5845. }
  5846. type OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails struct {
  5847. // DeliverByDate: Updated delivery by date, in ISO 8601 format. If not
  5848. // specified only ship by date is updated.
  5849. DeliverByDate string `json:"deliverByDate,omitempty"`
  5850. // LineItemId: The ID of the line item to set metadata. Either
  5851. // lineItemId or productId is required.
  5852. LineItemId string `json:"lineItemId,omitempty"`
  5853. // ProductId: The ID of the product to set metadata. This is the REST ID
  5854. // used in the products service. Either lineItemId or productId is
  5855. // required.
  5856. ProductId string `json:"productId,omitempty"`
  5857. // ShipByDate: Updated ship by date, in ISO 8601 format. If not
  5858. // specified only deliver by date is updated.
  5859. ShipByDate string `json:"shipByDate,omitempty"`
  5860. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  5861. // unconditionally include in API requests. By default, fields with
  5862. // empty values are omitted from API requests. However, any non-pointer,
  5863. // non-interface field appearing in ForceSendFields will be sent to the
  5864. // server regardless of whether the field is empty or not. This may be
  5865. // used to include empty fields in Patch requests.
  5866. ForceSendFields []string `json:"-"`
  5867. // NullFields is a list of field names (e.g. "DeliverByDate") to include
  5868. // in API requests with the JSON null value. By default, fields with
  5869. // empty values are omitted from API requests. However, any field with
  5870. // an empty value appearing in NullFields will be sent to the server as
  5871. // null. It is an error if a field in this list has a non-empty value.
  5872. // This may be used to include null fields in Patch requests.
  5873. NullFields []string `json:"-"`
  5874. }
  5875. func (s *OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails) MarshalJSON() ([]byte, error) {
  5876. type NoMethod OrdersCustomBatchRequestEntryUpdateLineItemShippingDetails
  5877. raw := NoMethod(*s)
  5878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5879. }
  5880. type OrdersCustomBatchRequestEntryUpdateShipment struct {
  5881. // Carrier: The carrier handling the shipment. Not updated if missing.
  5882. // See shipments[].carrier in the Orders resource representation for a
  5883. // list of acceptable values.
  5884. Carrier string `json:"carrier,omitempty"`
  5885. // DeliveryDate: Date on which the shipment has been delivered, in ISO
  5886. // 8601 format. Optional and can be provided only if status is
  5887. // delivered.
  5888. DeliveryDate string `json:"deliveryDate,omitempty"`
  5889. // ShipmentId: The ID of the shipment.
  5890. ShipmentId string `json:"shipmentId,omitempty"`
  5891. // Status: New status for the shipment. Not updated if missing.
  5892. Status string `json:"status,omitempty"`
  5893. // TrackingId: The tracking ID for the shipment. Not updated if missing.
  5894. TrackingId string `json:"trackingId,omitempty"`
  5895. // ForceSendFields is a list of field names (e.g. "Carrier") to
  5896. // unconditionally include in API requests. By default, fields with
  5897. // empty values are omitted from API requests. However, any non-pointer,
  5898. // non-interface field appearing in ForceSendFields will be sent to the
  5899. // server regardless of whether the field is empty or not. This may be
  5900. // used to include empty fields in Patch requests.
  5901. ForceSendFields []string `json:"-"`
  5902. // NullFields is a list of field names (e.g. "Carrier") to include in
  5903. // API requests with the JSON null value. By default, fields with empty
  5904. // values are omitted from API requests. However, any field with an
  5905. // empty value appearing in NullFields will be sent to the server as
  5906. // null. It is an error if a field in this list has a non-empty value.
  5907. // This may be used to include null fields in Patch requests.
  5908. NullFields []string `json:"-"`
  5909. }
  5910. func (s *OrdersCustomBatchRequestEntryUpdateShipment) MarshalJSON() ([]byte, error) {
  5911. type NoMethod OrdersCustomBatchRequestEntryUpdateShipment
  5912. raw := NoMethod(*s)
  5913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5914. }
  5915. type OrdersCustomBatchResponse struct {
  5916. // Entries: The result of the execution of the batch requests.
  5917. Entries []*OrdersCustomBatchResponseEntry `json:"entries,omitempty"`
  5918. // Kind: Identifies what kind of resource this is. Value: the fixed
  5919. // string "content#ordersCustomBatchResponse".
  5920. Kind string `json:"kind,omitempty"`
  5921. // ServerResponse contains the HTTP response code and headers from the
  5922. // server.
  5923. googleapi.ServerResponse `json:"-"`
  5924. // ForceSendFields is a list of field names (e.g. "Entries") to
  5925. // unconditionally include in API requests. By default, fields with
  5926. // empty values are omitted from API requests. However, any non-pointer,
  5927. // non-interface field appearing in ForceSendFields will be sent to the
  5928. // server regardless of whether the field is empty or not. This may be
  5929. // used to include empty fields in Patch requests.
  5930. ForceSendFields []string `json:"-"`
  5931. // NullFields is a list of field names (e.g. "Entries") to include in
  5932. // API requests with the JSON null value. By default, fields with empty
  5933. // values are omitted from API requests. However, any field with an
  5934. // empty value appearing in NullFields will be sent to the server as
  5935. // null. It is an error if a field in this list has a non-empty value.
  5936. // This may be used to include null fields in Patch requests.
  5937. NullFields []string `json:"-"`
  5938. }
  5939. func (s *OrdersCustomBatchResponse) MarshalJSON() ([]byte, error) {
  5940. type NoMethod OrdersCustomBatchResponse
  5941. raw := NoMethod(*s)
  5942. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5943. }
  5944. type OrdersCustomBatchResponseEntry struct {
  5945. // BatchId: The ID of the request entry this entry responds to.
  5946. BatchId int64 `json:"batchId,omitempty"`
  5947. // Errors: A list of errors defined if and only if the request failed.
  5948. Errors *Errors `json:"errors,omitempty"`
  5949. // ExecutionStatus: The status of the execution. Only defined if
  5950. // - the request was successful; and
  5951. // - the method is not get, getByMerchantOrderId, or one of the test
  5952. // methods.
  5953. ExecutionStatus string `json:"executionStatus,omitempty"`
  5954. // Kind: Identifies what kind of resource this is. Value: the fixed
  5955. // string "content#ordersCustomBatchResponseEntry".
  5956. Kind string `json:"kind,omitempty"`
  5957. // Order: The retrieved order. Only defined if the method is get and if
  5958. // the request was successful.
  5959. Order *Order `json:"order,omitempty"`
  5960. // ForceSendFields is a list of field names (e.g. "BatchId") to
  5961. // unconditionally include in API requests. By default, fields with
  5962. // empty values are omitted from API requests. However, any non-pointer,
  5963. // non-interface field appearing in ForceSendFields will be sent to the
  5964. // server regardless of whether the field is empty or not. This may be
  5965. // used to include empty fields in Patch requests.
  5966. ForceSendFields []string `json:"-"`
  5967. // NullFields is a list of field names (e.g. "BatchId") to include in
  5968. // API requests with the JSON null value. By default, fields with empty
  5969. // values are omitted from API requests. However, any field with an
  5970. // empty value appearing in NullFields will be sent to the server as
  5971. // null. It is an error if a field in this list has a non-empty value.
  5972. // This may be used to include null fields in Patch requests.
  5973. NullFields []string `json:"-"`
  5974. }
  5975. func (s *OrdersCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  5976. type NoMethod OrdersCustomBatchResponseEntry
  5977. raw := NoMethod(*s)
  5978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5979. }
  5980. type OrdersGetByMerchantOrderIdResponse struct {
  5981. // Kind: Identifies what kind of resource this is. Value: the fixed
  5982. // string "content#ordersGetByMerchantOrderIdResponse".
  5983. Kind string `json:"kind,omitempty"`
  5984. // Order: The requested order.
  5985. Order *Order `json:"order,omitempty"`
  5986. // ServerResponse contains the HTTP response code and headers from the
  5987. // server.
  5988. googleapi.ServerResponse `json:"-"`
  5989. // ForceSendFields is a list of field names (e.g. "Kind") to
  5990. // unconditionally include in API requests. By default, fields with
  5991. // empty values are omitted from API requests. However, any non-pointer,
  5992. // non-interface field appearing in ForceSendFields will be sent to the
  5993. // server regardless of whether the field is empty or not. This may be
  5994. // used to include empty fields in Patch requests.
  5995. ForceSendFields []string `json:"-"`
  5996. // NullFields is a list of field names (e.g. "Kind") to include in API
  5997. // requests with the JSON null value. By default, fields with empty
  5998. // values are omitted from API requests. However, any field with an
  5999. // empty value appearing in NullFields will be sent to the server as
  6000. // null. It is an error if a field in this list has a non-empty value.
  6001. // This may be used to include null fields in Patch requests.
  6002. NullFields []string `json:"-"`
  6003. }
  6004. func (s *OrdersGetByMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  6005. type NoMethod OrdersGetByMerchantOrderIdResponse
  6006. raw := NoMethod(*s)
  6007. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6008. }
  6009. type OrdersGetTestOrderTemplateResponse struct {
  6010. // Kind: Identifies what kind of resource this is. Value: the fixed
  6011. // string "content#ordersGetTestOrderTemplateResponse".
  6012. Kind string `json:"kind,omitempty"`
  6013. // Template: The requested test order template.
  6014. Template *TestOrder `json:"template,omitempty"`
  6015. // ServerResponse contains the HTTP response code and headers from the
  6016. // server.
  6017. googleapi.ServerResponse `json:"-"`
  6018. // ForceSendFields is a list of field names (e.g. "Kind") to
  6019. // unconditionally include in API requests. By default, fields with
  6020. // empty values are omitted from API requests. However, any non-pointer,
  6021. // non-interface field appearing in ForceSendFields will be sent to the
  6022. // server regardless of whether the field is empty or not. This may be
  6023. // used to include empty fields in Patch requests.
  6024. ForceSendFields []string `json:"-"`
  6025. // NullFields is a list of field names (e.g. "Kind") to include in API
  6026. // requests with the JSON null value. By default, fields with empty
  6027. // values are omitted from API requests. However, any field with an
  6028. // empty value appearing in NullFields will be sent to the server as
  6029. // null. It is an error if a field in this list has a non-empty value.
  6030. // This may be used to include null fields in Patch requests.
  6031. NullFields []string `json:"-"`
  6032. }
  6033. func (s *OrdersGetTestOrderTemplateResponse) MarshalJSON() ([]byte, error) {
  6034. type NoMethod OrdersGetTestOrderTemplateResponse
  6035. raw := NoMethod(*s)
  6036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6037. }
  6038. type OrdersInStoreRefundLineItemRequest struct {
  6039. // AmountPretax: The amount that is refunded. Required.
  6040. AmountPretax *Price `json:"amountPretax,omitempty"`
  6041. // AmountTax: Tax amount that correspond to refund amount in
  6042. // amountPretax. Required.
  6043. AmountTax *Price `json:"amountTax,omitempty"`
  6044. // LineItemId: The ID of the line item to return. Either lineItemId or
  6045. // productId is required.
  6046. LineItemId string `json:"lineItemId,omitempty"`
  6047. // OperationId: The ID of the operation. Unique across all operations
  6048. // for a given order.
  6049. OperationId string `json:"operationId,omitempty"`
  6050. // ProductId: The ID of the product to return. This is the REST ID used
  6051. // in the products service. Either lineItemId or productId is required.
  6052. ProductId string `json:"productId,omitempty"`
  6053. // Quantity: The quantity to return and refund.
  6054. Quantity int64 `json:"quantity,omitempty"`
  6055. // Reason: The reason for the return.
  6056. Reason string `json:"reason,omitempty"`
  6057. // ReasonText: The explanation of the reason.
  6058. ReasonText string `json:"reasonText,omitempty"`
  6059. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  6060. // unconditionally include in API requests. By default, fields with
  6061. // empty values are omitted from API requests. However, any non-pointer,
  6062. // non-interface field appearing in ForceSendFields will be sent to the
  6063. // server regardless of whether the field is empty or not. This may be
  6064. // used to include empty fields in Patch requests.
  6065. ForceSendFields []string `json:"-"`
  6066. // NullFields is a list of field names (e.g. "AmountPretax") to include
  6067. // in API requests with the JSON null value. By default, fields with
  6068. // empty values are omitted from API requests. However, any field with
  6069. // an empty value appearing in NullFields will be sent to the server as
  6070. // null. It is an error if a field in this list has a non-empty value.
  6071. // This may be used to include null fields in Patch requests.
  6072. NullFields []string `json:"-"`
  6073. }
  6074. func (s *OrdersInStoreRefundLineItemRequest) MarshalJSON() ([]byte, error) {
  6075. type NoMethod OrdersInStoreRefundLineItemRequest
  6076. raw := NoMethod(*s)
  6077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6078. }
  6079. type OrdersInStoreRefundLineItemResponse struct {
  6080. // ExecutionStatus: The status of the execution.
  6081. ExecutionStatus string `json:"executionStatus,omitempty"`
  6082. // Kind: Identifies what kind of resource this is. Value: the fixed
  6083. // string "content#ordersInStoreRefundLineItemResponse".
  6084. Kind string `json:"kind,omitempty"`
  6085. // ServerResponse contains the HTTP response code and headers from the
  6086. // server.
  6087. googleapi.ServerResponse `json:"-"`
  6088. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6089. // unconditionally include in API requests. By default, fields with
  6090. // empty values are omitted from API requests. However, any non-pointer,
  6091. // non-interface field appearing in ForceSendFields will be sent to the
  6092. // server regardless of whether the field is empty or not. This may be
  6093. // used to include empty fields in Patch requests.
  6094. ForceSendFields []string `json:"-"`
  6095. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6096. // include in API requests with the JSON null value. By default, fields
  6097. // with empty values are omitted from API requests. However, any field
  6098. // with an empty value appearing in NullFields will be sent to the
  6099. // server as null. It is an error if a field in this list has a
  6100. // non-empty value. This may be used to include null fields in Patch
  6101. // requests.
  6102. NullFields []string `json:"-"`
  6103. }
  6104. func (s *OrdersInStoreRefundLineItemResponse) MarshalJSON() ([]byte, error) {
  6105. type NoMethod OrdersInStoreRefundLineItemResponse
  6106. raw := NoMethod(*s)
  6107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6108. }
  6109. type OrdersListResponse struct {
  6110. // Kind: Identifies what kind of resource this is. Value: the fixed
  6111. // string "content#ordersListResponse".
  6112. Kind string `json:"kind,omitempty"`
  6113. // NextPageToken: The token for the retrieval of the next page of
  6114. // orders.
  6115. NextPageToken string `json:"nextPageToken,omitempty"`
  6116. Resources []*Order `json:"resources,omitempty"`
  6117. // ServerResponse contains the HTTP response code and headers from the
  6118. // server.
  6119. googleapi.ServerResponse `json:"-"`
  6120. // ForceSendFields is a list of field names (e.g. "Kind") to
  6121. // unconditionally include in API requests. By default, fields with
  6122. // empty values are omitted from API requests. However, any non-pointer,
  6123. // non-interface field appearing in ForceSendFields will be sent to the
  6124. // server regardless of whether the field is empty or not. This may be
  6125. // used to include empty fields in Patch requests.
  6126. ForceSendFields []string `json:"-"`
  6127. // NullFields is a list of field names (e.g. "Kind") to include in API
  6128. // requests with the JSON null value. By default, fields with empty
  6129. // values are omitted from API requests. However, any field with an
  6130. // empty value appearing in NullFields will be sent to the server as
  6131. // null. It is an error if a field in this list has a non-empty value.
  6132. // This may be used to include null fields in Patch requests.
  6133. NullFields []string `json:"-"`
  6134. }
  6135. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  6136. type NoMethod OrdersListResponse
  6137. raw := NoMethod(*s)
  6138. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6139. }
  6140. type OrdersRefundRequest struct {
  6141. // Amount: Deprecated. Please use amountPretax and amountTax instead.
  6142. Amount *Price `json:"amount,omitempty"`
  6143. // AmountPretax: The amount that is refunded. Either amount or
  6144. // amountPretax should be filled.
  6145. AmountPretax *Price `json:"amountPretax,omitempty"`
  6146. // AmountTax: Tax amount that corresponds to refund amount in
  6147. // amountPretax. Optional, but if filled, amountPretax must be set.
  6148. // Calculated automatically if not provided.
  6149. AmountTax *Price `json:"amountTax,omitempty"`
  6150. // OperationId: The ID of the operation. Unique across all operations
  6151. // for a given order.
  6152. OperationId string `json:"operationId,omitempty"`
  6153. // Reason: The reason for the refund.
  6154. Reason string `json:"reason,omitempty"`
  6155. // ReasonText: The explanation of the reason.
  6156. ReasonText string `json:"reasonText,omitempty"`
  6157. // ForceSendFields is a list of field names (e.g. "Amount") to
  6158. // unconditionally include in API requests. By default, fields with
  6159. // empty values are omitted from API requests. However, any non-pointer,
  6160. // non-interface field appearing in ForceSendFields will be sent to the
  6161. // server regardless of whether the field is empty or not. This may be
  6162. // used to include empty fields in Patch requests.
  6163. ForceSendFields []string `json:"-"`
  6164. // NullFields is a list of field names (e.g. "Amount") to include in API
  6165. // requests with the JSON null value. By default, fields with empty
  6166. // values are omitted from API requests. However, any field with an
  6167. // empty value appearing in NullFields will be sent to the server as
  6168. // null. It is an error if a field in this list has a non-empty value.
  6169. // This may be used to include null fields in Patch requests.
  6170. NullFields []string `json:"-"`
  6171. }
  6172. func (s *OrdersRefundRequest) MarshalJSON() ([]byte, error) {
  6173. type NoMethod OrdersRefundRequest
  6174. raw := NoMethod(*s)
  6175. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6176. }
  6177. type OrdersRefundResponse struct {
  6178. // ExecutionStatus: The status of the execution.
  6179. ExecutionStatus string `json:"executionStatus,omitempty"`
  6180. // Kind: Identifies what kind of resource this is. Value: the fixed
  6181. // string "content#ordersRefundResponse".
  6182. Kind string `json:"kind,omitempty"`
  6183. // ServerResponse contains the HTTP response code and headers from the
  6184. // server.
  6185. googleapi.ServerResponse `json:"-"`
  6186. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6187. // unconditionally include in API requests. By default, fields with
  6188. // empty values are omitted from API requests. However, any non-pointer,
  6189. // non-interface field appearing in ForceSendFields will be sent to the
  6190. // server regardless of whether the field is empty or not. This may be
  6191. // used to include empty fields in Patch requests.
  6192. ForceSendFields []string `json:"-"`
  6193. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6194. // include in API requests with the JSON null value. By default, fields
  6195. // with empty values are omitted from API requests. However, any field
  6196. // with an empty value appearing in NullFields will be sent to the
  6197. // server as null. It is an error if a field in this list has a
  6198. // non-empty value. This may be used to include null fields in Patch
  6199. // requests.
  6200. NullFields []string `json:"-"`
  6201. }
  6202. func (s *OrdersRefundResponse) MarshalJSON() ([]byte, error) {
  6203. type NoMethod OrdersRefundResponse
  6204. raw := NoMethod(*s)
  6205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6206. }
  6207. type OrdersRejectReturnLineItemRequest struct {
  6208. // LineItemId: The ID of the line item to return. Either lineItemId or
  6209. // productId is required.
  6210. LineItemId string `json:"lineItemId,omitempty"`
  6211. // OperationId: The ID of the operation. Unique across all operations
  6212. // for a given order.
  6213. OperationId string `json:"operationId,omitempty"`
  6214. // ProductId: The ID of the product to return. This is the REST ID used
  6215. // in the products service. Either lineItemId or productId is required.
  6216. ProductId string `json:"productId,omitempty"`
  6217. // Quantity: The quantity to return and refund.
  6218. Quantity int64 `json:"quantity,omitempty"`
  6219. // Reason: The reason for the return.
  6220. Reason string `json:"reason,omitempty"`
  6221. // ReasonText: The explanation of the reason.
  6222. ReasonText string `json:"reasonText,omitempty"`
  6223. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  6224. // unconditionally include in API requests. By default, fields with
  6225. // empty values are omitted from API requests. However, any non-pointer,
  6226. // non-interface field appearing in ForceSendFields will be sent to the
  6227. // server regardless of whether the field is empty or not. This may be
  6228. // used to include empty fields in Patch requests.
  6229. ForceSendFields []string `json:"-"`
  6230. // NullFields is a list of field names (e.g. "LineItemId") to include in
  6231. // API requests with the JSON null value. By default, fields with empty
  6232. // values are omitted from API requests. However, any field with an
  6233. // empty value appearing in NullFields will be sent to the server as
  6234. // null. It is an error if a field in this list has a non-empty value.
  6235. // This may be used to include null fields in Patch requests.
  6236. NullFields []string `json:"-"`
  6237. }
  6238. func (s *OrdersRejectReturnLineItemRequest) MarshalJSON() ([]byte, error) {
  6239. type NoMethod OrdersRejectReturnLineItemRequest
  6240. raw := NoMethod(*s)
  6241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6242. }
  6243. type OrdersRejectReturnLineItemResponse struct {
  6244. // ExecutionStatus: The status of the execution.
  6245. ExecutionStatus string `json:"executionStatus,omitempty"`
  6246. // Kind: Identifies what kind of resource this is. Value: the fixed
  6247. // string "content#ordersRejectReturnLineItemResponse".
  6248. Kind string `json:"kind,omitempty"`
  6249. // ServerResponse contains the HTTP response code and headers from the
  6250. // server.
  6251. googleapi.ServerResponse `json:"-"`
  6252. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6253. // unconditionally include in API requests. By default, fields with
  6254. // empty values are omitted from API requests. However, any non-pointer,
  6255. // non-interface field appearing in ForceSendFields will be sent to the
  6256. // server regardless of whether the field is empty or not. This may be
  6257. // used to include empty fields in Patch requests.
  6258. ForceSendFields []string `json:"-"`
  6259. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6260. // include in API requests with the JSON null value. By default, fields
  6261. // with empty values are omitted from API requests. However, any field
  6262. // with an empty value appearing in NullFields will be sent to the
  6263. // server as null. It is an error if a field in this list has a
  6264. // non-empty value. This may be used to include null fields in Patch
  6265. // requests.
  6266. NullFields []string `json:"-"`
  6267. }
  6268. func (s *OrdersRejectReturnLineItemResponse) MarshalJSON() ([]byte, error) {
  6269. type NoMethod OrdersRejectReturnLineItemResponse
  6270. raw := NoMethod(*s)
  6271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6272. }
  6273. type OrdersReturnLineItemRequest struct {
  6274. // LineItemId: The ID of the line item to return. Either lineItemId or
  6275. // productId is required.
  6276. LineItemId string `json:"lineItemId,omitempty"`
  6277. // OperationId: The ID of the operation. Unique across all operations
  6278. // for a given order.
  6279. OperationId string `json:"operationId,omitempty"`
  6280. // ProductId: The ID of the product to return. This is the REST ID used
  6281. // in the products service. Either lineItemId or productId is required.
  6282. ProductId string `json:"productId,omitempty"`
  6283. // Quantity: The quantity to return.
  6284. Quantity int64 `json:"quantity,omitempty"`
  6285. // Reason: The reason for the return.
  6286. Reason string `json:"reason,omitempty"`
  6287. // ReasonText: The explanation of the reason.
  6288. ReasonText string `json:"reasonText,omitempty"`
  6289. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  6290. // unconditionally include in API requests. By default, fields with
  6291. // empty values are omitted from API requests. However, any non-pointer,
  6292. // non-interface field appearing in ForceSendFields will be sent to the
  6293. // server regardless of whether the field is empty or not. This may be
  6294. // used to include empty fields in Patch requests.
  6295. ForceSendFields []string `json:"-"`
  6296. // NullFields is a list of field names (e.g. "LineItemId") to include in
  6297. // API requests with the JSON null value. By default, fields with empty
  6298. // values are omitted from API requests. However, any field with an
  6299. // empty value appearing in NullFields will be sent to the server as
  6300. // null. It is an error if a field in this list has a non-empty value.
  6301. // This may be used to include null fields in Patch requests.
  6302. NullFields []string `json:"-"`
  6303. }
  6304. func (s *OrdersReturnLineItemRequest) MarshalJSON() ([]byte, error) {
  6305. type NoMethod OrdersReturnLineItemRequest
  6306. raw := NoMethod(*s)
  6307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6308. }
  6309. type OrdersReturnLineItemResponse struct {
  6310. // ExecutionStatus: The status of the execution.
  6311. ExecutionStatus string `json:"executionStatus,omitempty"`
  6312. // Kind: Identifies what kind of resource this is. Value: the fixed
  6313. // string "content#ordersReturnLineItemResponse".
  6314. Kind string `json:"kind,omitempty"`
  6315. // ServerResponse contains the HTTP response code and headers from the
  6316. // server.
  6317. googleapi.ServerResponse `json:"-"`
  6318. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6319. // unconditionally include in API requests. By default, fields with
  6320. // empty values are omitted from API requests. However, any non-pointer,
  6321. // non-interface field appearing in ForceSendFields will be sent to the
  6322. // server regardless of whether the field is empty or not. This may be
  6323. // used to include empty fields in Patch requests.
  6324. ForceSendFields []string `json:"-"`
  6325. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6326. // include in API requests with the JSON null value. By default, fields
  6327. // with empty values are omitted from API requests. However, any field
  6328. // with an empty value appearing in NullFields will be sent to the
  6329. // server as null. It is an error if a field in this list has a
  6330. // non-empty value. This may be used to include null fields in Patch
  6331. // requests.
  6332. NullFields []string `json:"-"`
  6333. }
  6334. func (s *OrdersReturnLineItemResponse) MarshalJSON() ([]byte, error) {
  6335. type NoMethod OrdersReturnLineItemResponse
  6336. raw := NoMethod(*s)
  6337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6338. }
  6339. type OrdersReturnRefundLineItemRequest struct {
  6340. // AmountPretax: The amount that is refunded. If omitted, refundless
  6341. // return is assumed (same as calling returnLineItem method).
  6342. AmountPretax *Price `json:"amountPretax,omitempty"`
  6343. // AmountTax: Tax amount that corresponds to refund amount in
  6344. // amountPretax. Optional, but if filled, then amountPretax must be set.
  6345. // Calculated automatically if not provided.
  6346. AmountTax *Price `json:"amountTax,omitempty"`
  6347. // LineItemId: The ID of the line item to return. Either lineItemId or
  6348. // productId is required.
  6349. LineItemId string `json:"lineItemId,omitempty"`
  6350. // OperationId: The ID of the operation. Unique across all operations
  6351. // for a given order.
  6352. OperationId string `json:"operationId,omitempty"`
  6353. // ProductId: The ID of the product to return. This is the REST ID used
  6354. // in the products service. Either lineItemId or productId is required.
  6355. ProductId string `json:"productId,omitempty"`
  6356. // Quantity: The quantity to return and refund.
  6357. Quantity int64 `json:"quantity,omitempty"`
  6358. // Reason: The reason for the return.
  6359. Reason string `json:"reason,omitempty"`
  6360. // ReasonText: The explanation of the reason.
  6361. ReasonText string `json:"reasonText,omitempty"`
  6362. // ForceSendFields is a list of field names (e.g. "AmountPretax") to
  6363. // unconditionally include in API requests. By default, fields with
  6364. // empty values are omitted from API requests. However, any non-pointer,
  6365. // non-interface field appearing in ForceSendFields will be sent to the
  6366. // server regardless of whether the field is empty or not. This may be
  6367. // used to include empty fields in Patch requests.
  6368. ForceSendFields []string `json:"-"`
  6369. // NullFields is a list of field names (e.g. "AmountPretax") to include
  6370. // in API requests with the JSON null value. By default, fields with
  6371. // empty values are omitted from API requests. However, any field with
  6372. // an empty value appearing in NullFields will be sent to the server as
  6373. // null. It is an error if a field in this list has a non-empty value.
  6374. // This may be used to include null fields in Patch requests.
  6375. NullFields []string `json:"-"`
  6376. }
  6377. func (s *OrdersReturnRefundLineItemRequest) MarshalJSON() ([]byte, error) {
  6378. type NoMethod OrdersReturnRefundLineItemRequest
  6379. raw := NoMethod(*s)
  6380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6381. }
  6382. type OrdersReturnRefundLineItemResponse struct {
  6383. // ExecutionStatus: The status of the execution.
  6384. ExecutionStatus string `json:"executionStatus,omitempty"`
  6385. // Kind: Identifies what kind of resource this is. Value: the fixed
  6386. // string "content#ordersReturnRefundLineItemResponse".
  6387. Kind string `json:"kind,omitempty"`
  6388. // ServerResponse contains the HTTP response code and headers from the
  6389. // server.
  6390. googleapi.ServerResponse `json:"-"`
  6391. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6392. // unconditionally include in API requests. By default, fields with
  6393. // empty values are omitted from API requests. However, any non-pointer,
  6394. // non-interface field appearing in ForceSendFields will be sent to the
  6395. // server regardless of whether the field is empty or not. This may be
  6396. // used to include empty fields in Patch requests.
  6397. ForceSendFields []string `json:"-"`
  6398. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6399. // include in API requests with the JSON null value. By default, fields
  6400. // with empty values are omitted from API requests. However, any field
  6401. // with an empty value appearing in NullFields will be sent to the
  6402. // server as null. It is an error if a field in this list has a
  6403. // non-empty value. This may be used to include null fields in Patch
  6404. // requests.
  6405. NullFields []string `json:"-"`
  6406. }
  6407. func (s *OrdersReturnRefundLineItemResponse) MarshalJSON() ([]byte, error) {
  6408. type NoMethod OrdersReturnRefundLineItemResponse
  6409. raw := NoMethod(*s)
  6410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6411. }
  6412. type OrdersSetLineItemMetadataRequest struct {
  6413. Annotations []*OrderMerchantProvidedAnnotation `json:"annotations,omitempty"`
  6414. // LineItemId: The ID of the line item to set metadata. Either
  6415. // lineItemId or productId is required.
  6416. LineItemId string `json:"lineItemId,omitempty"`
  6417. // OperationId: The ID of the operation. Unique across all operations
  6418. // for a given order.
  6419. OperationId string `json:"operationId,omitempty"`
  6420. // ProductId: The ID of the product to set metadata. This is the REST ID
  6421. // used in the products service. Either lineItemId or productId is
  6422. // required.
  6423. ProductId string `json:"productId,omitempty"`
  6424. // ForceSendFields is a list of field names (e.g. "Annotations") to
  6425. // unconditionally include in API requests. By default, fields with
  6426. // empty values are omitted from API requests. However, any non-pointer,
  6427. // non-interface field appearing in ForceSendFields will be sent to the
  6428. // server regardless of whether the field is empty or not. This may be
  6429. // used to include empty fields in Patch requests.
  6430. ForceSendFields []string `json:"-"`
  6431. // NullFields is a list of field names (e.g. "Annotations") to include
  6432. // in API requests with the JSON null value. By default, fields with
  6433. // empty values are omitted from API requests. However, any field with
  6434. // an empty value appearing in NullFields will be sent to the server as
  6435. // null. It is an error if a field in this list has a non-empty value.
  6436. // This may be used to include null fields in Patch requests.
  6437. NullFields []string `json:"-"`
  6438. }
  6439. func (s *OrdersSetLineItemMetadataRequest) MarshalJSON() ([]byte, error) {
  6440. type NoMethod OrdersSetLineItemMetadataRequest
  6441. raw := NoMethod(*s)
  6442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6443. }
  6444. type OrdersSetLineItemMetadataResponse struct {
  6445. // ExecutionStatus: The status of the execution.
  6446. ExecutionStatus string `json:"executionStatus,omitempty"`
  6447. // Kind: Identifies what kind of resource this is. Value: the fixed
  6448. // string "content#ordersSetLineItemMetadataResponse".
  6449. Kind string `json:"kind,omitempty"`
  6450. // ServerResponse contains the HTTP response code and headers from the
  6451. // server.
  6452. googleapi.ServerResponse `json:"-"`
  6453. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6454. // unconditionally include in API requests. By default, fields with
  6455. // empty values are omitted from API requests. However, any non-pointer,
  6456. // non-interface field appearing in ForceSendFields will be sent to the
  6457. // server regardless of whether the field is empty or not. This may be
  6458. // used to include empty fields in Patch requests.
  6459. ForceSendFields []string `json:"-"`
  6460. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6461. // include in API requests with the JSON null value. By default, fields
  6462. // with empty values are omitted from API requests. However, any field
  6463. // with an empty value appearing in NullFields will be sent to the
  6464. // server as null. It is an error if a field in this list has a
  6465. // non-empty value. This may be used to include null fields in Patch
  6466. // requests.
  6467. NullFields []string `json:"-"`
  6468. }
  6469. func (s *OrdersSetLineItemMetadataResponse) MarshalJSON() ([]byte, error) {
  6470. type NoMethod OrdersSetLineItemMetadataResponse
  6471. raw := NoMethod(*s)
  6472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6473. }
  6474. type OrdersShipLineItemsRequest struct {
  6475. // Carrier: Deprecated. Please use shipmentInfo instead. The carrier
  6476. // handling the shipment. See shipments[].carrier in the Orders
  6477. // resource representation for a list of acceptable values.
  6478. Carrier string `json:"carrier,omitempty"`
  6479. // LineItems: Line items to ship.
  6480. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  6481. // OperationId: The ID of the operation. Unique across all operations
  6482. // for a given order.
  6483. OperationId string `json:"operationId,omitempty"`
  6484. // ShipmentGroupId: ID of the shipment group. Required for orders that
  6485. // use the orderinvoices service.
  6486. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  6487. // ShipmentId: Deprecated. Please use shipmentInfo instead. The ID of
  6488. // the shipment.
  6489. ShipmentId string `json:"shipmentId,omitempty"`
  6490. // ShipmentInfos: Shipment information. This field is repeated because a
  6491. // single line item can be shipped in several packages (and have several
  6492. // tracking IDs).
  6493. ShipmentInfos []*OrdersCustomBatchRequestEntryShipLineItemsShipmentInfo `json:"shipmentInfos,omitempty"`
  6494. // TrackingId: Deprecated. Please use shipmentInfo instead. The tracking
  6495. // ID for the shipment.
  6496. TrackingId string `json:"trackingId,omitempty"`
  6497. // ForceSendFields is a list of field names (e.g. "Carrier") to
  6498. // unconditionally include in API requests. By default, fields with
  6499. // empty values are omitted from API requests. However, any non-pointer,
  6500. // non-interface field appearing in ForceSendFields will be sent to the
  6501. // server regardless of whether the field is empty or not. This may be
  6502. // used to include empty fields in Patch requests.
  6503. ForceSendFields []string `json:"-"`
  6504. // NullFields is a list of field names (e.g. "Carrier") to include in
  6505. // API requests with the JSON null value. By default, fields with empty
  6506. // values are omitted from API requests. However, any field with an
  6507. // empty value appearing in NullFields will be sent to the server as
  6508. // null. It is an error if a field in this list has a non-empty value.
  6509. // This may be used to include null fields in Patch requests.
  6510. NullFields []string `json:"-"`
  6511. }
  6512. func (s *OrdersShipLineItemsRequest) MarshalJSON() ([]byte, error) {
  6513. type NoMethod OrdersShipLineItemsRequest
  6514. raw := NoMethod(*s)
  6515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6516. }
  6517. type OrdersShipLineItemsResponse struct {
  6518. // ExecutionStatus: The status of the execution.
  6519. ExecutionStatus string `json:"executionStatus,omitempty"`
  6520. // Kind: Identifies what kind of resource this is. Value: the fixed
  6521. // string "content#ordersShipLineItemsResponse".
  6522. Kind string `json:"kind,omitempty"`
  6523. // ServerResponse contains the HTTP response code and headers from the
  6524. // server.
  6525. googleapi.ServerResponse `json:"-"`
  6526. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6527. // unconditionally include in API requests. By default, fields with
  6528. // empty values are omitted from API requests. However, any non-pointer,
  6529. // non-interface field appearing in ForceSendFields will be sent to the
  6530. // server regardless of whether the field is empty or not. This may be
  6531. // used to include empty fields in Patch requests.
  6532. ForceSendFields []string `json:"-"`
  6533. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6534. // include in API requests with the JSON null value. By default, fields
  6535. // with empty values are omitted from API requests. However, any field
  6536. // with an empty value appearing in NullFields will be sent to the
  6537. // server as null. It is an error if a field in this list has a
  6538. // non-empty value. This may be used to include null fields in Patch
  6539. // requests.
  6540. NullFields []string `json:"-"`
  6541. }
  6542. func (s *OrdersShipLineItemsResponse) MarshalJSON() ([]byte, error) {
  6543. type NoMethod OrdersShipLineItemsResponse
  6544. raw := NoMethod(*s)
  6545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6546. }
  6547. type OrdersUpdateLineItemShippingDetailsRequest struct {
  6548. // DeliverByDate: Updated delivery by date, in ISO 8601 format. If not
  6549. // specified only ship by date is updated.
  6550. DeliverByDate string `json:"deliverByDate,omitempty"`
  6551. // LineItemId: The ID of the line item to set metadata. Either
  6552. // lineItemId or productId is required.
  6553. LineItemId string `json:"lineItemId,omitempty"`
  6554. // OperationId: The ID of the operation. Unique across all operations
  6555. // for a given order.
  6556. OperationId string `json:"operationId,omitempty"`
  6557. // ProductId: The ID of the product to set metadata. This is the REST ID
  6558. // used in the products service. Either lineItemId or productId is
  6559. // required.
  6560. ProductId string `json:"productId,omitempty"`
  6561. // ShipByDate: Updated ship by date, in ISO 8601 format. If not
  6562. // specified only deliver by date is updated.
  6563. ShipByDate string `json:"shipByDate,omitempty"`
  6564. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  6565. // unconditionally include in API requests. By default, fields with
  6566. // empty values are omitted from API requests. However, any non-pointer,
  6567. // non-interface field appearing in ForceSendFields will be sent to the
  6568. // server regardless of whether the field is empty or not. This may be
  6569. // used to include empty fields in Patch requests.
  6570. ForceSendFields []string `json:"-"`
  6571. // NullFields is a list of field names (e.g. "DeliverByDate") to include
  6572. // in API requests with the JSON null value. By default, fields with
  6573. // empty values are omitted from API requests. However, any field with
  6574. // an empty value appearing in NullFields will be sent to the server as
  6575. // null. It is an error if a field in this list has a non-empty value.
  6576. // This may be used to include null fields in Patch requests.
  6577. NullFields []string `json:"-"`
  6578. }
  6579. func (s *OrdersUpdateLineItemShippingDetailsRequest) MarshalJSON() ([]byte, error) {
  6580. type NoMethod OrdersUpdateLineItemShippingDetailsRequest
  6581. raw := NoMethod(*s)
  6582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6583. }
  6584. type OrdersUpdateLineItemShippingDetailsResponse struct {
  6585. // ExecutionStatus: The status of the execution.
  6586. ExecutionStatus string `json:"executionStatus,omitempty"`
  6587. // Kind: Identifies what kind of resource this is. Value: the fixed
  6588. // string "content#ordersUpdateLineItemShippingDetailsResponse".
  6589. Kind string `json:"kind,omitempty"`
  6590. // ServerResponse contains the HTTP response code and headers from the
  6591. // server.
  6592. googleapi.ServerResponse `json:"-"`
  6593. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6594. // unconditionally include in API requests. By default, fields with
  6595. // empty values are omitted from API requests. However, any non-pointer,
  6596. // non-interface field appearing in ForceSendFields will be sent to the
  6597. // server regardless of whether the field is empty or not. This may be
  6598. // used to include empty fields in Patch requests.
  6599. ForceSendFields []string `json:"-"`
  6600. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6601. // include in API requests with the JSON null value. By default, fields
  6602. // with empty values are omitted from API requests. However, any field
  6603. // with an empty value appearing in NullFields will be sent to the
  6604. // server as null. It is an error if a field in this list has a
  6605. // non-empty value. This may be used to include null fields in Patch
  6606. // requests.
  6607. NullFields []string `json:"-"`
  6608. }
  6609. func (s *OrdersUpdateLineItemShippingDetailsResponse) MarshalJSON() ([]byte, error) {
  6610. type NoMethod OrdersUpdateLineItemShippingDetailsResponse
  6611. raw := NoMethod(*s)
  6612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6613. }
  6614. type OrdersUpdateMerchantOrderIdRequest struct {
  6615. // MerchantOrderId: The merchant order id to be assigned to the order.
  6616. // Must be unique per merchant.
  6617. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  6618. // OperationId: The ID of the operation. Unique across all operations
  6619. // for a given order.
  6620. OperationId string `json:"operationId,omitempty"`
  6621. // ForceSendFields is a list of field names (e.g. "MerchantOrderId") to
  6622. // unconditionally include in API requests. By default, fields with
  6623. // empty values are omitted from API requests. However, any non-pointer,
  6624. // non-interface field appearing in ForceSendFields will be sent to the
  6625. // server regardless of whether the field is empty or not. This may be
  6626. // used to include empty fields in Patch requests.
  6627. ForceSendFields []string `json:"-"`
  6628. // NullFields is a list of field names (e.g. "MerchantOrderId") to
  6629. // include in API requests with the JSON null value. By default, fields
  6630. // with empty values are omitted from API requests. However, any field
  6631. // with an empty value appearing in NullFields will be sent to the
  6632. // server as null. It is an error if a field in this list has a
  6633. // non-empty value. This may be used to include null fields in Patch
  6634. // requests.
  6635. NullFields []string `json:"-"`
  6636. }
  6637. func (s *OrdersUpdateMerchantOrderIdRequest) MarshalJSON() ([]byte, error) {
  6638. type NoMethod OrdersUpdateMerchantOrderIdRequest
  6639. raw := NoMethod(*s)
  6640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6641. }
  6642. type OrdersUpdateMerchantOrderIdResponse struct {
  6643. // ExecutionStatus: The status of the execution.
  6644. ExecutionStatus string `json:"executionStatus,omitempty"`
  6645. // Kind: Identifies what kind of resource this is. Value: the fixed
  6646. // string "content#ordersUpdateMerchantOrderIdResponse".
  6647. Kind string `json:"kind,omitempty"`
  6648. // ServerResponse contains the HTTP response code and headers from the
  6649. // server.
  6650. googleapi.ServerResponse `json:"-"`
  6651. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6652. // unconditionally include in API requests. By default, fields with
  6653. // empty values are omitted from API requests. However, any non-pointer,
  6654. // non-interface field appearing in ForceSendFields will be sent to the
  6655. // server regardless of whether the field is empty or not. This may be
  6656. // used to include empty fields in Patch requests.
  6657. ForceSendFields []string `json:"-"`
  6658. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6659. // include in API requests with the JSON null value. By default, fields
  6660. // with empty values are omitted from API requests. However, any field
  6661. // with an empty value appearing in NullFields will be sent to the
  6662. // server as null. It is an error if a field in this list has a
  6663. // non-empty value. This may be used to include null fields in Patch
  6664. // requests.
  6665. NullFields []string `json:"-"`
  6666. }
  6667. func (s *OrdersUpdateMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  6668. type NoMethod OrdersUpdateMerchantOrderIdResponse
  6669. raw := NoMethod(*s)
  6670. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6671. }
  6672. type OrdersUpdateShipmentRequest struct {
  6673. // Carrier: The carrier handling the shipment. Not updated if missing.
  6674. // See shipments[].carrier in the Orders resource representation for a
  6675. // list of acceptable values.
  6676. Carrier string `json:"carrier,omitempty"`
  6677. // DeliveryDate: Date on which the shipment has been delivered, in ISO
  6678. // 8601 format. Optional and can be provided only if status is
  6679. // delivered.
  6680. DeliveryDate string `json:"deliveryDate,omitempty"`
  6681. // OperationId: The ID of the operation. Unique across all operations
  6682. // for a given order.
  6683. OperationId string `json:"operationId,omitempty"`
  6684. // ShipmentId: The ID of the shipment.
  6685. ShipmentId string `json:"shipmentId,omitempty"`
  6686. // Status: New status for the shipment. Not updated if missing.
  6687. Status string `json:"status,omitempty"`
  6688. // TrackingId: The tracking ID for the shipment. Not updated if missing.
  6689. TrackingId string `json:"trackingId,omitempty"`
  6690. // ForceSendFields is a list of field names (e.g. "Carrier") to
  6691. // unconditionally include in API requests. By default, fields with
  6692. // empty values are omitted from API requests. However, any non-pointer,
  6693. // non-interface field appearing in ForceSendFields will be sent to the
  6694. // server regardless of whether the field is empty or not. This may be
  6695. // used to include empty fields in Patch requests.
  6696. ForceSendFields []string `json:"-"`
  6697. // NullFields is a list of field names (e.g. "Carrier") to include in
  6698. // API requests with the JSON null value. By default, fields with empty
  6699. // values are omitted from API requests. However, any field with an
  6700. // empty value appearing in NullFields will be sent to the server as
  6701. // null. It is an error if a field in this list has a non-empty value.
  6702. // This may be used to include null fields in Patch requests.
  6703. NullFields []string `json:"-"`
  6704. }
  6705. func (s *OrdersUpdateShipmentRequest) MarshalJSON() ([]byte, error) {
  6706. type NoMethod OrdersUpdateShipmentRequest
  6707. raw := NoMethod(*s)
  6708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6709. }
  6710. type OrdersUpdateShipmentResponse struct {
  6711. // ExecutionStatus: The status of the execution.
  6712. ExecutionStatus string `json:"executionStatus,omitempty"`
  6713. // Kind: Identifies what kind of resource this is. Value: the fixed
  6714. // string "content#ordersUpdateShipmentResponse".
  6715. Kind string `json:"kind,omitempty"`
  6716. // ServerResponse contains the HTTP response code and headers from the
  6717. // server.
  6718. googleapi.ServerResponse `json:"-"`
  6719. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  6720. // unconditionally include in API requests. By default, fields with
  6721. // empty values are omitted from API requests. However, any non-pointer,
  6722. // non-interface field appearing in ForceSendFields will be sent to the
  6723. // server regardless of whether the field is empty or not. This may be
  6724. // used to include empty fields in Patch requests.
  6725. ForceSendFields []string `json:"-"`
  6726. // NullFields is a list of field names (e.g. "ExecutionStatus") to
  6727. // include in API requests with the JSON null value. By default, fields
  6728. // with empty values are omitted from API requests. However, any field
  6729. // with an empty value appearing in NullFields will be sent to the
  6730. // server as null. It is an error if a field in this list has a
  6731. // non-empty value. This may be used to include null fields in Patch
  6732. // requests.
  6733. NullFields []string `json:"-"`
  6734. }
  6735. func (s *OrdersUpdateShipmentResponse) MarshalJSON() ([]byte, error) {
  6736. type NoMethod OrdersUpdateShipmentResponse
  6737. raw := NoMethod(*s)
  6738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6739. }
  6740. type PosCustomBatchRequest struct {
  6741. // Entries: The request entries to be processed in the batch.
  6742. Entries []*PosCustomBatchRequestEntry `json:"entries,omitempty"`
  6743. // ForceSendFields is a list of field names (e.g. "Entries") to
  6744. // unconditionally include in API requests. By default, fields with
  6745. // empty values are omitted from API requests. However, any non-pointer,
  6746. // non-interface field appearing in ForceSendFields will be sent to the
  6747. // server regardless of whether the field is empty or not. This may be
  6748. // used to include empty fields in Patch requests.
  6749. ForceSendFields []string `json:"-"`
  6750. // NullFields is a list of field names (e.g. "Entries") to include in
  6751. // API requests with the JSON null value. By default, fields with empty
  6752. // values are omitted from API requests. However, any field with an
  6753. // empty value appearing in NullFields will be sent to the server as
  6754. // null. It is an error if a field in this list has a non-empty value.
  6755. // This may be used to include null fields in Patch requests.
  6756. NullFields []string `json:"-"`
  6757. }
  6758. func (s *PosCustomBatchRequest) MarshalJSON() ([]byte, error) {
  6759. type NoMethod PosCustomBatchRequest
  6760. raw := NoMethod(*s)
  6761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6762. }
  6763. type PosCustomBatchRequestEntry struct {
  6764. // BatchId: An entry ID, unique within the batch request.
  6765. BatchId int64 `json:"batchId,omitempty"`
  6766. // Inventory: The inventory to submit. Set this only if the method is
  6767. // inventory.
  6768. Inventory *PosInventory `json:"inventory,omitempty"`
  6769. // MerchantId: The ID of the POS data provider.
  6770. MerchantId uint64 `json:"merchantId,omitempty,string"`
  6771. Method string `json:"method,omitempty"`
  6772. // Sale: The sale information to submit. Set this only if the method is
  6773. // sale.
  6774. Sale *PosSale `json:"sale,omitempty"`
  6775. // Store: The store information to submit. Set this only if the method
  6776. // is insert.
  6777. Store *PosStore `json:"store,omitempty"`
  6778. // StoreCode: The store code. Set this only if the method is delete or
  6779. // get.
  6780. StoreCode string `json:"storeCode,omitempty"`
  6781. // TargetMerchantId: The ID of the account for which to get/submit data.
  6782. TargetMerchantId uint64 `json:"targetMerchantId,omitempty,string"`
  6783. // ForceSendFields is a list of field names (e.g. "BatchId") to
  6784. // unconditionally include in API requests. By default, fields with
  6785. // empty values are omitted from API requests. However, any non-pointer,
  6786. // non-interface field appearing in ForceSendFields will be sent to the
  6787. // server regardless of whether the field is empty or not. This may be
  6788. // used to include empty fields in Patch requests.
  6789. ForceSendFields []string `json:"-"`
  6790. // NullFields is a list of field names (e.g. "BatchId") to include in
  6791. // API requests with the JSON null value. By default, fields with empty
  6792. // values are omitted from API requests. However, any field with an
  6793. // empty value appearing in NullFields will be sent to the server as
  6794. // null. It is an error if a field in this list has a non-empty value.
  6795. // This may be used to include null fields in Patch requests.
  6796. NullFields []string `json:"-"`
  6797. }
  6798. func (s *PosCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  6799. type NoMethod PosCustomBatchRequestEntry
  6800. raw := NoMethod(*s)
  6801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6802. }
  6803. type PosCustomBatchResponse struct {
  6804. // Entries: The result of the execution of the batch requests.
  6805. Entries []*PosCustomBatchResponseEntry `json:"entries,omitempty"`
  6806. // Kind: Identifies what kind of resource this is. Value: the fixed
  6807. // string "content#posCustomBatchResponse".
  6808. Kind string `json:"kind,omitempty"`
  6809. // ServerResponse contains the HTTP response code and headers from the
  6810. // server.
  6811. googleapi.ServerResponse `json:"-"`
  6812. // ForceSendFields is a list of field names (e.g. "Entries") to
  6813. // unconditionally include in API requests. By default, fields with
  6814. // empty values are omitted from API requests. However, any non-pointer,
  6815. // non-interface field appearing in ForceSendFields will be sent to the
  6816. // server regardless of whether the field is empty or not. This may be
  6817. // used to include empty fields in Patch requests.
  6818. ForceSendFields []string `json:"-"`
  6819. // NullFields is a list of field names (e.g. "Entries") to include in
  6820. // API requests with the JSON null value. By default, fields with empty
  6821. // values are omitted from API requests. However, any field with an
  6822. // empty value appearing in NullFields will be sent to the server as
  6823. // null. It is an error if a field in this list has a non-empty value.
  6824. // This may be used to include null fields in Patch requests.
  6825. NullFields []string `json:"-"`
  6826. }
  6827. func (s *PosCustomBatchResponse) MarshalJSON() ([]byte, error) {
  6828. type NoMethod PosCustomBatchResponse
  6829. raw := NoMethod(*s)
  6830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6831. }
  6832. type PosCustomBatchResponseEntry struct {
  6833. // BatchId: The ID of the request entry to which this entry responds.
  6834. BatchId int64 `json:"batchId,omitempty"`
  6835. // Errors: A list of errors defined if, and only if, the request failed.
  6836. Errors *Errors `json:"errors,omitempty"`
  6837. // Inventory: The updated inventory information.
  6838. Inventory *PosInventory `json:"inventory,omitempty"`
  6839. // Kind: Identifies what kind of resource this is. Value: the fixed
  6840. // string "content#posCustomBatchResponseEntry".
  6841. Kind string `json:"kind,omitempty"`
  6842. // Sale: The updated sale information.
  6843. Sale *PosSale `json:"sale,omitempty"`
  6844. // Store: The retrieved or updated store information.
  6845. Store *PosStore `json:"store,omitempty"`
  6846. // ForceSendFields is a list of field names (e.g. "BatchId") to
  6847. // unconditionally include in API requests. By default, fields with
  6848. // empty values are omitted from API requests. However, any non-pointer,
  6849. // non-interface field appearing in ForceSendFields will be sent to the
  6850. // server regardless of whether the field is empty or not. This may be
  6851. // used to include empty fields in Patch requests.
  6852. ForceSendFields []string `json:"-"`
  6853. // NullFields is a list of field names (e.g. "BatchId") to include in
  6854. // API requests with the JSON null value. By default, fields with empty
  6855. // values are omitted from API requests. However, any field with an
  6856. // empty value appearing in NullFields will be sent to the server as
  6857. // null. It is an error if a field in this list has a non-empty value.
  6858. // This may be used to include null fields in Patch requests.
  6859. NullFields []string `json:"-"`
  6860. }
  6861. func (s *PosCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  6862. type NoMethod PosCustomBatchResponseEntry
  6863. raw := NoMethod(*s)
  6864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6865. }
  6866. type PosDataProviders struct {
  6867. // Country: Country code.
  6868. Country string `json:"country,omitempty"`
  6869. // PosDataProviders: A list of POS data providers.
  6870. PosDataProviders []*PosDataProvidersPosDataProvider `json:"posDataProviders,omitempty"`
  6871. // ForceSendFields is a list of field names (e.g. "Country") to
  6872. // unconditionally include in API requests. By default, fields with
  6873. // empty values are omitted from API requests. However, any non-pointer,
  6874. // non-interface field appearing in ForceSendFields will be sent to the
  6875. // server regardless of whether the field is empty or not. This may be
  6876. // used to include empty fields in Patch requests.
  6877. ForceSendFields []string `json:"-"`
  6878. // NullFields is a list of field names (e.g. "Country") to include in
  6879. // API requests with the JSON null value. By default, fields with empty
  6880. // values are omitted from API requests. However, any field with an
  6881. // empty value appearing in NullFields will be sent to the server as
  6882. // null. It is an error if a field in this list has a non-empty value.
  6883. // This may be used to include null fields in Patch requests.
  6884. NullFields []string `json:"-"`
  6885. }
  6886. func (s *PosDataProviders) MarshalJSON() ([]byte, error) {
  6887. type NoMethod PosDataProviders
  6888. raw := NoMethod(*s)
  6889. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6890. }
  6891. type PosDataProvidersPosDataProvider struct {
  6892. // DisplayName: The display name of Pos data Provider.
  6893. DisplayName string `json:"displayName,omitempty"`
  6894. // FullName: The full name of this POS data Provider.
  6895. FullName string `json:"fullName,omitempty"`
  6896. // ProviderId: The ID of the account.
  6897. ProviderId uint64 `json:"providerId,omitempty,string"`
  6898. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  6899. // unconditionally include in API requests. By default, fields with
  6900. // empty values are omitted from API requests. However, any non-pointer,
  6901. // non-interface field appearing in ForceSendFields will be sent to the
  6902. // server regardless of whether the field is empty or not. This may be
  6903. // used to include empty fields in Patch requests.
  6904. ForceSendFields []string `json:"-"`
  6905. // NullFields is a list of field names (e.g. "DisplayName") to include
  6906. // in API requests with the JSON null value. By default, fields with
  6907. // empty values are omitted from API requests. However, any field with
  6908. // an empty value appearing in NullFields will be sent to the server as
  6909. // null. It is an error if a field in this list has a non-empty value.
  6910. // This may be used to include null fields in Patch requests.
  6911. NullFields []string `json:"-"`
  6912. }
  6913. func (s *PosDataProvidersPosDataProvider) MarshalJSON() ([]byte, error) {
  6914. type NoMethod PosDataProvidersPosDataProvider
  6915. raw := NoMethod(*s)
  6916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6917. }
  6918. // PosInventory: The absolute quantity of an item available at the given
  6919. // store.
  6920. type PosInventory struct {
  6921. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  6922. ContentLanguage string `json:"contentLanguage,omitempty"`
  6923. // Gtin: Global Trade Item Number.
  6924. Gtin string `json:"gtin,omitempty"`
  6925. // ItemId: A unique identifier for the item.
  6926. ItemId string `json:"itemId,omitempty"`
  6927. // Kind: Identifies what kind of resource this is. Value: the fixed
  6928. // string "content#posInventory".
  6929. Kind string `json:"kind,omitempty"`
  6930. // Price: The current price of the item.
  6931. Price *Price `json:"price,omitempty"`
  6932. // Quantity: The available quantity of the item.
  6933. Quantity int64 `json:"quantity,omitempty,string"`
  6934. // StoreCode: The identifier of the merchant's store. Either a storeCode
  6935. // inserted via the API or the code of the store in Google My Business.
  6936. StoreCode string `json:"storeCode,omitempty"`
  6937. // TargetCountry: The CLDR territory code for the item.
  6938. TargetCountry string `json:"targetCountry,omitempty"`
  6939. // Timestamp: The inventory timestamp, in ISO 8601 format.
  6940. Timestamp string `json:"timestamp,omitempty"`
  6941. // ForceSendFields is a list of field names (e.g. "ContentLanguage") to
  6942. // unconditionally include in API requests. By default, fields with
  6943. // empty values are omitted from API requests. However, any non-pointer,
  6944. // non-interface field appearing in ForceSendFields will be sent to the
  6945. // server regardless of whether the field is empty or not. This may be
  6946. // used to include empty fields in Patch requests.
  6947. ForceSendFields []string `json:"-"`
  6948. // NullFields is a list of field names (e.g. "ContentLanguage") to
  6949. // include in API requests with the JSON null value. By default, fields
  6950. // with empty values are omitted from API requests. However, any field
  6951. // with an empty value appearing in NullFields will be sent to the
  6952. // server as null. It is an error if a field in this list has a
  6953. // non-empty value. This may be used to include null fields in Patch
  6954. // requests.
  6955. NullFields []string `json:"-"`
  6956. }
  6957. func (s *PosInventory) MarshalJSON() ([]byte, error) {
  6958. type NoMethod PosInventory
  6959. raw := NoMethod(*s)
  6960. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6961. }
  6962. type PosInventoryRequest struct {
  6963. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  6964. ContentLanguage string `json:"contentLanguage,omitempty"`
  6965. // Gtin: Global Trade Item Number.
  6966. Gtin string `json:"gtin,omitempty"`
  6967. // ItemId: A unique identifier for the item.
  6968. ItemId string `json:"itemId,omitempty"`
  6969. // Price: The current price of the item.
  6970. Price *Price `json:"price,omitempty"`
  6971. // Quantity: The available quantity of the item.
  6972. Quantity int64 `json:"quantity,omitempty,string"`
  6973. // StoreCode: The identifier of the merchant's store. Either a storeCode
  6974. // inserted via the API or the code of the store in Google My Business.
  6975. StoreCode string `json:"storeCode,omitempty"`
  6976. // TargetCountry: The CLDR territory code for the item.
  6977. TargetCountry string `json:"targetCountry,omitempty"`
  6978. // Timestamp: The inventory timestamp, in ISO 8601 format.
  6979. Timestamp string `json:"timestamp,omitempty"`
  6980. // ForceSendFields is a list of field names (e.g. "ContentLanguage") to
  6981. // unconditionally include in API requests. By default, fields with
  6982. // empty values are omitted from API requests. However, any non-pointer,
  6983. // non-interface field appearing in ForceSendFields will be sent to the
  6984. // server regardless of whether the field is empty or not. This may be
  6985. // used to include empty fields in Patch requests.
  6986. ForceSendFields []string `json:"-"`
  6987. // NullFields is a list of field names (e.g. "ContentLanguage") to
  6988. // include in API requests with the JSON null value. By default, fields
  6989. // with empty values are omitted from API requests. However, any field
  6990. // with an empty value appearing in NullFields will be sent to the
  6991. // server as null. It is an error if a field in this list has a
  6992. // non-empty value. This may be used to include null fields in Patch
  6993. // requests.
  6994. NullFields []string `json:"-"`
  6995. }
  6996. func (s *PosInventoryRequest) MarshalJSON() ([]byte, error) {
  6997. type NoMethod PosInventoryRequest
  6998. raw := NoMethod(*s)
  6999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7000. }
  7001. type PosInventoryResponse struct {
  7002. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  7003. ContentLanguage string `json:"contentLanguage,omitempty"`
  7004. // Gtin: Global Trade Item Number.
  7005. Gtin string `json:"gtin,omitempty"`
  7006. // ItemId: A unique identifier for the item.
  7007. ItemId string `json:"itemId,omitempty"`
  7008. // Kind: Identifies what kind of resource this is. Value: the fixed
  7009. // string "content#posInventoryResponse".
  7010. Kind string `json:"kind,omitempty"`
  7011. // Price: The current price of the item.
  7012. Price *Price `json:"price,omitempty"`
  7013. // Quantity: The available quantity of the item.
  7014. Quantity int64 `json:"quantity,omitempty,string"`
  7015. // StoreCode: The identifier of the merchant's store. Either a storeCode
  7016. // inserted via the API or the code of the store in Google My Business.
  7017. StoreCode string `json:"storeCode,omitempty"`
  7018. // TargetCountry: The CLDR territory code for the item.
  7019. TargetCountry string `json:"targetCountry,omitempty"`
  7020. // Timestamp: The inventory timestamp, in ISO 8601 format.
  7021. Timestamp string `json:"timestamp,omitempty"`
  7022. // ServerResponse contains the HTTP response code and headers from the
  7023. // server.
  7024. googleapi.ServerResponse `json:"-"`
  7025. // ForceSendFields is a list of field names (e.g. "ContentLanguage") to
  7026. // unconditionally include in API requests. By default, fields with
  7027. // empty values are omitted from API requests. However, any non-pointer,
  7028. // non-interface field appearing in ForceSendFields will be sent to the
  7029. // server regardless of whether the field is empty or not. This may be
  7030. // used to include empty fields in Patch requests.
  7031. ForceSendFields []string `json:"-"`
  7032. // NullFields is a list of field names (e.g. "ContentLanguage") to
  7033. // include in API requests with the JSON null value. By default, fields
  7034. // with empty values are omitted from API requests. However, any field
  7035. // with an empty value appearing in NullFields will be sent to the
  7036. // server as null. It is an error if a field in this list has a
  7037. // non-empty value. This may be used to include null fields in Patch
  7038. // requests.
  7039. NullFields []string `json:"-"`
  7040. }
  7041. func (s *PosInventoryResponse) MarshalJSON() ([]byte, error) {
  7042. type NoMethod PosInventoryResponse
  7043. raw := NoMethod(*s)
  7044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7045. }
  7046. type PosListResponse struct {
  7047. // Kind: Identifies what kind of resource this is. Value: the fixed
  7048. // string "content#posListResponse".
  7049. Kind string `json:"kind,omitempty"`
  7050. Resources []*PosStore `json:"resources,omitempty"`
  7051. // ServerResponse contains the HTTP response code and headers from the
  7052. // server.
  7053. googleapi.ServerResponse `json:"-"`
  7054. // ForceSendFields is a list of field names (e.g. "Kind") to
  7055. // unconditionally include in API requests. By default, fields with
  7056. // empty values are omitted from API requests. However, any non-pointer,
  7057. // non-interface field appearing in ForceSendFields will be sent to the
  7058. // server regardless of whether the field is empty or not. This may be
  7059. // used to include empty fields in Patch requests.
  7060. ForceSendFields []string `json:"-"`
  7061. // NullFields is a list of field names (e.g. "Kind") to include in API
  7062. // requests with the JSON null value. By default, fields with empty
  7063. // values are omitted from API requests. However, any field with an
  7064. // empty value appearing in NullFields will be sent to the server as
  7065. // null. It is an error if a field in this list has a non-empty value.
  7066. // This may be used to include null fields in Patch requests.
  7067. NullFields []string `json:"-"`
  7068. }
  7069. func (s *PosListResponse) MarshalJSON() ([]byte, error) {
  7070. type NoMethod PosListResponse
  7071. raw := NoMethod(*s)
  7072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7073. }
  7074. // PosSale: The change of the available quantity of an item at the given
  7075. // store.
  7076. type PosSale struct {
  7077. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  7078. ContentLanguage string `json:"contentLanguage,omitempty"`
  7079. // Gtin: Global Trade Item Number.
  7080. Gtin string `json:"gtin,omitempty"`
  7081. // ItemId: A unique identifier for the item.
  7082. ItemId string `json:"itemId,omitempty"`
  7083. // Kind: Identifies what kind of resource this is. Value: the fixed
  7084. // string "content#posSale".
  7085. Kind string `json:"kind,omitempty"`
  7086. // Price: The price of the item.
  7087. Price *Price `json:"price,omitempty"`
  7088. // Quantity: The relative change of the available quantity. Negative for
  7089. // items returned.
  7090. Quantity int64 `json:"quantity,omitempty,string"`
  7091. // SaleId: A unique ID to group items from the same sale event.
  7092. SaleId string `json:"saleId,omitempty"`
  7093. // StoreCode: The identifier of the merchant's store. Either a storeCode
  7094. // inserted via the API or the code of the store in Google My Business.
  7095. StoreCode string `json:"storeCode,omitempty"`
  7096. // TargetCountry: The CLDR territory code for the item.
  7097. TargetCountry string `json:"targetCountry,omitempty"`
  7098. // Timestamp: The inventory timestamp, in ISO 8601 format.
  7099. Timestamp string `json:"timestamp,omitempty"`
  7100. // ForceSendFields is a list of field names (e.g. "ContentLanguage") to
  7101. // unconditionally include in API requests. By default, fields with
  7102. // empty values are omitted from API requests. However, any non-pointer,
  7103. // non-interface field appearing in ForceSendFields will be sent to the
  7104. // server regardless of whether the field is empty or not. This may be
  7105. // used to include empty fields in Patch requests.
  7106. ForceSendFields []string `json:"-"`
  7107. // NullFields is a list of field names (e.g. "ContentLanguage") to
  7108. // include in API requests with the JSON null value. By default, fields
  7109. // with empty values are omitted from API requests. However, any field
  7110. // with an empty value appearing in NullFields will be sent to the
  7111. // server as null. It is an error if a field in this list has a
  7112. // non-empty value. This may be used to include null fields in Patch
  7113. // requests.
  7114. NullFields []string `json:"-"`
  7115. }
  7116. func (s *PosSale) MarshalJSON() ([]byte, error) {
  7117. type NoMethod PosSale
  7118. raw := NoMethod(*s)
  7119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7120. }
  7121. type PosSaleRequest struct {
  7122. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  7123. ContentLanguage string `json:"contentLanguage,omitempty"`
  7124. // Gtin: Global Trade Item Number.
  7125. Gtin string `json:"gtin,omitempty"`
  7126. // ItemId: A unique identifier for the item.
  7127. ItemId string `json:"itemId,omitempty"`
  7128. // Price: The price of the item.
  7129. Price *Price `json:"price,omitempty"`
  7130. // Quantity: The relative change of the available quantity. Negative for
  7131. // items returned.
  7132. Quantity int64 `json:"quantity,omitempty,string"`
  7133. // SaleId: A unique ID to group items from the same sale event.
  7134. SaleId string `json:"saleId,omitempty"`
  7135. // StoreCode: The identifier of the merchant's store. Either a storeCode
  7136. // inserted via the API or the code of the store in Google My Business.
  7137. StoreCode string `json:"storeCode,omitempty"`
  7138. // TargetCountry: The CLDR territory code for the item.
  7139. TargetCountry string `json:"targetCountry,omitempty"`
  7140. // Timestamp: The inventory timestamp, in ISO 8601 format.
  7141. Timestamp string `json:"timestamp,omitempty"`
  7142. // ForceSendFields is a list of field names (e.g. "ContentLanguage") to
  7143. // unconditionally include in API requests. By default, fields with
  7144. // empty values are omitted from API requests. However, any non-pointer,
  7145. // non-interface field appearing in ForceSendFields will be sent to the
  7146. // server regardless of whether the field is empty or not. This may be
  7147. // used to include empty fields in Patch requests.
  7148. ForceSendFields []string `json:"-"`
  7149. // NullFields is a list of field names (e.g. "ContentLanguage") to
  7150. // include in API requests with the JSON null value. By default, fields
  7151. // with empty values are omitted from API requests. However, any field
  7152. // with an empty value appearing in NullFields will be sent to the
  7153. // server as null. It is an error if a field in this list has a
  7154. // non-empty value. This may be used to include null fields in Patch
  7155. // requests.
  7156. NullFields []string `json:"-"`
  7157. }
  7158. func (s *PosSaleRequest) MarshalJSON() ([]byte, error) {
  7159. type NoMethod PosSaleRequest
  7160. raw := NoMethod(*s)
  7161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7162. }
  7163. type PosSaleResponse struct {
  7164. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  7165. ContentLanguage string `json:"contentLanguage,omitempty"`
  7166. // Gtin: Global Trade Item Number.
  7167. Gtin string `json:"gtin,omitempty"`
  7168. // ItemId: A unique identifier for the item.
  7169. ItemId string `json:"itemId,omitempty"`
  7170. // Kind: Identifies what kind of resource this is. Value: the fixed
  7171. // string "content#posSaleResponse".
  7172. Kind string `json:"kind,omitempty"`
  7173. // Price: The price of the item.
  7174. Price *Price `json:"price,omitempty"`
  7175. // Quantity: The relative change of the available quantity. Negative for
  7176. // items returned.
  7177. Quantity int64 `json:"quantity,omitempty,string"`
  7178. // SaleId: A unique ID to group items from the same sale event.
  7179. SaleId string `json:"saleId,omitempty"`
  7180. // StoreCode: The identifier of the merchant's store. Either a storeCode
  7181. // inserted via the API or the code of the store in Google My Business.
  7182. StoreCode string `json:"storeCode,omitempty"`
  7183. // TargetCountry: The CLDR territory code for the item.
  7184. TargetCountry string `json:"targetCountry,omitempty"`
  7185. // Timestamp: The inventory timestamp, in ISO 8601 format.
  7186. Timestamp string `json:"timestamp,omitempty"`
  7187. // ServerResponse contains the HTTP response code and headers from the
  7188. // server.
  7189. googleapi.ServerResponse `json:"-"`
  7190. // ForceSendFields is a list of field names (e.g. "ContentLanguage") to
  7191. // unconditionally include in API requests. By default, fields with
  7192. // empty values are omitted from API requests. However, any non-pointer,
  7193. // non-interface field appearing in ForceSendFields will be sent to the
  7194. // server regardless of whether the field is empty or not. This may be
  7195. // used to include empty fields in Patch requests.
  7196. ForceSendFields []string `json:"-"`
  7197. // NullFields is a list of field names (e.g. "ContentLanguage") to
  7198. // include in API requests with the JSON null value. By default, fields
  7199. // with empty values are omitted from API requests. However, any field
  7200. // with an empty value appearing in NullFields will be sent to the
  7201. // server as null. It is an error if a field in this list has a
  7202. // non-empty value. This may be used to include null fields in Patch
  7203. // requests.
  7204. NullFields []string `json:"-"`
  7205. }
  7206. func (s *PosSaleResponse) MarshalJSON() ([]byte, error) {
  7207. type NoMethod PosSaleResponse
  7208. raw := NoMethod(*s)
  7209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7210. }
  7211. // PosStore: Store resource.
  7212. type PosStore struct {
  7213. // Kind: Identifies what kind of resource this is. Value: the fixed
  7214. // string "content#posStore".
  7215. Kind string `json:"kind,omitempty"`
  7216. // StoreAddress: The street address of the store.
  7217. StoreAddress string `json:"storeAddress,omitempty"`
  7218. // StoreCode: A store identifier that is unique for the given merchant.
  7219. StoreCode string `json:"storeCode,omitempty"`
  7220. // ServerResponse contains the HTTP response code and headers from the
  7221. // server.
  7222. googleapi.ServerResponse `json:"-"`
  7223. // ForceSendFields is a list of field names (e.g. "Kind") to
  7224. // unconditionally include in API requests. By default, fields with
  7225. // empty values are omitted from API requests. However, any non-pointer,
  7226. // non-interface field appearing in ForceSendFields will be sent to the
  7227. // server regardless of whether the field is empty or not. This may be
  7228. // used to include empty fields in Patch requests.
  7229. ForceSendFields []string `json:"-"`
  7230. // NullFields is a list of field names (e.g. "Kind") to include in API
  7231. // requests with the JSON null value. By default, fields with empty
  7232. // values are omitted from API requests. However, any field with an
  7233. // empty value appearing in NullFields will be sent to the server as
  7234. // null. It is an error if a field in this list has a non-empty value.
  7235. // This may be used to include null fields in Patch requests.
  7236. NullFields []string `json:"-"`
  7237. }
  7238. func (s *PosStore) MarshalJSON() ([]byte, error) {
  7239. type NoMethod PosStore
  7240. raw := NoMethod(*s)
  7241. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7242. }
  7243. type PostalCodeGroup struct {
  7244. // Country: The CLDR territory code of the country the postal code group
  7245. // applies to. Required.
  7246. Country string `json:"country,omitempty"`
  7247. // Name: The name of the postal code group, referred to in headers.
  7248. // Required.
  7249. Name string `json:"name,omitempty"`
  7250. // PostalCodeRanges: A range of postal codes. Required.
  7251. PostalCodeRanges []*PostalCodeRange `json:"postalCodeRanges,omitempty"`
  7252. // ForceSendFields is a list of field names (e.g. "Country") to
  7253. // unconditionally include in API requests. By default, fields with
  7254. // empty values are omitted from API requests. However, any non-pointer,
  7255. // non-interface field appearing in ForceSendFields will be sent to the
  7256. // server regardless of whether the field is empty or not. This may be
  7257. // used to include empty fields in Patch requests.
  7258. ForceSendFields []string `json:"-"`
  7259. // NullFields is a list of field names (e.g. "Country") to include in
  7260. // API requests with the JSON null value. By default, fields with empty
  7261. // values are omitted from API requests. However, any field with an
  7262. // empty value appearing in NullFields will be sent to the server as
  7263. // null. It is an error if a field in this list has a non-empty value.
  7264. // This may be used to include null fields in Patch requests.
  7265. NullFields []string `json:"-"`
  7266. }
  7267. func (s *PostalCodeGroup) MarshalJSON() ([]byte, error) {
  7268. type NoMethod PostalCodeGroup
  7269. raw := NoMethod(*s)
  7270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7271. }
  7272. type PostalCodeRange struct {
  7273. // PostalCodeRangeBegin: A postal code or a pattern of the form prefix*
  7274. // denoting the inclusive lower bound of the range defining the area.
  7275. // Examples values: "94108", "9410*", "9*". Required.
  7276. PostalCodeRangeBegin string `json:"postalCodeRangeBegin,omitempty"`
  7277. // PostalCodeRangeEnd: A postal code or a pattern of the form prefix*
  7278. // denoting the inclusive upper bound of the range defining the area. It
  7279. // must have the same length as postalCodeRangeBegin: if
  7280. // postalCodeRangeBegin is a postal code then postalCodeRangeEnd must be
  7281. // a postal code too; if postalCodeRangeBegin is a pattern then
  7282. // postalCodeRangeEnd must be a pattern with the same prefix length.
  7283. // Optional: if not set, then the area is defined as being all the
  7284. // postal codes matching postalCodeRangeBegin.
  7285. PostalCodeRangeEnd string `json:"postalCodeRangeEnd,omitempty"`
  7286. // ForceSendFields is a list of field names (e.g.
  7287. // "PostalCodeRangeBegin") to unconditionally include in API requests.
  7288. // By default, fields with empty values are omitted from API requests.
  7289. // However, any non-pointer, non-interface field appearing in
  7290. // ForceSendFields will be sent to the server regardless of whether the
  7291. // field is empty or not. This may be used to include empty fields in
  7292. // Patch requests.
  7293. ForceSendFields []string `json:"-"`
  7294. // NullFields is a list of field names (e.g. "PostalCodeRangeBegin") to
  7295. // include in API requests with the JSON null value. By default, fields
  7296. // with empty values are omitted from API requests. However, any field
  7297. // with an empty value appearing in NullFields will be sent to the
  7298. // server as null. It is an error if a field in this list has a
  7299. // non-empty value. This may be used to include null fields in Patch
  7300. // requests.
  7301. NullFields []string `json:"-"`
  7302. }
  7303. func (s *PostalCodeRange) MarshalJSON() ([]byte, error) {
  7304. type NoMethod PostalCodeRange
  7305. raw := NoMethod(*s)
  7306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7307. }
  7308. type Price struct {
  7309. // Currency: The currency of the price.
  7310. Currency string `json:"currency,omitempty"`
  7311. // Value: The price represented as a number.
  7312. Value string `json:"value,omitempty"`
  7313. // ForceSendFields is a list of field names (e.g. "Currency") to
  7314. // unconditionally include in API requests. By default, fields with
  7315. // empty values are omitted from API requests. However, any non-pointer,
  7316. // non-interface field appearing in ForceSendFields will be sent to the
  7317. // server regardless of whether the field is empty or not. This may be
  7318. // used to include empty fields in Patch requests.
  7319. ForceSendFields []string `json:"-"`
  7320. // NullFields is a list of field names (e.g. "Currency") to include in
  7321. // API requests with the JSON null value. By default, fields with empty
  7322. // values are omitted from API requests. However, any field with an
  7323. // empty value appearing in NullFields will be sent to the server as
  7324. // null. It is an error if a field in this list has a non-empty value.
  7325. // This may be used to include null fields in Patch requests.
  7326. NullFields []string `json:"-"`
  7327. }
  7328. func (s *Price) MarshalJSON() ([]byte, error) {
  7329. type NoMethod Price
  7330. raw := NoMethod(*s)
  7331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7332. }
  7333. // Product: Product data. After inserting, updating, or deleting a
  7334. // product, it may take several minutes before changes take effect.
  7335. type Product struct {
  7336. // AdditionalImageLinks: Additional URLs of images of the item.
  7337. AdditionalImageLinks []string `json:"additionalImageLinks,omitempty"`
  7338. // AdditionalProductTypes: Additional categories of the item (formatted
  7339. // as in products feed specification).
  7340. AdditionalProductTypes []string `json:"additionalProductTypes,omitempty"`
  7341. // Adult: Set to true if the item is targeted towards adults.
  7342. Adult bool `json:"adult,omitempty"`
  7343. // AdwordsGrouping: Used to group items in an arbitrary way. Only for
  7344. // CPA%, discouraged otherwise.
  7345. AdwordsGrouping string `json:"adwordsGrouping,omitempty"`
  7346. // AdwordsLabels: Similar to adwords_grouping, but only works on CPC.
  7347. AdwordsLabels []string `json:"adwordsLabels,omitempty"`
  7348. // AdwordsRedirect: Allows advertisers to override the item URL when the
  7349. // product is shown within the context of Product Ads.
  7350. AdwordsRedirect string `json:"adwordsRedirect,omitempty"`
  7351. // AgeGroup: Target age group of the item.
  7352. AgeGroup string `json:"ageGroup,omitempty"`
  7353. // Aspects: Deprecated. Do not use.
  7354. Aspects []*ProductAspect `json:"aspects,omitempty"`
  7355. // Availability: Availability status of the item.
  7356. Availability string `json:"availability,omitempty"`
  7357. // AvailabilityDate: The day a pre-ordered product becomes available for
  7358. // delivery, in ISO 8601 format.
  7359. AvailabilityDate string `json:"availabilityDate,omitempty"`
  7360. // Brand: Brand of the item.
  7361. Brand string `json:"brand,omitempty"`
  7362. // Channel: The item's channel (online or local).
  7363. Channel string `json:"channel,omitempty"`
  7364. // Color: Color of the item.
  7365. Color string `json:"color,omitempty"`
  7366. // Condition: Condition or state of the item.
  7367. Condition string `json:"condition,omitempty"`
  7368. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  7369. ContentLanguage string `json:"contentLanguage,omitempty"`
  7370. // CostOfGoodsSold: Cost of goods sold. Used for gross profit reporting.
  7371. CostOfGoodsSold *Price `json:"costOfGoodsSold,omitempty"`
  7372. // CustomAttributes: A list of custom (merchant-provided) attributes. It
  7373. // can also be used for submitting any attribute of the feed
  7374. // specification in its generic form (e.g., { "name": "size type",
  7375. // "type": "text", "value": "regular" }). This is useful for submitting
  7376. // attributes not explicitly exposed by the API.
  7377. CustomAttributes []*CustomAttribute `json:"customAttributes,omitempty"`
  7378. // CustomGroups: A list of custom (merchant-provided) custom attribute
  7379. // groups.
  7380. CustomGroups []*CustomGroup `json:"customGroups,omitempty"`
  7381. // CustomLabel0: Custom label 0 for custom grouping of items in a
  7382. // Shopping campaign.
  7383. CustomLabel0 string `json:"customLabel0,omitempty"`
  7384. // CustomLabel1: Custom label 1 for custom grouping of items in a
  7385. // Shopping campaign.
  7386. CustomLabel1 string `json:"customLabel1,omitempty"`
  7387. // CustomLabel2: Custom label 2 for custom grouping of items in a
  7388. // Shopping campaign.
  7389. CustomLabel2 string `json:"customLabel2,omitempty"`
  7390. // CustomLabel3: Custom label 3 for custom grouping of items in a
  7391. // Shopping campaign.
  7392. CustomLabel3 string `json:"customLabel3,omitempty"`
  7393. // CustomLabel4: Custom label 4 for custom grouping of items in a
  7394. // Shopping campaign.
  7395. CustomLabel4 string `json:"customLabel4,omitempty"`
  7396. // Description: Description of the item.
  7397. Description string `json:"description,omitempty"`
  7398. // Destinations: Specifies the intended destinations for the product.
  7399. Destinations []*ProductDestination `json:"destinations,omitempty"`
  7400. // DisplayAdsId: An identifier for an item for dynamic remarketing
  7401. // campaigns.
  7402. DisplayAdsId string `json:"displayAdsId,omitempty"`
  7403. // DisplayAdsLink: URL directly to your item's landing page for dynamic
  7404. // remarketing campaigns.
  7405. DisplayAdsLink string `json:"displayAdsLink,omitempty"`
  7406. // DisplayAdsSimilarIds: Advertiser-specified recommendations.
  7407. DisplayAdsSimilarIds []string `json:"displayAdsSimilarIds,omitempty"`
  7408. // DisplayAdsTitle: Title of an item for dynamic remarketing campaigns.
  7409. DisplayAdsTitle string `json:"displayAdsTitle,omitempty"`
  7410. // DisplayAdsValue: Offer margin for dynamic remarketing campaigns.
  7411. DisplayAdsValue float64 `json:"displayAdsValue,omitempty"`
  7412. // EnergyEfficiencyClass: The energy efficiency class as defined in EU
  7413. // directive 2010/30/EU.
  7414. EnergyEfficiencyClass string `json:"energyEfficiencyClass,omitempty"`
  7415. // ExpirationDate: Date on which the item should expire, as specified
  7416. // upon insertion, in ISO 8601 format. The actual expiration date in
  7417. // Google Shopping is exposed in productstatuses as googleExpirationDate
  7418. // and might be earlier if expirationDate is too far in the future.
  7419. ExpirationDate string `json:"expirationDate,omitempty"`
  7420. // Gender: Target gender of the item.
  7421. Gender string `json:"gender,omitempty"`
  7422. // GoogleProductCategory: Google's category of the item (see Google
  7423. // product taxonomy).
  7424. GoogleProductCategory string `json:"googleProductCategory,omitempty"`
  7425. // Gtin: Global Trade Item Number (GTIN) of the item.
  7426. Gtin string `json:"gtin,omitempty"`
  7427. // Id: The REST ID of the product. Content API methods that operate on
  7428. // products take this as their productId parameter.
  7429. // The REST ID for a product is of the form
  7430. // channel:contentLanguage:targetCountry:offerId.
  7431. Id string `json:"id,omitempty"`
  7432. // IdentifierExists: False when the item does not have unique product
  7433. // identifiers appropriate to its category, such as GTIN, MPN, and
  7434. // brand. Required according to the Unique Product Identifier Rules for
  7435. // all target countries except for Canada.
  7436. IdentifierExists bool `json:"identifierExists,omitempty"`
  7437. // ImageLink: URL of an image of the item.
  7438. ImageLink string `json:"imageLink,omitempty"`
  7439. // Installment: Number and amount of installments to pay for an item.
  7440. // Brazil only.
  7441. Installment *Installment `json:"installment,omitempty"`
  7442. // IsBundle: Whether the item is a merchant-defined bundle. A bundle is
  7443. // a custom grouping of different products sold by a merchant for a
  7444. // single price.
  7445. IsBundle bool `json:"isBundle,omitempty"`
  7446. // ItemGroupId: Shared identifier for all variants of the same product.
  7447. ItemGroupId string `json:"itemGroupId,omitempty"`
  7448. // Kind: Identifies what kind of resource this is. Value: the fixed
  7449. // string "content#product".
  7450. Kind string `json:"kind,omitempty"`
  7451. // Link: URL directly linking to your item's page on your website.
  7452. Link string `json:"link,omitempty"`
  7453. // LoyaltyPoints: Loyalty points that users receive after purchasing the
  7454. // item. Japan only.
  7455. LoyaltyPoints *LoyaltyPoints `json:"loyaltyPoints,omitempty"`
  7456. // Material: The material of which the item is made.
  7457. Material string `json:"material,omitempty"`
  7458. // MaxEnergyEfficiencyClass: The energy efficiency class as defined in
  7459. // EU directive 2010/30/EU.
  7460. MaxEnergyEfficiencyClass string `json:"maxEnergyEfficiencyClass,omitempty"`
  7461. // MaxHandlingTime: Maximal product handling time (in business days).
  7462. MaxHandlingTime int64 `json:"maxHandlingTime,omitempty,string"`
  7463. // MinEnergyEfficiencyClass: The energy efficiency class as defined in
  7464. // EU directive 2010/30/EU.
  7465. MinEnergyEfficiencyClass string `json:"minEnergyEfficiencyClass,omitempty"`
  7466. // MinHandlingTime: Minimal product handling time (in business days).
  7467. MinHandlingTime int64 `json:"minHandlingTime,omitempty,string"`
  7468. // MobileLink: Link to a mobile-optimized version of the landing page.
  7469. MobileLink string `json:"mobileLink,omitempty"`
  7470. // Mpn: Manufacturer Part Number (MPN) of the item.
  7471. Mpn string `json:"mpn,omitempty"`
  7472. // Multipack: The number of identical products in a merchant-defined
  7473. // multipack.
  7474. Multipack int64 `json:"multipack,omitempty,string"`
  7475. // OfferId: A unique identifier for the item. Leading and trailing
  7476. // whitespaces are stripped and multiple whitespaces are replaced by a
  7477. // single whitespace upon submission. Only valid unicode characters are
  7478. // accepted. See the products feed specification for details.
  7479. // Note: Content API methods that operate on products take the REST ID
  7480. // of the product, not this identifier.
  7481. OfferId string `json:"offerId,omitempty"`
  7482. // OnlineOnly: Deprecated. Whether an item is available for purchase
  7483. // only online.
  7484. OnlineOnly bool `json:"onlineOnly,omitempty"`
  7485. // Pattern: The item's pattern (e.g. polka dots).
  7486. Pattern string `json:"pattern,omitempty"`
  7487. // Price: Price of the item.
  7488. Price *Price `json:"price,omitempty"`
  7489. // ProductType: Your category of the item (formatted as in products feed
  7490. // specification).
  7491. ProductType string `json:"productType,omitempty"`
  7492. // PromotionIds: The unique ID of a promotion.
  7493. PromotionIds []string `json:"promotionIds,omitempty"`
  7494. // SalePrice: Advertised sale price of the item.
  7495. SalePrice *Price `json:"salePrice,omitempty"`
  7496. // SalePriceEffectiveDate: Date range during which the item is on sale
  7497. // (see products feed specification).
  7498. SalePriceEffectiveDate string `json:"salePriceEffectiveDate,omitempty"`
  7499. // SellOnGoogleQuantity: The quantity of the product that is available
  7500. // for selling on Google. Supported only for online products.
  7501. SellOnGoogleQuantity int64 `json:"sellOnGoogleQuantity,omitempty,string"`
  7502. // Shipping: Shipping rules.
  7503. Shipping []*ProductShipping `json:"shipping,omitempty"`
  7504. // ShippingHeight: Height of the item for shipping.
  7505. ShippingHeight *ProductShippingDimension `json:"shippingHeight,omitempty"`
  7506. // ShippingLabel: The shipping label of the product, used to group
  7507. // product in account-level shipping rules.
  7508. ShippingLabel string `json:"shippingLabel,omitempty"`
  7509. // ShippingLength: Length of the item for shipping.
  7510. ShippingLength *ProductShippingDimension `json:"shippingLength,omitempty"`
  7511. // ShippingWeight: Weight of the item for shipping.
  7512. ShippingWeight *ProductShippingWeight `json:"shippingWeight,omitempty"`
  7513. // ShippingWidth: Width of the item for shipping.
  7514. ShippingWidth *ProductShippingDimension `json:"shippingWidth,omitempty"`
  7515. // SizeSystem: System in which the size is specified. Recommended for
  7516. // apparel items.
  7517. SizeSystem string `json:"sizeSystem,omitempty"`
  7518. // SizeType: The cut of the item. Recommended for apparel items.
  7519. SizeType string `json:"sizeType,omitempty"`
  7520. // Sizes: Size of the item.
  7521. Sizes []string `json:"sizes,omitempty"`
  7522. // Source: The source of the offer, i.e., how the offer was created.
  7523. Source string `json:"source,omitempty"`
  7524. // TargetCountry: The CLDR territory code for the item.
  7525. TargetCountry string `json:"targetCountry,omitempty"`
  7526. // Taxes: Tax information.
  7527. Taxes []*ProductTax `json:"taxes,omitempty"`
  7528. // Title: Title of the item.
  7529. Title string `json:"title,omitempty"`
  7530. // UnitPricingBaseMeasure: The preference of the denominator of the unit
  7531. // price.
  7532. UnitPricingBaseMeasure *ProductUnitPricingBaseMeasure `json:"unitPricingBaseMeasure,omitempty"`
  7533. // UnitPricingMeasure: The measure and dimension of an item.
  7534. UnitPricingMeasure *ProductUnitPricingMeasure `json:"unitPricingMeasure,omitempty"`
  7535. // ValidatedDestinations: Deprecated. The read-only list of intended
  7536. // destinations which passed validation.
  7537. ValidatedDestinations []string `json:"validatedDestinations,omitempty"`
  7538. // Warnings: Read-only warnings.
  7539. Warnings []*Error `json:"warnings,omitempty"`
  7540. // ServerResponse contains the HTTP response code and headers from the
  7541. // server.
  7542. googleapi.ServerResponse `json:"-"`
  7543. // ForceSendFields is a list of field names (e.g.
  7544. // "AdditionalImageLinks") to unconditionally include in API requests.
  7545. // By default, fields with empty values are omitted from API requests.
  7546. // However, any non-pointer, non-interface field appearing in
  7547. // ForceSendFields will be sent to the server regardless of whether the
  7548. // field is empty or not. This may be used to include empty fields in
  7549. // Patch requests.
  7550. ForceSendFields []string `json:"-"`
  7551. // NullFields is a list of field names (e.g. "AdditionalImageLinks") to
  7552. // include in API requests with the JSON null value. By default, fields
  7553. // with empty values are omitted from API requests. However, any field
  7554. // with an empty value appearing in NullFields will be sent to the
  7555. // server as null. It is an error if a field in this list has a
  7556. // non-empty value. This may be used to include null fields in Patch
  7557. // requests.
  7558. NullFields []string `json:"-"`
  7559. }
  7560. func (s *Product) MarshalJSON() ([]byte, error) {
  7561. type NoMethod Product
  7562. raw := NoMethod(*s)
  7563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7564. }
  7565. func (s *Product) UnmarshalJSON(data []byte) error {
  7566. type NoMethod Product
  7567. var s1 struct {
  7568. DisplayAdsValue gensupport.JSONFloat64 `json:"displayAdsValue"`
  7569. *NoMethod
  7570. }
  7571. s1.NoMethod = (*NoMethod)(s)
  7572. if err := json.Unmarshal(data, &s1); err != nil {
  7573. return err
  7574. }
  7575. s.DisplayAdsValue = float64(s1.DisplayAdsValue)
  7576. return nil
  7577. }
  7578. type ProductAmount struct {
  7579. // PriceAmount: The pre-tax or post-tax price depending on the location
  7580. // of the order.
  7581. PriceAmount *Price `json:"priceAmount,omitempty"`
  7582. // RemittedTaxAmount: Remitted tax value.
  7583. RemittedTaxAmount *Price `json:"remittedTaxAmount,omitempty"`
  7584. // TaxAmount: Tax value.
  7585. TaxAmount *Price `json:"taxAmount,omitempty"`
  7586. // ForceSendFields is a list of field names (e.g. "PriceAmount") to
  7587. // unconditionally include in API requests. By default, fields with
  7588. // empty values are omitted from API requests. However, any non-pointer,
  7589. // non-interface field appearing in ForceSendFields will be sent to the
  7590. // server regardless of whether the field is empty or not. This may be
  7591. // used to include empty fields in Patch requests.
  7592. ForceSendFields []string `json:"-"`
  7593. // NullFields is a list of field names (e.g. "PriceAmount") to include
  7594. // in API requests with the JSON null value. By default, fields with
  7595. // empty values are omitted from API requests. However, any field with
  7596. // an empty value appearing in NullFields will be sent to the server as
  7597. // null. It is an error if a field in this list has a non-empty value.
  7598. // This may be used to include null fields in Patch requests.
  7599. NullFields []string `json:"-"`
  7600. }
  7601. func (s *ProductAmount) MarshalJSON() ([]byte, error) {
  7602. type NoMethod ProductAmount
  7603. raw := NoMethod(*s)
  7604. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7605. }
  7606. type ProductAspect struct {
  7607. // AspectName: The name of the aspect.
  7608. AspectName string `json:"aspectName,omitempty"`
  7609. // DestinationName: The name of the destination. Leave out to apply to
  7610. // all destinations.
  7611. DestinationName string `json:"destinationName,omitempty"`
  7612. // Intention: Whether the aspect is required, excluded or should be
  7613. // validated.
  7614. Intention string `json:"intention,omitempty"`
  7615. // ForceSendFields is a list of field names (e.g. "AspectName") to
  7616. // unconditionally include in API requests. By default, fields with
  7617. // empty values are omitted from API requests. However, any non-pointer,
  7618. // non-interface field appearing in ForceSendFields will be sent to the
  7619. // server regardless of whether the field is empty or not. This may be
  7620. // used to include empty fields in Patch requests.
  7621. ForceSendFields []string `json:"-"`
  7622. // NullFields is a list of field names (e.g. "AspectName") to include in
  7623. // API requests with the JSON null value. By default, fields with empty
  7624. // values are omitted from API requests. However, any field with an
  7625. // empty value appearing in NullFields will be sent to the server as
  7626. // null. It is an error if a field in this list has a non-empty value.
  7627. // This may be used to include null fields in Patch requests.
  7628. NullFields []string `json:"-"`
  7629. }
  7630. func (s *ProductAspect) MarshalJSON() ([]byte, error) {
  7631. type NoMethod ProductAspect
  7632. raw := NoMethod(*s)
  7633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7634. }
  7635. type ProductDestination struct {
  7636. // DestinationName: The name of the destination.
  7637. DestinationName string `json:"destinationName,omitempty"`
  7638. // Intention: Whether the destination is required, excluded or should be
  7639. // validated.
  7640. Intention string `json:"intention,omitempty"`
  7641. // ForceSendFields is a list of field names (e.g. "DestinationName") to
  7642. // unconditionally include in API requests. By default, fields with
  7643. // empty values are omitted from API requests. However, any non-pointer,
  7644. // non-interface field appearing in ForceSendFields will be sent to the
  7645. // server regardless of whether the field is empty or not. This may be
  7646. // used to include empty fields in Patch requests.
  7647. ForceSendFields []string `json:"-"`
  7648. // NullFields is a list of field names (e.g. "DestinationName") to
  7649. // include in API requests with the JSON null value. By default, fields
  7650. // with empty values are omitted from API requests. However, any field
  7651. // with an empty value appearing in NullFields will be sent to the
  7652. // server as null. It is an error if a field in this list has a
  7653. // non-empty value. This may be used to include null fields in Patch
  7654. // requests.
  7655. NullFields []string `json:"-"`
  7656. }
  7657. func (s *ProductDestination) MarshalJSON() ([]byte, error) {
  7658. type NoMethod ProductDestination
  7659. raw := NoMethod(*s)
  7660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7661. }
  7662. type ProductShipping struct {
  7663. // Country: The CLDR territory code of the country to which an item will
  7664. // ship.
  7665. Country string `json:"country,omitempty"`
  7666. // LocationGroupName: The location where the shipping is applicable,
  7667. // represented by a location group name.
  7668. LocationGroupName string `json:"locationGroupName,omitempty"`
  7669. // LocationId: The numeric ID of a location that the shipping rate
  7670. // applies to as defined in the AdWords API.
  7671. LocationId int64 `json:"locationId,omitempty,string"`
  7672. // PostalCode: The postal code range that the shipping rate applies to,
  7673. // represented by a postal code, a postal code prefix followed by a *
  7674. // wildcard, a range between two postal codes or two postal code
  7675. // prefixes of equal length.
  7676. PostalCode string `json:"postalCode,omitempty"`
  7677. // Price: Fixed shipping price, represented as a number.
  7678. Price *Price `json:"price,omitempty"`
  7679. // Region: The geographic region to which a shipping rate applies.
  7680. Region string `json:"region,omitempty"`
  7681. // Service: A free-form description of the service class or delivery
  7682. // speed.
  7683. Service string `json:"service,omitempty"`
  7684. // ForceSendFields is a list of field names (e.g. "Country") to
  7685. // unconditionally include in API requests. By default, fields with
  7686. // empty values are omitted from API requests. However, any non-pointer,
  7687. // non-interface field appearing in ForceSendFields will be sent to the
  7688. // server regardless of whether the field is empty or not. This may be
  7689. // used to include empty fields in Patch requests.
  7690. ForceSendFields []string `json:"-"`
  7691. // NullFields is a list of field names (e.g. "Country") to include in
  7692. // API requests with the JSON null value. By default, fields with empty
  7693. // values are omitted from API requests. However, any field with an
  7694. // empty value appearing in NullFields will be sent to the server as
  7695. // null. It is an error if a field in this list has a non-empty value.
  7696. // This may be used to include null fields in Patch requests.
  7697. NullFields []string `json:"-"`
  7698. }
  7699. func (s *ProductShipping) MarshalJSON() ([]byte, error) {
  7700. type NoMethod ProductShipping
  7701. raw := NoMethod(*s)
  7702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7703. }
  7704. type ProductShippingDimension struct {
  7705. // Unit: The unit of value.
  7706. Unit string `json:"unit,omitempty"`
  7707. // Value: The dimension of the product used to calculate the shipping
  7708. // cost of the item.
  7709. Value float64 `json:"value,omitempty"`
  7710. // ForceSendFields is a list of field names (e.g. "Unit") to
  7711. // unconditionally include in API requests. By default, fields with
  7712. // empty values are omitted from API requests. However, any non-pointer,
  7713. // non-interface field appearing in ForceSendFields will be sent to the
  7714. // server regardless of whether the field is empty or not. This may be
  7715. // used to include empty fields in Patch requests.
  7716. ForceSendFields []string `json:"-"`
  7717. // NullFields is a list of field names (e.g. "Unit") to include in API
  7718. // requests with the JSON null value. By default, fields with empty
  7719. // values are omitted from API requests. However, any field with an
  7720. // empty value appearing in NullFields will be sent to the server as
  7721. // null. It is an error if a field in this list has a non-empty value.
  7722. // This may be used to include null fields in Patch requests.
  7723. NullFields []string `json:"-"`
  7724. }
  7725. func (s *ProductShippingDimension) MarshalJSON() ([]byte, error) {
  7726. type NoMethod ProductShippingDimension
  7727. raw := NoMethod(*s)
  7728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7729. }
  7730. func (s *ProductShippingDimension) UnmarshalJSON(data []byte) error {
  7731. type NoMethod ProductShippingDimension
  7732. var s1 struct {
  7733. Value gensupport.JSONFloat64 `json:"value"`
  7734. *NoMethod
  7735. }
  7736. s1.NoMethod = (*NoMethod)(s)
  7737. if err := json.Unmarshal(data, &s1); err != nil {
  7738. return err
  7739. }
  7740. s.Value = float64(s1.Value)
  7741. return nil
  7742. }
  7743. type ProductShippingWeight struct {
  7744. // Unit: The unit of value.
  7745. Unit string `json:"unit,omitempty"`
  7746. // Value: The weight of the product used to calculate the shipping cost
  7747. // of the item.
  7748. Value float64 `json:"value,omitempty"`
  7749. // ForceSendFields is a list of field names (e.g. "Unit") to
  7750. // unconditionally include in API requests. By default, fields with
  7751. // empty values are omitted from API requests. However, any non-pointer,
  7752. // non-interface field appearing in ForceSendFields will be sent to the
  7753. // server regardless of whether the field is empty or not. This may be
  7754. // used to include empty fields in Patch requests.
  7755. ForceSendFields []string `json:"-"`
  7756. // NullFields is a list of field names (e.g. "Unit") to include in API
  7757. // requests with the JSON null value. By default, fields with empty
  7758. // values are omitted from API requests. However, any field with an
  7759. // empty value appearing in NullFields will be sent to the server as
  7760. // null. It is an error if a field in this list has a non-empty value.
  7761. // This may be used to include null fields in Patch requests.
  7762. NullFields []string `json:"-"`
  7763. }
  7764. func (s *ProductShippingWeight) MarshalJSON() ([]byte, error) {
  7765. type NoMethod ProductShippingWeight
  7766. raw := NoMethod(*s)
  7767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7768. }
  7769. func (s *ProductShippingWeight) UnmarshalJSON(data []byte) error {
  7770. type NoMethod ProductShippingWeight
  7771. var s1 struct {
  7772. Value gensupport.JSONFloat64 `json:"value"`
  7773. *NoMethod
  7774. }
  7775. s1.NoMethod = (*NoMethod)(s)
  7776. if err := json.Unmarshal(data, &s1); err != nil {
  7777. return err
  7778. }
  7779. s.Value = float64(s1.Value)
  7780. return nil
  7781. }
  7782. // ProductStatus: The status of a product, i.e., information about a
  7783. // product computed asynchronously.
  7784. type ProductStatus struct {
  7785. // CreationDate: Date on which the item has been created, in ISO 8601
  7786. // format.
  7787. CreationDate string `json:"creationDate,omitempty"`
  7788. // DataQualityIssues: DEPRECATED - never populated
  7789. DataQualityIssues []*ProductStatusDataQualityIssue `json:"dataQualityIssues,omitempty"`
  7790. // DestinationStatuses: The intended destinations for the product.
  7791. DestinationStatuses []*ProductStatusDestinationStatus `json:"destinationStatuses,omitempty"`
  7792. // GoogleExpirationDate: Date on which the item expires in Google
  7793. // Shopping, in ISO 8601 format.
  7794. GoogleExpirationDate string `json:"googleExpirationDate,omitempty"`
  7795. // ItemLevelIssues: A list of all issues associated with the product.
  7796. ItemLevelIssues []*ProductStatusItemLevelIssue `json:"itemLevelIssues,omitempty"`
  7797. // Kind: Identifies what kind of resource this is. Value: the fixed
  7798. // string "content#productStatus".
  7799. Kind string `json:"kind,omitempty"`
  7800. // LastUpdateDate: Date on which the item has been last updated, in ISO
  7801. // 8601 format.
  7802. LastUpdateDate string `json:"lastUpdateDate,omitempty"`
  7803. // Link: The link to the product.
  7804. Link string `json:"link,omitempty"`
  7805. // Product: Product data after applying all the join inputs.
  7806. Product *Product `json:"product,omitempty"`
  7807. // ProductId: The ID of the product for which status is reported.
  7808. ProductId string `json:"productId,omitempty"`
  7809. // Title: The title of the product.
  7810. Title string `json:"title,omitempty"`
  7811. // ServerResponse contains the HTTP response code and headers from the
  7812. // server.
  7813. googleapi.ServerResponse `json:"-"`
  7814. // ForceSendFields is a list of field names (e.g. "CreationDate") to
  7815. // unconditionally include in API requests. By default, fields with
  7816. // empty values are omitted from API requests. However, any non-pointer,
  7817. // non-interface field appearing in ForceSendFields will be sent to the
  7818. // server regardless of whether the field is empty or not. This may be
  7819. // used to include empty fields in Patch requests.
  7820. ForceSendFields []string `json:"-"`
  7821. // NullFields is a list of field names (e.g. "CreationDate") to include
  7822. // in API requests with the JSON null value. By default, fields with
  7823. // empty values are omitted from API requests. However, any field with
  7824. // an empty value appearing in NullFields will be sent to the server as
  7825. // null. It is an error if a field in this list has a non-empty value.
  7826. // This may be used to include null fields in Patch requests.
  7827. NullFields []string `json:"-"`
  7828. }
  7829. func (s *ProductStatus) MarshalJSON() ([]byte, error) {
  7830. type NoMethod ProductStatus
  7831. raw := NoMethod(*s)
  7832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7833. }
  7834. type ProductStatusDataQualityIssue struct {
  7835. Destination string `json:"destination,omitempty"`
  7836. Detail string `json:"detail,omitempty"`
  7837. FetchStatus string `json:"fetchStatus,omitempty"`
  7838. Id string `json:"id,omitempty"`
  7839. Location string `json:"location,omitempty"`
  7840. Severity string `json:"severity,omitempty"`
  7841. Timestamp string `json:"timestamp,omitempty"`
  7842. ValueOnLandingPage string `json:"valueOnLandingPage,omitempty"`
  7843. ValueProvided string `json:"valueProvided,omitempty"`
  7844. // ForceSendFields is a list of field names (e.g. "Destination") to
  7845. // unconditionally include in API requests. By default, fields with
  7846. // empty values are omitted from API requests. However, any non-pointer,
  7847. // non-interface field appearing in ForceSendFields will be sent to the
  7848. // server regardless of whether the field is empty or not. This may be
  7849. // used to include empty fields in Patch requests.
  7850. ForceSendFields []string `json:"-"`
  7851. // NullFields is a list of field names (e.g. "Destination") to include
  7852. // in API requests with the JSON null value. By default, fields with
  7853. // empty values are omitted from API requests. However, any field with
  7854. // an empty value appearing in NullFields will be sent to the server as
  7855. // null. It is an error if a field in this list has a non-empty value.
  7856. // This may be used to include null fields in Patch requests.
  7857. NullFields []string `json:"-"`
  7858. }
  7859. func (s *ProductStatusDataQualityIssue) MarshalJSON() ([]byte, error) {
  7860. type NoMethod ProductStatusDataQualityIssue
  7861. raw := NoMethod(*s)
  7862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7863. }
  7864. type ProductStatusDestinationStatus struct {
  7865. // ApprovalPending: Whether the approval status might change due to
  7866. // further processing.
  7867. ApprovalPending bool `json:"approvalPending,omitempty"`
  7868. // ApprovalStatus: The destination's approval status.
  7869. ApprovalStatus string `json:"approvalStatus,omitempty"`
  7870. // Destination: The name of the destination
  7871. Destination string `json:"destination,omitempty"`
  7872. // Intention: Provided for backward compatibility only. Always set to
  7873. // "required".
  7874. Intention string `json:"intention,omitempty"`
  7875. // ForceSendFields is a list of field names (e.g. "ApprovalPending") to
  7876. // unconditionally include in API requests. By default, fields with
  7877. // empty values are omitted from API requests. However, any non-pointer,
  7878. // non-interface field appearing in ForceSendFields will be sent to the
  7879. // server regardless of whether the field is empty or not. This may be
  7880. // used to include empty fields in Patch requests.
  7881. ForceSendFields []string `json:"-"`
  7882. // NullFields is a list of field names (e.g. "ApprovalPending") to
  7883. // include in API requests with the JSON null value. By default, fields
  7884. // with empty values are omitted from API requests. However, any field
  7885. // with an empty value appearing in NullFields will be sent to the
  7886. // server as null. It is an error if a field in this list has a
  7887. // non-empty value. This may be used to include null fields in Patch
  7888. // requests.
  7889. NullFields []string `json:"-"`
  7890. }
  7891. func (s *ProductStatusDestinationStatus) MarshalJSON() ([]byte, error) {
  7892. type NoMethod ProductStatusDestinationStatus
  7893. raw := NoMethod(*s)
  7894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7895. }
  7896. type ProductStatusItemLevelIssue struct {
  7897. // AttributeName: The attribute's name, if the issue is caused by a
  7898. // single attribute.
  7899. AttributeName string `json:"attributeName,omitempty"`
  7900. // Code: The error code of the issue.
  7901. Code string `json:"code,omitempty"`
  7902. // Description: A short issue description in English.
  7903. Description string `json:"description,omitempty"`
  7904. // Destination: The destination the issue applies to.
  7905. Destination string `json:"destination,omitempty"`
  7906. // Detail: A detailed issue description in English.
  7907. Detail string `json:"detail,omitempty"`
  7908. // Documentation: The URL of a web page to help with resolving this
  7909. // issue.
  7910. Documentation string `json:"documentation,omitempty"`
  7911. // Resolution: Whether the issue can be resolved by the merchant.
  7912. Resolution string `json:"resolution,omitempty"`
  7913. // Servability: How this issue affects serving of the offer.
  7914. Servability string `json:"servability,omitempty"`
  7915. // ForceSendFields is a list of field names (e.g. "AttributeName") to
  7916. // unconditionally include in API requests. By default, fields with
  7917. // empty values are omitted from API requests. However, any non-pointer,
  7918. // non-interface field appearing in ForceSendFields will be sent to the
  7919. // server regardless of whether the field is empty or not. This may be
  7920. // used to include empty fields in Patch requests.
  7921. ForceSendFields []string `json:"-"`
  7922. // NullFields is a list of field names (e.g. "AttributeName") to include
  7923. // in API requests with the JSON null value. By default, fields with
  7924. // empty values are omitted from API requests. However, any field with
  7925. // an empty value appearing in NullFields will be sent to the server as
  7926. // null. It is an error if a field in this list has a non-empty value.
  7927. // This may be used to include null fields in Patch requests.
  7928. NullFields []string `json:"-"`
  7929. }
  7930. func (s *ProductStatusItemLevelIssue) MarshalJSON() ([]byte, error) {
  7931. type NoMethod ProductStatusItemLevelIssue
  7932. raw := NoMethod(*s)
  7933. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7934. }
  7935. type ProductTax struct {
  7936. // Country: The country within which the item is taxed, specified as a
  7937. // CLDR territory code.
  7938. Country string `json:"country,omitempty"`
  7939. // LocationId: The numeric ID of a location that the tax rate applies to
  7940. // as defined in the AdWords API.
  7941. LocationId int64 `json:"locationId,omitempty,string"`
  7942. // PostalCode: The postal code range that the tax rate applies to,
  7943. // represented by a ZIP code, a ZIP code prefix using * wildcard, a
  7944. // range between two ZIP codes or two ZIP code prefixes of equal length.
  7945. // Examples: 94114, 94*, 94002-95460, 94*-95*.
  7946. PostalCode string `json:"postalCode,omitempty"`
  7947. // Rate: The percentage of tax rate that applies to the item price.
  7948. Rate float64 `json:"rate,omitempty"`
  7949. // Region: The geographic region to which the tax rate applies.
  7950. Region string `json:"region,omitempty"`
  7951. // TaxShip: Set to true if tax is charged on shipping.
  7952. TaxShip bool `json:"taxShip,omitempty"`
  7953. // ForceSendFields is a list of field names (e.g. "Country") to
  7954. // unconditionally include in API requests. By default, fields with
  7955. // empty values are omitted from API requests. However, any non-pointer,
  7956. // non-interface field appearing in ForceSendFields will be sent to the
  7957. // server regardless of whether the field is empty or not. This may be
  7958. // used to include empty fields in Patch requests.
  7959. ForceSendFields []string `json:"-"`
  7960. // NullFields is a list of field names (e.g. "Country") to include in
  7961. // API requests with the JSON null value. By default, fields with empty
  7962. // values are omitted from API requests. However, any field with an
  7963. // empty value appearing in NullFields will be sent to the server as
  7964. // null. It is an error if a field in this list has a non-empty value.
  7965. // This may be used to include null fields in Patch requests.
  7966. NullFields []string `json:"-"`
  7967. }
  7968. func (s *ProductTax) MarshalJSON() ([]byte, error) {
  7969. type NoMethod ProductTax
  7970. raw := NoMethod(*s)
  7971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7972. }
  7973. func (s *ProductTax) UnmarshalJSON(data []byte) error {
  7974. type NoMethod ProductTax
  7975. var s1 struct {
  7976. Rate gensupport.JSONFloat64 `json:"rate"`
  7977. *NoMethod
  7978. }
  7979. s1.NoMethod = (*NoMethod)(s)
  7980. if err := json.Unmarshal(data, &s1); err != nil {
  7981. return err
  7982. }
  7983. s.Rate = float64(s1.Rate)
  7984. return nil
  7985. }
  7986. type ProductUnitPricingBaseMeasure struct {
  7987. // Unit: The unit of the denominator.
  7988. Unit string `json:"unit,omitempty"`
  7989. // Value: The denominator of the unit price.
  7990. Value int64 `json:"value,omitempty,string"`
  7991. // ForceSendFields is a list of field names (e.g. "Unit") to
  7992. // unconditionally include in API requests. By default, fields with
  7993. // empty values are omitted from API requests. However, any non-pointer,
  7994. // non-interface field appearing in ForceSendFields will be sent to the
  7995. // server regardless of whether the field is empty or not. This may be
  7996. // used to include empty fields in Patch requests.
  7997. ForceSendFields []string `json:"-"`
  7998. // NullFields is a list of field names (e.g. "Unit") to include in API
  7999. // requests with the JSON null value. By default, fields with empty
  8000. // values are omitted from API requests. However, any field with an
  8001. // empty value appearing in NullFields will be sent to the server as
  8002. // null. It is an error if a field in this list has a non-empty value.
  8003. // This may be used to include null fields in Patch requests.
  8004. NullFields []string `json:"-"`
  8005. }
  8006. func (s *ProductUnitPricingBaseMeasure) MarshalJSON() ([]byte, error) {
  8007. type NoMethod ProductUnitPricingBaseMeasure
  8008. raw := NoMethod(*s)
  8009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8010. }
  8011. type ProductUnitPricingMeasure struct {
  8012. // Unit: The unit of the measure.
  8013. Unit string `json:"unit,omitempty"`
  8014. // Value: The measure of an item.
  8015. Value float64 `json:"value,omitempty"`
  8016. // ForceSendFields is a list of field names (e.g. "Unit") to
  8017. // unconditionally include in API requests. By default, fields with
  8018. // empty values are omitted from API requests. However, any non-pointer,
  8019. // non-interface field appearing in ForceSendFields will be sent to the
  8020. // server regardless of whether the field is empty or not. This may be
  8021. // used to include empty fields in Patch requests.
  8022. ForceSendFields []string `json:"-"`
  8023. // NullFields is a list of field names (e.g. "Unit") to include in API
  8024. // requests with the JSON null value. By default, fields with empty
  8025. // values are omitted from API requests. However, any field with an
  8026. // empty value appearing in NullFields will be sent to the server as
  8027. // null. It is an error if a field in this list has a non-empty value.
  8028. // This may be used to include null fields in Patch requests.
  8029. NullFields []string `json:"-"`
  8030. }
  8031. func (s *ProductUnitPricingMeasure) MarshalJSON() ([]byte, error) {
  8032. type NoMethod ProductUnitPricingMeasure
  8033. raw := NoMethod(*s)
  8034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8035. }
  8036. func (s *ProductUnitPricingMeasure) UnmarshalJSON(data []byte) error {
  8037. type NoMethod ProductUnitPricingMeasure
  8038. var s1 struct {
  8039. Value gensupport.JSONFloat64 `json:"value"`
  8040. *NoMethod
  8041. }
  8042. s1.NoMethod = (*NoMethod)(s)
  8043. if err := json.Unmarshal(data, &s1); err != nil {
  8044. return err
  8045. }
  8046. s.Value = float64(s1.Value)
  8047. return nil
  8048. }
  8049. type ProductsCustomBatchRequest struct {
  8050. // Entries: The request entries to be processed in the batch.
  8051. Entries []*ProductsCustomBatchRequestEntry `json:"entries,omitempty"`
  8052. // ForceSendFields is a list of field names (e.g. "Entries") to
  8053. // unconditionally include in API requests. By default, fields with
  8054. // empty values are omitted from API requests. However, any non-pointer,
  8055. // non-interface field appearing in ForceSendFields will be sent to the
  8056. // server regardless of whether the field is empty or not. This may be
  8057. // used to include empty fields in Patch requests.
  8058. ForceSendFields []string `json:"-"`
  8059. // NullFields is a list of field names (e.g. "Entries") to include in
  8060. // API requests with the JSON null value. By default, fields with empty
  8061. // values are omitted from API requests. However, any field with an
  8062. // empty value appearing in NullFields will be sent to the server as
  8063. // null. It is an error if a field in this list has a non-empty value.
  8064. // This may be used to include null fields in Patch requests.
  8065. NullFields []string `json:"-"`
  8066. }
  8067. func (s *ProductsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  8068. type NoMethod ProductsCustomBatchRequest
  8069. raw := NoMethod(*s)
  8070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8071. }
  8072. // ProductsCustomBatchRequestEntry: A batch entry encoding a single
  8073. // non-batch products request.
  8074. type ProductsCustomBatchRequestEntry struct {
  8075. // BatchId: An entry ID, unique within the batch request.
  8076. BatchId int64 `json:"batchId,omitempty"`
  8077. // MerchantId: The ID of the managing account.
  8078. MerchantId uint64 `json:"merchantId,omitempty,string"`
  8079. Method string `json:"method,omitempty"`
  8080. // Product: The product to insert. Only required if the method is
  8081. // insert.
  8082. Product *Product `json:"product,omitempty"`
  8083. // ProductId: The ID of the product to get or delete. Only defined if
  8084. // the method is get or delete.
  8085. ProductId string `json:"productId,omitempty"`
  8086. // ForceSendFields is a list of field names (e.g. "BatchId") to
  8087. // unconditionally include in API requests. By default, fields with
  8088. // empty values are omitted from API requests. However, any non-pointer,
  8089. // non-interface field appearing in ForceSendFields will be sent to the
  8090. // server regardless of whether the field is empty or not. This may be
  8091. // used to include empty fields in Patch requests.
  8092. ForceSendFields []string `json:"-"`
  8093. // NullFields is a list of field names (e.g. "BatchId") to include in
  8094. // API requests with the JSON null value. By default, fields with empty
  8095. // values are omitted from API requests. However, any field with an
  8096. // empty value appearing in NullFields will be sent to the server as
  8097. // null. It is an error if a field in this list has a non-empty value.
  8098. // This may be used to include null fields in Patch requests.
  8099. NullFields []string `json:"-"`
  8100. }
  8101. func (s *ProductsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  8102. type NoMethod ProductsCustomBatchRequestEntry
  8103. raw := NoMethod(*s)
  8104. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8105. }
  8106. type ProductsCustomBatchResponse struct {
  8107. // Entries: The result of the execution of the batch requests.
  8108. Entries []*ProductsCustomBatchResponseEntry `json:"entries,omitempty"`
  8109. // Kind: Identifies what kind of resource this is. Value: the fixed
  8110. // string "content#productsCustomBatchResponse".
  8111. Kind string `json:"kind,omitempty"`
  8112. // ServerResponse contains the HTTP response code and headers from the
  8113. // server.
  8114. googleapi.ServerResponse `json:"-"`
  8115. // ForceSendFields is a list of field names (e.g. "Entries") to
  8116. // unconditionally include in API requests. By default, fields with
  8117. // empty values are omitted from API requests. However, any non-pointer,
  8118. // non-interface field appearing in ForceSendFields will be sent to the
  8119. // server regardless of whether the field is empty or not. This may be
  8120. // used to include empty fields in Patch requests.
  8121. ForceSendFields []string `json:"-"`
  8122. // NullFields is a list of field names (e.g. "Entries") to include in
  8123. // API requests with the JSON null value. By default, fields with empty
  8124. // values are omitted from API requests. However, any field with an
  8125. // empty value appearing in NullFields will be sent to the server as
  8126. // null. It is an error if a field in this list has a non-empty value.
  8127. // This may be used to include null fields in Patch requests.
  8128. NullFields []string `json:"-"`
  8129. }
  8130. func (s *ProductsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  8131. type NoMethod ProductsCustomBatchResponse
  8132. raw := NoMethod(*s)
  8133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8134. }
  8135. // ProductsCustomBatchResponseEntry: A batch entry encoding a single
  8136. // non-batch products response.
  8137. type ProductsCustomBatchResponseEntry struct {
  8138. // BatchId: The ID of the request entry this entry responds to.
  8139. BatchId int64 `json:"batchId,omitempty"`
  8140. // Errors: A list of errors defined if and only if the request failed.
  8141. Errors *Errors `json:"errors,omitempty"`
  8142. // Kind: Identifies what kind of resource this is. Value: the fixed
  8143. // string "content#productsCustomBatchResponseEntry".
  8144. Kind string `json:"kind,omitempty"`
  8145. // Product: The inserted product. Only defined if the method is insert
  8146. // and if the request was successful.
  8147. Product *Product `json:"product,omitempty"`
  8148. // ForceSendFields is a list of field names (e.g. "BatchId") to
  8149. // unconditionally include in API requests. By default, fields with
  8150. // empty values are omitted from API requests. However, any non-pointer,
  8151. // non-interface field appearing in ForceSendFields will be sent to the
  8152. // server regardless of whether the field is empty or not. This may be
  8153. // used to include empty fields in Patch requests.
  8154. ForceSendFields []string `json:"-"`
  8155. // NullFields is a list of field names (e.g. "BatchId") to include in
  8156. // API requests with the JSON null value. By default, fields with empty
  8157. // values are omitted from API requests. However, any field with an
  8158. // empty value appearing in NullFields will be sent to the server as
  8159. // null. It is an error if a field in this list has a non-empty value.
  8160. // This may be used to include null fields in Patch requests.
  8161. NullFields []string `json:"-"`
  8162. }
  8163. func (s *ProductsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  8164. type NoMethod ProductsCustomBatchResponseEntry
  8165. raw := NoMethod(*s)
  8166. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8167. }
  8168. type ProductsListResponse struct {
  8169. // Kind: Identifies what kind of resource this is. Value: the fixed
  8170. // string "content#productsListResponse".
  8171. Kind string `json:"kind,omitempty"`
  8172. // NextPageToken: The token for the retrieval of the next page of
  8173. // products.
  8174. NextPageToken string `json:"nextPageToken,omitempty"`
  8175. Resources []*Product `json:"resources,omitempty"`
  8176. // ServerResponse contains the HTTP response code and headers from the
  8177. // server.
  8178. googleapi.ServerResponse `json:"-"`
  8179. // ForceSendFields is a list of field names (e.g. "Kind") to
  8180. // unconditionally include in API requests. By default, fields with
  8181. // empty values are omitted from API requests. However, any non-pointer,
  8182. // non-interface field appearing in ForceSendFields will be sent to the
  8183. // server regardless of whether the field is empty or not. This may be
  8184. // used to include empty fields in Patch requests.
  8185. ForceSendFields []string `json:"-"`
  8186. // NullFields is a list of field names (e.g. "Kind") to include in API
  8187. // requests with the JSON null value. By default, fields with empty
  8188. // values are omitted from API requests. However, any field with an
  8189. // empty value appearing in NullFields will be sent to the server as
  8190. // null. It is an error if a field in this list has a non-empty value.
  8191. // This may be used to include null fields in Patch requests.
  8192. NullFields []string `json:"-"`
  8193. }
  8194. func (s *ProductsListResponse) MarshalJSON() ([]byte, error) {
  8195. type NoMethod ProductsListResponse
  8196. raw := NoMethod(*s)
  8197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8198. }
  8199. type ProductstatusesCustomBatchRequest struct {
  8200. // Entries: The request entries to be processed in the batch.
  8201. Entries []*ProductstatusesCustomBatchRequestEntry `json:"entries,omitempty"`
  8202. // ForceSendFields is a list of field names (e.g. "Entries") to
  8203. // unconditionally include in API requests. By default, fields with
  8204. // empty values are omitted from API requests. However, any non-pointer,
  8205. // non-interface field appearing in ForceSendFields will be sent to the
  8206. // server regardless of whether the field is empty or not. This may be
  8207. // used to include empty fields in Patch requests.
  8208. ForceSendFields []string `json:"-"`
  8209. // NullFields is a list of field names (e.g. "Entries") to include in
  8210. // API requests with the JSON null value. By default, fields with empty
  8211. // values are omitted from API requests. However, any field with an
  8212. // empty value appearing in NullFields will be sent to the server as
  8213. // null. It is an error if a field in this list has a non-empty value.
  8214. // This may be used to include null fields in Patch requests.
  8215. NullFields []string `json:"-"`
  8216. }
  8217. func (s *ProductstatusesCustomBatchRequest) MarshalJSON() ([]byte, error) {
  8218. type NoMethod ProductstatusesCustomBatchRequest
  8219. raw := NoMethod(*s)
  8220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8221. }
  8222. // ProductstatusesCustomBatchRequestEntry: A batch entry encoding a
  8223. // single non-batch productstatuses request.
  8224. type ProductstatusesCustomBatchRequestEntry struct {
  8225. // BatchId: An entry ID, unique within the batch request.
  8226. BatchId int64 `json:"batchId,omitempty"`
  8227. // Destinations: If set, only issues for the specified destinations are
  8228. // returned, otherwise only issues for the Shopping destination.
  8229. Destinations []string `json:"destinations,omitempty"`
  8230. IncludeAttributes bool `json:"includeAttributes,omitempty"`
  8231. // MerchantId: The ID of the managing account.
  8232. MerchantId uint64 `json:"merchantId,omitempty,string"`
  8233. Method string `json:"method,omitempty"`
  8234. // ProductId: The ID of the product whose status to get.
  8235. ProductId string `json:"productId,omitempty"`
  8236. // ForceSendFields is a list of field names (e.g. "BatchId") to
  8237. // unconditionally include in API requests. By default, fields with
  8238. // empty values are omitted from API requests. However, any non-pointer,
  8239. // non-interface field appearing in ForceSendFields will be sent to the
  8240. // server regardless of whether the field is empty or not. This may be
  8241. // used to include empty fields in Patch requests.
  8242. ForceSendFields []string `json:"-"`
  8243. // NullFields is a list of field names (e.g. "BatchId") to include in
  8244. // API requests with the JSON null value. By default, fields with empty
  8245. // values are omitted from API requests. However, any field with an
  8246. // empty value appearing in NullFields will be sent to the server as
  8247. // null. It is an error if a field in this list has a non-empty value.
  8248. // This may be used to include null fields in Patch requests.
  8249. NullFields []string `json:"-"`
  8250. }
  8251. func (s *ProductstatusesCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  8252. type NoMethod ProductstatusesCustomBatchRequestEntry
  8253. raw := NoMethod(*s)
  8254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8255. }
  8256. type ProductstatusesCustomBatchResponse struct {
  8257. // Entries: The result of the execution of the batch requests.
  8258. Entries []*ProductstatusesCustomBatchResponseEntry `json:"entries,omitempty"`
  8259. // Kind: Identifies what kind of resource this is. Value: the fixed
  8260. // string "content#productstatusesCustomBatchResponse".
  8261. Kind string `json:"kind,omitempty"`
  8262. // ServerResponse contains the HTTP response code and headers from the
  8263. // server.
  8264. googleapi.ServerResponse `json:"-"`
  8265. // ForceSendFields is a list of field names (e.g. "Entries") to
  8266. // unconditionally include in API requests. By default, fields with
  8267. // empty values are omitted from API requests. However, any non-pointer,
  8268. // non-interface field appearing in ForceSendFields will be sent to the
  8269. // server regardless of whether the field is empty or not. This may be
  8270. // used to include empty fields in Patch requests.
  8271. ForceSendFields []string `json:"-"`
  8272. // NullFields is a list of field names (e.g. "Entries") to include in
  8273. // API requests with the JSON null value. By default, fields with empty
  8274. // values are omitted from API requests. However, any field with an
  8275. // empty value appearing in NullFields will be sent to the server as
  8276. // null. It is an error if a field in this list has a non-empty value.
  8277. // This may be used to include null fields in Patch requests.
  8278. NullFields []string `json:"-"`
  8279. }
  8280. func (s *ProductstatusesCustomBatchResponse) MarshalJSON() ([]byte, error) {
  8281. type NoMethod ProductstatusesCustomBatchResponse
  8282. raw := NoMethod(*s)
  8283. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8284. }
  8285. // ProductstatusesCustomBatchResponseEntry: A batch entry encoding a
  8286. // single non-batch productstatuses response.
  8287. type ProductstatusesCustomBatchResponseEntry struct {
  8288. // BatchId: The ID of the request entry this entry responds to.
  8289. BatchId int64 `json:"batchId,omitempty"`
  8290. // Errors: A list of errors, if the request failed.
  8291. Errors *Errors `json:"errors,omitempty"`
  8292. // Kind: Identifies what kind of resource this is. Value: the fixed
  8293. // string "content#productstatusesCustomBatchResponseEntry".
  8294. Kind string `json:"kind,omitempty"`
  8295. // ProductStatus: The requested product status. Only defined if the
  8296. // request was successful.
  8297. ProductStatus *ProductStatus `json:"productStatus,omitempty"`
  8298. // ForceSendFields is a list of field names (e.g. "BatchId") to
  8299. // unconditionally include in API requests. By default, fields with
  8300. // empty values are omitted from API requests. However, any non-pointer,
  8301. // non-interface field appearing in ForceSendFields will be sent to the
  8302. // server regardless of whether the field is empty or not. This may be
  8303. // used to include empty fields in Patch requests.
  8304. ForceSendFields []string `json:"-"`
  8305. // NullFields is a list of field names (e.g. "BatchId") to include in
  8306. // API requests with the JSON null value. By default, fields with empty
  8307. // values are omitted from API requests. However, any field with an
  8308. // empty value appearing in NullFields will be sent to the server as
  8309. // null. It is an error if a field in this list has a non-empty value.
  8310. // This may be used to include null fields in Patch requests.
  8311. NullFields []string `json:"-"`
  8312. }
  8313. func (s *ProductstatusesCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  8314. type NoMethod ProductstatusesCustomBatchResponseEntry
  8315. raw := NoMethod(*s)
  8316. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8317. }
  8318. type ProductstatusesListResponse struct {
  8319. // Kind: Identifies what kind of resource this is. Value: the fixed
  8320. // string "content#productstatusesListResponse".
  8321. Kind string `json:"kind,omitempty"`
  8322. // NextPageToken: The token for the retrieval of the next page of
  8323. // products statuses.
  8324. NextPageToken string `json:"nextPageToken,omitempty"`
  8325. Resources []*ProductStatus `json:"resources,omitempty"`
  8326. // ServerResponse contains the HTTP response code and headers from the
  8327. // server.
  8328. googleapi.ServerResponse `json:"-"`
  8329. // ForceSendFields is a list of field names (e.g. "Kind") to
  8330. // unconditionally include in API requests. By default, fields with
  8331. // empty values are omitted from API requests. However, any non-pointer,
  8332. // non-interface field appearing in ForceSendFields will be sent to the
  8333. // server regardless of whether the field is empty or not. This may be
  8334. // used to include empty fields in Patch requests.
  8335. ForceSendFields []string `json:"-"`
  8336. // NullFields is a list of field names (e.g. "Kind") to include in API
  8337. // requests with the JSON null value. By default, fields with empty
  8338. // values are omitted from API requests. However, any field with an
  8339. // empty value appearing in NullFields will be sent to the server as
  8340. // null. It is an error if a field in this list has a non-empty value.
  8341. // This may be used to include null fields in Patch requests.
  8342. NullFields []string `json:"-"`
  8343. }
  8344. func (s *ProductstatusesListResponse) MarshalJSON() ([]byte, error) {
  8345. type NoMethod ProductstatusesListResponse
  8346. raw := NoMethod(*s)
  8347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8348. }
  8349. type Promotion struct {
  8350. // PromotionAmount: [required] Amount of the promotion. The values here
  8351. // are the promotion applied to the unit price pretax and to the total
  8352. // of the tax amounts.
  8353. PromotionAmount *Amount `json:"promotionAmount,omitempty"`
  8354. // PromotionId: [required] ID of the promotion.
  8355. PromotionId string `json:"promotionId,omitempty"`
  8356. // ForceSendFields is a list of field names (e.g. "PromotionAmount") to
  8357. // unconditionally include in API requests. By default, fields with
  8358. // empty values are omitted from API requests. However, any non-pointer,
  8359. // non-interface field appearing in ForceSendFields will be sent to the
  8360. // server regardless of whether the field is empty or not. This may be
  8361. // used to include empty fields in Patch requests.
  8362. ForceSendFields []string `json:"-"`
  8363. // NullFields is a list of field names (e.g. "PromotionAmount") to
  8364. // include in API requests with the JSON null value. By default, fields
  8365. // with empty values are omitted from API requests. However, any field
  8366. // with an empty value appearing in NullFields will be sent to the
  8367. // server as null. It is an error if a field in this list has a
  8368. // non-empty value. This may be used to include null fields in Patch
  8369. // requests.
  8370. NullFields []string `json:"-"`
  8371. }
  8372. func (s *Promotion) MarshalJSON() ([]byte, error) {
  8373. type NoMethod Promotion
  8374. raw := NoMethod(*s)
  8375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8376. }
  8377. type RateGroup struct {
  8378. // ApplicableShippingLabels: A list of shipping labels defining the
  8379. // products to which this rate group applies to. This is a disjunction:
  8380. // only one of the labels has to match for the rate group to apply. May
  8381. // only be empty for the last rate group of a service. Required.
  8382. ApplicableShippingLabels []string `json:"applicableShippingLabels,omitempty"`
  8383. // CarrierRates: A list of carrier rates that can be referred to by
  8384. // mainTable or singleValue.
  8385. CarrierRates []*CarrierRate `json:"carrierRates,omitempty"`
  8386. // MainTable: A table defining the rate group, when singleValue is not
  8387. // expressive enough. Can only be set if singleValue is not set.
  8388. MainTable *Table `json:"mainTable,omitempty"`
  8389. // Name: Name of the rate group. Optional. If set has to be unique
  8390. // within shipping service.
  8391. Name string `json:"name,omitempty"`
  8392. // SingleValue: The value of the rate group (e.g. flat rate $10). Can
  8393. // only be set if mainTable and subtables are not set.
  8394. SingleValue *Value `json:"singleValue,omitempty"`
  8395. // Subtables: A list of subtables referred to by mainTable. Can only be
  8396. // set if mainTable is set.
  8397. Subtables []*Table `json:"subtables,omitempty"`
  8398. // ForceSendFields is a list of field names (e.g.
  8399. // "ApplicableShippingLabels") to unconditionally include in API
  8400. // requests. By default, fields with empty values are omitted from API
  8401. // requests. However, any non-pointer, non-interface field appearing in
  8402. // ForceSendFields will be sent to the server regardless of whether the
  8403. // field is empty or not. This may be used to include empty fields in
  8404. // Patch requests.
  8405. ForceSendFields []string `json:"-"`
  8406. // NullFields is a list of field names (e.g. "ApplicableShippingLabels")
  8407. // to include in API requests with the JSON null value. By default,
  8408. // fields with empty values are omitted from API requests. However, any
  8409. // field with an empty value appearing in NullFields will be sent to the
  8410. // server as null. It is an error if a field in this list has a
  8411. // non-empty value. This may be used to include null fields in Patch
  8412. // requests.
  8413. NullFields []string `json:"-"`
  8414. }
  8415. func (s *RateGroup) MarshalJSON() ([]byte, error) {
  8416. type NoMethod RateGroup
  8417. raw := NoMethod(*s)
  8418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8419. }
  8420. type RefundReason struct {
  8421. Description string `json:"description,omitempty"`
  8422. ReasonCode string `json:"reasonCode,omitempty"`
  8423. // ForceSendFields is a list of field names (e.g. "Description") to
  8424. // unconditionally include in API requests. By default, fields with
  8425. // empty values are omitted from API requests. However, any non-pointer,
  8426. // non-interface field appearing in ForceSendFields will be sent to the
  8427. // server regardless of whether the field is empty or not. This may be
  8428. // used to include empty fields in Patch requests.
  8429. ForceSendFields []string `json:"-"`
  8430. // NullFields is a list of field names (e.g. "Description") to include
  8431. // in API requests with the JSON null value. By default, fields with
  8432. // empty values are omitted from API requests. However, any field with
  8433. // an empty value appearing in NullFields will be sent to the server as
  8434. // null. It is an error if a field in this list has a non-empty value.
  8435. // This may be used to include null fields in Patch requests.
  8436. NullFields []string `json:"-"`
  8437. }
  8438. func (s *RefundReason) MarshalJSON() ([]byte, error) {
  8439. type NoMethod RefundReason
  8440. raw := NoMethod(*s)
  8441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8442. }
  8443. type ReturnShipment struct {
  8444. CreationDate string `json:"creationDate,omitempty"`
  8445. DeliveryDate string `json:"deliveryDate,omitempty"`
  8446. ReturnMethodType string `json:"returnMethodType,omitempty"`
  8447. ShipmentId string `json:"shipmentId,omitempty"`
  8448. ShipmentTrackingInfos []*ShipmentTrackingInfo `json:"shipmentTrackingInfos,omitempty"`
  8449. ShippingDate string `json:"shippingDate,omitempty"`
  8450. State string `json:"state,omitempty"`
  8451. // ForceSendFields is a list of field names (e.g. "CreationDate") to
  8452. // unconditionally include in API requests. By default, fields with
  8453. // empty values are omitted from API requests. However, any non-pointer,
  8454. // non-interface field appearing in ForceSendFields will be sent to the
  8455. // server regardless of whether the field is empty or not. This may be
  8456. // used to include empty fields in Patch requests.
  8457. ForceSendFields []string `json:"-"`
  8458. // NullFields is a list of field names (e.g. "CreationDate") to include
  8459. // in API requests with the JSON null value. By default, fields with
  8460. // empty values are omitted from API requests. However, any field with
  8461. // an empty value appearing in NullFields will be sent to the server as
  8462. // null. It is an error if a field in this list has a non-empty value.
  8463. // This may be used to include null fields in Patch requests.
  8464. NullFields []string `json:"-"`
  8465. }
  8466. func (s *ReturnShipment) MarshalJSON() ([]byte, error) {
  8467. type NoMethod ReturnShipment
  8468. raw := NoMethod(*s)
  8469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8470. }
  8471. type Row struct {
  8472. // Cells: The list of cells that constitute the row. Must have the same
  8473. // length as columnHeaders for two-dimensional tables, a length of 1 for
  8474. // one-dimensional tables. Required.
  8475. Cells []*Value `json:"cells,omitempty"`
  8476. // ForceSendFields is a list of field names (e.g. "Cells") to
  8477. // unconditionally include in API requests. By default, fields with
  8478. // empty values are omitted from API requests. However, any non-pointer,
  8479. // non-interface field appearing in ForceSendFields will be sent to the
  8480. // server regardless of whether the field is empty or not. This may be
  8481. // used to include empty fields in Patch requests.
  8482. ForceSendFields []string `json:"-"`
  8483. // NullFields is a list of field names (e.g. "Cells") to include in API
  8484. // requests with the JSON null value. By default, fields with empty
  8485. // values are omitted from API requests. However, any field with an
  8486. // empty value appearing in NullFields will be sent to the server as
  8487. // null. It is an error if a field in this list has a non-empty value.
  8488. // This may be used to include null fields in Patch requests.
  8489. NullFields []string `json:"-"`
  8490. }
  8491. func (s *Row) MarshalJSON() ([]byte, error) {
  8492. type NoMethod Row
  8493. raw := NoMethod(*s)
  8494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8495. }
  8496. type Service struct {
  8497. // Active: A boolean exposing the active status of the shipping service.
  8498. // Required.
  8499. Active bool `json:"active,omitempty"`
  8500. // Currency: The CLDR code of the currency to which this service
  8501. // applies. Must match that of the prices in rate groups.
  8502. Currency string `json:"currency,omitempty"`
  8503. // DeliveryCountry: The CLDR territory code of the country to which the
  8504. // service applies. Required.
  8505. DeliveryCountry string `json:"deliveryCountry,omitempty"`
  8506. // DeliveryTime: Time spent in various aspects from order to the
  8507. // delivery of the product. Required.
  8508. DeliveryTime *DeliveryTime `json:"deliveryTime,omitempty"`
  8509. // Eligibility: Eligibility for this service.
  8510. Eligibility string `json:"eligibility,omitempty"`
  8511. // MinimumOrderValue: Minimum order value for this service. If set,
  8512. // indicates that customers will have to spend at least this amount. All
  8513. // prices within a service must have the same currency.
  8514. MinimumOrderValue *Price `json:"minimumOrderValue,omitempty"`
  8515. // Name: Free-form name of the service. Must be unique within target
  8516. // account. Required.
  8517. Name string `json:"name,omitempty"`
  8518. // RateGroups: Shipping rate group definitions. Only the last one is
  8519. // allowed to have an empty applicableShippingLabels, which means
  8520. // "everything else". The other applicableShippingLabels must not
  8521. // overlap.
  8522. RateGroups []*RateGroup `json:"rateGroups,omitempty"`
  8523. // ForceSendFields is a list of field names (e.g. "Active") to
  8524. // unconditionally include in API requests. By default, fields with
  8525. // empty values are omitted from API requests. However, any non-pointer,
  8526. // non-interface field appearing in ForceSendFields will be sent to the
  8527. // server regardless of whether the field is empty or not. This may be
  8528. // used to include empty fields in Patch requests.
  8529. ForceSendFields []string `json:"-"`
  8530. // NullFields is a list of field names (e.g. "Active") to include in API
  8531. // requests with the JSON null value. By default, fields with empty
  8532. // values are omitted from API requests. However, any field with an
  8533. // empty value appearing in NullFields will be sent to the server as
  8534. // null. It is an error if a field in this list has a non-empty value.
  8535. // This may be used to include null fields in Patch requests.
  8536. NullFields []string `json:"-"`
  8537. }
  8538. func (s *Service) MarshalJSON() ([]byte, error) {
  8539. type NoMethod Service
  8540. raw := NoMethod(*s)
  8541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8542. }
  8543. type ShipmentInvoice struct {
  8544. // InvoiceSummary: [required] Invoice summary.
  8545. InvoiceSummary *InvoiceSummary `json:"invoiceSummary,omitempty"`
  8546. // LineItemInvoices: [required] Invoice details per line item.
  8547. LineItemInvoices []*ShipmentInvoiceLineItemInvoice `json:"lineItemInvoices,omitempty"`
  8548. // ShipmentGroupId: [required] ID of the shipment group.
  8549. ShipmentGroupId string `json:"shipmentGroupId,omitempty"`
  8550. // ForceSendFields is a list of field names (e.g. "InvoiceSummary") to
  8551. // unconditionally include in API requests. By default, fields with
  8552. // empty values are omitted from API requests. However, any non-pointer,
  8553. // non-interface field appearing in ForceSendFields will be sent to the
  8554. // server regardless of whether the field is empty or not. This may be
  8555. // used to include empty fields in Patch requests.
  8556. ForceSendFields []string `json:"-"`
  8557. // NullFields is a list of field names (e.g. "InvoiceSummary") to
  8558. // include in API requests with the JSON null value. By default, fields
  8559. // with empty values are omitted from API requests. However, any field
  8560. // with an empty value appearing in NullFields will be sent to the
  8561. // server as null. It is an error if a field in this list has a
  8562. // non-empty value. This may be used to include null fields in Patch
  8563. // requests.
  8564. NullFields []string `json:"-"`
  8565. }
  8566. func (s *ShipmentInvoice) MarshalJSON() ([]byte, error) {
  8567. type NoMethod ShipmentInvoice
  8568. raw := NoMethod(*s)
  8569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8570. }
  8571. type ShipmentInvoiceLineItemInvoice struct {
  8572. // LineItemId: ID of the line item. Either lineItemId or productId must
  8573. // be set.
  8574. LineItemId string `json:"lineItemId,omitempty"`
  8575. // ProductId: ID of the product. This is the REST ID used in the
  8576. // products service. Either lineItemId or productId must be set.
  8577. ProductId string `json:"productId,omitempty"`
  8578. // ShipmentUnitIds: [required] Unit IDs to define specific units within
  8579. // the line item.
  8580. ShipmentUnitIds []string `json:"shipmentUnitIds,omitempty"`
  8581. // UnitInvoice: [required] Invoice details for a single unit.
  8582. UnitInvoice *UnitInvoice `json:"unitInvoice,omitempty"`
  8583. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  8584. // unconditionally include in API requests. By default, fields with
  8585. // empty values are omitted from API requests. However, any non-pointer,
  8586. // non-interface field appearing in ForceSendFields will be sent to the
  8587. // server regardless of whether the field is empty or not. This may be
  8588. // used to include empty fields in Patch requests.
  8589. ForceSendFields []string `json:"-"`
  8590. // NullFields is a list of field names (e.g. "LineItemId") to include in
  8591. // API requests with the JSON null value. By default, fields with empty
  8592. // values are omitted from API requests. However, any field with an
  8593. // empty value appearing in NullFields will be sent to the server as
  8594. // null. It is an error if a field in this list has a non-empty value.
  8595. // This may be used to include null fields in Patch requests.
  8596. NullFields []string `json:"-"`
  8597. }
  8598. func (s *ShipmentInvoiceLineItemInvoice) MarshalJSON() ([]byte, error) {
  8599. type NoMethod ShipmentInvoiceLineItemInvoice
  8600. raw := NoMethod(*s)
  8601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8602. }
  8603. type ShipmentTrackingInfo struct {
  8604. Carrier string `json:"carrier,omitempty"`
  8605. TrackingNumber string `json:"trackingNumber,omitempty"`
  8606. // ForceSendFields is a list of field names (e.g. "Carrier") to
  8607. // unconditionally include in API requests. By default, fields with
  8608. // empty values are omitted from API requests. However, any non-pointer,
  8609. // non-interface field appearing in ForceSendFields will be sent to the
  8610. // server regardless of whether the field is empty or not. This may be
  8611. // used to include empty fields in Patch requests.
  8612. ForceSendFields []string `json:"-"`
  8613. // NullFields is a list of field names (e.g. "Carrier") to include in
  8614. // API requests with the JSON null value. By default, fields with empty
  8615. // values are omitted from API requests. However, any field with an
  8616. // empty value appearing in NullFields will be sent to the server as
  8617. // null. It is an error if a field in this list has a non-empty value.
  8618. // This may be used to include null fields in Patch requests.
  8619. NullFields []string `json:"-"`
  8620. }
  8621. func (s *ShipmentTrackingInfo) MarshalJSON() ([]byte, error) {
  8622. type NoMethod ShipmentTrackingInfo
  8623. raw := NoMethod(*s)
  8624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8625. }
  8626. // ShippingSettings: The merchant account's shipping settings. All
  8627. // methods except getsupportedcarriers and getsupportedholidays require
  8628. // the admin role.
  8629. type ShippingSettings struct {
  8630. // AccountId: The ID of the account to which these account shipping
  8631. // settings belong. Ignored upon update, always present in get request
  8632. // responses.
  8633. AccountId uint64 `json:"accountId,omitempty,string"`
  8634. // PostalCodeGroups: A list of postal code groups that can be referred
  8635. // to in services. Optional.
  8636. PostalCodeGroups []*PostalCodeGroup `json:"postalCodeGroups,omitempty"`
  8637. // Services: The target account's list of services. Optional.
  8638. Services []*Service `json:"services,omitempty"`
  8639. // ServerResponse contains the HTTP response code and headers from the
  8640. // server.
  8641. googleapi.ServerResponse `json:"-"`
  8642. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8643. // unconditionally include in API requests. By default, fields with
  8644. // empty values are omitted from API requests. However, any non-pointer,
  8645. // non-interface field appearing in ForceSendFields will be sent to the
  8646. // server regardless of whether the field is empty or not. This may be
  8647. // used to include empty fields in Patch requests.
  8648. ForceSendFields []string `json:"-"`
  8649. // NullFields is a list of field names (e.g. "AccountId") to include in
  8650. // API requests with the JSON null value. By default, fields with empty
  8651. // values are omitted from API requests. However, any field with an
  8652. // empty value appearing in NullFields will be sent to the server as
  8653. // null. It is an error if a field in this list has a non-empty value.
  8654. // This may be used to include null fields in Patch requests.
  8655. NullFields []string `json:"-"`
  8656. }
  8657. func (s *ShippingSettings) MarshalJSON() ([]byte, error) {
  8658. type NoMethod ShippingSettings
  8659. raw := NoMethod(*s)
  8660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8661. }
  8662. type ShippingsettingsCustomBatchRequest struct {
  8663. // Entries: The request entries to be processed in the batch.
  8664. Entries []*ShippingsettingsCustomBatchRequestEntry `json:"entries,omitempty"`
  8665. // ForceSendFields is a list of field names (e.g. "Entries") to
  8666. // unconditionally include in API requests. By default, fields with
  8667. // empty values are omitted from API requests. However, any non-pointer,
  8668. // non-interface field appearing in ForceSendFields will be sent to the
  8669. // server regardless of whether the field is empty or not. This may be
  8670. // used to include empty fields in Patch requests.
  8671. ForceSendFields []string `json:"-"`
  8672. // NullFields is a list of field names (e.g. "Entries") to include in
  8673. // API requests with the JSON null value. By default, fields with empty
  8674. // values are omitted from API requests. However, any field with an
  8675. // empty value appearing in NullFields will be sent to the server as
  8676. // null. It is an error if a field in this list has a non-empty value.
  8677. // This may be used to include null fields in Patch requests.
  8678. NullFields []string `json:"-"`
  8679. }
  8680. func (s *ShippingsettingsCustomBatchRequest) MarshalJSON() ([]byte, error) {
  8681. type NoMethod ShippingsettingsCustomBatchRequest
  8682. raw := NoMethod(*s)
  8683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8684. }
  8685. // ShippingsettingsCustomBatchRequestEntry: A batch entry encoding a
  8686. // single non-batch shippingsettings request.
  8687. type ShippingsettingsCustomBatchRequestEntry struct {
  8688. // AccountId: The ID of the account for which to get/update account
  8689. // shipping settings.
  8690. AccountId uint64 `json:"accountId,omitempty,string"`
  8691. // BatchId: An entry ID, unique within the batch request.
  8692. BatchId int64 `json:"batchId,omitempty"`
  8693. // MerchantId: The ID of the managing account.
  8694. MerchantId uint64 `json:"merchantId,omitempty,string"`
  8695. Method string `json:"method,omitempty"`
  8696. // ShippingSettings: The account shipping settings to update. Only
  8697. // defined if the method is update.
  8698. ShippingSettings *ShippingSettings `json:"shippingSettings,omitempty"`
  8699. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8700. // unconditionally include in API requests. By default, fields with
  8701. // empty values are omitted from API requests. However, any non-pointer,
  8702. // non-interface field appearing in ForceSendFields will be sent to the
  8703. // server regardless of whether the field is empty or not. This may be
  8704. // used to include empty fields in Patch requests.
  8705. ForceSendFields []string `json:"-"`
  8706. // NullFields is a list of field names (e.g. "AccountId") to include in
  8707. // API requests with the JSON null value. By default, fields with empty
  8708. // values are omitted from API requests. However, any field with an
  8709. // empty value appearing in NullFields will be sent to the server as
  8710. // null. It is an error if a field in this list has a non-empty value.
  8711. // This may be used to include null fields in Patch requests.
  8712. NullFields []string `json:"-"`
  8713. }
  8714. func (s *ShippingsettingsCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  8715. type NoMethod ShippingsettingsCustomBatchRequestEntry
  8716. raw := NoMethod(*s)
  8717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8718. }
  8719. type ShippingsettingsCustomBatchResponse struct {
  8720. // Entries: The result of the execution of the batch requests.
  8721. Entries []*ShippingsettingsCustomBatchResponseEntry `json:"entries,omitempty"`
  8722. // Kind: Identifies what kind of resource this is. Value: the fixed
  8723. // string "content#shippingsettingsCustomBatchResponse".
  8724. Kind string `json:"kind,omitempty"`
  8725. // ServerResponse contains the HTTP response code and headers from the
  8726. // server.
  8727. googleapi.ServerResponse `json:"-"`
  8728. // ForceSendFields is a list of field names (e.g. "Entries") to
  8729. // unconditionally include in API requests. By default, fields with
  8730. // empty values are omitted from API requests. However, any non-pointer,
  8731. // non-interface field appearing in ForceSendFields will be sent to the
  8732. // server regardless of whether the field is empty or not. This may be
  8733. // used to include empty fields in Patch requests.
  8734. ForceSendFields []string `json:"-"`
  8735. // NullFields is a list of field names (e.g. "Entries") to include in
  8736. // API requests with the JSON null value. By default, fields with empty
  8737. // values are omitted from API requests. However, any field with an
  8738. // empty value appearing in NullFields will be sent to the server as
  8739. // null. It is an error if a field in this list has a non-empty value.
  8740. // This may be used to include null fields in Patch requests.
  8741. NullFields []string `json:"-"`
  8742. }
  8743. func (s *ShippingsettingsCustomBatchResponse) MarshalJSON() ([]byte, error) {
  8744. type NoMethod ShippingsettingsCustomBatchResponse
  8745. raw := NoMethod(*s)
  8746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8747. }
  8748. // ShippingsettingsCustomBatchResponseEntry: A batch entry encoding a
  8749. // single non-batch shipping settings response.
  8750. type ShippingsettingsCustomBatchResponseEntry struct {
  8751. // BatchId: The ID of the request entry to which this entry responds.
  8752. BatchId int64 `json:"batchId,omitempty"`
  8753. // Errors: A list of errors defined if, and only if, the request failed.
  8754. Errors *Errors `json:"errors,omitempty"`
  8755. // Kind: Identifies what kind of resource this is. Value: the fixed
  8756. // string "content#shippingsettingsCustomBatchResponseEntry".
  8757. Kind string `json:"kind,omitempty"`
  8758. // ShippingSettings: The retrieved or updated account shipping settings.
  8759. ShippingSettings *ShippingSettings `json:"shippingSettings,omitempty"`
  8760. // ForceSendFields is a list of field names (e.g. "BatchId") to
  8761. // unconditionally include in API requests. By default, fields with
  8762. // empty values are omitted from API requests. However, any non-pointer,
  8763. // non-interface field appearing in ForceSendFields will be sent to the
  8764. // server regardless of whether the field is empty or not. This may be
  8765. // used to include empty fields in Patch requests.
  8766. ForceSendFields []string `json:"-"`
  8767. // NullFields is a list of field names (e.g. "BatchId") to include in
  8768. // API requests with the JSON null value. By default, fields with empty
  8769. // values are omitted from API requests. However, any field with an
  8770. // empty value appearing in NullFields will be sent to the server as
  8771. // null. It is an error if a field in this list has a non-empty value.
  8772. // This may be used to include null fields in Patch requests.
  8773. NullFields []string `json:"-"`
  8774. }
  8775. func (s *ShippingsettingsCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  8776. type NoMethod ShippingsettingsCustomBatchResponseEntry
  8777. raw := NoMethod(*s)
  8778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8779. }
  8780. type ShippingsettingsGetSupportedCarriersResponse struct {
  8781. // Carriers: A list of supported carriers. May be empty.
  8782. Carriers []*CarriersCarrier `json:"carriers,omitempty"`
  8783. // Kind: Identifies what kind of resource this is. Value: the fixed
  8784. // string "content#shippingsettingsGetSupportedCarriersResponse".
  8785. Kind string `json:"kind,omitempty"`
  8786. // ServerResponse contains the HTTP response code and headers from the
  8787. // server.
  8788. googleapi.ServerResponse `json:"-"`
  8789. // ForceSendFields is a list of field names (e.g. "Carriers") to
  8790. // unconditionally include in API requests. By default, fields with
  8791. // empty values are omitted from API requests. However, any non-pointer,
  8792. // non-interface field appearing in ForceSendFields will be sent to the
  8793. // server regardless of whether the field is empty or not. This may be
  8794. // used to include empty fields in Patch requests.
  8795. ForceSendFields []string `json:"-"`
  8796. // NullFields is a list of field names (e.g. "Carriers") to include in
  8797. // API requests with the JSON null value. By default, fields with empty
  8798. // values are omitted from API requests. However, any field with an
  8799. // empty value appearing in NullFields will be sent to the server as
  8800. // null. It is an error if a field in this list has a non-empty value.
  8801. // This may be used to include null fields in Patch requests.
  8802. NullFields []string `json:"-"`
  8803. }
  8804. func (s *ShippingsettingsGetSupportedCarriersResponse) MarshalJSON() ([]byte, error) {
  8805. type NoMethod ShippingsettingsGetSupportedCarriersResponse
  8806. raw := NoMethod(*s)
  8807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8808. }
  8809. type ShippingsettingsGetSupportedHolidaysResponse struct {
  8810. // Holidays: A list of holidays applicable for delivery guarantees. May
  8811. // be empty.
  8812. Holidays []*HolidaysHoliday `json:"holidays,omitempty"`
  8813. // Kind: Identifies what kind of resource this is. Value: the fixed
  8814. // string "content#shippingsettingsGetSupportedHolidaysResponse".
  8815. Kind string `json:"kind,omitempty"`
  8816. // ServerResponse contains the HTTP response code and headers from the
  8817. // server.
  8818. googleapi.ServerResponse `json:"-"`
  8819. // ForceSendFields is a list of field names (e.g. "Holidays") to
  8820. // unconditionally include in API requests. By default, fields with
  8821. // empty values are omitted from API requests. However, any non-pointer,
  8822. // non-interface field appearing in ForceSendFields will be sent to the
  8823. // server regardless of whether the field is empty or not. This may be
  8824. // used to include empty fields in Patch requests.
  8825. ForceSendFields []string `json:"-"`
  8826. // NullFields is a list of field names (e.g. "Holidays") to include in
  8827. // API requests with the JSON null value. By default, fields with empty
  8828. // values are omitted from API requests. However, any field with an
  8829. // empty value appearing in NullFields will be sent to the server as
  8830. // null. It is an error if a field in this list has a non-empty value.
  8831. // This may be used to include null fields in Patch requests.
  8832. NullFields []string `json:"-"`
  8833. }
  8834. func (s *ShippingsettingsGetSupportedHolidaysResponse) MarshalJSON() ([]byte, error) {
  8835. type NoMethod ShippingsettingsGetSupportedHolidaysResponse
  8836. raw := NoMethod(*s)
  8837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8838. }
  8839. type ShippingsettingsListResponse struct {
  8840. // Kind: Identifies what kind of resource this is. Value: the fixed
  8841. // string "content#shippingsettingsListResponse".
  8842. Kind string `json:"kind,omitempty"`
  8843. // NextPageToken: The token for the retrieval of the next page of
  8844. // shipping settings.
  8845. NextPageToken string `json:"nextPageToken,omitempty"`
  8846. Resources []*ShippingSettings `json:"resources,omitempty"`
  8847. // ServerResponse contains the HTTP response code and headers from the
  8848. // server.
  8849. googleapi.ServerResponse `json:"-"`
  8850. // ForceSendFields is a list of field names (e.g. "Kind") to
  8851. // unconditionally include in API requests. By default, fields with
  8852. // empty values are omitted from API requests. However, any non-pointer,
  8853. // non-interface field appearing in ForceSendFields will be sent to the
  8854. // server regardless of whether the field is empty or not. This may be
  8855. // used to include empty fields in Patch requests.
  8856. ForceSendFields []string `json:"-"`
  8857. // NullFields is a list of field names (e.g. "Kind") to include in API
  8858. // requests with the JSON null value. By default, fields with empty
  8859. // values are omitted from API requests. However, any field with an
  8860. // empty value appearing in NullFields will be sent to the server as
  8861. // null. It is an error if a field in this list has a non-empty value.
  8862. // This may be used to include null fields in Patch requests.
  8863. NullFields []string `json:"-"`
  8864. }
  8865. func (s *ShippingsettingsListResponse) MarshalJSON() ([]byte, error) {
  8866. type NoMethod ShippingsettingsListResponse
  8867. raw := NoMethod(*s)
  8868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8869. }
  8870. type Table struct {
  8871. // ColumnHeaders: Headers of the table's columns. Optional: if not set
  8872. // then the table has only one dimension.
  8873. ColumnHeaders *Headers `json:"columnHeaders,omitempty"`
  8874. // Name: Name of the table. Required for subtables, ignored for the main
  8875. // table.
  8876. Name string `json:"name,omitempty"`
  8877. // RowHeaders: Headers of the table's rows. Required.
  8878. RowHeaders *Headers `json:"rowHeaders,omitempty"`
  8879. // Rows: The list of rows that constitute the table. Must have the same
  8880. // length as rowHeaders. Required.
  8881. Rows []*Row `json:"rows,omitempty"`
  8882. // ForceSendFields is a list of field names (e.g. "ColumnHeaders") to
  8883. // unconditionally include in API requests. By default, fields with
  8884. // empty values are omitted from API requests. However, any non-pointer,
  8885. // non-interface field appearing in ForceSendFields will be sent to the
  8886. // server regardless of whether the field is empty or not. This may be
  8887. // used to include empty fields in Patch requests.
  8888. ForceSendFields []string `json:"-"`
  8889. // NullFields is a list of field names (e.g. "ColumnHeaders") to include
  8890. // in API requests with the JSON null value. By default, fields with
  8891. // empty values are omitted from API requests. However, any field with
  8892. // an empty value appearing in NullFields will be sent to the server as
  8893. // null. It is an error if a field in this list has a non-empty value.
  8894. // This may be used to include null fields in Patch requests.
  8895. NullFields []string `json:"-"`
  8896. }
  8897. func (s *Table) MarshalJSON() ([]byte, error) {
  8898. type NoMethod Table
  8899. raw := NoMethod(*s)
  8900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8901. }
  8902. type TestOrder struct {
  8903. // Customer: The details of the customer who placed the order.
  8904. Customer *TestOrderCustomer `json:"customer,omitempty"`
  8905. // EnableOrderinvoices: Whether the orderinvoices service should support
  8906. // this order.
  8907. EnableOrderinvoices bool `json:"enableOrderinvoices,omitempty"`
  8908. // Kind: Identifies what kind of resource this is. Value: the fixed
  8909. // string "content#testOrder".
  8910. Kind string `json:"kind,omitempty"`
  8911. // LineItems: Line items that are ordered. At least one line item must
  8912. // be provided.
  8913. LineItems []*TestOrderLineItem `json:"lineItems,omitempty"`
  8914. // NotificationMode: Determines if test order must be pulled by merchant
  8915. // or pushed to merchant via push integration.
  8916. NotificationMode string `json:"notificationMode,omitempty"`
  8917. // PaymentMethod: The details of the payment method.
  8918. PaymentMethod *TestOrderPaymentMethod `json:"paymentMethod,omitempty"`
  8919. // PredefinedDeliveryAddress: Identifier of one of the predefined
  8920. // delivery addresses for the delivery.
  8921. PredefinedDeliveryAddress string `json:"predefinedDeliveryAddress,omitempty"`
  8922. // Promotions: Deprecated. Ignored if provided.
  8923. Promotions []*OrderLegacyPromotion `json:"promotions,omitempty"`
  8924. // ShippingCost: The price of shipping for all items. Shipping tax is
  8925. // automatically calculated for MFL orders. For non-MFL orders, tax
  8926. // settings from Merchant Center are applied. Note that shipping is not
  8927. // taxed in certain states.
  8928. ShippingCost *Price `json:"shippingCost,omitempty"`
  8929. // ShippingCostTax: Deprecated. Ignored if provided.
  8930. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  8931. // ShippingOption: The requested shipping option.
  8932. ShippingOption string `json:"shippingOption,omitempty"`
  8933. // ForceSendFields is a list of field names (e.g. "Customer") to
  8934. // unconditionally include in API requests. By default, fields with
  8935. // empty values are omitted from API requests. However, any non-pointer,
  8936. // non-interface field appearing in ForceSendFields will be sent to the
  8937. // server regardless of whether the field is empty or not. This may be
  8938. // used to include empty fields in Patch requests.
  8939. ForceSendFields []string `json:"-"`
  8940. // NullFields is a list of field names (e.g. "Customer") to include in
  8941. // API requests with the JSON null value. By default, fields with empty
  8942. // values are omitted from API requests. However, any field with an
  8943. // empty value appearing in NullFields will be sent to the server as
  8944. // null. It is an error if a field in this list has a non-empty value.
  8945. // This may be used to include null fields in Patch requests.
  8946. NullFields []string `json:"-"`
  8947. }
  8948. func (s *TestOrder) MarshalJSON() ([]byte, error) {
  8949. type NoMethod TestOrder
  8950. raw := NoMethod(*s)
  8951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8952. }
  8953. type TestOrderCustomer struct {
  8954. // Email: Email address of the customer.
  8955. Email string `json:"email,omitempty"`
  8956. // ExplicitMarketingPreference: Deprecated. Please use
  8957. // marketingRightsInfo instead.
  8958. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  8959. // FullName: Full name of the customer.
  8960. FullName string `json:"fullName,omitempty"`
  8961. // MarketingRightsInfo: Customer's marketing preferences.
  8962. MarketingRightsInfo *TestOrderCustomerMarketingRightsInfo `json:"marketingRightsInfo,omitempty"`
  8963. // ForceSendFields is a list of field names (e.g. "Email") to
  8964. // unconditionally include in API requests. By default, fields with
  8965. // empty values are omitted from API requests. However, any non-pointer,
  8966. // non-interface field appearing in ForceSendFields will be sent to the
  8967. // server regardless of whether the field is empty or not. This may be
  8968. // used to include empty fields in Patch requests.
  8969. ForceSendFields []string `json:"-"`
  8970. // NullFields is a list of field names (e.g. "Email") to include in API
  8971. // requests with the JSON null value. By default, fields with empty
  8972. // values are omitted from API requests. However, any field with an
  8973. // empty value appearing in NullFields will be sent to the server as
  8974. // null. It is an error if a field in this list has a non-empty value.
  8975. // This may be used to include null fields in Patch requests.
  8976. NullFields []string `json:"-"`
  8977. }
  8978. func (s *TestOrderCustomer) MarshalJSON() ([]byte, error) {
  8979. type NoMethod TestOrderCustomer
  8980. raw := NoMethod(*s)
  8981. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8982. }
  8983. type TestOrderCustomerMarketingRightsInfo struct {
  8984. // ExplicitMarketingPreference: Last know user use selection regards
  8985. // marketing preferences. In certain cases selection might not be known,
  8986. // so this field would be empty.
  8987. ExplicitMarketingPreference string `json:"explicitMarketingPreference,omitempty"`
  8988. // LastUpdatedTimestamp: Timestamp when last time marketing preference
  8989. // was updated. Could be empty, if user wasn't offered a selection yet.
  8990. LastUpdatedTimestamp string `json:"lastUpdatedTimestamp,omitempty"`
  8991. // ForceSendFields is a list of field names (e.g.
  8992. // "ExplicitMarketingPreference") to unconditionally include in API
  8993. // requests. By default, fields with empty values are omitted from API
  8994. // requests. However, any non-pointer, non-interface field appearing in
  8995. // ForceSendFields will be sent to the server regardless of whether the
  8996. // field is empty or not. This may be used to include empty fields in
  8997. // Patch requests.
  8998. ForceSendFields []string `json:"-"`
  8999. // NullFields is a list of field names (e.g.
  9000. // "ExplicitMarketingPreference") to include in API requests with the
  9001. // JSON null value. By default, fields with empty values are omitted
  9002. // from API requests. However, any field with an empty value appearing
  9003. // in NullFields will be sent to the server as null. It is an error if a
  9004. // field in this list has a non-empty value. This may be used to include
  9005. // null fields in Patch requests.
  9006. NullFields []string `json:"-"`
  9007. }
  9008. func (s *TestOrderCustomerMarketingRightsInfo) MarshalJSON() ([]byte, error) {
  9009. type NoMethod TestOrderCustomerMarketingRightsInfo
  9010. raw := NoMethod(*s)
  9011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9012. }
  9013. type TestOrderLineItem struct {
  9014. // Product: Product data from the time of the order placement.
  9015. Product *TestOrderLineItemProduct `json:"product,omitempty"`
  9016. // QuantityOrdered: Number of items ordered.
  9017. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  9018. // ReturnInfo: Details of the return policy for the line item.
  9019. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  9020. // ShippingDetails: Details of the requested shipping for the line item.
  9021. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  9022. // UnitTax: Deprecated. Ignored if provided.
  9023. UnitTax *Price `json:"unitTax,omitempty"`
  9024. // ForceSendFields is a list of field names (e.g. "Product") to
  9025. // unconditionally include in API requests. By default, fields with
  9026. // empty values are omitted from API requests. However, any non-pointer,
  9027. // non-interface field appearing in ForceSendFields will be sent to the
  9028. // server regardless of whether the field is empty or not. This may be
  9029. // used to include empty fields in Patch requests.
  9030. ForceSendFields []string `json:"-"`
  9031. // NullFields is a list of field names (e.g. "Product") to include in
  9032. // API requests with the JSON null value. By default, fields with empty
  9033. // values are omitted from API requests. However, any field with an
  9034. // empty value appearing in NullFields will be sent to the server as
  9035. // null. It is an error if a field in this list has a non-empty value.
  9036. // This may be used to include null fields in Patch requests.
  9037. NullFields []string `json:"-"`
  9038. }
  9039. func (s *TestOrderLineItem) MarshalJSON() ([]byte, error) {
  9040. type NoMethod TestOrderLineItem
  9041. raw := NoMethod(*s)
  9042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9043. }
  9044. type TestOrderLineItemProduct struct {
  9045. // Brand: Brand of the item.
  9046. Brand string `json:"brand,omitempty"`
  9047. // Channel: Deprecated.
  9048. Channel string `json:"channel,omitempty"`
  9049. // Condition: Condition or state of the item.
  9050. Condition string `json:"condition,omitempty"`
  9051. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  9052. ContentLanguage string `json:"contentLanguage,omitempty"`
  9053. // Gtin: Global Trade Item Number (GTIN) of the item. Optional.
  9054. Gtin string `json:"gtin,omitempty"`
  9055. // ImageLink: URL of an image of the item.
  9056. ImageLink string `json:"imageLink,omitempty"`
  9057. // ItemGroupId: Shared identifier for all variants of the same product.
  9058. // Optional.
  9059. ItemGroupId string `json:"itemGroupId,omitempty"`
  9060. // Mpn: Manufacturer Part Number (MPN) of the item. Optional.
  9061. Mpn string `json:"mpn,omitempty"`
  9062. // OfferId: An identifier of the item.
  9063. OfferId string `json:"offerId,omitempty"`
  9064. // Price: The price for the product. Tax is automatically calculated for
  9065. // MFL orders. For non-MFL orders, tax settings from Merchant Center are
  9066. // applied.
  9067. Price *Price `json:"price,omitempty"`
  9068. // TargetCountry: The CLDR territory code of the target country of the
  9069. // product.
  9070. TargetCountry string `json:"targetCountry,omitempty"`
  9071. // Title: The title of the product.
  9072. Title string `json:"title,omitempty"`
  9073. // VariantAttributes: Variant attributes for the item. Optional.
  9074. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  9075. // ForceSendFields is a list of field names (e.g. "Brand") to
  9076. // unconditionally include in API requests. By default, fields with
  9077. // empty values are omitted from API requests. However, any non-pointer,
  9078. // non-interface field appearing in ForceSendFields will be sent to the
  9079. // server regardless of whether the field is empty or not. This may be
  9080. // used to include empty fields in Patch requests.
  9081. ForceSendFields []string `json:"-"`
  9082. // NullFields is a list of field names (e.g. "Brand") to include in API
  9083. // requests with the JSON null value. By default, fields with empty
  9084. // values are omitted from API requests. However, any field with an
  9085. // empty value appearing in NullFields will be sent to the server as
  9086. // null. It is an error if a field in this list has a non-empty value.
  9087. // This may be used to include null fields in Patch requests.
  9088. NullFields []string `json:"-"`
  9089. }
  9090. func (s *TestOrderLineItemProduct) MarshalJSON() ([]byte, error) {
  9091. type NoMethod TestOrderLineItemProduct
  9092. raw := NoMethod(*s)
  9093. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9094. }
  9095. type TestOrderPaymentMethod struct {
  9096. // ExpirationMonth: The card expiration month (January = 1, February = 2
  9097. // etc.).
  9098. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  9099. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  9100. ExpirationYear int64 `json:"expirationYear,omitempty"`
  9101. // LastFourDigits: The last four digits of the card number.
  9102. LastFourDigits string `json:"lastFourDigits,omitempty"`
  9103. // PredefinedBillingAddress: The billing address.
  9104. PredefinedBillingAddress string `json:"predefinedBillingAddress,omitempty"`
  9105. // Type: The type of instrument. Note that real orders might have
  9106. // different values than the four values accepted by createTestOrder.
  9107. Type string `json:"type,omitempty"`
  9108. // ForceSendFields is a list of field names (e.g. "ExpirationMonth") to
  9109. // unconditionally include in API requests. By default, fields with
  9110. // empty values are omitted from API requests. However, any non-pointer,
  9111. // non-interface field appearing in ForceSendFields will be sent to the
  9112. // server regardless of whether the field is empty or not. This may be
  9113. // used to include empty fields in Patch requests.
  9114. ForceSendFields []string `json:"-"`
  9115. // NullFields is a list of field names (e.g. "ExpirationMonth") to
  9116. // include in API requests with the JSON null value. By default, fields
  9117. // with empty values are omitted from API requests. However, any field
  9118. // with an empty value appearing in NullFields will be sent to the
  9119. // server as null. It is an error if a field in this list has a
  9120. // non-empty value. This may be used to include null fields in Patch
  9121. // requests.
  9122. NullFields []string `json:"-"`
  9123. }
  9124. func (s *TestOrderPaymentMethod) MarshalJSON() ([]byte, error) {
  9125. type NoMethod TestOrderPaymentMethod
  9126. raw := NoMethod(*s)
  9127. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9128. }
  9129. type TransitTable struct {
  9130. // PostalCodeGroupNames: A list of postal group names. The last value
  9131. // can be "all other locations". Example: ["zone 1", "zone 2", "all
  9132. // other locations"]. The referred postal code groups must match the
  9133. // delivery country of the service.
  9134. PostalCodeGroupNames []string `json:"postalCodeGroupNames,omitempty"`
  9135. Rows []*TransitTableTransitTimeRow `json:"rows,omitempty"`
  9136. // TransitTimeLabels: A list of transit time labels. The last value can
  9137. // be "all other labels". Example: ["food", "electronics", "all other
  9138. // labels"].
  9139. TransitTimeLabels []string `json:"transitTimeLabels,omitempty"`
  9140. // ForceSendFields is a list of field names (e.g.
  9141. // "PostalCodeGroupNames") to unconditionally include in API requests.
  9142. // By default, fields with empty values are omitted from API requests.
  9143. // However, any non-pointer, non-interface field appearing in
  9144. // ForceSendFields will be sent to the server regardless of whether the
  9145. // field is empty or not. This may be used to include empty fields in
  9146. // Patch requests.
  9147. ForceSendFields []string `json:"-"`
  9148. // NullFields is a list of field names (e.g. "PostalCodeGroupNames") to
  9149. // include in API requests with the JSON null value. By default, fields
  9150. // with empty values are omitted from API requests. However, any field
  9151. // with an empty value appearing in NullFields will be sent to the
  9152. // server as null. It is an error if a field in this list has a
  9153. // non-empty value. This may be used to include null fields in Patch
  9154. // requests.
  9155. NullFields []string `json:"-"`
  9156. }
  9157. func (s *TransitTable) MarshalJSON() ([]byte, error) {
  9158. type NoMethod TransitTable
  9159. raw := NoMethod(*s)
  9160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9161. }
  9162. type TransitTableTransitTimeRow struct {
  9163. Values []*TransitTableTransitTimeRowTransitTimeValue `json:"values,omitempty"`
  9164. // ForceSendFields is a list of field names (e.g. "Values") to
  9165. // unconditionally include in API requests. By default, fields with
  9166. // empty values are omitted from API requests. However, any non-pointer,
  9167. // non-interface field appearing in ForceSendFields will be sent to the
  9168. // server regardless of whether the field is empty or not. This may be
  9169. // used to include empty fields in Patch requests.
  9170. ForceSendFields []string `json:"-"`
  9171. // NullFields is a list of field names (e.g. "Values") to include in API
  9172. // requests with the JSON null value. By default, fields with empty
  9173. // values are omitted from API requests. However, any field with an
  9174. // empty value appearing in NullFields will be sent to the server as
  9175. // null. It is an error if a field in this list has a non-empty value.
  9176. // This may be used to include null fields in Patch requests.
  9177. NullFields []string `json:"-"`
  9178. }
  9179. func (s *TransitTableTransitTimeRow) MarshalJSON() ([]byte, error) {
  9180. type NoMethod TransitTableTransitTimeRow
  9181. raw := NoMethod(*s)
  9182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9183. }
  9184. type TransitTableTransitTimeRowTransitTimeValue struct {
  9185. // MaxTransitTimeInDays: Must be greater than or equal to
  9186. // minTransitTimeInDays.
  9187. MaxTransitTimeInDays int64 `json:"maxTransitTimeInDays,omitempty"`
  9188. // MinTransitTimeInDays: Transit time range (min-max) in business days.
  9189. // 0 means same day delivery, 1 means next day delivery.
  9190. MinTransitTimeInDays int64 `json:"minTransitTimeInDays,omitempty"`
  9191. // ForceSendFields is a list of field names (e.g.
  9192. // "MaxTransitTimeInDays") to unconditionally include in API requests.
  9193. // By default, fields with empty values are omitted from API requests.
  9194. // However, any non-pointer, non-interface field appearing in
  9195. // ForceSendFields will be sent to the server regardless of whether the
  9196. // field is empty or not. This may be used to include empty fields in
  9197. // Patch requests.
  9198. ForceSendFields []string `json:"-"`
  9199. // NullFields is a list of field names (e.g. "MaxTransitTimeInDays") to
  9200. // include in API requests with the JSON null value. By default, fields
  9201. // with empty values are omitted from API requests. However, any field
  9202. // with an empty value appearing in NullFields will be sent to the
  9203. // server as null. It is an error if a field in this list has a
  9204. // non-empty value. This may be used to include null fields in Patch
  9205. // requests.
  9206. NullFields []string `json:"-"`
  9207. }
  9208. func (s *TransitTableTransitTimeRowTransitTimeValue) MarshalJSON() ([]byte, error) {
  9209. type NoMethod TransitTableTransitTimeRowTransitTimeValue
  9210. raw := NoMethod(*s)
  9211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9212. }
  9213. type UnitInvoice struct {
  9214. // AdditionalCharges: Additional charges for a unit, e.g. shipping
  9215. // costs.
  9216. AdditionalCharges []*UnitInvoiceAdditionalCharge `json:"additionalCharges,omitempty"`
  9217. // Promotions: Deprecated.
  9218. Promotions []*Promotion `json:"promotions,omitempty"`
  9219. // UnitPricePretax: [required] Price of the unit, before applying taxes.
  9220. UnitPricePretax *Price `json:"unitPricePretax,omitempty"`
  9221. // UnitPriceTaxes: Tax amounts to apply to the unit price.
  9222. UnitPriceTaxes []*UnitInvoiceTaxLine `json:"unitPriceTaxes,omitempty"`
  9223. // ForceSendFields is a list of field names (e.g. "AdditionalCharges")
  9224. // to unconditionally include in API requests. By default, fields with
  9225. // empty values are omitted from API requests. However, any non-pointer,
  9226. // non-interface field appearing in ForceSendFields will be sent to the
  9227. // server regardless of whether the field is empty or not. This may be
  9228. // used to include empty fields in Patch requests.
  9229. ForceSendFields []string `json:"-"`
  9230. // NullFields is a list of field names (e.g. "AdditionalCharges") to
  9231. // include in API requests with the JSON null value. By default, fields
  9232. // with empty values are omitted from API requests. However, any field
  9233. // with an empty value appearing in NullFields will be sent to the
  9234. // server as null. It is an error if a field in this list has a
  9235. // non-empty value. This may be used to include null fields in Patch
  9236. // requests.
  9237. NullFields []string `json:"-"`
  9238. }
  9239. func (s *UnitInvoice) MarshalJSON() ([]byte, error) {
  9240. type NoMethod UnitInvoice
  9241. raw := NoMethod(*s)
  9242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9243. }
  9244. type UnitInvoiceAdditionalCharge struct {
  9245. // AdditionalChargeAmount: [required] Amount of the additional charge.
  9246. AdditionalChargeAmount *Amount `json:"additionalChargeAmount,omitempty"`
  9247. // AdditionalChargePromotions: Deprecated.
  9248. AdditionalChargePromotions []*Promotion `json:"additionalChargePromotions,omitempty"`
  9249. // Type: [required] Type of the additional charge.
  9250. Type string `json:"type,omitempty"`
  9251. // ForceSendFields is a list of field names (e.g.
  9252. // "AdditionalChargeAmount") to unconditionally include in API requests.
  9253. // By default, fields with empty values are omitted from API requests.
  9254. // However, any non-pointer, non-interface field appearing in
  9255. // ForceSendFields will be sent to the server regardless of whether the
  9256. // field is empty or not. This may be used to include empty fields in
  9257. // Patch requests.
  9258. ForceSendFields []string `json:"-"`
  9259. // NullFields is a list of field names (e.g. "AdditionalChargeAmount")
  9260. // to include in API requests with the JSON null value. By default,
  9261. // fields with empty values are omitted from API requests. However, any
  9262. // field with an empty value appearing in NullFields will be sent to the
  9263. // server as null. It is an error if a field in this list has a
  9264. // non-empty value. This may be used to include null fields in Patch
  9265. // requests.
  9266. NullFields []string `json:"-"`
  9267. }
  9268. func (s *UnitInvoiceAdditionalCharge) MarshalJSON() ([]byte, error) {
  9269. type NoMethod UnitInvoiceAdditionalCharge
  9270. raw := NoMethod(*s)
  9271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9272. }
  9273. type UnitInvoiceTaxLine struct {
  9274. // TaxAmount: [required] Tax amount for the tax type.
  9275. TaxAmount *Price `json:"taxAmount,omitempty"`
  9276. // TaxName: Optional name of the tax type. This should only be provided
  9277. // if taxType is otherFeeTax.
  9278. TaxName string `json:"taxName,omitempty"`
  9279. // TaxType: [required] Type of the tax.
  9280. TaxType string `json:"taxType,omitempty"`
  9281. // ForceSendFields is a list of field names (e.g. "TaxAmount") to
  9282. // unconditionally include in API requests. By default, fields with
  9283. // empty values are omitted from API requests. However, any non-pointer,
  9284. // non-interface field appearing in ForceSendFields will be sent to the
  9285. // server regardless of whether the field is empty or not. This may be
  9286. // used to include empty fields in Patch requests.
  9287. ForceSendFields []string `json:"-"`
  9288. // NullFields is a list of field names (e.g. "TaxAmount") to include in
  9289. // API requests with the JSON null value. By default, fields with empty
  9290. // values are omitted from API requests. However, any field with an
  9291. // empty value appearing in NullFields will be sent to the server as
  9292. // null. It is an error if a field in this list has a non-empty value.
  9293. // This may be used to include null fields in Patch requests.
  9294. NullFields []string `json:"-"`
  9295. }
  9296. func (s *UnitInvoiceTaxLine) MarshalJSON() ([]byte, error) {
  9297. type NoMethod UnitInvoiceTaxLine
  9298. raw := NoMethod(*s)
  9299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9300. }
  9301. // Value: The single value of a rate group or the value of a rate group
  9302. // table's cell. Exactly one of noShipping, flatRate, pricePercentage,
  9303. // carrierRateName, subtableName must be set.
  9304. type Value struct {
  9305. // CarrierRateName: The name of a carrier rate referring to a carrier
  9306. // rate defined in the same rate group. Can only be set if all other
  9307. // fields are not set.
  9308. CarrierRateName string `json:"carrierRateName,omitempty"`
  9309. // FlatRate: A flat rate. Can only be set if all other fields are not
  9310. // set.
  9311. FlatRate *Price `json:"flatRate,omitempty"`
  9312. // NoShipping: If true, then the product can't ship. Must be true when
  9313. // set, can only be set if all other fields are not set.
  9314. NoShipping bool `json:"noShipping,omitempty"`
  9315. // PricePercentage: A percentage of the price represented as a number in
  9316. // decimal notation (e.g., "5.4"). Can only be set if all other fields
  9317. // are not set.
  9318. PricePercentage string `json:"pricePercentage,omitempty"`
  9319. // SubtableName: The name of a subtable. Can only be set in table cells
  9320. // (i.e., not for single values), and only if all other fields are not
  9321. // set.
  9322. SubtableName string `json:"subtableName,omitempty"`
  9323. // ForceSendFields is a list of field names (e.g. "CarrierRateName") to
  9324. // unconditionally include in API requests. By default, fields with
  9325. // empty values are omitted from API requests. However, any non-pointer,
  9326. // non-interface field appearing in ForceSendFields will be sent to the
  9327. // server regardless of whether the field is empty or not. This may be
  9328. // used to include empty fields in Patch requests.
  9329. ForceSendFields []string `json:"-"`
  9330. // NullFields is a list of field names (e.g. "CarrierRateName") to
  9331. // include in API requests with the JSON null value. By default, fields
  9332. // with empty values are omitted from API requests. However, any field
  9333. // with an empty value appearing in NullFields will be sent to the
  9334. // server as null. It is an error if a field in this list has a
  9335. // non-empty value. This may be used to include null fields in Patch
  9336. // requests.
  9337. NullFields []string `json:"-"`
  9338. }
  9339. func (s *Value) MarshalJSON() ([]byte, error) {
  9340. type NoMethod Value
  9341. raw := NoMethod(*s)
  9342. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9343. }
  9344. type Weight struct {
  9345. // Unit: The weight unit.
  9346. Unit string `json:"unit,omitempty"`
  9347. // Value: The weight represented as a number.
  9348. Value string `json:"value,omitempty"`
  9349. // ForceSendFields is a list of field names (e.g. "Unit") to
  9350. // unconditionally include in API requests. By default, fields with
  9351. // empty values are omitted from API requests. However, any non-pointer,
  9352. // non-interface field appearing in ForceSendFields will be sent to the
  9353. // server regardless of whether the field is empty or not. This may be
  9354. // used to include empty fields in Patch requests.
  9355. ForceSendFields []string `json:"-"`
  9356. // NullFields is a list of field names (e.g. "Unit") to include in API
  9357. // requests with the JSON null value. By default, fields with empty
  9358. // values are omitted from API requests. However, any field with an
  9359. // empty value appearing in NullFields will be sent to the server as
  9360. // null. It is an error if a field in this list has a non-empty value.
  9361. // This may be used to include null fields in Patch requests.
  9362. NullFields []string `json:"-"`
  9363. }
  9364. func (s *Weight) MarshalJSON() ([]byte, error) {
  9365. type NoMethod Weight
  9366. raw := NoMethod(*s)
  9367. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9368. }
  9369. // method id "content.accounts.authinfo":
  9370. type AccountsAuthinfoCall struct {
  9371. s *APIService
  9372. urlParams_ gensupport.URLParams
  9373. ifNoneMatch_ string
  9374. ctx_ context.Context
  9375. header_ http.Header
  9376. }
  9377. // Authinfo: Returns information about the authenticated user.
  9378. func (r *AccountsService) Authinfo() *AccountsAuthinfoCall {
  9379. c := &AccountsAuthinfoCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9380. return c
  9381. }
  9382. // Fields allows partial responses to be retrieved. See
  9383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9384. // for more information.
  9385. func (c *AccountsAuthinfoCall) Fields(s ...googleapi.Field) *AccountsAuthinfoCall {
  9386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9387. return c
  9388. }
  9389. // IfNoneMatch sets the optional parameter which makes the operation
  9390. // fail if the object's ETag matches the given value. This is useful for
  9391. // getting updates only after the object has changed since the last
  9392. // request. Use googleapi.IsNotModified to check whether the response
  9393. // error from Do is the result of In-None-Match.
  9394. func (c *AccountsAuthinfoCall) IfNoneMatch(entityTag string) *AccountsAuthinfoCall {
  9395. c.ifNoneMatch_ = entityTag
  9396. return c
  9397. }
  9398. // Context sets the context to be used in this call's Do method. Any
  9399. // pending HTTP request will be aborted if the provided context is
  9400. // canceled.
  9401. func (c *AccountsAuthinfoCall) Context(ctx context.Context) *AccountsAuthinfoCall {
  9402. c.ctx_ = ctx
  9403. return c
  9404. }
  9405. // Header returns an http.Header that can be modified by the caller to
  9406. // add HTTP headers to the request.
  9407. func (c *AccountsAuthinfoCall) Header() http.Header {
  9408. if c.header_ == nil {
  9409. c.header_ = make(http.Header)
  9410. }
  9411. return c.header_
  9412. }
  9413. func (c *AccountsAuthinfoCall) doRequest(alt string) (*http.Response, error) {
  9414. reqHeaders := make(http.Header)
  9415. for k, v := range c.header_ {
  9416. reqHeaders[k] = v
  9417. }
  9418. reqHeaders.Set("User-Agent", c.s.userAgent())
  9419. if c.ifNoneMatch_ != "" {
  9420. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9421. }
  9422. var body io.Reader = nil
  9423. c.urlParams_.Set("alt", alt)
  9424. c.urlParams_.Set("prettyPrint", "false")
  9425. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/authinfo")
  9426. urls += "?" + c.urlParams_.Encode()
  9427. req, err := http.NewRequest("GET", urls, body)
  9428. if err != nil {
  9429. return nil, err
  9430. }
  9431. req.Header = reqHeaders
  9432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9433. }
  9434. // Do executes the "content.accounts.authinfo" call.
  9435. // Exactly one of *AccountsAuthInfoResponse or error will be non-nil.
  9436. // Any non-2xx status code is an error. Response headers are in either
  9437. // *AccountsAuthInfoResponse.ServerResponse.Header or (if a response was
  9438. // returned at all) in error.(*googleapi.Error).Header. Use
  9439. // googleapi.IsNotModified to check whether the returned error was
  9440. // because http.StatusNotModified was returned.
  9441. func (c *AccountsAuthinfoCall) Do(opts ...googleapi.CallOption) (*AccountsAuthInfoResponse, error) {
  9442. gensupport.SetOptions(c.urlParams_, opts...)
  9443. res, err := c.doRequest("json")
  9444. if res != nil && res.StatusCode == http.StatusNotModified {
  9445. if res.Body != nil {
  9446. res.Body.Close()
  9447. }
  9448. return nil, &googleapi.Error{
  9449. Code: res.StatusCode,
  9450. Header: res.Header,
  9451. }
  9452. }
  9453. if err != nil {
  9454. return nil, err
  9455. }
  9456. defer googleapi.CloseBody(res)
  9457. if err := googleapi.CheckResponse(res); err != nil {
  9458. return nil, err
  9459. }
  9460. ret := &AccountsAuthInfoResponse{
  9461. ServerResponse: googleapi.ServerResponse{
  9462. Header: res.Header,
  9463. HTTPStatusCode: res.StatusCode,
  9464. },
  9465. }
  9466. target := &ret
  9467. if err := gensupport.DecodeResponse(target, res); err != nil {
  9468. return nil, err
  9469. }
  9470. return ret, nil
  9471. // {
  9472. // "description": "Returns information about the authenticated user.",
  9473. // "httpMethod": "GET",
  9474. // "id": "content.accounts.authinfo",
  9475. // "path": "accounts/authinfo",
  9476. // "response": {
  9477. // "$ref": "AccountsAuthInfoResponse"
  9478. // },
  9479. // "scopes": [
  9480. // "https://www.googleapis.com/auth/content"
  9481. // ]
  9482. // }
  9483. }
  9484. // method id "content.accounts.claimwebsite":
  9485. type AccountsClaimwebsiteCall struct {
  9486. s *APIService
  9487. merchantId uint64
  9488. accountId uint64
  9489. urlParams_ gensupport.URLParams
  9490. ctx_ context.Context
  9491. header_ http.Header
  9492. }
  9493. // Claimwebsite: Claims the website of a Merchant Center sub-account.
  9494. func (r *AccountsService) Claimwebsite(merchantId uint64, accountId uint64) *AccountsClaimwebsiteCall {
  9495. c := &AccountsClaimwebsiteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9496. c.merchantId = merchantId
  9497. c.accountId = accountId
  9498. return c
  9499. }
  9500. // Overwrite sets the optional parameter "overwrite": Only available to
  9501. // selected merchants. When set to True, this flag removes any existing
  9502. // claim on the requested website by another account and replaces it
  9503. // with a claim from this account.
  9504. func (c *AccountsClaimwebsiteCall) Overwrite(overwrite bool) *AccountsClaimwebsiteCall {
  9505. c.urlParams_.Set("overwrite", fmt.Sprint(overwrite))
  9506. return c
  9507. }
  9508. // Fields allows partial responses to be retrieved. See
  9509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9510. // for more information.
  9511. func (c *AccountsClaimwebsiteCall) Fields(s ...googleapi.Field) *AccountsClaimwebsiteCall {
  9512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9513. return c
  9514. }
  9515. // Context sets the context to be used in this call's Do method. Any
  9516. // pending HTTP request will be aborted if the provided context is
  9517. // canceled.
  9518. func (c *AccountsClaimwebsiteCall) Context(ctx context.Context) *AccountsClaimwebsiteCall {
  9519. c.ctx_ = ctx
  9520. return c
  9521. }
  9522. // Header returns an http.Header that can be modified by the caller to
  9523. // add HTTP headers to the request.
  9524. func (c *AccountsClaimwebsiteCall) Header() http.Header {
  9525. if c.header_ == nil {
  9526. c.header_ = make(http.Header)
  9527. }
  9528. return c.header_
  9529. }
  9530. func (c *AccountsClaimwebsiteCall) doRequest(alt string) (*http.Response, error) {
  9531. reqHeaders := make(http.Header)
  9532. for k, v := range c.header_ {
  9533. reqHeaders[k] = v
  9534. }
  9535. reqHeaders.Set("User-Agent", c.s.userAgent())
  9536. var body io.Reader = nil
  9537. c.urlParams_.Set("alt", alt)
  9538. c.urlParams_.Set("prettyPrint", "false")
  9539. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}/claimwebsite")
  9540. urls += "?" + c.urlParams_.Encode()
  9541. req, err := http.NewRequest("POST", urls, body)
  9542. if err != nil {
  9543. return nil, err
  9544. }
  9545. req.Header = reqHeaders
  9546. googleapi.Expand(req.URL, map[string]string{
  9547. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9548. "accountId": strconv.FormatUint(c.accountId, 10),
  9549. })
  9550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9551. }
  9552. // Do executes the "content.accounts.claimwebsite" call.
  9553. // Exactly one of *AccountsClaimWebsiteResponse or error will be
  9554. // non-nil. Any non-2xx status code is an error. Response headers are in
  9555. // either *AccountsClaimWebsiteResponse.ServerResponse.Header or (if a
  9556. // response was returned at all) in error.(*googleapi.Error).Header. Use
  9557. // googleapi.IsNotModified to check whether the returned error was
  9558. // because http.StatusNotModified was returned.
  9559. func (c *AccountsClaimwebsiteCall) Do(opts ...googleapi.CallOption) (*AccountsClaimWebsiteResponse, error) {
  9560. gensupport.SetOptions(c.urlParams_, opts...)
  9561. res, err := c.doRequest("json")
  9562. if res != nil && res.StatusCode == http.StatusNotModified {
  9563. if res.Body != nil {
  9564. res.Body.Close()
  9565. }
  9566. return nil, &googleapi.Error{
  9567. Code: res.StatusCode,
  9568. Header: res.Header,
  9569. }
  9570. }
  9571. if err != nil {
  9572. return nil, err
  9573. }
  9574. defer googleapi.CloseBody(res)
  9575. if err := googleapi.CheckResponse(res); err != nil {
  9576. return nil, err
  9577. }
  9578. ret := &AccountsClaimWebsiteResponse{
  9579. ServerResponse: googleapi.ServerResponse{
  9580. Header: res.Header,
  9581. HTTPStatusCode: res.StatusCode,
  9582. },
  9583. }
  9584. target := &ret
  9585. if err := gensupport.DecodeResponse(target, res); err != nil {
  9586. return nil, err
  9587. }
  9588. return ret, nil
  9589. // {
  9590. // "description": "Claims the website of a Merchant Center sub-account.",
  9591. // "httpMethod": "POST",
  9592. // "id": "content.accounts.claimwebsite",
  9593. // "parameterOrder": [
  9594. // "merchantId",
  9595. // "accountId"
  9596. // ],
  9597. // "parameters": {
  9598. // "accountId": {
  9599. // "description": "The ID of the account whose website is claimed.",
  9600. // "format": "uint64",
  9601. // "location": "path",
  9602. // "required": true,
  9603. // "type": "string"
  9604. // },
  9605. // "merchantId": {
  9606. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  9607. // "format": "uint64",
  9608. // "location": "path",
  9609. // "required": true,
  9610. // "type": "string"
  9611. // },
  9612. // "overwrite": {
  9613. // "description": "Only available to selected merchants. When set to True, this flag removes any existing claim on the requested website by another account and replaces it with a claim from this account.",
  9614. // "location": "query",
  9615. // "type": "boolean"
  9616. // }
  9617. // },
  9618. // "path": "{merchantId}/accounts/{accountId}/claimwebsite",
  9619. // "response": {
  9620. // "$ref": "AccountsClaimWebsiteResponse"
  9621. // },
  9622. // "scopes": [
  9623. // "https://www.googleapis.com/auth/content"
  9624. // ]
  9625. // }
  9626. }
  9627. // method id "content.accounts.custombatch":
  9628. type AccountsCustombatchCall struct {
  9629. s *APIService
  9630. accountscustombatchrequest *AccountsCustomBatchRequest
  9631. urlParams_ gensupport.URLParams
  9632. ctx_ context.Context
  9633. header_ http.Header
  9634. }
  9635. // Custombatch: Retrieves, inserts, updates, and deletes multiple
  9636. // Merchant Center (sub-)accounts in a single request.
  9637. func (r *AccountsService) Custombatch(accountscustombatchrequest *AccountsCustomBatchRequest) *AccountsCustombatchCall {
  9638. c := &AccountsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9639. c.accountscustombatchrequest = accountscustombatchrequest
  9640. return c
  9641. }
  9642. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  9643. // request like in a live environment. If set to true, dry-run mode
  9644. // checks the validity of the request and returns errors (if any).
  9645. func (c *AccountsCustombatchCall) DryRun(dryRun bool) *AccountsCustombatchCall {
  9646. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  9647. return c
  9648. }
  9649. // Fields allows partial responses to be retrieved. See
  9650. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9651. // for more information.
  9652. func (c *AccountsCustombatchCall) Fields(s ...googleapi.Field) *AccountsCustombatchCall {
  9653. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9654. return c
  9655. }
  9656. // Context sets the context to be used in this call's Do method. Any
  9657. // pending HTTP request will be aborted if the provided context is
  9658. // canceled.
  9659. func (c *AccountsCustombatchCall) Context(ctx context.Context) *AccountsCustombatchCall {
  9660. c.ctx_ = ctx
  9661. return c
  9662. }
  9663. // Header returns an http.Header that can be modified by the caller to
  9664. // add HTTP headers to the request.
  9665. func (c *AccountsCustombatchCall) Header() http.Header {
  9666. if c.header_ == nil {
  9667. c.header_ = make(http.Header)
  9668. }
  9669. return c.header_
  9670. }
  9671. func (c *AccountsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  9672. reqHeaders := make(http.Header)
  9673. for k, v := range c.header_ {
  9674. reqHeaders[k] = v
  9675. }
  9676. reqHeaders.Set("User-Agent", c.s.userAgent())
  9677. var body io.Reader = nil
  9678. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountscustombatchrequest)
  9679. if err != nil {
  9680. return nil, err
  9681. }
  9682. reqHeaders.Set("Content-Type", "application/json")
  9683. c.urlParams_.Set("alt", alt)
  9684. c.urlParams_.Set("prettyPrint", "false")
  9685. urls := googleapi.ResolveRelative(c.s.BasePath, "accounts/batch")
  9686. urls += "?" + c.urlParams_.Encode()
  9687. req, err := http.NewRequest("POST", urls, body)
  9688. if err != nil {
  9689. return nil, err
  9690. }
  9691. req.Header = reqHeaders
  9692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9693. }
  9694. // Do executes the "content.accounts.custombatch" call.
  9695. // Exactly one of *AccountsCustomBatchResponse or error will be non-nil.
  9696. // Any non-2xx status code is an error. Response headers are in either
  9697. // *AccountsCustomBatchResponse.ServerResponse.Header or (if a response
  9698. // was returned at all) in error.(*googleapi.Error).Header. Use
  9699. // googleapi.IsNotModified to check whether the returned error was
  9700. // because http.StatusNotModified was returned.
  9701. func (c *AccountsCustombatchCall) Do(opts ...googleapi.CallOption) (*AccountsCustomBatchResponse, error) {
  9702. gensupport.SetOptions(c.urlParams_, opts...)
  9703. res, err := c.doRequest("json")
  9704. if res != nil && res.StatusCode == http.StatusNotModified {
  9705. if res.Body != nil {
  9706. res.Body.Close()
  9707. }
  9708. return nil, &googleapi.Error{
  9709. Code: res.StatusCode,
  9710. Header: res.Header,
  9711. }
  9712. }
  9713. if err != nil {
  9714. return nil, err
  9715. }
  9716. defer googleapi.CloseBody(res)
  9717. if err := googleapi.CheckResponse(res); err != nil {
  9718. return nil, err
  9719. }
  9720. ret := &AccountsCustomBatchResponse{
  9721. ServerResponse: googleapi.ServerResponse{
  9722. Header: res.Header,
  9723. HTTPStatusCode: res.StatusCode,
  9724. },
  9725. }
  9726. target := &ret
  9727. if err := gensupport.DecodeResponse(target, res); err != nil {
  9728. return nil, err
  9729. }
  9730. return ret, nil
  9731. // {
  9732. // "description": "Retrieves, inserts, updates, and deletes multiple Merchant Center (sub-)accounts in a single request.",
  9733. // "httpMethod": "POST",
  9734. // "id": "content.accounts.custombatch",
  9735. // "parameters": {
  9736. // "dryRun": {
  9737. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  9738. // "location": "query",
  9739. // "type": "boolean"
  9740. // }
  9741. // },
  9742. // "path": "accounts/batch",
  9743. // "request": {
  9744. // "$ref": "AccountsCustomBatchRequest"
  9745. // },
  9746. // "response": {
  9747. // "$ref": "AccountsCustomBatchResponse"
  9748. // },
  9749. // "scopes": [
  9750. // "https://www.googleapis.com/auth/content"
  9751. // ]
  9752. // }
  9753. }
  9754. // method id "content.accounts.delete":
  9755. type AccountsDeleteCall struct {
  9756. s *APIService
  9757. merchantId uint64
  9758. accountId uint64
  9759. urlParams_ gensupport.URLParams
  9760. ctx_ context.Context
  9761. header_ http.Header
  9762. }
  9763. // Delete: Deletes a Merchant Center sub-account.
  9764. func (r *AccountsService) Delete(merchantId uint64, accountId uint64) *AccountsDeleteCall {
  9765. c := &AccountsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9766. c.merchantId = merchantId
  9767. c.accountId = accountId
  9768. return c
  9769. }
  9770. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  9771. // request like in a live environment. If set to true, dry-run mode
  9772. // checks the validity of the request and returns errors (if any).
  9773. func (c *AccountsDeleteCall) DryRun(dryRun bool) *AccountsDeleteCall {
  9774. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  9775. return c
  9776. }
  9777. // Force sets the optional parameter "force": Flag to delete
  9778. // sub-accounts with products. The default value is false.
  9779. func (c *AccountsDeleteCall) Force(force bool) *AccountsDeleteCall {
  9780. c.urlParams_.Set("force", fmt.Sprint(force))
  9781. return c
  9782. }
  9783. // Fields allows partial responses to be retrieved. See
  9784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9785. // for more information.
  9786. func (c *AccountsDeleteCall) Fields(s ...googleapi.Field) *AccountsDeleteCall {
  9787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9788. return c
  9789. }
  9790. // Context sets the context to be used in this call's Do method. Any
  9791. // pending HTTP request will be aborted if the provided context is
  9792. // canceled.
  9793. func (c *AccountsDeleteCall) Context(ctx context.Context) *AccountsDeleteCall {
  9794. c.ctx_ = ctx
  9795. return c
  9796. }
  9797. // Header returns an http.Header that can be modified by the caller to
  9798. // add HTTP headers to the request.
  9799. func (c *AccountsDeleteCall) Header() http.Header {
  9800. if c.header_ == nil {
  9801. c.header_ = make(http.Header)
  9802. }
  9803. return c.header_
  9804. }
  9805. func (c *AccountsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9806. reqHeaders := make(http.Header)
  9807. for k, v := range c.header_ {
  9808. reqHeaders[k] = v
  9809. }
  9810. reqHeaders.Set("User-Agent", c.s.userAgent())
  9811. var body io.Reader = nil
  9812. c.urlParams_.Set("alt", alt)
  9813. c.urlParams_.Set("prettyPrint", "false")
  9814. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  9815. urls += "?" + c.urlParams_.Encode()
  9816. req, err := http.NewRequest("DELETE", urls, body)
  9817. if err != nil {
  9818. return nil, err
  9819. }
  9820. req.Header = reqHeaders
  9821. googleapi.Expand(req.URL, map[string]string{
  9822. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9823. "accountId": strconv.FormatUint(c.accountId, 10),
  9824. })
  9825. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9826. }
  9827. // Do executes the "content.accounts.delete" call.
  9828. func (c *AccountsDeleteCall) Do(opts ...googleapi.CallOption) error {
  9829. gensupport.SetOptions(c.urlParams_, opts...)
  9830. res, err := c.doRequest("json")
  9831. if err != nil {
  9832. return err
  9833. }
  9834. defer googleapi.CloseBody(res)
  9835. if err := googleapi.CheckResponse(res); err != nil {
  9836. return err
  9837. }
  9838. return nil
  9839. // {
  9840. // "description": "Deletes a Merchant Center sub-account.",
  9841. // "httpMethod": "DELETE",
  9842. // "id": "content.accounts.delete",
  9843. // "parameterOrder": [
  9844. // "merchantId",
  9845. // "accountId"
  9846. // ],
  9847. // "parameters": {
  9848. // "accountId": {
  9849. // "description": "The ID of the account.",
  9850. // "format": "uint64",
  9851. // "location": "path",
  9852. // "required": true,
  9853. // "type": "string"
  9854. // },
  9855. // "dryRun": {
  9856. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  9857. // "location": "query",
  9858. // "type": "boolean"
  9859. // },
  9860. // "force": {
  9861. // "default": "false",
  9862. // "description": "Flag to delete sub-accounts with products. The default value is false.",
  9863. // "location": "query",
  9864. // "type": "boolean"
  9865. // },
  9866. // "merchantId": {
  9867. // "description": "The ID of the managing account. This must be a multi-client account, and accountId must be the ID of a sub-account of this account.",
  9868. // "format": "uint64",
  9869. // "location": "path",
  9870. // "required": true,
  9871. // "type": "string"
  9872. // }
  9873. // },
  9874. // "path": "{merchantId}/accounts/{accountId}",
  9875. // "scopes": [
  9876. // "https://www.googleapis.com/auth/content"
  9877. // ]
  9878. // }
  9879. }
  9880. // method id "content.accounts.get":
  9881. type AccountsGetCall struct {
  9882. s *APIService
  9883. merchantId uint64
  9884. accountId uint64
  9885. urlParams_ gensupport.URLParams
  9886. ifNoneMatch_ string
  9887. ctx_ context.Context
  9888. header_ http.Header
  9889. }
  9890. // Get: Retrieves a Merchant Center account.
  9891. func (r *AccountsService) Get(merchantId uint64, accountId uint64) *AccountsGetCall {
  9892. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9893. c.merchantId = merchantId
  9894. c.accountId = accountId
  9895. return c
  9896. }
  9897. // Fields allows partial responses to be retrieved. See
  9898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9899. // for more information.
  9900. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  9901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9902. return c
  9903. }
  9904. // IfNoneMatch sets the optional parameter which makes the operation
  9905. // fail if the object's ETag matches the given value. This is useful for
  9906. // getting updates only after the object has changed since the last
  9907. // request. Use googleapi.IsNotModified to check whether the response
  9908. // error from Do is the result of In-None-Match.
  9909. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  9910. c.ifNoneMatch_ = entityTag
  9911. return c
  9912. }
  9913. // Context sets the context to be used in this call's Do method. Any
  9914. // pending HTTP request will be aborted if the provided context is
  9915. // canceled.
  9916. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  9917. c.ctx_ = ctx
  9918. return c
  9919. }
  9920. // Header returns an http.Header that can be modified by the caller to
  9921. // add HTTP headers to the request.
  9922. func (c *AccountsGetCall) Header() http.Header {
  9923. if c.header_ == nil {
  9924. c.header_ = make(http.Header)
  9925. }
  9926. return c.header_
  9927. }
  9928. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  9929. reqHeaders := make(http.Header)
  9930. for k, v := range c.header_ {
  9931. reqHeaders[k] = v
  9932. }
  9933. reqHeaders.Set("User-Agent", c.s.userAgent())
  9934. if c.ifNoneMatch_ != "" {
  9935. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9936. }
  9937. var body io.Reader = nil
  9938. c.urlParams_.Set("alt", alt)
  9939. c.urlParams_.Set("prettyPrint", "false")
  9940. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  9941. urls += "?" + c.urlParams_.Encode()
  9942. req, err := http.NewRequest("GET", urls, body)
  9943. if err != nil {
  9944. return nil, err
  9945. }
  9946. req.Header = reqHeaders
  9947. googleapi.Expand(req.URL, map[string]string{
  9948. "merchantId": strconv.FormatUint(c.merchantId, 10),
  9949. "accountId": strconv.FormatUint(c.accountId, 10),
  9950. })
  9951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9952. }
  9953. // Do executes the "content.accounts.get" call.
  9954. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  9955. // code is an error. Response headers are in either
  9956. // *Account.ServerResponse.Header or (if a response was returned at all)
  9957. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9958. // check whether the returned error was because http.StatusNotModified
  9959. // was returned.
  9960. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  9961. gensupport.SetOptions(c.urlParams_, opts...)
  9962. res, err := c.doRequest("json")
  9963. if res != nil && res.StatusCode == http.StatusNotModified {
  9964. if res.Body != nil {
  9965. res.Body.Close()
  9966. }
  9967. return nil, &googleapi.Error{
  9968. Code: res.StatusCode,
  9969. Header: res.Header,
  9970. }
  9971. }
  9972. if err != nil {
  9973. return nil, err
  9974. }
  9975. defer googleapi.CloseBody(res)
  9976. if err := googleapi.CheckResponse(res); err != nil {
  9977. return nil, err
  9978. }
  9979. ret := &Account{
  9980. ServerResponse: googleapi.ServerResponse{
  9981. Header: res.Header,
  9982. HTTPStatusCode: res.StatusCode,
  9983. },
  9984. }
  9985. target := &ret
  9986. if err := gensupport.DecodeResponse(target, res); err != nil {
  9987. return nil, err
  9988. }
  9989. return ret, nil
  9990. // {
  9991. // "description": "Retrieves a Merchant Center account.",
  9992. // "httpMethod": "GET",
  9993. // "id": "content.accounts.get",
  9994. // "parameterOrder": [
  9995. // "merchantId",
  9996. // "accountId"
  9997. // ],
  9998. // "parameters": {
  9999. // "accountId": {
  10000. // "description": "The ID of the account.",
  10001. // "format": "uint64",
  10002. // "location": "path",
  10003. // "required": true,
  10004. // "type": "string"
  10005. // },
  10006. // "merchantId": {
  10007. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  10008. // "format": "uint64",
  10009. // "location": "path",
  10010. // "required": true,
  10011. // "type": "string"
  10012. // }
  10013. // },
  10014. // "path": "{merchantId}/accounts/{accountId}",
  10015. // "response": {
  10016. // "$ref": "Account"
  10017. // },
  10018. // "scopes": [
  10019. // "https://www.googleapis.com/auth/content"
  10020. // ]
  10021. // }
  10022. }
  10023. // method id "content.accounts.insert":
  10024. type AccountsInsertCall struct {
  10025. s *APIService
  10026. merchantId uint64
  10027. account *Account
  10028. urlParams_ gensupport.URLParams
  10029. ctx_ context.Context
  10030. header_ http.Header
  10031. }
  10032. // Insert: Creates a Merchant Center sub-account.
  10033. func (r *AccountsService) Insert(merchantId uint64, account *Account) *AccountsInsertCall {
  10034. c := &AccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10035. c.merchantId = merchantId
  10036. c.account = account
  10037. return c
  10038. }
  10039. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  10040. // request like in a live environment. If set to true, dry-run mode
  10041. // checks the validity of the request and returns errors (if any).
  10042. func (c *AccountsInsertCall) DryRun(dryRun bool) *AccountsInsertCall {
  10043. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  10044. return c
  10045. }
  10046. // Fields allows partial responses to be retrieved. See
  10047. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10048. // for more information.
  10049. func (c *AccountsInsertCall) Fields(s ...googleapi.Field) *AccountsInsertCall {
  10050. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10051. return c
  10052. }
  10053. // Context sets the context to be used in this call's Do method. Any
  10054. // pending HTTP request will be aborted if the provided context is
  10055. // canceled.
  10056. func (c *AccountsInsertCall) Context(ctx context.Context) *AccountsInsertCall {
  10057. c.ctx_ = ctx
  10058. return c
  10059. }
  10060. // Header returns an http.Header that can be modified by the caller to
  10061. // add HTTP headers to the request.
  10062. func (c *AccountsInsertCall) Header() http.Header {
  10063. if c.header_ == nil {
  10064. c.header_ = make(http.Header)
  10065. }
  10066. return c.header_
  10067. }
  10068. func (c *AccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  10069. reqHeaders := make(http.Header)
  10070. for k, v := range c.header_ {
  10071. reqHeaders[k] = v
  10072. }
  10073. reqHeaders.Set("User-Agent", c.s.userAgent())
  10074. var body io.Reader = nil
  10075. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  10076. if err != nil {
  10077. return nil, err
  10078. }
  10079. reqHeaders.Set("Content-Type", "application/json")
  10080. c.urlParams_.Set("alt", alt)
  10081. c.urlParams_.Set("prettyPrint", "false")
  10082. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts")
  10083. urls += "?" + c.urlParams_.Encode()
  10084. req, err := http.NewRequest("POST", urls, body)
  10085. if err != nil {
  10086. return nil, err
  10087. }
  10088. req.Header = reqHeaders
  10089. googleapi.Expand(req.URL, map[string]string{
  10090. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10091. })
  10092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10093. }
  10094. // Do executes the "content.accounts.insert" call.
  10095. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  10096. // code is an error. Response headers are in either
  10097. // *Account.ServerResponse.Header or (if a response was returned at all)
  10098. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10099. // check whether the returned error was because http.StatusNotModified
  10100. // was returned.
  10101. func (c *AccountsInsertCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  10102. gensupport.SetOptions(c.urlParams_, opts...)
  10103. res, err := c.doRequest("json")
  10104. if res != nil && res.StatusCode == http.StatusNotModified {
  10105. if res.Body != nil {
  10106. res.Body.Close()
  10107. }
  10108. return nil, &googleapi.Error{
  10109. Code: res.StatusCode,
  10110. Header: res.Header,
  10111. }
  10112. }
  10113. if err != nil {
  10114. return nil, err
  10115. }
  10116. defer googleapi.CloseBody(res)
  10117. if err := googleapi.CheckResponse(res); err != nil {
  10118. return nil, err
  10119. }
  10120. ret := &Account{
  10121. ServerResponse: googleapi.ServerResponse{
  10122. Header: res.Header,
  10123. HTTPStatusCode: res.StatusCode,
  10124. },
  10125. }
  10126. target := &ret
  10127. if err := gensupport.DecodeResponse(target, res); err != nil {
  10128. return nil, err
  10129. }
  10130. return ret, nil
  10131. // {
  10132. // "description": "Creates a Merchant Center sub-account.",
  10133. // "httpMethod": "POST",
  10134. // "id": "content.accounts.insert",
  10135. // "parameterOrder": [
  10136. // "merchantId"
  10137. // ],
  10138. // "parameters": {
  10139. // "dryRun": {
  10140. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  10141. // "location": "query",
  10142. // "type": "boolean"
  10143. // },
  10144. // "merchantId": {
  10145. // "description": "The ID of the managing account. This must be a multi-client account.",
  10146. // "format": "uint64",
  10147. // "location": "path",
  10148. // "required": true,
  10149. // "type": "string"
  10150. // }
  10151. // },
  10152. // "path": "{merchantId}/accounts",
  10153. // "request": {
  10154. // "$ref": "Account"
  10155. // },
  10156. // "response": {
  10157. // "$ref": "Account"
  10158. // },
  10159. // "scopes": [
  10160. // "https://www.googleapis.com/auth/content"
  10161. // ]
  10162. // }
  10163. }
  10164. // method id "content.accounts.link":
  10165. type AccountsLinkCall struct {
  10166. s *APIService
  10167. merchantId uint64
  10168. accountId uint64
  10169. accountslinkrequest *AccountsLinkRequest
  10170. urlParams_ gensupport.URLParams
  10171. ctx_ context.Context
  10172. header_ http.Header
  10173. }
  10174. // Link: Performs an action on a link between a Merchant Center account
  10175. // and another account.
  10176. func (r *AccountsService) Link(merchantId uint64, accountId uint64, accountslinkrequest *AccountsLinkRequest) *AccountsLinkCall {
  10177. c := &AccountsLinkCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10178. c.merchantId = merchantId
  10179. c.accountId = accountId
  10180. c.accountslinkrequest = accountslinkrequest
  10181. return c
  10182. }
  10183. // Fields allows partial responses to be retrieved. See
  10184. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10185. // for more information.
  10186. func (c *AccountsLinkCall) Fields(s ...googleapi.Field) *AccountsLinkCall {
  10187. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10188. return c
  10189. }
  10190. // Context sets the context to be used in this call's Do method. Any
  10191. // pending HTTP request will be aborted if the provided context is
  10192. // canceled.
  10193. func (c *AccountsLinkCall) Context(ctx context.Context) *AccountsLinkCall {
  10194. c.ctx_ = ctx
  10195. return c
  10196. }
  10197. // Header returns an http.Header that can be modified by the caller to
  10198. // add HTTP headers to the request.
  10199. func (c *AccountsLinkCall) Header() http.Header {
  10200. if c.header_ == nil {
  10201. c.header_ = make(http.Header)
  10202. }
  10203. return c.header_
  10204. }
  10205. func (c *AccountsLinkCall) doRequest(alt string) (*http.Response, error) {
  10206. reqHeaders := make(http.Header)
  10207. for k, v := range c.header_ {
  10208. reqHeaders[k] = v
  10209. }
  10210. reqHeaders.Set("User-Agent", c.s.userAgent())
  10211. var body io.Reader = nil
  10212. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountslinkrequest)
  10213. if err != nil {
  10214. return nil, err
  10215. }
  10216. reqHeaders.Set("Content-Type", "application/json")
  10217. c.urlParams_.Set("alt", alt)
  10218. c.urlParams_.Set("prettyPrint", "false")
  10219. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}/link")
  10220. urls += "?" + c.urlParams_.Encode()
  10221. req, err := http.NewRequest("POST", urls, body)
  10222. if err != nil {
  10223. return nil, err
  10224. }
  10225. req.Header = reqHeaders
  10226. googleapi.Expand(req.URL, map[string]string{
  10227. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10228. "accountId": strconv.FormatUint(c.accountId, 10),
  10229. })
  10230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10231. }
  10232. // Do executes the "content.accounts.link" call.
  10233. // Exactly one of *AccountsLinkResponse or error will be non-nil. Any
  10234. // non-2xx status code is an error. Response headers are in either
  10235. // *AccountsLinkResponse.ServerResponse.Header or (if a response was
  10236. // returned at all) in error.(*googleapi.Error).Header. Use
  10237. // googleapi.IsNotModified to check whether the returned error was
  10238. // because http.StatusNotModified was returned.
  10239. func (c *AccountsLinkCall) Do(opts ...googleapi.CallOption) (*AccountsLinkResponse, error) {
  10240. gensupport.SetOptions(c.urlParams_, opts...)
  10241. res, err := c.doRequest("json")
  10242. if res != nil && res.StatusCode == http.StatusNotModified {
  10243. if res.Body != nil {
  10244. res.Body.Close()
  10245. }
  10246. return nil, &googleapi.Error{
  10247. Code: res.StatusCode,
  10248. Header: res.Header,
  10249. }
  10250. }
  10251. if err != nil {
  10252. return nil, err
  10253. }
  10254. defer googleapi.CloseBody(res)
  10255. if err := googleapi.CheckResponse(res); err != nil {
  10256. return nil, err
  10257. }
  10258. ret := &AccountsLinkResponse{
  10259. ServerResponse: googleapi.ServerResponse{
  10260. Header: res.Header,
  10261. HTTPStatusCode: res.StatusCode,
  10262. },
  10263. }
  10264. target := &ret
  10265. if err := gensupport.DecodeResponse(target, res); err != nil {
  10266. return nil, err
  10267. }
  10268. return ret, nil
  10269. // {
  10270. // "description": "Performs an action on a link between a Merchant Center account and another account.",
  10271. // "httpMethod": "POST",
  10272. // "id": "content.accounts.link",
  10273. // "parameterOrder": [
  10274. // "merchantId",
  10275. // "accountId"
  10276. // ],
  10277. // "parameters": {
  10278. // "accountId": {
  10279. // "description": "The ID of the account that should be linked.",
  10280. // "format": "uint64",
  10281. // "location": "path",
  10282. // "required": true,
  10283. // "type": "string"
  10284. // },
  10285. // "merchantId": {
  10286. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  10287. // "format": "uint64",
  10288. // "location": "path",
  10289. // "required": true,
  10290. // "type": "string"
  10291. // }
  10292. // },
  10293. // "path": "{merchantId}/accounts/{accountId}/link",
  10294. // "request": {
  10295. // "$ref": "AccountsLinkRequest"
  10296. // },
  10297. // "response": {
  10298. // "$ref": "AccountsLinkResponse"
  10299. // },
  10300. // "scopes": [
  10301. // "https://www.googleapis.com/auth/content"
  10302. // ]
  10303. // }
  10304. }
  10305. // method id "content.accounts.list":
  10306. type AccountsListCall struct {
  10307. s *APIService
  10308. merchantId uint64
  10309. urlParams_ gensupport.URLParams
  10310. ifNoneMatch_ string
  10311. ctx_ context.Context
  10312. header_ http.Header
  10313. }
  10314. // List: Lists the sub-accounts in your Merchant Center account.
  10315. func (r *AccountsService) List(merchantId uint64) *AccountsListCall {
  10316. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10317. c.merchantId = merchantId
  10318. return c
  10319. }
  10320. // MaxResults sets the optional parameter "maxResults": The maximum
  10321. // number of accounts to return in the response, used for paging.
  10322. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  10323. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10324. return c
  10325. }
  10326. // PageToken sets the optional parameter "pageToken": The token returned
  10327. // by the previous request.
  10328. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  10329. c.urlParams_.Set("pageToken", pageToken)
  10330. return c
  10331. }
  10332. // Fields allows partial responses to be retrieved. See
  10333. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10334. // for more information.
  10335. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  10336. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10337. return c
  10338. }
  10339. // IfNoneMatch sets the optional parameter which makes the operation
  10340. // fail if the object's ETag matches the given value. This is useful for
  10341. // getting updates only after the object has changed since the last
  10342. // request. Use googleapi.IsNotModified to check whether the response
  10343. // error from Do is the result of In-None-Match.
  10344. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  10345. c.ifNoneMatch_ = entityTag
  10346. return c
  10347. }
  10348. // Context sets the context to be used in this call's Do method. Any
  10349. // pending HTTP request will be aborted if the provided context is
  10350. // canceled.
  10351. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  10352. c.ctx_ = ctx
  10353. return c
  10354. }
  10355. // Header returns an http.Header that can be modified by the caller to
  10356. // add HTTP headers to the request.
  10357. func (c *AccountsListCall) Header() http.Header {
  10358. if c.header_ == nil {
  10359. c.header_ = make(http.Header)
  10360. }
  10361. return c.header_
  10362. }
  10363. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  10364. reqHeaders := make(http.Header)
  10365. for k, v := range c.header_ {
  10366. reqHeaders[k] = v
  10367. }
  10368. reqHeaders.Set("User-Agent", c.s.userAgent())
  10369. if c.ifNoneMatch_ != "" {
  10370. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10371. }
  10372. var body io.Reader = nil
  10373. c.urlParams_.Set("alt", alt)
  10374. c.urlParams_.Set("prettyPrint", "false")
  10375. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts")
  10376. urls += "?" + c.urlParams_.Encode()
  10377. req, err := http.NewRequest("GET", urls, body)
  10378. if err != nil {
  10379. return nil, err
  10380. }
  10381. req.Header = reqHeaders
  10382. googleapi.Expand(req.URL, map[string]string{
  10383. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10384. })
  10385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10386. }
  10387. // Do executes the "content.accounts.list" call.
  10388. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  10389. // non-2xx status code is an error. Response headers are in either
  10390. // *AccountsListResponse.ServerResponse.Header or (if a response was
  10391. // returned at all) in error.(*googleapi.Error).Header. Use
  10392. // googleapi.IsNotModified to check whether the returned error was
  10393. // because http.StatusNotModified was returned.
  10394. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  10395. gensupport.SetOptions(c.urlParams_, opts...)
  10396. res, err := c.doRequest("json")
  10397. if res != nil && res.StatusCode == http.StatusNotModified {
  10398. if res.Body != nil {
  10399. res.Body.Close()
  10400. }
  10401. return nil, &googleapi.Error{
  10402. Code: res.StatusCode,
  10403. Header: res.Header,
  10404. }
  10405. }
  10406. if err != nil {
  10407. return nil, err
  10408. }
  10409. defer googleapi.CloseBody(res)
  10410. if err := googleapi.CheckResponse(res); err != nil {
  10411. return nil, err
  10412. }
  10413. ret := &AccountsListResponse{
  10414. ServerResponse: googleapi.ServerResponse{
  10415. Header: res.Header,
  10416. HTTPStatusCode: res.StatusCode,
  10417. },
  10418. }
  10419. target := &ret
  10420. if err := gensupport.DecodeResponse(target, res); err != nil {
  10421. return nil, err
  10422. }
  10423. return ret, nil
  10424. // {
  10425. // "description": "Lists the sub-accounts in your Merchant Center account.",
  10426. // "httpMethod": "GET",
  10427. // "id": "content.accounts.list",
  10428. // "parameterOrder": [
  10429. // "merchantId"
  10430. // ],
  10431. // "parameters": {
  10432. // "maxResults": {
  10433. // "description": "The maximum number of accounts to return in the response, used for paging.",
  10434. // "format": "uint32",
  10435. // "location": "query",
  10436. // "type": "integer"
  10437. // },
  10438. // "merchantId": {
  10439. // "description": "The ID of the managing account. This must be a multi-client account.",
  10440. // "format": "uint64",
  10441. // "location": "path",
  10442. // "required": true,
  10443. // "type": "string"
  10444. // },
  10445. // "pageToken": {
  10446. // "description": "The token returned by the previous request.",
  10447. // "location": "query",
  10448. // "type": "string"
  10449. // }
  10450. // },
  10451. // "path": "{merchantId}/accounts",
  10452. // "response": {
  10453. // "$ref": "AccountsListResponse"
  10454. // },
  10455. // "scopes": [
  10456. // "https://www.googleapis.com/auth/content"
  10457. // ]
  10458. // }
  10459. }
  10460. // Pages invokes f for each page of results.
  10461. // A non-nil error returned from f will halt the iteration.
  10462. // The provided context supersedes any context provided to the Context method.
  10463. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  10464. c.ctx_ = ctx
  10465. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10466. for {
  10467. x, err := c.Do()
  10468. if err != nil {
  10469. return err
  10470. }
  10471. if err := f(x); err != nil {
  10472. return err
  10473. }
  10474. if x.NextPageToken == "" {
  10475. return nil
  10476. }
  10477. c.PageToken(x.NextPageToken)
  10478. }
  10479. }
  10480. // method id "content.accounts.patch":
  10481. type AccountsPatchCall struct {
  10482. s *APIService
  10483. merchantId uint64
  10484. accountId uint64
  10485. account *Account
  10486. urlParams_ gensupport.URLParams
  10487. ctx_ context.Context
  10488. header_ http.Header
  10489. }
  10490. // Patch: Updates a Merchant Center account. This method supports patch
  10491. // semantics.
  10492. func (r *AccountsService) Patch(merchantId uint64, accountId uint64, account *Account) *AccountsPatchCall {
  10493. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10494. c.merchantId = merchantId
  10495. c.accountId = accountId
  10496. c.account = account
  10497. return c
  10498. }
  10499. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  10500. // request like in a live environment. If set to true, dry-run mode
  10501. // checks the validity of the request and returns errors (if any).
  10502. func (c *AccountsPatchCall) DryRun(dryRun bool) *AccountsPatchCall {
  10503. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  10504. return c
  10505. }
  10506. // Fields allows partial responses to be retrieved. See
  10507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10508. // for more information.
  10509. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  10510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10511. return c
  10512. }
  10513. // Context sets the context to be used in this call's Do method. Any
  10514. // pending HTTP request will be aborted if the provided context is
  10515. // canceled.
  10516. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  10517. c.ctx_ = ctx
  10518. return c
  10519. }
  10520. // Header returns an http.Header that can be modified by the caller to
  10521. // add HTTP headers to the request.
  10522. func (c *AccountsPatchCall) Header() http.Header {
  10523. if c.header_ == nil {
  10524. c.header_ = make(http.Header)
  10525. }
  10526. return c.header_
  10527. }
  10528. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  10529. reqHeaders := make(http.Header)
  10530. for k, v := range c.header_ {
  10531. reqHeaders[k] = v
  10532. }
  10533. reqHeaders.Set("User-Agent", c.s.userAgent())
  10534. var body io.Reader = nil
  10535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  10536. if err != nil {
  10537. return nil, err
  10538. }
  10539. reqHeaders.Set("Content-Type", "application/json")
  10540. c.urlParams_.Set("alt", alt)
  10541. c.urlParams_.Set("prettyPrint", "false")
  10542. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  10543. urls += "?" + c.urlParams_.Encode()
  10544. req, err := http.NewRequest("PATCH", urls, body)
  10545. if err != nil {
  10546. return nil, err
  10547. }
  10548. req.Header = reqHeaders
  10549. googleapi.Expand(req.URL, map[string]string{
  10550. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10551. "accountId": strconv.FormatUint(c.accountId, 10),
  10552. })
  10553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10554. }
  10555. // Do executes the "content.accounts.patch" call.
  10556. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  10557. // code is an error. Response headers are in either
  10558. // *Account.ServerResponse.Header or (if a response was returned at all)
  10559. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10560. // check whether the returned error was because http.StatusNotModified
  10561. // was returned.
  10562. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  10563. gensupport.SetOptions(c.urlParams_, opts...)
  10564. res, err := c.doRequest("json")
  10565. if res != nil && res.StatusCode == http.StatusNotModified {
  10566. if res.Body != nil {
  10567. res.Body.Close()
  10568. }
  10569. return nil, &googleapi.Error{
  10570. Code: res.StatusCode,
  10571. Header: res.Header,
  10572. }
  10573. }
  10574. if err != nil {
  10575. return nil, err
  10576. }
  10577. defer googleapi.CloseBody(res)
  10578. if err := googleapi.CheckResponse(res); err != nil {
  10579. return nil, err
  10580. }
  10581. ret := &Account{
  10582. ServerResponse: googleapi.ServerResponse{
  10583. Header: res.Header,
  10584. HTTPStatusCode: res.StatusCode,
  10585. },
  10586. }
  10587. target := &ret
  10588. if err := gensupport.DecodeResponse(target, res); err != nil {
  10589. return nil, err
  10590. }
  10591. return ret, nil
  10592. // {
  10593. // "description": "Updates a Merchant Center account. This method supports patch semantics.",
  10594. // "httpMethod": "PATCH",
  10595. // "id": "content.accounts.patch",
  10596. // "parameterOrder": [
  10597. // "merchantId",
  10598. // "accountId"
  10599. // ],
  10600. // "parameters": {
  10601. // "accountId": {
  10602. // "description": "The ID of the account.",
  10603. // "format": "uint64",
  10604. // "location": "path",
  10605. // "required": true,
  10606. // "type": "string"
  10607. // },
  10608. // "dryRun": {
  10609. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  10610. // "location": "query",
  10611. // "type": "boolean"
  10612. // },
  10613. // "merchantId": {
  10614. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  10615. // "format": "uint64",
  10616. // "location": "path",
  10617. // "required": true,
  10618. // "type": "string"
  10619. // }
  10620. // },
  10621. // "path": "{merchantId}/accounts/{accountId}",
  10622. // "request": {
  10623. // "$ref": "Account"
  10624. // },
  10625. // "response": {
  10626. // "$ref": "Account"
  10627. // },
  10628. // "scopes": [
  10629. // "https://www.googleapis.com/auth/content"
  10630. // ]
  10631. // }
  10632. }
  10633. // method id "content.accounts.update":
  10634. type AccountsUpdateCall struct {
  10635. s *APIService
  10636. merchantId uint64
  10637. accountId uint64
  10638. account *Account
  10639. urlParams_ gensupport.URLParams
  10640. ctx_ context.Context
  10641. header_ http.Header
  10642. }
  10643. // Update: Updates a Merchant Center account.
  10644. func (r *AccountsService) Update(merchantId uint64, accountId uint64, account *Account) *AccountsUpdateCall {
  10645. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10646. c.merchantId = merchantId
  10647. c.accountId = accountId
  10648. c.account = account
  10649. return c
  10650. }
  10651. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  10652. // request like in a live environment. If set to true, dry-run mode
  10653. // checks the validity of the request and returns errors (if any).
  10654. func (c *AccountsUpdateCall) DryRun(dryRun bool) *AccountsUpdateCall {
  10655. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  10656. return c
  10657. }
  10658. // Fields allows partial responses to be retrieved. See
  10659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10660. // for more information.
  10661. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  10662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10663. return c
  10664. }
  10665. // Context sets the context to be used in this call's Do method. Any
  10666. // pending HTTP request will be aborted if the provided context is
  10667. // canceled.
  10668. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  10669. c.ctx_ = ctx
  10670. return c
  10671. }
  10672. // Header returns an http.Header that can be modified by the caller to
  10673. // add HTTP headers to the request.
  10674. func (c *AccountsUpdateCall) Header() http.Header {
  10675. if c.header_ == nil {
  10676. c.header_ = make(http.Header)
  10677. }
  10678. return c.header_
  10679. }
  10680. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10681. reqHeaders := make(http.Header)
  10682. for k, v := range c.header_ {
  10683. reqHeaders[k] = v
  10684. }
  10685. reqHeaders.Set("User-Agent", c.s.userAgent())
  10686. var body io.Reader = nil
  10687. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  10688. if err != nil {
  10689. return nil, err
  10690. }
  10691. reqHeaders.Set("Content-Type", "application/json")
  10692. c.urlParams_.Set("alt", alt)
  10693. c.urlParams_.Set("prettyPrint", "false")
  10694. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounts/{accountId}")
  10695. urls += "?" + c.urlParams_.Encode()
  10696. req, err := http.NewRequest("PUT", urls, body)
  10697. if err != nil {
  10698. return nil, err
  10699. }
  10700. req.Header = reqHeaders
  10701. googleapi.Expand(req.URL, map[string]string{
  10702. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10703. "accountId": strconv.FormatUint(c.accountId, 10),
  10704. })
  10705. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10706. }
  10707. // Do executes the "content.accounts.update" call.
  10708. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  10709. // code is an error. Response headers are in either
  10710. // *Account.ServerResponse.Header or (if a response was returned at all)
  10711. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10712. // check whether the returned error was because http.StatusNotModified
  10713. // was returned.
  10714. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  10715. gensupport.SetOptions(c.urlParams_, opts...)
  10716. res, err := c.doRequest("json")
  10717. if res != nil && res.StatusCode == http.StatusNotModified {
  10718. if res.Body != nil {
  10719. res.Body.Close()
  10720. }
  10721. return nil, &googleapi.Error{
  10722. Code: res.StatusCode,
  10723. Header: res.Header,
  10724. }
  10725. }
  10726. if err != nil {
  10727. return nil, err
  10728. }
  10729. defer googleapi.CloseBody(res)
  10730. if err := googleapi.CheckResponse(res); err != nil {
  10731. return nil, err
  10732. }
  10733. ret := &Account{
  10734. ServerResponse: googleapi.ServerResponse{
  10735. Header: res.Header,
  10736. HTTPStatusCode: res.StatusCode,
  10737. },
  10738. }
  10739. target := &ret
  10740. if err := gensupport.DecodeResponse(target, res); err != nil {
  10741. return nil, err
  10742. }
  10743. return ret, nil
  10744. // {
  10745. // "description": "Updates a Merchant Center account.",
  10746. // "httpMethod": "PUT",
  10747. // "id": "content.accounts.update",
  10748. // "parameterOrder": [
  10749. // "merchantId",
  10750. // "accountId"
  10751. // ],
  10752. // "parameters": {
  10753. // "accountId": {
  10754. // "description": "The ID of the account.",
  10755. // "format": "uint64",
  10756. // "location": "path",
  10757. // "required": true,
  10758. // "type": "string"
  10759. // },
  10760. // "dryRun": {
  10761. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  10762. // "location": "query",
  10763. // "type": "boolean"
  10764. // },
  10765. // "merchantId": {
  10766. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  10767. // "format": "uint64",
  10768. // "location": "path",
  10769. // "required": true,
  10770. // "type": "string"
  10771. // }
  10772. // },
  10773. // "path": "{merchantId}/accounts/{accountId}",
  10774. // "request": {
  10775. // "$ref": "Account"
  10776. // },
  10777. // "response": {
  10778. // "$ref": "Account"
  10779. // },
  10780. // "scopes": [
  10781. // "https://www.googleapis.com/auth/content"
  10782. // ]
  10783. // }
  10784. }
  10785. // method id "content.accountstatuses.custombatch":
  10786. type AccountstatusesCustombatchCall struct {
  10787. s *APIService
  10788. accountstatusescustombatchrequest *AccountstatusesCustomBatchRequest
  10789. urlParams_ gensupport.URLParams
  10790. ctx_ context.Context
  10791. header_ http.Header
  10792. }
  10793. // Custombatch: Retrieves multiple Merchant Center account statuses in a
  10794. // single request.
  10795. func (r *AccountstatusesService) Custombatch(accountstatusescustombatchrequest *AccountstatusesCustomBatchRequest) *AccountstatusesCustombatchCall {
  10796. c := &AccountstatusesCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10797. c.accountstatusescustombatchrequest = accountstatusescustombatchrequest
  10798. return c
  10799. }
  10800. // Fields allows partial responses to be retrieved. See
  10801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10802. // for more information.
  10803. func (c *AccountstatusesCustombatchCall) Fields(s ...googleapi.Field) *AccountstatusesCustombatchCall {
  10804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10805. return c
  10806. }
  10807. // Context sets the context to be used in this call's Do method. Any
  10808. // pending HTTP request will be aborted if the provided context is
  10809. // canceled.
  10810. func (c *AccountstatusesCustombatchCall) Context(ctx context.Context) *AccountstatusesCustombatchCall {
  10811. c.ctx_ = ctx
  10812. return c
  10813. }
  10814. // Header returns an http.Header that can be modified by the caller to
  10815. // add HTTP headers to the request.
  10816. func (c *AccountstatusesCustombatchCall) Header() http.Header {
  10817. if c.header_ == nil {
  10818. c.header_ = make(http.Header)
  10819. }
  10820. return c.header_
  10821. }
  10822. func (c *AccountstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) {
  10823. reqHeaders := make(http.Header)
  10824. for k, v := range c.header_ {
  10825. reqHeaders[k] = v
  10826. }
  10827. reqHeaders.Set("User-Agent", c.s.userAgent())
  10828. var body io.Reader = nil
  10829. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountstatusescustombatchrequest)
  10830. if err != nil {
  10831. return nil, err
  10832. }
  10833. reqHeaders.Set("Content-Type", "application/json")
  10834. c.urlParams_.Set("alt", alt)
  10835. c.urlParams_.Set("prettyPrint", "false")
  10836. urls := googleapi.ResolveRelative(c.s.BasePath, "accountstatuses/batch")
  10837. urls += "?" + c.urlParams_.Encode()
  10838. req, err := http.NewRequest("POST", urls, body)
  10839. if err != nil {
  10840. return nil, err
  10841. }
  10842. req.Header = reqHeaders
  10843. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10844. }
  10845. // Do executes the "content.accountstatuses.custombatch" call.
  10846. // Exactly one of *AccountstatusesCustomBatchResponse or error will be
  10847. // non-nil. Any non-2xx status code is an error. Response headers are in
  10848. // either *AccountstatusesCustomBatchResponse.ServerResponse.Header or
  10849. // (if a response was returned at all) in
  10850. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  10851. // whether the returned error was because http.StatusNotModified was
  10852. // returned.
  10853. func (c *AccountstatusesCustombatchCall) Do(opts ...googleapi.CallOption) (*AccountstatusesCustomBatchResponse, error) {
  10854. gensupport.SetOptions(c.urlParams_, opts...)
  10855. res, err := c.doRequest("json")
  10856. if res != nil && res.StatusCode == http.StatusNotModified {
  10857. if res.Body != nil {
  10858. res.Body.Close()
  10859. }
  10860. return nil, &googleapi.Error{
  10861. Code: res.StatusCode,
  10862. Header: res.Header,
  10863. }
  10864. }
  10865. if err != nil {
  10866. return nil, err
  10867. }
  10868. defer googleapi.CloseBody(res)
  10869. if err := googleapi.CheckResponse(res); err != nil {
  10870. return nil, err
  10871. }
  10872. ret := &AccountstatusesCustomBatchResponse{
  10873. ServerResponse: googleapi.ServerResponse{
  10874. Header: res.Header,
  10875. HTTPStatusCode: res.StatusCode,
  10876. },
  10877. }
  10878. target := &ret
  10879. if err := gensupport.DecodeResponse(target, res); err != nil {
  10880. return nil, err
  10881. }
  10882. return ret, nil
  10883. // {
  10884. // "description": "Retrieves multiple Merchant Center account statuses in a single request.",
  10885. // "httpMethod": "POST",
  10886. // "id": "content.accountstatuses.custombatch",
  10887. // "path": "accountstatuses/batch",
  10888. // "request": {
  10889. // "$ref": "AccountstatusesCustomBatchRequest"
  10890. // },
  10891. // "response": {
  10892. // "$ref": "AccountstatusesCustomBatchResponse"
  10893. // },
  10894. // "scopes": [
  10895. // "https://www.googleapis.com/auth/content"
  10896. // ]
  10897. // }
  10898. }
  10899. // method id "content.accountstatuses.get":
  10900. type AccountstatusesGetCall struct {
  10901. s *APIService
  10902. merchantId uint64
  10903. accountId uint64
  10904. urlParams_ gensupport.URLParams
  10905. ifNoneMatch_ string
  10906. ctx_ context.Context
  10907. header_ http.Header
  10908. }
  10909. // Get: Retrieves the status of a Merchant Center account. No
  10910. // itemLevelIssues are returned for multi-client accounts.
  10911. func (r *AccountstatusesService) Get(merchantId uint64, accountId uint64) *AccountstatusesGetCall {
  10912. c := &AccountstatusesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10913. c.merchantId = merchantId
  10914. c.accountId = accountId
  10915. return c
  10916. }
  10917. // Destinations sets the optional parameter "destinations": If set, only
  10918. // issues for the specified destinations are returned, otherwise only
  10919. // issues for the Shopping destination.
  10920. func (c *AccountstatusesGetCall) Destinations(destinations ...string) *AccountstatusesGetCall {
  10921. c.urlParams_.SetMulti("destinations", append([]string{}, destinations...))
  10922. return c
  10923. }
  10924. // Fields allows partial responses to be retrieved. See
  10925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10926. // for more information.
  10927. func (c *AccountstatusesGetCall) Fields(s ...googleapi.Field) *AccountstatusesGetCall {
  10928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10929. return c
  10930. }
  10931. // IfNoneMatch sets the optional parameter which makes the operation
  10932. // fail if the object's ETag matches the given value. This is useful for
  10933. // getting updates only after the object has changed since the last
  10934. // request. Use googleapi.IsNotModified to check whether the response
  10935. // error from Do is the result of In-None-Match.
  10936. func (c *AccountstatusesGetCall) IfNoneMatch(entityTag string) *AccountstatusesGetCall {
  10937. c.ifNoneMatch_ = entityTag
  10938. return c
  10939. }
  10940. // Context sets the context to be used in this call's Do method. Any
  10941. // pending HTTP request will be aborted if the provided context is
  10942. // canceled.
  10943. func (c *AccountstatusesGetCall) Context(ctx context.Context) *AccountstatusesGetCall {
  10944. c.ctx_ = ctx
  10945. return c
  10946. }
  10947. // Header returns an http.Header that can be modified by the caller to
  10948. // add HTTP headers to the request.
  10949. func (c *AccountstatusesGetCall) Header() http.Header {
  10950. if c.header_ == nil {
  10951. c.header_ = make(http.Header)
  10952. }
  10953. return c.header_
  10954. }
  10955. func (c *AccountstatusesGetCall) doRequest(alt string) (*http.Response, error) {
  10956. reqHeaders := make(http.Header)
  10957. for k, v := range c.header_ {
  10958. reqHeaders[k] = v
  10959. }
  10960. reqHeaders.Set("User-Agent", c.s.userAgent())
  10961. if c.ifNoneMatch_ != "" {
  10962. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10963. }
  10964. var body io.Reader = nil
  10965. c.urlParams_.Set("alt", alt)
  10966. c.urlParams_.Set("prettyPrint", "false")
  10967. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses/{accountId}")
  10968. urls += "?" + c.urlParams_.Encode()
  10969. req, err := http.NewRequest("GET", urls, body)
  10970. if err != nil {
  10971. return nil, err
  10972. }
  10973. req.Header = reqHeaders
  10974. googleapi.Expand(req.URL, map[string]string{
  10975. "merchantId": strconv.FormatUint(c.merchantId, 10),
  10976. "accountId": strconv.FormatUint(c.accountId, 10),
  10977. })
  10978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10979. }
  10980. // Do executes the "content.accountstatuses.get" call.
  10981. // Exactly one of *AccountStatus or error will be non-nil. Any non-2xx
  10982. // status code is an error. Response headers are in either
  10983. // *AccountStatus.ServerResponse.Header or (if a response was returned
  10984. // at all) in error.(*googleapi.Error).Header. Use
  10985. // googleapi.IsNotModified to check whether the returned error was
  10986. // because http.StatusNotModified was returned.
  10987. func (c *AccountstatusesGetCall) Do(opts ...googleapi.CallOption) (*AccountStatus, error) {
  10988. gensupport.SetOptions(c.urlParams_, opts...)
  10989. res, err := c.doRequest("json")
  10990. if res != nil && res.StatusCode == http.StatusNotModified {
  10991. if res.Body != nil {
  10992. res.Body.Close()
  10993. }
  10994. return nil, &googleapi.Error{
  10995. Code: res.StatusCode,
  10996. Header: res.Header,
  10997. }
  10998. }
  10999. if err != nil {
  11000. return nil, err
  11001. }
  11002. defer googleapi.CloseBody(res)
  11003. if err := googleapi.CheckResponse(res); err != nil {
  11004. return nil, err
  11005. }
  11006. ret := &AccountStatus{
  11007. ServerResponse: googleapi.ServerResponse{
  11008. Header: res.Header,
  11009. HTTPStatusCode: res.StatusCode,
  11010. },
  11011. }
  11012. target := &ret
  11013. if err := gensupport.DecodeResponse(target, res); err != nil {
  11014. return nil, err
  11015. }
  11016. return ret, nil
  11017. // {
  11018. // "description": "Retrieves the status of a Merchant Center account. No itemLevelIssues are returned for multi-client accounts.",
  11019. // "httpMethod": "GET",
  11020. // "id": "content.accountstatuses.get",
  11021. // "parameterOrder": [
  11022. // "merchantId",
  11023. // "accountId"
  11024. // ],
  11025. // "parameters": {
  11026. // "accountId": {
  11027. // "description": "The ID of the account.",
  11028. // "format": "uint64",
  11029. // "location": "path",
  11030. // "required": true,
  11031. // "type": "string"
  11032. // },
  11033. // "destinations": {
  11034. // "description": "If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.",
  11035. // "location": "query",
  11036. // "repeated": true,
  11037. // "type": "string"
  11038. // },
  11039. // "merchantId": {
  11040. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  11041. // "format": "uint64",
  11042. // "location": "path",
  11043. // "required": true,
  11044. // "type": "string"
  11045. // }
  11046. // },
  11047. // "path": "{merchantId}/accountstatuses/{accountId}",
  11048. // "response": {
  11049. // "$ref": "AccountStatus"
  11050. // },
  11051. // "scopes": [
  11052. // "https://www.googleapis.com/auth/content"
  11053. // ]
  11054. // }
  11055. }
  11056. // method id "content.accountstatuses.list":
  11057. type AccountstatusesListCall struct {
  11058. s *APIService
  11059. merchantId uint64
  11060. urlParams_ gensupport.URLParams
  11061. ifNoneMatch_ string
  11062. ctx_ context.Context
  11063. header_ http.Header
  11064. }
  11065. // List: Lists the statuses of the sub-accounts in your Merchant Center
  11066. // account.
  11067. func (r *AccountstatusesService) List(merchantId uint64) *AccountstatusesListCall {
  11068. c := &AccountstatusesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11069. c.merchantId = merchantId
  11070. return c
  11071. }
  11072. // Destinations sets the optional parameter "destinations": If set, only
  11073. // issues for the specified destinations are returned, otherwise only
  11074. // issues for the Shopping destination.
  11075. func (c *AccountstatusesListCall) Destinations(destinations ...string) *AccountstatusesListCall {
  11076. c.urlParams_.SetMulti("destinations", append([]string{}, destinations...))
  11077. return c
  11078. }
  11079. // MaxResults sets the optional parameter "maxResults": The maximum
  11080. // number of account statuses to return in the response, used for
  11081. // paging.
  11082. func (c *AccountstatusesListCall) MaxResults(maxResults int64) *AccountstatusesListCall {
  11083. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11084. return c
  11085. }
  11086. // PageToken sets the optional parameter "pageToken": The token returned
  11087. // by the previous request.
  11088. func (c *AccountstatusesListCall) PageToken(pageToken string) *AccountstatusesListCall {
  11089. c.urlParams_.Set("pageToken", pageToken)
  11090. return c
  11091. }
  11092. // Fields allows partial responses to be retrieved. See
  11093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11094. // for more information.
  11095. func (c *AccountstatusesListCall) Fields(s ...googleapi.Field) *AccountstatusesListCall {
  11096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11097. return c
  11098. }
  11099. // IfNoneMatch sets the optional parameter which makes the operation
  11100. // fail if the object's ETag matches the given value. This is useful for
  11101. // getting updates only after the object has changed since the last
  11102. // request. Use googleapi.IsNotModified to check whether the response
  11103. // error from Do is the result of In-None-Match.
  11104. func (c *AccountstatusesListCall) IfNoneMatch(entityTag string) *AccountstatusesListCall {
  11105. c.ifNoneMatch_ = entityTag
  11106. return c
  11107. }
  11108. // Context sets the context to be used in this call's Do method. Any
  11109. // pending HTTP request will be aborted if the provided context is
  11110. // canceled.
  11111. func (c *AccountstatusesListCall) Context(ctx context.Context) *AccountstatusesListCall {
  11112. c.ctx_ = ctx
  11113. return c
  11114. }
  11115. // Header returns an http.Header that can be modified by the caller to
  11116. // add HTTP headers to the request.
  11117. func (c *AccountstatusesListCall) Header() http.Header {
  11118. if c.header_ == nil {
  11119. c.header_ = make(http.Header)
  11120. }
  11121. return c.header_
  11122. }
  11123. func (c *AccountstatusesListCall) doRequest(alt string) (*http.Response, error) {
  11124. reqHeaders := make(http.Header)
  11125. for k, v := range c.header_ {
  11126. reqHeaders[k] = v
  11127. }
  11128. reqHeaders.Set("User-Agent", c.s.userAgent())
  11129. if c.ifNoneMatch_ != "" {
  11130. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11131. }
  11132. var body io.Reader = nil
  11133. c.urlParams_.Set("alt", alt)
  11134. c.urlParams_.Set("prettyPrint", "false")
  11135. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accountstatuses")
  11136. urls += "?" + c.urlParams_.Encode()
  11137. req, err := http.NewRequest("GET", urls, body)
  11138. if err != nil {
  11139. return nil, err
  11140. }
  11141. req.Header = reqHeaders
  11142. googleapi.Expand(req.URL, map[string]string{
  11143. "merchantId": strconv.FormatUint(c.merchantId, 10),
  11144. })
  11145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11146. }
  11147. // Do executes the "content.accountstatuses.list" call.
  11148. // Exactly one of *AccountstatusesListResponse or error will be non-nil.
  11149. // Any non-2xx status code is an error. Response headers are in either
  11150. // *AccountstatusesListResponse.ServerResponse.Header or (if a response
  11151. // was returned at all) in error.(*googleapi.Error).Header. Use
  11152. // googleapi.IsNotModified to check whether the returned error was
  11153. // because http.StatusNotModified was returned.
  11154. func (c *AccountstatusesListCall) Do(opts ...googleapi.CallOption) (*AccountstatusesListResponse, error) {
  11155. gensupport.SetOptions(c.urlParams_, opts...)
  11156. res, err := c.doRequest("json")
  11157. if res != nil && res.StatusCode == http.StatusNotModified {
  11158. if res.Body != nil {
  11159. res.Body.Close()
  11160. }
  11161. return nil, &googleapi.Error{
  11162. Code: res.StatusCode,
  11163. Header: res.Header,
  11164. }
  11165. }
  11166. if err != nil {
  11167. return nil, err
  11168. }
  11169. defer googleapi.CloseBody(res)
  11170. if err := googleapi.CheckResponse(res); err != nil {
  11171. return nil, err
  11172. }
  11173. ret := &AccountstatusesListResponse{
  11174. ServerResponse: googleapi.ServerResponse{
  11175. Header: res.Header,
  11176. HTTPStatusCode: res.StatusCode,
  11177. },
  11178. }
  11179. target := &ret
  11180. if err := gensupport.DecodeResponse(target, res); err != nil {
  11181. return nil, err
  11182. }
  11183. return ret, nil
  11184. // {
  11185. // "description": "Lists the statuses of the sub-accounts in your Merchant Center account.",
  11186. // "httpMethod": "GET",
  11187. // "id": "content.accountstatuses.list",
  11188. // "parameterOrder": [
  11189. // "merchantId"
  11190. // ],
  11191. // "parameters": {
  11192. // "destinations": {
  11193. // "description": "If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.",
  11194. // "location": "query",
  11195. // "repeated": true,
  11196. // "type": "string"
  11197. // },
  11198. // "maxResults": {
  11199. // "description": "The maximum number of account statuses to return in the response, used for paging.",
  11200. // "format": "uint32",
  11201. // "location": "query",
  11202. // "type": "integer"
  11203. // },
  11204. // "merchantId": {
  11205. // "description": "The ID of the managing account. This must be a multi-client account.",
  11206. // "format": "uint64",
  11207. // "location": "path",
  11208. // "required": true,
  11209. // "type": "string"
  11210. // },
  11211. // "pageToken": {
  11212. // "description": "The token returned by the previous request.",
  11213. // "location": "query",
  11214. // "type": "string"
  11215. // }
  11216. // },
  11217. // "path": "{merchantId}/accountstatuses",
  11218. // "response": {
  11219. // "$ref": "AccountstatusesListResponse"
  11220. // },
  11221. // "scopes": [
  11222. // "https://www.googleapis.com/auth/content"
  11223. // ]
  11224. // }
  11225. }
  11226. // Pages invokes f for each page of results.
  11227. // A non-nil error returned from f will halt the iteration.
  11228. // The provided context supersedes any context provided to the Context method.
  11229. func (c *AccountstatusesListCall) Pages(ctx context.Context, f func(*AccountstatusesListResponse) error) error {
  11230. c.ctx_ = ctx
  11231. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11232. for {
  11233. x, err := c.Do()
  11234. if err != nil {
  11235. return err
  11236. }
  11237. if err := f(x); err != nil {
  11238. return err
  11239. }
  11240. if x.NextPageToken == "" {
  11241. return nil
  11242. }
  11243. c.PageToken(x.NextPageToken)
  11244. }
  11245. }
  11246. // method id "content.accounttax.custombatch":
  11247. type AccounttaxCustombatchCall struct {
  11248. s *APIService
  11249. accounttaxcustombatchrequest *AccounttaxCustomBatchRequest
  11250. urlParams_ gensupport.URLParams
  11251. ctx_ context.Context
  11252. header_ http.Header
  11253. }
  11254. // Custombatch: Retrieves and updates tax settings of multiple accounts
  11255. // in a single request.
  11256. func (r *AccounttaxService) Custombatch(accounttaxcustombatchrequest *AccounttaxCustomBatchRequest) *AccounttaxCustombatchCall {
  11257. c := &AccounttaxCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11258. c.accounttaxcustombatchrequest = accounttaxcustombatchrequest
  11259. return c
  11260. }
  11261. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  11262. // request like in a live environment. If set to true, dry-run mode
  11263. // checks the validity of the request and returns errors (if any).
  11264. func (c *AccounttaxCustombatchCall) DryRun(dryRun bool) *AccounttaxCustombatchCall {
  11265. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  11266. return c
  11267. }
  11268. // Fields allows partial responses to be retrieved. See
  11269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11270. // for more information.
  11271. func (c *AccounttaxCustombatchCall) Fields(s ...googleapi.Field) *AccounttaxCustombatchCall {
  11272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11273. return c
  11274. }
  11275. // Context sets the context to be used in this call's Do method. Any
  11276. // pending HTTP request will be aborted if the provided context is
  11277. // canceled.
  11278. func (c *AccounttaxCustombatchCall) Context(ctx context.Context) *AccounttaxCustombatchCall {
  11279. c.ctx_ = ctx
  11280. return c
  11281. }
  11282. // Header returns an http.Header that can be modified by the caller to
  11283. // add HTTP headers to the request.
  11284. func (c *AccounttaxCustombatchCall) Header() http.Header {
  11285. if c.header_ == nil {
  11286. c.header_ = make(http.Header)
  11287. }
  11288. return c.header_
  11289. }
  11290. func (c *AccounttaxCustombatchCall) doRequest(alt string) (*http.Response, error) {
  11291. reqHeaders := make(http.Header)
  11292. for k, v := range c.header_ {
  11293. reqHeaders[k] = v
  11294. }
  11295. reqHeaders.Set("User-Agent", c.s.userAgent())
  11296. var body io.Reader = nil
  11297. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttaxcustombatchrequest)
  11298. if err != nil {
  11299. return nil, err
  11300. }
  11301. reqHeaders.Set("Content-Type", "application/json")
  11302. c.urlParams_.Set("alt", alt)
  11303. c.urlParams_.Set("prettyPrint", "false")
  11304. urls := googleapi.ResolveRelative(c.s.BasePath, "accounttax/batch")
  11305. urls += "?" + c.urlParams_.Encode()
  11306. req, err := http.NewRequest("POST", urls, body)
  11307. if err != nil {
  11308. return nil, err
  11309. }
  11310. req.Header = reqHeaders
  11311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11312. }
  11313. // Do executes the "content.accounttax.custombatch" call.
  11314. // Exactly one of *AccounttaxCustomBatchResponse or error will be
  11315. // non-nil. Any non-2xx status code is an error. Response headers are in
  11316. // either *AccounttaxCustomBatchResponse.ServerResponse.Header or (if a
  11317. // response was returned at all) in error.(*googleapi.Error).Header. Use
  11318. // googleapi.IsNotModified to check whether the returned error was
  11319. // because http.StatusNotModified was returned.
  11320. func (c *AccounttaxCustombatchCall) Do(opts ...googleapi.CallOption) (*AccounttaxCustomBatchResponse, error) {
  11321. gensupport.SetOptions(c.urlParams_, opts...)
  11322. res, err := c.doRequest("json")
  11323. if res != nil && res.StatusCode == http.StatusNotModified {
  11324. if res.Body != nil {
  11325. res.Body.Close()
  11326. }
  11327. return nil, &googleapi.Error{
  11328. Code: res.StatusCode,
  11329. Header: res.Header,
  11330. }
  11331. }
  11332. if err != nil {
  11333. return nil, err
  11334. }
  11335. defer googleapi.CloseBody(res)
  11336. if err := googleapi.CheckResponse(res); err != nil {
  11337. return nil, err
  11338. }
  11339. ret := &AccounttaxCustomBatchResponse{
  11340. ServerResponse: googleapi.ServerResponse{
  11341. Header: res.Header,
  11342. HTTPStatusCode: res.StatusCode,
  11343. },
  11344. }
  11345. target := &ret
  11346. if err := gensupport.DecodeResponse(target, res); err != nil {
  11347. return nil, err
  11348. }
  11349. return ret, nil
  11350. // {
  11351. // "description": "Retrieves and updates tax settings of multiple accounts in a single request.",
  11352. // "httpMethod": "POST",
  11353. // "id": "content.accounttax.custombatch",
  11354. // "parameters": {
  11355. // "dryRun": {
  11356. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  11357. // "location": "query",
  11358. // "type": "boolean"
  11359. // }
  11360. // },
  11361. // "path": "accounttax/batch",
  11362. // "request": {
  11363. // "$ref": "AccounttaxCustomBatchRequest"
  11364. // },
  11365. // "response": {
  11366. // "$ref": "AccounttaxCustomBatchResponse"
  11367. // },
  11368. // "scopes": [
  11369. // "https://www.googleapis.com/auth/content"
  11370. // ]
  11371. // }
  11372. }
  11373. // method id "content.accounttax.get":
  11374. type AccounttaxGetCall struct {
  11375. s *APIService
  11376. merchantId uint64
  11377. accountId uint64
  11378. urlParams_ gensupport.URLParams
  11379. ifNoneMatch_ string
  11380. ctx_ context.Context
  11381. header_ http.Header
  11382. }
  11383. // Get: Retrieves the tax settings of the account.
  11384. func (r *AccounttaxService) Get(merchantId uint64, accountId uint64) *AccounttaxGetCall {
  11385. c := &AccounttaxGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11386. c.merchantId = merchantId
  11387. c.accountId = accountId
  11388. return c
  11389. }
  11390. // Fields allows partial responses to be retrieved. See
  11391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11392. // for more information.
  11393. func (c *AccounttaxGetCall) Fields(s ...googleapi.Field) *AccounttaxGetCall {
  11394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11395. return c
  11396. }
  11397. // IfNoneMatch sets the optional parameter which makes the operation
  11398. // fail if the object's ETag matches the given value. This is useful for
  11399. // getting updates only after the object has changed since the last
  11400. // request. Use googleapi.IsNotModified to check whether the response
  11401. // error from Do is the result of In-None-Match.
  11402. func (c *AccounttaxGetCall) IfNoneMatch(entityTag string) *AccounttaxGetCall {
  11403. c.ifNoneMatch_ = entityTag
  11404. return c
  11405. }
  11406. // Context sets the context to be used in this call's Do method. Any
  11407. // pending HTTP request will be aborted if the provided context is
  11408. // canceled.
  11409. func (c *AccounttaxGetCall) Context(ctx context.Context) *AccounttaxGetCall {
  11410. c.ctx_ = ctx
  11411. return c
  11412. }
  11413. // Header returns an http.Header that can be modified by the caller to
  11414. // add HTTP headers to the request.
  11415. func (c *AccounttaxGetCall) Header() http.Header {
  11416. if c.header_ == nil {
  11417. c.header_ = make(http.Header)
  11418. }
  11419. return c.header_
  11420. }
  11421. func (c *AccounttaxGetCall) doRequest(alt string) (*http.Response, error) {
  11422. reqHeaders := make(http.Header)
  11423. for k, v := range c.header_ {
  11424. reqHeaders[k] = v
  11425. }
  11426. reqHeaders.Set("User-Agent", c.s.userAgent())
  11427. if c.ifNoneMatch_ != "" {
  11428. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11429. }
  11430. var body io.Reader = nil
  11431. c.urlParams_.Set("alt", alt)
  11432. c.urlParams_.Set("prettyPrint", "false")
  11433. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}")
  11434. urls += "?" + c.urlParams_.Encode()
  11435. req, err := http.NewRequest("GET", urls, body)
  11436. if err != nil {
  11437. return nil, err
  11438. }
  11439. req.Header = reqHeaders
  11440. googleapi.Expand(req.URL, map[string]string{
  11441. "merchantId": strconv.FormatUint(c.merchantId, 10),
  11442. "accountId": strconv.FormatUint(c.accountId, 10),
  11443. })
  11444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11445. }
  11446. // Do executes the "content.accounttax.get" call.
  11447. // Exactly one of *AccountTax or error will be non-nil. Any non-2xx
  11448. // status code is an error. Response headers are in either
  11449. // *AccountTax.ServerResponse.Header or (if a response was returned at
  11450. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11451. // to check whether the returned error was because
  11452. // http.StatusNotModified was returned.
  11453. func (c *AccounttaxGetCall) Do(opts ...googleapi.CallOption) (*AccountTax, error) {
  11454. gensupport.SetOptions(c.urlParams_, opts...)
  11455. res, err := c.doRequest("json")
  11456. if res != nil && res.StatusCode == http.StatusNotModified {
  11457. if res.Body != nil {
  11458. res.Body.Close()
  11459. }
  11460. return nil, &googleapi.Error{
  11461. Code: res.StatusCode,
  11462. Header: res.Header,
  11463. }
  11464. }
  11465. if err != nil {
  11466. return nil, err
  11467. }
  11468. defer googleapi.CloseBody(res)
  11469. if err := googleapi.CheckResponse(res); err != nil {
  11470. return nil, err
  11471. }
  11472. ret := &AccountTax{
  11473. ServerResponse: googleapi.ServerResponse{
  11474. Header: res.Header,
  11475. HTTPStatusCode: res.StatusCode,
  11476. },
  11477. }
  11478. target := &ret
  11479. if err := gensupport.DecodeResponse(target, res); err != nil {
  11480. return nil, err
  11481. }
  11482. return ret, nil
  11483. // {
  11484. // "description": "Retrieves the tax settings of the account.",
  11485. // "httpMethod": "GET",
  11486. // "id": "content.accounttax.get",
  11487. // "parameterOrder": [
  11488. // "merchantId",
  11489. // "accountId"
  11490. // ],
  11491. // "parameters": {
  11492. // "accountId": {
  11493. // "description": "The ID of the account for which to get/update account tax settings.",
  11494. // "format": "uint64",
  11495. // "location": "path",
  11496. // "required": true,
  11497. // "type": "string"
  11498. // },
  11499. // "merchantId": {
  11500. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  11501. // "format": "uint64",
  11502. // "location": "path",
  11503. // "required": true,
  11504. // "type": "string"
  11505. // }
  11506. // },
  11507. // "path": "{merchantId}/accounttax/{accountId}",
  11508. // "response": {
  11509. // "$ref": "AccountTax"
  11510. // },
  11511. // "scopes": [
  11512. // "https://www.googleapis.com/auth/content"
  11513. // ]
  11514. // }
  11515. }
  11516. // method id "content.accounttax.list":
  11517. type AccounttaxListCall struct {
  11518. s *APIService
  11519. merchantId uint64
  11520. urlParams_ gensupport.URLParams
  11521. ifNoneMatch_ string
  11522. ctx_ context.Context
  11523. header_ http.Header
  11524. }
  11525. // List: Lists the tax settings of the sub-accounts in your Merchant
  11526. // Center account.
  11527. func (r *AccounttaxService) List(merchantId uint64) *AccounttaxListCall {
  11528. c := &AccounttaxListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11529. c.merchantId = merchantId
  11530. return c
  11531. }
  11532. // MaxResults sets the optional parameter "maxResults": The maximum
  11533. // number of tax settings to return in the response, used for paging.
  11534. func (c *AccounttaxListCall) MaxResults(maxResults int64) *AccounttaxListCall {
  11535. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11536. return c
  11537. }
  11538. // PageToken sets the optional parameter "pageToken": The token returned
  11539. // by the previous request.
  11540. func (c *AccounttaxListCall) PageToken(pageToken string) *AccounttaxListCall {
  11541. c.urlParams_.Set("pageToken", pageToken)
  11542. return c
  11543. }
  11544. // Fields allows partial responses to be retrieved. See
  11545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11546. // for more information.
  11547. func (c *AccounttaxListCall) Fields(s ...googleapi.Field) *AccounttaxListCall {
  11548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11549. return c
  11550. }
  11551. // IfNoneMatch sets the optional parameter which makes the operation
  11552. // fail if the object's ETag matches the given value. This is useful for
  11553. // getting updates only after the object has changed since the last
  11554. // request. Use googleapi.IsNotModified to check whether the response
  11555. // error from Do is the result of In-None-Match.
  11556. func (c *AccounttaxListCall) IfNoneMatch(entityTag string) *AccounttaxListCall {
  11557. c.ifNoneMatch_ = entityTag
  11558. return c
  11559. }
  11560. // Context sets the context to be used in this call's Do method. Any
  11561. // pending HTTP request will be aborted if the provided context is
  11562. // canceled.
  11563. func (c *AccounttaxListCall) Context(ctx context.Context) *AccounttaxListCall {
  11564. c.ctx_ = ctx
  11565. return c
  11566. }
  11567. // Header returns an http.Header that can be modified by the caller to
  11568. // add HTTP headers to the request.
  11569. func (c *AccounttaxListCall) Header() http.Header {
  11570. if c.header_ == nil {
  11571. c.header_ = make(http.Header)
  11572. }
  11573. return c.header_
  11574. }
  11575. func (c *AccounttaxListCall) doRequest(alt string) (*http.Response, error) {
  11576. reqHeaders := make(http.Header)
  11577. for k, v := range c.header_ {
  11578. reqHeaders[k] = v
  11579. }
  11580. reqHeaders.Set("User-Agent", c.s.userAgent())
  11581. if c.ifNoneMatch_ != "" {
  11582. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11583. }
  11584. var body io.Reader = nil
  11585. c.urlParams_.Set("alt", alt)
  11586. c.urlParams_.Set("prettyPrint", "false")
  11587. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax")
  11588. urls += "?" + c.urlParams_.Encode()
  11589. req, err := http.NewRequest("GET", urls, body)
  11590. if err != nil {
  11591. return nil, err
  11592. }
  11593. req.Header = reqHeaders
  11594. googleapi.Expand(req.URL, map[string]string{
  11595. "merchantId": strconv.FormatUint(c.merchantId, 10),
  11596. })
  11597. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11598. }
  11599. // Do executes the "content.accounttax.list" call.
  11600. // Exactly one of *AccounttaxListResponse or error will be non-nil. Any
  11601. // non-2xx status code is an error. Response headers are in either
  11602. // *AccounttaxListResponse.ServerResponse.Header or (if a response was
  11603. // returned at all) in error.(*googleapi.Error).Header. Use
  11604. // googleapi.IsNotModified to check whether the returned error was
  11605. // because http.StatusNotModified was returned.
  11606. func (c *AccounttaxListCall) Do(opts ...googleapi.CallOption) (*AccounttaxListResponse, error) {
  11607. gensupport.SetOptions(c.urlParams_, opts...)
  11608. res, err := c.doRequest("json")
  11609. if res != nil && res.StatusCode == http.StatusNotModified {
  11610. if res.Body != nil {
  11611. res.Body.Close()
  11612. }
  11613. return nil, &googleapi.Error{
  11614. Code: res.StatusCode,
  11615. Header: res.Header,
  11616. }
  11617. }
  11618. if err != nil {
  11619. return nil, err
  11620. }
  11621. defer googleapi.CloseBody(res)
  11622. if err := googleapi.CheckResponse(res); err != nil {
  11623. return nil, err
  11624. }
  11625. ret := &AccounttaxListResponse{
  11626. ServerResponse: googleapi.ServerResponse{
  11627. Header: res.Header,
  11628. HTTPStatusCode: res.StatusCode,
  11629. },
  11630. }
  11631. target := &ret
  11632. if err := gensupport.DecodeResponse(target, res); err != nil {
  11633. return nil, err
  11634. }
  11635. return ret, nil
  11636. // {
  11637. // "description": "Lists the tax settings of the sub-accounts in your Merchant Center account.",
  11638. // "httpMethod": "GET",
  11639. // "id": "content.accounttax.list",
  11640. // "parameterOrder": [
  11641. // "merchantId"
  11642. // ],
  11643. // "parameters": {
  11644. // "maxResults": {
  11645. // "description": "The maximum number of tax settings to return in the response, used for paging.",
  11646. // "format": "uint32",
  11647. // "location": "query",
  11648. // "type": "integer"
  11649. // },
  11650. // "merchantId": {
  11651. // "description": "The ID of the managing account. This must be a multi-client account.",
  11652. // "format": "uint64",
  11653. // "location": "path",
  11654. // "required": true,
  11655. // "type": "string"
  11656. // },
  11657. // "pageToken": {
  11658. // "description": "The token returned by the previous request.",
  11659. // "location": "query",
  11660. // "type": "string"
  11661. // }
  11662. // },
  11663. // "path": "{merchantId}/accounttax",
  11664. // "response": {
  11665. // "$ref": "AccounttaxListResponse"
  11666. // },
  11667. // "scopes": [
  11668. // "https://www.googleapis.com/auth/content"
  11669. // ]
  11670. // }
  11671. }
  11672. // Pages invokes f for each page of results.
  11673. // A non-nil error returned from f will halt the iteration.
  11674. // The provided context supersedes any context provided to the Context method.
  11675. func (c *AccounttaxListCall) Pages(ctx context.Context, f func(*AccounttaxListResponse) error) error {
  11676. c.ctx_ = ctx
  11677. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11678. for {
  11679. x, err := c.Do()
  11680. if err != nil {
  11681. return err
  11682. }
  11683. if err := f(x); err != nil {
  11684. return err
  11685. }
  11686. if x.NextPageToken == "" {
  11687. return nil
  11688. }
  11689. c.PageToken(x.NextPageToken)
  11690. }
  11691. }
  11692. // method id "content.accounttax.patch":
  11693. type AccounttaxPatchCall struct {
  11694. s *APIService
  11695. merchantId uint64
  11696. accountId uint64
  11697. accounttax *AccountTax
  11698. urlParams_ gensupport.URLParams
  11699. ctx_ context.Context
  11700. header_ http.Header
  11701. }
  11702. // Patch: Updates the tax settings of the account. This method supports
  11703. // patch semantics.
  11704. func (r *AccounttaxService) Patch(merchantId uint64, accountId uint64, accounttax *AccountTax) *AccounttaxPatchCall {
  11705. c := &AccounttaxPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11706. c.merchantId = merchantId
  11707. c.accountId = accountId
  11708. c.accounttax = accounttax
  11709. return c
  11710. }
  11711. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  11712. // request like in a live environment. If set to true, dry-run mode
  11713. // checks the validity of the request and returns errors (if any).
  11714. func (c *AccounttaxPatchCall) DryRun(dryRun bool) *AccounttaxPatchCall {
  11715. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  11716. return c
  11717. }
  11718. // Fields allows partial responses to be retrieved. See
  11719. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11720. // for more information.
  11721. func (c *AccounttaxPatchCall) Fields(s ...googleapi.Field) *AccounttaxPatchCall {
  11722. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11723. return c
  11724. }
  11725. // Context sets the context to be used in this call's Do method. Any
  11726. // pending HTTP request will be aborted if the provided context is
  11727. // canceled.
  11728. func (c *AccounttaxPatchCall) Context(ctx context.Context) *AccounttaxPatchCall {
  11729. c.ctx_ = ctx
  11730. return c
  11731. }
  11732. // Header returns an http.Header that can be modified by the caller to
  11733. // add HTTP headers to the request.
  11734. func (c *AccounttaxPatchCall) Header() http.Header {
  11735. if c.header_ == nil {
  11736. c.header_ = make(http.Header)
  11737. }
  11738. return c.header_
  11739. }
  11740. func (c *AccounttaxPatchCall) doRequest(alt string) (*http.Response, error) {
  11741. reqHeaders := make(http.Header)
  11742. for k, v := range c.header_ {
  11743. reqHeaders[k] = v
  11744. }
  11745. reqHeaders.Set("User-Agent", c.s.userAgent())
  11746. var body io.Reader = nil
  11747. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax)
  11748. if err != nil {
  11749. return nil, err
  11750. }
  11751. reqHeaders.Set("Content-Type", "application/json")
  11752. c.urlParams_.Set("alt", alt)
  11753. c.urlParams_.Set("prettyPrint", "false")
  11754. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}")
  11755. urls += "?" + c.urlParams_.Encode()
  11756. req, err := http.NewRequest("PATCH", urls, body)
  11757. if err != nil {
  11758. return nil, err
  11759. }
  11760. req.Header = reqHeaders
  11761. googleapi.Expand(req.URL, map[string]string{
  11762. "merchantId": strconv.FormatUint(c.merchantId, 10),
  11763. "accountId": strconv.FormatUint(c.accountId, 10),
  11764. })
  11765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11766. }
  11767. // Do executes the "content.accounttax.patch" call.
  11768. // Exactly one of *AccountTax or error will be non-nil. Any non-2xx
  11769. // status code is an error. Response headers are in either
  11770. // *AccountTax.ServerResponse.Header or (if a response was returned at
  11771. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11772. // to check whether the returned error was because
  11773. // http.StatusNotModified was returned.
  11774. func (c *AccounttaxPatchCall) Do(opts ...googleapi.CallOption) (*AccountTax, error) {
  11775. gensupport.SetOptions(c.urlParams_, opts...)
  11776. res, err := c.doRequest("json")
  11777. if res != nil && res.StatusCode == http.StatusNotModified {
  11778. if res.Body != nil {
  11779. res.Body.Close()
  11780. }
  11781. return nil, &googleapi.Error{
  11782. Code: res.StatusCode,
  11783. Header: res.Header,
  11784. }
  11785. }
  11786. if err != nil {
  11787. return nil, err
  11788. }
  11789. defer googleapi.CloseBody(res)
  11790. if err := googleapi.CheckResponse(res); err != nil {
  11791. return nil, err
  11792. }
  11793. ret := &AccountTax{
  11794. ServerResponse: googleapi.ServerResponse{
  11795. Header: res.Header,
  11796. HTTPStatusCode: res.StatusCode,
  11797. },
  11798. }
  11799. target := &ret
  11800. if err := gensupport.DecodeResponse(target, res); err != nil {
  11801. return nil, err
  11802. }
  11803. return ret, nil
  11804. // {
  11805. // "description": "Updates the tax settings of the account. This method supports patch semantics.",
  11806. // "httpMethod": "PATCH",
  11807. // "id": "content.accounttax.patch",
  11808. // "parameterOrder": [
  11809. // "merchantId",
  11810. // "accountId"
  11811. // ],
  11812. // "parameters": {
  11813. // "accountId": {
  11814. // "description": "The ID of the account for which to get/update account tax settings.",
  11815. // "format": "uint64",
  11816. // "location": "path",
  11817. // "required": true,
  11818. // "type": "string"
  11819. // },
  11820. // "dryRun": {
  11821. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  11822. // "location": "query",
  11823. // "type": "boolean"
  11824. // },
  11825. // "merchantId": {
  11826. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  11827. // "format": "uint64",
  11828. // "location": "path",
  11829. // "required": true,
  11830. // "type": "string"
  11831. // }
  11832. // },
  11833. // "path": "{merchantId}/accounttax/{accountId}",
  11834. // "request": {
  11835. // "$ref": "AccountTax"
  11836. // },
  11837. // "response": {
  11838. // "$ref": "AccountTax"
  11839. // },
  11840. // "scopes": [
  11841. // "https://www.googleapis.com/auth/content"
  11842. // ]
  11843. // }
  11844. }
  11845. // method id "content.accounttax.update":
  11846. type AccounttaxUpdateCall struct {
  11847. s *APIService
  11848. merchantId uint64
  11849. accountId uint64
  11850. accounttax *AccountTax
  11851. urlParams_ gensupport.URLParams
  11852. ctx_ context.Context
  11853. header_ http.Header
  11854. }
  11855. // Update: Updates the tax settings of the account.
  11856. func (r *AccounttaxService) Update(merchantId uint64, accountId uint64, accounttax *AccountTax) *AccounttaxUpdateCall {
  11857. c := &AccounttaxUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11858. c.merchantId = merchantId
  11859. c.accountId = accountId
  11860. c.accounttax = accounttax
  11861. return c
  11862. }
  11863. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  11864. // request like in a live environment. If set to true, dry-run mode
  11865. // checks the validity of the request and returns errors (if any).
  11866. func (c *AccounttaxUpdateCall) DryRun(dryRun bool) *AccounttaxUpdateCall {
  11867. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  11868. return c
  11869. }
  11870. // Fields allows partial responses to be retrieved. See
  11871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11872. // for more information.
  11873. func (c *AccounttaxUpdateCall) Fields(s ...googleapi.Field) *AccounttaxUpdateCall {
  11874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11875. return c
  11876. }
  11877. // Context sets the context to be used in this call's Do method. Any
  11878. // pending HTTP request will be aborted if the provided context is
  11879. // canceled.
  11880. func (c *AccounttaxUpdateCall) Context(ctx context.Context) *AccounttaxUpdateCall {
  11881. c.ctx_ = ctx
  11882. return c
  11883. }
  11884. // Header returns an http.Header that can be modified by the caller to
  11885. // add HTTP headers to the request.
  11886. func (c *AccounttaxUpdateCall) Header() http.Header {
  11887. if c.header_ == nil {
  11888. c.header_ = make(http.Header)
  11889. }
  11890. return c.header_
  11891. }
  11892. func (c *AccounttaxUpdateCall) doRequest(alt string) (*http.Response, error) {
  11893. reqHeaders := make(http.Header)
  11894. for k, v := range c.header_ {
  11895. reqHeaders[k] = v
  11896. }
  11897. reqHeaders.Set("User-Agent", c.s.userAgent())
  11898. var body io.Reader = nil
  11899. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accounttax)
  11900. if err != nil {
  11901. return nil, err
  11902. }
  11903. reqHeaders.Set("Content-Type", "application/json")
  11904. c.urlParams_.Set("alt", alt)
  11905. c.urlParams_.Set("prettyPrint", "false")
  11906. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/accounttax/{accountId}")
  11907. urls += "?" + c.urlParams_.Encode()
  11908. req, err := http.NewRequest("PUT", urls, body)
  11909. if err != nil {
  11910. return nil, err
  11911. }
  11912. req.Header = reqHeaders
  11913. googleapi.Expand(req.URL, map[string]string{
  11914. "merchantId": strconv.FormatUint(c.merchantId, 10),
  11915. "accountId": strconv.FormatUint(c.accountId, 10),
  11916. })
  11917. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11918. }
  11919. // Do executes the "content.accounttax.update" call.
  11920. // Exactly one of *AccountTax or error will be non-nil. Any non-2xx
  11921. // status code is an error. Response headers are in either
  11922. // *AccountTax.ServerResponse.Header or (if a response was returned at
  11923. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11924. // to check whether the returned error was because
  11925. // http.StatusNotModified was returned.
  11926. func (c *AccounttaxUpdateCall) Do(opts ...googleapi.CallOption) (*AccountTax, error) {
  11927. gensupport.SetOptions(c.urlParams_, opts...)
  11928. res, err := c.doRequest("json")
  11929. if res != nil && res.StatusCode == http.StatusNotModified {
  11930. if res.Body != nil {
  11931. res.Body.Close()
  11932. }
  11933. return nil, &googleapi.Error{
  11934. Code: res.StatusCode,
  11935. Header: res.Header,
  11936. }
  11937. }
  11938. if err != nil {
  11939. return nil, err
  11940. }
  11941. defer googleapi.CloseBody(res)
  11942. if err := googleapi.CheckResponse(res); err != nil {
  11943. return nil, err
  11944. }
  11945. ret := &AccountTax{
  11946. ServerResponse: googleapi.ServerResponse{
  11947. Header: res.Header,
  11948. HTTPStatusCode: res.StatusCode,
  11949. },
  11950. }
  11951. target := &ret
  11952. if err := gensupport.DecodeResponse(target, res); err != nil {
  11953. return nil, err
  11954. }
  11955. return ret, nil
  11956. // {
  11957. // "description": "Updates the tax settings of the account.",
  11958. // "httpMethod": "PUT",
  11959. // "id": "content.accounttax.update",
  11960. // "parameterOrder": [
  11961. // "merchantId",
  11962. // "accountId"
  11963. // ],
  11964. // "parameters": {
  11965. // "accountId": {
  11966. // "description": "The ID of the account for which to get/update account tax settings.",
  11967. // "format": "uint64",
  11968. // "location": "path",
  11969. // "required": true,
  11970. // "type": "string"
  11971. // },
  11972. // "dryRun": {
  11973. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  11974. // "location": "query",
  11975. // "type": "boolean"
  11976. // },
  11977. // "merchantId": {
  11978. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  11979. // "format": "uint64",
  11980. // "location": "path",
  11981. // "required": true,
  11982. // "type": "string"
  11983. // }
  11984. // },
  11985. // "path": "{merchantId}/accounttax/{accountId}",
  11986. // "request": {
  11987. // "$ref": "AccountTax"
  11988. // },
  11989. // "response": {
  11990. // "$ref": "AccountTax"
  11991. // },
  11992. // "scopes": [
  11993. // "https://www.googleapis.com/auth/content"
  11994. // ]
  11995. // }
  11996. }
  11997. // method id "content.datafeeds.custombatch":
  11998. type DatafeedsCustombatchCall struct {
  11999. s *APIService
  12000. datafeedscustombatchrequest *DatafeedsCustomBatchRequest
  12001. urlParams_ gensupport.URLParams
  12002. ctx_ context.Context
  12003. header_ http.Header
  12004. }
  12005. // Custombatch:
  12006. func (r *DatafeedsService) Custombatch(datafeedscustombatchrequest *DatafeedsCustomBatchRequest) *DatafeedsCustombatchCall {
  12007. c := &DatafeedsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12008. c.datafeedscustombatchrequest = datafeedscustombatchrequest
  12009. return c
  12010. }
  12011. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  12012. // request like in a live environment. If set to true, dry-run mode
  12013. // checks the validity of the request and returns errors (if any).
  12014. func (c *DatafeedsCustombatchCall) DryRun(dryRun bool) *DatafeedsCustombatchCall {
  12015. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  12016. return c
  12017. }
  12018. // Fields allows partial responses to be retrieved. See
  12019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12020. // for more information.
  12021. func (c *DatafeedsCustombatchCall) Fields(s ...googleapi.Field) *DatafeedsCustombatchCall {
  12022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12023. return c
  12024. }
  12025. // Context sets the context to be used in this call's Do method. Any
  12026. // pending HTTP request will be aborted if the provided context is
  12027. // canceled.
  12028. func (c *DatafeedsCustombatchCall) Context(ctx context.Context) *DatafeedsCustombatchCall {
  12029. c.ctx_ = ctx
  12030. return c
  12031. }
  12032. // Header returns an http.Header that can be modified by the caller to
  12033. // add HTTP headers to the request.
  12034. func (c *DatafeedsCustombatchCall) Header() http.Header {
  12035. if c.header_ == nil {
  12036. c.header_ = make(http.Header)
  12037. }
  12038. return c.header_
  12039. }
  12040. func (c *DatafeedsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  12041. reqHeaders := make(http.Header)
  12042. for k, v := range c.header_ {
  12043. reqHeaders[k] = v
  12044. }
  12045. reqHeaders.Set("User-Agent", c.s.userAgent())
  12046. var body io.Reader = nil
  12047. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedscustombatchrequest)
  12048. if err != nil {
  12049. return nil, err
  12050. }
  12051. reqHeaders.Set("Content-Type", "application/json")
  12052. c.urlParams_.Set("alt", alt)
  12053. c.urlParams_.Set("prettyPrint", "false")
  12054. urls := googleapi.ResolveRelative(c.s.BasePath, "datafeeds/batch")
  12055. urls += "?" + c.urlParams_.Encode()
  12056. req, err := http.NewRequest("POST", urls, body)
  12057. if err != nil {
  12058. return nil, err
  12059. }
  12060. req.Header = reqHeaders
  12061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12062. }
  12063. // Do executes the "content.datafeeds.custombatch" call.
  12064. // Exactly one of *DatafeedsCustomBatchResponse or error will be
  12065. // non-nil. Any non-2xx status code is an error. Response headers are in
  12066. // either *DatafeedsCustomBatchResponse.ServerResponse.Header or (if a
  12067. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12068. // googleapi.IsNotModified to check whether the returned error was
  12069. // because http.StatusNotModified was returned.
  12070. func (c *DatafeedsCustombatchCall) Do(opts ...googleapi.CallOption) (*DatafeedsCustomBatchResponse, error) {
  12071. gensupport.SetOptions(c.urlParams_, opts...)
  12072. res, err := c.doRequest("json")
  12073. if res != nil && res.StatusCode == http.StatusNotModified {
  12074. if res.Body != nil {
  12075. res.Body.Close()
  12076. }
  12077. return nil, &googleapi.Error{
  12078. Code: res.StatusCode,
  12079. Header: res.Header,
  12080. }
  12081. }
  12082. if err != nil {
  12083. return nil, err
  12084. }
  12085. defer googleapi.CloseBody(res)
  12086. if err := googleapi.CheckResponse(res); err != nil {
  12087. return nil, err
  12088. }
  12089. ret := &DatafeedsCustomBatchResponse{
  12090. ServerResponse: googleapi.ServerResponse{
  12091. Header: res.Header,
  12092. HTTPStatusCode: res.StatusCode,
  12093. },
  12094. }
  12095. target := &ret
  12096. if err := gensupport.DecodeResponse(target, res); err != nil {
  12097. return nil, err
  12098. }
  12099. return ret, nil
  12100. // {
  12101. // "httpMethod": "POST",
  12102. // "id": "content.datafeeds.custombatch",
  12103. // "parameters": {
  12104. // "dryRun": {
  12105. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  12106. // "location": "query",
  12107. // "type": "boolean"
  12108. // }
  12109. // },
  12110. // "path": "datafeeds/batch",
  12111. // "request": {
  12112. // "$ref": "DatafeedsCustomBatchRequest"
  12113. // },
  12114. // "response": {
  12115. // "$ref": "DatafeedsCustomBatchResponse"
  12116. // },
  12117. // "scopes": [
  12118. // "https://www.googleapis.com/auth/content"
  12119. // ]
  12120. // }
  12121. }
  12122. // method id "content.datafeeds.delete":
  12123. type DatafeedsDeleteCall struct {
  12124. s *APIService
  12125. merchantId uint64
  12126. datafeedId uint64
  12127. urlParams_ gensupport.URLParams
  12128. ctx_ context.Context
  12129. header_ http.Header
  12130. }
  12131. // Delete: Deletes a datafeed configuration from your Merchant Center
  12132. // account.
  12133. func (r *DatafeedsService) Delete(merchantId uint64, datafeedId uint64) *DatafeedsDeleteCall {
  12134. c := &DatafeedsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12135. c.merchantId = merchantId
  12136. c.datafeedId = datafeedId
  12137. return c
  12138. }
  12139. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  12140. // request like in a live environment. If set to true, dry-run mode
  12141. // checks the validity of the request and returns errors (if any).
  12142. func (c *DatafeedsDeleteCall) DryRun(dryRun bool) *DatafeedsDeleteCall {
  12143. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  12144. return c
  12145. }
  12146. // Fields allows partial responses to be retrieved. See
  12147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12148. // for more information.
  12149. func (c *DatafeedsDeleteCall) Fields(s ...googleapi.Field) *DatafeedsDeleteCall {
  12150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12151. return c
  12152. }
  12153. // Context sets the context to be used in this call's Do method. Any
  12154. // pending HTTP request will be aborted if the provided context is
  12155. // canceled.
  12156. func (c *DatafeedsDeleteCall) Context(ctx context.Context) *DatafeedsDeleteCall {
  12157. c.ctx_ = ctx
  12158. return c
  12159. }
  12160. // Header returns an http.Header that can be modified by the caller to
  12161. // add HTTP headers to the request.
  12162. func (c *DatafeedsDeleteCall) Header() http.Header {
  12163. if c.header_ == nil {
  12164. c.header_ = make(http.Header)
  12165. }
  12166. return c.header_
  12167. }
  12168. func (c *DatafeedsDeleteCall) doRequest(alt string) (*http.Response, error) {
  12169. reqHeaders := make(http.Header)
  12170. for k, v := range c.header_ {
  12171. reqHeaders[k] = v
  12172. }
  12173. reqHeaders.Set("User-Agent", c.s.userAgent())
  12174. var body io.Reader = nil
  12175. c.urlParams_.Set("alt", alt)
  12176. c.urlParams_.Set("prettyPrint", "false")
  12177. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  12178. urls += "?" + c.urlParams_.Encode()
  12179. req, err := http.NewRequest("DELETE", urls, body)
  12180. if err != nil {
  12181. return nil, err
  12182. }
  12183. req.Header = reqHeaders
  12184. googleapi.Expand(req.URL, map[string]string{
  12185. "merchantId": strconv.FormatUint(c.merchantId, 10),
  12186. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  12187. })
  12188. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12189. }
  12190. // Do executes the "content.datafeeds.delete" call.
  12191. func (c *DatafeedsDeleteCall) Do(opts ...googleapi.CallOption) error {
  12192. gensupport.SetOptions(c.urlParams_, opts...)
  12193. res, err := c.doRequest("json")
  12194. if err != nil {
  12195. return err
  12196. }
  12197. defer googleapi.CloseBody(res)
  12198. if err := googleapi.CheckResponse(res); err != nil {
  12199. return err
  12200. }
  12201. return nil
  12202. // {
  12203. // "description": "Deletes a datafeed configuration from your Merchant Center account.",
  12204. // "httpMethod": "DELETE",
  12205. // "id": "content.datafeeds.delete",
  12206. // "parameterOrder": [
  12207. // "merchantId",
  12208. // "datafeedId"
  12209. // ],
  12210. // "parameters": {
  12211. // "datafeedId": {
  12212. // "description": "The ID of the datafeed.",
  12213. // "format": "uint64",
  12214. // "location": "path",
  12215. // "required": true,
  12216. // "type": "string"
  12217. // },
  12218. // "dryRun": {
  12219. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  12220. // "location": "query",
  12221. // "type": "boolean"
  12222. // },
  12223. // "merchantId": {
  12224. // "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.",
  12225. // "format": "uint64",
  12226. // "location": "path",
  12227. // "required": true,
  12228. // "type": "string"
  12229. // }
  12230. // },
  12231. // "path": "{merchantId}/datafeeds/{datafeedId}",
  12232. // "scopes": [
  12233. // "https://www.googleapis.com/auth/content"
  12234. // ]
  12235. // }
  12236. }
  12237. // method id "content.datafeeds.fetchnow":
  12238. type DatafeedsFetchnowCall struct {
  12239. s *APIService
  12240. merchantId uint64
  12241. datafeedId uint64
  12242. urlParams_ gensupport.URLParams
  12243. ctx_ context.Context
  12244. header_ http.Header
  12245. }
  12246. // Fetchnow: Invokes a fetch for the datafeed in your Merchant Center
  12247. // account.
  12248. func (r *DatafeedsService) Fetchnow(merchantId uint64, datafeedId uint64) *DatafeedsFetchnowCall {
  12249. c := &DatafeedsFetchnowCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12250. c.merchantId = merchantId
  12251. c.datafeedId = datafeedId
  12252. return c
  12253. }
  12254. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  12255. // request like in a live environment. If set to true, dry-run mode
  12256. // checks the validity of the request and returns errors (if any).
  12257. func (c *DatafeedsFetchnowCall) DryRun(dryRun bool) *DatafeedsFetchnowCall {
  12258. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  12259. return c
  12260. }
  12261. // Fields allows partial responses to be retrieved. See
  12262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12263. // for more information.
  12264. func (c *DatafeedsFetchnowCall) Fields(s ...googleapi.Field) *DatafeedsFetchnowCall {
  12265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12266. return c
  12267. }
  12268. // Context sets the context to be used in this call's Do method. Any
  12269. // pending HTTP request will be aborted if the provided context is
  12270. // canceled.
  12271. func (c *DatafeedsFetchnowCall) Context(ctx context.Context) *DatafeedsFetchnowCall {
  12272. c.ctx_ = ctx
  12273. return c
  12274. }
  12275. // Header returns an http.Header that can be modified by the caller to
  12276. // add HTTP headers to the request.
  12277. func (c *DatafeedsFetchnowCall) Header() http.Header {
  12278. if c.header_ == nil {
  12279. c.header_ = make(http.Header)
  12280. }
  12281. return c.header_
  12282. }
  12283. func (c *DatafeedsFetchnowCall) doRequest(alt string) (*http.Response, error) {
  12284. reqHeaders := make(http.Header)
  12285. for k, v := range c.header_ {
  12286. reqHeaders[k] = v
  12287. }
  12288. reqHeaders.Set("User-Agent", c.s.userAgent())
  12289. var body io.Reader = nil
  12290. c.urlParams_.Set("alt", alt)
  12291. c.urlParams_.Set("prettyPrint", "false")
  12292. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}/fetchNow")
  12293. urls += "?" + c.urlParams_.Encode()
  12294. req, err := http.NewRequest("POST", urls, body)
  12295. if err != nil {
  12296. return nil, err
  12297. }
  12298. req.Header = reqHeaders
  12299. googleapi.Expand(req.URL, map[string]string{
  12300. "merchantId": strconv.FormatUint(c.merchantId, 10),
  12301. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  12302. })
  12303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12304. }
  12305. // Do executes the "content.datafeeds.fetchnow" call.
  12306. // Exactly one of *DatafeedsFetchNowResponse or error will be non-nil.
  12307. // Any non-2xx status code is an error. Response headers are in either
  12308. // *DatafeedsFetchNowResponse.ServerResponse.Header or (if a response
  12309. // was returned at all) in error.(*googleapi.Error).Header. Use
  12310. // googleapi.IsNotModified to check whether the returned error was
  12311. // because http.StatusNotModified was returned.
  12312. func (c *DatafeedsFetchnowCall) Do(opts ...googleapi.CallOption) (*DatafeedsFetchNowResponse, error) {
  12313. gensupport.SetOptions(c.urlParams_, opts...)
  12314. res, err := c.doRequest("json")
  12315. if res != nil && res.StatusCode == http.StatusNotModified {
  12316. if res.Body != nil {
  12317. res.Body.Close()
  12318. }
  12319. return nil, &googleapi.Error{
  12320. Code: res.StatusCode,
  12321. Header: res.Header,
  12322. }
  12323. }
  12324. if err != nil {
  12325. return nil, err
  12326. }
  12327. defer googleapi.CloseBody(res)
  12328. if err := googleapi.CheckResponse(res); err != nil {
  12329. return nil, err
  12330. }
  12331. ret := &DatafeedsFetchNowResponse{
  12332. ServerResponse: googleapi.ServerResponse{
  12333. Header: res.Header,
  12334. HTTPStatusCode: res.StatusCode,
  12335. },
  12336. }
  12337. target := &ret
  12338. if err := gensupport.DecodeResponse(target, res); err != nil {
  12339. return nil, err
  12340. }
  12341. return ret, nil
  12342. // {
  12343. // "description": "Invokes a fetch for the datafeed in your Merchant Center account.",
  12344. // "httpMethod": "POST",
  12345. // "id": "content.datafeeds.fetchnow",
  12346. // "parameterOrder": [
  12347. // "merchantId",
  12348. // "datafeedId"
  12349. // ],
  12350. // "parameters": {
  12351. // "datafeedId": {
  12352. // "description": "The ID of the datafeed to be fetched.",
  12353. // "format": "uint64",
  12354. // "location": "path",
  12355. // "required": true,
  12356. // "type": "string"
  12357. // },
  12358. // "dryRun": {
  12359. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  12360. // "location": "query",
  12361. // "type": "boolean"
  12362. // },
  12363. // "merchantId": {
  12364. // "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.",
  12365. // "format": "uint64",
  12366. // "location": "path",
  12367. // "required": true,
  12368. // "type": "string"
  12369. // }
  12370. // },
  12371. // "path": "{merchantId}/datafeeds/{datafeedId}/fetchNow",
  12372. // "response": {
  12373. // "$ref": "DatafeedsFetchNowResponse"
  12374. // },
  12375. // "scopes": [
  12376. // "https://www.googleapis.com/auth/content"
  12377. // ]
  12378. // }
  12379. }
  12380. // method id "content.datafeeds.get":
  12381. type DatafeedsGetCall struct {
  12382. s *APIService
  12383. merchantId uint64
  12384. datafeedId uint64
  12385. urlParams_ gensupport.URLParams
  12386. ifNoneMatch_ string
  12387. ctx_ context.Context
  12388. header_ http.Header
  12389. }
  12390. // Get: Retrieves a datafeed configuration from your Merchant Center
  12391. // account.
  12392. func (r *DatafeedsService) Get(merchantId uint64, datafeedId uint64) *DatafeedsGetCall {
  12393. c := &DatafeedsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12394. c.merchantId = merchantId
  12395. c.datafeedId = datafeedId
  12396. return c
  12397. }
  12398. // Fields allows partial responses to be retrieved. See
  12399. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12400. // for more information.
  12401. func (c *DatafeedsGetCall) Fields(s ...googleapi.Field) *DatafeedsGetCall {
  12402. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12403. return c
  12404. }
  12405. // IfNoneMatch sets the optional parameter which makes the operation
  12406. // fail if the object's ETag matches the given value. This is useful for
  12407. // getting updates only after the object has changed since the last
  12408. // request. Use googleapi.IsNotModified to check whether the response
  12409. // error from Do is the result of In-None-Match.
  12410. func (c *DatafeedsGetCall) IfNoneMatch(entityTag string) *DatafeedsGetCall {
  12411. c.ifNoneMatch_ = entityTag
  12412. return c
  12413. }
  12414. // Context sets the context to be used in this call's Do method. Any
  12415. // pending HTTP request will be aborted if the provided context is
  12416. // canceled.
  12417. func (c *DatafeedsGetCall) Context(ctx context.Context) *DatafeedsGetCall {
  12418. c.ctx_ = ctx
  12419. return c
  12420. }
  12421. // Header returns an http.Header that can be modified by the caller to
  12422. // add HTTP headers to the request.
  12423. func (c *DatafeedsGetCall) Header() http.Header {
  12424. if c.header_ == nil {
  12425. c.header_ = make(http.Header)
  12426. }
  12427. return c.header_
  12428. }
  12429. func (c *DatafeedsGetCall) doRequest(alt string) (*http.Response, error) {
  12430. reqHeaders := make(http.Header)
  12431. for k, v := range c.header_ {
  12432. reqHeaders[k] = v
  12433. }
  12434. reqHeaders.Set("User-Agent", c.s.userAgent())
  12435. if c.ifNoneMatch_ != "" {
  12436. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12437. }
  12438. var body io.Reader = nil
  12439. c.urlParams_.Set("alt", alt)
  12440. c.urlParams_.Set("prettyPrint", "false")
  12441. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  12442. urls += "?" + c.urlParams_.Encode()
  12443. req, err := http.NewRequest("GET", urls, body)
  12444. if err != nil {
  12445. return nil, err
  12446. }
  12447. req.Header = reqHeaders
  12448. googleapi.Expand(req.URL, map[string]string{
  12449. "merchantId": strconv.FormatUint(c.merchantId, 10),
  12450. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  12451. })
  12452. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12453. }
  12454. // Do executes the "content.datafeeds.get" call.
  12455. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  12456. // code is an error. Response headers are in either
  12457. // *Datafeed.ServerResponse.Header or (if a response was returned at
  12458. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12459. // to check whether the returned error was because
  12460. // http.StatusNotModified was returned.
  12461. func (c *DatafeedsGetCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  12462. gensupport.SetOptions(c.urlParams_, opts...)
  12463. res, err := c.doRequest("json")
  12464. if res != nil && res.StatusCode == http.StatusNotModified {
  12465. if res.Body != nil {
  12466. res.Body.Close()
  12467. }
  12468. return nil, &googleapi.Error{
  12469. Code: res.StatusCode,
  12470. Header: res.Header,
  12471. }
  12472. }
  12473. if err != nil {
  12474. return nil, err
  12475. }
  12476. defer googleapi.CloseBody(res)
  12477. if err := googleapi.CheckResponse(res); err != nil {
  12478. return nil, err
  12479. }
  12480. ret := &Datafeed{
  12481. ServerResponse: googleapi.ServerResponse{
  12482. Header: res.Header,
  12483. HTTPStatusCode: res.StatusCode,
  12484. },
  12485. }
  12486. target := &ret
  12487. if err := gensupport.DecodeResponse(target, res); err != nil {
  12488. return nil, err
  12489. }
  12490. return ret, nil
  12491. // {
  12492. // "description": "Retrieves a datafeed configuration from your Merchant Center account.",
  12493. // "httpMethod": "GET",
  12494. // "id": "content.datafeeds.get",
  12495. // "parameterOrder": [
  12496. // "merchantId",
  12497. // "datafeedId"
  12498. // ],
  12499. // "parameters": {
  12500. // "datafeedId": {
  12501. // "description": "The ID of the datafeed.",
  12502. // "format": "uint64",
  12503. // "location": "path",
  12504. // "required": true,
  12505. // "type": "string"
  12506. // },
  12507. // "merchantId": {
  12508. // "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.",
  12509. // "format": "uint64",
  12510. // "location": "path",
  12511. // "required": true,
  12512. // "type": "string"
  12513. // }
  12514. // },
  12515. // "path": "{merchantId}/datafeeds/{datafeedId}",
  12516. // "response": {
  12517. // "$ref": "Datafeed"
  12518. // },
  12519. // "scopes": [
  12520. // "https://www.googleapis.com/auth/content"
  12521. // ]
  12522. // }
  12523. }
  12524. // method id "content.datafeeds.insert":
  12525. type DatafeedsInsertCall struct {
  12526. s *APIService
  12527. merchantId uint64
  12528. datafeed *Datafeed
  12529. urlParams_ gensupport.URLParams
  12530. ctx_ context.Context
  12531. header_ http.Header
  12532. }
  12533. // Insert: Registers a datafeed configuration with your Merchant Center
  12534. // account.
  12535. func (r *DatafeedsService) Insert(merchantId uint64, datafeed *Datafeed) *DatafeedsInsertCall {
  12536. c := &DatafeedsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12537. c.merchantId = merchantId
  12538. c.datafeed = datafeed
  12539. return c
  12540. }
  12541. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  12542. // request like in a live environment. If set to true, dry-run mode
  12543. // checks the validity of the request and returns errors (if any).
  12544. func (c *DatafeedsInsertCall) DryRun(dryRun bool) *DatafeedsInsertCall {
  12545. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  12546. return c
  12547. }
  12548. // Fields allows partial responses to be retrieved. See
  12549. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12550. // for more information.
  12551. func (c *DatafeedsInsertCall) Fields(s ...googleapi.Field) *DatafeedsInsertCall {
  12552. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12553. return c
  12554. }
  12555. // Context sets the context to be used in this call's Do method. Any
  12556. // pending HTTP request will be aborted if the provided context is
  12557. // canceled.
  12558. func (c *DatafeedsInsertCall) Context(ctx context.Context) *DatafeedsInsertCall {
  12559. c.ctx_ = ctx
  12560. return c
  12561. }
  12562. // Header returns an http.Header that can be modified by the caller to
  12563. // add HTTP headers to the request.
  12564. func (c *DatafeedsInsertCall) Header() http.Header {
  12565. if c.header_ == nil {
  12566. c.header_ = make(http.Header)
  12567. }
  12568. return c.header_
  12569. }
  12570. func (c *DatafeedsInsertCall) doRequest(alt string) (*http.Response, error) {
  12571. reqHeaders := make(http.Header)
  12572. for k, v := range c.header_ {
  12573. reqHeaders[k] = v
  12574. }
  12575. reqHeaders.Set("User-Agent", c.s.userAgent())
  12576. var body io.Reader = nil
  12577. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed)
  12578. if err != nil {
  12579. return nil, err
  12580. }
  12581. reqHeaders.Set("Content-Type", "application/json")
  12582. c.urlParams_.Set("alt", alt)
  12583. c.urlParams_.Set("prettyPrint", "false")
  12584. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds")
  12585. urls += "?" + c.urlParams_.Encode()
  12586. req, err := http.NewRequest("POST", urls, body)
  12587. if err != nil {
  12588. return nil, err
  12589. }
  12590. req.Header = reqHeaders
  12591. googleapi.Expand(req.URL, map[string]string{
  12592. "merchantId": strconv.FormatUint(c.merchantId, 10),
  12593. })
  12594. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12595. }
  12596. // Do executes the "content.datafeeds.insert" call.
  12597. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  12598. // code is an error. Response headers are in either
  12599. // *Datafeed.ServerResponse.Header or (if a response was returned at
  12600. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12601. // to check whether the returned error was because
  12602. // http.StatusNotModified was returned.
  12603. func (c *DatafeedsInsertCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  12604. gensupport.SetOptions(c.urlParams_, opts...)
  12605. res, err := c.doRequest("json")
  12606. if res != nil && res.StatusCode == http.StatusNotModified {
  12607. if res.Body != nil {
  12608. res.Body.Close()
  12609. }
  12610. return nil, &googleapi.Error{
  12611. Code: res.StatusCode,
  12612. Header: res.Header,
  12613. }
  12614. }
  12615. if err != nil {
  12616. return nil, err
  12617. }
  12618. defer googleapi.CloseBody(res)
  12619. if err := googleapi.CheckResponse(res); err != nil {
  12620. return nil, err
  12621. }
  12622. ret := &Datafeed{
  12623. ServerResponse: googleapi.ServerResponse{
  12624. Header: res.Header,
  12625. HTTPStatusCode: res.StatusCode,
  12626. },
  12627. }
  12628. target := &ret
  12629. if err := gensupport.DecodeResponse(target, res); err != nil {
  12630. return nil, err
  12631. }
  12632. return ret, nil
  12633. // {
  12634. // "description": "Registers a datafeed configuration with your Merchant Center account.",
  12635. // "httpMethod": "POST",
  12636. // "id": "content.datafeeds.insert",
  12637. // "parameterOrder": [
  12638. // "merchantId"
  12639. // ],
  12640. // "parameters": {
  12641. // "dryRun": {
  12642. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  12643. // "location": "query",
  12644. // "type": "boolean"
  12645. // },
  12646. // "merchantId": {
  12647. // "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.",
  12648. // "format": "uint64",
  12649. // "location": "path",
  12650. // "required": true,
  12651. // "type": "string"
  12652. // }
  12653. // },
  12654. // "path": "{merchantId}/datafeeds",
  12655. // "request": {
  12656. // "$ref": "Datafeed"
  12657. // },
  12658. // "response": {
  12659. // "$ref": "Datafeed"
  12660. // },
  12661. // "scopes": [
  12662. // "https://www.googleapis.com/auth/content"
  12663. // ]
  12664. // }
  12665. }
  12666. // method id "content.datafeeds.list":
  12667. type DatafeedsListCall struct {
  12668. s *APIService
  12669. merchantId uint64
  12670. urlParams_ gensupport.URLParams
  12671. ifNoneMatch_ string
  12672. ctx_ context.Context
  12673. header_ http.Header
  12674. }
  12675. // List: Lists the configurations for datafeeds in your Merchant Center
  12676. // account.
  12677. func (r *DatafeedsService) List(merchantId uint64) *DatafeedsListCall {
  12678. c := &DatafeedsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12679. c.merchantId = merchantId
  12680. return c
  12681. }
  12682. // MaxResults sets the optional parameter "maxResults": The maximum
  12683. // number of products to return in the response, used for paging.
  12684. func (c *DatafeedsListCall) MaxResults(maxResults int64) *DatafeedsListCall {
  12685. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12686. return c
  12687. }
  12688. // PageToken sets the optional parameter "pageToken": The token returned
  12689. // by the previous request.
  12690. func (c *DatafeedsListCall) PageToken(pageToken string) *DatafeedsListCall {
  12691. c.urlParams_.Set("pageToken", pageToken)
  12692. return c
  12693. }
  12694. // Fields allows partial responses to be retrieved. See
  12695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12696. // for more information.
  12697. func (c *DatafeedsListCall) Fields(s ...googleapi.Field) *DatafeedsListCall {
  12698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12699. return c
  12700. }
  12701. // IfNoneMatch sets the optional parameter which makes the operation
  12702. // fail if the object's ETag matches the given value. This is useful for
  12703. // getting updates only after the object has changed since the last
  12704. // request. Use googleapi.IsNotModified to check whether the response
  12705. // error from Do is the result of In-None-Match.
  12706. func (c *DatafeedsListCall) IfNoneMatch(entityTag string) *DatafeedsListCall {
  12707. c.ifNoneMatch_ = entityTag
  12708. return c
  12709. }
  12710. // Context sets the context to be used in this call's Do method. Any
  12711. // pending HTTP request will be aborted if the provided context is
  12712. // canceled.
  12713. func (c *DatafeedsListCall) Context(ctx context.Context) *DatafeedsListCall {
  12714. c.ctx_ = ctx
  12715. return c
  12716. }
  12717. // Header returns an http.Header that can be modified by the caller to
  12718. // add HTTP headers to the request.
  12719. func (c *DatafeedsListCall) Header() http.Header {
  12720. if c.header_ == nil {
  12721. c.header_ = make(http.Header)
  12722. }
  12723. return c.header_
  12724. }
  12725. func (c *DatafeedsListCall) doRequest(alt string) (*http.Response, error) {
  12726. reqHeaders := make(http.Header)
  12727. for k, v := range c.header_ {
  12728. reqHeaders[k] = v
  12729. }
  12730. reqHeaders.Set("User-Agent", c.s.userAgent())
  12731. if c.ifNoneMatch_ != "" {
  12732. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12733. }
  12734. var body io.Reader = nil
  12735. c.urlParams_.Set("alt", alt)
  12736. c.urlParams_.Set("prettyPrint", "false")
  12737. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds")
  12738. urls += "?" + c.urlParams_.Encode()
  12739. req, err := http.NewRequest("GET", urls, body)
  12740. if err != nil {
  12741. return nil, err
  12742. }
  12743. req.Header = reqHeaders
  12744. googleapi.Expand(req.URL, map[string]string{
  12745. "merchantId": strconv.FormatUint(c.merchantId, 10),
  12746. })
  12747. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12748. }
  12749. // Do executes the "content.datafeeds.list" call.
  12750. // Exactly one of *DatafeedsListResponse or error will be non-nil. Any
  12751. // non-2xx status code is an error. Response headers are in either
  12752. // *DatafeedsListResponse.ServerResponse.Header or (if a response was
  12753. // returned at all) in error.(*googleapi.Error).Header. Use
  12754. // googleapi.IsNotModified to check whether the returned error was
  12755. // because http.StatusNotModified was returned.
  12756. func (c *DatafeedsListCall) Do(opts ...googleapi.CallOption) (*DatafeedsListResponse, error) {
  12757. gensupport.SetOptions(c.urlParams_, opts...)
  12758. res, err := c.doRequest("json")
  12759. if res != nil && res.StatusCode == http.StatusNotModified {
  12760. if res.Body != nil {
  12761. res.Body.Close()
  12762. }
  12763. return nil, &googleapi.Error{
  12764. Code: res.StatusCode,
  12765. Header: res.Header,
  12766. }
  12767. }
  12768. if err != nil {
  12769. return nil, err
  12770. }
  12771. defer googleapi.CloseBody(res)
  12772. if err := googleapi.CheckResponse(res); err != nil {
  12773. return nil, err
  12774. }
  12775. ret := &DatafeedsListResponse{
  12776. ServerResponse: googleapi.ServerResponse{
  12777. Header: res.Header,
  12778. HTTPStatusCode: res.StatusCode,
  12779. },
  12780. }
  12781. target := &ret
  12782. if err := gensupport.DecodeResponse(target, res); err != nil {
  12783. return nil, err
  12784. }
  12785. return ret, nil
  12786. // {
  12787. // "description": "Lists the configurations for datafeeds in your Merchant Center account.",
  12788. // "httpMethod": "GET",
  12789. // "id": "content.datafeeds.list",
  12790. // "parameterOrder": [
  12791. // "merchantId"
  12792. // ],
  12793. // "parameters": {
  12794. // "maxResults": {
  12795. // "description": "The maximum number of products to return in the response, used for paging.",
  12796. // "format": "uint32",
  12797. // "location": "query",
  12798. // "type": "integer"
  12799. // },
  12800. // "merchantId": {
  12801. // "description": "The ID of the account that manages the datafeeds. This account cannot be a multi-client account.",
  12802. // "format": "uint64",
  12803. // "location": "path",
  12804. // "required": true,
  12805. // "type": "string"
  12806. // },
  12807. // "pageToken": {
  12808. // "description": "The token returned by the previous request.",
  12809. // "location": "query",
  12810. // "type": "string"
  12811. // }
  12812. // },
  12813. // "path": "{merchantId}/datafeeds",
  12814. // "response": {
  12815. // "$ref": "DatafeedsListResponse"
  12816. // },
  12817. // "scopes": [
  12818. // "https://www.googleapis.com/auth/content"
  12819. // ]
  12820. // }
  12821. }
  12822. // Pages invokes f for each page of results.
  12823. // A non-nil error returned from f will halt the iteration.
  12824. // The provided context supersedes any context provided to the Context method.
  12825. func (c *DatafeedsListCall) Pages(ctx context.Context, f func(*DatafeedsListResponse) error) error {
  12826. c.ctx_ = ctx
  12827. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12828. for {
  12829. x, err := c.Do()
  12830. if err != nil {
  12831. return err
  12832. }
  12833. if err := f(x); err != nil {
  12834. return err
  12835. }
  12836. if x.NextPageToken == "" {
  12837. return nil
  12838. }
  12839. c.PageToken(x.NextPageToken)
  12840. }
  12841. }
  12842. // method id "content.datafeeds.patch":
  12843. type DatafeedsPatchCall struct {
  12844. s *APIService
  12845. merchantId uint64
  12846. datafeedId uint64
  12847. datafeed *Datafeed
  12848. urlParams_ gensupport.URLParams
  12849. ctx_ context.Context
  12850. header_ http.Header
  12851. }
  12852. // Patch: Updates a datafeed configuration of your Merchant Center
  12853. // account. This method supports patch semantics.
  12854. func (r *DatafeedsService) Patch(merchantId uint64, datafeedId uint64, datafeed *Datafeed) *DatafeedsPatchCall {
  12855. c := &DatafeedsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12856. c.merchantId = merchantId
  12857. c.datafeedId = datafeedId
  12858. c.datafeed = datafeed
  12859. return c
  12860. }
  12861. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  12862. // request like in a live environment. If set to true, dry-run mode
  12863. // checks the validity of the request and returns errors (if any).
  12864. func (c *DatafeedsPatchCall) DryRun(dryRun bool) *DatafeedsPatchCall {
  12865. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  12866. return c
  12867. }
  12868. // Fields allows partial responses to be retrieved. See
  12869. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12870. // for more information.
  12871. func (c *DatafeedsPatchCall) Fields(s ...googleapi.Field) *DatafeedsPatchCall {
  12872. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12873. return c
  12874. }
  12875. // Context sets the context to be used in this call's Do method. Any
  12876. // pending HTTP request will be aborted if the provided context is
  12877. // canceled.
  12878. func (c *DatafeedsPatchCall) Context(ctx context.Context) *DatafeedsPatchCall {
  12879. c.ctx_ = ctx
  12880. return c
  12881. }
  12882. // Header returns an http.Header that can be modified by the caller to
  12883. // add HTTP headers to the request.
  12884. func (c *DatafeedsPatchCall) Header() http.Header {
  12885. if c.header_ == nil {
  12886. c.header_ = make(http.Header)
  12887. }
  12888. return c.header_
  12889. }
  12890. func (c *DatafeedsPatchCall) doRequest(alt string) (*http.Response, error) {
  12891. reqHeaders := make(http.Header)
  12892. for k, v := range c.header_ {
  12893. reqHeaders[k] = v
  12894. }
  12895. reqHeaders.Set("User-Agent", c.s.userAgent())
  12896. var body io.Reader = nil
  12897. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed)
  12898. if err != nil {
  12899. return nil, err
  12900. }
  12901. reqHeaders.Set("Content-Type", "application/json")
  12902. c.urlParams_.Set("alt", alt)
  12903. c.urlParams_.Set("prettyPrint", "false")
  12904. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  12905. urls += "?" + c.urlParams_.Encode()
  12906. req, err := http.NewRequest("PATCH", urls, body)
  12907. if err != nil {
  12908. return nil, err
  12909. }
  12910. req.Header = reqHeaders
  12911. googleapi.Expand(req.URL, map[string]string{
  12912. "merchantId": strconv.FormatUint(c.merchantId, 10),
  12913. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  12914. })
  12915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12916. }
  12917. // Do executes the "content.datafeeds.patch" call.
  12918. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  12919. // code is an error. Response headers are in either
  12920. // *Datafeed.ServerResponse.Header or (if a response was returned at
  12921. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  12922. // to check whether the returned error was because
  12923. // http.StatusNotModified was returned.
  12924. func (c *DatafeedsPatchCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  12925. gensupport.SetOptions(c.urlParams_, opts...)
  12926. res, err := c.doRequest("json")
  12927. if res != nil && res.StatusCode == http.StatusNotModified {
  12928. if res.Body != nil {
  12929. res.Body.Close()
  12930. }
  12931. return nil, &googleapi.Error{
  12932. Code: res.StatusCode,
  12933. Header: res.Header,
  12934. }
  12935. }
  12936. if err != nil {
  12937. return nil, err
  12938. }
  12939. defer googleapi.CloseBody(res)
  12940. if err := googleapi.CheckResponse(res); err != nil {
  12941. return nil, err
  12942. }
  12943. ret := &Datafeed{
  12944. ServerResponse: googleapi.ServerResponse{
  12945. Header: res.Header,
  12946. HTTPStatusCode: res.StatusCode,
  12947. },
  12948. }
  12949. target := &ret
  12950. if err := gensupport.DecodeResponse(target, res); err != nil {
  12951. return nil, err
  12952. }
  12953. return ret, nil
  12954. // {
  12955. // "description": "Updates a datafeed configuration of your Merchant Center account. This method supports patch semantics.",
  12956. // "httpMethod": "PATCH",
  12957. // "id": "content.datafeeds.patch",
  12958. // "parameterOrder": [
  12959. // "merchantId",
  12960. // "datafeedId"
  12961. // ],
  12962. // "parameters": {
  12963. // "datafeedId": {
  12964. // "description": "The ID of the datafeed.",
  12965. // "format": "uint64",
  12966. // "location": "path",
  12967. // "required": true,
  12968. // "type": "string"
  12969. // },
  12970. // "dryRun": {
  12971. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  12972. // "location": "query",
  12973. // "type": "boolean"
  12974. // },
  12975. // "merchantId": {
  12976. // "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.",
  12977. // "format": "uint64",
  12978. // "location": "path",
  12979. // "required": true,
  12980. // "type": "string"
  12981. // }
  12982. // },
  12983. // "path": "{merchantId}/datafeeds/{datafeedId}",
  12984. // "request": {
  12985. // "$ref": "Datafeed"
  12986. // },
  12987. // "response": {
  12988. // "$ref": "Datafeed"
  12989. // },
  12990. // "scopes": [
  12991. // "https://www.googleapis.com/auth/content"
  12992. // ]
  12993. // }
  12994. }
  12995. // method id "content.datafeeds.update":
  12996. type DatafeedsUpdateCall struct {
  12997. s *APIService
  12998. merchantId uint64
  12999. datafeedId uint64
  13000. datafeed *Datafeed
  13001. urlParams_ gensupport.URLParams
  13002. ctx_ context.Context
  13003. header_ http.Header
  13004. }
  13005. // Update: Updates a datafeed configuration of your Merchant Center
  13006. // account.
  13007. func (r *DatafeedsService) Update(merchantId uint64, datafeedId uint64, datafeed *Datafeed) *DatafeedsUpdateCall {
  13008. c := &DatafeedsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13009. c.merchantId = merchantId
  13010. c.datafeedId = datafeedId
  13011. c.datafeed = datafeed
  13012. return c
  13013. }
  13014. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  13015. // request like in a live environment. If set to true, dry-run mode
  13016. // checks the validity of the request and returns errors (if any).
  13017. func (c *DatafeedsUpdateCall) DryRun(dryRun bool) *DatafeedsUpdateCall {
  13018. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  13019. return c
  13020. }
  13021. // Fields allows partial responses to be retrieved. See
  13022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13023. // for more information.
  13024. func (c *DatafeedsUpdateCall) Fields(s ...googleapi.Field) *DatafeedsUpdateCall {
  13025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13026. return c
  13027. }
  13028. // Context sets the context to be used in this call's Do method. Any
  13029. // pending HTTP request will be aborted if the provided context is
  13030. // canceled.
  13031. func (c *DatafeedsUpdateCall) Context(ctx context.Context) *DatafeedsUpdateCall {
  13032. c.ctx_ = ctx
  13033. return c
  13034. }
  13035. // Header returns an http.Header that can be modified by the caller to
  13036. // add HTTP headers to the request.
  13037. func (c *DatafeedsUpdateCall) Header() http.Header {
  13038. if c.header_ == nil {
  13039. c.header_ = make(http.Header)
  13040. }
  13041. return c.header_
  13042. }
  13043. func (c *DatafeedsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13044. reqHeaders := make(http.Header)
  13045. for k, v := range c.header_ {
  13046. reqHeaders[k] = v
  13047. }
  13048. reqHeaders.Set("User-Agent", c.s.userAgent())
  13049. var body io.Reader = nil
  13050. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeed)
  13051. if err != nil {
  13052. return nil, err
  13053. }
  13054. reqHeaders.Set("Content-Type", "application/json")
  13055. c.urlParams_.Set("alt", alt)
  13056. c.urlParams_.Set("prettyPrint", "false")
  13057. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeeds/{datafeedId}")
  13058. urls += "?" + c.urlParams_.Encode()
  13059. req, err := http.NewRequest("PUT", urls, body)
  13060. if err != nil {
  13061. return nil, err
  13062. }
  13063. req.Header = reqHeaders
  13064. googleapi.Expand(req.URL, map[string]string{
  13065. "merchantId": strconv.FormatUint(c.merchantId, 10),
  13066. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  13067. })
  13068. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13069. }
  13070. // Do executes the "content.datafeeds.update" call.
  13071. // Exactly one of *Datafeed or error will be non-nil. Any non-2xx status
  13072. // code is an error. Response headers are in either
  13073. // *Datafeed.ServerResponse.Header or (if a response was returned at
  13074. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  13075. // to check whether the returned error was because
  13076. // http.StatusNotModified was returned.
  13077. func (c *DatafeedsUpdateCall) Do(opts ...googleapi.CallOption) (*Datafeed, error) {
  13078. gensupport.SetOptions(c.urlParams_, opts...)
  13079. res, err := c.doRequest("json")
  13080. if res != nil && res.StatusCode == http.StatusNotModified {
  13081. if res.Body != nil {
  13082. res.Body.Close()
  13083. }
  13084. return nil, &googleapi.Error{
  13085. Code: res.StatusCode,
  13086. Header: res.Header,
  13087. }
  13088. }
  13089. if err != nil {
  13090. return nil, err
  13091. }
  13092. defer googleapi.CloseBody(res)
  13093. if err := googleapi.CheckResponse(res); err != nil {
  13094. return nil, err
  13095. }
  13096. ret := &Datafeed{
  13097. ServerResponse: googleapi.ServerResponse{
  13098. Header: res.Header,
  13099. HTTPStatusCode: res.StatusCode,
  13100. },
  13101. }
  13102. target := &ret
  13103. if err := gensupport.DecodeResponse(target, res); err != nil {
  13104. return nil, err
  13105. }
  13106. return ret, nil
  13107. // {
  13108. // "description": "Updates a datafeed configuration of your Merchant Center account.",
  13109. // "httpMethod": "PUT",
  13110. // "id": "content.datafeeds.update",
  13111. // "parameterOrder": [
  13112. // "merchantId",
  13113. // "datafeedId"
  13114. // ],
  13115. // "parameters": {
  13116. // "datafeedId": {
  13117. // "description": "The ID of the datafeed.",
  13118. // "format": "uint64",
  13119. // "location": "path",
  13120. // "required": true,
  13121. // "type": "string"
  13122. // },
  13123. // "dryRun": {
  13124. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  13125. // "location": "query",
  13126. // "type": "boolean"
  13127. // },
  13128. // "merchantId": {
  13129. // "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.",
  13130. // "format": "uint64",
  13131. // "location": "path",
  13132. // "required": true,
  13133. // "type": "string"
  13134. // }
  13135. // },
  13136. // "path": "{merchantId}/datafeeds/{datafeedId}",
  13137. // "request": {
  13138. // "$ref": "Datafeed"
  13139. // },
  13140. // "response": {
  13141. // "$ref": "Datafeed"
  13142. // },
  13143. // "scopes": [
  13144. // "https://www.googleapis.com/auth/content"
  13145. // ]
  13146. // }
  13147. }
  13148. // method id "content.datafeedstatuses.custombatch":
  13149. type DatafeedstatusesCustombatchCall struct {
  13150. s *APIService
  13151. datafeedstatusescustombatchrequest *DatafeedstatusesCustomBatchRequest
  13152. urlParams_ gensupport.URLParams
  13153. ctx_ context.Context
  13154. header_ http.Header
  13155. }
  13156. // Custombatch:
  13157. func (r *DatafeedstatusesService) Custombatch(datafeedstatusescustombatchrequest *DatafeedstatusesCustomBatchRequest) *DatafeedstatusesCustombatchCall {
  13158. c := &DatafeedstatusesCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13159. c.datafeedstatusescustombatchrequest = datafeedstatusescustombatchrequest
  13160. return c
  13161. }
  13162. // Fields allows partial responses to be retrieved. See
  13163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13164. // for more information.
  13165. func (c *DatafeedstatusesCustombatchCall) Fields(s ...googleapi.Field) *DatafeedstatusesCustombatchCall {
  13166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13167. return c
  13168. }
  13169. // Context sets the context to be used in this call's Do method. Any
  13170. // pending HTTP request will be aborted if the provided context is
  13171. // canceled.
  13172. func (c *DatafeedstatusesCustombatchCall) Context(ctx context.Context) *DatafeedstatusesCustombatchCall {
  13173. c.ctx_ = ctx
  13174. return c
  13175. }
  13176. // Header returns an http.Header that can be modified by the caller to
  13177. // add HTTP headers to the request.
  13178. func (c *DatafeedstatusesCustombatchCall) Header() http.Header {
  13179. if c.header_ == nil {
  13180. c.header_ = make(http.Header)
  13181. }
  13182. return c.header_
  13183. }
  13184. func (c *DatafeedstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) {
  13185. reqHeaders := make(http.Header)
  13186. for k, v := range c.header_ {
  13187. reqHeaders[k] = v
  13188. }
  13189. reqHeaders.Set("User-Agent", c.s.userAgent())
  13190. var body io.Reader = nil
  13191. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datafeedstatusescustombatchrequest)
  13192. if err != nil {
  13193. return nil, err
  13194. }
  13195. reqHeaders.Set("Content-Type", "application/json")
  13196. c.urlParams_.Set("alt", alt)
  13197. c.urlParams_.Set("prettyPrint", "false")
  13198. urls := googleapi.ResolveRelative(c.s.BasePath, "datafeedstatuses/batch")
  13199. urls += "?" + c.urlParams_.Encode()
  13200. req, err := http.NewRequest("POST", urls, body)
  13201. if err != nil {
  13202. return nil, err
  13203. }
  13204. req.Header = reqHeaders
  13205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13206. }
  13207. // Do executes the "content.datafeedstatuses.custombatch" call.
  13208. // Exactly one of *DatafeedstatusesCustomBatchResponse or error will be
  13209. // non-nil. Any non-2xx status code is an error. Response headers are in
  13210. // either *DatafeedstatusesCustomBatchResponse.ServerResponse.Header or
  13211. // (if a response was returned at all) in
  13212. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13213. // whether the returned error was because http.StatusNotModified was
  13214. // returned.
  13215. func (c *DatafeedstatusesCustombatchCall) Do(opts ...googleapi.CallOption) (*DatafeedstatusesCustomBatchResponse, error) {
  13216. gensupport.SetOptions(c.urlParams_, opts...)
  13217. res, err := c.doRequest("json")
  13218. if res != nil && res.StatusCode == http.StatusNotModified {
  13219. if res.Body != nil {
  13220. res.Body.Close()
  13221. }
  13222. return nil, &googleapi.Error{
  13223. Code: res.StatusCode,
  13224. Header: res.Header,
  13225. }
  13226. }
  13227. if err != nil {
  13228. return nil, err
  13229. }
  13230. defer googleapi.CloseBody(res)
  13231. if err := googleapi.CheckResponse(res); err != nil {
  13232. return nil, err
  13233. }
  13234. ret := &DatafeedstatusesCustomBatchResponse{
  13235. ServerResponse: googleapi.ServerResponse{
  13236. Header: res.Header,
  13237. HTTPStatusCode: res.StatusCode,
  13238. },
  13239. }
  13240. target := &ret
  13241. if err := gensupport.DecodeResponse(target, res); err != nil {
  13242. return nil, err
  13243. }
  13244. return ret, nil
  13245. // {
  13246. // "httpMethod": "POST",
  13247. // "id": "content.datafeedstatuses.custombatch",
  13248. // "path": "datafeedstatuses/batch",
  13249. // "request": {
  13250. // "$ref": "DatafeedstatusesCustomBatchRequest"
  13251. // },
  13252. // "response": {
  13253. // "$ref": "DatafeedstatusesCustomBatchResponse"
  13254. // },
  13255. // "scopes": [
  13256. // "https://www.googleapis.com/auth/content"
  13257. // ]
  13258. // }
  13259. }
  13260. // method id "content.datafeedstatuses.get":
  13261. type DatafeedstatusesGetCall struct {
  13262. s *APIService
  13263. merchantId uint64
  13264. datafeedId uint64
  13265. urlParams_ gensupport.URLParams
  13266. ifNoneMatch_ string
  13267. ctx_ context.Context
  13268. header_ http.Header
  13269. }
  13270. // Get: Retrieves the status of a datafeed from your Merchant Center
  13271. // account.
  13272. func (r *DatafeedstatusesService) Get(merchantId uint64, datafeedId uint64) *DatafeedstatusesGetCall {
  13273. c := &DatafeedstatusesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13274. c.merchantId = merchantId
  13275. c.datafeedId = datafeedId
  13276. return c
  13277. }
  13278. // Country sets the optional parameter "country": The country for which
  13279. // to get the datafeed status. If this parameter is provided then
  13280. // language must also be provided. Note that this parameter is required
  13281. // for feeds targeting multiple countries and languages, since a feed
  13282. // may have a different status for each target.
  13283. func (c *DatafeedstatusesGetCall) Country(country string) *DatafeedstatusesGetCall {
  13284. c.urlParams_.Set("country", country)
  13285. return c
  13286. }
  13287. // Language sets the optional parameter "language": The language for
  13288. // which to get the datafeed status. If this parameter is provided then
  13289. // country must also be provided. Note that this parameter is required
  13290. // for feeds targeting multiple countries and languages, since a feed
  13291. // may have a different status for each target.
  13292. func (c *DatafeedstatusesGetCall) Language(language string) *DatafeedstatusesGetCall {
  13293. c.urlParams_.Set("language", language)
  13294. return c
  13295. }
  13296. // Fields allows partial responses to be retrieved. See
  13297. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13298. // for more information.
  13299. func (c *DatafeedstatusesGetCall) Fields(s ...googleapi.Field) *DatafeedstatusesGetCall {
  13300. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13301. return c
  13302. }
  13303. // IfNoneMatch sets the optional parameter which makes the operation
  13304. // fail if the object's ETag matches the given value. This is useful for
  13305. // getting updates only after the object has changed since the last
  13306. // request. Use googleapi.IsNotModified to check whether the response
  13307. // error from Do is the result of In-None-Match.
  13308. func (c *DatafeedstatusesGetCall) IfNoneMatch(entityTag string) *DatafeedstatusesGetCall {
  13309. c.ifNoneMatch_ = entityTag
  13310. return c
  13311. }
  13312. // Context sets the context to be used in this call's Do method. Any
  13313. // pending HTTP request will be aborted if the provided context is
  13314. // canceled.
  13315. func (c *DatafeedstatusesGetCall) Context(ctx context.Context) *DatafeedstatusesGetCall {
  13316. c.ctx_ = ctx
  13317. return c
  13318. }
  13319. // Header returns an http.Header that can be modified by the caller to
  13320. // add HTTP headers to the request.
  13321. func (c *DatafeedstatusesGetCall) Header() http.Header {
  13322. if c.header_ == nil {
  13323. c.header_ = make(http.Header)
  13324. }
  13325. return c.header_
  13326. }
  13327. func (c *DatafeedstatusesGetCall) doRequest(alt string) (*http.Response, error) {
  13328. reqHeaders := make(http.Header)
  13329. for k, v := range c.header_ {
  13330. reqHeaders[k] = v
  13331. }
  13332. reqHeaders.Set("User-Agent", c.s.userAgent())
  13333. if c.ifNoneMatch_ != "" {
  13334. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13335. }
  13336. var body io.Reader = nil
  13337. c.urlParams_.Set("alt", alt)
  13338. c.urlParams_.Set("prettyPrint", "false")
  13339. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses/{datafeedId}")
  13340. urls += "?" + c.urlParams_.Encode()
  13341. req, err := http.NewRequest("GET", urls, body)
  13342. if err != nil {
  13343. return nil, err
  13344. }
  13345. req.Header = reqHeaders
  13346. googleapi.Expand(req.URL, map[string]string{
  13347. "merchantId": strconv.FormatUint(c.merchantId, 10),
  13348. "datafeedId": strconv.FormatUint(c.datafeedId, 10),
  13349. })
  13350. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13351. }
  13352. // Do executes the "content.datafeedstatuses.get" call.
  13353. // Exactly one of *DatafeedStatus or error will be non-nil. Any non-2xx
  13354. // status code is an error. Response headers are in either
  13355. // *DatafeedStatus.ServerResponse.Header or (if a response was returned
  13356. // at all) in error.(*googleapi.Error).Header. Use
  13357. // googleapi.IsNotModified to check whether the returned error was
  13358. // because http.StatusNotModified was returned.
  13359. func (c *DatafeedstatusesGetCall) Do(opts ...googleapi.CallOption) (*DatafeedStatus, error) {
  13360. gensupport.SetOptions(c.urlParams_, opts...)
  13361. res, err := c.doRequest("json")
  13362. if res != nil && res.StatusCode == http.StatusNotModified {
  13363. if res.Body != nil {
  13364. res.Body.Close()
  13365. }
  13366. return nil, &googleapi.Error{
  13367. Code: res.StatusCode,
  13368. Header: res.Header,
  13369. }
  13370. }
  13371. if err != nil {
  13372. return nil, err
  13373. }
  13374. defer googleapi.CloseBody(res)
  13375. if err := googleapi.CheckResponse(res); err != nil {
  13376. return nil, err
  13377. }
  13378. ret := &DatafeedStatus{
  13379. ServerResponse: googleapi.ServerResponse{
  13380. Header: res.Header,
  13381. HTTPStatusCode: res.StatusCode,
  13382. },
  13383. }
  13384. target := &ret
  13385. if err := gensupport.DecodeResponse(target, res); err != nil {
  13386. return nil, err
  13387. }
  13388. return ret, nil
  13389. // {
  13390. // "description": "Retrieves the status of a datafeed from your Merchant Center account.",
  13391. // "httpMethod": "GET",
  13392. // "id": "content.datafeedstatuses.get",
  13393. // "parameterOrder": [
  13394. // "merchantId",
  13395. // "datafeedId"
  13396. // ],
  13397. // "parameters": {
  13398. // "country": {
  13399. // "description": "The country for which to get the datafeed status. If this parameter is provided then language must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target.",
  13400. // "location": "query",
  13401. // "type": "string"
  13402. // },
  13403. // "datafeedId": {
  13404. // "description": "The ID of the datafeed.",
  13405. // "format": "uint64",
  13406. // "location": "path",
  13407. // "required": true,
  13408. // "type": "string"
  13409. // },
  13410. // "language": {
  13411. // "description": "The language for which to get the datafeed status. If this parameter is provided then country must also be provided. Note that this parameter is required for feeds targeting multiple countries and languages, since a feed may have a different status for each target.",
  13412. // "location": "query",
  13413. // "type": "string"
  13414. // },
  13415. // "merchantId": {
  13416. // "description": "The ID of the account that manages the datafeed. This account cannot be a multi-client account.",
  13417. // "format": "uint64",
  13418. // "location": "path",
  13419. // "required": true,
  13420. // "type": "string"
  13421. // }
  13422. // },
  13423. // "path": "{merchantId}/datafeedstatuses/{datafeedId}",
  13424. // "response": {
  13425. // "$ref": "DatafeedStatus"
  13426. // },
  13427. // "scopes": [
  13428. // "https://www.googleapis.com/auth/content"
  13429. // ]
  13430. // }
  13431. }
  13432. // method id "content.datafeedstatuses.list":
  13433. type DatafeedstatusesListCall struct {
  13434. s *APIService
  13435. merchantId uint64
  13436. urlParams_ gensupport.URLParams
  13437. ifNoneMatch_ string
  13438. ctx_ context.Context
  13439. header_ http.Header
  13440. }
  13441. // List: Lists the statuses of the datafeeds in your Merchant Center
  13442. // account.
  13443. func (r *DatafeedstatusesService) List(merchantId uint64) *DatafeedstatusesListCall {
  13444. c := &DatafeedstatusesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13445. c.merchantId = merchantId
  13446. return c
  13447. }
  13448. // MaxResults sets the optional parameter "maxResults": The maximum
  13449. // number of products to return in the response, used for paging.
  13450. func (c *DatafeedstatusesListCall) MaxResults(maxResults int64) *DatafeedstatusesListCall {
  13451. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13452. return c
  13453. }
  13454. // PageToken sets the optional parameter "pageToken": The token returned
  13455. // by the previous request.
  13456. func (c *DatafeedstatusesListCall) PageToken(pageToken string) *DatafeedstatusesListCall {
  13457. c.urlParams_.Set("pageToken", pageToken)
  13458. return c
  13459. }
  13460. // Fields allows partial responses to be retrieved. See
  13461. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13462. // for more information.
  13463. func (c *DatafeedstatusesListCall) Fields(s ...googleapi.Field) *DatafeedstatusesListCall {
  13464. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13465. return c
  13466. }
  13467. // IfNoneMatch sets the optional parameter which makes the operation
  13468. // fail if the object's ETag matches the given value. This is useful for
  13469. // getting updates only after the object has changed since the last
  13470. // request. Use googleapi.IsNotModified to check whether the response
  13471. // error from Do is the result of In-None-Match.
  13472. func (c *DatafeedstatusesListCall) IfNoneMatch(entityTag string) *DatafeedstatusesListCall {
  13473. c.ifNoneMatch_ = entityTag
  13474. return c
  13475. }
  13476. // Context sets the context to be used in this call's Do method. Any
  13477. // pending HTTP request will be aborted if the provided context is
  13478. // canceled.
  13479. func (c *DatafeedstatusesListCall) Context(ctx context.Context) *DatafeedstatusesListCall {
  13480. c.ctx_ = ctx
  13481. return c
  13482. }
  13483. // Header returns an http.Header that can be modified by the caller to
  13484. // add HTTP headers to the request.
  13485. func (c *DatafeedstatusesListCall) Header() http.Header {
  13486. if c.header_ == nil {
  13487. c.header_ = make(http.Header)
  13488. }
  13489. return c.header_
  13490. }
  13491. func (c *DatafeedstatusesListCall) doRequest(alt string) (*http.Response, error) {
  13492. reqHeaders := make(http.Header)
  13493. for k, v := range c.header_ {
  13494. reqHeaders[k] = v
  13495. }
  13496. reqHeaders.Set("User-Agent", c.s.userAgent())
  13497. if c.ifNoneMatch_ != "" {
  13498. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13499. }
  13500. var body io.Reader = nil
  13501. c.urlParams_.Set("alt", alt)
  13502. c.urlParams_.Set("prettyPrint", "false")
  13503. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/datafeedstatuses")
  13504. urls += "?" + c.urlParams_.Encode()
  13505. req, err := http.NewRequest("GET", urls, body)
  13506. if err != nil {
  13507. return nil, err
  13508. }
  13509. req.Header = reqHeaders
  13510. googleapi.Expand(req.URL, map[string]string{
  13511. "merchantId": strconv.FormatUint(c.merchantId, 10),
  13512. })
  13513. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13514. }
  13515. // Do executes the "content.datafeedstatuses.list" call.
  13516. // Exactly one of *DatafeedstatusesListResponse or error will be
  13517. // non-nil. Any non-2xx status code is an error. Response headers are in
  13518. // either *DatafeedstatusesListResponse.ServerResponse.Header or (if a
  13519. // response was returned at all) in error.(*googleapi.Error).Header. Use
  13520. // googleapi.IsNotModified to check whether the returned error was
  13521. // because http.StatusNotModified was returned.
  13522. func (c *DatafeedstatusesListCall) Do(opts ...googleapi.CallOption) (*DatafeedstatusesListResponse, error) {
  13523. gensupport.SetOptions(c.urlParams_, opts...)
  13524. res, err := c.doRequest("json")
  13525. if res != nil && res.StatusCode == http.StatusNotModified {
  13526. if res.Body != nil {
  13527. res.Body.Close()
  13528. }
  13529. return nil, &googleapi.Error{
  13530. Code: res.StatusCode,
  13531. Header: res.Header,
  13532. }
  13533. }
  13534. if err != nil {
  13535. return nil, err
  13536. }
  13537. defer googleapi.CloseBody(res)
  13538. if err := googleapi.CheckResponse(res); err != nil {
  13539. return nil, err
  13540. }
  13541. ret := &DatafeedstatusesListResponse{
  13542. ServerResponse: googleapi.ServerResponse{
  13543. Header: res.Header,
  13544. HTTPStatusCode: res.StatusCode,
  13545. },
  13546. }
  13547. target := &ret
  13548. if err := gensupport.DecodeResponse(target, res); err != nil {
  13549. return nil, err
  13550. }
  13551. return ret, nil
  13552. // {
  13553. // "description": "Lists the statuses of the datafeeds in your Merchant Center account.",
  13554. // "httpMethod": "GET",
  13555. // "id": "content.datafeedstatuses.list",
  13556. // "parameterOrder": [
  13557. // "merchantId"
  13558. // ],
  13559. // "parameters": {
  13560. // "maxResults": {
  13561. // "description": "The maximum number of products to return in the response, used for paging.",
  13562. // "format": "uint32",
  13563. // "location": "query",
  13564. // "type": "integer"
  13565. // },
  13566. // "merchantId": {
  13567. // "description": "The ID of the account that manages the datafeeds. This account cannot be a multi-client account.",
  13568. // "format": "uint64",
  13569. // "location": "path",
  13570. // "required": true,
  13571. // "type": "string"
  13572. // },
  13573. // "pageToken": {
  13574. // "description": "The token returned by the previous request.",
  13575. // "location": "query",
  13576. // "type": "string"
  13577. // }
  13578. // },
  13579. // "path": "{merchantId}/datafeedstatuses",
  13580. // "response": {
  13581. // "$ref": "DatafeedstatusesListResponse"
  13582. // },
  13583. // "scopes": [
  13584. // "https://www.googleapis.com/auth/content"
  13585. // ]
  13586. // }
  13587. }
  13588. // Pages invokes f for each page of results.
  13589. // A non-nil error returned from f will halt the iteration.
  13590. // The provided context supersedes any context provided to the Context method.
  13591. func (c *DatafeedstatusesListCall) Pages(ctx context.Context, f func(*DatafeedstatusesListResponse) error) error {
  13592. c.ctx_ = ctx
  13593. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13594. for {
  13595. x, err := c.Do()
  13596. if err != nil {
  13597. return err
  13598. }
  13599. if err := f(x); err != nil {
  13600. return err
  13601. }
  13602. if x.NextPageToken == "" {
  13603. return nil
  13604. }
  13605. c.PageToken(x.NextPageToken)
  13606. }
  13607. }
  13608. // method id "content.inventory.custombatch":
  13609. type InventoryCustombatchCall struct {
  13610. s *APIService
  13611. inventorycustombatchrequest *InventoryCustomBatchRequest
  13612. urlParams_ gensupport.URLParams
  13613. ctx_ context.Context
  13614. header_ http.Header
  13615. }
  13616. // Custombatch: Updates price and availability for multiple products or
  13617. // stores in a single request. This operation does not update the
  13618. // expiration date of the products.
  13619. func (r *InventoryService) Custombatch(inventorycustombatchrequest *InventoryCustomBatchRequest) *InventoryCustombatchCall {
  13620. c := &InventoryCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13621. c.inventorycustombatchrequest = inventorycustombatchrequest
  13622. return c
  13623. }
  13624. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  13625. // request like in a live environment. If set to true, dry-run mode
  13626. // checks the validity of the request and returns errors (if any).
  13627. func (c *InventoryCustombatchCall) DryRun(dryRun bool) *InventoryCustombatchCall {
  13628. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  13629. return c
  13630. }
  13631. // Fields allows partial responses to be retrieved. See
  13632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13633. // for more information.
  13634. func (c *InventoryCustombatchCall) Fields(s ...googleapi.Field) *InventoryCustombatchCall {
  13635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13636. return c
  13637. }
  13638. // Context sets the context to be used in this call's Do method. Any
  13639. // pending HTTP request will be aborted if the provided context is
  13640. // canceled.
  13641. func (c *InventoryCustombatchCall) Context(ctx context.Context) *InventoryCustombatchCall {
  13642. c.ctx_ = ctx
  13643. return c
  13644. }
  13645. // Header returns an http.Header that can be modified by the caller to
  13646. // add HTTP headers to the request.
  13647. func (c *InventoryCustombatchCall) Header() http.Header {
  13648. if c.header_ == nil {
  13649. c.header_ = make(http.Header)
  13650. }
  13651. return c.header_
  13652. }
  13653. func (c *InventoryCustombatchCall) doRequest(alt string) (*http.Response, error) {
  13654. reqHeaders := make(http.Header)
  13655. for k, v := range c.header_ {
  13656. reqHeaders[k] = v
  13657. }
  13658. reqHeaders.Set("User-Agent", c.s.userAgent())
  13659. var body io.Reader = nil
  13660. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorycustombatchrequest)
  13661. if err != nil {
  13662. return nil, err
  13663. }
  13664. reqHeaders.Set("Content-Type", "application/json")
  13665. c.urlParams_.Set("alt", alt)
  13666. c.urlParams_.Set("prettyPrint", "false")
  13667. urls := googleapi.ResolveRelative(c.s.BasePath, "inventory/batch")
  13668. urls += "?" + c.urlParams_.Encode()
  13669. req, err := http.NewRequest("POST", urls, body)
  13670. if err != nil {
  13671. return nil, err
  13672. }
  13673. req.Header = reqHeaders
  13674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13675. }
  13676. // Do executes the "content.inventory.custombatch" call.
  13677. // Exactly one of *InventoryCustomBatchResponse or error will be
  13678. // non-nil. Any non-2xx status code is an error. Response headers are in
  13679. // either *InventoryCustomBatchResponse.ServerResponse.Header or (if a
  13680. // response was returned at all) in error.(*googleapi.Error).Header. Use
  13681. // googleapi.IsNotModified to check whether the returned error was
  13682. // because http.StatusNotModified was returned.
  13683. func (c *InventoryCustombatchCall) Do(opts ...googleapi.CallOption) (*InventoryCustomBatchResponse, error) {
  13684. gensupport.SetOptions(c.urlParams_, opts...)
  13685. res, err := c.doRequest("json")
  13686. if res != nil && res.StatusCode == http.StatusNotModified {
  13687. if res.Body != nil {
  13688. res.Body.Close()
  13689. }
  13690. return nil, &googleapi.Error{
  13691. Code: res.StatusCode,
  13692. Header: res.Header,
  13693. }
  13694. }
  13695. if err != nil {
  13696. return nil, err
  13697. }
  13698. defer googleapi.CloseBody(res)
  13699. if err := googleapi.CheckResponse(res); err != nil {
  13700. return nil, err
  13701. }
  13702. ret := &InventoryCustomBatchResponse{
  13703. ServerResponse: googleapi.ServerResponse{
  13704. Header: res.Header,
  13705. HTTPStatusCode: res.StatusCode,
  13706. },
  13707. }
  13708. target := &ret
  13709. if err := gensupport.DecodeResponse(target, res); err != nil {
  13710. return nil, err
  13711. }
  13712. return ret, nil
  13713. // {
  13714. // "description": "Updates price and availability for multiple products or stores in a single request. This operation does not update the expiration date of the products.",
  13715. // "httpMethod": "POST",
  13716. // "id": "content.inventory.custombatch",
  13717. // "parameters": {
  13718. // "dryRun": {
  13719. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  13720. // "location": "query",
  13721. // "type": "boolean"
  13722. // }
  13723. // },
  13724. // "path": "inventory/batch",
  13725. // "request": {
  13726. // "$ref": "InventoryCustomBatchRequest"
  13727. // },
  13728. // "response": {
  13729. // "$ref": "InventoryCustomBatchResponse"
  13730. // },
  13731. // "scopes": [
  13732. // "https://www.googleapis.com/auth/content"
  13733. // ]
  13734. // }
  13735. }
  13736. // method id "content.inventory.set":
  13737. type InventorySetCall struct {
  13738. s *APIService
  13739. merchantId uint64
  13740. storeCode string
  13741. productId string
  13742. inventorysetrequest *InventorySetRequest
  13743. urlParams_ gensupport.URLParams
  13744. ctx_ context.Context
  13745. header_ http.Header
  13746. }
  13747. // Set: Updates price and availability of a product in your Merchant
  13748. // Center account.
  13749. func (r *InventoryService) Set(merchantId uint64, storeCode string, productId string, inventorysetrequest *InventorySetRequest) *InventorySetCall {
  13750. c := &InventorySetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13751. c.merchantId = merchantId
  13752. c.storeCode = storeCode
  13753. c.productId = productId
  13754. c.inventorysetrequest = inventorysetrequest
  13755. return c
  13756. }
  13757. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  13758. // request like in a live environment. If set to true, dry-run mode
  13759. // checks the validity of the request and returns errors (if any).
  13760. func (c *InventorySetCall) DryRun(dryRun bool) *InventorySetCall {
  13761. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  13762. return c
  13763. }
  13764. // Fields allows partial responses to be retrieved. See
  13765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13766. // for more information.
  13767. func (c *InventorySetCall) Fields(s ...googleapi.Field) *InventorySetCall {
  13768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13769. return c
  13770. }
  13771. // Context sets the context to be used in this call's Do method. Any
  13772. // pending HTTP request will be aborted if the provided context is
  13773. // canceled.
  13774. func (c *InventorySetCall) Context(ctx context.Context) *InventorySetCall {
  13775. c.ctx_ = ctx
  13776. return c
  13777. }
  13778. // Header returns an http.Header that can be modified by the caller to
  13779. // add HTTP headers to the request.
  13780. func (c *InventorySetCall) Header() http.Header {
  13781. if c.header_ == nil {
  13782. c.header_ = make(http.Header)
  13783. }
  13784. return c.header_
  13785. }
  13786. func (c *InventorySetCall) doRequest(alt string) (*http.Response, error) {
  13787. reqHeaders := make(http.Header)
  13788. for k, v := range c.header_ {
  13789. reqHeaders[k] = v
  13790. }
  13791. reqHeaders.Set("User-Agent", c.s.userAgent())
  13792. var body io.Reader = nil
  13793. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inventorysetrequest)
  13794. if err != nil {
  13795. return nil, err
  13796. }
  13797. reqHeaders.Set("Content-Type", "application/json")
  13798. c.urlParams_.Set("alt", alt)
  13799. c.urlParams_.Set("prettyPrint", "false")
  13800. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/inventory/{storeCode}/products/{productId}")
  13801. urls += "?" + c.urlParams_.Encode()
  13802. req, err := http.NewRequest("POST", urls, body)
  13803. if err != nil {
  13804. return nil, err
  13805. }
  13806. req.Header = reqHeaders
  13807. googleapi.Expand(req.URL, map[string]string{
  13808. "merchantId": strconv.FormatUint(c.merchantId, 10),
  13809. "storeCode": c.storeCode,
  13810. "productId": c.productId,
  13811. })
  13812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13813. }
  13814. // Do executes the "content.inventory.set" call.
  13815. // Exactly one of *InventorySetResponse or error will be non-nil. Any
  13816. // non-2xx status code is an error. Response headers are in either
  13817. // *InventorySetResponse.ServerResponse.Header or (if a response was
  13818. // returned at all) in error.(*googleapi.Error).Header. Use
  13819. // googleapi.IsNotModified to check whether the returned error was
  13820. // because http.StatusNotModified was returned.
  13821. func (c *InventorySetCall) Do(opts ...googleapi.CallOption) (*InventorySetResponse, error) {
  13822. gensupport.SetOptions(c.urlParams_, opts...)
  13823. res, err := c.doRequest("json")
  13824. if res != nil && res.StatusCode == http.StatusNotModified {
  13825. if res.Body != nil {
  13826. res.Body.Close()
  13827. }
  13828. return nil, &googleapi.Error{
  13829. Code: res.StatusCode,
  13830. Header: res.Header,
  13831. }
  13832. }
  13833. if err != nil {
  13834. return nil, err
  13835. }
  13836. defer googleapi.CloseBody(res)
  13837. if err := googleapi.CheckResponse(res); err != nil {
  13838. return nil, err
  13839. }
  13840. ret := &InventorySetResponse{
  13841. ServerResponse: googleapi.ServerResponse{
  13842. Header: res.Header,
  13843. HTTPStatusCode: res.StatusCode,
  13844. },
  13845. }
  13846. target := &ret
  13847. if err := gensupport.DecodeResponse(target, res); err != nil {
  13848. return nil, err
  13849. }
  13850. return ret, nil
  13851. // {
  13852. // "description": "Updates price and availability of a product in your Merchant Center account.",
  13853. // "httpMethod": "POST",
  13854. // "id": "content.inventory.set",
  13855. // "parameterOrder": [
  13856. // "merchantId",
  13857. // "storeCode",
  13858. // "productId"
  13859. // ],
  13860. // "parameters": {
  13861. // "dryRun": {
  13862. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  13863. // "location": "query",
  13864. // "type": "boolean"
  13865. // },
  13866. // "merchantId": {
  13867. // "description": "The ID of the account that contains the product. This account cannot be a multi-client account.",
  13868. // "format": "uint64",
  13869. // "location": "path",
  13870. // "required": true,
  13871. // "type": "string"
  13872. // },
  13873. // "productId": {
  13874. // "description": "The REST ID of the product for which to update price and availability.",
  13875. // "location": "path",
  13876. // "required": true,
  13877. // "type": "string"
  13878. // },
  13879. // "storeCode": {
  13880. // "description": "The code of the store for which to update price and availability. Use online to update price and availability of an online product.",
  13881. // "location": "path",
  13882. // "required": true,
  13883. // "type": "string"
  13884. // }
  13885. // },
  13886. // "path": "{merchantId}/inventory/{storeCode}/products/{productId}",
  13887. // "request": {
  13888. // "$ref": "InventorySetRequest"
  13889. // },
  13890. // "response": {
  13891. // "$ref": "InventorySetResponse"
  13892. // },
  13893. // "scopes": [
  13894. // "https://www.googleapis.com/auth/content"
  13895. // ]
  13896. // }
  13897. }
  13898. // method id "content.liasettings.custombatch":
  13899. type LiasettingsCustombatchCall struct {
  13900. s *APIService
  13901. liasettingscustombatchrequest *LiasettingsCustomBatchRequest
  13902. urlParams_ gensupport.URLParams
  13903. ctx_ context.Context
  13904. header_ http.Header
  13905. }
  13906. // Custombatch: Retrieves and/or updates the LIA settings of multiple
  13907. // accounts in a single request.
  13908. func (r *LiasettingsService) Custombatch(liasettingscustombatchrequest *LiasettingsCustomBatchRequest) *LiasettingsCustombatchCall {
  13909. c := &LiasettingsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13910. c.liasettingscustombatchrequest = liasettingscustombatchrequest
  13911. return c
  13912. }
  13913. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  13914. // request like in a live environment. If set to true, dry-run mode
  13915. // checks the validity of the request and returns errors (if any).
  13916. func (c *LiasettingsCustombatchCall) DryRun(dryRun bool) *LiasettingsCustombatchCall {
  13917. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  13918. return c
  13919. }
  13920. // Fields allows partial responses to be retrieved. See
  13921. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13922. // for more information.
  13923. func (c *LiasettingsCustombatchCall) Fields(s ...googleapi.Field) *LiasettingsCustombatchCall {
  13924. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13925. return c
  13926. }
  13927. // Context sets the context to be used in this call's Do method. Any
  13928. // pending HTTP request will be aborted if the provided context is
  13929. // canceled.
  13930. func (c *LiasettingsCustombatchCall) Context(ctx context.Context) *LiasettingsCustombatchCall {
  13931. c.ctx_ = ctx
  13932. return c
  13933. }
  13934. // Header returns an http.Header that can be modified by the caller to
  13935. // add HTTP headers to the request.
  13936. func (c *LiasettingsCustombatchCall) Header() http.Header {
  13937. if c.header_ == nil {
  13938. c.header_ = make(http.Header)
  13939. }
  13940. return c.header_
  13941. }
  13942. func (c *LiasettingsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  13943. reqHeaders := make(http.Header)
  13944. for k, v := range c.header_ {
  13945. reqHeaders[k] = v
  13946. }
  13947. reqHeaders.Set("User-Agent", c.s.userAgent())
  13948. var body io.Reader = nil
  13949. body, err := googleapi.WithoutDataWrapper.JSONReader(c.liasettingscustombatchrequest)
  13950. if err != nil {
  13951. return nil, err
  13952. }
  13953. reqHeaders.Set("Content-Type", "application/json")
  13954. c.urlParams_.Set("alt", alt)
  13955. c.urlParams_.Set("prettyPrint", "false")
  13956. urls := googleapi.ResolveRelative(c.s.BasePath, "liasettings/batch")
  13957. urls += "?" + c.urlParams_.Encode()
  13958. req, err := http.NewRequest("POST", urls, body)
  13959. if err != nil {
  13960. return nil, err
  13961. }
  13962. req.Header = reqHeaders
  13963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13964. }
  13965. // Do executes the "content.liasettings.custombatch" call.
  13966. // Exactly one of *LiasettingsCustomBatchResponse or error will be
  13967. // non-nil. Any non-2xx status code is an error. Response headers are in
  13968. // either *LiasettingsCustomBatchResponse.ServerResponse.Header or (if a
  13969. // response was returned at all) in error.(*googleapi.Error).Header. Use
  13970. // googleapi.IsNotModified to check whether the returned error was
  13971. // because http.StatusNotModified was returned.
  13972. func (c *LiasettingsCustombatchCall) Do(opts ...googleapi.CallOption) (*LiasettingsCustomBatchResponse, error) {
  13973. gensupport.SetOptions(c.urlParams_, opts...)
  13974. res, err := c.doRequest("json")
  13975. if res != nil && res.StatusCode == http.StatusNotModified {
  13976. if res.Body != nil {
  13977. res.Body.Close()
  13978. }
  13979. return nil, &googleapi.Error{
  13980. Code: res.StatusCode,
  13981. Header: res.Header,
  13982. }
  13983. }
  13984. if err != nil {
  13985. return nil, err
  13986. }
  13987. defer googleapi.CloseBody(res)
  13988. if err := googleapi.CheckResponse(res); err != nil {
  13989. return nil, err
  13990. }
  13991. ret := &LiasettingsCustomBatchResponse{
  13992. ServerResponse: googleapi.ServerResponse{
  13993. Header: res.Header,
  13994. HTTPStatusCode: res.StatusCode,
  13995. },
  13996. }
  13997. target := &ret
  13998. if err := gensupport.DecodeResponse(target, res); err != nil {
  13999. return nil, err
  14000. }
  14001. return ret, nil
  14002. // {
  14003. // "description": "Retrieves and/or updates the LIA settings of multiple accounts in a single request.",
  14004. // "httpMethod": "POST",
  14005. // "id": "content.liasettings.custombatch",
  14006. // "parameters": {
  14007. // "dryRun": {
  14008. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  14009. // "location": "query",
  14010. // "type": "boolean"
  14011. // }
  14012. // },
  14013. // "path": "liasettings/batch",
  14014. // "request": {
  14015. // "$ref": "LiasettingsCustomBatchRequest"
  14016. // },
  14017. // "response": {
  14018. // "$ref": "LiasettingsCustomBatchResponse"
  14019. // },
  14020. // "scopes": [
  14021. // "https://www.googleapis.com/auth/content"
  14022. // ]
  14023. // }
  14024. }
  14025. // method id "content.liasettings.get":
  14026. type LiasettingsGetCall struct {
  14027. s *APIService
  14028. merchantId uint64
  14029. accountId uint64
  14030. urlParams_ gensupport.URLParams
  14031. ifNoneMatch_ string
  14032. ctx_ context.Context
  14033. header_ http.Header
  14034. }
  14035. // Get: Retrieves the LIA settings of the account.
  14036. func (r *LiasettingsService) Get(merchantId uint64, accountId uint64) *LiasettingsGetCall {
  14037. c := &LiasettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14038. c.merchantId = merchantId
  14039. c.accountId = accountId
  14040. return c
  14041. }
  14042. // Fields allows partial responses to be retrieved. See
  14043. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14044. // for more information.
  14045. func (c *LiasettingsGetCall) Fields(s ...googleapi.Field) *LiasettingsGetCall {
  14046. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14047. return c
  14048. }
  14049. // IfNoneMatch sets the optional parameter which makes the operation
  14050. // fail if the object's ETag matches the given value. This is useful for
  14051. // getting updates only after the object has changed since the last
  14052. // request. Use googleapi.IsNotModified to check whether the response
  14053. // error from Do is the result of In-None-Match.
  14054. func (c *LiasettingsGetCall) IfNoneMatch(entityTag string) *LiasettingsGetCall {
  14055. c.ifNoneMatch_ = entityTag
  14056. return c
  14057. }
  14058. // Context sets the context to be used in this call's Do method. Any
  14059. // pending HTTP request will be aborted if the provided context is
  14060. // canceled.
  14061. func (c *LiasettingsGetCall) Context(ctx context.Context) *LiasettingsGetCall {
  14062. c.ctx_ = ctx
  14063. return c
  14064. }
  14065. // Header returns an http.Header that can be modified by the caller to
  14066. // add HTTP headers to the request.
  14067. func (c *LiasettingsGetCall) Header() http.Header {
  14068. if c.header_ == nil {
  14069. c.header_ = make(http.Header)
  14070. }
  14071. return c.header_
  14072. }
  14073. func (c *LiasettingsGetCall) doRequest(alt string) (*http.Response, error) {
  14074. reqHeaders := make(http.Header)
  14075. for k, v := range c.header_ {
  14076. reqHeaders[k] = v
  14077. }
  14078. reqHeaders.Set("User-Agent", c.s.userAgent())
  14079. if c.ifNoneMatch_ != "" {
  14080. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14081. }
  14082. var body io.Reader = nil
  14083. c.urlParams_.Set("alt", alt)
  14084. c.urlParams_.Set("prettyPrint", "false")
  14085. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}")
  14086. urls += "?" + c.urlParams_.Encode()
  14087. req, err := http.NewRequest("GET", urls, body)
  14088. if err != nil {
  14089. return nil, err
  14090. }
  14091. req.Header = reqHeaders
  14092. googleapi.Expand(req.URL, map[string]string{
  14093. "merchantId": strconv.FormatUint(c.merchantId, 10),
  14094. "accountId": strconv.FormatUint(c.accountId, 10),
  14095. })
  14096. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14097. }
  14098. // Do executes the "content.liasettings.get" call.
  14099. // Exactly one of *LiaSettings or error will be non-nil. Any non-2xx
  14100. // status code is an error. Response headers are in either
  14101. // *LiaSettings.ServerResponse.Header or (if a response was returned at
  14102. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14103. // to check whether the returned error was because
  14104. // http.StatusNotModified was returned.
  14105. func (c *LiasettingsGetCall) Do(opts ...googleapi.CallOption) (*LiaSettings, error) {
  14106. gensupport.SetOptions(c.urlParams_, opts...)
  14107. res, err := c.doRequest("json")
  14108. if res != nil && res.StatusCode == http.StatusNotModified {
  14109. if res.Body != nil {
  14110. res.Body.Close()
  14111. }
  14112. return nil, &googleapi.Error{
  14113. Code: res.StatusCode,
  14114. Header: res.Header,
  14115. }
  14116. }
  14117. if err != nil {
  14118. return nil, err
  14119. }
  14120. defer googleapi.CloseBody(res)
  14121. if err := googleapi.CheckResponse(res); err != nil {
  14122. return nil, err
  14123. }
  14124. ret := &LiaSettings{
  14125. ServerResponse: googleapi.ServerResponse{
  14126. Header: res.Header,
  14127. HTTPStatusCode: res.StatusCode,
  14128. },
  14129. }
  14130. target := &ret
  14131. if err := gensupport.DecodeResponse(target, res); err != nil {
  14132. return nil, err
  14133. }
  14134. return ret, nil
  14135. // {
  14136. // "description": "Retrieves the LIA settings of the account.",
  14137. // "httpMethod": "GET",
  14138. // "id": "content.liasettings.get",
  14139. // "parameterOrder": [
  14140. // "merchantId",
  14141. // "accountId"
  14142. // ],
  14143. // "parameters": {
  14144. // "accountId": {
  14145. // "description": "The ID of the account for which to get or update LIA settings.",
  14146. // "format": "uint64",
  14147. // "location": "path",
  14148. // "required": true,
  14149. // "type": "string"
  14150. // },
  14151. // "merchantId": {
  14152. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  14153. // "format": "uint64",
  14154. // "location": "path",
  14155. // "required": true,
  14156. // "type": "string"
  14157. // }
  14158. // },
  14159. // "path": "{merchantId}/liasettings/{accountId}",
  14160. // "response": {
  14161. // "$ref": "LiaSettings"
  14162. // },
  14163. // "scopes": [
  14164. // "https://www.googleapis.com/auth/content"
  14165. // ]
  14166. // }
  14167. }
  14168. // method id "content.liasettings.getaccessiblegmbaccounts":
  14169. type LiasettingsGetaccessiblegmbaccountsCall struct {
  14170. s *APIService
  14171. merchantId uint64
  14172. accountId uint64
  14173. urlParams_ gensupport.URLParams
  14174. ifNoneMatch_ string
  14175. ctx_ context.Context
  14176. header_ http.Header
  14177. }
  14178. // Getaccessiblegmbaccounts: Retrieves the list of accessible Google My
  14179. // Business accounts.
  14180. func (r *LiasettingsService) Getaccessiblegmbaccounts(merchantId uint64, accountId uint64) *LiasettingsGetaccessiblegmbaccountsCall {
  14181. c := &LiasettingsGetaccessiblegmbaccountsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14182. c.merchantId = merchantId
  14183. c.accountId = accountId
  14184. return c
  14185. }
  14186. // Fields allows partial responses to be retrieved. See
  14187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14188. // for more information.
  14189. func (c *LiasettingsGetaccessiblegmbaccountsCall) Fields(s ...googleapi.Field) *LiasettingsGetaccessiblegmbaccountsCall {
  14190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14191. return c
  14192. }
  14193. // IfNoneMatch sets the optional parameter which makes the operation
  14194. // fail if the object's ETag matches the given value. This is useful for
  14195. // getting updates only after the object has changed since the last
  14196. // request. Use googleapi.IsNotModified to check whether the response
  14197. // error from Do is the result of In-None-Match.
  14198. func (c *LiasettingsGetaccessiblegmbaccountsCall) IfNoneMatch(entityTag string) *LiasettingsGetaccessiblegmbaccountsCall {
  14199. c.ifNoneMatch_ = entityTag
  14200. return c
  14201. }
  14202. // Context sets the context to be used in this call's Do method. Any
  14203. // pending HTTP request will be aborted if the provided context is
  14204. // canceled.
  14205. func (c *LiasettingsGetaccessiblegmbaccountsCall) Context(ctx context.Context) *LiasettingsGetaccessiblegmbaccountsCall {
  14206. c.ctx_ = ctx
  14207. return c
  14208. }
  14209. // Header returns an http.Header that can be modified by the caller to
  14210. // add HTTP headers to the request.
  14211. func (c *LiasettingsGetaccessiblegmbaccountsCall) Header() http.Header {
  14212. if c.header_ == nil {
  14213. c.header_ = make(http.Header)
  14214. }
  14215. return c.header_
  14216. }
  14217. func (c *LiasettingsGetaccessiblegmbaccountsCall) doRequest(alt string) (*http.Response, error) {
  14218. reqHeaders := make(http.Header)
  14219. for k, v := range c.header_ {
  14220. reqHeaders[k] = v
  14221. }
  14222. reqHeaders.Set("User-Agent", c.s.userAgent())
  14223. if c.ifNoneMatch_ != "" {
  14224. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14225. }
  14226. var body io.Reader = nil
  14227. c.urlParams_.Set("alt", alt)
  14228. c.urlParams_.Set("prettyPrint", "false")
  14229. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/accessiblegmbaccounts")
  14230. urls += "?" + c.urlParams_.Encode()
  14231. req, err := http.NewRequest("GET", urls, body)
  14232. if err != nil {
  14233. return nil, err
  14234. }
  14235. req.Header = reqHeaders
  14236. googleapi.Expand(req.URL, map[string]string{
  14237. "merchantId": strconv.FormatUint(c.merchantId, 10),
  14238. "accountId": strconv.FormatUint(c.accountId, 10),
  14239. })
  14240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14241. }
  14242. // Do executes the "content.liasettings.getaccessiblegmbaccounts" call.
  14243. // Exactly one of *LiasettingsGetAccessibleGmbAccountsResponse or error
  14244. // will be non-nil. Any non-2xx status code is an error. Response
  14245. // headers are in either
  14246. // *LiasettingsGetAccessibleGmbAccountsResponse.ServerResponse.Header or
  14247. // (if a response was returned at all) in
  14248. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14249. // whether the returned error was because http.StatusNotModified was
  14250. // returned.
  14251. func (c *LiasettingsGetaccessiblegmbaccountsCall) Do(opts ...googleapi.CallOption) (*LiasettingsGetAccessibleGmbAccountsResponse, error) {
  14252. gensupport.SetOptions(c.urlParams_, opts...)
  14253. res, err := c.doRequest("json")
  14254. if res != nil && res.StatusCode == http.StatusNotModified {
  14255. if res.Body != nil {
  14256. res.Body.Close()
  14257. }
  14258. return nil, &googleapi.Error{
  14259. Code: res.StatusCode,
  14260. Header: res.Header,
  14261. }
  14262. }
  14263. if err != nil {
  14264. return nil, err
  14265. }
  14266. defer googleapi.CloseBody(res)
  14267. if err := googleapi.CheckResponse(res); err != nil {
  14268. return nil, err
  14269. }
  14270. ret := &LiasettingsGetAccessibleGmbAccountsResponse{
  14271. ServerResponse: googleapi.ServerResponse{
  14272. Header: res.Header,
  14273. HTTPStatusCode: res.StatusCode,
  14274. },
  14275. }
  14276. target := &ret
  14277. if err := gensupport.DecodeResponse(target, res); err != nil {
  14278. return nil, err
  14279. }
  14280. return ret, nil
  14281. // {
  14282. // "description": "Retrieves the list of accessible Google My Business accounts.",
  14283. // "httpMethod": "GET",
  14284. // "id": "content.liasettings.getaccessiblegmbaccounts",
  14285. // "parameterOrder": [
  14286. // "merchantId",
  14287. // "accountId"
  14288. // ],
  14289. // "parameters": {
  14290. // "accountId": {
  14291. // "description": "The ID of the account for which to retrieve accessible Google My Business accounts.",
  14292. // "format": "uint64",
  14293. // "location": "path",
  14294. // "required": true,
  14295. // "type": "string"
  14296. // },
  14297. // "merchantId": {
  14298. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  14299. // "format": "uint64",
  14300. // "location": "path",
  14301. // "required": true,
  14302. // "type": "string"
  14303. // }
  14304. // },
  14305. // "path": "{merchantId}/liasettings/{accountId}/accessiblegmbaccounts",
  14306. // "response": {
  14307. // "$ref": "LiasettingsGetAccessibleGmbAccountsResponse"
  14308. // },
  14309. // "scopes": [
  14310. // "https://www.googleapis.com/auth/content"
  14311. // ]
  14312. // }
  14313. }
  14314. // method id "content.liasettings.list":
  14315. type LiasettingsListCall struct {
  14316. s *APIService
  14317. merchantId uint64
  14318. urlParams_ gensupport.URLParams
  14319. ifNoneMatch_ string
  14320. ctx_ context.Context
  14321. header_ http.Header
  14322. }
  14323. // List: Lists the LIA settings of the sub-accounts in your Merchant
  14324. // Center account.
  14325. func (r *LiasettingsService) List(merchantId uint64) *LiasettingsListCall {
  14326. c := &LiasettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14327. c.merchantId = merchantId
  14328. return c
  14329. }
  14330. // MaxResults sets the optional parameter "maxResults": The maximum
  14331. // number of LIA settings to return in the response, used for paging.
  14332. func (c *LiasettingsListCall) MaxResults(maxResults int64) *LiasettingsListCall {
  14333. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14334. return c
  14335. }
  14336. // PageToken sets the optional parameter "pageToken": The token returned
  14337. // by the previous request.
  14338. func (c *LiasettingsListCall) PageToken(pageToken string) *LiasettingsListCall {
  14339. c.urlParams_.Set("pageToken", pageToken)
  14340. return c
  14341. }
  14342. // Fields allows partial responses to be retrieved. See
  14343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14344. // for more information.
  14345. func (c *LiasettingsListCall) Fields(s ...googleapi.Field) *LiasettingsListCall {
  14346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14347. return c
  14348. }
  14349. // IfNoneMatch sets the optional parameter which makes the operation
  14350. // fail if the object's ETag matches the given value. This is useful for
  14351. // getting updates only after the object has changed since the last
  14352. // request. Use googleapi.IsNotModified to check whether the response
  14353. // error from Do is the result of In-None-Match.
  14354. func (c *LiasettingsListCall) IfNoneMatch(entityTag string) *LiasettingsListCall {
  14355. c.ifNoneMatch_ = entityTag
  14356. return c
  14357. }
  14358. // Context sets the context to be used in this call's Do method. Any
  14359. // pending HTTP request will be aborted if the provided context is
  14360. // canceled.
  14361. func (c *LiasettingsListCall) Context(ctx context.Context) *LiasettingsListCall {
  14362. c.ctx_ = ctx
  14363. return c
  14364. }
  14365. // Header returns an http.Header that can be modified by the caller to
  14366. // add HTTP headers to the request.
  14367. func (c *LiasettingsListCall) Header() http.Header {
  14368. if c.header_ == nil {
  14369. c.header_ = make(http.Header)
  14370. }
  14371. return c.header_
  14372. }
  14373. func (c *LiasettingsListCall) doRequest(alt string) (*http.Response, error) {
  14374. reqHeaders := make(http.Header)
  14375. for k, v := range c.header_ {
  14376. reqHeaders[k] = v
  14377. }
  14378. reqHeaders.Set("User-Agent", c.s.userAgent())
  14379. if c.ifNoneMatch_ != "" {
  14380. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14381. }
  14382. var body io.Reader = nil
  14383. c.urlParams_.Set("alt", alt)
  14384. c.urlParams_.Set("prettyPrint", "false")
  14385. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings")
  14386. urls += "?" + c.urlParams_.Encode()
  14387. req, err := http.NewRequest("GET", urls, body)
  14388. if err != nil {
  14389. return nil, err
  14390. }
  14391. req.Header = reqHeaders
  14392. googleapi.Expand(req.URL, map[string]string{
  14393. "merchantId": strconv.FormatUint(c.merchantId, 10),
  14394. })
  14395. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14396. }
  14397. // Do executes the "content.liasettings.list" call.
  14398. // Exactly one of *LiasettingsListResponse or error will be non-nil. Any
  14399. // non-2xx status code is an error. Response headers are in either
  14400. // *LiasettingsListResponse.ServerResponse.Header or (if a response was
  14401. // returned at all) in error.(*googleapi.Error).Header. Use
  14402. // googleapi.IsNotModified to check whether the returned error was
  14403. // because http.StatusNotModified was returned.
  14404. func (c *LiasettingsListCall) Do(opts ...googleapi.CallOption) (*LiasettingsListResponse, error) {
  14405. gensupport.SetOptions(c.urlParams_, opts...)
  14406. res, err := c.doRequest("json")
  14407. if res != nil && res.StatusCode == http.StatusNotModified {
  14408. if res.Body != nil {
  14409. res.Body.Close()
  14410. }
  14411. return nil, &googleapi.Error{
  14412. Code: res.StatusCode,
  14413. Header: res.Header,
  14414. }
  14415. }
  14416. if err != nil {
  14417. return nil, err
  14418. }
  14419. defer googleapi.CloseBody(res)
  14420. if err := googleapi.CheckResponse(res); err != nil {
  14421. return nil, err
  14422. }
  14423. ret := &LiasettingsListResponse{
  14424. ServerResponse: googleapi.ServerResponse{
  14425. Header: res.Header,
  14426. HTTPStatusCode: res.StatusCode,
  14427. },
  14428. }
  14429. target := &ret
  14430. if err := gensupport.DecodeResponse(target, res); err != nil {
  14431. return nil, err
  14432. }
  14433. return ret, nil
  14434. // {
  14435. // "description": "Lists the LIA settings of the sub-accounts in your Merchant Center account.",
  14436. // "httpMethod": "GET",
  14437. // "id": "content.liasettings.list",
  14438. // "parameterOrder": [
  14439. // "merchantId"
  14440. // ],
  14441. // "parameters": {
  14442. // "maxResults": {
  14443. // "description": "The maximum number of LIA settings to return in the response, used for paging.",
  14444. // "format": "uint32",
  14445. // "location": "query",
  14446. // "type": "integer"
  14447. // },
  14448. // "merchantId": {
  14449. // "description": "The ID of the managing account. This must be a multi-client account.",
  14450. // "format": "uint64",
  14451. // "location": "path",
  14452. // "required": true,
  14453. // "type": "string"
  14454. // },
  14455. // "pageToken": {
  14456. // "description": "The token returned by the previous request.",
  14457. // "location": "query",
  14458. // "type": "string"
  14459. // }
  14460. // },
  14461. // "path": "{merchantId}/liasettings",
  14462. // "response": {
  14463. // "$ref": "LiasettingsListResponse"
  14464. // },
  14465. // "scopes": [
  14466. // "https://www.googleapis.com/auth/content"
  14467. // ]
  14468. // }
  14469. }
  14470. // Pages invokes f for each page of results.
  14471. // A non-nil error returned from f will halt the iteration.
  14472. // The provided context supersedes any context provided to the Context method.
  14473. func (c *LiasettingsListCall) Pages(ctx context.Context, f func(*LiasettingsListResponse) error) error {
  14474. c.ctx_ = ctx
  14475. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14476. for {
  14477. x, err := c.Do()
  14478. if err != nil {
  14479. return err
  14480. }
  14481. if err := f(x); err != nil {
  14482. return err
  14483. }
  14484. if x.NextPageToken == "" {
  14485. return nil
  14486. }
  14487. c.PageToken(x.NextPageToken)
  14488. }
  14489. }
  14490. // method id "content.liasettings.listposdataproviders":
  14491. type LiasettingsListposdataprovidersCall struct {
  14492. s *APIService
  14493. urlParams_ gensupport.URLParams
  14494. ifNoneMatch_ string
  14495. ctx_ context.Context
  14496. header_ http.Header
  14497. }
  14498. // Listposdataproviders: Retrieves the list of POS data providers that
  14499. // have active settings for the all eiligible countries.
  14500. func (r *LiasettingsService) Listposdataproviders() *LiasettingsListposdataprovidersCall {
  14501. c := &LiasettingsListposdataprovidersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14502. return c
  14503. }
  14504. // Fields allows partial responses to be retrieved. See
  14505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14506. // for more information.
  14507. func (c *LiasettingsListposdataprovidersCall) Fields(s ...googleapi.Field) *LiasettingsListposdataprovidersCall {
  14508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14509. return c
  14510. }
  14511. // IfNoneMatch sets the optional parameter which makes the operation
  14512. // fail if the object's ETag matches the given value. This is useful for
  14513. // getting updates only after the object has changed since the last
  14514. // request. Use googleapi.IsNotModified to check whether the response
  14515. // error from Do is the result of In-None-Match.
  14516. func (c *LiasettingsListposdataprovidersCall) IfNoneMatch(entityTag string) *LiasettingsListposdataprovidersCall {
  14517. c.ifNoneMatch_ = entityTag
  14518. return c
  14519. }
  14520. // Context sets the context to be used in this call's Do method. Any
  14521. // pending HTTP request will be aborted if the provided context is
  14522. // canceled.
  14523. func (c *LiasettingsListposdataprovidersCall) Context(ctx context.Context) *LiasettingsListposdataprovidersCall {
  14524. c.ctx_ = ctx
  14525. return c
  14526. }
  14527. // Header returns an http.Header that can be modified by the caller to
  14528. // add HTTP headers to the request.
  14529. func (c *LiasettingsListposdataprovidersCall) Header() http.Header {
  14530. if c.header_ == nil {
  14531. c.header_ = make(http.Header)
  14532. }
  14533. return c.header_
  14534. }
  14535. func (c *LiasettingsListposdataprovidersCall) doRequest(alt string) (*http.Response, error) {
  14536. reqHeaders := make(http.Header)
  14537. for k, v := range c.header_ {
  14538. reqHeaders[k] = v
  14539. }
  14540. reqHeaders.Set("User-Agent", c.s.userAgent())
  14541. if c.ifNoneMatch_ != "" {
  14542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14543. }
  14544. var body io.Reader = nil
  14545. c.urlParams_.Set("alt", alt)
  14546. c.urlParams_.Set("prettyPrint", "false")
  14547. urls := googleapi.ResolveRelative(c.s.BasePath, "liasettings/posdataproviders")
  14548. urls += "?" + c.urlParams_.Encode()
  14549. req, err := http.NewRequest("GET", urls, body)
  14550. if err != nil {
  14551. return nil, err
  14552. }
  14553. req.Header = reqHeaders
  14554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14555. }
  14556. // Do executes the "content.liasettings.listposdataproviders" call.
  14557. // Exactly one of *LiasettingsListPosDataProvidersResponse or error will
  14558. // be non-nil. Any non-2xx status code is an error. Response headers are
  14559. // in either
  14560. // *LiasettingsListPosDataProvidersResponse.ServerResponse.Header or (if
  14561. // a response was returned at all) in error.(*googleapi.Error).Header.
  14562. // Use googleapi.IsNotModified to check whether the returned error was
  14563. // because http.StatusNotModified was returned.
  14564. func (c *LiasettingsListposdataprovidersCall) Do(opts ...googleapi.CallOption) (*LiasettingsListPosDataProvidersResponse, error) {
  14565. gensupport.SetOptions(c.urlParams_, opts...)
  14566. res, err := c.doRequest("json")
  14567. if res != nil && res.StatusCode == http.StatusNotModified {
  14568. if res.Body != nil {
  14569. res.Body.Close()
  14570. }
  14571. return nil, &googleapi.Error{
  14572. Code: res.StatusCode,
  14573. Header: res.Header,
  14574. }
  14575. }
  14576. if err != nil {
  14577. return nil, err
  14578. }
  14579. defer googleapi.CloseBody(res)
  14580. if err := googleapi.CheckResponse(res); err != nil {
  14581. return nil, err
  14582. }
  14583. ret := &LiasettingsListPosDataProvidersResponse{
  14584. ServerResponse: googleapi.ServerResponse{
  14585. Header: res.Header,
  14586. HTTPStatusCode: res.StatusCode,
  14587. },
  14588. }
  14589. target := &ret
  14590. if err := gensupport.DecodeResponse(target, res); err != nil {
  14591. return nil, err
  14592. }
  14593. return ret, nil
  14594. // {
  14595. // "description": "Retrieves the list of POS data providers that have active settings for the all eiligible countries.",
  14596. // "httpMethod": "GET",
  14597. // "id": "content.liasettings.listposdataproviders",
  14598. // "path": "liasettings/posdataproviders",
  14599. // "response": {
  14600. // "$ref": "LiasettingsListPosDataProvidersResponse"
  14601. // },
  14602. // "scopes": [
  14603. // "https://www.googleapis.com/auth/content"
  14604. // ]
  14605. // }
  14606. }
  14607. // method id "content.liasettings.patch":
  14608. type LiasettingsPatchCall struct {
  14609. s *APIService
  14610. merchantId uint64
  14611. accountId uint64
  14612. liasettings *LiaSettings
  14613. urlParams_ gensupport.URLParams
  14614. ctx_ context.Context
  14615. header_ http.Header
  14616. }
  14617. // Patch: Updates the LIA settings of the account. This method supports
  14618. // patch semantics.
  14619. func (r *LiasettingsService) Patch(merchantId uint64, accountId uint64, liasettings *LiaSettings) *LiasettingsPatchCall {
  14620. c := &LiasettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14621. c.merchantId = merchantId
  14622. c.accountId = accountId
  14623. c.liasettings = liasettings
  14624. return c
  14625. }
  14626. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  14627. // request like in a live environment. If set to true, dry-run mode
  14628. // checks the validity of the request and returns errors (if any).
  14629. func (c *LiasettingsPatchCall) DryRun(dryRun bool) *LiasettingsPatchCall {
  14630. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  14631. return c
  14632. }
  14633. // Fields allows partial responses to be retrieved. See
  14634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14635. // for more information.
  14636. func (c *LiasettingsPatchCall) Fields(s ...googleapi.Field) *LiasettingsPatchCall {
  14637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14638. return c
  14639. }
  14640. // Context sets the context to be used in this call's Do method. Any
  14641. // pending HTTP request will be aborted if the provided context is
  14642. // canceled.
  14643. func (c *LiasettingsPatchCall) Context(ctx context.Context) *LiasettingsPatchCall {
  14644. c.ctx_ = ctx
  14645. return c
  14646. }
  14647. // Header returns an http.Header that can be modified by the caller to
  14648. // add HTTP headers to the request.
  14649. func (c *LiasettingsPatchCall) Header() http.Header {
  14650. if c.header_ == nil {
  14651. c.header_ = make(http.Header)
  14652. }
  14653. return c.header_
  14654. }
  14655. func (c *LiasettingsPatchCall) doRequest(alt string) (*http.Response, error) {
  14656. reqHeaders := make(http.Header)
  14657. for k, v := range c.header_ {
  14658. reqHeaders[k] = v
  14659. }
  14660. reqHeaders.Set("User-Agent", c.s.userAgent())
  14661. var body io.Reader = nil
  14662. body, err := googleapi.WithoutDataWrapper.JSONReader(c.liasettings)
  14663. if err != nil {
  14664. return nil, err
  14665. }
  14666. reqHeaders.Set("Content-Type", "application/json")
  14667. c.urlParams_.Set("alt", alt)
  14668. c.urlParams_.Set("prettyPrint", "false")
  14669. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}")
  14670. urls += "?" + c.urlParams_.Encode()
  14671. req, err := http.NewRequest("PATCH", urls, body)
  14672. if err != nil {
  14673. return nil, err
  14674. }
  14675. req.Header = reqHeaders
  14676. googleapi.Expand(req.URL, map[string]string{
  14677. "merchantId": strconv.FormatUint(c.merchantId, 10),
  14678. "accountId": strconv.FormatUint(c.accountId, 10),
  14679. })
  14680. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14681. }
  14682. // Do executes the "content.liasettings.patch" call.
  14683. // Exactly one of *LiaSettings or error will be non-nil. Any non-2xx
  14684. // status code is an error. Response headers are in either
  14685. // *LiaSettings.ServerResponse.Header or (if a response was returned at
  14686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14687. // to check whether the returned error was because
  14688. // http.StatusNotModified was returned.
  14689. func (c *LiasettingsPatchCall) Do(opts ...googleapi.CallOption) (*LiaSettings, error) {
  14690. gensupport.SetOptions(c.urlParams_, opts...)
  14691. res, err := c.doRequest("json")
  14692. if res != nil && res.StatusCode == http.StatusNotModified {
  14693. if res.Body != nil {
  14694. res.Body.Close()
  14695. }
  14696. return nil, &googleapi.Error{
  14697. Code: res.StatusCode,
  14698. Header: res.Header,
  14699. }
  14700. }
  14701. if err != nil {
  14702. return nil, err
  14703. }
  14704. defer googleapi.CloseBody(res)
  14705. if err := googleapi.CheckResponse(res); err != nil {
  14706. return nil, err
  14707. }
  14708. ret := &LiaSettings{
  14709. ServerResponse: googleapi.ServerResponse{
  14710. Header: res.Header,
  14711. HTTPStatusCode: res.StatusCode,
  14712. },
  14713. }
  14714. target := &ret
  14715. if err := gensupport.DecodeResponse(target, res); err != nil {
  14716. return nil, err
  14717. }
  14718. return ret, nil
  14719. // {
  14720. // "description": "Updates the LIA settings of the account. This method supports patch semantics.",
  14721. // "httpMethod": "PATCH",
  14722. // "id": "content.liasettings.patch",
  14723. // "parameterOrder": [
  14724. // "merchantId",
  14725. // "accountId"
  14726. // ],
  14727. // "parameters": {
  14728. // "accountId": {
  14729. // "description": "The ID of the account for which to get or update LIA settings.",
  14730. // "format": "uint64",
  14731. // "location": "path",
  14732. // "required": true,
  14733. // "type": "string"
  14734. // },
  14735. // "dryRun": {
  14736. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  14737. // "location": "query",
  14738. // "type": "boolean"
  14739. // },
  14740. // "merchantId": {
  14741. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  14742. // "format": "uint64",
  14743. // "location": "path",
  14744. // "required": true,
  14745. // "type": "string"
  14746. // }
  14747. // },
  14748. // "path": "{merchantId}/liasettings/{accountId}",
  14749. // "request": {
  14750. // "$ref": "LiaSettings"
  14751. // },
  14752. // "response": {
  14753. // "$ref": "LiaSettings"
  14754. // },
  14755. // "scopes": [
  14756. // "https://www.googleapis.com/auth/content"
  14757. // ]
  14758. // }
  14759. }
  14760. // method id "content.liasettings.requestgmbaccess":
  14761. type LiasettingsRequestgmbaccessCall struct {
  14762. s *APIService
  14763. merchantId uint64
  14764. accountId uint64
  14765. urlParams_ gensupport.URLParams
  14766. ctx_ context.Context
  14767. header_ http.Header
  14768. }
  14769. // Requestgmbaccess: Requests access to a specified Google My Business
  14770. // account.
  14771. func (r *LiasettingsService) Requestgmbaccess(merchantId uint64, accountId uint64, gmbEmail string) *LiasettingsRequestgmbaccessCall {
  14772. c := &LiasettingsRequestgmbaccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14773. c.merchantId = merchantId
  14774. c.accountId = accountId
  14775. c.urlParams_.Set("gmbEmail", gmbEmail)
  14776. return c
  14777. }
  14778. // Fields allows partial responses to be retrieved. See
  14779. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14780. // for more information.
  14781. func (c *LiasettingsRequestgmbaccessCall) Fields(s ...googleapi.Field) *LiasettingsRequestgmbaccessCall {
  14782. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14783. return c
  14784. }
  14785. // Context sets the context to be used in this call's Do method. Any
  14786. // pending HTTP request will be aborted if the provided context is
  14787. // canceled.
  14788. func (c *LiasettingsRequestgmbaccessCall) Context(ctx context.Context) *LiasettingsRequestgmbaccessCall {
  14789. c.ctx_ = ctx
  14790. return c
  14791. }
  14792. // Header returns an http.Header that can be modified by the caller to
  14793. // add HTTP headers to the request.
  14794. func (c *LiasettingsRequestgmbaccessCall) Header() http.Header {
  14795. if c.header_ == nil {
  14796. c.header_ = make(http.Header)
  14797. }
  14798. return c.header_
  14799. }
  14800. func (c *LiasettingsRequestgmbaccessCall) doRequest(alt string) (*http.Response, error) {
  14801. reqHeaders := make(http.Header)
  14802. for k, v := range c.header_ {
  14803. reqHeaders[k] = v
  14804. }
  14805. reqHeaders.Set("User-Agent", c.s.userAgent())
  14806. var body io.Reader = nil
  14807. c.urlParams_.Set("alt", alt)
  14808. c.urlParams_.Set("prettyPrint", "false")
  14809. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/requestgmbaccess")
  14810. urls += "?" + c.urlParams_.Encode()
  14811. req, err := http.NewRequest("POST", urls, body)
  14812. if err != nil {
  14813. return nil, err
  14814. }
  14815. req.Header = reqHeaders
  14816. googleapi.Expand(req.URL, map[string]string{
  14817. "merchantId": strconv.FormatUint(c.merchantId, 10),
  14818. "accountId": strconv.FormatUint(c.accountId, 10),
  14819. })
  14820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14821. }
  14822. // Do executes the "content.liasettings.requestgmbaccess" call.
  14823. // Exactly one of *LiasettingsRequestGmbAccessResponse or error will be
  14824. // non-nil. Any non-2xx status code is an error. Response headers are in
  14825. // either *LiasettingsRequestGmbAccessResponse.ServerResponse.Header or
  14826. // (if a response was returned at all) in
  14827. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14828. // whether the returned error was because http.StatusNotModified was
  14829. // returned.
  14830. func (c *LiasettingsRequestgmbaccessCall) Do(opts ...googleapi.CallOption) (*LiasettingsRequestGmbAccessResponse, error) {
  14831. gensupport.SetOptions(c.urlParams_, opts...)
  14832. res, err := c.doRequest("json")
  14833. if res != nil && res.StatusCode == http.StatusNotModified {
  14834. if res.Body != nil {
  14835. res.Body.Close()
  14836. }
  14837. return nil, &googleapi.Error{
  14838. Code: res.StatusCode,
  14839. Header: res.Header,
  14840. }
  14841. }
  14842. if err != nil {
  14843. return nil, err
  14844. }
  14845. defer googleapi.CloseBody(res)
  14846. if err := googleapi.CheckResponse(res); err != nil {
  14847. return nil, err
  14848. }
  14849. ret := &LiasettingsRequestGmbAccessResponse{
  14850. ServerResponse: googleapi.ServerResponse{
  14851. Header: res.Header,
  14852. HTTPStatusCode: res.StatusCode,
  14853. },
  14854. }
  14855. target := &ret
  14856. if err := gensupport.DecodeResponse(target, res); err != nil {
  14857. return nil, err
  14858. }
  14859. return ret, nil
  14860. // {
  14861. // "description": "Requests access to a specified Google My Business account.",
  14862. // "httpMethod": "POST",
  14863. // "id": "content.liasettings.requestgmbaccess",
  14864. // "parameterOrder": [
  14865. // "merchantId",
  14866. // "accountId",
  14867. // "gmbEmail"
  14868. // ],
  14869. // "parameters": {
  14870. // "accountId": {
  14871. // "description": "The ID of the account for which GMB access is requested.",
  14872. // "format": "uint64",
  14873. // "location": "path",
  14874. // "required": true,
  14875. // "type": "string"
  14876. // },
  14877. // "gmbEmail": {
  14878. // "description": "The email of the Google My Business account.",
  14879. // "location": "query",
  14880. // "required": true,
  14881. // "type": "string"
  14882. // },
  14883. // "merchantId": {
  14884. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  14885. // "format": "uint64",
  14886. // "location": "path",
  14887. // "required": true,
  14888. // "type": "string"
  14889. // }
  14890. // },
  14891. // "path": "{merchantId}/liasettings/{accountId}/requestgmbaccess",
  14892. // "response": {
  14893. // "$ref": "LiasettingsRequestGmbAccessResponse"
  14894. // },
  14895. // "scopes": [
  14896. // "https://www.googleapis.com/auth/content"
  14897. // ]
  14898. // }
  14899. }
  14900. // method id "content.liasettings.requestinventoryverification":
  14901. type LiasettingsRequestinventoryverificationCall struct {
  14902. s *APIService
  14903. merchantId uint64
  14904. accountId uint64
  14905. country string
  14906. urlParams_ gensupport.URLParams
  14907. ctx_ context.Context
  14908. header_ http.Header
  14909. }
  14910. // Requestinventoryverification: Requests inventory validation for the
  14911. // specified country.
  14912. func (r *LiasettingsService) Requestinventoryverification(merchantId uint64, accountId uint64, country string) *LiasettingsRequestinventoryverificationCall {
  14913. c := &LiasettingsRequestinventoryverificationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14914. c.merchantId = merchantId
  14915. c.accountId = accountId
  14916. c.country = country
  14917. return c
  14918. }
  14919. // Fields allows partial responses to be retrieved. See
  14920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14921. // for more information.
  14922. func (c *LiasettingsRequestinventoryverificationCall) Fields(s ...googleapi.Field) *LiasettingsRequestinventoryverificationCall {
  14923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14924. return c
  14925. }
  14926. // Context sets the context to be used in this call's Do method. Any
  14927. // pending HTTP request will be aborted if the provided context is
  14928. // canceled.
  14929. func (c *LiasettingsRequestinventoryverificationCall) Context(ctx context.Context) *LiasettingsRequestinventoryverificationCall {
  14930. c.ctx_ = ctx
  14931. return c
  14932. }
  14933. // Header returns an http.Header that can be modified by the caller to
  14934. // add HTTP headers to the request.
  14935. func (c *LiasettingsRequestinventoryverificationCall) Header() http.Header {
  14936. if c.header_ == nil {
  14937. c.header_ = make(http.Header)
  14938. }
  14939. return c.header_
  14940. }
  14941. func (c *LiasettingsRequestinventoryverificationCall) doRequest(alt string) (*http.Response, error) {
  14942. reqHeaders := make(http.Header)
  14943. for k, v := range c.header_ {
  14944. reqHeaders[k] = v
  14945. }
  14946. reqHeaders.Set("User-Agent", c.s.userAgent())
  14947. var body io.Reader = nil
  14948. c.urlParams_.Set("alt", alt)
  14949. c.urlParams_.Set("prettyPrint", "false")
  14950. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/requestinventoryverification/{country}")
  14951. urls += "?" + c.urlParams_.Encode()
  14952. req, err := http.NewRequest("POST", urls, body)
  14953. if err != nil {
  14954. return nil, err
  14955. }
  14956. req.Header = reqHeaders
  14957. googleapi.Expand(req.URL, map[string]string{
  14958. "merchantId": strconv.FormatUint(c.merchantId, 10),
  14959. "accountId": strconv.FormatUint(c.accountId, 10),
  14960. "country": c.country,
  14961. })
  14962. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14963. }
  14964. // Do executes the "content.liasettings.requestinventoryverification" call.
  14965. // Exactly one of *LiasettingsRequestInventoryVerificationResponse or
  14966. // error will be non-nil. Any non-2xx status code is an error. Response
  14967. // headers are in either
  14968. // *LiasettingsRequestInventoryVerificationResponse.ServerResponse.Header
  14969. // or (if a response was returned at all) in
  14970. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14971. // whether the returned error was because http.StatusNotModified was
  14972. // returned.
  14973. func (c *LiasettingsRequestinventoryverificationCall) Do(opts ...googleapi.CallOption) (*LiasettingsRequestInventoryVerificationResponse, error) {
  14974. gensupport.SetOptions(c.urlParams_, opts...)
  14975. res, err := c.doRequest("json")
  14976. if res != nil && res.StatusCode == http.StatusNotModified {
  14977. if res.Body != nil {
  14978. res.Body.Close()
  14979. }
  14980. return nil, &googleapi.Error{
  14981. Code: res.StatusCode,
  14982. Header: res.Header,
  14983. }
  14984. }
  14985. if err != nil {
  14986. return nil, err
  14987. }
  14988. defer googleapi.CloseBody(res)
  14989. if err := googleapi.CheckResponse(res); err != nil {
  14990. return nil, err
  14991. }
  14992. ret := &LiasettingsRequestInventoryVerificationResponse{
  14993. ServerResponse: googleapi.ServerResponse{
  14994. Header: res.Header,
  14995. HTTPStatusCode: res.StatusCode,
  14996. },
  14997. }
  14998. target := &ret
  14999. if err := gensupport.DecodeResponse(target, res); err != nil {
  15000. return nil, err
  15001. }
  15002. return ret, nil
  15003. // {
  15004. // "description": "Requests inventory validation for the specified country.",
  15005. // "httpMethod": "POST",
  15006. // "id": "content.liasettings.requestinventoryverification",
  15007. // "parameterOrder": [
  15008. // "merchantId",
  15009. // "accountId",
  15010. // "country"
  15011. // ],
  15012. // "parameters": {
  15013. // "accountId": {
  15014. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  15015. // "format": "uint64",
  15016. // "location": "path",
  15017. // "required": true,
  15018. // "type": "string"
  15019. // },
  15020. // "country": {
  15021. // "description": "The country for which inventory validation is requested.",
  15022. // "location": "path",
  15023. // "required": true,
  15024. // "type": "string"
  15025. // },
  15026. // "merchantId": {
  15027. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  15028. // "format": "uint64",
  15029. // "location": "path",
  15030. // "required": true,
  15031. // "type": "string"
  15032. // }
  15033. // },
  15034. // "path": "{merchantId}/liasettings/{accountId}/requestinventoryverification/{country}",
  15035. // "response": {
  15036. // "$ref": "LiasettingsRequestInventoryVerificationResponse"
  15037. // },
  15038. // "scopes": [
  15039. // "https://www.googleapis.com/auth/content"
  15040. // ]
  15041. // }
  15042. }
  15043. // method id "content.liasettings.setinventoryverificationcontact":
  15044. type LiasettingsSetinventoryverificationcontactCall struct {
  15045. s *APIService
  15046. merchantId uint64
  15047. accountId uint64
  15048. urlParams_ gensupport.URLParams
  15049. ctx_ context.Context
  15050. header_ http.Header
  15051. }
  15052. // Setinventoryverificationcontact: Sets the inventory verification
  15053. // contract for the specified country.
  15054. func (r *LiasettingsService) Setinventoryverificationcontact(merchantId uint64, accountId uint64, contactEmail string, contactName string, country string, language string) *LiasettingsSetinventoryverificationcontactCall {
  15055. c := &LiasettingsSetinventoryverificationcontactCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15056. c.merchantId = merchantId
  15057. c.accountId = accountId
  15058. c.urlParams_.Set("contactEmail", contactEmail)
  15059. c.urlParams_.Set("contactName", contactName)
  15060. c.urlParams_.Set("country", country)
  15061. c.urlParams_.Set("language", language)
  15062. return c
  15063. }
  15064. // Fields allows partial responses to be retrieved. See
  15065. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15066. // for more information.
  15067. func (c *LiasettingsSetinventoryverificationcontactCall) Fields(s ...googleapi.Field) *LiasettingsSetinventoryverificationcontactCall {
  15068. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15069. return c
  15070. }
  15071. // Context sets the context to be used in this call's Do method. Any
  15072. // pending HTTP request will be aborted if the provided context is
  15073. // canceled.
  15074. func (c *LiasettingsSetinventoryverificationcontactCall) Context(ctx context.Context) *LiasettingsSetinventoryverificationcontactCall {
  15075. c.ctx_ = ctx
  15076. return c
  15077. }
  15078. // Header returns an http.Header that can be modified by the caller to
  15079. // add HTTP headers to the request.
  15080. func (c *LiasettingsSetinventoryverificationcontactCall) Header() http.Header {
  15081. if c.header_ == nil {
  15082. c.header_ = make(http.Header)
  15083. }
  15084. return c.header_
  15085. }
  15086. func (c *LiasettingsSetinventoryverificationcontactCall) doRequest(alt string) (*http.Response, error) {
  15087. reqHeaders := make(http.Header)
  15088. for k, v := range c.header_ {
  15089. reqHeaders[k] = v
  15090. }
  15091. reqHeaders.Set("User-Agent", c.s.userAgent())
  15092. var body io.Reader = nil
  15093. c.urlParams_.Set("alt", alt)
  15094. c.urlParams_.Set("prettyPrint", "false")
  15095. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/setinventoryverificationcontact")
  15096. urls += "?" + c.urlParams_.Encode()
  15097. req, err := http.NewRequest("POST", urls, body)
  15098. if err != nil {
  15099. return nil, err
  15100. }
  15101. req.Header = reqHeaders
  15102. googleapi.Expand(req.URL, map[string]string{
  15103. "merchantId": strconv.FormatUint(c.merchantId, 10),
  15104. "accountId": strconv.FormatUint(c.accountId, 10),
  15105. })
  15106. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15107. }
  15108. // Do executes the "content.liasettings.setinventoryverificationcontact" call.
  15109. // Exactly one of *LiasettingsSetInventoryVerificationContactResponse or
  15110. // error will be non-nil. Any non-2xx status code is an error. Response
  15111. // headers are in either
  15112. // *LiasettingsSetInventoryVerificationContactResponse.ServerResponse.Hea
  15113. // der or (if a response was returned at all) in
  15114. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15115. // whether the returned error was because http.StatusNotModified was
  15116. // returned.
  15117. func (c *LiasettingsSetinventoryverificationcontactCall) Do(opts ...googleapi.CallOption) (*LiasettingsSetInventoryVerificationContactResponse, error) {
  15118. gensupport.SetOptions(c.urlParams_, opts...)
  15119. res, err := c.doRequest("json")
  15120. if res != nil && res.StatusCode == http.StatusNotModified {
  15121. if res.Body != nil {
  15122. res.Body.Close()
  15123. }
  15124. return nil, &googleapi.Error{
  15125. Code: res.StatusCode,
  15126. Header: res.Header,
  15127. }
  15128. }
  15129. if err != nil {
  15130. return nil, err
  15131. }
  15132. defer googleapi.CloseBody(res)
  15133. if err := googleapi.CheckResponse(res); err != nil {
  15134. return nil, err
  15135. }
  15136. ret := &LiasettingsSetInventoryVerificationContactResponse{
  15137. ServerResponse: googleapi.ServerResponse{
  15138. Header: res.Header,
  15139. HTTPStatusCode: res.StatusCode,
  15140. },
  15141. }
  15142. target := &ret
  15143. if err := gensupport.DecodeResponse(target, res); err != nil {
  15144. return nil, err
  15145. }
  15146. return ret, nil
  15147. // {
  15148. // "description": "Sets the inventory verification contract for the specified country.",
  15149. // "httpMethod": "POST",
  15150. // "id": "content.liasettings.setinventoryverificationcontact",
  15151. // "parameterOrder": [
  15152. // "merchantId",
  15153. // "accountId",
  15154. // "contactEmail",
  15155. // "contactName",
  15156. // "country",
  15157. // "language"
  15158. // ],
  15159. // "parameters": {
  15160. // "accountId": {
  15161. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  15162. // "format": "uint64",
  15163. // "location": "path",
  15164. // "required": true,
  15165. // "type": "string"
  15166. // },
  15167. // "contactEmail": {
  15168. // "description": "The email of the inventory verification contact.",
  15169. // "location": "query",
  15170. // "required": true,
  15171. // "type": "string"
  15172. // },
  15173. // "contactName": {
  15174. // "description": "The name of the inventory verification contact.",
  15175. // "location": "query",
  15176. // "required": true,
  15177. // "type": "string"
  15178. // },
  15179. // "country": {
  15180. // "description": "The country for which inventory verification is requested.",
  15181. // "location": "query",
  15182. // "required": true,
  15183. // "type": "string"
  15184. // },
  15185. // "language": {
  15186. // "description": "The language for which inventory verification is requested.",
  15187. // "location": "query",
  15188. // "required": true,
  15189. // "type": "string"
  15190. // },
  15191. // "merchantId": {
  15192. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  15193. // "format": "uint64",
  15194. // "location": "path",
  15195. // "required": true,
  15196. // "type": "string"
  15197. // }
  15198. // },
  15199. // "path": "{merchantId}/liasettings/{accountId}/setinventoryverificationcontact",
  15200. // "response": {
  15201. // "$ref": "LiasettingsSetInventoryVerificationContactResponse"
  15202. // },
  15203. // "scopes": [
  15204. // "https://www.googleapis.com/auth/content"
  15205. // ]
  15206. // }
  15207. }
  15208. // method id "content.liasettings.setposdataprovider":
  15209. type LiasettingsSetposdataproviderCall struct {
  15210. s *APIService
  15211. merchantId uint64
  15212. accountId uint64
  15213. urlParams_ gensupport.URLParams
  15214. ctx_ context.Context
  15215. header_ http.Header
  15216. }
  15217. // Setposdataprovider: Sets the POS data provider for the specified
  15218. // country.
  15219. func (r *LiasettingsService) Setposdataprovider(merchantId uint64, accountId uint64, country string) *LiasettingsSetposdataproviderCall {
  15220. c := &LiasettingsSetposdataproviderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15221. c.merchantId = merchantId
  15222. c.accountId = accountId
  15223. c.urlParams_.Set("country", country)
  15224. return c
  15225. }
  15226. // PosDataProviderId sets the optional parameter "posDataProviderId":
  15227. // The ID of POS data provider.
  15228. func (c *LiasettingsSetposdataproviderCall) PosDataProviderId(posDataProviderId uint64) *LiasettingsSetposdataproviderCall {
  15229. c.urlParams_.Set("posDataProviderId", fmt.Sprint(posDataProviderId))
  15230. return c
  15231. }
  15232. // PosExternalAccountId sets the optional parameter
  15233. // "posExternalAccountId": The account ID by which this merchant is
  15234. // known to the POS data provider.
  15235. func (c *LiasettingsSetposdataproviderCall) PosExternalAccountId(posExternalAccountId string) *LiasettingsSetposdataproviderCall {
  15236. c.urlParams_.Set("posExternalAccountId", posExternalAccountId)
  15237. return c
  15238. }
  15239. // Fields allows partial responses to be retrieved. See
  15240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15241. // for more information.
  15242. func (c *LiasettingsSetposdataproviderCall) Fields(s ...googleapi.Field) *LiasettingsSetposdataproviderCall {
  15243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15244. return c
  15245. }
  15246. // Context sets the context to be used in this call's Do method. Any
  15247. // pending HTTP request will be aborted if the provided context is
  15248. // canceled.
  15249. func (c *LiasettingsSetposdataproviderCall) Context(ctx context.Context) *LiasettingsSetposdataproviderCall {
  15250. c.ctx_ = ctx
  15251. return c
  15252. }
  15253. // Header returns an http.Header that can be modified by the caller to
  15254. // add HTTP headers to the request.
  15255. func (c *LiasettingsSetposdataproviderCall) Header() http.Header {
  15256. if c.header_ == nil {
  15257. c.header_ = make(http.Header)
  15258. }
  15259. return c.header_
  15260. }
  15261. func (c *LiasettingsSetposdataproviderCall) doRequest(alt string) (*http.Response, error) {
  15262. reqHeaders := make(http.Header)
  15263. for k, v := range c.header_ {
  15264. reqHeaders[k] = v
  15265. }
  15266. reqHeaders.Set("User-Agent", c.s.userAgent())
  15267. var body io.Reader = nil
  15268. c.urlParams_.Set("alt", alt)
  15269. c.urlParams_.Set("prettyPrint", "false")
  15270. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}/setposdataprovider")
  15271. urls += "?" + c.urlParams_.Encode()
  15272. req, err := http.NewRequest("POST", urls, body)
  15273. if err != nil {
  15274. return nil, err
  15275. }
  15276. req.Header = reqHeaders
  15277. googleapi.Expand(req.URL, map[string]string{
  15278. "merchantId": strconv.FormatUint(c.merchantId, 10),
  15279. "accountId": strconv.FormatUint(c.accountId, 10),
  15280. })
  15281. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15282. }
  15283. // Do executes the "content.liasettings.setposdataprovider" call.
  15284. // Exactly one of *LiasettingsSetPosDataProviderResponse or error will
  15285. // be non-nil. Any non-2xx status code is an error. Response headers are
  15286. // in either
  15287. // *LiasettingsSetPosDataProviderResponse.ServerResponse.Header or (if a
  15288. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15289. // googleapi.IsNotModified to check whether the returned error was
  15290. // because http.StatusNotModified was returned.
  15291. func (c *LiasettingsSetposdataproviderCall) Do(opts ...googleapi.CallOption) (*LiasettingsSetPosDataProviderResponse, error) {
  15292. gensupport.SetOptions(c.urlParams_, opts...)
  15293. res, err := c.doRequest("json")
  15294. if res != nil && res.StatusCode == http.StatusNotModified {
  15295. if res.Body != nil {
  15296. res.Body.Close()
  15297. }
  15298. return nil, &googleapi.Error{
  15299. Code: res.StatusCode,
  15300. Header: res.Header,
  15301. }
  15302. }
  15303. if err != nil {
  15304. return nil, err
  15305. }
  15306. defer googleapi.CloseBody(res)
  15307. if err := googleapi.CheckResponse(res); err != nil {
  15308. return nil, err
  15309. }
  15310. ret := &LiasettingsSetPosDataProviderResponse{
  15311. ServerResponse: googleapi.ServerResponse{
  15312. Header: res.Header,
  15313. HTTPStatusCode: res.StatusCode,
  15314. },
  15315. }
  15316. target := &ret
  15317. if err := gensupport.DecodeResponse(target, res); err != nil {
  15318. return nil, err
  15319. }
  15320. return ret, nil
  15321. // {
  15322. // "description": "Sets the POS data provider for the specified country.",
  15323. // "httpMethod": "POST",
  15324. // "id": "content.liasettings.setposdataprovider",
  15325. // "parameterOrder": [
  15326. // "merchantId",
  15327. // "accountId",
  15328. // "country"
  15329. // ],
  15330. // "parameters": {
  15331. // "accountId": {
  15332. // "description": "The ID of the account for which to retrieve accessible Google My Business accounts.",
  15333. // "format": "uint64",
  15334. // "location": "path",
  15335. // "required": true,
  15336. // "type": "string"
  15337. // },
  15338. // "country": {
  15339. // "description": "The country for which the POS data provider is selected.",
  15340. // "location": "query",
  15341. // "required": true,
  15342. // "type": "string"
  15343. // },
  15344. // "merchantId": {
  15345. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  15346. // "format": "uint64",
  15347. // "location": "path",
  15348. // "required": true,
  15349. // "type": "string"
  15350. // },
  15351. // "posDataProviderId": {
  15352. // "description": "The ID of POS data provider.",
  15353. // "format": "uint64",
  15354. // "location": "query",
  15355. // "type": "string"
  15356. // },
  15357. // "posExternalAccountId": {
  15358. // "description": "The account ID by which this merchant is known to the POS data provider.",
  15359. // "location": "query",
  15360. // "type": "string"
  15361. // }
  15362. // },
  15363. // "path": "{merchantId}/liasettings/{accountId}/setposdataprovider",
  15364. // "response": {
  15365. // "$ref": "LiasettingsSetPosDataProviderResponse"
  15366. // },
  15367. // "scopes": [
  15368. // "https://www.googleapis.com/auth/content"
  15369. // ]
  15370. // }
  15371. }
  15372. // method id "content.liasettings.update":
  15373. type LiasettingsUpdateCall struct {
  15374. s *APIService
  15375. merchantId uint64
  15376. accountId uint64
  15377. liasettings *LiaSettings
  15378. urlParams_ gensupport.URLParams
  15379. ctx_ context.Context
  15380. header_ http.Header
  15381. }
  15382. // Update: Updates the LIA settings of the account.
  15383. func (r *LiasettingsService) Update(merchantId uint64, accountId uint64, liasettings *LiaSettings) *LiasettingsUpdateCall {
  15384. c := &LiasettingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15385. c.merchantId = merchantId
  15386. c.accountId = accountId
  15387. c.liasettings = liasettings
  15388. return c
  15389. }
  15390. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  15391. // request like in a live environment. If set to true, dry-run mode
  15392. // checks the validity of the request and returns errors (if any).
  15393. func (c *LiasettingsUpdateCall) DryRun(dryRun bool) *LiasettingsUpdateCall {
  15394. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  15395. return c
  15396. }
  15397. // Fields allows partial responses to be retrieved. See
  15398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15399. // for more information.
  15400. func (c *LiasettingsUpdateCall) Fields(s ...googleapi.Field) *LiasettingsUpdateCall {
  15401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15402. return c
  15403. }
  15404. // Context sets the context to be used in this call's Do method. Any
  15405. // pending HTTP request will be aborted if the provided context is
  15406. // canceled.
  15407. func (c *LiasettingsUpdateCall) Context(ctx context.Context) *LiasettingsUpdateCall {
  15408. c.ctx_ = ctx
  15409. return c
  15410. }
  15411. // Header returns an http.Header that can be modified by the caller to
  15412. // add HTTP headers to the request.
  15413. func (c *LiasettingsUpdateCall) Header() http.Header {
  15414. if c.header_ == nil {
  15415. c.header_ = make(http.Header)
  15416. }
  15417. return c.header_
  15418. }
  15419. func (c *LiasettingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15420. reqHeaders := make(http.Header)
  15421. for k, v := range c.header_ {
  15422. reqHeaders[k] = v
  15423. }
  15424. reqHeaders.Set("User-Agent", c.s.userAgent())
  15425. var body io.Reader = nil
  15426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.liasettings)
  15427. if err != nil {
  15428. return nil, err
  15429. }
  15430. reqHeaders.Set("Content-Type", "application/json")
  15431. c.urlParams_.Set("alt", alt)
  15432. c.urlParams_.Set("prettyPrint", "false")
  15433. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/liasettings/{accountId}")
  15434. urls += "?" + c.urlParams_.Encode()
  15435. req, err := http.NewRequest("PUT", urls, body)
  15436. if err != nil {
  15437. return nil, err
  15438. }
  15439. req.Header = reqHeaders
  15440. googleapi.Expand(req.URL, map[string]string{
  15441. "merchantId": strconv.FormatUint(c.merchantId, 10),
  15442. "accountId": strconv.FormatUint(c.accountId, 10),
  15443. })
  15444. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15445. }
  15446. // Do executes the "content.liasettings.update" call.
  15447. // Exactly one of *LiaSettings or error will be non-nil. Any non-2xx
  15448. // status code is an error. Response headers are in either
  15449. // *LiaSettings.ServerResponse.Header or (if a response was returned at
  15450. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15451. // to check whether the returned error was because
  15452. // http.StatusNotModified was returned.
  15453. func (c *LiasettingsUpdateCall) Do(opts ...googleapi.CallOption) (*LiaSettings, error) {
  15454. gensupport.SetOptions(c.urlParams_, opts...)
  15455. res, err := c.doRequest("json")
  15456. if res != nil && res.StatusCode == http.StatusNotModified {
  15457. if res.Body != nil {
  15458. res.Body.Close()
  15459. }
  15460. return nil, &googleapi.Error{
  15461. Code: res.StatusCode,
  15462. Header: res.Header,
  15463. }
  15464. }
  15465. if err != nil {
  15466. return nil, err
  15467. }
  15468. defer googleapi.CloseBody(res)
  15469. if err := googleapi.CheckResponse(res); err != nil {
  15470. return nil, err
  15471. }
  15472. ret := &LiaSettings{
  15473. ServerResponse: googleapi.ServerResponse{
  15474. Header: res.Header,
  15475. HTTPStatusCode: res.StatusCode,
  15476. },
  15477. }
  15478. target := &ret
  15479. if err := gensupport.DecodeResponse(target, res); err != nil {
  15480. return nil, err
  15481. }
  15482. return ret, nil
  15483. // {
  15484. // "description": "Updates the LIA settings of the account.",
  15485. // "httpMethod": "PUT",
  15486. // "id": "content.liasettings.update",
  15487. // "parameterOrder": [
  15488. // "merchantId",
  15489. // "accountId"
  15490. // ],
  15491. // "parameters": {
  15492. // "accountId": {
  15493. // "description": "The ID of the account for which to get or update LIA settings.",
  15494. // "format": "uint64",
  15495. // "location": "path",
  15496. // "required": true,
  15497. // "type": "string"
  15498. // },
  15499. // "dryRun": {
  15500. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  15501. // "location": "query",
  15502. // "type": "boolean"
  15503. // },
  15504. // "merchantId": {
  15505. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  15506. // "format": "uint64",
  15507. // "location": "path",
  15508. // "required": true,
  15509. // "type": "string"
  15510. // }
  15511. // },
  15512. // "path": "{merchantId}/liasettings/{accountId}",
  15513. // "request": {
  15514. // "$ref": "LiaSettings"
  15515. // },
  15516. // "response": {
  15517. // "$ref": "LiaSettings"
  15518. // },
  15519. // "scopes": [
  15520. // "https://www.googleapis.com/auth/content"
  15521. // ]
  15522. // }
  15523. }
  15524. // method id "content.orderinvoices.createchargeinvoice":
  15525. type OrderinvoicesCreatechargeinvoiceCall struct {
  15526. s *APIService
  15527. merchantId uint64
  15528. orderId string
  15529. orderinvoicescreatechargeinvoicerequest *OrderinvoicesCreateChargeInvoiceRequest
  15530. urlParams_ gensupport.URLParams
  15531. ctx_ context.Context
  15532. header_ http.Header
  15533. }
  15534. // Createchargeinvoice: Creates a charge invoice for a shipment group,
  15535. // and triggers a charge capture for non-facilitated payment orders.
  15536. func (r *OrderinvoicesService) Createchargeinvoice(merchantId uint64, orderId string, orderinvoicescreatechargeinvoicerequest *OrderinvoicesCreateChargeInvoiceRequest) *OrderinvoicesCreatechargeinvoiceCall {
  15537. c := &OrderinvoicesCreatechargeinvoiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15538. c.merchantId = merchantId
  15539. c.orderId = orderId
  15540. c.orderinvoicescreatechargeinvoicerequest = orderinvoicescreatechargeinvoicerequest
  15541. return c
  15542. }
  15543. // Fields allows partial responses to be retrieved. See
  15544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15545. // for more information.
  15546. func (c *OrderinvoicesCreatechargeinvoiceCall) Fields(s ...googleapi.Field) *OrderinvoicesCreatechargeinvoiceCall {
  15547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15548. return c
  15549. }
  15550. // Context sets the context to be used in this call's Do method. Any
  15551. // pending HTTP request will be aborted if the provided context is
  15552. // canceled.
  15553. func (c *OrderinvoicesCreatechargeinvoiceCall) Context(ctx context.Context) *OrderinvoicesCreatechargeinvoiceCall {
  15554. c.ctx_ = ctx
  15555. return c
  15556. }
  15557. // Header returns an http.Header that can be modified by the caller to
  15558. // add HTTP headers to the request.
  15559. func (c *OrderinvoicesCreatechargeinvoiceCall) Header() http.Header {
  15560. if c.header_ == nil {
  15561. c.header_ = make(http.Header)
  15562. }
  15563. return c.header_
  15564. }
  15565. func (c *OrderinvoicesCreatechargeinvoiceCall) doRequest(alt string) (*http.Response, error) {
  15566. reqHeaders := make(http.Header)
  15567. for k, v := range c.header_ {
  15568. reqHeaders[k] = v
  15569. }
  15570. reqHeaders.Set("User-Agent", c.s.userAgent())
  15571. var body io.Reader = nil
  15572. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderinvoicescreatechargeinvoicerequest)
  15573. if err != nil {
  15574. return nil, err
  15575. }
  15576. reqHeaders.Set("Content-Type", "application/json")
  15577. c.urlParams_.Set("alt", alt)
  15578. c.urlParams_.Set("prettyPrint", "false")
  15579. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderinvoices/{orderId}/createChargeInvoice")
  15580. urls += "?" + c.urlParams_.Encode()
  15581. req, err := http.NewRequest("POST", urls, body)
  15582. if err != nil {
  15583. return nil, err
  15584. }
  15585. req.Header = reqHeaders
  15586. googleapi.Expand(req.URL, map[string]string{
  15587. "merchantId": strconv.FormatUint(c.merchantId, 10),
  15588. "orderId": c.orderId,
  15589. })
  15590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15591. }
  15592. // Do executes the "content.orderinvoices.createchargeinvoice" call.
  15593. // Exactly one of *OrderinvoicesCreateChargeInvoiceResponse or error
  15594. // will be non-nil. Any non-2xx status code is an error. Response
  15595. // headers are in either
  15596. // *OrderinvoicesCreateChargeInvoiceResponse.ServerResponse.Header or
  15597. // (if a response was returned at all) in
  15598. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15599. // whether the returned error was because http.StatusNotModified was
  15600. // returned.
  15601. func (c *OrderinvoicesCreatechargeinvoiceCall) Do(opts ...googleapi.CallOption) (*OrderinvoicesCreateChargeInvoiceResponse, error) {
  15602. gensupport.SetOptions(c.urlParams_, opts...)
  15603. res, err := c.doRequest("json")
  15604. if res != nil && res.StatusCode == http.StatusNotModified {
  15605. if res.Body != nil {
  15606. res.Body.Close()
  15607. }
  15608. return nil, &googleapi.Error{
  15609. Code: res.StatusCode,
  15610. Header: res.Header,
  15611. }
  15612. }
  15613. if err != nil {
  15614. return nil, err
  15615. }
  15616. defer googleapi.CloseBody(res)
  15617. if err := googleapi.CheckResponse(res); err != nil {
  15618. return nil, err
  15619. }
  15620. ret := &OrderinvoicesCreateChargeInvoiceResponse{
  15621. ServerResponse: googleapi.ServerResponse{
  15622. Header: res.Header,
  15623. HTTPStatusCode: res.StatusCode,
  15624. },
  15625. }
  15626. target := &ret
  15627. if err := gensupport.DecodeResponse(target, res); err != nil {
  15628. return nil, err
  15629. }
  15630. return ret, nil
  15631. // {
  15632. // "description": "Creates a charge invoice for a shipment group, and triggers a charge capture for non-facilitated payment orders.",
  15633. // "httpMethod": "POST",
  15634. // "id": "content.orderinvoices.createchargeinvoice",
  15635. // "parameterOrder": [
  15636. // "merchantId",
  15637. // "orderId"
  15638. // ],
  15639. // "parameters": {
  15640. // "merchantId": {
  15641. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  15642. // "format": "uint64",
  15643. // "location": "path",
  15644. // "required": true,
  15645. // "type": "string"
  15646. // },
  15647. // "orderId": {
  15648. // "description": "The ID of the order.",
  15649. // "location": "path",
  15650. // "required": true,
  15651. // "type": "string"
  15652. // }
  15653. // },
  15654. // "path": "{merchantId}/orderinvoices/{orderId}/createChargeInvoice",
  15655. // "request": {
  15656. // "$ref": "OrderinvoicesCreateChargeInvoiceRequest"
  15657. // },
  15658. // "response": {
  15659. // "$ref": "OrderinvoicesCreateChargeInvoiceResponse"
  15660. // },
  15661. // "scopes": [
  15662. // "https://www.googleapis.com/auth/content"
  15663. // ]
  15664. // }
  15665. }
  15666. // method id "content.orderinvoices.createrefundinvoice":
  15667. type OrderinvoicesCreaterefundinvoiceCall struct {
  15668. s *APIService
  15669. merchantId uint64
  15670. orderId string
  15671. orderinvoicescreaterefundinvoicerequest *OrderinvoicesCreateRefundInvoiceRequest
  15672. urlParams_ gensupport.URLParams
  15673. ctx_ context.Context
  15674. header_ http.Header
  15675. }
  15676. // Createrefundinvoice: Creates a refund invoice for one or more
  15677. // shipment groups, and triggers a refund for non-facilitated payment
  15678. // orders. This can only be used for line items that have previously
  15679. // been charged using createChargeInvoice. All amounts (except for the
  15680. // summary) are incremental with respect to the previous invoice.
  15681. func (r *OrderinvoicesService) Createrefundinvoice(merchantId uint64, orderId string, orderinvoicescreaterefundinvoicerequest *OrderinvoicesCreateRefundInvoiceRequest) *OrderinvoicesCreaterefundinvoiceCall {
  15682. c := &OrderinvoicesCreaterefundinvoiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15683. c.merchantId = merchantId
  15684. c.orderId = orderId
  15685. c.orderinvoicescreaterefundinvoicerequest = orderinvoicescreaterefundinvoicerequest
  15686. return c
  15687. }
  15688. // Fields allows partial responses to be retrieved. See
  15689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15690. // for more information.
  15691. func (c *OrderinvoicesCreaterefundinvoiceCall) Fields(s ...googleapi.Field) *OrderinvoicesCreaterefundinvoiceCall {
  15692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15693. return c
  15694. }
  15695. // Context sets the context to be used in this call's Do method. Any
  15696. // pending HTTP request will be aborted if the provided context is
  15697. // canceled.
  15698. func (c *OrderinvoicesCreaterefundinvoiceCall) Context(ctx context.Context) *OrderinvoicesCreaterefundinvoiceCall {
  15699. c.ctx_ = ctx
  15700. return c
  15701. }
  15702. // Header returns an http.Header that can be modified by the caller to
  15703. // add HTTP headers to the request.
  15704. func (c *OrderinvoicesCreaterefundinvoiceCall) Header() http.Header {
  15705. if c.header_ == nil {
  15706. c.header_ = make(http.Header)
  15707. }
  15708. return c.header_
  15709. }
  15710. func (c *OrderinvoicesCreaterefundinvoiceCall) doRequest(alt string) (*http.Response, error) {
  15711. reqHeaders := make(http.Header)
  15712. for k, v := range c.header_ {
  15713. reqHeaders[k] = v
  15714. }
  15715. reqHeaders.Set("User-Agent", c.s.userAgent())
  15716. var body io.Reader = nil
  15717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderinvoicescreaterefundinvoicerequest)
  15718. if err != nil {
  15719. return nil, err
  15720. }
  15721. reqHeaders.Set("Content-Type", "application/json")
  15722. c.urlParams_.Set("alt", alt)
  15723. c.urlParams_.Set("prettyPrint", "false")
  15724. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderinvoices/{orderId}/createRefundInvoice")
  15725. urls += "?" + c.urlParams_.Encode()
  15726. req, err := http.NewRequest("POST", urls, body)
  15727. if err != nil {
  15728. return nil, err
  15729. }
  15730. req.Header = reqHeaders
  15731. googleapi.Expand(req.URL, map[string]string{
  15732. "merchantId": strconv.FormatUint(c.merchantId, 10),
  15733. "orderId": c.orderId,
  15734. })
  15735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15736. }
  15737. // Do executes the "content.orderinvoices.createrefundinvoice" call.
  15738. // Exactly one of *OrderinvoicesCreateRefundInvoiceResponse or error
  15739. // will be non-nil. Any non-2xx status code is an error. Response
  15740. // headers are in either
  15741. // *OrderinvoicesCreateRefundInvoiceResponse.ServerResponse.Header or
  15742. // (if a response was returned at all) in
  15743. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  15744. // whether the returned error was because http.StatusNotModified was
  15745. // returned.
  15746. func (c *OrderinvoicesCreaterefundinvoiceCall) Do(opts ...googleapi.CallOption) (*OrderinvoicesCreateRefundInvoiceResponse, error) {
  15747. gensupport.SetOptions(c.urlParams_, opts...)
  15748. res, err := c.doRequest("json")
  15749. if res != nil && res.StatusCode == http.StatusNotModified {
  15750. if res.Body != nil {
  15751. res.Body.Close()
  15752. }
  15753. return nil, &googleapi.Error{
  15754. Code: res.StatusCode,
  15755. Header: res.Header,
  15756. }
  15757. }
  15758. if err != nil {
  15759. return nil, err
  15760. }
  15761. defer googleapi.CloseBody(res)
  15762. if err := googleapi.CheckResponse(res); err != nil {
  15763. return nil, err
  15764. }
  15765. ret := &OrderinvoicesCreateRefundInvoiceResponse{
  15766. ServerResponse: googleapi.ServerResponse{
  15767. Header: res.Header,
  15768. HTTPStatusCode: res.StatusCode,
  15769. },
  15770. }
  15771. target := &ret
  15772. if err := gensupport.DecodeResponse(target, res); err != nil {
  15773. return nil, err
  15774. }
  15775. return ret, nil
  15776. // {
  15777. // "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.",
  15778. // "httpMethod": "POST",
  15779. // "id": "content.orderinvoices.createrefundinvoice",
  15780. // "parameterOrder": [
  15781. // "merchantId",
  15782. // "orderId"
  15783. // ],
  15784. // "parameters": {
  15785. // "merchantId": {
  15786. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  15787. // "format": "uint64",
  15788. // "location": "path",
  15789. // "required": true,
  15790. // "type": "string"
  15791. // },
  15792. // "orderId": {
  15793. // "description": "The ID of the order.",
  15794. // "location": "path",
  15795. // "required": true,
  15796. // "type": "string"
  15797. // }
  15798. // },
  15799. // "path": "{merchantId}/orderinvoices/{orderId}/createRefundInvoice",
  15800. // "request": {
  15801. // "$ref": "OrderinvoicesCreateRefundInvoiceRequest"
  15802. // },
  15803. // "response": {
  15804. // "$ref": "OrderinvoicesCreateRefundInvoiceResponse"
  15805. // },
  15806. // "scopes": [
  15807. // "https://www.googleapis.com/auth/content"
  15808. // ]
  15809. // }
  15810. }
  15811. // method id "content.orderpayments.notifyauthapproved":
  15812. type OrderpaymentsNotifyauthapprovedCall struct {
  15813. s *APIService
  15814. merchantId uint64
  15815. orderId string
  15816. orderpaymentsnotifyauthapprovedrequest *OrderpaymentsNotifyAuthApprovedRequest
  15817. urlParams_ gensupport.URLParams
  15818. ctx_ context.Context
  15819. header_ http.Header
  15820. }
  15821. // Notifyauthapproved: Notify about successfully authorizing user's
  15822. // payment method for a given amount.
  15823. func (r *OrderpaymentsService) Notifyauthapproved(merchantId uint64, orderId string, orderpaymentsnotifyauthapprovedrequest *OrderpaymentsNotifyAuthApprovedRequest) *OrderpaymentsNotifyauthapprovedCall {
  15824. c := &OrderpaymentsNotifyauthapprovedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15825. c.merchantId = merchantId
  15826. c.orderId = orderId
  15827. c.orderpaymentsnotifyauthapprovedrequest = orderpaymentsnotifyauthapprovedrequest
  15828. return c
  15829. }
  15830. // Fields allows partial responses to be retrieved. See
  15831. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15832. // for more information.
  15833. func (c *OrderpaymentsNotifyauthapprovedCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifyauthapprovedCall {
  15834. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15835. return c
  15836. }
  15837. // Context sets the context to be used in this call's Do method. Any
  15838. // pending HTTP request will be aborted if the provided context is
  15839. // canceled.
  15840. func (c *OrderpaymentsNotifyauthapprovedCall) Context(ctx context.Context) *OrderpaymentsNotifyauthapprovedCall {
  15841. c.ctx_ = ctx
  15842. return c
  15843. }
  15844. // Header returns an http.Header that can be modified by the caller to
  15845. // add HTTP headers to the request.
  15846. func (c *OrderpaymentsNotifyauthapprovedCall) Header() http.Header {
  15847. if c.header_ == nil {
  15848. c.header_ = make(http.Header)
  15849. }
  15850. return c.header_
  15851. }
  15852. func (c *OrderpaymentsNotifyauthapprovedCall) doRequest(alt string) (*http.Response, error) {
  15853. reqHeaders := make(http.Header)
  15854. for k, v := range c.header_ {
  15855. reqHeaders[k] = v
  15856. }
  15857. reqHeaders.Set("User-Agent", c.s.userAgent())
  15858. var body io.Reader = nil
  15859. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifyauthapprovedrequest)
  15860. if err != nil {
  15861. return nil, err
  15862. }
  15863. reqHeaders.Set("Content-Type", "application/json")
  15864. c.urlParams_.Set("alt", alt)
  15865. c.urlParams_.Set("prettyPrint", "false")
  15866. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyAuthApproved")
  15867. urls += "?" + c.urlParams_.Encode()
  15868. req, err := http.NewRequest("POST", urls, body)
  15869. if err != nil {
  15870. return nil, err
  15871. }
  15872. req.Header = reqHeaders
  15873. googleapi.Expand(req.URL, map[string]string{
  15874. "merchantId": strconv.FormatUint(c.merchantId, 10),
  15875. "orderId": c.orderId,
  15876. })
  15877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15878. }
  15879. // Do executes the "content.orderpayments.notifyauthapproved" call.
  15880. // Exactly one of *OrderpaymentsNotifyAuthApprovedResponse or error will
  15881. // be non-nil. Any non-2xx status code is an error. Response headers are
  15882. // in either
  15883. // *OrderpaymentsNotifyAuthApprovedResponse.ServerResponse.Header or (if
  15884. // a response was returned at all) in error.(*googleapi.Error).Header.
  15885. // Use googleapi.IsNotModified to check whether the returned error was
  15886. // because http.StatusNotModified was returned.
  15887. func (c *OrderpaymentsNotifyauthapprovedCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyAuthApprovedResponse, error) {
  15888. gensupport.SetOptions(c.urlParams_, opts...)
  15889. res, err := c.doRequest("json")
  15890. if res != nil && res.StatusCode == http.StatusNotModified {
  15891. if res.Body != nil {
  15892. res.Body.Close()
  15893. }
  15894. return nil, &googleapi.Error{
  15895. Code: res.StatusCode,
  15896. Header: res.Header,
  15897. }
  15898. }
  15899. if err != nil {
  15900. return nil, err
  15901. }
  15902. defer googleapi.CloseBody(res)
  15903. if err := googleapi.CheckResponse(res); err != nil {
  15904. return nil, err
  15905. }
  15906. ret := &OrderpaymentsNotifyAuthApprovedResponse{
  15907. ServerResponse: googleapi.ServerResponse{
  15908. Header: res.Header,
  15909. HTTPStatusCode: res.StatusCode,
  15910. },
  15911. }
  15912. target := &ret
  15913. if err := gensupport.DecodeResponse(target, res); err != nil {
  15914. return nil, err
  15915. }
  15916. return ret, nil
  15917. // {
  15918. // "description": "Notify about successfully authorizing user's payment method for a given amount.",
  15919. // "httpMethod": "POST",
  15920. // "id": "content.orderpayments.notifyauthapproved",
  15921. // "parameterOrder": [
  15922. // "merchantId",
  15923. // "orderId"
  15924. // ],
  15925. // "parameters": {
  15926. // "merchantId": {
  15927. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  15928. // "format": "uint64",
  15929. // "location": "path",
  15930. // "required": true,
  15931. // "type": "string"
  15932. // },
  15933. // "orderId": {
  15934. // "description": "The ID of the order for for which payment authorization is happening.",
  15935. // "location": "path",
  15936. // "required": true,
  15937. // "type": "string"
  15938. // }
  15939. // },
  15940. // "path": "{merchantId}/orderpayments/{orderId}/notifyAuthApproved",
  15941. // "request": {
  15942. // "$ref": "OrderpaymentsNotifyAuthApprovedRequest"
  15943. // },
  15944. // "response": {
  15945. // "$ref": "OrderpaymentsNotifyAuthApprovedResponse"
  15946. // },
  15947. // "scopes": [
  15948. // "https://www.googleapis.com/auth/content"
  15949. // ]
  15950. // }
  15951. }
  15952. // method id "content.orderpayments.notifyauthdeclined":
  15953. type OrderpaymentsNotifyauthdeclinedCall struct {
  15954. s *APIService
  15955. merchantId uint64
  15956. orderId string
  15957. orderpaymentsnotifyauthdeclinedrequest *OrderpaymentsNotifyAuthDeclinedRequest
  15958. urlParams_ gensupport.URLParams
  15959. ctx_ context.Context
  15960. header_ http.Header
  15961. }
  15962. // Notifyauthdeclined: Notify about failure to authorize user's payment
  15963. // method.
  15964. func (r *OrderpaymentsService) Notifyauthdeclined(merchantId uint64, orderId string, orderpaymentsnotifyauthdeclinedrequest *OrderpaymentsNotifyAuthDeclinedRequest) *OrderpaymentsNotifyauthdeclinedCall {
  15965. c := &OrderpaymentsNotifyauthdeclinedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15966. c.merchantId = merchantId
  15967. c.orderId = orderId
  15968. c.orderpaymentsnotifyauthdeclinedrequest = orderpaymentsnotifyauthdeclinedrequest
  15969. return c
  15970. }
  15971. // Fields allows partial responses to be retrieved. See
  15972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15973. // for more information.
  15974. func (c *OrderpaymentsNotifyauthdeclinedCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifyauthdeclinedCall {
  15975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15976. return c
  15977. }
  15978. // Context sets the context to be used in this call's Do method. Any
  15979. // pending HTTP request will be aborted if the provided context is
  15980. // canceled.
  15981. func (c *OrderpaymentsNotifyauthdeclinedCall) Context(ctx context.Context) *OrderpaymentsNotifyauthdeclinedCall {
  15982. c.ctx_ = ctx
  15983. return c
  15984. }
  15985. // Header returns an http.Header that can be modified by the caller to
  15986. // add HTTP headers to the request.
  15987. func (c *OrderpaymentsNotifyauthdeclinedCall) Header() http.Header {
  15988. if c.header_ == nil {
  15989. c.header_ = make(http.Header)
  15990. }
  15991. return c.header_
  15992. }
  15993. func (c *OrderpaymentsNotifyauthdeclinedCall) doRequest(alt string) (*http.Response, error) {
  15994. reqHeaders := make(http.Header)
  15995. for k, v := range c.header_ {
  15996. reqHeaders[k] = v
  15997. }
  15998. reqHeaders.Set("User-Agent", c.s.userAgent())
  15999. var body io.Reader = nil
  16000. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifyauthdeclinedrequest)
  16001. if err != nil {
  16002. return nil, err
  16003. }
  16004. reqHeaders.Set("Content-Type", "application/json")
  16005. c.urlParams_.Set("alt", alt)
  16006. c.urlParams_.Set("prettyPrint", "false")
  16007. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyAuthDeclined")
  16008. urls += "?" + c.urlParams_.Encode()
  16009. req, err := http.NewRequest("POST", urls, body)
  16010. if err != nil {
  16011. return nil, err
  16012. }
  16013. req.Header = reqHeaders
  16014. googleapi.Expand(req.URL, map[string]string{
  16015. "merchantId": strconv.FormatUint(c.merchantId, 10),
  16016. "orderId": c.orderId,
  16017. })
  16018. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16019. }
  16020. // Do executes the "content.orderpayments.notifyauthdeclined" call.
  16021. // Exactly one of *OrderpaymentsNotifyAuthDeclinedResponse or error will
  16022. // be non-nil. Any non-2xx status code is an error. Response headers are
  16023. // in either
  16024. // *OrderpaymentsNotifyAuthDeclinedResponse.ServerResponse.Header or (if
  16025. // a response was returned at all) in error.(*googleapi.Error).Header.
  16026. // Use googleapi.IsNotModified to check whether the returned error was
  16027. // because http.StatusNotModified was returned.
  16028. func (c *OrderpaymentsNotifyauthdeclinedCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyAuthDeclinedResponse, error) {
  16029. gensupport.SetOptions(c.urlParams_, opts...)
  16030. res, err := c.doRequest("json")
  16031. if res != nil && res.StatusCode == http.StatusNotModified {
  16032. if res.Body != nil {
  16033. res.Body.Close()
  16034. }
  16035. return nil, &googleapi.Error{
  16036. Code: res.StatusCode,
  16037. Header: res.Header,
  16038. }
  16039. }
  16040. if err != nil {
  16041. return nil, err
  16042. }
  16043. defer googleapi.CloseBody(res)
  16044. if err := googleapi.CheckResponse(res); err != nil {
  16045. return nil, err
  16046. }
  16047. ret := &OrderpaymentsNotifyAuthDeclinedResponse{
  16048. ServerResponse: googleapi.ServerResponse{
  16049. Header: res.Header,
  16050. HTTPStatusCode: res.StatusCode,
  16051. },
  16052. }
  16053. target := &ret
  16054. if err := gensupport.DecodeResponse(target, res); err != nil {
  16055. return nil, err
  16056. }
  16057. return ret, nil
  16058. // {
  16059. // "description": "Notify about failure to authorize user's payment method.",
  16060. // "httpMethod": "POST",
  16061. // "id": "content.orderpayments.notifyauthdeclined",
  16062. // "parameterOrder": [
  16063. // "merchantId",
  16064. // "orderId"
  16065. // ],
  16066. // "parameters": {
  16067. // "merchantId": {
  16068. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  16069. // "format": "uint64",
  16070. // "location": "path",
  16071. // "required": true,
  16072. // "type": "string"
  16073. // },
  16074. // "orderId": {
  16075. // "description": "The ID of the order for which payment authorization was declined.",
  16076. // "location": "path",
  16077. // "required": true,
  16078. // "type": "string"
  16079. // }
  16080. // },
  16081. // "path": "{merchantId}/orderpayments/{orderId}/notifyAuthDeclined",
  16082. // "request": {
  16083. // "$ref": "OrderpaymentsNotifyAuthDeclinedRequest"
  16084. // },
  16085. // "response": {
  16086. // "$ref": "OrderpaymentsNotifyAuthDeclinedResponse"
  16087. // },
  16088. // "scopes": [
  16089. // "https://www.googleapis.com/auth/content"
  16090. // ]
  16091. // }
  16092. }
  16093. // method id "content.orderpayments.notifycharge":
  16094. type OrderpaymentsNotifychargeCall struct {
  16095. s *APIService
  16096. merchantId uint64
  16097. orderId string
  16098. orderpaymentsnotifychargerequest *OrderpaymentsNotifyChargeRequest
  16099. urlParams_ gensupport.URLParams
  16100. ctx_ context.Context
  16101. header_ http.Header
  16102. }
  16103. // Notifycharge: Notify about charge on user's selected payments method.
  16104. func (r *OrderpaymentsService) Notifycharge(merchantId uint64, orderId string, orderpaymentsnotifychargerequest *OrderpaymentsNotifyChargeRequest) *OrderpaymentsNotifychargeCall {
  16105. c := &OrderpaymentsNotifychargeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16106. c.merchantId = merchantId
  16107. c.orderId = orderId
  16108. c.orderpaymentsnotifychargerequest = orderpaymentsnotifychargerequest
  16109. return c
  16110. }
  16111. // Fields allows partial responses to be retrieved. See
  16112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16113. // for more information.
  16114. func (c *OrderpaymentsNotifychargeCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifychargeCall {
  16115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16116. return c
  16117. }
  16118. // Context sets the context to be used in this call's Do method. Any
  16119. // pending HTTP request will be aborted if the provided context is
  16120. // canceled.
  16121. func (c *OrderpaymentsNotifychargeCall) Context(ctx context.Context) *OrderpaymentsNotifychargeCall {
  16122. c.ctx_ = ctx
  16123. return c
  16124. }
  16125. // Header returns an http.Header that can be modified by the caller to
  16126. // add HTTP headers to the request.
  16127. func (c *OrderpaymentsNotifychargeCall) Header() http.Header {
  16128. if c.header_ == nil {
  16129. c.header_ = make(http.Header)
  16130. }
  16131. return c.header_
  16132. }
  16133. func (c *OrderpaymentsNotifychargeCall) doRequest(alt string) (*http.Response, error) {
  16134. reqHeaders := make(http.Header)
  16135. for k, v := range c.header_ {
  16136. reqHeaders[k] = v
  16137. }
  16138. reqHeaders.Set("User-Agent", c.s.userAgent())
  16139. var body io.Reader = nil
  16140. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifychargerequest)
  16141. if err != nil {
  16142. return nil, err
  16143. }
  16144. reqHeaders.Set("Content-Type", "application/json")
  16145. c.urlParams_.Set("alt", alt)
  16146. c.urlParams_.Set("prettyPrint", "false")
  16147. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyCharge")
  16148. urls += "?" + c.urlParams_.Encode()
  16149. req, err := http.NewRequest("POST", urls, body)
  16150. if err != nil {
  16151. return nil, err
  16152. }
  16153. req.Header = reqHeaders
  16154. googleapi.Expand(req.URL, map[string]string{
  16155. "merchantId": strconv.FormatUint(c.merchantId, 10),
  16156. "orderId": c.orderId,
  16157. })
  16158. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16159. }
  16160. // Do executes the "content.orderpayments.notifycharge" call.
  16161. // Exactly one of *OrderpaymentsNotifyChargeResponse or error will be
  16162. // non-nil. Any non-2xx status code is an error. Response headers are in
  16163. // either *OrderpaymentsNotifyChargeResponse.ServerResponse.Header or
  16164. // (if a response was returned at all) in
  16165. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16166. // whether the returned error was because http.StatusNotModified was
  16167. // returned.
  16168. func (c *OrderpaymentsNotifychargeCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyChargeResponse, error) {
  16169. gensupport.SetOptions(c.urlParams_, opts...)
  16170. res, err := c.doRequest("json")
  16171. if res != nil && res.StatusCode == http.StatusNotModified {
  16172. if res.Body != nil {
  16173. res.Body.Close()
  16174. }
  16175. return nil, &googleapi.Error{
  16176. Code: res.StatusCode,
  16177. Header: res.Header,
  16178. }
  16179. }
  16180. if err != nil {
  16181. return nil, err
  16182. }
  16183. defer googleapi.CloseBody(res)
  16184. if err := googleapi.CheckResponse(res); err != nil {
  16185. return nil, err
  16186. }
  16187. ret := &OrderpaymentsNotifyChargeResponse{
  16188. ServerResponse: googleapi.ServerResponse{
  16189. Header: res.Header,
  16190. HTTPStatusCode: res.StatusCode,
  16191. },
  16192. }
  16193. target := &ret
  16194. if err := gensupport.DecodeResponse(target, res); err != nil {
  16195. return nil, err
  16196. }
  16197. return ret, nil
  16198. // {
  16199. // "description": "Notify about charge on user's selected payments method.",
  16200. // "httpMethod": "POST",
  16201. // "id": "content.orderpayments.notifycharge",
  16202. // "parameterOrder": [
  16203. // "merchantId",
  16204. // "orderId"
  16205. // ],
  16206. // "parameters": {
  16207. // "merchantId": {
  16208. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  16209. // "format": "uint64",
  16210. // "location": "path",
  16211. // "required": true,
  16212. // "type": "string"
  16213. // },
  16214. // "orderId": {
  16215. // "description": "The ID of the order for which charge is happening.",
  16216. // "location": "path",
  16217. // "required": true,
  16218. // "type": "string"
  16219. // }
  16220. // },
  16221. // "path": "{merchantId}/orderpayments/{orderId}/notifyCharge",
  16222. // "request": {
  16223. // "$ref": "OrderpaymentsNotifyChargeRequest"
  16224. // },
  16225. // "response": {
  16226. // "$ref": "OrderpaymentsNotifyChargeResponse"
  16227. // },
  16228. // "scopes": [
  16229. // "https://www.googleapis.com/auth/content"
  16230. // ]
  16231. // }
  16232. }
  16233. // method id "content.orderpayments.notifyrefund":
  16234. type OrderpaymentsNotifyrefundCall struct {
  16235. s *APIService
  16236. merchantId uint64
  16237. orderId string
  16238. orderpaymentsnotifyrefundrequest *OrderpaymentsNotifyRefundRequest
  16239. urlParams_ gensupport.URLParams
  16240. ctx_ context.Context
  16241. header_ http.Header
  16242. }
  16243. // Notifyrefund: Notify about refund on user's selected payments method.
  16244. func (r *OrderpaymentsService) Notifyrefund(merchantId uint64, orderId string, orderpaymentsnotifyrefundrequest *OrderpaymentsNotifyRefundRequest) *OrderpaymentsNotifyrefundCall {
  16245. c := &OrderpaymentsNotifyrefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16246. c.merchantId = merchantId
  16247. c.orderId = orderId
  16248. c.orderpaymentsnotifyrefundrequest = orderpaymentsnotifyrefundrequest
  16249. return c
  16250. }
  16251. // Fields allows partial responses to be retrieved. See
  16252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16253. // for more information.
  16254. func (c *OrderpaymentsNotifyrefundCall) Fields(s ...googleapi.Field) *OrderpaymentsNotifyrefundCall {
  16255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16256. return c
  16257. }
  16258. // Context sets the context to be used in this call's Do method. Any
  16259. // pending HTTP request will be aborted if the provided context is
  16260. // canceled.
  16261. func (c *OrderpaymentsNotifyrefundCall) Context(ctx context.Context) *OrderpaymentsNotifyrefundCall {
  16262. c.ctx_ = ctx
  16263. return c
  16264. }
  16265. // Header returns an http.Header that can be modified by the caller to
  16266. // add HTTP headers to the request.
  16267. func (c *OrderpaymentsNotifyrefundCall) Header() http.Header {
  16268. if c.header_ == nil {
  16269. c.header_ = make(http.Header)
  16270. }
  16271. return c.header_
  16272. }
  16273. func (c *OrderpaymentsNotifyrefundCall) doRequest(alt string) (*http.Response, error) {
  16274. reqHeaders := make(http.Header)
  16275. for k, v := range c.header_ {
  16276. reqHeaders[k] = v
  16277. }
  16278. reqHeaders.Set("User-Agent", c.s.userAgent())
  16279. var body io.Reader = nil
  16280. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderpaymentsnotifyrefundrequest)
  16281. if err != nil {
  16282. return nil, err
  16283. }
  16284. reqHeaders.Set("Content-Type", "application/json")
  16285. c.urlParams_.Set("alt", alt)
  16286. c.urlParams_.Set("prettyPrint", "false")
  16287. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderpayments/{orderId}/notifyRefund")
  16288. urls += "?" + c.urlParams_.Encode()
  16289. req, err := http.NewRequest("POST", urls, body)
  16290. if err != nil {
  16291. return nil, err
  16292. }
  16293. req.Header = reqHeaders
  16294. googleapi.Expand(req.URL, map[string]string{
  16295. "merchantId": strconv.FormatUint(c.merchantId, 10),
  16296. "orderId": c.orderId,
  16297. })
  16298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16299. }
  16300. // Do executes the "content.orderpayments.notifyrefund" call.
  16301. // Exactly one of *OrderpaymentsNotifyRefundResponse or error will be
  16302. // non-nil. Any non-2xx status code is an error. Response headers are in
  16303. // either *OrderpaymentsNotifyRefundResponse.ServerResponse.Header or
  16304. // (if a response was returned at all) in
  16305. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16306. // whether the returned error was because http.StatusNotModified was
  16307. // returned.
  16308. func (c *OrderpaymentsNotifyrefundCall) Do(opts ...googleapi.CallOption) (*OrderpaymentsNotifyRefundResponse, error) {
  16309. gensupport.SetOptions(c.urlParams_, opts...)
  16310. res, err := c.doRequest("json")
  16311. if res != nil && res.StatusCode == http.StatusNotModified {
  16312. if res.Body != nil {
  16313. res.Body.Close()
  16314. }
  16315. return nil, &googleapi.Error{
  16316. Code: res.StatusCode,
  16317. Header: res.Header,
  16318. }
  16319. }
  16320. if err != nil {
  16321. return nil, err
  16322. }
  16323. defer googleapi.CloseBody(res)
  16324. if err := googleapi.CheckResponse(res); err != nil {
  16325. return nil, err
  16326. }
  16327. ret := &OrderpaymentsNotifyRefundResponse{
  16328. ServerResponse: googleapi.ServerResponse{
  16329. Header: res.Header,
  16330. HTTPStatusCode: res.StatusCode,
  16331. },
  16332. }
  16333. target := &ret
  16334. if err := gensupport.DecodeResponse(target, res); err != nil {
  16335. return nil, err
  16336. }
  16337. return ret, nil
  16338. // {
  16339. // "description": "Notify about refund on user's selected payments method.",
  16340. // "httpMethod": "POST",
  16341. // "id": "content.orderpayments.notifyrefund",
  16342. // "parameterOrder": [
  16343. // "merchantId",
  16344. // "orderId"
  16345. // ],
  16346. // "parameters": {
  16347. // "merchantId": {
  16348. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  16349. // "format": "uint64",
  16350. // "location": "path",
  16351. // "required": true,
  16352. // "type": "string"
  16353. // },
  16354. // "orderId": {
  16355. // "description": "The ID of the order for which charge is happening.",
  16356. // "location": "path",
  16357. // "required": true,
  16358. // "type": "string"
  16359. // }
  16360. // },
  16361. // "path": "{merchantId}/orderpayments/{orderId}/notifyRefund",
  16362. // "request": {
  16363. // "$ref": "OrderpaymentsNotifyRefundRequest"
  16364. // },
  16365. // "response": {
  16366. // "$ref": "OrderpaymentsNotifyRefundResponse"
  16367. // },
  16368. // "scopes": [
  16369. // "https://www.googleapis.com/auth/content"
  16370. // ]
  16371. // }
  16372. }
  16373. // method id "content.orderreports.listdisbursements":
  16374. type OrderreportsListdisbursementsCall struct {
  16375. s *APIService
  16376. merchantId uint64
  16377. urlParams_ gensupport.URLParams
  16378. ifNoneMatch_ string
  16379. ctx_ context.Context
  16380. header_ http.Header
  16381. }
  16382. // Listdisbursements: Retrieves a report for disbursements from your
  16383. // Merchant Center account.
  16384. func (r *OrderreportsService) Listdisbursements(merchantId uint64, disbursementStartDate string) *OrderreportsListdisbursementsCall {
  16385. c := &OrderreportsListdisbursementsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16386. c.merchantId = merchantId
  16387. c.urlParams_.Set("disbursementStartDate", disbursementStartDate)
  16388. return c
  16389. }
  16390. // DisbursementEndDate sets the optional parameter
  16391. // "disbursementEndDate": The last date which disbursements occurred. In
  16392. // ISO 8601 format. Default: current date.
  16393. func (c *OrderreportsListdisbursementsCall) DisbursementEndDate(disbursementEndDate string) *OrderreportsListdisbursementsCall {
  16394. c.urlParams_.Set("disbursementEndDate", disbursementEndDate)
  16395. return c
  16396. }
  16397. // MaxResults sets the optional parameter "maxResults": The maximum
  16398. // number of disbursements to return in the response, used for paging.
  16399. func (c *OrderreportsListdisbursementsCall) MaxResults(maxResults int64) *OrderreportsListdisbursementsCall {
  16400. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16401. return c
  16402. }
  16403. // PageToken sets the optional parameter "pageToken": The token returned
  16404. // by the previous request.
  16405. func (c *OrderreportsListdisbursementsCall) PageToken(pageToken string) *OrderreportsListdisbursementsCall {
  16406. c.urlParams_.Set("pageToken", pageToken)
  16407. return c
  16408. }
  16409. // Fields allows partial responses to be retrieved. See
  16410. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16411. // for more information.
  16412. func (c *OrderreportsListdisbursementsCall) Fields(s ...googleapi.Field) *OrderreportsListdisbursementsCall {
  16413. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16414. return c
  16415. }
  16416. // IfNoneMatch sets the optional parameter which makes the operation
  16417. // fail if the object's ETag matches the given value. This is useful for
  16418. // getting updates only after the object has changed since the last
  16419. // request. Use googleapi.IsNotModified to check whether the response
  16420. // error from Do is the result of In-None-Match.
  16421. func (c *OrderreportsListdisbursementsCall) IfNoneMatch(entityTag string) *OrderreportsListdisbursementsCall {
  16422. c.ifNoneMatch_ = entityTag
  16423. return c
  16424. }
  16425. // Context sets the context to be used in this call's Do method. Any
  16426. // pending HTTP request will be aborted if the provided context is
  16427. // canceled.
  16428. func (c *OrderreportsListdisbursementsCall) Context(ctx context.Context) *OrderreportsListdisbursementsCall {
  16429. c.ctx_ = ctx
  16430. return c
  16431. }
  16432. // Header returns an http.Header that can be modified by the caller to
  16433. // add HTTP headers to the request.
  16434. func (c *OrderreportsListdisbursementsCall) Header() http.Header {
  16435. if c.header_ == nil {
  16436. c.header_ = make(http.Header)
  16437. }
  16438. return c.header_
  16439. }
  16440. func (c *OrderreportsListdisbursementsCall) doRequest(alt string) (*http.Response, error) {
  16441. reqHeaders := make(http.Header)
  16442. for k, v := range c.header_ {
  16443. reqHeaders[k] = v
  16444. }
  16445. reqHeaders.Set("User-Agent", c.s.userAgent())
  16446. if c.ifNoneMatch_ != "" {
  16447. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16448. }
  16449. var body io.Reader = nil
  16450. c.urlParams_.Set("alt", alt)
  16451. c.urlParams_.Set("prettyPrint", "false")
  16452. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderreports/disbursements")
  16453. urls += "?" + c.urlParams_.Encode()
  16454. req, err := http.NewRequest("GET", urls, body)
  16455. if err != nil {
  16456. return nil, err
  16457. }
  16458. req.Header = reqHeaders
  16459. googleapi.Expand(req.URL, map[string]string{
  16460. "merchantId": strconv.FormatUint(c.merchantId, 10),
  16461. })
  16462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16463. }
  16464. // Do executes the "content.orderreports.listdisbursements" call.
  16465. // Exactly one of *OrderreportsListDisbursementsResponse or error will
  16466. // be non-nil. Any non-2xx status code is an error. Response headers are
  16467. // in either
  16468. // *OrderreportsListDisbursementsResponse.ServerResponse.Header or (if a
  16469. // response was returned at all) in error.(*googleapi.Error).Header. Use
  16470. // googleapi.IsNotModified to check whether the returned error was
  16471. // because http.StatusNotModified was returned.
  16472. func (c *OrderreportsListdisbursementsCall) Do(opts ...googleapi.CallOption) (*OrderreportsListDisbursementsResponse, error) {
  16473. gensupport.SetOptions(c.urlParams_, opts...)
  16474. res, err := c.doRequest("json")
  16475. if res != nil && res.StatusCode == http.StatusNotModified {
  16476. if res.Body != nil {
  16477. res.Body.Close()
  16478. }
  16479. return nil, &googleapi.Error{
  16480. Code: res.StatusCode,
  16481. Header: res.Header,
  16482. }
  16483. }
  16484. if err != nil {
  16485. return nil, err
  16486. }
  16487. defer googleapi.CloseBody(res)
  16488. if err := googleapi.CheckResponse(res); err != nil {
  16489. return nil, err
  16490. }
  16491. ret := &OrderreportsListDisbursementsResponse{
  16492. ServerResponse: googleapi.ServerResponse{
  16493. Header: res.Header,
  16494. HTTPStatusCode: res.StatusCode,
  16495. },
  16496. }
  16497. target := &ret
  16498. if err := gensupport.DecodeResponse(target, res); err != nil {
  16499. return nil, err
  16500. }
  16501. return ret, nil
  16502. // {
  16503. // "description": "Retrieves a report for disbursements from your Merchant Center account.",
  16504. // "httpMethod": "GET",
  16505. // "id": "content.orderreports.listdisbursements",
  16506. // "parameterOrder": [
  16507. // "merchantId",
  16508. // "disbursementStartDate"
  16509. // ],
  16510. // "parameters": {
  16511. // "disbursementEndDate": {
  16512. // "description": "The last date which disbursements occurred. In ISO 8601 format. Default: current date.",
  16513. // "location": "query",
  16514. // "type": "string"
  16515. // },
  16516. // "disbursementStartDate": {
  16517. // "description": "The first date which disbursements occurred. In ISO 8601 format.",
  16518. // "location": "query",
  16519. // "required": true,
  16520. // "type": "string"
  16521. // },
  16522. // "maxResults": {
  16523. // "description": "The maximum number of disbursements to return in the response, used for paging.",
  16524. // "format": "uint32",
  16525. // "location": "query",
  16526. // "type": "integer"
  16527. // },
  16528. // "merchantId": {
  16529. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  16530. // "format": "uint64",
  16531. // "location": "path",
  16532. // "required": true,
  16533. // "type": "string"
  16534. // },
  16535. // "pageToken": {
  16536. // "description": "The token returned by the previous request.",
  16537. // "location": "query",
  16538. // "type": "string"
  16539. // }
  16540. // },
  16541. // "path": "{merchantId}/orderreports/disbursements",
  16542. // "response": {
  16543. // "$ref": "OrderreportsListDisbursementsResponse"
  16544. // },
  16545. // "scopes": [
  16546. // "https://www.googleapis.com/auth/content"
  16547. // ]
  16548. // }
  16549. }
  16550. // Pages invokes f for each page of results.
  16551. // A non-nil error returned from f will halt the iteration.
  16552. // The provided context supersedes any context provided to the Context method.
  16553. func (c *OrderreportsListdisbursementsCall) Pages(ctx context.Context, f func(*OrderreportsListDisbursementsResponse) error) error {
  16554. c.ctx_ = ctx
  16555. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16556. for {
  16557. x, err := c.Do()
  16558. if err != nil {
  16559. return err
  16560. }
  16561. if err := f(x); err != nil {
  16562. return err
  16563. }
  16564. if x.NextPageToken == "" {
  16565. return nil
  16566. }
  16567. c.PageToken(x.NextPageToken)
  16568. }
  16569. }
  16570. // method id "content.orderreports.listtransactions":
  16571. type OrderreportsListtransactionsCall struct {
  16572. s *APIService
  16573. merchantId uint64
  16574. disbursementId string
  16575. urlParams_ gensupport.URLParams
  16576. ifNoneMatch_ string
  16577. ctx_ context.Context
  16578. header_ http.Header
  16579. }
  16580. // Listtransactions: Retrieves a list of transactions for a disbursement
  16581. // from your Merchant Center account.
  16582. func (r *OrderreportsService) Listtransactions(merchantId uint64, disbursementId string, transactionStartDate string) *OrderreportsListtransactionsCall {
  16583. c := &OrderreportsListtransactionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16584. c.merchantId = merchantId
  16585. c.disbursementId = disbursementId
  16586. c.urlParams_.Set("transactionStartDate", transactionStartDate)
  16587. return c
  16588. }
  16589. // MaxResults sets the optional parameter "maxResults": The maximum
  16590. // number of disbursements to return in the response, used for paging.
  16591. func (c *OrderreportsListtransactionsCall) MaxResults(maxResults int64) *OrderreportsListtransactionsCall {
  16592. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16593. return c
  16594. }
  16595. // PageToken sets the optional parameter "pageToken": The token returned
  16596. // by the previous request.
  16597. func (c *OrderreportsListtransactionsCall) PageToken(pageToken string) *OrderreportsListtransactionsCall {
  16598. c.urlParams_.Set("pageToken", pageToken)
  16599. return c
  16600. }
  16601. // TransactionEndDate sets the optional parameter "transactionEndDate":
  16602. // The last date in which transaction occurred. In ISO 8601 format.
  16603. // Default: current date.
  16604. func (c *OrderreportsListtransactionsCall) TransactionEndDate(transactionEndDate string) *OrderreportsListtransactionsCall {
  16605. c.urlParams_.Set("transactionEndDate", transactionEndDate)
  16606. return c
  16607. }
  16608. // Fields allows partial responses to be retrieved. See
  16609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16610. // for more information.
  16611. func (c *OrderreportsListtransactionsCall) Fields(s ...googleapi.Field) *OrderreportsListtransactionsCall {
  16612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16613. return c
  16614. }
  16615. // IfNoneMatch sets the optional parameter which makes the operation
  16616. // fail if the object's ETag matches the given value. This is useful for
  16617. // getting updates only after the object has changed since the last
  16618. // request. Use googleapi.IsNotModified to check whether the response
  16619. // error from Do is the result of In-None-Match.
  16620. func (c *OrderreportsListtransactionsCall) IfNoneMatch(entityTag string) *OrderreportsListtransactionsCall {
  16621. c.ifNoneMatch_ = entityTag
  16622. return c
  16623. }
  16624. // Context sets the context to be used in this call's Do method. Any
  16625. // pending HTTP request will be aborted if the provided context is
  16626. // canceled.
  16627. func (c *OrderreportsListtransactionsCall) Context(ctx context.Context) *OrderreportsListtransactionsCall {
  16628. c.ctx_ = ctx
  16629. return c
  16630. }
  16631. // Header returns an http.Header that can be modified by the caller to
  16632. // add HTTP headers to the request.
  16633. func (c *OrderreportsListtransactionsCall) Header() http.Header {
  16634. if c.header_ == nil {
  16635. c.header_ = make(http.Header)
  16636. }
  16637. return c.header_
  16638. }
  16639. func (c *OrderreportsListtransactionsCall) doRequest(alt string) (*http.Response, error) {
  16640. reqHeaders := make(http.Header)
  16641. for k, v := range c.header_ {
  16642. reqHeaders[k] = v
  16643. }
  16644. reqHeaders.Set("User-Agent", c.s.userAgent())
  16645. if c.ifNoneMatch_ != "" {
  16646. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16647. }
  16648. var body io.Reader = nil
  16649. c.urlParams_.Set("alt", alt)
  16650. c.urlParams_.Set("prettyPrint", "false")
  16651. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderreports/disbursements/{disbursementId}/transactions")
  16652. urls += "?" + c.urlParams_.Encode()
  16653. req, err := http.NewRequest("GET", urls, body)
  16654. if err != nil {
  16655. return nil, err
  16656. }
  16657. req.Header = reqHeaders
  16658. googleapi.Expand(req.URL, map[string]string{
  16659. "merchantId": strconv.FormatUint(c.merchantId, 10),
  16660. "disbursementId": c.disbursementId,
  16661. })
  16662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16663. }
  16664. // Do executes the "content.orderreports.listtransactions" call.
  16665. // Exactly one of *OrderreportsListTransactionsResponse or error will be
  16666. // non-nil. Any non-2xx status code is an error. Response headers are in
  16667. // either *OrderreportsListTransactionsResponse.ServerResponse.Header or
  16668. // (if a response was returned at all) in
  16669. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16670. // whether the returned error was because http.StatusNotModified was
  16671. // returned.
  16672. func (c *OrderreportsListtransactionsCall) Do(opts ...googleapi.CallOption) (*OrderreportsListTransactionsResponse, error) {
  16673. gensupport.SetOptions(c.urlParams_, opts...)
  16674. res, err := c.doRequest("json")
  16675. if res != nil && res.StatusCode == http.StatusNotModified {
  16676. if res.Body != nil {
  16677. res.Body.Close()
  16678. }
  16679. return nil, &googleapi.Error{
  16680. Code: res.StatusCode,
  16681. Header: res.Header,
  16682. }
  16683. }
  16684. if err != nil {
  16685. return nil, err
  16686. }
  16687. defer googleapi.CloseBody(res)
  16688. if err := googleapi.CheckResponse(res); err != nil {
  16689. return nil, err
  16690. }
  16691. ret := &OrderreportsListTransactionsResponse{
  16692. ServerResponse: googleapi.ServerResponse{
  16693. Header: res.Header,
  16694. HTTPStatusCode: res.StatusCode,
  16695. },
  16696. }
  16697. target := &ret
  16698. if err := gensupport.DecodeResponse(target, res); err != nil {
  16699. return nil, err
  16700. }
  16701. return ret, nil
  16702. // {
  16703. // "description": "Retrieves a list of transactions for a disbursement from your Merchant Center account.",
  16704. // "httpMethod": "GET",
  16705. // "id": "content.orderreports.listtransactions",
  16706. // "parameterOrder": [
  16707. // "merchantId",
  16708. // "disbursementId",
  16709. // "transactionStartDate"
  16710. // ],
  16711. // "parameters": {
  16712. // "disbursementId": {
  16713. // "description": "The Google-provided ID of the disbursement (found in Wallet).",
  16714. // "location": "path",
  16715. // "required": true,
  16716. // "type": "string"
  16717. // },
  16718. // "maxResults": {
  16719. // "description": "The maximum number of disbursements to return in the response, used for paging.",
  16720. // "format": "uint32",
  16721. // "location": "query",
  16722. // "type": "integer"
  16723. // },
  16724. // "merchantId": {
  16725. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  16726. // "format": "uint64",
  16727. // "location": "path",
  16728. // "required": true,
  16729. // "type": "string"
  16730. // },
  16731. // "pageToken": {
  16732. // "description": "The token returned by the previous request.",
  16733. // "location": "query",
  16734. // "type": "string"
  16735. // },
  16736. // "transactionEndDate": {
  16737. // "description": "The last date in which transaction occurred. In ISO 8601 format. Default: current date.",
  16738. // "location": "query",
  16739. // "type": "string"
  16740. // },
  16741. // "transactionStartDate": {
  16742. // "description": "The first date in which transaction occurred. In ISO 8601 format.",
  16743. // "location": "query",
  16744. // "required": true,
  16745. // "type": "string"
  16746. // }
  16747. // },
  16748. // "path": "{merchantId}/orderreports/disbursements/{disbursementId}/transactions",
  16749. // "response": {
  16750. // "$ref": "OrderreportsListTransactionsResponse"
  16751. // },
  16752. // "scopes": [
  16753. // "https://www.googleapis.com/auth/content"
  16754. // ]
  16755. // }
  16756. }
  16757. // Pages invokes f for each page of results.
  16758. // A non-nil error returned from f will halt the iteration.
  16759. // The provided context supersedes any context provided to the Context method.
  16760. func (c *OrderreportsListtransactionsCall) Pages(ctx context.Context, f func(*OrderreportsListTransactionsResponse) error) error {
  16761. c.ctx_ = ctx
  16762. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16763. for {
  16764. x, err := c.Do()
  16765. if err != nil {
  16766. return err
  16767. }
  16768. if err := f(x); err != nil {
  16769. return err
  16770. }
  16771. if x.NextPageToken == "" {
  16772. return nil
  16773. }
  16774. c.PageToken(x.NextPageToken)
  16775. }
  16776. }
  16777. // method id "content.orderreturns.get":
  16778. type OrderreturnsGetCall struct {
  16779. s *APIService
  16780. merchantId uint64
  16781. returnId string
  16782. urlParams_ gensupport.URLParams
  16783. ifNoneMatch_ string
  16784. ctx_ context.Context
  16785. header_ http.Header
  16786. }
  16787. // Get: Retrieves an order return from your Merchant Center account.
  16788. func (r *OrderreturnsService) Get(merchantId uint64, returnId string) *OrderreturnsGetCall {
  16789. c := &OrderreturnsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16790. c.merchantId = merchantId
  16791. c.returnId = returnId
  16792. return c
  16793. }
  16794. // Fields allows partial responses to be retrieved. See
  16795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16796. // for more information.
  16797. func (c *OrderreturnsGetCall) Fields(s ...googleapi.Field) *OrderreturnsGetCall {
  16798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16799. return c
  16800. }
  16801. // IfNoneMatch sets the optional parameter which makes the operation
  16802. // fail if the object's ETag matches the given value. This is useful for
  16803. // getting updates only after the object has changed since the last
  16804. // request. Use googleapi.IsNotModified to check whether the response
  16805. // error from Do is the result of In-None-Match.
  16806. func (c *OrderreturnsGetCall) IfNoneMatch(entityTag string) *OrderreturnsGetCall {
  16807. c.ifNoneMatch_ = entityTag
  16808. return c
  16809. }
  16810. // Context sets the context to be used in this call's Do method. Any
  16811. // pending HTTP request will be aborted if the provided context is
  16812. // canceled.
  16813. func (c *OrderreturnsGetCall) Context(ctx context.Context) *OrderreturnsGetCall {
  16814. c.ctx_ = ctx
  16815. return c
  16816. }
  16817. // Header returns an http.Header that can be modified by the caller to
  16818. // add HTTP headers to the request.
  16819. func (c *OrderreturnsGetCall) Header() http.Header {
  16820. if c.header_ == nil {
  16821. c.header_ = make(http.Header)
  16822. }
  16823. return c.header_
  16824. }
  16825. func (c *OrderreturnsGetCall) doRequest(alt string) (*http.Response, error) {
  16826. reqHeaders := make(http.Header)
  16827. for k, v := range c.header_ {
  16828. reqHeaders[k] = v
  16829. }
  16830. reqHeaders.Set("User-Agent", c.s.userAgent())
  16831. if c.ifNoneMatch_ != "" {
  16832. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16833. }
  16834. var body io.Reader = nil
  16835. c.urlParams_.Set("alt", alt)
  16836. c.urlParams_.Set("prettyPrint", "false")
  16837. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderreturns/{returnId}")
  16838. urls += "?" + c.urlParams_.Encode()
  16839. req, err := http.NewRequest("GET", urls, body)
  16840. if err != nil {
  16841. return nil, err
  16842. }
  16843. req.Header = reqHeaders
  16844. googleapi.Expand(req.URL, map[string]string{
  16845. "merchantId": strconv.FormatUint(c.merchantId, 10),
  16846. "returnId": c.returnId,
  16847. })
  16848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16849. }
  16850. // Do executes the "content.orderreturns.get" call.
  16851. // Exactly one of *MerchantOrderReturn or error will be non-nil. Any
  16852. // non-2xx status code is an error. Response headers are in either
  16853. // *MerchantOrderReturn.ServerResponse.Header or (if a response was
  16854. // returned at all) in error.(*googleapi.Error).Header. Use
  16855. // googleapi.IsNotModified to check whether the returned error was
  16856. // because http.StatusNotModified was returned.
  16857. func (c *OrderreturnsGetCall) Do(opts ...googleapi.CallOption) (*MerchantOrderReturn, error) {
  16858. gensupport.SetOptions(c.urlParams_, opts...)
  16859. res, err := c.doRequest("json")
  16860. if res != nil && res.StatusCode == http.StatusNotModified {
  16861. if res.Body != nil {
  16862. res.Body.Close()
  16863. }
  16864. return nil, &googleapi.Error{
  16865. Code: res.StatusCode,
  16866. Header: res.Header,
  16867. }
  16868. }
  16869. if err != nil {
  16870. return nil, err
  16871. }
  16872. defer googleapi.CloseBody(res)
  16873. if err := googleapi.CheckResponse(res); err != nil {
  16874. return nil, err
  16875. }
  16876. ret := &MerchantOrderReturn{
  16877. ServerResponse: googleapi.ServerResponse{
  16878. Header: res.Header,
  16879. HTTPStatusCode: res.StatusCode,
  16880. },
  16881. }
  16882. target := &ret
  16883. if err := gensupport.DecodeResponse(target, res); err != nil {
  16884. return nil, err
  16885. }
  16886. return ret, nil
  16887. // {
  16888. // "description": "Retrieves an order return from your Merchant Center account.",
  16889. // "httpMethod": "GET",
  16890. // "id": "content.orderreturns.get",
  16891. // "parameterOrder": [
  16892. // "merchantId",
  16893. // "returnId"
  16894. // ],
  16895. // "parameters": {
  16896. // "merchantId": {
  16897. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  16898. // "format": "uint64",
  16899. // "location": "path",
  16900. // "required": true,
  16901. // "type": "string"
  16902. // },
  16903. // "returnId": {
  16904. // "description": "Merchant order return ID generated by Google.",
  16905. // "location": "path",
  16906. // "required": true,
  16907. // "type": "string"
  16908. // }
  16909. // },
  16910. // "path": "{merchantId}/orderreturns/{returnId}",
  16911. // "response": {
  16912. // "$ref": "MerchantOrderReturn"
  16913. // },
  16914. // "scopes": [
  16915. // "https://www.googleapis.com/auth/content"
  16916. // ]
  16917. // }
  16918. }
  16919. // method id "content.orderreturns.list":
  16920. type OrderreturnsListCall struct {
  16921. s *APIService
  16922. merchantId uint64
  16923. urlParams_ gensupport.URLParams
  16924. ifNoneMatch_ string
  16925. ctx_ context.Context
  16926. header_ http.Header
  16927. }
  16928. // List: Lists order returns in your Merchant Center account.
  16929. func (r *OrderreturnsService) List(merchantId uint64) *OrderreturnsListCall {
  16930. c := &OrderreturnsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16931. c.merchantId = merchantId
  16932. return c
  16933. }
  16934. // CreatedEndDate sets the optional parameter "createdEndDate": Obtains
  16935. // order returns created before this date (inclusively), in ISO 8601
  16936. // format.
  16937. func (c *OrderreturnsListCall) CreatedEndDate(createdEndDate string) *OrderreturnsListCall {
  16938. c.urlParams_.Set("createdEndDate", createdEndDate)
  16939. return c
  16940. }
  16941. // CreatedStartDate sets the optional parameter "createdStartDate":
  16942. // Obtains order returns created after this date (inclusively), in ISO
  16943. // 8601 format.
  16944. func (c *OrderreturnsListCall) CreatedStartDate(createdStartDate string) *OrderreturnsListCall {
  16945. c.urlParams_.Set("createdStartDate", createdStartDate)
  16946. return c
  16947. }
  16948. // MaxResults sets the optional parameter "maxResults": The maximum
  16949. // number of order returns to return in the response, used for paging.
  16950. // The default value is 25 returns per page, and the maximum allowed
  16951. // value is 250 returns per page.
  16952. func (c *OrderreturnsListCall) MaxResults(maxResults int64) *OrderreturnsListCall {
  16953. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16954. return c
  16955. }
  16956. // OrderBy sets the optional parameter "orderBy": Return the results in
  16957. // the specified order.
  16958. //
  16959. // Possible values:
  16960. // "returnCreationTimeAsc"
  16961. // "returnCreationTimeDesc"
  16962. func (c *OrderreturnsListCall) OrderBy(orderBy string) *OrderreturnsListCall {
  16963. c.urlParams_.Set("orderBy", orderBy)
  16964. return c
  16965. }
  16966. // PageToken sets the optional parameter "pageToken": The token returned
  16967. // by the previous request.
  16968. func (c *OrderreturnsListCall) PageToken(pageToken string) *OrderreturnsListCall {
  16969. c.urlParams_.Set("pageToken", pageToken)
  16970. return c
  16971. }
  16972. // Fields allows partial responses to be retrieved. See
  16973. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16974. // for more information.
  16975. func (c *OrderreturnsListCall) Fields(s ...googleapi.Field) *OrderreturnsListCall {
  16976. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16977. return c
  16978. }
  16979. // IfNoneMatch sets the optional parameter which makes the operation
  16980. // fail if the object's ETag matches the given value. This is useful for
  16981. // getting updates only after the object has changed since the last
  16982. // request. Use googleapi.IsNotModified to check whether the response
  16983. // error from Do is the result of In-None-Match.
  16984. func (c *OrderreturnsListCall) IfNoneMatch(entityTag string) *OrderreturnsListCall {
  16985. c.ifNoneMatch_ = entityTag
  16986. return c
  16987. }
  16988. // Context sets the context to be used in this call's Do method. Any
  16989. // pending HTTP request will be aborted if the provided context is
  16990. // canceled.
  16991. func (c *OrderreturnsListCall) Context(ctx context.Context) *OrderreturnsListCall {
  16992. c.ctx_ = ctx
  16993. return c
  16994. }
  16995. // Header returns an http.Header that can be modified by the caller to
  16996. // add HTTP headers to the request.
  16997. func (c *OrderreturnsListCall) Header() http.Header {
  16998. if c.header_ == nil {
  16999. c.header_ = make(http.Header)
  17000. }
  17001. return c.header_
  17002. }
  17003. func (c *OrderreturnsListCall) doRequest(alt string) (*http.Response, error) {
  17004. reqHeaders := make(http.Header)
  17005. for k, v := range c.header_ {
  17006. reqHeaders[k] = v
  17007. }
  17008. reqHeaders.Set("User-Agent", c.s.userAgent())
  17009. if c.ifNoneMatch_ != "" {
  17010. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17011. }
  17012. var body io.Reader = nil
  17013. c.urlParams_.Set("alt", alt)
  17014. c.urlParams_.Set("prettyPrint", "false")
  17015. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orderreturns")
  17016. urls += "?" + c.urlParams_.Encode()
  17017. req, err := http.NewRequest("GET", urls, body)
  17018. if err != nil {
  17019. return nil, err
  17020. }
  17021. req.Header = reqHeaders
  17022. googleapi.Expand(req.URL, map[string]string{
  17023. "merchantId": strconv.FormatUint(c.merchantId, 10),
  17024. })
  17025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17026. }
  17027. // Do executes the "content.orderreturns.list" call.
  17028. // Exactly one of *OrderreturnsListResponse or error will be non-nil.
  17029. // Any non-2xx status code is an error. Response headers are in either
  17030. // *OrderreturnsListResponse.ServerResponse.Header or (if a response was
  17031. // returned at all) in error.(*googleapi.Error).Header. Use
  17032. // googleapi.IsNotModified to check whether the returned error was
  17033. // because http.StatusNotModified was returned.
  17034. func (c *OrderreturnsListCall) Do(opts ...googleapi.CallOption) (*OrderreturnsListResponse, error) {
  17035. gensupport.SetOptions(c.urlParams_, opts...)
  17036. res, err := c.doRequest("json")
  17037. if res != nil && res.StatusCode == http.StatusNotModified {
  17038. if res.Body != nil {
  17039. res.Body.Close()
  17040. }
  17041. return nil, &googleapi.Error{
  17042. Code: res.StatusCode,
  17043. Header: res.Header,
  17044. }
  17045. }
  17046. if err != nil {
  17047. return nil, err
  17048. }
  17049. defer googleapi.CloseBody(res)
  17050. if err := googleapi.CheckResponse(res); err != nil {
  17051. return nil, err
  17052. }
  17053. ret := &OrderreturnsListResponse{
  17054. ServerResponse: googleapi.ServerResponse{
  17055. Header: res.Header,
  17056. HTTPStatusCode: res.StatusCode,
  17057. },
  17058. }
  17059. target := &ret
  17060. if err := gensupport.DecodeResponse(target, res); err != nil {
  17061. return nil, err
  17062. }
  17063. return ret, nil
  17064. // {
  17065. // "description": "Lists order returns in your Merchant Center account.",
  17066. // "httpMethod": "GET",
  17067. // "id": "content.orderreturns.list",
  17068. // "parameterOrder": [
  17069. // "merchantId"
  17070. // ],
  17071. // "parameters": {
  17072. // "createdEndDate": {
  17073. // "description": "Obtains order returns created before this date (inclusively), in ISO 8601 format.",
  17074. // "location": "query",
  17075. // "type": "string"
  17076. // },
  17077. // "createdStartDate": {
  17078. // "description": "Obtains order returns created after this date (inclusively), in ISO 8601 format.",
  17079. // "location": "query",
  17080. // "type": "string"
  17081. // },
  17082. // "maxResults": {
  17083. // "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.",
  17084. // "format": "uint32",
  17085. // "location": "query",
  17086. // "type": "integer"
  17087. // },
  17088. // "merchantId": {
  17089. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  17090. // "format": "uint64",
  17091. // "location": "path",
  17092. // "required": true,
  17093. // "type": "string"
  17094. // },
  17095. // "orderBy": {
  17096. // "description": "Return the results in the specified order.",
  17097. // "enum": [
  17098. // "returnCreationTimeAsc",
  17099. // "returnCreationTimeDesc"
  17100. // ],
  17101. // "enumDescriptions": [
  17102. // "",
  17103. // ""
  17104. // ],
  17105. // "location": "query",
  17106. // "type": "string"
  17107. // },
  17108. // "pageToken": {
  17109. // "description": "The token returned by the previous request.",
  17110. // "location": "query",
  17111. // "type": "string"
  17112. // }
  17113. // },
  17114. // "path": "{merchantId}/orderreturns",
  17115. // "response": {
  17116. // "$ref": "OrderreturnsListResponse"
  17117. // },
  17118. // "scopes": [
  17119. // "https://www.googleapis.com/auth/content"
  17120. // ]
  17121. // }
  17122. }
  17123. // Pages invokes f for each page of results.
  17124. // A non-nil error returned from f will halt the iteration.
  17125. // The provided context supersedes any context provided to the Context method.
  17126. func (c *OrderreturnsListCall) Pages(ctx context.Context, f func(*OrderreturnsListResponse) error) error {
  17127. c.ctx_ = ctx
  17128. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17129. for {
  17130. x, err := c.Do()
  17131. if err != nil {
  17132. return err
  17133. }
  17134. if err := f(x); err != nil {
  17135. return err
  17136. }
  17137. if x.NextPageToken == "" {
  17138. return nil
  17139. }
  17140. c.PageToken(x.NextPageToken)
  17141. }
  17142. }
  17143. // method id "content.orders.acknowledge":
  17144. type OrdersAcknowledgeCall struct {
  17145. s *APIService
  17146. merchantId uint64
  17147. orderId string
  17148. ordersacknowledgerequest *OrdersAcknowledgeRequest
  17149. urlParams_ gensupport.URLParams
  17150. ctx_ context.Context
  17151. header_ http.Header
  17152. }
  17153. // Acknowledge: Marks an order as acknowledged.
  17154. func (r *OrdersService) Acknowledge(merchantId uint64, orderId string, ordersacknowledgerequest *OrdersAcknowledgeRequest) *OrdersAcknowledgeCall {
  17155. c := &OrdersAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17156. c.merchantId = merchantId
  17157. c.orderId = orderId
  17158. c.ordersacknowledgerequest = ordersacknowledgerequest
  17159. return c
  17160. }
  17161. // Fields allows partial responses to be retrieved. See
  17162. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17163. // for more information.
  17164. func (c *OrdersAcknowledgeCall) Fields(s ...googleapi.Field) *OrdersAcknowledgeCall {
  17165. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17166. return c
  17167. }
  17168. // Context sets the context to be used in this call's Do method. Any
  17169. // pending HTTP request will be aborted if the provided context is
  17170. // canceled.
  17171. func (c *OrdersAcknowledgeCall) Context(ctx context.Context) *OrdersAcknowledgeCall {
  17172. c.ctx_ = ctx
  17173. return c
  17174. }
  17175. // Header returns an http.Header that can be modified by the caller to
  17176. // add HTTP headers to the request.
  17177. func (c *OrdersAcknowledgeCall) Header() http.Header {
  17178. if c.header_ == nil {
  17179. c.header_ = make(http.Header)
  17180. }
  17181. return c.header_
  17182. }
  17183. func (c *OrdersAcknowledgeCall) doRequest(alt string) (*http.Response, error) {
  17184. reqHeaders := make(http.Header)
  17185. for k, v := range c.header_ {
  17186. reqHeaders[k] = v
  17187. }
  17188. reqHeaders.Set("User-Agent", c.s.userAgent())
  17189. var body io.Reader = nil
  17190. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersacknowledgerequest)
  17191. if err != nil {
  17192. return nil, err
  17193. }
  17194. reqHeaders.Set("Content-Type", "application/json")
  17195. c.urlParams_.Set("alt", alt)
  17196. c.urlParams_.Set("prettyPrint", "false")
  17197. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/acknowledge")
  17198. urls += "?" + c.urlParams_.Encode()
  17199. req, err := http.NewRequest("POST", urls, body)
  17200. if err != nil {
  17201. return nil, err
  17202. }
  17203. req.Header = reqHeaders
  17204. googleapi.Expand(req.URL, map[string]string{
  17205. "merchantId": strconv.FormatUint(c.merchantId, 10),
  17206. "orderId": c.orderId,
  17207. })
  17208. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17209. }
  17210. // Do executes the "content.orders.acknowledge" call.
  17211. // Exactly one of *OrdersAcknowledgeResponse or error will be non-nil.
  17212. // Any non-2xx status code is an error. Response headers are in either
  17213. // *OrdersAcknowledgeResponse.ServerResponse.Header or (if a response
  17214. // was returned at all) in error.(*googleapi.Error).Header. Use
  17215. // googleapi.IsNotModified to check whether the returned error was
  17216. // because http.StatusNotModified was returned.
  17217. func (c *OrdersAcknowledgeCall) Do(opts ...googleapi.CallOption) (*OrdersAcknowledgeResponse, error) {
  17218. gensupport.SetOptions(c.urlParams_, opts...)
  17219. res, err := c.doRequest("json")
  17220. if res != nil && res.StatusCode == http.StatusNotModified {
  17221. if res.Body != nil {
  17222. res.Body.Close()
  17223. }
  17224. return nil, &googleapi.Error{
  17225. Code: res.StatusCode,
  17226. Header: res.Header,
  17227. }
  17228. }
  17229. if err != nil {
  17230. return nil, err
  17231. }
  17232. defer googleapi.CloseBody(res)
  17233. if err := googleapi.CheckResponse(res); err != nil {
  17234. return nil, err
  17235. }
  17236. ret := &OrdersAcknowledgeResponse{
  17237. ServerResponse: googleapi.ServerResponse{
  17238. Header: res.Header,
  17239. HTTPStatusCode: res.StatusCode,
  17240. },
  17241. }
  17242. target := &ret
  17243. if err := gensupport.DecodeResponse(target, res); err != nil {
  17244. return nil, err
  17245. }
  17246. return ret, nil
  17247. // {
  17248. // "description": "Marks an order as acknowledged.",
  17249. // "httpMethod": "POST",
  17250. // "id": "content.orders.acknowledge",
  17251. // "parameterOrder": [
  17252. // "merchantId",
  17253. // "orderId"
  17254. // ],
  17255. // "parameters": {
  17256. // "merchantId": {
  17257. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  17258. // "format": "uint64",
  17259. // "location": "path",
  17260. // "required": true,
  17261. // "type": "string"
  17262. // },
  17263. // "orderId": {
  17264. // "description": "The ID of the order.",
  17265. // "location": "path",
  17266. // "required": true,
  17267. // "type": "string"
  17268. // }
  17269. // },
  17270. // "path": "{merchantId}/orders/{orderId}/acknowledge",
  17271. // "request": {
  17272. // "$ref": "OrdersAcknowledgeRequest"
  17273. // },
  17274. // "response": {
  17275. // "$ref": "OrdersAcknowledgeResponse"
  17276. // },
  17277. // "scopes": [
  17278. // "https://www.googleapis.com/auth/content"
  17279. // ]
  17280. // }
  17281. }
  17282. // method id "content.orders.advancetestorder":
  17283. type OrdersAdvancetestorderCall struct {
  17284. s *APIService
  17285. merchantId uint64
  17286. orderId string
  17287. urlParams_ gensupport.URLParams
  17288. ctx_ context.Context
  17289. header_ http.Header
  17290. }
  17291. // Advancetestorder: Sandbox only. Moves a test order from state
  17292. // "inProgress" to state "pendingShipment".
  17293. func (r *OrdersService) Advancetestorder(merchantId uint64, orderId string) *OrdersAdvancetestorderCall {
  17294. c := &OrdersAdvancetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17295. c.merchantId = merchantId
  17296. c.orderId = orderId
  17297. return c
  17298. }
  17299. // Fields allows partial responses to be retrieved. See
  17300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17301. // for more information.
  17302. func (c *OrdersAdvancetestorderCall) Fields(s ...googleapi.Field) *OrdersAdvancetestorderCall {
  17303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17304. return c
  17305. }
  17306. // Context sets the context to be used in this call's Do method. Any
  17307. // pending HTTP request will be aborted if the provided context is
  17308. // canceled.
  17309. func (c *OrdersAdvancetestorderCall) Context(ctx context.Context) *OrdersAdvancetestorderCall {
  17310. c.ctx_ = ctx
  17311. return c
  17312. }
  17313. // Header returns an http.Header that can be modified by the caller to
  17314. // add HTTP headers to the request.
  17315. func (c *OrdersAdvancetestorderCall) Header() http.Header {
  17316. if c.header_ == nil {
  17317. c.header_ = make(http.Header)
  17318. }
  17319. return c.header_
  17320. }
  17321. func (c *OrdersAdvancetestorderCall) doRequest(alt string) (*http.Response, error) {
  17322. reqHeaders := make(http.Header)
  17323. for k, v := range c.header_ {
  17324. reqHeaders[k] = v
  17325. }
  17326. reqHeaders.Set("User-Agent", c.s.userAgent())
  17327. var body io.Reader = nil
  17328. c.urlParams_.Set("alt", alt)
  17329. c.urlParams_.Set("prettyPrint", "false")
  17330. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders/{orderId}/advance")
  17331. urls += "?" + c.urlParams_.Encode()
  17332. req, err := http.NewRequest("POST", urls, body)
  17333. if err != nil {
  17334. return nil, err
  17335. }
  17336. req.Header = reqHeaders
  17337. googleapi.Expand(req.URL, map[string]string{
  17338. "merchantId": strconv.FormatUint(c.merchantId, 10),
  17339. "orderId": c.orderId,
  17340. })
  17341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17342. }
  17343. // Do executes the "content.orders.advancetestorder" call.
  17344. // Exactly one of *OrdersAdvanceTestOrderResponse or error will be
  17345. // non-nil. Any non-2xx status code is an error. Response headers are in
  17346. // either *OrdersAdvanceTestOrderResponse.ServerResponse.Header or (if a
  17347. // response was returned at all) in error.(*googleapi.Error).Header. Use
  17348. // googleapi.IsNotModified to check whether the returned error was
  17349. // because http.StatusNotModified was returned.
  17350. func (c *OrdersAdvancetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersAdvanceTestOrderResponse, error) {
  17351. gensupport.SetOptions(c.urlParams_, opts...)
  17352. res, err := c.doRequest("json")
  17353. if res != nil && res.StatusCode == http.StatusNotModified {
  17354. if res.Body != nil {
  17355. res.Body.Close()
  17356. }
  17357. return nil, &googleapi.Error{
  17358. Code: res.StatusCode,
  17359. Header: res.Header,
  17360. }
  17361. }
  17362. if err != nil {
  17363. return nil, err
  17364. }
  17365. defer googleapi.CloseBody(res)
  17366. if err := googleapi.CheckResponse(res); err != nil {
  17367. return nil, err
  17368. }
  17369. ret := &OrdersAdvanceTestOrderResponse{
  17370. ServerResponse: googleapi.ServerResponse{
  17371. Header: res.Header,
  17372. HTTPStatusCode: res.StatusCode,
  17373. },
  17374. }
  17375. target := &ret
  17376. if err := gensupport.DecodeResponse(target, res); err != nil {
  17377. return nil, err
  17378. }
  17379. return ret, nil
  17380. // {
  17381. // "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".",
  17382. // "httpMethod": "POST",
  17383. // "id": "content.orders.advancetestorder",
  17384. // "parameterOrder": [
  17385. // "merchantId",
  17386. // "orderId"
  17387. // ],
  17388. // "parameters": {
  17389. // "merchantId": {
  17390. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  17391. // "format": "uint64",
  17392. // "location": "path",
  17393. // "required": true,
  17394. // "type": "string"
  17395. // },
  17396. // "orderId": {
  17397. // "description": "The ID of the test order to modify.",
  17398. // "location": "path",
  17399. // "required": true,
  17400. // "type": "string"
  17401. // }
  17402. // },
  17403. // "path": "{merchantId}/testorders/{orderId}/advance",
  17404. // "response": {
  17405. // "$ref": "OrdersAdvanceTestOrderResponse"
  17406. // },
  17407. // "scopes": [
  17408. // "https://www.googleapis.com/auth/content"
  17409. // ]
  17410. // }
  17411. }
  17412. // method id "content.orders.cancel":
  17413. type OrdersCancelCall struct {
  17414. s *APIService
  17415. merchantId uint64
  17416. orderId string
  17417. orderscancelrequest *OrdersCancelRequest
  17418. urlParams_ gensupport.URLParams
  17419. ctx_ context.Context
  17420. header_ http.Header
  17421. }
  17422. // Cancel: Cancels all line items in an order, making a full refund.
  17423. func (r *OrdersService) Cancel(merchantId uint64, orderId string, orderscancelrequest *OrdersCancelRequest) *OrdersCancelCall {
  17424. c := &OrdersCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17425. c.merchantId = merchantId
  17426. c.orderId = orderId
  17427. c.orderscancelrequest = orderscancelrequest
  17428. return c
  17429. }
  17430. // Fields allows partial responses to be retrieved. See
  17431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17432. // for more information.
  17433. func (c *OrdersCancelCall) Fields(s ...googleapi.Field) *OrdersCancelCall {
  17434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17435. return c
  17436. }
  17437. // Context sets the context to be used in this call's Do method. Any
  17438. // pending HTTP request will be aborted if the provided context is
  17439. // canceled.
  17440. func (c *OrdersCancelCall) Context(ctx context.Context) *OrdersCancelCall {
  17441. c.ctx_ = ctx
  17442. return c
  17443. }
  17444. // Header returns an http.Header that can be modified by the caller to
  17445. // add HTTP headers to the request.
  17446. func (c *OrdersCancelCall) Header() http.Header {
  17447. if c.header_ == nil {
  17448. c.header_ = make(http.Header)
  17449. }
  17450. return c.header_
  17451. }
  17452. func (c *OrdersCancelCall) doRequest(alt string) (*http.Response, error) {
  17453. reqHeaders := make(http.Header)
  17454. for k, v := range c.header_ {
  17455. reqHeaders[k] = v
  17456. }
  17457. reqHeaders.Set("User-Agent", c.s.userAgent())
  17458. var body io.Reader = nil
  17459. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancelrequest)
  17460. if err != nil {
  17461. return nil, err
  17462. }
  17463. reqHeaders.Set("Content-Type", "application/json")
  17464. c.urlParams_.Set("alt", alt)
  17465. c.urlParams_.Set("prettyPrint", "false")
  17466. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancel")
  17467. urls += "?" + c.urlParams_.Encode()
  17468. req, err := http.NewRequest("POST", urls, body)
  17469. if err != nil {
  17470. return nil, err
  17471. }
  17472. req.Header = reqHeaders
  17473. googleapi.Expand(req.URL, map[string]string{
  17474. "merchantId": strconv.FormatUint(c.merchantId, 10),
  17475. "orderId": c.orderId,
  17476. })
  17477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17478. }
  17479. // Do executes the "content.orders.cancel" call.
  17480. // Exactly one of *OrdersCancelResponse or error will be non-nil. Any
  17481. // non-2xx status code is an error. Response headers are in either
  17482. // *OrdersCancelResponse.ServerResponse.Header or (if a response was
  17483. // returned at all) in error.(*googleapi.Error).Header. Use
  17484. // googleapi.IsNotModified to check whether the returned error was
  17485. // because http.StatusNotModified was returned.
  17486. func (c *OrdersCancelCall) Do(opts ...googleapi.CallOption) (*OrdersCancelResponse, error) {
  17487. gensupport.SetOptions(c.urlParams_, opts...)
  17488. res, err := c.doRequest("json")
  17489. if res != nil && res.StatusCode == http.StatusNotModified {
  17490. if res.Body != nil {
  17491. res.Body.Close()
  17492. }
  17493. return nil, &googleapi.Error{
  17494. Code: res.StatusCode,
  17495. Header: res.Header,
  17496. }
  17497. }
  17498. if err != nil {
  17499. return nil, err
  17500. }
  17501. defer googleapi.CloseBody(res)
  17502. if err := googleapi.CheckResponse(res); err != nil {
  17503. return nil, err
  17504. }
  17505. ret := &OrdersCancelResponse{
  17506. ServerResponse: googleapi.ServerResponse{
  17507. Header: res.Header,
  17508. HTTPStatusCode: res.StatusCode,
  17509. },
  17510. }
  17511. target := &ret
  17512. if err := gensupport.DecodeResponse(target, res); err != nil {
  17513. return nil, err
  17514. }
  17515. return ret, nil
  17516. // {
  17517. // "description": "Cancels all line items in an order, making a full refund.",
  17518. // "httpMethod": "POST",
  17519. // "id": "content.orders.cancel",
  17520. // "parameterOrder": [
  17521. // "merchantId",
  17522. // "orderId"
  17523. // ],
  17524. // "parameters": {
  17525. // "merchantId": {
  17526. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  17527. // "format": "uint64",
  17528. // "location": "path",
  17529. // "required": true,
  17530. // "type": "string"
  17531. // },
  17532. // "orderId": {
  17533. // "description": "The ID of the order to cancel.",
  17534. // "location": "path",
  17535. // "required": true,
  17536. // "type": "string"
  17537. // }
  17538. // },
  17539. // "path": "{merchantId}/orders/{orderId}/cancel",
  17540. // "request": {
  17541. // "$ref": "OrdersCancelRequest"
  17542. // },
  17543. // "response": {
  17544. // "$ref": "OrdersCancelResponse"
  17545. // },
  17546. // "scopes": [
  17547. // "https://www.googleapis.com/auth/content"
  17548. // ]
  17549. // }
  17550. }
  17551. // method id "content.orders.cancellineitem":
  17552. type OrdersCancellineitemCall struct {
  17553. s *APIService
  17554. merchantId uint64
  17555. orderId string
  17556. orderscancellineitemrequest *OrdersCancelLineItemRequest
  17557. urlParams_ gensupport.URLParams
  17558. ctx_ context.Context
  17559. header_ http.Header
  17560. }
  17561. // Cancellineitem: Cancels a line item, making a full refund.
  17562. func (r *OrdersService) Cancellineitem(merchantId uint64, orderId string, orderscancellineitemrequest *OrdersCancelLineItemRequest) *OrdersCancellineitemCall {
  17563. c := &OrdersCancellineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17564. c.merchantId = merchantId
  17565. c.orderId = orderId
  17566. c.orderscancellineitemrequest = orderscancellineitemrequest
  17567. return c
  17568. }
  17569. // Fields allows partial responses to be retrieved. See
  17570. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17571. // for more information.
  17572. func (c *OrdersCancellineitemCall) Fields(s ...googleapi.Field) *OrdersCancellineitemCall {
  17573. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17574. return c
  17575. }
  17576. // Context sets the context to be used in this call's Do method. Any
  17577. // pending HTTP request will be aborted if the provided context is
  17578. // canceled.
  17579. func (c *OrdersCancellineitemCall) Context(ctx context.Context) *OrdersCancellineitemCall {
  17580. c.ctx_ = ctx
  17581. return c
  17582. }
  17583. // Header returns an http.Header that can be modified by the caller to
  17584. // add HTTP headers to the request.
  17585. func (c *OrdersCancellineitemCall) Header() http.Header {
  17586. if c.header_ == nil {
  17587. c.header_ = make(http.Header)
  17588. }
  17589. return c.header_
  17590. }
  17591. func (c *OrdersCancellineitemCall) doRequest(alt string) (*http.Response, error) {
  17592. reqHeaders := make(http.Header)
  17593. for k, v := range c.header_ {
  17594. reqHeaders[k] = v
  17595. }
  17596. reqHeaders.Set("User-Agent", c.s.userAgent())
  17597. var body io.Reader = nil
  17598. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancellineitemrequest)
  17599. if err != nil {
  17600. return nil, err
  17601. }
  17602. reqHeaders.Set("Content-Type", "application/json")
  17603. c.urlParams_.Set("alt", alt)
  17604. c.urlParams_.Set("prettyPrint", "false")
  17605. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancelLineItem")
  17606. urls += "?" + c.urlParams_.Encode()
  17607. req, err := http.NewRequest("POST", urls, body)
  17608. if err != nil {
  17609. return nil, err
  17610. }
  17611. req.Header = reqHeaders
  17612. googleapi.Expand(req.URL, map[string]string{
  17613. "merchantId": strconv.FormatUint(c.merchantId, 10),
  17614. "orderId": c.orderId,
  17615. })
  17616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17617. }
  17618. // Do executes the "content.orders.cancellineitem" call.
  17619. // Exactly one of *OrdersCancelLineItemResponse or error will be
  17620. // non-nil. Any non-2xx status code is an error. Response headers are in
  17621. // either *OrdersCancelLineItemResponse.ServerResponse.Header or (if a
  17622. // response was returned at all) in error.(*googleapi.Error).Header. Use
  17623. // googleapi.IsNotModified to check whether the returned error was
  17624. // because http.StatusNotModified was returned.
  17625. func (c *OrdersCancellineitemCall) Do(opts ...googleapi.CallOption) (*OrdersCancelLineItemResponse, error) {
  17626. gensupport.SetOptions(c.urlParams_, opts...)
  17627. res, err := c.doRequest("json")
  17628. if res != nil && res.StatusCode == http.StatusNotModified {
  17629. if res.Body != nil {
  17630. res.Body.Close()
  17631. }
  17632. return nil, &googleapi.Error{
  17633. Code: res.StatusCode,
  17634. Header: res.Header,
  17635. }
  17636. }
  17637. if err != nil {
  17638. return nil, err
  17639. }
  17640. defer googleapi.CloseBody(res)
  17641. if err := googleapi.CheckResponse(res); err != nil {
  17642. return nil, err
  17643. }
  17644. ret := &OrdersCancelLineItemResponse{
  17645. ServerResponse: googleapi.ServerResponse{
  17646. Header: res.Header,
  17647. HTTPStatusCode: res.StatusCode,
  17648. },
  17649. }
  17650. target := &ret
  17651. if err := gensupport.DecodeResponse(target, res); err != nil {
  17652. return nil, err
  17653. }
  17654. return ret, nil
  17655. // {
  17656. // "description": "Cancels a line item, making a full refund.",
  17657. // "httpMethod": "POST",
  17658. // "id": "content.orders.cancellineitem",
  17659. // "parameterOrder": [
  17660. // "merchantId",
  17661. // "orderId"
  17662. // ],
  17663. // "parameters": {
  17664. // "merchantId": {
  17665. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  17666. // "format": "uint64",
  17667. // "location": "path",
  17668. // "required": true,
  17669. // "type": "string"
  17670. // },
  17671. // "orderId": {
  17672. // "description": "The ID of the order.",
  17673. // "location": "path",
  17674. // "required": true,
  17675. // "type": "string"
  17676. // }
  17677. // },
  17678. // "path": "{merchantId}/orders/{orderId}/cancelLineItem",
  17679. // "request": {
  17680. // "$ref": "OrdersCancelLineItemRequest"
  17681. // },
  17682. // "response": {
  17683. // "$ref": "OrdersCancelLineItemResponse"
  17684. // },
  17685. // "scopes": [
  17686. // "https://www.googleapis.com/auth/content"
  17687. // ]
  17688. // }
  17689. }
  17690. // method id "content.orders.canceltestorderbycustomer":
  17691. type OrdersCanceltestorderbycustomerCall struct {
  17692. s *APIService
  17693. merchantId uint64
  17694. orderId string
  17695. orderscanceltestorderbycustomerrequest *OrdersCancelTestOrderByCustomerRequest
  17696. urlParams_ gensupport.URLParams
  17697. ctx_ context.Context
  17698. header_ http.Header
  17699. }
  17700. // Canceltestorderbycustomer: Sandbox only. Cancels a test order for
  17701. // customer-initiated cancellation.
  17702. func (r *OrdersService) Canceltestorderbycustomer(merchantId uint64, orderId string, orderscanceltestorderbycustomerrequest *OrdersCancelTestOrderByCustomerRequest) *OrdersCanceltestorderbycustomerCall {
  17703. c := &OrdersCanceltestorderbycustomerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17704. c.merchantId = merchantId
  17705. c.orderId = orderId
  17706. c.orderscanceltestorderbycustomerrequest = orderscanceltestorderbycustomerrequest
  17707. return c
  17708. }
  17709. // Fields allows partial responses to be retrieved. See
  17710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17711. // for more information.
  17712. func (c *OrdersCanceltestorderbycustomerCall) Fields(s ...googleapi.Field) *OrdersCanceltestorderbycustomerCall {
  17713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17714. return c
  17715. }
  17716. // Context sets the context to be used in this call's Do method. Any
  17717. // pending HTTP request will be aborted if the provided context is
  17718. // canceled.
  17719. func (c *OrdersCanceltestorderbycustomerCall) Context(ctx context.Context) *OrdersCanceltestorderbycustomerCall {
  17720. c.ctx_ = ctx
  17721. return c
  17722. }
  17723. // Header returns an http.Header that can be modified by the caller to
  17724. // add HTTP headers to the request.
  17725. func (c *OrdersCanceltestorderbycustomerCall) Header() http.Header {
  17726. if c.header_ == nil {
  17727. c.header_ = make(http.Header)
  17728. }
  17729. return c.header_
  17730. }
  17731. func (c *OrdersCanceltestorderbycustomerCall) doRequest(alt string) (*http.Response, error) {
  17732. reqHeaders := make(http.Header)
  17733. for k, v := range c.header_ {
  17734. reqHeaders[k] = v
  17735. }
  17736. reqHeaders.Set("User-Agent", c.s.userAgent())
  17737. var body io.Reader = nil
  17738. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscanceltestorderbycustomerrequest)
  17739. if err != nil {
  17740. return nil, err
  17741. }
  17742. reqHeaders.Set("Content-Type", "application/json")
  17743. c.urlParams_.Set("alt", alt)
  17744. c.urlParams_.Set("prettyPrint", "false")
  17745. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders/{orderId}/cancelByCustomer")
  17746. urls += "?" + c.urlParams_.Encode()
  17747. req, err := http.NewRequest("POST", urls, body)
  17748. if err != nil {
  17749. return nil, err
  17750. }
  17751. req.Header = reqHeaders
  17752. googleapi.Expand(req.URL, map[string]string{
  17753. "merchantId": strconv.FormatUint(c.merchantId, 10),
  17754. "orderId": c.orderId,
  17755. })
  17756. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17757. }
  17758. // Do executes the "content.orders.canceltestorderbycustomer" call.
  17759. // Exactly one of *OrdersCancelTestOrderByCustomerResponse or error will
  17760. // be non-nil. Any non-2xx status code is an error. Response headers are
  17761. // in either
  17762. // *OrdersCancelTestOrderByCustomerResponse.ServerResponse.Header or (if
  17763. // a response was returned at all) in error.(*googleapi.Error).Header.
  17764. // Use googleapi.IsNotModified to check whether the returned error was
  17765. // because http.StatusNotModified was returned.
  17766. func (c *OrdersCanceltestorderbycustomerCall) Do(opts ...googleapi.CallOption) (*OrdersCancelTestOrderByCustomerResponse, error) {
  17767. gensupport.SetOptions(c.urlParams_, opts...)
  17768. res, err := c.doRequest("json")
  17769. if res != nil && res.StatusCode == http.StatusNotModified {
  17770. if res.Body != nil {
  17771. res.Body.Close()
  17772. }
  17773. return nil, &googleapi.Error{
  17774. Code: res.StatusCode,
  17775. Header: res.Header,
  17776. }
  17777. }
  17778. if err != nil {
  17779. return nil, err
  17780. }
  17781. defer googleapi.CloseBody(res)
  17782. if err := googleapi.CheckResponse(res); err != nil {
  17783. return nil, err
  17784. }
  17785. ret := &OrdersCancelTestOrderByCustomerResponse{
  17786. ServerResponse: googleapi.ServerResponse{
  17787. Header: res.Header,
  17788. HTTPStatusCode: res.StatusCode,
  17789. },
  17790. }
  17791. target := &ret
  17792. if err := gensupport.DecodeResponse(target, res); err != nil {
  17793. return nil, err
  17794. }
  17795. return ret, nil
  17796. // {
  17797. // "description": "Sandbox only. Cancels a test order for customer-initiated cancellation.",
  17798. // "httpMethod": "POST",
  17799. // "id": "content.orders.canceltestorderbycustomer",
  17800. // "parameterOrder": [
  17801. // "merchantId",
  17802. // "orderId"
  17803. // ],
  17804. // "parameters": {
  17805. // "merchantId": {
  17806. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  17807. // "format": "uint64",
  17808. // "location": "path",
  17809. // "required": true,
  17810. // "type": "string"
  17811. // },
  17812. // "orderId": {
  17813. // "description": "The ID of the test order to cancel.",
  17814. // "location": "path",
  17815. // "required": true,
  17816. // "type": "string"
  17817. // }
  17818. // },
  17819. // "path": "{merchantId}/testorders/{orderId}/cancelByCustomer",
  17820. // "request": {
  17821. // "$ref": "OrdersCancelTestOrderByCustomerRequest"
  17822. // },
  17823. // "response": {
  17824. // "$ref": "OrdersCancelTestOrderByCustomerResponse"
  17825. // },
  17826. // "scopes": [
  17827. // "https://www.googleapis.com/auth/content"
  17828. // ]
  17829. // }
  17830. }
  17831. // method id "content.orders.createtestorder":
  17832. type OrdersCreatetestorderCall struct {
  17833. s *APIService
  17834. merchantId uint64
  17835. orderscreatetestorderrequest *OrdersCreateTestOrderRequest
  17836. urlParams_ gensupport.URLParams
  17837. ctx_ context.Context
  17838. header_ http.Header
  17839. }
  17840. // Createtestorder: Sandbox only. Creates a test order.
  17841. func (r *OrdersService) Createtestorder(merchantId uint64, orderscreatetestorderrequest *OrdersCreateTestOrderRequest) *OrdersCreatetestorderCall {
  17842. c := &OrdersCreatetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17843. c.merchantId = merchantId
  17844. c.orderscreatetestorderrequest = orderscreatetestorderrequest
  17845. return c
  17846. }
  17847. // Fields allows partial responses to be retrieved. See
  17848. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17849. // for more information.
  17850. func (c *OrdersCreatetestorderCall) Fields(s ...googleapi.Field) *OrdersCreatetestorderCall {
  17851. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17852. return c
  17853. }
  17854. // Context sets the context to be used in this call's Do method. Any
  17855. // pending HTTP request will be aborted if the provided context is
  17856. // canceled.
  17857. func (c *OrdersCreatetestorderCall) Context(ctx context.Context) *OrdersCreatetestorderCall {
  17858. c.ctx_ = ctx
  17859. return c
  17860. }
  17861. // Header returns an http.Header that can be modified by the caller to
  17862. // add HTTP headers to the request.
  17863. func (c *OrdersCreatetestorderCall) Header() http.Header {
  17864. if c.header_ == nil {
  17865. c.header_ = make(http.Header)
  17866. }
  17867. return c.header_
  17868. }
  17869. func (c *OrdersCreatetestorderCall) doRequest(alt string) (*http.Response, error) {
  17870. reqHeaders := make(http.Header)
  17871. for k, v := range c.header_ {
  17872. reqHeaders[k] = v
  17873. }
  17874. reqHeaders.Set("User-Agent", c.s.userAgent())
  17875. var body io.Reader = nil
  17876. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscreatetestorderrequest)
  17877. if err != nil {
  17878. return nil, err
  17879. }
  17880. reqHeaders.Set("Content-Type", "application/json")
  17881. c.urlParams_.Set("alt", alt)
  17882. c.urlParams_.Set("prettyPrint", "false")
  17883. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders")
  17884. urls += "?" + c.urlParams_.Encode()
  17885. req, err := http.NewRequest("POST", urls, body)
  17886. if err != nil {
  17887. return nil, err
  17888. }
  17889. req.Header = reqHeaders
  17890. googleapi.Expand(req.URL, map[string]string{
  17891. "merchantId": strconv.FormatUint(c.merchantId, 10),
  17892. })
  17893. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17894. }
  17895. // Do executes the "content.orders.createtestorder" call.
  17896. // Exactly one of *OrdersCreateTestOrderResponse or error will be
  17897. // non-nil. Any non-2xx status code is an error. Response headers are in
  17898. // either *OrdersCreateTestOrderResponse.ServerResponse.Header or (if a
  17899. // response was returned at all) in error.(*googleapi.Error).Header. Use
  17900. // googleapi.IsNotModified to check whether the returned error was
  17901. // because http.StatusNotModified was returned.
  17902. func (c *OrdersCreatetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersCreateTestOrderResponse, error) {
  17903. gensupport.SetOptions(c.urlParams_, opts...)
  17904. res, err := c.doRequest("json")
  17905. if res != nil && res.StatusCode == http.StatusNotModified {
  17906. if res.Body != nil {
  17907. res.Body.Close()
  17908. }
  17909. return nil, &googleapi.Error{
  17910. Code: res.StatusCode,
  17911. Header: res.Header,
  17912. }
  17913. }
  17914. if err != nil {
  17915. return nil, err
  17916. }
  17917. defer googleapi.CloseBody(res)
  17918. if err := googleapi.CheckResponse(res); err != nil {
  17919. return nil, err
  17920. }
  17921. ret := &OrdersCreateTestOrderResponse{
  17922. ServerResponse: googleapi.ServerResponse{
  17923. Header: res.Header,
  17924. HTTPStatusCode: res.StatusCode,
  17925. },
  17926. }
  17927. target := &ret
  17928. if err := gensupport.DecodeResponse(target, res); err != nil {
  17929. return nil, err
  17930. }
  17931. return ret, nil
  17932. // {
  17933. // "description": "Sandbox only. Creates a test order.",
  17934. // "httpMethod": "POST",
  17935. // "id": "content.orders.createtestorder",
  17936. // "parameterOrder": [
  17937. // "merchantId"
  17938. // ],
  17939. // "parameters": {
  17940. // "merchantId": {
  17941. // "description": "The ID of the account that should manage the order. This cannot be a multi-client account.",
  17942. // "format": "uint64",
  17943. // "location": "path",
  17944. // "required": true,
  17945. // "type": "string"
  17946. // }
  17947. // },
  17948. // "path": "{merchantId}/testorders",
  17949. // "request": {
  17950. // "$ref": "OrdersCreateTestOrderRequest"
  17951. // },
  17952. // "response": {
  17953. // "$ref": "OrdersCreateTestOrderResponse"
  17954. // },
  17955. // "scopes": [
  17956. // "https://www.googleapis.com/auth/content"
  17957. // ]
  17958. // }
  17959. }
  17960. // method id "content.orders.createtestreturn":
  17961. type OrdersCreatetestreturnCall struct {
  17962. s *APIService
  17963. merchantId uint64
  17964. orderId string
  17965. orderscreatetestreturnrequest *OrdersCreateTestReturnRequest
  17966. urlParams_ gensupport.URLParams
  17967. ctx_ context.Context
  17968. header_ http.Header
  17969. }
  17970. // Createtestreturn: Sandbox only. Creates a test return.
  17971. func (r *OrdersService) Createtestreturn(merchantId uint64, orderId string, orderscreatetestreturnrequest *OrdersCreateTestReturnRequest) *OrdersCreatetestreturnCall {
  17972. c := &OrdersCreatetestreturnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17973. c.merchantId = merchantId
  17974. c.orderId = orderId
  17975. c.orderscreatetestreturnrequest = orderscreatetestreturnrequest
  17976. return c
  17977. }
  17978. // Fields allows partial responses to be retrieved. See
  17979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17980. // for more information.
  17981. func (c *OrdersCreatetestreturnCall) Fields(s ...googleapi.Field) *OrdersCreatetestreturnCall {
  17982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17983. return c
  17984. }
  17985. // Context sets the context to be used in this call's Do method. Any
  17986. // pending HTTP request will be aborted if the provided context is
  17987. // canceled.
  17988. func (c *OrdersCreatetestreturnCall) Context(ctx context.Context) *OrdersCreatetestreturnCall {
  17989. c.ctx_ = ctx
  17990. return c
  17991. }
  17992. // Header returns an http.Header that can be modified by the caller to
  17993. // add HTTP headers to the request.
  17994. func (c *OrdersCreatetestreturnCall) Header() http.Header {
  17995. if c.header_ == nil {
  17996. c.header_ = make(http.Header)
  17997. }
  17998. return c.header_
  17999. }
  18000. func (c *OrdersCreatetestreturnCall) doRequest(alt string) (*http.Response, error) {
  18001. reqHeaders := make(http.Header)
  18002. for k, v := range c.header_ {
  18003. reqHeaders[k] = v
  18004. }
  18005. reqHeaders.Set("User-Agent", c.s.userAgent())
  18006. var body io.Reader = nil
  18007. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscreatetestreturnrequest)
  18008. if err != nil {
  18009. return nil, err
  18010. }
  18011. reqHeaders.Set("Content-Type", "application/json")
  18012. c.urlParams_.Set("alt", alt)
  18013. c.urlParams_.Set("prettyPrint", "false")
  18014. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/testreturn")
  18015. urls += "?" + c.urlParams_.Encode()
  18016. req, err := http.NewRequest("POST", urls, body)
  18017. if err != nil {
  18018. return nil, err
  18019. }
  18020. req.Header = reqHeaders
  18021. googleapi.Expand(req.URL, map[string]string{
  18022. "merchantId": strconv.FormatUint(c.merchantId, 10),
  18023. "orderId": c.orderId,
  18024. })
  18025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18026. }
  18027. // Do executes the "content.orders.createtestreturn" call.
  18028. // Exactly one of *OrdersCreateTestReturnResponse or error will be
  18029. // non-nil. Any non-2xx status code is an error. Response headers are in
  18030. // either *OrdersCreateTestReturnResponse.ServerResponse.Header or (if a
  18031. // response was returned at all) in error.(*googleapi.Error).Header. Use
  18032. // googleapi.IsNotModified to check whether the returned error was
  18033. // because http.StatusNotModified was returned.
  18034. func (c *OrdersCreatetestreturnCall) Do(opts ...googleapi.CallOption) (*OrdersCreateTestReturnResponse, error) {
  18035. gensupport.SetOptions(c.urlParams_, opts...)
  18036. res, err := c.doRequest("json")
  18037. if res != nil && res.StatusCode == http.StatusNotModified {
  18038. if res.Body != nil {
  18039. res.Body.Close()
  18040. }
  18041. return nil, &googleapi.Error{
  18042. Code: res.StatusCode,
  18043. Header: res.Header,
  18044. }
  18045. }
  18046. if err != nil {
  18047. return nil, err
  18048. }
  18049. defer googleapi.CloseBody(res)
  18050. if err := googleapi.CheckResponse(res); err != nil {
  18051. return nil, err
  18052. }
  18053. ret := &OrdersCreateTestReturnResponse{
  18054. ServerResponse: googleapi.ServerResponse{
  18055. Header: res.Header,
  18056. HTTPStatusCode: res.StatusCode,
  18057. },
  18058. }
  18059. target := &ret
  18060. if err := gensupport.DecodeResponse(target, res); err != nil {
  18061. return nil, err
  18062. }
  18063. return ret, nil
  18064. // {
  18065. // "description": "Sandbox only. Creates a test return.",
  18066. // "httpMethod": "POST",
  18067. // "id": "content.orders.createtestreturn",
  18068. // "parameterOrder": [
  18069. // "merchantId",
  18070. // "orderId"
  18071. // ],
  18072. // "parameters": {
  18073. // "merchantId": {
  18074. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  18075. // "format": "uint64",
  18076. // "location": "path",
  18077. // "required": true,
  18078. // "type": "string"
  18079. // },
  18080. // "orderId": {
  18081. // "description": "The ID of the order.",
  18082. // "location": "path",
  18083. // "required": true,
  18084. // "type": "string"
  18085. // }
  18086. // },
  18087. // "path": "{merchantId}/orders/{orderId}/testreturn",
  18088. // "request": {
  18089. // "$ref": "OrdersCreateTestReturnRequest"
  18090. // },
  18091. // "response": {
  18092. // "$ref": "OrdersCreateTestReturnResponse"
  18093. // },
  18094. // "scopes": [
  18095. // "https://www.googleapis.com/auth/content"
  18096. // ]
  18097. // }
  18098. }
  18099. // method id "content.orders.custombatch":
  18100. type OrdersCustombatchCall struct {
  18101. s *APIService
  18102. orderscustombatchrequest *OrdersCustomBatchRequest
  18103. urlParams_ gensupport.URLParams
  18104. ctx_ context.Context
  18105. header_ http.Header
  18106. }
  18107. // Custombatch: Retrieves or modifies multiple orders in a single
  18108. // request.
  18109. func (r *OrdersService) Custombatch(orderscustombatchrequest *OrdersCustomBatchRequest) *OrdersCustombatchCall {
  18110. c := &OrdersCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18111. c.orderscustombatchrequest = orderscustombatchrequest
  18112. return c
  18113. }
  18114. // Fields allows partial responses to be retrieved. See
  18115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18116. // for more information.
  18117. func (c *OrdersCustombatchCall) Fields(s ...googleapi.Field) *OrdersCustombatchCall {
  18118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18119. return c
  18120. }
  18121. // Context sets the context to be used in this call's Do method. Any
  18122. // pending HTTP request will be aborted if the provided context is
  18123. // canceled.
  18124. func (c *OrdersCustombatchCall) Context(ctx context.Context) *OrdersCustombatchCall {
  18125. c.ctx_ = ctx
  18126. return c
  18127. }
  18128. // Header returns an http.Header that can be modified by the caller to
  18129. // add HTTP headers to the request.
  18130. func (c *OrdersCustombatchCall) Header() http.Header {
  18131. if c.header_ == nil {
  18132. c.header_ = make(http.Header)
  18133. }
  18134. return c.header_
  18135. }
  18136. func (c *OrdersCustombatchCall) doRequest(alt string) (*http.Response, error) {
  18137. reqHeaders := make(http.Header)
  18138. for k, v := range c.header_ {
  18139. reqHeaders[k] = v
  18140. }
  18141. reqHeaders.Set("User-Agent", c.s.userAgent())
  18142. var body io.Reader = nil
  18143. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscustombatchrequest)
  18144. if err != nil {
  18145. return nil, err
  18146. }
  18147. reqHeaders.Set("Content-Type", "application/json")
  18148. c.urlParams_.Set("alt", alt)
  18149. c.urlParams_.Set("prettyPrint", "false")
  18150. urls := googleapi.ResolveRelative(c.s.BasePath, "orders/batch")
  18151. urls += "?" + c.urlParams_.Encode()
  18152. req, err := http.NewRequest("POST", urls, body)
  18153. if err != nil {
  18154. return nil, err
  18155. }
  18156. req.Header = reqHeaders
  18157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18158. }
  18159. // Do executes the "content.orders.custombatch" call.
  18160. // Exactly one of *OrdersCustomBatchResponse or error will be non-nil.
  18161. // Any non-2xx status code is an error. Response headers are in either
  18162. // *OrdersCustomBatchResponse.ServerResponse.Header or (if a response
  18163. // was returned at all) in error.(*googleapi.Error).Header. Use
  18164. // googleapi.IsNotModified to check whether the returned error was
  18165. // because http.StatusNotModified was returned.
  18166. func (c *OrdersCustombatchCall) Do(opts ...googleapi.CallOption) (*OrdersCustomBatchResponse, error) {
  18167. gensupport.SetOptions(c.urlParams_, opts...)
  18168. res, err := c.doRequest("json")
  18169. if res != nil && res.StatusCode == http.StatusNotModified {
  18170. if res.Body != nil {
  18171. res.Body.Close()
  18172. }
  18173. return nil, &googleapi.Error{
  18174. Code: res.StatusCode,
  18175. Header: res.Header,
  18176. }
  18177. }
  18178. if err != nil {
  18179. return nil, err
  18180. }
  18181. defer googleapi.CloseBody(res)
  18182. if err := googleapi.CheckResponse(res); err != nil {
  18183. return nil, err
  18184. }
  18185. ret := &OrdersCustomBatchResponse{
  18186. ServerResponse: googleapi.ServerResponse{
  18187. Header: res.Header,
  18188. HTTPStatusCode: res.StatusCode,
  18189. },
  18190. }
  18191. target := &ret
  18192. if err := gensupport.DecodeResponse(target, res); err != nil {
  18193. return nil, err
  18194. }
  18195. return ret, nil
  18196. // {
  18197. // "description": "Retrieves or modifies multiple orders in a single request.",
  18198. // "httpMethod": "POST",
  18199. // "id": "content.orders.custombatch",
  18200. // "path": "orders/batch",
  18201. // "request": {
  18202. // "$ref": "OrdersCustomBatchRequest"
  18203. // },
  18204. // "response": {
  18205. // "$ref": "OrdersCustomBatchResponse"
  18206. // },
  18207. // "scopes": [
  18208. // "https://www.googleapis.com/auth/content"
  18209. // ]
  18210. // }
  18211. }
  18212. // method id "content.orders.get":
  18213. type OrdersGetCall struct {
  18214. s *APIService
  18215. merchantId uint64
  18216. orderId string
  18217. urlParams_ gensupport.URLParams
  18218. ifNoneMatch_ string
  18219. ctx_ context.Context
  18220. header_ http.Header
  18221. }
  18222. // Get: Retrieves an order from your Merchant Center account.
  18223. func (r *OrdersService) Get(merchantId uint64, orderId string) *OrdersGetCall {
  18224. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18225. c.merchantId = merchantId
  18226. c.orderId = orderId
  18227. return c
  18228. }
  18229. // Fields allows partial responses to be retrieved. See
  18230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18231. // for more information.
  18232. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  18233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18234. return c
  18235. }
  18236. // IfNoneMatch sets the optional parameter which makes the operation
  18237. // fail if the object's ETag matches the given value. This is useful for
  18238. // getting updates only after the object has changed since the last
  18239. // request. Use googleapi.IsNotModified to check whether the response
  18240. // error from Do is the result of In-None-Match.
  18241. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  18242. c.ifNoneMatch_ = entityTag
  18243. return c
  18244. }
  18245. // Context sets the context to be used in this call's Do method. Any
  18246. // pending HTTP request will be aborted if the provided context is
  18247. // canceled.
  18248. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  18249. c.ctx_ = ctx
  18250. return c
  18251. }
  18252. // Header returns an http.Header that can be modified by the caller to
  18253. // add HTTP headers to the request.
  18254. func (c *OrdersGetCall) Header() http.Header {
  18255. if c.header_ == nil {
  18256. c.header_ = make(http.Header)
  18257. }
  18258. return c.header_
  18259. }
  18260. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  18261. reqHeaders := make(http.Header)
  18262. for k, v := range c.header_ {
  18263. reqHeaders[k] = v
  18264. }
  18265. reqHeaders.Set("User-Agent", c.s.userAgent())
  18266. if c.ifNoneMatch_ != "" {
  18267. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18268. }
  18269. var body io.Reader = nil
  18270. c.urlParams_.Set("alt", alt)
  18271. c.urlParams_.Set("prettyPrint", "false")
  18272. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}")
  18273. urls += "?" + c.urlParams_.Encode()
  18274. req, err := http.NewRequest("GET", urls, body)
  18275. if err != nil {
  18276. return nil, err
  18277. }
  18278. req.Header = reqHeaders
  18279. googleapi.Expand(req.URL, map[string]string{
  18280. "merchantId": strconv.FormatUint(c.merchantId, 10),
  18281. "orderId": c.orderId,
  18282. })
  18283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18284. }
  18285. // Do executes the "content.orders.get" call.
  18286. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  18287. // code is an error. Response headers are in either
  18288. // *Order.ServerResponse.Header or (if a response was returned at all)
  18289. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  18290. // check whether the returned error was because http.StatusNotModified
  18291. // was returned.
  18292. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  18293. gensupport.SetOptions(c.urlParams_, opts...)
  18294. res, err := c.doRequest("json")
  18295. if res != nil && res.StatusCode == http.StatusNotModified {
  18296. if res.Body != nil {
  18297. res.Body.Close()
  18298. }
  18299. return nil, &googleapi.Error{
  18300. Code: res.StatusCode,
  18301. Header: res.Header,
  18302. }
  18303. }
  18304. if err != nil {
  18305. return nil, err
  18306. }
  18307. defer googleapi.CloseBody(res)
  18308. if err := googleapi.CheckResponse(res); err != nil {
  18309. return nil, err
  18310. }
  18311. ret := &Order{
  18312. ServerResponse: googleapi.ServerResponse{
  18313. Header: res.Header,
  18314. HTTPStatusCode: res.StatusCode,
  18315. },
  18316. }
  18317. target := &ret
  18318. if err := gensupport.DecodeResponse(target, res); err != nil {
  18319. return nil, err
  18320. }
  18321. return ret, nil
  18322. // {
  18323. // "description": "Retrieves an order from your Merchant Center account.",
  18324. // "httpMethod": "GET",
  18325. // "id": "content.orders.get",
  18326. // "parameterOrder": [
  18327. // "merchantId",
  18328. // "orderId"
  18329. // ],
  18330. // "parameters": {
  18331. // "merchantId": {
  18332. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  18333. // "format": "uint64",
  18334. // "location": "path",
  18335. // "required": true,
  18336. // "type": "string"
  18337. // },
  18338. // "orderId": {
  18339. // "description": "The ID of the order.",
  18340. // "location": "path",
  18341. // "required": true,
  18342. // "type": "string"
  18343. // }
  18344. // },
  18345. // "path": "{merchantId}/orders/{orderId}",
  18346. // "response": {
  18347. // "$ref": "Order"
  18348. // },
  18349. // "scopes": [
  18350. // "https://www.googleapis.com/auth/content"
  18351. // ]
  18352. // }
  18353. }
  18354. // method id "content.orders.getbymerchantorderid":
  18355. type OrdersGetbymerchantorderidCall struct {
  18356. s *APIService
  18357. merchantId uint64
  18358. merchantOrderId string
  18359. urlParams_ gensupport.URLParams
  18360. ifNoneMatch_ string
  18361. ctx_ context.Context
  18362. header_ http.Header
  18363. }
  18364. // Getbymerchantorderid: Retrieves an order using merchant order ID.
  18365. func (r *OrdersService) Getbymerchantorderid(merchantId uint64, merchantOrderId string) *OrdersGetbymerchantorderidCall {
  18366. c := &OrdersGetbymerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18367. c.merchantId = merchantId
  18368. c.merchantOrderId = merchantOrderId
  18369. return c
  18370. }
  18371. // Fields allows partial responses to be retrieved. See
  18372. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18373. // for more information.
  18374. func (c *OrdersGetbymerchantorderidCall) Fields(s ...googleapi.Field) *OrdersGetbymerchantorderidCall {
  18375. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18376. return c
  18377. }
  18378. // IfNoneMatch sets the optional parameter which makes the operation
  18379. // fail if the object's ETag matches the given value. This is useful for
  18380. // getting updates only after the object has changed since the last
  18381. // request. Use googleapi.IsNotModified to check whether the response
  18382. // error from Do is the result of In-None-Match.
  18383. func (c *OrdersGetbymerchantorderidCall) IfNoneMatch(entityTag string) *OrdersGetbymerchantorderidCall {
  18384. c.ifNoneMatch_ = entityTag
  18385. return c
  18386. }
  18387. // Context sets the context to be used in this call's Do method. Any
  18388. // pending HTTP request will be aborted if the provided context is
  18389. // canceled.
  18390. func (c *OrdersGetbymerchantorderidCall) Context(ctx context.Context) *OrdersGetbymerchantorderidCall {
  18391. c.ctx_ = ctx
  18392. return c
  18393. }
  18394. // Header returns an http.Header that can be modified by the caller to
  18395. // add HTTP headers to the request.
  18396. func (c *OrdersGetbymerchantorderidCall) Header() http.Header {
  18397. if c.header_ == nil {
  18398. c.header_ = make(http.Header)
  18399. }
  18400. return c.header_
  18401. }
  18402. func (c *OrdersGetbymerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  18403. reqHeaders := make(http.Header)
  18404. for k, v := range c.header_ {
  18405. reqHeaders[k] = v
  18406. }
  18407. reqHeaders.Set("User-Agent", c.s.userAgent())
  18408. if c.ifNoneMatch_ != "" {
  18409. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18410. }
  18411. var body io.Reader = nil
  18412. c.urlParams_.Set("alt", alt)
  18413. c.urlParams_.Set("prettyPrint", "false")
  18414. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/ordersbymerchantid/{merchantOrderId}")
  18415. urls += "?" + c.urlParams_.Encode()
  18416. req, err := http.NewRequest("GET", urls, body)
  18417. if err != nil {
  18418. return nil, err
  18419. }
  18420. req.Header = reqHeaders
  18421. googleapi.Expand(req.URL, map[string]string{
  18422. "merchantId": strconv.FormatUint(c.merchantId, 10),
  18423. "merchantOrderId": c.merchantOrderId,
  18424. })
  18425. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18426. }
  18427. // Do executes the "content.orders.getbymerchantorderid" call.
  18428. // Exactly one of *OrdersGetByMerchantOrderIdResponse or error will be
  18429. // non-nil. Any non-2xx status code is an error. Response headers are in
  18430. // either *OrdersGetByMerchantOrderIdResponse.ServerResponse.Header or
  18431. // (if a response was returned at all) in
  18432. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18433. // whether the returned error was because http.StatusNotModified was
  18434. // returned.
  18435. func (c *OrdersGetbymerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersGetByMerchantOrderIdResponse, error) {
  18436. gensupport.SetOptions(c.urlParams_, opts...)
  18437. res, err := c.doRequest("json")
  18438. if res != nil && res.StatusCode == http.StatusNotModified {
  18439. if res.Body != nil {
  18440. res.Body.Close()
  18441. }
  18442. return nil, &googleapi.Error{
  18443. Code: res.StatusCode,
  18444. Header: res.Header,
  18445. }
  18446. }
  18447. if err != nil {
  18448. return nil, err
  18449. }
  18450. defer googleapi.CloseBody(res)
  18451. if err := googleapi.CheckResponse(res); err != nil {
  18452. return nil, err
  18453. }
  18454. ret := &OrdersGetByMerchantOrderIdResponse{
  18455. ServerResponse: googleapi.ServerResponse{
  18456. Header: res.Header,
  18457. HTTPStatusCode: res.StatusCode,
  18458. },
  18459. }
  18460. target := &ret
  18461. if err := gensupport.DecodeResponse(target, res); err != nil {
  18462. return nil, err
  18463. }
  18464. return ret, nil
  18465. // {
  18466. // "description": "Retrieves an order using merchant order ID.",
  18467. // "httpMethod": "GET",
  18468. // "id": "content.orders.getbymerchantorderid",
  18469. // "parameterOrder": [
  18470. // "merchantId",
  18471. // "merchantOrderId"
  18472. // ],
  18473. // "parameters": {
  18474. // "merchantId": {
  18475. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  18476. // "format": "uint64",
  18477. // "location": "path",
  18478. // "required": true,
  18479. // "type": "string"
  18480. // },
  18481. // "merchantOrderId": {
  18482. // "description": "The merchant order ID to be looked for.",
  18483. // "location": "path",
  18484. // "required": true,
  18485. // "type": "string"
  18486. // }
  18487. // },
  18488. // "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}",
  18489. // "response": {
  18490. // "$ref": "OrdersGetByMerchantOrderIdResponse"
  18491. // },
  18492. // "scopes": [
  18493. // "https://www.googleapis.com/auth/content"
  18494. // ]
  18495. // }
  18496. }
  18497. // method id "content.orders.gettestordertemplate":
  18498. type OrdersGettestordertemplateCall struct {
  18499. s *APIService
  18500. merchantId uint64
  18501. templateName string
  18502. urlParams_ gensupport.URLParams
  18503. ifNoneMatch_ string
  18504. ctx_ context.Context
  18505. header_ http.Header
  18506. }
  18507. // Gettestordertemplate: Sandbox only. Retrieves an order template that
  18508. // can be used to quickly create a new order in sandbox.
  18509. func (r *OrdersService) Gettestordertemplate(merchantId uint64, templateName string) *OrdersGettestordertemplateCall {
  18510. c := &OrdersGettestordertemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18511. c.merchantId = merchantId
  18512. c.templateName = templateName
  18513. return c
  18514. }
  18515. // Country sets the optional parameter "country": The country of the
  18516. // template to retrieve. Defaults to US.
  18517. func (c *OrdersGettestordertemplateCall) Country(country string) *OrdersGettestordertemplateCall {
  18518. c.urlParams_.Set("country", country)
  18519. return c
  18520. }
  18521. // Fields allows partial responses to be retrieved. See
  18522. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18523. // for more information.
  18524. func (c *OrdersGettestordertemplateCall) Fields(s ...googleapi.Field) *OrdersGettestordertemplateCall {
  18525. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18526. return c
  18527. }
  18528. // IfNoneMatch sets the optional parameter which makes the operation
  18529. // fail if the object's ETag matches the given value. This is useful for
  18530. // getting updates only after the object has changed since the last
  18531. // request. Use googleapi.IsNotModified to check whether the response
  18532. // error from Do is the result of In-None-Match.
  18533. func (c *OrdersGettestordertemplateCall) IfNoneMatch(entityTag string) *OrdersGettestordertemplateCall {
  18534. c.ifNoneMatch_ = entityTag
  18535. return c
  18536. }
  18537. // Context sets the context to be used in this call's Do method. Any
  18538. // pending HTTP request will be aborted if the provided context is
  18539. // canceled.
  18540. func (c *OrdersGettestordertemplateCall) Context(ctx context.Context) *OrdersGettestordertemplateCall {
  18541. c.ctx_ = ctx
  18542. return c
  18543. }
  18544. // Header returns an http.Header that can be modified by the caller to
  18545. // add HTTP headers to the request.
  18546. func (c *OrdersGettestordertemplateCall) Header() http.Header {
  18547. if c.header_ == nil {
  18548. c.header_ = make(http.Header)
  18549. }
  18550. return c.header_
  18551. }
  18552. func (c *OrdersGettestordertemplateCall) doRequest(alt string) (*http.Response, error) {
  18553. reqHeaders := make(http.Header)
  18554. for k, v := range c.header_ {
  18555. reqHeaders[k] = v
  18556. }
  18557. reqHeaders.Set("User-Agent", c.s.userAgent())
  18558. if c.ifNoneMatch_ != "" {
  18559. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18560. }
  18561. var body io.Reader = nil
  18562. c.urlParams_.Set("alt", alt)
  18563. c.urlParams_.Set("prettyPrint", "false")
  18564. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testordertemplates/{templateName}")
  18565. urls += "?" + c.urlParams_.Encode()
  18566. req, err := http.NewRequest("GET", urls, body)
  18567. if err != nil {
  18568. return nil, err
  18569. }
  18570. req.Header = reqHeaders
  18571. googleapi.Expand(req.URL, map[string]string{
  18572. "merchantId": strconv.FormatUint(c.merchantId, 10),
  18573. "templateName": c.templateName,
  18574. })
  18575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18576. }
  18577. // Do executes the "content.orders.gettestordertemplate" call.
  18578. // Exactly one of *OrdersGetTestOrderTemplateResponse or error will be
  18579. // non-nil. Any non-2xx status code is an error. Response headers are in
  18580. // either *OrdersGetTestOrderTemplateResponse.ServerResponse.Header or
  18581. // (if a response was returned at all) in
  18582. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18583. // whether the returned error was because http.StatusNotModified was
  18584. // returned.
  18585. func (c *OrdersGettestordertemplateCall) Do(opts ...googleapi.CallOption) (*OrdersGetTestOrderTemplateResponse, error) {
  18586. gensupport.SetOptions(c.urlParams_, opts...)
  18587. res, err := c.doRequest("json")
  18588. if res != nil && res.StatusCode == http.StatusNotModified {
  18589. if res.Body != nil {
  18590. res.Body.Close()
  18591. }
  18592. return nil, &googleapi.Error{
  18593. Code: res.StatusCode,
  18594. Header: res.Header,
  18595. }
  18596. }
  18597. if err != nil {
  18598. return nil, err
  18599. }
  18600. defer googleapi.CloseBody(res)
  18601. if err := googleapi.CheckResponse(res); err != nil {
  18602. return nil, err
  18603. }
  18604. ret := &OrdersGetTestOrderTemplateResponse{
  18605. ServerResponse: googleapi.ServerResponse{
  18606. Header: res.Header,
  18607. HTTPStatusCode: res.StatusCode,
  18608. },
  18609. }
  18610. target := &ret
  18611. if err := gensupport.DecodeResponse(target, res); err != nil {
  18612. return nil, err
  18613. }
  18614. return ret, nil
  18615. // {
  18616. // "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.",
  18617. // "httpMethod": "GET",
  18618. // "id": "content.orders.gettestordertemplate",
  18619. // "parameterOrder": [
  18620. // "merchantId",
  18621. // "templateName"
  18622. // ],
  18623. // "parameters": {
  18624. // "country": {
  18625. // "description": "The country of the template to retrieve. Defaults to US.",
  18626. // "location": "query",
  18627. // "type": "string"
  18628. // },
  18629. // "merchantId": {
  18630. // "description": "The ID of the account that should manage the order. This cannot be a multi-client account.",
  18631. // "format": "uint64",
  18632. // "location": "path",
  18633. // "required": true,
  18634. // "type": "string"
  18635. // },
  18636. // "templateName": {
  18637. // "description": "The name of the template to retrieve.",
  18638. // "enum": [
  18639. // "template1",
  18640. // "template1a",
  18641. // "template1b",
  18642. // "template2"
  18643. // ],
  18644. // "enumDescriptions": [
  18645. // "",
  18646. // "",
  18647. // "",
  18648. // ""
  18649. // ],
  18650. // "location": "path",
  18651. // "required": true,
  18652. // "type": "string"
  18653. // }
  18654. // },
  18655. // "path": "{merchantId}/testordertemplates/{templateName}",
  18656. // "response": {
  18657. // "$ref": "OrdersGetTestOrderTemplateResponse"
  18658. // },
  18659. // "scopes": [
  18660. // "https://www.googleapis.com/auth/content"
  18661. // ]
  18662. // }
  18663. }
  18664. // method id "content.orders.instorerefundlineitem":
  18665. type OrdersInstorerefundlineitemCall struct {
  18666. s *APIService
  18667. merchantId uint64
  18668. orderId string
  18669. ordersinstorerefundlineitemrequest *OrdersInStoreRefundLineItemRequest
  18670. urlParams_ gensupport.URLParams
  18671. ctx_ context.Context
  18672. header_ http.Header
  18673. }
  18674. // Instorerefundlineitem: Notifies that item return and refund was
  18675. // handled directly by merchant outside of Google payments processing
  18676. // (e.g. cash refund done in store).
  18677. func (r *OrdersService) Instorerefundlineitem(merchantId uint64, orderId string, ordersinstorerefundlineitemrequest *OrdersInStoreRefundLineItemRequest) *OrdersInstorerefundlineitemCall {
  18678. c := &OrdersInstorerefundlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18679. c.merchantId = merchantId
  18680. c.orderId = orderId
  18681. c.ordersinstorerefundlineitemrequest = ordersinstorerefundlineitemrequest
  18682. return c
  18683. }
  18684. // Fields allows partial responses to be retrieved. See
  18685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18686. // for more information.
  18687. func (c *OrdersInstorerefundlineitemCall) Fields(s ...googleapi.Field) *OrdersInstorerefundlineitemCall {
  18688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18689. return c
  18690. }
  18691. // Context sets the context to be used in this call's Do method. Any
  18692. // pending HTTP request will be aborted if the provided context is
  18693. // canceled.
  18694. func (c *OrdersInstorerefundlineitemCall) Context(ctx context.Context) *OrdersInstorerefundlineitemCall {
  18695. c.ctx_ = ctx
  18696. return c
  18697. }
  18698. // Header returns an http.Header that can be modified by the caller to
  18699. // add HTTP headers to the request.
  18700. func (c *OrdersInstorerefundlineitemCall) Header() http.Header {
  18701. if c.header_ == nil {
  18702. c.header_ = make(http.Header)
  18703. }
  18704. return c.header_
  18705. }
  18706. func (c *OrdersInstorerefundlineitemCall) doRequest(alt string) (*http.Response, error) {
  18707. reqHeaders := make(http.Header)
  18708. for k, v := range c.header_ {
  18709. reqHeaders[k] = v
  18710. }
  18711. reqHeaders.Set("User-Agent", c.s.userAgent())
  18712. var body io.Reader = nil
  18713. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersinstorerefundlineitemrequest)
  18714. if err != nil {
  18715. return nil, err
  18716. }
  18717. reqHeaders.Set("Content-Type", "application/json")
  18718. c.urlParams_.Set("alt", alt)
  18719. c.urlParams_.Set("prettyPrint", "false")
  18720. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/inStoreRefundLineItem")
  18721. urls += "?" + c.urlParams_.Encode()
  18722. req, err := http.NewRequest("POST", urls, body)
  18723. if err != nil {
  18724. return nil, err
  18725. }
  18726. req.Header = reqHeaders
  18727. googleapi.Expand(req.URL, map[string]string{
  18728. "merchantId": strconv.FormatUint(c.merchantId, 10),
  18729. "orderId": c.orderId,
  18730. })
  18731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18732. }
  18733. // Do executes the "content.orders.instorerefundlineitem" call.
  18734. // Exactly one of *OrdersInStoreRefundLineItemResponse or error will be
  18735. // non-nil. Any non-2xx status code is an error. Response headers are in
  18736. // either *OrdersInStoreRefundLineItemResponse.ServerResponse.Header or
  18737. // (if a response was returned at all) in
  18738. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  18739. // whether the returned error was because http.StatusNotModified was
  18740. // returned.
  18741. func (c *OrdersInstorerefundlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersInStoreRefundLineItemResponse, error) {
  18742. gensupport.SetOptions(c.urlParams_, opts...)
  18743. res, err := c.doRequest("json")
  18744. if res != nil && res.StatusCode == http.StatusNotModified {
  18745. if res.Body != nil {
  18746. res.Body.Close()
  18747. }
  18748. return nil, &googleapi.Error{
  18749. Code: res.StatusCode,
  18750. Header: res.Header,
  18751. }
  18752. }
  18753. if err != nil {
  18754. return nil, err
  18755. }
  18756. defer googleapi.CloseBody(res)
  18757. if err := googleapi.CheckResponse(res); err != nil {
  18758. return nil, err
  18759. }
  18760. ret := &OrdersInStoreRefundLineItemResponse{
  18761. ServerResponse: googleapi.ServerResponse{
  18762. Header: res.Header,
  18763. HTTPStatusCode: res.StatusCode,
  18764. },
  18765. }
  18766. target := &ret
  18767. if err := gensupport.DecodeResponse(target, res); err != nil {
  18768. return nil, err
  18769. }
  18770. return ret, nil
  18771. // {
  18772. // "description": "Notifies that item return and refund was handled directly by merchant outside of Google payments processing (e.g. cash refund done in store).",
  18773. // "httpMethod": "POST",
  18774. // "id": "content.orders.instorerefundlineitem",
  18775. // "parameterOrder": [
  18776. // "merchantId",
  18777. // "orderId"
  18778. // ],
  18779. // "parameters": {
  18780. // "merchantId": {
  18781. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  18782. // "format": "uint64",
  18783. // "location": "path",
  18784. // "required": true,
  18785. // "type": "string"
  18786. // },
  18787. // "orderId": {
  18788. // "description": "The ID of the order.",
  18789. // "location": "path",
  18790. // "required": true,
  18791. // "type": "string"
  18792. // }
  18793. // },
  18794. // "path": "{merchantId}/orders/{orderId}/inStoreRefundLineItem",
  18795. // "request": {
  18796. // "$ref": "OrdersInStoreRefundLineItemRequest"
  18797. // },
  18798. // "response": {
  18799. // "$ref": "OrdersInStoreRefundLineItemResponse"
  18800. // },
  18801. // "scopes": [
  18802. // "https://www.googleapis.com/auth/content"
  18803. // ]
  18804. // }
  18805. }
  18806. // method id "content.orders.list":
  18807. type OrdersListCall struct {
  18808. s *APIService
  18809. merchantId uint64
  18810. urlParams_ gensupport.URLParams
  18811. ifNoneMatch_ string
  18812. ctx_ context.Context
  18813. header_ http.Header
  18814. }
  18815. // List: Lists the orders in your Merchant Center account.
  18816. func (r *OrdersService) List(merchantId uint64) *OrdersListCall {
  18817. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18818. c.merchantId = merchantId
  18819. return c
  18820. }
  18821. // Acknowledged sets the optional parameter "acknowledged": Obtains
  18822. // orders that match the acknowledgement status. When set to true,
  18823. // obtains orders that have been acknowledged. When false, obtains
  18824. // orders that have not been acknowledged.
  18825. // We recommend using this filter set to false, in conjunction with the
  18826. // acknowledge call, such that only un-acknowledged orders are returned.
  18827. func (c *OrdersListCall) Acknowledged(acknowledged bool) *OrdersListCall {
  18828. c.urlParams_.Set("acknowledged", fmt.Sprint(acknowledged))
  18829. return c
  18830. }
  18831. // MaxResults sets the optional parameter "maxResults": The maximum
  18832. // number of orders to return in the response, used for paging. The
  18833. // default value is 25 orders per page, and the maximum allowed value is
  18834. // 250 orders per page.
  18835. // Known issue: All List calls will return all Orders without limit
  18836. // regardless of the value of this field.
  18837. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  18838. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18839. return c
  18840. }
  18841. // OrderBy sets the optional parameter "orderBy": The ordering of the
  18842. // returned list. The only supported value are placedDate desc and
  18843. // placedDate asc for now, which returns orders sorted by placement
  18844. // date. "placedDate desc" stands for listing orders by placement date,
  18845. // from oldest to most recent. "placedDate asc" stands for listing
  18846. // orders by placement date, from most recent to oldest. In future
  18847. // releases we'll support other sorting criteria.
  18848. //
  18849. // Possible values:
  18850. // "placedDate asc"
  18851. // "placedDate desc"
  18852. func (c *OrdersListCall) OrderBy(orderBy string) *OrdersListCall {
  18853. c.urlParams_.Set("orderBy", orderBy)
  18854. return c
  18855. }
  18856. // PageToken sets the optional parameter "pageToken": The token returned
  18857. // by the previous request.
  18858. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  18859. c.urlParams_.Set("pageToken", pageToken)
  18860. return c
  18861. }
  18862. // PlacedDateEnd sets the optional parameter "placedDateEnd": Obtains
  18863. // orders placed before this date (exclusively), in ISO 8601 format.
  18864. func (c *OrdersListCall) PlacedDateEnd(placedDateEnd string) *OrdersListCall {
  18865. c.urlParams_.Set("placedDateEnd", placedDateEnd)
  18866. return c
  18867. }
  18868. // PlacedDateStart sets the optional parameter "placedDateStart":
  18869. // Obtains orders placed after this date (inclusively), in ISO 8601
  18870. // format.
  18871. func (c *OrdersListCall) PlacedDateStart(placedDateStart string) *OrdersListCall {
  18872. c.urlParams_.Set("placedDateStart", placedDateStart)
  18873. return c
  18874. }
  18875. // Statuses sets the optional parameter "statuses": Obtains orders that
  18876. // match any of the specified statuses. Multiple values can be specified
  18877. // with comma separation. Additionally, please note that active is a
  18878. // shortcut for pendingShipment and partiallyShipped, and completed is a
  18879. // shortcut for shipped , partiallyDelivered, delivered,
  18880. // partiallyReturned, returned, and canceled.
  18881. //
  18882. // Possible values:
  18883. // "active"
  18884. // "canceled"
  18885. // "completed"
  18886. // "delivered"
  18887. // "inProgress"
  18888. // "partiallyDelivered"
  18889. // "partiallyReturned"
  18890. // "partiallyShipped"
  18891. // "pendingShipment"
  18892. // "returned"
  18893. // "shipped"
  18894. func (c *OrdersListCall) Statuses(statuses ...string) *OrdersListCall {
  18895. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  18896. return c
  18897. }
  18898. // Fields allows partial responses to be retrieved. See
  18899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18900. // for more information.
  18901. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  18902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18903. return c
  18904. }
  18905. // IfNoneMatch sets the optional parameter which makes the operation
  18906. // fail if the object's ETag matches the given value. This is useful for
  18907. // getting updates only after the object has changed since the last
  18908. // request. Use googleapi.IsNotModified to check whether the response
  18909. // error from Do is the result of In-None-Match.
  18910. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  18911. c.ifNoneMatch_ = entityTag
  18912. return c
  18913. }
  18914. // Context sets the context to be used in this call's Do method. Any
  18915. // pending HTTP request will be aborted if the provided context is
  18916. // canceled.
  18917. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  18918. c.ctx_ = ctx
  18919. return c
  18920. }
  18921. // Header returns an http.Header that can be modified by the caller to
  18922. // add HTTP headers to the request.
  18923. func (c *OrdersListCall) Header() http.Header {
  18924. if c.header_ == nil {
  18925. c.header_ = make(http.Header)
  18926. }
  18927. return c.header_
  18928. }
  18929. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  18930. reqHeaders := make(http.Header)
  18931. for k, v := range c.header_ {
  18932. reqHeaders[k] = v
  18933. }
  18934. reqHeaders.Set("User-Agent", c.s.userAgent())
  18935. if c.ifNoneMatch_ != "" {
  18936. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18937. }
  18938. var body io.Reader = nil
  18939. c.urlParams_.Set("alt", alt)
  18940. c.urlParams_.Set("prettyPrint", "false")
  18941. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders")
  18942. urls += "?" + c.urlParams_.Encode()
  18943. req, err := http.NewRequest("GET", urls, body)
  18944. if err != nil {
  18945. return nil, err
  18946. }
  18947. req.Header = reqHeaders
  18948. googleapi.Expand(req.URL, map[string]string{
  18949. "merchantId": strconv.FormatUint(c.merchantId, 10),
  18950. })
  18951. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18952. }
  18953. // Do executes the "content.orders.list" call.
  18954. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  18955. // non-2xx status code is an error. Response headers are in either
  18956. // *OrdersListResponse.ServerResponse.Header or (if a response was
  18957. // returned at all) in error.(*googleapi.Error).Header. Use
  18958. // googleapi.IsNotModified to check whether the returned error was
  18959. // because http.StatusNotModified was returned.
  18960. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  18961. gensupport.SetOptions(c.urlParams_, opts...)
  18962. res, err := c.doRequest("json")
  18963. if res != nil && res.StatusCode == http.StatusNotModified {
  18964. if res.Body != nil {
  18965. res.Body.Close()
  18966. }
  18967. return nil, &googleapi.Error{
  18968. Code: res.StatusCode,
  18969. Header: res.Header,
  18970. }
  18971. }
  18972. if err != nil {
  18973. return nil, err
  18974. }
  18975. defer googleapi.CloseBody(res)
  18976. if err := googleapi.CheckResponse(res); err != nil {
  18977. return nil, err
  18978. }
  18979. ret := &OrdersListResponse{
  18980. ServerResponse: googleapi.ServerResponse{
  18981. Header: res.Header,
  18982. HTTPStatusCode: res.StatusCode,
  18983. },
  18984. }
  18985. target := &ret
  18986. if err := gensupport.DecodeResponse(target, res); err != nil {
  18987. return nil, err
  18988. }
  18989. return ret, nil
  18990. // {
  18991. // "description": "Lists the orders in your Merchant Center account.",
  18992. // "httpMethod": "GET",
  18993. // "id": "content.orders.list",
  18994. // "parameterOrder": [
  18995. // "merchantId"
  18996. // ],
  18997. // "parameters": {
  18998. // "acknowledged": {
  18999. // "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.",
  19000. // "location": "query",
  19001. // "type": "boolean"
  19002. // },
  19003. // "maxResults": {
  19004. // "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.",
  19005. // "format": "uint32",
  19006. // "location": "query",
  19007. // "type": "integer"
  19008. // },
  19009. // "merchantId": {
  19010. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  19011. // "format": "uint64",
  19012. // "location": "path",
  19013. // "required": true,
  19014. // "type": "string"
  19015. // },
  19016. // "orderBy": {
  19017. // "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.",
  19018. // "enum": [
  19019. // "placedDate asc",
  19020. // "placedDate desc"
  19021. // ],
  19022. // "enumDescriptions": [
  19023. // "",
  19024. // ""
  19025. // ],
  19026. // "location": "query",
  19027. // "type": "string"
  19028. // },
  19029. // "pageToken": {
  19030. // "description": "The token returned by the previous request.",
  19031. // "location": "query",
  19032. // "type": "string"
  19033. // },
  19034. // "placedDateEnd": {
  19035. // "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.",
  19036. // "location": "query",
  19037. // "type": "string"
  19038. // },
  19039. // "placedDateStart": {
  19040. // "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.",
  19041. // "location": "query",
  19042. // "type": "string"
  19043. // },
  19044. // "statuses": {
  19045. // "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.",
  19046. // "enum": [
  19047. // "active",
  19048. // "canceled",
  19049. // "completed",
  19050. // "delivered",
  19051. // "inProgress",
  19052. // "partiallyDelivered",
  19053. // "partiallyReturned",
  19054. // "partiallyShipped",
  19055. // "pendingShipment",
  19056. // "returned",
  19057. // "shipped"
  19058. // ],
  19059. // "enumDescriptions": [
  19060. // "",
  19061. // "",
  19062. // "",
  19063. // "",
  19064. // "",
  19065. // "",
  19066. // "",
  19067. // "",
  19068. // "",
  19069. // "",
  19070. // ""
  19071. // ],
  19072. // "location": "query",
  19073. // "repeated": true,
  19074. // "type": "string"
  19075. // }
  19076. // },
  19077. // "path": "{merchantId}/orders",
  19078. // "response": {
  19079. // "$ref": "OrdersListResponse"
  19080. // },
  19081. // "scopes": [
  19082. // "https://www.googleapis.com/auth/content"
  19083. // ]
  19084. // }
  19085. }
  19086. // Pages invokes f for each page of results.
  19087. // A non-nil error returned from f will halt the iteration.
  19088. // The provided context supersedes any context provided to the Context method.
  19089. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  19090. c.ctx_ = ctx
  19091. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19092. for {
  19093. x, err := c.Do()
  19094. if err != nil {
  19095. return err
  19096. }
  19097. if err := f(x); err != nil {
  19098. return err
  19099. }
  19100. if x.NextPageToken == "" {
  19101. return nil
  19102. }
  19103. c.PageToken(x.NextPageToken)
  19104. }
  19105. }
  19106. // method id "content.orders.refund":
  19107. type OrdersRefundCall struct {
  19108. s *APIService
  19109. merchantId uint64
  19110. orderId string
  19111. ordersrefundrequest *OrdersRefundRequest
  19112. urlParams_ gensupport.URLParams
  19113. ctx_ context.Context
  19114. header_ http.Header
  19115. }
  19116. // Refund: Deprecated, please use returnRefundLineItem instead.
  19117. func (r *OrdersService) Refund(merchantId uint64, orderId string, ordersrefundrequest *OrdersRefundRequest) *OrdersRefundCall {
  19118. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19119. c.merchantId = merchantId
  19120. c.orderId = orderId
  19121. c.ordersrefundrequest = ordersrefundrequest
  19122. return c
  19123. }
  19124. // Fields allows partial responses to be retrieved. See
  19125. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19126. // for more information.
  19127. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  19128. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19129. return c
  19130. }
  19131. // Context sets the context to be used in this call's Do method. Any
  19132. // pending HTTP request will be aborted if the provided context is
  19133. // canceled.
  19134. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  19135. c.ctx_ = ctx
  19136. return c
  19137. }
  19138. // Header returns an http.Header that can be modified by the caller to
  19139. // add HTTP headers to the request.
  19140. func (c *OrdersRefundCall) Header() http.Header {
  19141. if c.header_ == nil {
  19142. c.header_ = make(http.Header)
  19143. }
  19144. return c.header_
  19145. }
  19146. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  19147. reqHeaders := make(http.Header)
  19148. for k, v := range c.header_ {
  19149. reqHeaders[k] = v
  19150. }
  19151. reqHeaders.Set("User-Agent", c.s.userAgent())
  19152. var body io.Reader = nil
  19153. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrefundrequest)
  19154. if err != nil {
  19155. return nil, err
  19156. }
  19157. reqHeaders.Set("Content-Type", "application/json")
  19158. c.urlParams_.Set("alt", alt)
  19159. c.urlParams_.Set("prettyPrint", "false")
  19160. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/refund")
  19161. urls += "?" + c.urlParams_.Encode()
  19162. req, err := http.NewRequest("POST", urls, body)
  19163. if err != nil {
  19164. return nil, err
  19165. }
  19166. req.Header = reqHeaders
  19167. googleapi.Expand(req.URL, map[string]string{
  19168. "merchantId": strconv.FormatUint(c.merchantId, 10),
  19169. "orderId": c.orderId,
  19170. })
  19171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19172. }
  19173. // Do executes the "content.orders.refund" call.
  19174. // Exactly one of *OrdersRefundResponse or error will be non-nil. Any
  19175. // non-2xx status code is an error. Response headers are in either
  19176. // *OrdersRefundResponse.ServerResponse.Header or (if a response was
  19177. // returned at all) in error.(*googleapi.Error).Header. Use
  19178. // googleapi.IsNotModified to check whether the returned error was
  19179. // because http.StatusNotModified was returned.
  19180. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) (*OrdersRefundResponse, error) {
  19181. gensupport.SetOptions(c.urlParams_, opts...)
  19182. res, err := c.doRequest("json")
  19183. if res != nil && res.StatusCode == http.StatusNotModified {
  19184. if res.Body != nil {
  19185. res.Body.Close()
  19186. }
  19187. return nil, &googleapi.Error{
  19188. Code: res.StatusCode,
  19189. Header: res.Header,
  19190. }
  19191. }
  19192. if err != nil {
  19193. return nil, err
  19194. }
  19195. defer googleapi.CloseBody(res)
  19196. if err := googleapi.CheckResponse(res); err != nil {
  19197. return nil, err
  19198. }
  19199. ret := &OrdersRefundResponse{
  19200. ServerResponse: googleapi.ServerResponse{
  19201. Header: res.Header,
  19202. HTTPStatusCode: res.StatusCode,
  19203. },
  19204. }
  19205. target := &ret
  19206. if err := gensupport.DecodeResponse(target, res); err != nil {
  19207. return nil, err
  19208. }
  19209. return ret, nil
  19210. // {
  19211. // "description": "Deprecated, please use returnRefundLineItem instead.",
  19212. // "httpMethod": "POST",
  19213. // "id": "content.orders.refund",
  19214. // "parameterOrder": [
  19215. // "merchantId",
  19216. // "orderId"
  19217. // ],
  19218. // "parameters": {
  19219. // "merchantId": {
  19220. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  19221. // "format": "uint64",
  19222. // "location": "path",
  19223. // "required": true,
  19224. // "type": "string"
  19225. // },
  19226. // "orderId": {
  19227. // "description": "The ID of the order to refund.",
  19228. // "location": "path",
  19229. // "required": true,
  19230. // "type": "string"
  19231. // }
  19232. // },
  19233. // "path": "{merchantId}/orders/{orderId}/refund",
  19234. // "request": {
  19235. // "$ref": "OrdersRefundRequest"
  19236. // },
  19237. // "response": {
  19238. // "$ref": "OrdersRefundResponse"
  19239. // },
  19240. // "scopes": [
  19241. // "https://www.googleapis.com/auth/content"
  19242. // ]
  19243. // }
  19244. }
  19245. // method id "content.orders.rejectreturnlineitem":
  19246. type OrdersRejectreturnlineitemCall struct {
  19247. s *APIService
  19248. merchantId uint64
  19249. orderId string
  19250. ordersrejectreturnlineitemrequest *OrdersRejectReturnLineItemRequest
  19251. urlParams_ gensupport.URLParams
  19252. ctx_ context.Context
  19253. header_ http.Header
  19254. }
  19255. // Rejectreturnlineitem: Rejects return on an line item.
  19256. func (r *OrdersService) Rejectreturnlineitem(merchantId uint64, orderId string, ordersrejectreturnlineitemrequest *OrdersRejectReturnLineItemRequest) *OrdersRejectreturnlineitemCall {
  19257. c := &OrdersRejectreturnlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19258. c.merchantId = merchantId
  19259. c.orderId = orderId
  19260. c.ordersrejectreturnlineitemrequest = ordersrejectreturnlineitemrequest
  19261. return c
  19262. }
  19263. // Fields allows partial responses to be retrieved. See
  19264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19265. // for more information.
  19266. func (c *OrdersRejectreturnlineitemCall) Fields(s ...googleapi.Field) *OrdersRejectreturnlineitemCall {
  19267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19268. return c
  19269. }
  19270. // Context sets the context to be used in this call's Do method. Any
  19271. // pending HTTP request will be aborted if the provided context is
  19272. // canceled.
  19273. func (c *OrdersRejectreturnlineitemCall) Context(ctx context.Context) *OrdersRejectreturnlineitemCall {
  19274. c.ctx_ = ctx
  19275. return c
  19276. }
  19277. // Header returns an http.Header that can be modified by the caller to
  19278. // add HTTP headers to the request.
  19279. func (c *OrdersRejectreturnlineitemCall) Header() http.Header {
  19280. if c.header_ == nil {
  19281. c.header_ = make(http.Header)
  19282. }
  19283. return c.header_
  19284. }
  19285. func (c *OrdersRejectreturnlineitemCall) doRequest(alt string) (*http.Response, error) {
  19286. reqHeaders := make(http.Header)
  19287. for k, v := range c.header_ {
  19288. reqHeaders[k] = v
  19289. }
  19290. reqHeaders.Set("User-Agent", c.s.userAgent())
  19291. var body io.Reader = nil
  19292. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrejectreturnlineitemrequest)
  19293. if err != nil {
  19294. return nil, err
  19295. }
  19296. reqHeaders.Set("Content-Type", "application/json")
  19297. c.urlParams_.Set("alt", alt)
  19298. c.urlParams_.Set("prettyPrint", "false")
  19299. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/rejectReturnLineItem")
  19300. urls += "?" + c.urlParams_.Encode()
  19301. req, err := http.NewRequest("POST", urls, body)
  19302. if err != nil {
  19303. return nil, err
  19304. }
  19305. req.Header = reqHeaders
  19306. googleapi.Expand(req.URL, map[string]string{
  19307. "merchantId": strconv.FormatUint(c.merchantId, 10),
  19308. "orderId": c.orderId,
  19309. })
  19310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19311. }
  19312. // Do executes the "content.orders.rejectreturnlineitem" call.
  19313. // Exactly one of *OrdersRejectReturnLineItemResponse or error will be
  19314. // non-nil. Any non-2xx status code is an error. Response headers are in
  19315. // either *OrdersRejectReturnLineItemResponse.ServerResponse.Header or
  19316. // (if a response was returned at all) in
  19317. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  19318. // whether the returned error was because http.StatusNotModified was
  19319. // returned.
  19320. func (c *OrdersRejectreturnlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersRejectReturnLineItemResponse, error) {
  19321. gensupport.SetOptions(c.urlParams_, opts...)
  19322. res, err := c.doRequest("json")
  19323. if res != nil && res.StatusCode == http.StatusNotModified {
  19324. if res.Body != nil {
  19325. res.Body.Close()
  19326. }
  19327. return nil, &googleapi.Error{
  19328. Code: res.StatusCode,
  19329. Header: res.Header,
  19330. }
  19331. }
  19332. if err != nil {
  19333. return nil, err
  19334. }
  19335. defer googleapi.CloseBody(res)
  19336. if err := googleapi.CheckResponse(res); err != nil {
  19337. return nil, err
  19338. }
  19339. ret := &OrdersRejectReturnLineItemResponse{
  19340. ServerResponse: googleapi.ServerResponse{
  19341. Header: res.Header,
  19342. HTTPStatusCode: res.StatusCode,
  19343. },
  19344. }
  19345. target := &ret
  19346. if err := gensupport.DecodeResponse(target, res); err != nil {
  19347. return nil, err
  19348. }
  19349. return ret, nil
  19350. // {
  19351. // "description": "Rejects return on an line item.",
  19352. // "httpMethod": "POST",
  19353. // "id": "content.orders.rejectreturnlineitem",
  19354. // "parameterOrder": [
  19355. // "merchantId",
  19356. // "orderId"
  19357. // ],
  19358. // "parameters": {
  19359. // "merchantId": {
  19360. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  19361. // "format": "uint64",
  19362. // "location": "path",
  19363. // "required": true,
  19364. // "type": "string"
  19365. // },
  19366. // "orderId": {
  19367. // "description": "The ID of the order.",
  19368. // "location": "path",
  19369. // "required": true,
  19370. // "type": "string"
  19371. // }
  19372. // },
  19373. // "path": "{merchantId}/orders/{orderId}/rejectReturnLineItem",
  19374. // "request": {
  19375. // "$ref": "OrdersRejectReturnLineItemRequest"
  19376. // },
  19377. // "response": {
  19378. // "$ref": "OrdersRejectReturnLineItemResponse"
  19379. // },
  19380. // "scopes": [
  19381. // "https://www.googleapis.com/auth/content"
  19382. // ]
  19383. // }
  19384. }
  19385. // method id "content.orders.returnlineitem":
  19386. type OrdersReturnlineitemCall struct {
  19387. s *APIService
  19388. merchantId uint64
  19389. orderId string
  19390. ordersreturnlineitemrequest *OrdersReturnLineItemRequest
  19391. urlParams_ gensupport.URLParams
  19392. ctx_ context.Context
  19393. header_ http.Header
  19394. }
  19395. // Returnlineitem: Returns a line item.
  19396. func (r *OrdersService) Returnlineitem(merchantId uint64, orderId string, ordersreturnlineitemrequest *OrdersReturnLineItemRequest) *OrdersReturnlineitemCall {
  19397. c := &OrdersReturnlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19398. c.merchantId = merchantId
  19399. c.orderId = orderId
  19400. c.ordersreturnlineitemrequest = ordersreturnlineitemrequest
  19401. return c
  19402. }
  19403. // Fields allows partial responses to be retrieved. See
  19404. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19405. // for more information.
  19406. func (c *OrdersReturnlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnlineitemCall {
  19407. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19408. return c
  19409. }
  19410. // Context sets the context to be used in this call's Do method. Any
  19411. // pending HTTP request will be aborted if the provided context is
  19412. // canceled.
  19413. func (c *OrdersReturnlineitemCall) Context(ctx context.Context) *OrdersReturnlineitemCall {
  19414. c.ctx_ = ctx
  19415. return c
  19416. }
  19417. // Header returns an http.Header that can be modified by the caller to
  19418. // add HTTP headers to the request.
  19419. func (c *OrdersReturnlineitemCall) Header() http.Header {
  19420. if c.header_ == nil {
  19421. c.header_ = make(http.Header)
  19422. }
  19423. return c.header_
  19424. }
  19425. func (c *OrdersReturnlineitemCall) doRequest(alt string) (*http.Response, error) {
  19426. reqHeaders := make(http.Header)
  19427. for k, v := range c.header_ {
  19428. reqHeaders[k] = v
  19429. }
  19430. reqHeaders.Set("User-Agent", c.s.userAgent())
  19431. var body io.Reader = nil
  19432. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnlineitemrequest)
  19433. if err != nil {
  19434. return nil, err
  19435. }
  19436. reqHeaders.Set("Content-Type", "application/json")
  19437. c.urlParams_.Set("alt", alt)
  19438. c.urlParams_.Set("prettyPrint", "false")
  19439. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnLineItem")
  19440. urls += "?" + c.urlParams_.Encode()
  19441. req, err := http.NewRequest("POST", urls, body)
  19442. if err != nil {
  19443. return nil, err
  19444. }
  19445. req.Header = reqHeaders
  19446. googleapi.Expand(req.URL, map[string]string{
  19447. "merchantId": strconv.FormatUint(c.merchantId, 10),
  19448. "orderId": c.orderId,
  19449. })
  19450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19451. }
  19452. // Do executes the "content.orders.returnlineitem" call.
  19453. // Exactly one of *OrdersReturnLineItemResponse or error will be
  19454. // non-nil. Any non-2xx status code is an error. Response headers are in
  19455. // either *OrdersReturnLineItemResponse.ServerResponse.Header or (if a
  19456. // response was returned at all) in error.(*googleapi.Error).Header. Use
  19457. // googleapi.IsNotModified to check whether the returned error was
  19458. // because http.StatusNotModified was returned.
  19459. func (c *OrdersReturnlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersReturnLineItemResponse, error) {
  19460. gensupport.SetOptions(c.urlParams_, opts...)
  19461. res, err := c.doRequest("json")
  19462. if res != nil && res.StatusCode == http.StatusNotModified {
  19463. if res.Body != nil {
  19464. res.Body.Close()
  19465. }
  19466. return nil, &googleapi.Error{
  19467. Code: res.StatusCode,
  19468. Header: res.Header,
  19469. }
  19470. }
  19471. if err != nil {
  19472. return nil, err
  19473. }
  19474. defer googleapi.CloseBody(res)
  19475. if err := googleapi.CheckResponse(res); err != nil {
  19476. return nil, err
  19477. }
  19478. ret := &OrdersReturnLineItemResponse{
  19479. ServerResponse: googleapi.ServerResponse{
  19480. Header: res.Header,
  19481. HTTPStatusCode: res.StatusCode,
  19482. },
  19483. }
  19484. target := &ret
  19485. if err := gensupport.DecodeResponse(target, res); err != nil {
  19486. return nil, err
  19487. }
  19488. return ret, nil
  19489. // {
  19490. // "description": "Returns a line item.",
  19491. // "httpMethod": "POST",
  19492. // "id": "content.orders.returnlineitem",
  19493. // "parameterOrder": [
  19494. // "merchantId",
  19495. // "orderId"
  19496. // ],
  19497. // "parameters": {
  19498. // "merchantId": {
  19499. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  19500. // "format": "uint64",
  19501. // "location": "path",
  19502. // "required": true,
  19503. // "type": "string"
  19504. // },
  19505. // "orderId": {
  19506. // "description": "The ID of the order.",
  19507. // "location": "path",
  19508. // "required": true,
  19509. // "type": "string"
  19510. // }
  19511. // },
  19512. // "path": "{merchantId}/orders/{orderId}/returnLineItem",
  19513. // "request": {
  19514. // "$ref": "OrdersReturnLineItemRequest"
  19515. // },
  19516. // "response": {
  19517. // "$ref": "OrdersReturnLineItemResponse"
  19518. // },
  19519. // "scopes": [
  19520. // "https://www.googleapis.com/auth/content"
  19521. // ]
  19522. // }
  19523. }
  19524. // method id "content.orders.returnrefundlineitem":
  19525. type OrdersReturnrefundlineitemCall struct {
  19526. s *APIService
  19527. merchantId uint64
  19528. orderId string
  19529. ordersreturnrefundlineitemrequest *OrdersReturnRefundLineItemRequest
  19530. urlParams_ gensupport.URLParams
  19531. ctx_ context.Context
  19532. header_ http.Header
  19533. }
  19534. // Returnrefundlineitem: Returns and refunds a line item. Note that this
  19535. // method can only be called on fully shipped orders.
  19536. func (r *OrdersService) Returnrefundlineitem(merchantId uint64, orderId string, ordersreturnrefundlineitemrequest *OrdersReturnRefundLineItemRequest) *OrdersReturnrefundlineitemCall {
  19537. c := &OrdersReturnrefundlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19538. c.merchantId = merchantId
  19539. c.orderId = orderId
  19540. c.ordersreturnrefundlineitemrequest = ordersreturnrefundlineitemrequest
  19541. return c
  19542. }
  19543. // Fields allows partial responses to be retrieved. See
  19544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19545. // for more information.
  19546. func (c *OrdersReturnrefundlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnrefundlineitemCall {
  19547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19548. return c
  19549. }
  19550. // Context sets the context to be used in this call's Do method. Any
  19551. // pending HTTP request will be aborted if the provided context is
  19552. // canceled.
  19553. func (c *OrdersReturnrefundlineitemCall) Context(ctx context.Context) *OrdersReturnrefundlineitemCall {
  19554. c.ctx_ = ctx
  19555. return c
  19556. }
  19557. // Header returns an http.Header that can be modified by the caller to
  19558. // add HTTP headers to the request.
  19559. func (c *OrdersReturnrefundlineitemCall) Header() http.Header {
  19560. if c.header_ == nil {
  19561. c.header_ = make(http.Header)
  19562. }
  19563. return c.header_
  19564. }
  19565. func (c *OrdersReturnrefundlineitemCall) doRequest(alt string) (*http.Response, error) {
  19566. reqHeaders := make(http.Header)
  19567. for k, v := range c.header_ {
  19568. reqHeaders[k] = v
  19569. }
  19570. reqHeaders.Set("User-Agent", c.s.userAgent())
  19571. var body io.Reader = nil
  19572. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnrefundlineitemrequest)
  19573. if err != nil {
  19574. return nil, err
  19575. }
  19576. reqHeaders.Set("Content-Type", "application/json")
  19577. c.urlParams_.Set("alt", alt)
  19578. c.urlParams_.Set("prettyPrint", "false")
  19579. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnRefundLineItem")
  19580. urls += "?" + c.urlParams_.Encode()
  19581. req, err := http.NewRequest("POST", urls, body)
  19582. if err != nil {
  19583. return nil, err
  19584. }
  19585. req.Header = reqHeaders
  19586. googleapi.Expand(req.URL, map[string]string{
  19587. "merchantId": strconv.FormatUint(c.merchantId, 10),
  19588. "orderId": c.orderId,
  19589. })
  19590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19591. }
  19592. // Do executes the "content.orders.returnrefundlineitem" call.
  19593. // Exactly one of *OrdersReturnRefundLineItemResponse or error will be
  19594. // non-nil. Any non-2xx status code is an error. Response headers are in
  19595. // either *OrdersReturnRefundLineItemResponse.ServerResponse.Header or
  19596. // (if a response was returned at all) in
  19597. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  19598. // whether the returned error was because http.StatusNotModified was
  19599. // returned.
  19600. func (c *OrdersReturnrefundlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersReturnRefundLineItemResponse, error) {
  19601. gensupport.SetOptions(c.urlParams_, opts...)
  19602. res, err := c.doRequest("json")
  19603. if res != nil && res.StatusCode == http.StatusNotModified {
  19604. if res.Body != nil {
  19605. res.Body.Close()
  19606. }
  19607. return nil, &googleapi.Error{
  19608. Code: res.StatusCode,
  19609. Header: res.Header,
  19610. }
  19611. }
  19612. if err != nil {
  19613. return nil, err
  19614. }
  19615. defer googleapi.CloseBody(res)
  19616. if err := googleapi.CheckResponse(res); err != nil {
  19617. return nil, err
  19618. }
  19619. ret := &OrdersReturnRefundLineItemResponse{
  19620. ServerResponse: googleapi.ServerResponse{
  19621. Header: res.Header,
  19622. HTTPStatusCode: res.StatusCode,
  19623. },
  19624. }
  19625. target := &ret
  19626. if err := gensupport.DecodeResponse(target, res); err != nil {
  19627. return nil, err
  19628. }
  19629. return ret, nil
  19630. // {
  19631. // "description": "Returns and refunds a line item. Note that this method can only be called on fully shipped orders.",
  19632. // "httpMethod": "POST",
  19633. // "id": "content.orders.returnrefundlineitem",
  19634. // "parameterOrder": [
  19635. // "merchantId",
  19636. // "orderId"
  19637. // ],
  19638. // "parameters": {
  19639. // "merchantId": {
  19640. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  19641. // "format": "uint64",
  19642. // "location": "path",
  19643. // "required": true,
  19644. // "type": "string"
  19645. // },
  19646. // "orderId": {
  19647. // "description": "The ID of the order.",
  19648. // "location": "path",
  19649. // "required": true,
  19650. // "type": "string"
  19651. // }
  19652. // },
  19653. // "path": "{merchantId}/orders/{orderId}/returnRefundLineItem",
  19654. // "request": {
  19655. // "$ref": "OrdersReturnRefundLineItemRequest"
  19656. // },
  19657. // "response": {
  19658. // "$ref": "OrdersReturnRefundLineItemResponse"
  19659. // },
  19660. // "scopes": [
  19661. // "https://www.googleapis.com/auth/content"
  19662. // ]
  19663. // }
  19664. }
  19665. // method id "content.orders.setlineitemmetadata":
  19666. type OrdersSetlineitemmetadataCall struct {
  19667. s *APIService
  19668. merchantId uint64
  19669. orderId string
  19670. orderssetlineitemmetadatarequest *OrdersSetLineItemMetadataRequest
  19671. urlParams_ gensupport.URLParams
  19672. ctx_ context.Context
  19673. header_ http.Header
  19674. }
  19675. // Setlineitemmetadata: Sets (or overrides if it already exists)
  19676. // merchant provided annotations in the form of key-value pairs. A
  19677. // common use case would be to supply us with additional structured
  19678. // information about a line item that cannot be provided via other
  19679. // methods. Submitted key-value pairs can be retrieved as part of the
  19680. // orders resource.
  19681. func (r *OrdersService) Setlineitemmetadata(merchantId uint64, orderId string, orderssetlineitemmetadatarequest *OrdersSetLineItemMetadataRequest) *OrdersSetlineitemmetadataCall {
  19682. c := &OrdersSetlineitemmetadataCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19683. c.merchantId = merchantId
  19684. c.orderId = orderId
  19685. c.orderssetlineitemmetadatarequest = orderssetlineitemmetadatarequest
  19686. return c
  19687. }
  19688. // Fields allows partial responses to be retrieved. See
  19689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19690. // for more information.
  19691. func (c *OrdersSetlineitemmetadataCall) Fields(s ...googleapi.Field) *OrdersSetlineitemmetadataCall {
  19692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19693. return c
  19694. }
  19695. // Context sets the context to be used in this call's Do method. Any
  19696. // pending HTTP request will be aborted if the provided context is
  19697. // canceled.
  19698. func (c *OrdersSetlineitemmetadataCall) Context(ctx context.Context) *OrdersSetlineitemmetadataCall {
  19699. c.ctx_ = ctx
  19700. return c
  19701. }
  19702. // Header returns an http.Header that can be modified by the caller to
  19703. // add HTTP headers to the request.
  19704. func (c *OrdersSetlineitemmetadataCall) Header() http.Header {
  19705. if c.header_ == nil {
  19706. c.header_ = make(http.Header)
  19707. }
  19708. return c.header_
  19709. }
  19710. func (c *OrdersSetlineitemmetadataCall) doRequest(alt string) (*http.Response, error) {
  19711. reqHeaders := make(http.Header)
  19712. for k, v := range c.header_ {
  19713. reqHeaders[k] = v
  19714. }
  19715. reqHeaders.Set("User-Agent", c.s.userAgent())
  19716. var body io.Reader = nil
  19717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderssetlineitemmetadatarequest)
  19718. if err != nil {
  19719. return nil, err
  19720. }
  19721. reqHeaders.Set("Content-Type", "application/json")
  19722. c.urlParams_.Set("alt", alt)
  19723. c.urlParams_.Set("prettyPrint", "false")
  19724. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/setLineItemMetadata")
  19725. urls += "?" + c.urlParams_.Encode()
  19726. req, err := http.NewRequest("POST", urls, body)
  19727. if err != nil {
  19728. return nil, err
  19729. }
  19730. req.Header = reqHeaders
  19731. googleapi.Expand(req.URL, map[string]string{
  19732. "merchantId": strconv.FormatUint(c.merchantId, 10),
  19733. "orderId": c.orderId,
  19734. })
  19735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19736. }
  19737. // Do executes the "content.orders.setlineitemmetadata" call.
  19738. // Exactly one of *OrdersSetLineItemMetadataResponse or error will be
  19739. // non-nil. Any non-2xx status code is an error. Response headers are in
  19740. // either *OrdersSetLineItemMetadataResponse.ServerResponse.Header or
  19741. // (if a response was returned at all) in
  19742. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  19743. // whether the returned error was because http.StatusNotModified was
  19744. // returned.
  19745. func (c *OrdersSetlineitemmetadataCall) Do(opts ...googleapi.CallOption) (*OrdersSetLineItemMetadataResponse, error) {
  19746. gensupport.SetOptions(c.urlParams_, opts...)
  19747. res, err := c.doRequest("json")
  19748. if res != nil && res.StatusCode == http.StatusNotModified {
  19749. if res.Body != nil {
  19750. res.Body.Close()
  19751. }
  19752. return nil, &googleapi.Error{
  19753. Code: res.StatusCode,
  19754. Header: res.Header,
  19755. }
  19756. }
  19757. if err != nil {
  19758. return nil, err
  19759. }
  19760. defer googleapi.CloseBody(res)
  19761. if err := googleapi.CheckResponse(res); err != nil {
  19762. return nil, err
  19763. }
  19764. ret := &OrdersSetLineItemMetadataResponse{
  19765. ServerResponse: googleapi.ServerResponse{
  19766. Header: res.Header,
  19767. HTTPStatusCode: res.StatusCode,
  19768. },
  19769. }
  19770. target := &ret
  19771. if err := gensupport.DecodeResponse(target, res); err != nil {
  19772. return nil, err
  19773. }
  19774. return ret, nil
  19775. // {
  19776. // "description": "Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided via other methods. Submitted key-value pairs can be retrieved as part of the orders resource.",
  19777. // "httpMethod": "POST",
  19778. // "id": "content.orders.setlineitemmetadata",
  19779. // "parameterOrder": [
  19780. // "merchantId",
  19781. // "orderId"
  19782. // ],
  19783. // "parameters": {
  19784. // "merchantId": {
  19785. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  19786. // "format": "uint64",
  19787. // "location": "path",
  19788. // "required": true,
  19789. // "type": "string"
  19790. // },
  19791. // "orderId": {
  19792. // "description": "The ID of the order.",
  19793. // "location": "path",
  19794. // "required": true,
  19795. // "type": "string"
  19796. // }
  19797. // },
  19798. // "path": "{merchantId}/orders/{orderId}/setLineItemMetadata",
  19799. // "request": {
  19800. // "$ref": "OrdersSetLineItemMetadataRequest"
  19801. // },
  19802. // "response": {
  19803. // "$ref": "OrdersSetLineItemMetadataResponse"
  19804. // },
  19805. // "scopes": [
  19806. // "https://www.googleapis.com/auth/content"
  19807. // ]
  19808. // }
  19809. }
  19810. // method id "content.orders.shiplineitems":
  19811. type OrdersShiplineitemsCall struct {
  19812. s *APIService
  19813. merchantId uint64
  19814. orderId string
  19815. ordersshiplineitemsrequest *OrdersShipLineItemsRequest
  19816. urlParams_ gensupport.URLParams
  19817. ctx_ context.Context
  19818. header_ http.Header
  19819. }
  19820. // Shiplineitems: Marks line item(s) as shipped.
  19821. func (r *OrdersService) Shiplineitems(merchantId uint64, orderId string, ordersshiplineitemsrequest *OrdersShipLineItemsRequest) *OrdersShiplineitemsCall {
  19822. c := &OrdersShiplineitemsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19823. c.merchantId = merchantId
  19824. c.orderId = orderId
  19825. c.ordersshiplineitemsrequest = ordersshiplineitemsrequest
  19826. return c
  19827. }
  19828. // Fields allows partial responses to be retrieved. See
  19829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19830. // for more information.
  19831. func (c *OrdersShiplineitemsCall) Fields(s ...googleapi.Field) *OrdersShiplineitemsCall {
  19832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19833. return c
  19834. }
  19835. // Context sets the context to be used in this call's Do method. Any
  19836. // pending HTTP request will be aborted if the provided context is
  19837. // canceled.
  19838. func (c *OrdersShiplineitemsCall) Context(ctx context.Context) *OrdersShiplineitemsCall {
  19839. c.ctx_ = ctx
  19840. return c
  19841. }
  19842. // Header returns an http.Header that can be modified by the caller to
  19843. // add HTTP headers to the request.
  19844. func (c *OrdersShiplineitemsCall) Header() http.Header {
  19845. if c.header_ == nil {
  19846. c.header_ = make(http.Header)
  19847. }
  19848. return c.header_
  19849. }
  19850. func (c *OrdersShiplineitemsCall) doRequest(alt string) (*http.Response, error) {
  19851. reqHeaders := make(http.Header)
  19852. for k, v := range c.header_ {
  19853. reqHeaders[k] = v
  19854. }
  19855. reqHeaders.Set("User-Agent", c.s.userAgent())
  19856. var body io.Reader = nil
  19857. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersshiplineitemsrequest)
  19858. if err != nil {
  19859. return nil, err
  19860. }
  19861. reqHeaders.Set("Content-Type", "application/json")
  19862. c.urlParams_.Set("alt", alt)
  19863. c.urlParams_.Set("prettyPrint", "false")
  19864. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/shipLineItems")
  19865. urls += "?" + c.urlParams_.Encode()
  19866. req, err := http.NewRequest("POST", urls, body)
  19867. if err != nil {
  19868. return nil, err
  19869. }
  19870. req.Header = reqHeaders
  19871. googleapi.Expand(req.URL, map[string]string{
  19872. "merchantId": strconv.FormatUint(c.merchantId, 10),
  19873. "orderId": c.orderId,
  19874. })
  19875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19876. }
  19877. // Do executes the "content.orders.shiplineitems" call.
  19878. // Exactly one of *OrdersShipLineItemsResponse or error will be non-nil.
  19879. // Any non-2xx status code is an error. Response headers are in either
  19880. // *OrdersShipLineItemsResponse.ServerResponse.Header or (if a response
  19881. // was returned at all) in error.(*googleapi.Error).Header. Use
  19882. // googleapi.IsNotModified to check whether the returned error was
  19883. // because http.StatusNotModified was returned.
  19884. func (c *OrdersShiplineitemsCall) Do(opts ...googleapi.CallOption) (*OrdersShipLineItemsResponse, error) {
  19885. gensupport.SetOptions(c.urlParams_, opts...)
  19886. res, err := c.doRequest("json")
  19887. if res != nil && res.StatusCode == http.StatusNotModified {
  19888. if res.Body != nil {
  19889. res.Body.Close()
  19890. }
  19891. return nil, &googleapi.Error{
  19892. Code: res.StatusCode,
  19893. Header: res.Header,
  19894. }
  19895. }
  19896. if err != nil {
  19897. return nil, err
  19898. }
  19899. defer googleapi.CloseBody(res)
  19900. if err := googleapi.CheckResponse(res); err != nil {
  19901. return nil, err
  19902. }
  19903. ret := &OrdersShipLineItemsResponse{
  19904. ServerResponse: googleapi.ServerResponse{
  19905. Header: res.Header,
  19906. HTTPStatusCode: res.StatusCode,
  19907. },
  19908. }
  19909. target := &ret
  19910. if err := gensupport.DecodeResponse(target, res); err != nil {
  19911. return nil, err
  19912. }
  19913. return ret, nil
  19914. // {
  19915. // "description": "Marks line item(s) as shipped.",
  19916. // "httpMethod": "POST",
  19917. // "id": "content.orders.shiplineitems",
  19918. // "parameterOrder": [
  19919. // "merchantId",
  19920. // "orderId"
  19921. // ],
  19922. // "parameters": {
  19923. // "merchantId": {
  19924. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  19925. // "format": "uint64",
  19926. // "location": "path",
  19927. // "required": true,
  19928. // "type": "string"
  19929. // },
  19930. // "orderId": {
  19931. // "description": "The ID of the order.",
  19932. // "location": "path",
  19933. // "required": true,
  19934. // "type": "string"
  19935. // }
  19936. // },
  19937. // "path": "{merchantId}/orders/{orderId}/shipLineItems",
  19938. // "request": {
  19939. // "$ref": "OrdersShipLineItemsRequest"
  19940. // },
  19941. // "response": {
  19942. // "$ref": "OrdersShipLineItemsResponse"
  19943. // },
  19944. // "scopes": [
  19945. // "https://www.googleapis.com/auth/content"
  19946. // ]
  19947. // }
  19948. }
  19949. // method id "content.orders.updatelineitemshippingdetails":
  19950. type OrdersUpdatelineitemshippingdetailsCall struct {
  19951. s *APIService
  19952. merchantId uint64
  19953. orderId string
  19954. ordersupdatelineitemshippingdetailsrequest *OrdersUpdateLineItemShippingDetailsRequest
  19955. urlParams_ gensupport.URLParams
  19956. ctx_ context.Context
  19957. header_ http.Header
  19958. }
  19959. // Updatelineitemshippingdetails: Updates ship by and delivery by dates
  19960. // for a line item.
  19961. func (r *OrdersService) Updatelineitemshippingdetails(merchantId uint64, orderId string, ordersupdatelineitemshippingdetailsrequest *OrdersUpdateLineItemShippingDetailsRequest) *OrdersUpdatelineitemshippingdetailsCall {
  19962. c := &OrdersUpdatelineitemshippingdetailsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19963. c.merchantId = merchantId
  19964. c.orderId = orderId
  19965. c.ordersupdatelineitemshippingdetailsrequest = ordersupdatelineitemshippingdetailsrequest
  19966. return c
  19967. }
  19968. // Fields allows partial responses to be retrieved. See
  19969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19970. // for more information.
  19971. func (c *OrdersUpdatelineitemshippingdetailsCall) Fields(s ...googleapi.Field) *OrdersUpdatelineitemshippingdetailsCall {
  19972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19973. return c
  19974. }
  19975. // Context sets the context to be used in this call's Do method. Any
  19976. // pending HTTP request will be aborted if the provided context is
  19977. // canceled.
  19978. func (c *OrdersUpdatelineitemshippingdetailsCall) Context(ctx context.Context) *OrdersUpdatelineitemshippingdetailsCall {
  19979. c.ctx_ = ctx
  19980. return c
  19981. }
  19982. // Header returns an http.Header that can be modified by the caller to
  19983. // add HTTP headers to the request.
  19984. func (c *OrdersUpdatelineitemshippingdetailsCall) Header() http.Header {
  19985. if c.header_ == nil {
  19986. c.header_ = make(http.Header)
  19987. }
  19988. return c.header_
  19989. }
  19990. func (c *OrdersUpdatelineitemshippingdetailsCall) doRequest(alt string) (*http.Response, error) {
  19991. reqHeaders := make(http.Header)
  19992. for k, v := range c.header_ {
  19993. reqHeaders[k] = v
  19994. }
  19995. reqHeaders.Set("User-Agent", c.s.userAgent())
  19996. var body io.Reader = nil
  19997. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatelineitemshippingdetailsrequest)
  19998. if err != nil {
  19999. return nil, err
  20000. }
  20001. reqHeaders.Set("Content-Type", "application/json")
  20002. c.urlParams_.Set("alt", alt)
  20003. c.urlParams_.Set("prettyPrint", "false")
  20004. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateLineItemShippingDetails")
  20005. urls += "?" + c.urlParams_.Encode()
  20006. req, err := http.NewRequest("POST", urls, body)
  20007. if err != nil {
  20008. return nil, err
  20009. }
  20010. req.Header = reqHeaders
  20011. googleapi.Expand(req.URL, map[string]string{
  20012. "merchantId": strconv.FormatUint(c.merchantId, 10),
  20013. "orderId": c.orderId,
  20014. })
  20015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20016. }
  20017. // Do executes the "content.orders.updatelineitemshippingdetails" call.
  20018. // Exactly one of *OrdersUpdateLineItemShippingDetailsResponse or error
  20019. // will be non-nil. Any non-2xx status code is an error. Response
  20020. // headers are in either
  20021. // *OrdersUpdateLineItemShippingDetailsResponse.ServerResponse.Header or
  20022. // (if a response was returned at all) in
  20023. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  20024. // whether the returned error was because http.StatusNotModified was
  20025. // returned.
  20026. func (c *OrdersUpdatelineitemshippingdetailsCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateLineItemShippingDetailsResponse, error) {
  20027. gensupport.SetOptions(c.urlParams_, opts...)
  20028. res, err := c.doRequest("json")
  20029. if res != nil && res.StatusCode == http.StatusNotModified {
  20030. if res.Body != nil {
  20031. res.Body.Close()
  20032. }
  20033. return nil, &googleapi.Error{
  20034. Code: res.StatusCode,
  20035. Header: res.Header,
  20036. }
  20037. }
  20038. if err != nil {
  20039. return nil, err
  20040. }
  20041. defer googleapi.CloseBody(res)
  20042. if err := googleapi.CheckResponse(res); err != nil {
  20043. return nil, err
  20044. }
  20045. ret := &OrdersUpdateLineItemShippingDetailsResponse{
  20046. ServerResponse: googleapi.ServerResponse{
  20047. Header: res.Header,
  20048. HTTPStatusCode: res.StatusCode,
  20049. },
  20050. }
  20051. target := &ret
  20052. if err := gensupport.DecodeResponse(target, res); err != nil {
  20053. return nil, err
  20054. }
  20055. return ret, nil
  20056. // {
  20057. // "description": "Updates ship by and delivery by dates for a line item.",
  20058. // "httpMethod": "POST",
  20059. // "id": "content.orders.updatelineitemshippingdetails",
  20060. // "parameterOrder": [
  20061. // "merchantId",
  20062. // "orderId"
  20063. // ],
  20064. // "parameters": {
  20065. // "merchantId": {
  20066. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  20067. // "format": "uint64",
  20068. // "location": "path",
  20069. // "required": true,
  20070. // "type": "string"
  20071. // },
  20072. // "orderId": {
  20073. // "description": "The ID of the order.",
  20074. // "location": "path",
  20075. // "required": true,
  20076. // "type": "string"
  20077. // }
  20078. // },
  20079. // "path": "{merchantId}/orders/{orderId}/updateLineItemShippingDetails",
  20080. // "request": {
  20081. // "$ref": "OrdersUpdateLineItemShippingDetailsRequest"
  20082. // },
  20083. // "response": {
  20084. // "$ref": "OrdersUpdateLineItemShippingDetailsResponse"
  20085. // },
  20086. // "scopes": [
  20087. // "https://www.googleapis.com/auth/content"
  20088. // ]
  20089. // }
  20090. }
  20091. // method id "content.orders.updatemerchantorderid":
  20092. type OrdersUpdatemerchantorderidCall struct {
  20093. s *APIService
  20094. merchantId uint64
  20095. orderId string
  20096. ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest
  20097. urlParams_ gensupport.URLParams
  20098. ctx_ context.Context
  20099. header_ http.Header
  20100. }
  20101. // Updatemerchantorderid: Updates the merchant order ID for a given
  20102. // order.
  20103. func (r *OrdersService) Updatemerchantorderid(merchantId uint64, orderId string, ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest) *OrdersUpdatemerchantorderidCall {
  20104. c := &OrdersUpdatemerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20105. c.merchantId = merchantId
  20106. c.orderId = orderId
  20107. c.ordersupdatemerchantorderidrequest = ordersupdatemerchantorderidrequest
  20108. return c
  20109. }
  20110. // Fields allows partial responses to be retrieved. See
  20111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20112. // for more information.
  20113. func (c *OrdersUpdatemerchantorderidCall) Fields(s ...googleapi.Field) *OrdersUpdatemerchantorderidCall {
  20114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20115. return c
  20116. }
  20117. // Context sets the context to be used in this call's Do method. Any
  20118. // pending HTTP request will be aborted if the provided context is
  20119. // canceled.
  20120. func (c *OrdersUpdatemerchantorderidCall) Context(ctx context.Context) *OrdersUpdatemerchantorderidCall {
  20121. c.ctx_ = ctx
  20122. return c
  20123. }
  20124. // Header returns an http.Header that can be modified by the caller to
  20125. // add HTTP headers to the request.
  20126. func (c *OrdersUpdatemerchantorderidCall) Header() http.Header {
  20127. if c.header_ == nil {
  20128. c.header_ = make(http.Header)
  20129. }
  20130. return c.header_
  20131. }
  20132. func (c *OrdersUpdatemerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  20133. reqHeaders := make(http.Header)
  20134. for k, v := range c.header_ {
  20135. reqHeaders[k] = v
  20136. }
  20137. reqHeaders.Set("User-Agent", c.s.userAgent())
  20138. var body io.Reader = nil
  20139. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatemerchantorderidrequest)
  20140. if err != nil {
  20141. return nil, err
  20142. }
  20143. reqHeaders.Set("Content-Type", "application/json")
  20144. c.urlParams_.Set("alt", alt)
  20145. c.urlParams_.Set("prettyPrint", "false")
  20146. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateMerchantOrderId")
  20147. urls += "?" + c.urlParams_.Encode()
  20148. req, err := http.NewRequest("POST", urls, body)
  20149. if err != nil {
  20150. return nil, err
  20151. }
  20152. req.Header = reqHeaders
  20153. googleapi.Expand(req.URL, map[string]string{
  20154. "merchantId": strconv.FormatUint(c.merchantId, 10),
  20155. "orderId": c.orderId,
  20156. })
  20157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20158. }
  20159. // Do executes the "content.orders.updatemerchantorderid" call.
  20160. // Exactly one of *OrdersUpdateMerchantOrderIdResponse or error will be
  20161. // non-nil. Any non-2xx status code is an error. Response headers are in
  20162. // either *OrdersUpdateMerchantOrderIdResponse.ServerResponse.Header or
  20163. // (if a response was returned at all) in
  20164. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  20165. // whether the returned error was because http.StatusNotModified was
  20166. // returned.
  20167. func (c *OrdersUpdatemerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateMerchantOrderIdResponse, error) {
  20168. gensupport.SetOptions(c.urlParams_, opts...)
  20169. res, err := c.doRequest("json")
  20170. if res != nil && res.StatusCode == http.StatusNotModified {
  20171. if res.Body != nil {
  20172. res.Body.Close()
  20173. }
  20174. return nil, &googleapi.Error{
  20175. Code: res.StatusCode,
  20176. Header: res.Header,
  20177. }
  20178. }
  20179. if err != nil {
  20180. return nil, err
  20181. }
  20182. defer googleapi.CloseBody(res)
  20183. if err := googleapi.CheckResponse(res); err != nil {
  20184. return nil, err
  20185. }
  20186. ret := &OrdersUpdateMerchantOrderIdResponse{
  20187. ServerResponse: googleapi.ServerResponse{
  20188. Header: res.Header,
  20189. HTTPStatusCode: res.StatusCode,
  20190. },
  20191. }
  20192. target := &ret
  20193. if err := gensupport.DecodeResponse(target, res); err != nil {
  20194. return nil, err
  20195. }
  20196. return ret, nil
  20197. // {
  20198. // "description": "Updates the merchant order ID for a given order.",
  20199. // "httpMethod": "POST",
  20200. // "id": "content.orders.updatemerchantorderid",
  20201. // "parameterOrder": [
  20202. // "merchantId",
  20203. // "orderId"
  20204. // ],
  20205. // "parameters": {
  20206. // "merchantId": {
  20207. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  20208. // "format": "uint64",
  20209. // "location": "path",
  20210. // "required": true,
  20211. // "type": "string"
  20212. // },
  20213. // "orderId": {
  20214. // "description": "The ID of the order.",
  20215. // "location": "path",
  20216. // "required": true,
  20217. // "type": "string"
  20218. // }
  20219. // },
  20220. // "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId",
  20221. // "request": {
  20222. // "$ref": "OrdersUpdateMerchantOrderIdRequest"
  20223. // },
  20224. // "response": {
  20225. // "$ref": "OrdersUpdateMerchantOrderIdResponse"
  20226. // },
  20227. // "scopes": [
  20228. // "https://www.googleapis.com/auth/content"
  20229. // ]
  20230. // }
  20231. }
  20232. // method id "content.orders.updateshipment":
  20233. type OrdersUpdateshipmentCall struct {
  20234. s *APIService
  20235. merchantId uint64
  20236. orderId string
  20237. ordersupdateshipmentrequest *OrdersUpdateShipmentRequest
  20238. urlParams_ gensupport.URLParams
  20239. ctx_ context.Context
  20240. header_ http.Header
  20241. }
  20242. // Updateshipment: Updates a shipment's status, carrier, and/or tracking
  20243. // ID.
  20244. func (r *OrdersService) Updateshipment(merchantId uint64, orderId string, ordersupdateshipmentrequest *OrdersUpdateShipmentRequest) *OrdersUpdateshipmentCall {
  20245. c := &OrdersUpdateshipmentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20246. c.merchantId = merchantId
  20247. c.orderId = orderId
  20248. c.ordersupdateshipmentrequest = ordersupdateshipmentrequest
  20249. return c
  20250. }
  20251. // Fields allows partial responses to be retrieved. See
  20252. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20253. // for more information.
  20254. func (c *OrdersUpdateshipmentCall) Fields(s ...googleapi.Field) *OrdersUpdateshipmentCall {
  20255. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20256. return c
  20257. }
  20258. // Context sets the context to be used in this call's Do method. Any
  20259. // pending HTTP request will be aborted if the provided context is
  20260. // canceled.
  20261. func (c *OrdersUpdateshipmentCall) Context(ctx context.Context) *OrdersUpdateshipmentCall {
  20262. c.ctx_ = ctx
  20263. return c
  20264. }
  20265. // Header returns an http.Header that can be modified by the caller to
  20266. // add HTTP headers to the request.
  20267. func (c *OrdersUpdateshipmentCall) Header() http.Header {
  20268. if c.header_ == nil {
  20269. c.header_ = make(http.Header)
  20270. }
  20271. return c.header_
  20272. }
  20273. func (c *OrdersUpdateshipmentCall) doRequest(alt string) (*http.Response, error) {
  20274. reqHeaders := make(http.Header)
  20275. for k, v := range c.header_ {
  20276. reqHeaders[k] = v
  20277. }
  20278. reqHeaders.Set("User-Agent", c.s.userAgent())
  20279. var body io.Reader = nil
  20280. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdateshipmentrequest)
  20281. if err != nil {
  20282. return nil, err
  20283. }
  20284. reqHeaders.Set("Content-Type", "application/json")
  20285. c.urlParams_.Set("alt", alt)
  20286. c.urlParams_.Set("prettyPrint", "false")
  20287. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateShipment")
  20288. urls += "?" + c.urlParams_.Encode()
  20289. req, err := http.NewRequest("POST", urls, body)
  20290. if err != nil {
  20291. return nil, err
  20292. }
  20293. req.Header = reqHeaders
  20294. googleapi.Expand(req.URL, map[string]string{
  20295. "merchantId": strconv.FormatUint(c.merchantId, 10),
  20296. "orderId": c.orderId,
  20297. })
  20298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20299. }
  20300. // Do executes the "content.orders.updateshipment" call.
  20301. // Exactly one of *OrdersUpdateShipmentResponse or error will be
  20302. // non-nil. Any non-2xx status code is an error. Response headers are in
  20303. // either *OrdersUpdateShipmentResponse.ServerResponse.Header or (if a
  20304. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20305. // googleapi.IsNotModified to check whether the returned error was
  20306. // because http.StatusNotModified was returned.
  20307. func (c *OrdersUpdateshipmentCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateShipmentResponse, error) {
  20308. gensupport.SetOptions(c.urlParams_, opts...)
  20309. res, err := c.doRequest("json")
  20310. if res != nil && res.StatusCode == http.StatusNotModified {
  20311. if res.Body != nil {
  20312. res.Body.Close()
  20313. }
  20314. return nil, &googleapi.Error{
  20315. Code: res.StatusCode,
  20316. Header: res.Header,
  20317. }
  20318. }
  20319. if err != nil {
  20320. return nil, err
  20321. }
  20322. defer googleapi.CloseBody(res)
  20323. if err := googleapi.CheckResponse(res); err != nil {
  20324. return nil, err
  20325. }
  20326. ret := &OrdersUpdateShipmentResponse{
  20327. ServerResponse: googleapi.ServerResponse{
  20328. Header: res.Header,
  20329. HTTPStatusCode: res.StatusCode,
  20330. },
  20331. }
  20332. target := &ret
  20333. if err := gensupport.DecodeResponse(target, res); err != nil {
  20334. return nil, err
  20335. }
  20336. return ret, nil
  20337. // {
  20338. // "description": "Updates a shipment's status, carrier, and/or tracking ID.",
  20339. // "httpMethod": "POST",
  20340. // "id": "content.orders.updateshipment",
  20341. // "parameterOrder": [
  20342. // "merchantId",
  20343. // "orderId"
  20344. // ],
  20345. // "parameters": {
  20346. // "merchantId": {
  20347. // "description": "The ID of the account that manages the order. This cannot be a multi-client account.",
  20348. // "format": "uint64",
  20349. // "location": "path",
  20350. // "required": true,
  20351. // "type": "string"
  20352. // },
  20353. // "orderId": {
  20354. // "description": "The ID of the order.",
  20355. // "location": "path",
  20356. // "required": true,
  20357. // "type": "string"
  20358. // }
  20359. // },
  20360. // "path": "{merchantId}/orders/{orderId}/updateShipment",
  20361. // "request": {
  20362. // "$ref": "OrdersUpdateShipmentRequest"
  20363. // },
  20364. // "response": {
  20365. // "$ref": "OrdersUpdateShipmentResponse"
  20366. // },
  20367. // "scopes": [
  20368. // "https://www.googleapis.com/auth/content"
  20369. // ]
  20370. // }
  20371. }
  20372. // method id "content.pos.custombatch":
  20373. type PosCustombatchCall struct {
  20374. s *APIService
  20375. poscustombatchrequest *PosCustomBatchRequest
  20376. urlParams_ gensupport.URLParams
  20377. ctx_ context.Context
  20378. header_ http.Header
  20379. }
  20380. // Custombatch: Batches multiple POS-related calls in a single request.
  20381. func (r *PosService) Custombatch(poscustombatchrequest *PosCustomBatchRequest) *PosCustombatchCall {
  20382. c := &PosCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20383. c.poscustombatchrequest = poscustombatchrequest
  20384. return c
  20385. }
  20386. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  20387. // request like in a live environment. If set to true, dry-run mode
  20388. // checks the validity of the request and returns errors (if any).
  20389. func (c *PosCustombatchCall) DryRun(dryRun bool) *PosCustombatchCall {
  20390. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  20391. return c
  20392. }
  20393. // Fields allows partial responses to be retrieved. See
  20394. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20395. // for more information.
  20396. func (c *PosCustombatchCall) Fields(s ...googleapi.Field) *PosCustombatchCall {
  20397. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20398. return c
  20399. }
  20400. // Context sets the context to be used in this call's Do method. Any
  20401. // pending HTTP request will be aborted if the provided context is
  20402. // canceled.
  20403. func (c *PosCustombatchCall) Context(ctx context.Context) *PosCustombatchCall {
  20404. c.ctx_ = ctx
  20405. return c
  20406. }
  20407. // Header returns an http.Header that can be modified by the caller to
  20408. // add HTTP headers to the request.
  20409. func (c *PosCustombatchCall) Header() http.Header {
  20410. if c.header_ == nil {
  20411. c.header_ = make(http.Header)
  20412. }
  20413. return c.header_
  20414. }
  20415. func (c *PosCustombatchCall) doRequest(alt string) (*http.Response, error) {
  20416. reqHeaders := make(http.Header)
  20417. for k, v := range c.header_ {
  20418. reqHeaders[k] = v
  20419. }
  20420. reqHeaders.Set("User-Agent", c.s.userAgent())
  20421. var body io.Reader = nil
  20422. body, err := googleapi.WithoutDataWrapper.JSONReader(c.poscustombatchrequest)
  20423. if err != nil {
  20424. return nil, err
  20425. }
  20426. reqHeaders.Set("Content-Type", "application/json")
  20427. c.urlParams_.Set("alt", alt)
  20428. c.urlParams_.Set("prettyPrint", "false")
  20429. urls := googleapi.ResolveRelative(c.s.BasePath, "pos/batch")
  20430. urls += "?" + c.urlParams_.Encode()
  20431. req, err := http.NewRequest("POST", urls, body)
  20432. if err != nil {
  20433. return nil, err
  20434. }
  20435. req.Header = reqHeaders
  20436. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20437. }
  20438. // Do executes the "content.pos.custombatch" call.
  20439. // Exactly one of *PosCustomBatchResponse or error will be non-nil. Any
  20440. // non-2xx status code is an error. Response headers are in either
  20441. // *PosCustomBatchResponse.ServerResponse.Header or (if a response was
  20442. // returned at all) in error.(*googleapi.Error).Header. Use
  20443. // googleapi.IsNotModified to check whether the returned error was
  20444. // because http.StatusNotModified was returned.
  20445. func (c *PosCustombatchCall) Do(opts ...googleapi.CallOption) (*PosCustomBatchResponse, error) {
  20446. gensupport.SetOptions(c.urlParams_, opts...)
  20447. res, err := c.doRequest("json")
  20448. if res != nil && res.StatusCode == http.StatusNotModified {
  20449. if res.Body != nil {
  20450. res.Body.Close()
  20451. }
  20452. return nil, &googleapi.Error{
  20453. Code: res.StatusCode,
  20454. Header: res.Header,
  20455. }
  20456. }
  20457. if err != nil {
  20458. return nil, err
  20459. }
  20460. defer googleapi.CloseBody(res)
  20461. if err := googleapi.CheckResponse(res); err != nil {
  20462. return nil, err
  20463. }
  20464. ret := &PosCustomBatchResponse{
  20465. ServerResponse: googleapi.ServerResponse{
  20466. Header: res.Header,
  20467. HTTPStatusCode: res.StatusCode,
  20468. },
  20469. }
  20470. target := &ret
  20471. if err := gensupport.DecodeResponse(target, res); err != nil {
  20472. return nil, err
  20473. }
  20474. return ret, nil
  20475. // {
  20476. // "description": "Batches multiple POS-related calls in a single request.",
  20477. // "httpMethod": "POST",
  20478. // "id": "content.pos.custombatch",
  20479. // "parameters": {
  20480. // "dryRun": {
  20481. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  20482. // "location": "query",
  20483. // "type": "boolean"
  20484. // }
  20485. // },
  20486. // "path": "pos/batch",
  20487. // "request": {
  20488. // "$ref": "PosCustomBatchRequest"
  20489. // },
  20490. // "response": {
  20491. // "$ref": "PosCustomBatchResponse"
  20492. // },
  20493. // "scopes": [
  20494. // "https://www.googleapis.com/auth/content"
  20495. // ]
  20496. // }
  20497. }
  20498. // method id "content.pos.delete":
  20499. type PosDeleteCall struct {
  20500. s *APIService
  20501. merchantId uint64
  20502. targetMerchantId uint64
  20503. storeCode string
  20504. urlParams_ gensupport.URLParams
  20505. ctx_ context.Context
  20506. header_ http.Header
  20507. }
  20508. // Delete: Deletes a store for the given merchant.
  20509. func (r *PosService) Delete(merchantId uint64, targetMerchantId uint64, storeCode string) *PosDeleteCall {
  20510. c := &PosDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20511. c.merchantId = merchantId
  20512. c.targetMerchantId = targetMerchantId
  20513. c.storeCode = storeCode
  20514. return c
  20515. }
  20516. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  20517. // request like in a live environment. If set to true, dry-run mode
  20518. // checks the validity of the request and returns errors (if any).
  20519. func (c *PosDeleteCall) DryRun(dryRun bool) *PosDeleteCall {
  20520. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  20521. return c
  20522. }
  20523. // Fields allows partial responses to be retrieved. See
  20524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20525. // for more information.
  20526. func (c *PosDeleteCall) Fields(s ...googleapi.Field) *PosDeleteCall {
  20527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20528. return c
  20529. }
  20530. // Context sets the context to be used in this call's Do method. Any
  20531. // pending HTTP request will be aborted if the provided context is
  20532. // canceled.
  20533. func (c *PosDeleteCall) Context(ctx context.Context) *PosDeleteCall {
  20534. c.ctx_ = ctx
  20535. return c
  20536. }
  20537. // Header returns an http.Header that can be modified by the caller to
  20538. // add HTTP headers to the request.
  20539. func (c *PosDeleteCall) Header() http.Header {
  20540. if c.header_ == nil {
  20541. c.header_ = make(http.Header)
  20542. }
  20543. return c.header_
  20544. }
  20545. func (c *PosDeleteCall) doRequest(alt string) (*http.Response, error) {
  20546. reqHeaders := make(http.Header)
  20547. for k, v := range c.header_ {
  20548. reqHeaders[k] = v
  20549. }
  20550. reqHeaders.Set("User-Agent", c.s.userAgent())
  20551. var body io.Reader = nil
  20552. c.urlParams_.Set("alt", alt)
  20553. c.urlParams_.Set("prettyPrint", "false")
  20554. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/store/{storeCode}")
  20555. urls += "?" + c.urlParams_.Encode()
  20556. req, err := http.NewRequest("DELETE", urls, body)
  20557. if err != nil {
  20558. return nil, err
  20559. }
  20560. req.Header = reqHeaders
  20561. googleapi.Expand(req.URL, map[string]string{
  20562. "merchantId": strconv.FormatUint(c.merchantId, 10),
  20563. "targetMerchantId": strconv.FormatUint(c.targetMerchantId, 10),
  20564. "storeCode": c.storeCode,
  20565. })
  20566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20567. }
  20568. // Do executes the "content.pos.delete" call.
  20569. func (c *PosDeleteCall) Do(opts ...googleapi.CallOption) error {
  20570. gensupport.SetOptions(c.urlParams_, opts...)
  20571. res, err := c.doRequest("json")
  20572. if err != nil {
  20573. return err
  20574. }
  20575. defer googleapi.CloseBody(res)
  20576. if err := googleapi.CheckResponse(res); err != nil {
  20577. return err
  20578. }
  20579. return nil
  20580. // {
  20581. // "description": "Deletes a store for the given merchant.",
  20582. // "httpMethod": "DELETE",
  20583. // "id": "content.pos.delete",
  20584. // "parameterOrder": [
  20585. // "merchantId",
  20586. // "targetMerchantId",
  20587. // "storeCode"
  20588. // ],
  20589. // "parameters": {
  20590. // "dryRun": {
  20591. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  20592. // "location": "query",
  20593. // "type": "boolean"
  20594. // },
  20595. // "merchantId": {
  20596. // "description": "The ID of the POS or inventory data provider.",
  20597. // "format": "uint64",
  20598. // "location": "path",
  20599. // "required": true,
  20600. // "type": "string"
  20601. // },
  20602. // "storeCode": {
  20603. // "description": "A store code that is unique per merchant.",
  20604. // "location": "path",
  20605. // "required": true,
  20606. // "type": "string"
  20607. // },
  20608. // "targetMerchantId": {
  20609. // "description": "The ID of the target merchant.",
  20610. // "format": "uint64",
  20611. // "location": "path",
  20612. // "required": true,
  20613. // "type": "string"
  20614. // }
  20615. // },
  20616. // "path": "{merchantId}/pos/{targetMerchantId}/store/{storeCode}",
  20617. // "scopes": [
  20618. // "https://www.googleapis.com/auth/content"
  20619. // ]
  20620. // }
  20621. }
  20622. // method id "content.pos.get":
  20623. type PosGetCall struct {
  20624. s *APIService
  20625. merchantId uint64
  20626. targetMerchantId uint64
  20627. storeCode string
  20628. urlParams_ gensupport.URLParams
  20629. ifNoneMatch_ string
  20630. ctx_ context.Context
  20631. header_ http.Header
  20632. }
  20633. // Get: Retrieves information about the given store.
  20634. func (r *PosService) Get(merchantId uint64, targetMerchantId uint64, storeCode string) *PosGetCall {
  20635. c := &PosGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20636. c.merchantId = merchantId
  20637. c.targetMerchantId = targetMerchantId
  20638. c.storeCode = storeCode
  20639. return c
  20640. }
  20641. // Fields allows partial responses to be retrieved. See
  20642. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20643. // for more information.
  20644. func (c *PosGetCall) Fields(s ...googleapi.Field) *PosGetCall {
  20645. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20646. return c
  20647. }
  20648. // IfNoneMatch sets the optional parameter which makes the operation
  20649. // fail if the object's ETag matches the given value. This is useful for
  20650. // getting updates only after the object has changed since the last
  20651. // request. Use googleapi.IsNotModified to check whether the response
  20652. // error from Do is the result of In-None-Match.
  20653. func (c *PosGetCall) IfNoneMatch(entityTag string) *PosGetCall {
  20654. c.ifNoneMatch_ = entityTag
  20655. return c
  20656. }
  20657. // Context sets the context to be used in this call's Do method. Any
  20658. // pending HTTP request will be aborted if the provided context is
  20659. // canceled.
  20660. func (c *PosGetCall) Context(ctx context.Context) *PosGetCall {
  20661. c.ctx_ = ctx
  20662. return c
  20663. }
  20664. // Header returns an http.Header that can be modified by the caller to
  20665. // add HTTP headers to the request.
  20666. func (c *PosGetCall) Header() http.Header {
  20667. if c.header_ == nil {
  20668. c.header_ = make(http.Header)
  20669. }
  20670. return c.header_
  20671. }
  20672. func (c *PosGetCall) doRequest(alt string) (*http.Response, error) {
  20673. reqHeaders := make(http.Header)
  20674. for k, v := range c.header_ {
  20675. reqHeaders[k] = v
  20676. }
  20677. reqHeaders.Set("User-Agent", c.s.userAgent())
  20678. if c.ifNoneMatch_ != "" {
  20679. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20680. }
  20681. var body io.Reader = nil
  20682. c.urlParams_.Set("alt", alt)
  20683. c.urlParams_.Set("prettyPrint", "false")
  20684. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/store/{storeCode}")
  20685. urls += "?" + c.urlParams_.Encode()
  20686. req, err := http.NewRequest("GET", urls, body)
  20687. if err != nil {
  20688. return nil, err
  20689. }
  20690. req.Header = reqHeaders
  20691. googleapi.Expand(req.URL, map[string]string{
  20692. "merchantId": strconv.FormatUint(c.merchantId, 10),
  20693. "targetMerchantId": strconv.FormatUint(c.targetMerchantId, 10),
  20694. "storeCode": c.storeCode,
  20695. })
  20696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20697. }
  20698. // Do executes the "content.pos.get" call.
  20699. // Exactly one of *PosStore or error will be non-nil. Any non-2xx status
  20700. // code is an error. Response headers are in either
  20701. // *PosStore.ServerResponse.Header or (if a response was returned at
  20702. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20703. // to check whether the returned error was because
  20704. // http.StatusNotModified was returned.
  20705. func (c *PosGetCall) Do(opts ...googleapi.CallOption) (*PosStore, error) {
  20706. gensupport.SetOptions(c.urlParams_, opts...)
  20707. res, err := c.doRequest("json")
  20708. if res != nil && res.StatusCode == http.StatusNotModified {
  20709. if res.Body != nil {
  20710. res.Body.Close()
  20711. }
  20712. return nil, &googleapi.Error{
  20713. Code: res.StatusCode,
  20714. Header: res.Header,
  20715. }
  20716. }
  20717. if err != nil {
  20718. return nil, err
  20719. }
  20720. defer googleapi.CloseBody(res)
  20721. if err := googleapi.CheckResponse(res); err != nil {
  20722. return nil, err
  20723. }
  20724. ret := &PosStore{
  20725. ServerResponse: googleapi.ServerResponse{
  20726. Header: res.Header,
  20727. HTTPStatusCode: res.StatusCode,
  20728. },
  20729. }
  20730. target := &ret
  20731. if err := gensupport.DecodeResponse(target, res); err != nil {
  20732. return nil, err
  20733. }
  20734. return ret, nil
  20735. // {
  20736. // "description": "Retrieves information about the given store.",
  20737. // "httpMethod": "GET",
  20738. // "id": "content.pos.get",
  20739. // "parameterOrder": [
  20740. // "merchantId",
  20741. // "targetMerchantId",
  20742. // "storeCode"
  20743. // ],
  20744. // "parameters": {
  20745. // "merchantId": {
  20746. // "description": "The ID of the POS or inventory data provider.",
  20747. // "format": "uint64",
  20748. // "location": "path",
  20749. // "required": true,
  20750. // "type": "string"
  20751. // },
  20752. // "storeCode": {
  20753. // "description": "A store code that is unique per merchant.",
  20754. // "location": "path",
  20755. // "required": true,
  20756. // "type": "string"
  20757. // },
  20758. // "targetMerchantId": {
  20759. // "description": "The ID of the target merchant.",
  20760. // "format": "uint64",
  20761. // "location": "path",
  20762. // "required": true,
  20763. // "type": "string"
  20764. // }
  20765. // },
  20766. // "path": "{merchantId}/pos/{targetMerchantId}/store/{storeCode}",
  20767. // "response": {
  20768. // "$ref": "PosStore"
  20769. // },
  20770. // "scopes": [
  20771. // "https://www.googleapis.com/auth/content"
  20772. // ]
  20773. // }
  20774. }
  20775. // method id "content.pos.insert":
  20776. type PosInsertCall struct {
  20777. s *APIService
  20778. merchantId uint64
  20779. targetMerchantId uint64
  20780. posstore *PosStore
  20781. urlParams_ gensupport.URLParams
  20782. ctx_ context.Context
  20783. header_ http.Header
  20784. }
  20785. // Insert: Creates a store for the given merchant.
  20786. func (r *PosService) Insert(merchantId uint64, targetMerchantId uint64, posstore *PosStore) *PosInsertCall {
  20787. c := &PosInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20788. c.merchantId = merchantId
  20789. c.targetMerchantId = targetMerchantId
  20790. c.posstore = posstore
  20791. return c
  20792. }
  20793. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  20794. // request like in a live environment. If set to true, dry-run mode
  20795. // checks the validity of the request and returns errors (if any).
  20796. func (c *PosInsertCall) DryRun(dryRun bool) *PosInsertCall {
  20797. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  20798. return c
  20799. }
  20800. // Fields allows partial responses to be retrieved. See
  20801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20802. // for more information.
  20803. func (c *PosInsertCall) Fields(s ...googleapi.Field) *PosInsertCall {
  20804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20805. return c
  20806. }
  20807. // Context sets the context to be used in this call's Do method. Any
  20808. // pending HTTP request will be aborted if the provided context is
  20809. // canceled.
  20810. func (c *PosInsertCall) Context(ctx context.Context) *PosInsertCall {
  20811. c.ctx_ = ctx
  20812. return c
  20813. }
  20814. // Header returns an http.Header that can be modified by the caller to
  20815. // add HTTP headers to the request.
  20816. func (c *PosInsertCall) Header() http.Header {
  20817. if c.header_ == nil {
  20818. c.header_ = make(http.Header)
  20819. }
  20820. return c.header_
  20821. }
  20822. func (c *PosInsertCall) doRequest(alt string) (*http.Response, error) {
  20823. reqHeaders := make(http.Header)
  20824. for k, v := range c.header_ {
  20825. reqHeaders[k] = v
  20826. }
  20827. reqHeaders.Set("User-Agent", c.s.userAgent())
  20828. var body io.Reader = nil
  20829. body, err := googleapi.WithoutDataWrapper.JSONReader(c.posstore)
  20830. if err != nil {
  20831. return nil, err
  20832. }
  20833. reqHeaders.Set("Content-Type", "application/json")
  20834. c.urlParams_.Set("alt", alt)
  20835. c.urlParams_.Set("prettyPrint", "false")
  20836. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/store")
  20837. urls += "?" + c.urlParams_.Encode()
  20838. req, err := http.NewRequest("POST", urls, body)
  20839. if err != nil {
  20840. return nil, err
  20841. }
  20842. req.Header = reqHeaders
  20843. googleapi.Expand(req.URL, map[string]string{
  20844. "merchantId": strconv.FormatUint(c.merchantId, 10),
  20845. "targetMerchantId": strconv.FormatUint(c.targetMerchantId, 10),
  20846. })
  20847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20848. }
  20849. // Do executes the "content.pos.insert" call.
  20850. // Exactly one of *PosStore or error will be non-nil. Any non-2xx status
  20851. // code is an error. Response headers are in either
  20852. // *PosStore.ServerResponse.Header or (if a response was returned at
  20853. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  20854. // to check whether the returned error was because
  20855. // http.StatusNotModified was returned.
  20856. func (c *PosInsertCall) Do(opts ...googleapi.CallOption) (*PosStore, error) {
  20857. gensupport.SetOptions(c.urlParams_, opts...)
  20858. res, err := c.doRequest("json")
  20859. if res != nil && res.StatusCode == http.StatusNotModified {
  20860. if res.Body != nil {
  20861. res.Body.Close()
  20862. }
  20863. return nil, &googleapi.Error{
  20864. Code: res.StatusCode,
  20865. Header: res.Header,
  20866. }
  20867. }
  20868. if err != nil {
  20869. return nil, err
  20870. }
  20871. defer googleapi.CloseBody(res)
  20872. if err := googleapi.CheckResponse(res); err != nil {
  20873. return nil, err
  20874. }
  20875. ret := &PosStore{
  20876. ServerResponse: googleapi.ServerResponse{
  20877. Header: res.Header,
  20878. HTTPStatusCode: res.StatusCode,
  20879. },
  20880. }
  20881. target := &ret
  20882. if err := gensupport.DecodeResponse(target, res); err != nil {
  20883. return nil, err
  20884. }
  20885. return ret, nil
  20886. // {
  20887. // "description": "Creates a store for the given merchant.",
  20888. // "httpMethod": "POST",
  20889. // "id": "content.pos.insert",
  20890. // "parameterOrder": [
  20891. // "merchantId",
  20892. // "targetMerchantId"
  20893. // ],
  20894. // "parameters": {
  20895. // "dryRun": {
  20896. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  20897. // "location": "query",
  20898. // "type": "boolean"
  20899. // },
  20900. // "merchantId": {
  20901. // "description": "The ID of the POS or inventory data provider.",
  20902. // "format": "uint64",
  20903. // "location": "path",
  20904. // "required": true,
  20905. // "type": "string"
  20906. // },
  20907. // "targetMerchantId": {
  20908. // "description": "The ID of the target merchant.",
  20909. // "format": "uint64",
  20910. // "location": "path",
  20911. // "required": true,
  20912. // "type": "string"
  20913. // }
  20914. // },
  20915. // "path": "{merchantId}/pos/{targetMerchantId}/store",
  20916. // "request": {
  20917. // "$ref": "PosStore"
  20918. // },
  20919. // "response": {
  20920. // "$ref": "PosStore"
  20921. // },
  20922. // "scopes": [
  20923. // "https://www.googleapis.com/auth/content"
  20924. // ]
  20925. // }
  20926. }
  20927. // method id "content.pos.inventory":
  20928. type PosInventoryCall struct {
  20929. s *APIService
  20930. merchantId uint64
  20931. targetMerchantId uint64
  20932. posinventoryrequest *PosInventoryRequest
  20933. urlParams_ gensupport.URLParams
  20934. ctx_ context.Context
  20935. header_ http.Header
  20936. }
  20937. // Inventory: Submit inventory for the given merchant.
  20938. func (r *PosService) Inventory(merchantId uint64, targetMerchantId uint64, posinventoryrequest *PosInventoryRequest) *PosInventoryCall {
  20939. c := &PosInventoryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20940. c.merchantId = merchantId
  20941. c.targetMerchantId = targetMerchantId
  20942. c.posinventoryrequest = posinventoryrequest
  20943. return c
  20944. }
  20945. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  20946. // request like in a live environment. If set to true, dry-run mode
  20947. // checks the validity of the request and returns errors (if any).
  20948. func (c *PosInventoryCall) DryRun(dryRun bool) *PosInventoryCall {
  20949. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  20950. return c
  20951. }
  20952. // Fields allows partial responses to be retrieved. See
  20953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20954. // for more information.
  20955. func (c *PosInventoryCall) Fields(s ...googleapi.Field) *PosInventoryCall {
  20956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20957. return c
  20958. }
  20959. // Context sets the context to be used in this call's Do method. Any
  20960. // pending HTTP request will be aborted if the provided context is
  20961. // canceled.
  20962. func (c *PosInventoryCall) Context(ctx context.Context) *PosInventoryCall {
  20963. c.ctx_ = ctx
  20964. return c
  20965. }
  20966. // Header returns an http.Header that can be modified by the caller to
  20967. // add HTTP headers to the request.
  20968. func (c *PosInventoryCall) Header() http.Header {
  20969. if c.header_ == nil {
  20970. c.header_ = make(http.Header)
  20971. }
  20972. return c.header_
  20973. }
  20974. func (c *PosInventoryCall) doRequest(alt string) (*http.Response, error) {
  20975. reqHeaders := make(http.Header)
  20976. for k, v := range c.header_ {
  20977. reqHeaders[k] = v
  20978. }
  20979. reqHeaders.Set("User-Agent", c.s.userAgent())
  20980. var body io.Reader = nil
  20981. body, err := googleapi.WithoutDataWrapper.JSONReader(c.posinventoryrequest)
  20982. if err != nil {
  20983. return nil, err
  20984. }
  20985. reqHeaders.Set("Content-Type", "application/json")
  20986. c.urlParams_.Set("alt", alt)
  20987. c.urlParams_.Set("prettyPrint", "false")
  20988. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/inventory")
  20989. urls += "?" + c.urlParams_.Encode()
  20990. req, err := http.NewRequest("POST", urls, body)
  20991. if err != nil {
  20992. return nil, err
  20993. }
  20994. req.Header = reqHeaders
  20995. googleapi.Expand(req.URL, map[string]string{
  20996. "merchantId": strconv.FormatUint(c.merchantId, 10),
  20997. "targetMerchantId": strconv.FormatUint(c.targetMerchantId, 10),
  20998. })
  20999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21000. }
  21001. // Do executes the "content.pos.inventory" call.
  21002. // Exactly one of *PosInventoryResponse or error will be non-nil. Any
  21003. // non-2xx status code is an error. Response headers are in either
  21004. // *PosInventoryResponse.ServerResponse.Header or (if a response was
  21005. // returned at all) in error.(*googleapi.Error).Header. Use
  21006. // googleapi.IsNotModified to check whether the returned error was
  21007. // because http.StatusNotModified was returned.
  21008. func (c *PosInventoryCall) Do(opts ...googleapi.CallOption) (*PosInventoryResponse, error) {
  21009. gensupport.SetOptions(c.urlParams_, opts...)
  21010. res, err := c.doRequest("json")
  21011. if res != nil && res.StatusCode == http.StatusNotModified {
  21012. if res.Body != nil {
  21013. res.Body.Close()
  21014. }
  21015. return nil, &googleapi.Error{
  21016. Code: res.StatusCode,
  21017. Header: res.Header,
  21018. }
  21019. }
  21020. if err != nil {
  21021. return nil, err
  21022. }
  21023. defer googleapi.CloseBody(res)
  21024. if err := googleapi.CheckResponse(res); err != nil {
  21025. return nil, err
  21026. }
  21027. ret := &PosInventoryResponse{
  21028. ServerResponse: googleapi.ServerResponse{
  21029. Header: res.Header,
  21030. HTTPStatusCode: res.StatusCode,
  21031. },
  21032. }
  21033. target := &ret
  21034. if err := gensupport.DecodeResponse(target, res); err != nil {
  21035. return nil, err
  21036. }
  21037. return ret, nil
  21038. // {
  21039. // "description": "Submit inventory for the given merchant.",
  21040. // "httpMethod": "POST",
  21041. // "id": "content.pos.inventory",
  21042. // "parameterOrder": [
  21043. // "merchantId",
  21044. // "targetMerchantId"
  21045. // ],
  21046. // "parameters": {
  21047. // "dryRun": {
  21048. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  21049. // "location": "query",
  21050. // "type": "boolean"
  21051. // },
  21052. // "merchantId": {
  21053. // "description": "The ID of the POS or inventory data provider.",
  21054. // "format": "uint64",
  21055. // "location": "path",
  21056. // "required": true,
  21057. // "type": "string"
  21058. // },
  21059. // "targetMerchantId": {
  21060. // "description": "The ID of the target merchant.",
  21061. // "format": "uint64",
  21062. // "location": "path",
  21063. // "required": true,
  21064. // "type": "string"
  21065. // }
  21066. // },
  21067. // "path": "{merchantId}/pos/{targetMerchantId}/inventory",
  21068. // "request": {
  21069. // "$ref": "PosInventoryRequest"
  21070. // },
  21071. // "response": {
  21072. // "$ref": "PosInventoryResponse"
  21073. // },
  21074. // "scopes": [
  21075. // "https://www.googleapis.com/auth/content"
  21076. // ]
  21077. // }
  21078. }
  21079. // method id "content.pos.list":
  21080. type PosListCall struct {
  21081. s *APIService
  21082. merchantId uint64
  21083. targetMerchantId uint64
  21084. urlParams_ gensupport.URLParams
  21085. ifNoneMatch_ string
  21086. ctx_ context.Context
  21087. header_ http.Header
  21088. }
  21089. // List: Lists the stores of the target merchant.
  21090. func (r *PosService) List(merchantId uint64, targetMerchantId uint64) *PosListCall {
  21091. c := &PosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21092. c.merchantId = merchantId
  21093. c.targetMerchantId = targetMerchantId
  21094. return c
  21095. }
  21096. // Fields allows partial responses to be retrieved. See
  21097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21098. // for more information.
  21099. func (c *PosListCall) Fields(s ...googleapi.Field) *PosListCall {
  21100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21101. return c
  21102. }
  21103. // IfNoneMatch sets the optional parameter which makes the operation
  21104. // fail if the object's ETag matches the given value. This is useful for
  21105. // getting updates only after the object has changed since the last
  21106. // request. Use googleapi.IsNotModified to check whether the response
  21107. // error from Do is the result of In-None-Match.
  21108. func (c *PosListCall) IfNoneMatch(entityTag string) *PosListCall {
  21109. c.ifNoneMatch_ = entityTag
  21110. return c
  21111. }
  21112. // Context sets the context to be used in this call's Do method. Any
  21113. // pending HTTP request will be aborted if the provided context is
  21114. // canceled.
  21115. func (c *PosListCall) Context(ctx context.Context) *PosListCall {
  21116. c.ctx_ = ctx
  21117. return c
  21118. }
  21119. // Header returns an http.Header that can be modified by the caller to
  21120. // add HTTP headers to the request.
  21121. func (c *PosListCall) Header() http.Header {
  21122. if c.header_ == nil {
  21123. c.header_ = make(http.Header)
  21124. }
  21125. return c.header_
  21126. }
  21127. func (c *PosListCall) doRequest(alt string) (*http.Response, error) {
  21128. reqHeaders := make(http.Header)
  21129. for k, v := range c.header_ {
  21130. reqHeaders[k] = v
  21131. }
  21132. reqHeaders.Set("User-Agent", c.s.userAgent())
  21133. if c.ifNoneMatch_ != "" {
  21134. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21135. }
  21136. var body io.Reader = nil
  21137. c.urlParams_.Set("alt", alt)
  21138. c.urlParams_.Set("prettyPrint", "false")
  21139. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/store")
  21140. urls += "?" + c.urlParams_.Encode()
  21141. req, err := http.NewRequest("GET", urls, body)
  21142. if err != nil {
  21143. return nil, err
  21144. }
  21145. req.Header = reqHeaders
  21146. googleapi.Expand(req.URL, map[string]string{
  21147. "merchantId": strconv.FormatUint(c.merchantId, 10),
  21148. "targetMerchantId": strconv.FormatUint(c.targetMerchantId, 10),
  21149. })
  21150. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21151. }
  21152. // Do executes the "content.pos.list" call.
  21153. // Exactly one of *PosListResponse or error will be non-nil. Any non-2xx
  21154. // status code is an error. Response headers are in either
  21155. // *PosListResponse.ServerResponse.Header or (if a response was returned
  21156. // at all) in error.(*googleapi.Error).Header. Use
  21157. // googleapi.IsNotModified to check whether the returned error was
  21158. // because http.StatusNotModified was returned.
  21159. func (c *PosListCall) Do(opts ...googleapi.CallOption) (*PosListResponse, error) {
  21160. gensupport.SetOptions(c.urlParams_, opts...)
  21161. res, err := c.doRequest("json")
  21162. if res != nil && res.StatusCode == http.StatusNotModified {
  21163. if res.Body != nil {
  21164. res.Body.Close()
  21165. }
  21166. return nil, &googleapi.Error{
  21167. Code: res.StatusCode,
  21168. Header: res.Header,
  21169. }
  21170. }
  21171. if err != nil {
  21172. return nil, err
  21173. }
  21174. defer googleapi.CloseBody(res)
  21175. if err := googleapi.CheckResponse(res); err != nil {
  21176. return nil, err
  21177. }
  21178. ret := &PosListResponse{
  21179. ServerResponse: googleapi.ServerResponse{
  21180. Header: res.Header,
  21181. HTTPStatusCode: res.StatusCode,
  21182. },
  21183. }
  21184. target := &ret
  21185. if err := gensupport.DecodeResponse(target, res); err != nil {
  21186. return nil, err
  21187. }
  21188. return ret, nil
  21189. // {
  21190. // "description": "Lists the stores of the target merchant.",
  21191. // "httpMethod": "GET",
  21192. // "id": "content.pos.list",
  21193. // "parameterOrder": [
  21194. // "merchantId",
  21195. // "targetMerchantId"
  21196. // ],
  21197. // "parameters": {
  21198. // "merchantId": {
  21199. // "description": "The ID of the POS or inventory data provider.",
  21200. // "format": "uint64",
  21201. // "location": "path",
  21202. // "required": true,
  21203. // "type": "string"
  21204. // },
  21205. // "targetMerchantId": {
  21206. // "description": "The ID of the target merchant.",
  21207. // "format": "uint64",
  21208. // "location": "path",
  21209. // "required": true,
  21210. // "type": "string"
  21211. // }
  21212. // },
  21213. // "path": "{merchantId}/pos/{targetMerchantId}/store",
  21214. // "response": {
  21215. // "$ref": "PosListResponse"
  21216. // },
  21217. // "scopes": [
  21218. // "https://www.googleapis.com/auth/content"
  21219. // ]
  21220. // }
  21221. }
  21222. // method id "content.pos.sale":
  21223. type PosSaleCall struct {
  21224. s *APIService
  21225. merchantId uint64
  21226. targetMerchantId uint64
  21227. possalerequest *PosSaleRequest
  21228. urlParams_ gensupport.URLParams
  21229. ctx_ context.Context
  21230. header_ http.Header
  21231. }
  21232. // Sale: Submit a sale event for the given merchant.
  21233. func (r *PosService) Sale(merchantId uint64, targetMerchantId uint64, possalerequest *PosSaleRequest) *PosSaleCall {
  21234. c := &PosSaleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21235. c.merchantId = merchantId
  21236. c.targetMerchantId = targetMerchantId
  21237. c.possalerequest = possalerequest
  21238. return c
  21239. }
  21240. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  21241. // request like in a live environment. If set to true, dry-run mode
  21242. // checks the validity of the request and returns errors (if any).
  21243. func (c *PosSaleCall) DryRun(dryRun bool) *PosSaleCall {
  21244. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  21245. return c
  21246. }
  21247. // Fields allows partial responses to be retrieved. See
  21248. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21249. // for more information.
  21250. func (c *PosSaleCall) Fields(s ...googleapi.Field) *PosSaleCall {
  21251. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21252. return c
  21253. }
  21254. // Context sets the context to be used in this call's Do method. Any
  21255. // pending HTTP request will be aborted if the provided context is
  21256. // canceled.
  21257. func (c *PosSaleCall) Context(ctx context.Context) *PosSaleCall {
  21258. c.ctx_ = ctx
  21259. return c
  21260. }
  21261. // Header returns an http.Header that can be modified by the caller to
  21262. // add HTTP headers to the request.
  21263. func (c *PosSaleCall) Header() http.Header {
  21264. if c.header_ == nil {
  21265. c.header_ = make(http.Header)
  21266. }
  21267. return c.header_
  21268. }
  21269. func (c *PosSaleCall) doRequest(alt string) (*http.Response, error) {
  21270. reqHeaders := make(http.Header)
  21271. for k, v := range c.header_ {
  21272. reqHeaders[k] = v
  21273. }
  21274. reqHeaders.Set("User-Agent", c.s.userAgent())
  21275. var body io.Reader = nil
  21276. body, err := googleapi.WithoutDataWrapper.JSONReader(c.possalerequest)
  21277. if err != nil {
  21278. return nil, err
  21279. }
  21280. reqHeaders.Set("Content-Type", "application/json")
  21281. c.urlParams_.Set("alt", alt)
  21282. c.urlParams_.Set("prettyPrint", "false")
  21283. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/pos/{targetMerchantId}/sale")
  21284. urls += "?" + c.urlParams_.Encode()
  21285. req, err := http.NewRequest("POST", urls, body)
  21286. if err != nil {
  21287. return nil, err
  21288. }
  21289. req.Header = reqHeaders
  21290. googleapi.Expand(req.URL, map[string]string{
  21291. "merchantId": strconv.FormatUint(c.merchantId, 10),
  21292. "targetMerchantId": strconv.FormatUint(c.targetMerchantId, 10),
  21293. })
  21294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21295. }
  21296. // Do executes the "content.pos.sale" call.
  21297. // Exactly one of *PosSaleResponse or error will be non-nil. Any non-2xx
  21298. // status code is an error. Response headers are in either
  21299. // *PosSaleResponse.ServerResponse.Header or (if a response was returned
  21300. // at all) in error.(*googleapi.Error).Header. Use
  21301. // googleapi.IsNotModified to check whether the returned error was
  21302. // because http.StatusNotModified was returned.
  21303. func (c *PosSaleCall) Do(opts ...googleapi.CallOption) (*PosSaleResponse, error) {
  21304. gensupport.SetOptions(c.urlParams_, opts...)
  21305. res, err := c.doRequest("json")
  21306. if res != nil && res.StatusCode == http.StatusNotModified {
  21307. if res.Body != nil {
  21308. res.Body.Close()
  21309. }
  21310. return nil, &googleapi.Error{
  21311. Code: res.StatusCode,
  21312. Header: res.Header,
  21313. }
  21314. }
  21315. if err != nil {
  21316. return nil, err
  21317. }
  21318. defer googleapi.CloseBody(res)
  21319. if err := googleapi.CheckResponse(res); err != nil {
  21320. return nil, err
  21321. }
  21322. ret := &PosSaleResponse{
  21323. ServerResponse: googleapi.ServerResponse{
  21324. Header: res.Header,
  21325. HTTPStatusCode: res.StatusCode,
  21326. },
  21327. }
  21328. target := &ret
  21329. if err := gensupport.DecodeResponse(target, res); err != nil {
  21330. return nil, err
  21331. }
  21332. return ret, nil
  21333. // {
  21334. // "description": "Submit a sale event for the given merchant.",
  21335. // "httpMethod": "POST",
  21336. // "id": "content.pos.sale",
  21337. // "parameterOrder": [
  21338. // "merchantId",
  21339. // "targetMerchantId"
  21340. // ],
  21341. // "parameters": {
  21342. // "dryRun": {
  21343. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  21344. // "location": "query",
  21345. // "type": "boolean"
  21346. // },
  21347. // "merchantId": {
  21348. // "description": "The ID of the POS or inventory data provider.",
  21349. // "format": "uint64",
  21350. // "location": "path",
  21351. // "required": true,
  21352. // "type": "string"
  21353. // },
  21354. // "targetMerchantId": {
  21355. // "description": "The ID of the target merchant.",
  21356. // "format": "uint64",
  21357. // "location": "path",
  21358. // "required": true,
  21359. // "type": "string"
  21360. // }
  21361. // },
  21362. // "path": "{merchantId}/pos/{targetMerchantId}/sale",
  21363. // "request": {
  21364. // "$ref": "PosSaleRequest"
  21365. // },
  21366. // "response": {
  21367. // "$ref": "PosSaleResponse"
  21368. // },
  21369. // "scopes": [
  21370. // "https://www.googleapis.com/auth/content"
  21371. // ]
  21372. // }
  21373. }
  21374. // method id "content.products.custombatch":
  21375. type ProductsCustombatchCall struct {
  21376. s *APIService
  21377. productscustombatchrequest *ProductsCustomBatchRequest
  21378. urlParams_ gensupport.URLParams
  21379. ctx_ context.Context
  21380. header_ http.Header
  21381. }
  21382. // Custombatch: Retrieves, inserts, and deletes multiple products in a
  21383. // single request.
  21384. func (r *ProductsService) Custombatch(productscustombatchrequest *ProductsCustomBatchRequest) *ProductsCustombatchCall {
  21385. c := &ProductsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21386. c.productscustombatchrequest = productscustombatchrequest
  21387. return c
  21388. }
  21389. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  21390. // request like in a live environment. If set to true, dry-run mode
  21391. // checks the validity of the request and returns errors (if any).
  21392. func (c *ProductsCustombatchCall) DryRun(dryRun bool) *ProductsCustombatchCall {
  21393. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  21394. return c
  21395. }
  21396. // Fields allows partial responses to be retrieved. See
  21397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21398. // for more information.
  21399. func (c *ProductsCustombatchCall) Fields(s ...googleapi.Field) *ProductsCustombatchCall {
  21400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21401. return c
  21402. }
  21403. // Context sets the context to be used in this call's Do method. Any
  21404. // pending HTTP request will be aborted if the provided context is
  21405. // canceled.
  21406. func (c *ProductsCustombatchCall) Context(ctx context.Context) *ProductsCustombatchCall {
  21407. c.ctx_ = ctx
  21408. return c
  21409. }
  21410. // Header returns an http.Header that can be modified by the caller to
  21411. // add HTTP headers to the request.
  21412. func (c *ProductsCustombatchCall) Header() http.Header {
  21413. if c.header_ == nil {
  21414. c.header_ = make(http.Header)
  21415. }
  21416. return c.header_
  21417. }
  21418. func (c *ProductsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  21419. reqHeaders := make(http.Header)
  21420. for k, v := range c.header_ {
  21421. reqHeaders[k] = v
  21422. }
  21423. reqHeaders.Set("User-Agent", c.s.userAgent())
  21424. var body io.Reader = nil
  21425. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productscustombatchrequest)
  21426. if err != nil {
  21427. return nil, err
  21428. }
  21429. reqHeaders.Set("Content-Type", "application/json")
  21430. c.urlParams_.Set("alt", alt)
  21431. c.urlParams_.Set("prettyPrint", "false")
  21432. urls := googleapi.ResolveRelative(c.s.BasePath, "products/batch")
  21433. urls += "?" + c.urlParams_.Encode()
  21434. req, err := http.NewRequest("POST", urls, body)
  21435. if err != nil {
  21436. return nil, err
  21437. }
  21438. req.Header = reqHeaders
  21439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21440. }
  21441. // Do executes the "content.products.custombatch" call.
  21442. // Exactly one of *ProductsCustomBatchResponse or error will be non-nil.
  21443. // Any non-2xx status code is an error. Response headers are in either
  21444. // *ProductsCustomBatchResponse.ServerResponse.Header or (if a response
  21445. // was returned at all) in error.(*googleapi.Error).Header. Use
  21446. // googleapi.IsNotModified to check whether the returned error was
  21447. // because http.StatusNotModified was returned.
  21448. func (c *ProductsCustombatchCall) Do(opts ...googleapi.CallOption) (*ProductsCustomBatchResponse, error) {
  21449. gensupport.SetOptions(c.urlParams_, opts...)
  21450. res, err := c.doRequest("json")
  21451. if res != nil && res.StatusCode == http.StatusNotModified {
  21452. if res.Body != nil {
  21453. res.Body.Close()
  21454. }
  21455. return nil, &googleapi.Error{
  21456. Code: res.StatusCode,
  21457. Header: res.Header,
  21458. }
  21459. }
  21460. if err != nil {
  21461. return nil, err
  21462. }
  21463. defer googleapi.CloseBody(res)
  21464. if err := googleapi.CheckResponse(res); err != nil {
  21465. return nil, err
  21466. }
  21467. ret := &ProductsCustomBatchResponse{
  21468. ServerResponse: googleapi.ServerResponse{
  21469. Header: res.Header,
  21470. HTTPStatusCode: res.StatusCode,
  21471. },
  21472. }
  21473. target := &ret
  21474. if err := gensupport.DecodeResponse(target, res); err != nil {
  21475. return nil, err
  21476. }
  21477. return ret, nil
  21478. // {
  21479. // "description": "Retrieves, inserts, and deletes multiple products in a single request.",
  21480. // "httpMethod": "POST",
  21481. // "id": "content.products.custombatch",
  21482. // "parameters": {
  21483. // "dryRun": {
  21484. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  21485. // "location": "query",
  21486. // "type": "boolean"
  21487. // }
  21488. // },
  21489. // "path": "products/batch",
  21490. // "request": {
  21491. // "$ref": "ProductsCustomBatchRequest"
  21492. // },
  21493. // "response": {
  21494. // "$ref": "ProductsCustomBatchResponse"
  21495. // },
  21496. // "scopes": [
  21497. // "https://www.googleapis.com/auth/content"
  21498. // ]
  21499. // }
  21500. }
  21501. // method id "content.products.delete":
  21502. type ProductsDeleteCall struct {
  21503. s *APIService
  21504. merchantId uint64
  21505. productId string
  21506. urlParams_ gensupport.URLParams
  21507. ctx_ context.Context
  21508. header_ http.Header
  21509. }
  21510. // Delete: Deletes a product from your Merchant Center account.
  21511. func (r *ProductsService) Delete(merchantId uint64, productId string) *ProductsDeleteCall {
  21512. c := &ProductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21513. c.merchantId = merchantId
  21514. c.productId = productId
  21515. return c
  21516. }
  21517. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  21518. // request like in a live environment. If set to true, dry-run mode
  21519. // checks the validity of the request and returns errors (if any).
  21520. func (c *ProductsDeleteCall) DryRun(dryRun bool) *ProductsDeleteCall {
  21521. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  21522. return c
  21523. }
  21524. // Fields allows partial responses to be retrieved. See
  21525. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21526. // for more information.
  21527. func (c *ProductsDeleteCall) Fields(s ...googleapi.Field) *ProductsDeleteCall {
  21528. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21529. return c
  21530. }
  21531. // Context sets the context to be used in this call's Do method. Any
  21532. // pending HTTP request will be aborted if the provided context is
  21533. // canceled.
  21534. func (c *ProductsDeleteCall) Context(ctx context.Context) *ProductsDeleteCall {
  21535. c.ctx_ = ctx
  21536. return c
  21537. }
  21538. // Header returns an http.Header that can be modified by the caller to
  21539. // add HTTP headers to the request.
  21540. func (c *ProductsDeleteCall) Header() http.Header {
  21541. if c.header_ == nil {
  21542. c.header_ = make(http.Header)
  21543. }
  21544. return c.header_
  21545. }
  21546. func (c *ProductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  21547. reqHeaders := make(http.Header)
  21548. for k, v := range c.header_ {
  21549. reqHeaders[k] = v
  21550. }
  21551. reqHeaders.Set("User-Agent", c.s.userAgent())
  21552. var body io.Reader = nil
  21553. c.urlParams_.Set("alt", alt)
  21554. c.urlParams_.Set("prettyPrint", "false")
  21555. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}")
  21556. urls += "?" + c.urlParams_.Encode()
  21557. req, err := http.NewRequest("DELETE", urls, body)
  21558. if err != nil {
  21559. return nil, err
  21560. }
  21561. req.Header = reqHeaders
  21562. googleapi.Expand(req.URL, map[string]string{
  21563. "merchantId": strconv.FormatUint(c.merchantId, 10),
  21564. "productId": c.productId,
  21565. })
  21566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21567. }
  21568. // Do executes the "content.products.delete" call.
  21569. func (c *ProductsDeleteCall) Do(opts ...googleapi.CallOption) error {
  21570. gensupport.SetOptions(c.urlParams_, opts...)
  21571. res, err := c.doRequest("json")
  21572. if err != nil {
  21573. return err
  21574. }
  21575. defer googleapi.CloseBody(res)
  21576. if err := googleapi.CheckResponse(res); err != nil {
  21577. return err
  21578. }
  21579. return nil
  21580. // {
  21581. // "description": "Deletes a product from your Merchant Center account.",
  21582. // "httpMethod": "DELETE",
  21583. // "id": "content.products.delete",
  21584. // "parameterOrder": [
  21585. // "merchantId",
  21586. // "productId"
  21587. // ],
  21588. // "parameters": {
  21589. // "dryRun": {
  21590. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  21591. // "location": "query",
  21592. // "type": "boolean"
  21593. // },
  21594. // "merchantId": {
  21595. // "description": "The ID of the account that contains the product. This account cannot be a multi-client account.",
  21596. // "format": "uint64",
  21597. // "location": "path",
  21598. // "required": true,
  21599. // "type": "string"
  21600. // },
  21601. // "productId": {
  21602. // "description": "The REST ID of the product.",
  21603. // "location": "path",
  21604. // "required": true,
  21605. // "type": "string"
  21606. // }
  21607. // },
  21608. // "path": "{merchantId}/products/{productId}",
  21609. // "scopes": [
  21610. // "https://www.googleapis.com/auth/content"
  21611. // ]
  21612. // }
  21613. }
  21614. // method id "content.products.get":
  21615. type ProductsGetCall struct {
  21616. s *APIService
  21617. merchantId uint64
  21618. productId string
  21619. urlParams_ gensupport.URLParams
  21620. ifNoneMatch_ string
  21621. ctx_ context.Context
  21622. header_ http.Header
  21623. }
  21624. // Get: Retrieves a product from your Merchant Center account.
  21625. func (r *ProductsService) Get(merchantId uint64, productId string) *ProductsGetCall {
  21626. c := &ProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21627. c.merchantId = merchantId
  21628. c.productId = productId
  21629. return c
  21630. }
  21631. // Fields allows partial responses to be retrieved. See
  21632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21633. // for more information.
  21634. func (c *ProductsGetCall) Fields(s ...googleapi.Field) *ProductsGetCall {
  21635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21636. return c
  21637. }
  21638. // IfNoneMatch sets the optional parameter which makes the operation
  21639. // fail if the object's ETag matches the given value. This is useful for
  21640. // getting updates only after the object has changed since the last
  21641. // request. Use googleapi.IsNotModified to check whether the response
  21642. // error from Do is the result of In-None-Match.
  21643. func (c *ProductsGetCall) IfNoneMatch(entityTag string) *ProductsGetCall {
  21644. c.ifNoneMatch_ = entityTag
  21645. return c
  21646. }
  21647. // Context sets the context to be used in this call's Do method. Any
  21648. // pending HTTP request will be aborted if the provided context is
  21649. // canceled.
  21650. func (c *ProductsGetCall) Context(ctx context.Context) *ProductsGetCall {
  21651. c.ctx_ = ctx
  21652. return c
  21653. }
  21654. // Header returns an http.Header that can be modified by the caller to
  21655. // add HTTP headers to the request.
  21656. func (c *ProductsGetCall) Header() http.Header {
  21657. if c.header_ == nil {
  21658. c.header_ = make(http.Header)
  21659. }
  21660. return c.header_
  21661. }
  21662. func (c *ProductsGetCall) doRequest(alt string) (*http.Response, error) {
  21663. reqHeaders := make(http.Header)
  21664. for k, v := range c.header_ {
  21665. reqHeaders[k] = v
  21666. }
  21667. reqHeaders.Set("User-Agent", c.s.userAgent())
  21668. if c.ifNoneMatch_ != "" {
  21669. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21670. }
  21671. var body io.Reader = nil
  21672. c.urlParams_.Set("alt", alt)
  21673. c.urlParams_.Set("prettyPrint", "false")
  21674. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products/{productId}")
  21675. urls += "?" + c.urlParams_.Encode()
  21676. req, err := http.NewRequest("GET", urls, body)
  21677. if err != nil {
  21678. return nil, err
  21679. }
  21680. req.Header = reqHeaders
  21681. googleapi.Expand(req.URL, map[string]string{
  21682. "merchantId": strconv.FormatUint(c.merchantId, 10),
  21683. "productId": c.productId,
  21684. })
  21685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21686. }
  21687. // Do executes the "content.products.get" call.
  21688. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  21689. // code is an error. Response headers are in either
  21690. // *Product.ServerResponse.Header or (if a response was returned at all)
  21691. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21692. // check whether the returned error was because http.StatusNotModified
  21693. // was returned.
  21694. func (c *ProductsGetCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  21695. gensupport.SetOptions(c.urlParams_, opts...)
  21696. res, err := c.doRequest("json")
  21697. if res != nil && res.StatusCode == http.StatusNotModified {
  21698. if res.Body != nil {
  21699. res.Body.Close()
  21700. }
  21701. return nil, &googleapi.Error{
  21702. Code: res.StatusCode,
  21703. Header: res.Header,
  21704. }
  21705. }
  21706. if err != nil {
  21707. return nil, err
  21708. }
  21709. defer googleapi.CloseBody(res)
  21710. if err := googleapi.CheckResponse(res); err != nil {
  21711. return nil, err
  21712. }
  21713. ret := &Product{
  21714. ServerResponse: googleapi.ServerResponse{
  21715. Header: res.Header,
  21716. HTTPStatusCode: res.StatusCode,
  21717. },
  21718. }
  21719. target := &ret
  21720. if err := gensupport.DecodeResponse(target, res); err != nil {
  21721. return nil, err
  21722. }
  21723. return ret, nil
  21724. // {
  21725. // "description": "Retrieves a product from your Merchant Center account.",
  21726. // "httpMethod": "GET",
  21727. // "id": "content.products.get",
  21728. // "parameterOrder": [
  21729. // "merchantId",
  21730. // "productId"
  21731. // ],
  21732. // "parameters": {
  21733. // "merchantId": {
  21734. // "description": "The ID of the account that contains the product. This account cannot be a multi-client account.",
  21735. // "format": "uint64",
  21736. // "location": "path",
  21737. // "required": true,
  21738. // "type": "string"
  21739. // },
  21740. // "productId": {
  21741. // "description": "The REST ID of the product.",
  21742. // "location": "path",
  21743. // "required": true,
  21744. // "type": "string"
  21745. // }
  21746. // },
  21747. // "path": "{merchantId}/products/{productId}",
  21748. // "response": {
  21749. // "$ref": "Product"
  21750. // },
  21751. // "scopes": [
  21752. // "https://www.googleapis.com/auth/content"
  21753. // ]
  21754. // }
  21755. }
  21756. // method id "content.products.insert":
  21757. type ProductsInsertCall struct {
  21758. s *APIService
  21759. merchantId uint64
  21760. product *Product
  21761. urlParams_ gensupport.URLParams
  21762. ctx_ context.Context
  21763. header_ http.Header
  21764. }
  21765. // Insert: Uploads a product to your Merchant Center account. If an item
  21766. // with the same channel, contentLanguage, offerId, and targetCountry
  21767. // already exists, this method updates that entry.
  21768. func (r *ProductsService) Insert(merchantId uint64, product *Product) *ProductsInsertCall {
  21769. c := &ProductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21770. c.merchantId = merchantId
  21771. c.product = product
  21772. return c
  21773. }
  21774. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  21775. // request like in a live environment. If set to true, dry-run mode
  21776. // checks the validity of the request and returns errors (if any).
  21777. func (c *ProductsInsertCall) DryRun(dryRun bool) *ProductsInsertCall {
  21778. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  21779. return c
  21780. }
  21781. // Fields allows partial responses to be retrieved. See
  21782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21783. // for more information.
  21784. func (c *ProductsInsertCall) Fields(s ...googleapi.Field) *ProductsInsertCall {
  21785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21786. return c
  21787. }
  21788. // Context sets the context to be used in this call's Do method. Any
  21789. // pending HTTP request will be aborted if the provided context is
  21790. // canceled.
  21791. func (c *ProductsInsertCall) Context(ctx context.Context) *ProductsInsertCall {
  21792. c.ctx_ = ctx
  21793. return c
  21794. }
  21795. // Header returns an http.Header that can be modified by the caller to
  21796. // add HTTP headers to the request.
  21797. func (c *ProductsInsertCall) Header() http.Header {
  21798. if c.header_ == nil {
  21799. c.header_ = make(http.Header)
  21800. }
  21801. return c.header_
  21802. }
  21803. func (c *ProductsInsertCall) doRequest(alt string) (*http.Response, error) {
  21804. reqHeaders := make(http.Header)
  21805. for k, v := range c.header_ {
  21806. reqHeaders[k] = v
  21807. }
  21808. reqHeaders.Set("User-Agent", c.s.userAgent())
  21809. var body io.Reader = nil
  21810. body, err := googleapi.WithoutDataWrapper.JSONReader(c.product)
  21811. if err != nil {
  21812. return nil, err
  21813. }
  21814. reqHeaders.Set("Content-Type", "application/json")
  21815. c.urlParams_.Set("alt", alt)
  21816. c.urlParams_.Set("prettyPrint", "false")
  21817. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products")
  21818. urls += "?" + c.urlParams_.Encode()
  21819. req, err := http.NewRequest("POST", urls, body)
  21820. if err != nil {
  21821. return nil, err
  21822. }
  21823. req.Header = reqHeaders
  21824. googleapi.Expand(req.URL, map[string]string{
  21825. "merchantId": strconv.FormatUint(c.merchantId, 10),
  21826. })
  21827. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21828. }
  21829. // Do executes the "content.products.insert" call.
  21830. // Exactly one of *Product or error will be non-nil. Any non-2xx status
  21831. // code is an error. Response headers are in either
  21832. // *Product.ServerResponse.Header or (if a response was returned at all)
  21833. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21834. // check whether the returned error was because http.StatusNotModified
  21835. // was returned.
  21836. func (c *ProductsInsertCall) Do(opts ...googleapi.CallOption) (*Product, error) {
  21837. gensupport.SetOptions(c.urlParams_, opts...)
  21838. res, err := c.doRequest("json")
  21839. if res != nil && res.StatusCode == http.StatusNotModified {
  21840. if res.Body != nil {
  21841. res.Body.Close()
  21842. }
  21843. return nil, &googleapi.Error{
  21844. Code: res.StatusCode,
  21845. Header: res.Header,
  21846. }
  21847. }
  21848. if err != nil {
  21849. return nil, err
  21850. }
  21851. defer googleapi.CloseBody(res)
  21852. if err := googleapi.CheckResponse(res); err != nil {
  21853. return nil, err
  21854. }
  21855. ret := &Product{
  21856. ServerResponse: googleapi.ServerResponse{
  21857. Header: res.Header,
  21858. HTTPStatusCode: res.StatusCode,
  21859. },
  21860. }
  21861. target := &ret
  21862. if err := gensupport.DecodeResponse(target, res); err != nil {
  21863. return nil, err
  21864. }
  21865. return ret, nil
  21866. // {
  21867. // "description": "Uploads a product to your Merchant Center account. If an item with the same channel, contentLanguage, offerId, and targetCountry already exists, this method updates that entry.",
  21868. // "httpMethod": "POST",
  21869. // "id": "content.products.insert",
  21870. // "parameterOrder": [
  21871. // "merchantId"
  21872. // ],
  21873. // "parameters": {
  21874. // "dryRun": {
  21875. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  21876. // "location": "query",
  21877. // "type": "boolean"
  21878. // },
  21879. // "merchantId": {
  21880. // "description": "The ID of the account that contains the product. This account cannot be a multi-client account.",
  21881. // "format": "uint64",
  21882. // "location": "path",
  21883. // "required": true,
  21884. // "type": "string"
  21885. // }
  21886. // },
  21887. // "path": "{merchantId}/products",
  21888. // "request": {
  21889. // "$ref": "Product"
  21890. // },
  21891. // "response": {
  21892. // "$ref": "Product"
  21893. // },
  21894. // "scopes": [
  21895. // "https://www.googleapis.com/auth/content"
  21896. // ]
  21897. // }
  21898. }
  21899. // method id "content.products.list":
  21900. type ProductsListCall struct {
  21901. s *APIService
  21902. merchantId uint64
  21903. urlParams_ gensupport.URLParams
  21904. ifNoneMatch_ string
  21905. ctx_ context.Context
  21906. header_ http.Header
  21907. }
  21908. // List: Lists the products in your Merchant Center account.
  21909. func (r *ProductsService) List(merchantId uint64) *ProductsListCall {
  21910. c := &ProductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21911. c.merchantId = merchantId
  21912. return c
  21913. }
  21914. // IncludeInvalidInsertedItems sets the optional parameter
  21915. // "includeInvalidInsertedItems": Flag to include the invalid inserted
  21916. // items in the result of the list request. By default the invalid items
  21917. // are not shown (the default value is false).
  21918. func (c *ProductsListCall) IncludeInvalidInsertedItems(includeInvalidInsertedItems bool) *ProductsListCall {
  21919. c.urlParams_.Set("includeInvalidInsertedItems", fmt.Sprint(includeInvalidInsertedItems))
  21920. return c
  21921. }
  21922. // MaxResults sets the optional parameter "maxResults": The maximum
  21923. // number of products to return in the response, used for paging.
  21924. func (c *ProductsListCall) MaxResults(maxResults int64) *ProductsListCall {
  21925. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21926. return c
  21927. }
  21928. // PageToken sets the optional parameter "pageToken": The token returned
  21929. // by the previous request.
  21930. func (c *ProductsListCall) PageToken(pageToken string) *ProductsListCall {
  21931. c.urlParams_.Set("pageToken", pageToken)
  21932. return c
  21933. }
  21934. // Fields allows partial responses to be retrieved. See
  21935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21936. // for more information.
  21937. func (c *ProductsListCall) Fields(s ...googleapi.Field) *ProductsListCall {
  21938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21939. return c
  21940. }
  21941. // IfNoneMatch sets the optional parameter which makes the operation
  21942. // fail if the object's ETag matches the given value. This is useful for
  21943. // getting updates only after the object has changed since the last
  21944. // request. Use googleapi.IsNotModified to check whether the response
  21945. // error from Do is the result of In-None-Match.
  21946. func (c *ProductsListCall) IfNoneMatch(entityTag string) *ProductsListCall {
  21947. c.ifNoneMatch_ = entityTag
  21948. return c
  21949. }
  21950. // Context sets the context to be used in this call's Do method. Any
  21951. // pending HTTP request will be aborted if the provided context is
  21952. // canceled.
  21953. func (c *ProductsListCall) Context(ctx context.Context) *ProductsListCall {
  21954. c.ctx_ = ctx
  21955. return c
  21956. }
  21957. // Header returns an http.Header that can be modified by the caller to
  21958. // add HTTP headers to the request.
  21959. func (c *ProductsListCall) Header() http.Header {
  21960. if c.header_ == nil {
  21961. c.header_ = make(http.Header)
  21962. }
  21963. return c.header_
  21964. }
  21965. func (c *ProductsListCall) doRequest(alt string) (*http.Response, error) {
  21966. reqHeaders := make(http.Header)
  21967. for k, v := range c.header_ {
  21968. reqHeaders[k] = v
  21969. }
  21970. reqHeaders.Set("User-Agent", c.s.userAgent())
  21971. if c.ifNoneMatch_ != "" {
  21972. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21973. }
  21974. var body io.Reader = nil
  21975. c.urlParams_.Set("alt", alt)
  21976. c.urlParams_.Set("prettyPrint", "false")
  21977. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/products")
  21978. urls += "?" + c.urlParams_.Encode()
  21979. req, err := http.NewRequest("GET", urls, body)
  21980. if err != nil {
  21981. return nil, err
  21982. }
  21983. req.Header = reqHeaders
  21984. googleapi.Expand(req.URL, map[string]string{
  21985. "merchantId": strconv.FormatUint(c.merchantId, 10),
  21986. })
  21987. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21988. }
  21989. // Do executes the "content.products.list" call.
  21990. // Exactly one of *ProductsListResponse or error will be non-nil. Any
  21991. // non-2xx status code is an error. Response headers are in either
  21992. // *ProductsListResponse.ServerResponse.Header or (if a response was
  21993. // returned at all) in error.(*googleapi.Error).Header. Use
  21994. // googleapi.IsNotModified to check whether the returned error was
  21995. // because http.StatusNotModified was returned.
  21996. func (c *ProductsListCall) Do(opts ...googleapi.CallOption) (*ProductsListResponse, error) {
  21997. gensupport.SetOptions(c.urlParams_, opts...)
  21998. res, err := c.doRequest("json")
  21999. if res != nil && res.StatusCode == http.StatusNotModified {
  22000. if res.Body != nil {
  22001. res.Body.Close()
  22002. }
  22003. return nil, &googleapi.Error{
  22004. Code: res.StatusCode,
  22005. Header: res.Header,
  22006. }
  22007. }
  22008. if err != nil {
  22009. return nil, err
  22010. }
  22011. defer googleapi.CloseBody(res)
  22012. if err := googleapi.CheckResponse(res); err != nil {
  22013. return nil, err
  22014. }
  22015. ret := &ProductsListResponse{
  22016. ServerResponse: googleapi.ServerResponse{
  22017. Header: res.Header,
  22018. HTTPStatusCode: res.StatusCode,
  22019. },
  22020. }
  22021. target := &ret
  22022. if err := gensupport.DecodeResponse(target, res); err != nil {
  22023. return nil, err
  22024. }
  22025. return ret, nil
  22026. // {
  22027. // "description": "Lists the products in your Merchant Center account.",
  22028. // "httpMethod": "GET",
  22029. // "id": "content.products.list",
  22030. // "parameterOrder": [
  22031. // "merchantId"
  22032. // ],
  22033. // "parameters": {
  22034. // "includeInvalidInsertedItems": {
  22035. // "description": "Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false).",
  22036. // "location": "query",
  22037. // "type": "boolean"
  22038. // },
  22039. // "maxResults": {
  22040. // "description": "The maximum number of products to return in the response, used for paging.",
  22041. // "format": "uint32",
  22042. // "location": "query",
  22043. // "type": "integer"
  22044. // },
  22045. // "merchantId": {
  22046. // "description": "The ID of the account that contains the products. This account cannot be a multi-client account.",
  22047. // "format": "uint64",
  22048. // "location": "path",
  22049. // "required": true,
  22050. // "type": "string"
  22051. // },
  22052. // "pageToken": {
  22053. // "description": "The token returned by the previous request.",
  22054. // "location": "query",
  22055. // "type": "string"
  22056. // }
  22057. // },
  22058. // "path": "{merchantId}/products",
  22059. // "response": {
  22060. // "$ref": "ProductsListResponse"
  22061. // },
  22062. // "scopes": [
  22063. // "https://www.googleapis.com/auth/content"
  22064. // ]
  22065. // }
  22066. }
  22067. // Pages invokes f for each page of results.
  22068. // A non-nil error returned from f will halt the iteration.
  22069. // The provided context supersedes any context provided to the Context method.
  22070. func (c *ProductsListCall) Pages(ctx context.Context, f func(*ProductsListResponse) error) error {
  22071. c.ctx_ = ctx
  22072. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22073. for {
  22074. x, err := c.Do()
  22075. if err != nil {
  22076. return err
  22077. }
  22078. if err := f(x); err != nil {
  22079. return err
  22080. }
  22081. if x.NextPageToken == "" {
  22082. return nil
  22083. }
  22084. c.PageToken(x.NextPageToken)
  22085. }
  22086. }
  22087. // method id "content.productstatuses.custombatch":
  22088. type ProductstatusesCustombatchCall struct {
  22089. s *APIService
  22090. productstatusescustombatchrequest *ProductstatusesCustomBatchRequest
  22091. urlParams_ gensupport.URLParams
  22092. ctx_ context.Context
  22093. header_ http.Header
  22094. }
  22095. // Custombatch: Gets the statuses of multiple products in a single
  22096. // request.
  22097. func (r *ProductstatusesService) Custombatch(productstatusescustombatchrequest *ProductstatusesCustomBatchRequest) *ProductstatusesCustombatchCall {
  22098. c := &ProductstatusesCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22099. c.productstatusescustombatchrequest = productstatusescustombatchrequest
  22100. return c
  22101. }
  22102. // IncludeAttributes sets the optional parameter "includeAttributes":
  22103. // Flag to include full product data in the results of this request. The
  22104. // default value is false.
  22105. func (c *ProductstatusesCustombatchCall) IncludeAttributes(includeAttributes bool) *ProductstatusesCustombatchCall {
  22106. c.urlParams_.Set("includeAttributes", fmt.Sprint(includeAttributes))
  22107. return c
  22108. }
  22109. // Fields allows partial responses to be retrieved. See
  22110. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22111. // for more information.
  22112. func (c *ProductstatusesCustombatchCall) Fields(s ...googleapi.Field) *ProductstatusesCustombatchCall {
  22113. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22114. return c
  22115. }
  22116. // Context sets the context to be used in this call's Do method. Any
  22117. // pending HTTP request will be aborted if the provided context is
  22118. // canceled.
  22119. func (c *ProductstatusesCustombatchCall) Context(ctx context.Context) *ProductstatusesCustombatchCall {
  22120. c.ctx_ = ctx
  22121. return c
  22122. }
  22123. // Header returns an http.Header that can be modified by the caller to
  22124. // add HTTP headers to the request.
  22125. func (c *ProductstatusesCustombatchCall) Header() http.Header {
  22126. if c.header_ == nil {
  22127. c.header_ = make(http.Header)
  22128. }
  22129. return c.header_
  22130. }
  22131. func (c *ProductstatusesCustombatchCall) doRequest(alt string) (*http.Response, error) {
  22132. reqHeaders := make(http.Header)
  22133. for k, v := range c.header_ {
  22134. reqHeaders[k] = v
  22135. }
  22136. reqHeaders.Set("User-Agent", c.s.userAgent())
  22137. var body io.Reader = nil
  22138. body, err := googleapi.WithoutDataWrapper.JSONReader(c.productstatusescustombatchrequest)
  22139. if err != nil {
  22140. return nil, err
  22141. }
  22142. reqHeaders.Set("Content-Type", "application/json")
  22143. c.urlParams_.Set("alt", alt)
  22144. c.urlParams_.Set("prettyPrint", "false")
  22145. urls := googleapi.ResolveRelative(c.s.BasePath, "productstatuses/batch")
  22146. urls += "?" + c.urlParams_.Encode()
  22147. req, err := http.NewRequest("POST", urls, body)
  22148. if err != nil {
  22149. return nil, err
  22150. }
  22151. req.Header = reqHeaders
  22152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22153. }
  22154. // Do executes the "content.productstatuses.custombatch" call.
  22155. // Exactly one of *ProductstatusesCustomBatchResponse or error will be
  22156. // non-nil. Any non-2xx status code is an error. Response headers are in
  22157. // either *ProductstatusesCustomBatchResponse.ServerResponse.Header or
  22158. // (if a response was returned at all) in
  22159. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  22160. // whether the returned error was because http.StatusNotModified was
  22161. // returned.
  22162. func (c *ProductstatusesCustombatchCall) Do(opts ...googleapi.CallOption) (*ProductstatusesCustomBatchResponse, error) {
  22163. gensupport.SetOptions(c.urlParams_, opts...)
  22164. res, err := c.doRequest("json")
  22165. if res != nil && res.StatusCode == http.StatusNotModified {
  22166. if res.Body != nil {
  22167. res.Body.Close()
  22168. }
  22169. return nil, &googleapi.Error{
  22170. Code: res.StatusCode,
  22171. Header: res.Header,
  22172. }
  22173. }
  22174. if err != nil {
  22175. return nil, err
  22176. }
  22177. defer googleapi.CloseBody(res)
  22178. if err := googleapi.CheckResponse(res); err != nil {
  22179. return nil, err
  22180. }
  22181. ret := &ProductstatusesCustomBatchResponse{
  22182. ServerResponse: googleapi.ServerResponse{
  22183. Header: res.Header,
  22184. HTTPStatusCode: res.StatusCode,
  22185. },
  22186. }
  22187. target := &ret
  22188. if err := gensupport.DecodeResponse(target, res); err != nil {
  22189. return nil, err
  22190. }
  22191. return ret, nil
  22192. // {
  22193. // "description": "Gets the statuses of multiple products in a single request.",
  22194. // "httpMethod": "POST",
  22195. // "id": "content.productstatuses.custombatch",
  22196. // "parameters": {
  22197. // "includeAttributes": {
  22198. // "description": "Flag to include full product data in the results of this request. The default value is false.",
  22199. // "location": "query",
  22200. // "type": "boolean"
  22201. // }
  22202. // },
  22203. // "path": "productstatuses/batch",
  22204. // "request": {
  22205. // "$ref": "ProductstatusesCustomBatchRequest"
  22206. // },
  22207. // "response": {
  22208. // "$ref": "ProductstatusesCustomBatchResponse"
  22209. // },
  22210. // "scopes": [
  22211. // "https://www.googleapis.com/auth/content"
  22212. // ]
  22213. // }
  22214. }
  22215. // method id "content.productstatuses.get":
  22216. type ProductstatusesGetCall struct {
  22217. s *APIService
  22218. merchantId uint64
  22219. productId string
  22220. urlParams_ gensupport.URLParams
  22221. ifNoneMatch_ string
  22222. ctx_ context.Context
  22223. header_ http.Header
  22224. }
  22225. // Get: Gets the status of a product from your Merchant Center account.
  22226. func (r *ProductstatusesService) Get(merchantId uint64, productId string) *ProductstatusesGetCall {
  22227. c := &ProductstatusesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22228. c.merchantId = merchantId
  22229. c.productId = productId
  22230. return c
  22231. }
  22232. // Destinations sets the optional parameter "destinations": If set, only
  22233. // issues for the specified destinations are returned, otherwise only
  22234. // issues for the Shopping destination.
  22235. func (c *ProductstatusesGetCall) Destinations(destinations ...string) *ProductstatusesGetCall {
  22236. c.urlParams_.SetMulti("destinations", append([]string{}, destinations...))
  22237. return c
  22238. }
  22239. // IncludeAttributes sets the optional parameter "includeAttributes":
  22240. // Flag to include full product data in the result of this get request.
  22241. // The default value is false.
  22242. func (c *ProductstatusesGetCall) IncludeAttributes(includeAttributes bool) *ProductstatusesGetCall {
  22243. c.urlParams_.Set("includeAttributes", fmt.Sprint(includeAttributes))
  22244. return c
  22245. }
  22246. // Fields allows partial responses to be retrieved. See
  22247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22248. // for more information.
  22249. func (c *ProductstatusesGetCall) Fields(s ...googleapi.Field) *ProductstatusesGetCall {
  22250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22251. return c
  22252. }
  22253. // IfNoneMatch sets the optional parameter which makes the operation
  22254. // fail if the object's ETag matches the given value. This is useful for
  22255. // getting updates only after the object has changed since the last
  22256. // request. Use googleapi.IsNotModified to check whether the response
  22257. // error from Do is the result of In-None-Match.
  22258. func (c *ProductstatusesGetCall) IfNoneMatch(entityTag string) *ProductstatusesGetCall {
  22259. c.ifNoneMatch_ = entityTag
  22260. return c
  22261. }
  22262. // Context sets the context to be used in this call's Do method. Any
  22263. // pending HTTP request will be aborted if the provided context is
  22264. // canceled.
  22265. func (c *ProductstatusesGetCall) Context(ctx context.Context) *ProductstatusesGetCall {
  22266. c.ctx_ = ctx
  22267. return c
  22268. }
  22269. // Header returns an http.Header that can be modified by the caller to
  22270. // add HTTP headers to the request.
  22271. func (c *ProductstatusesGetCall) Header() http.Header {
  22272. if c.header_ == nil {
  22273. c.header_ = make(http.Header)
  22274. }
  22275. return c.header_
  22276. }
  22277. func (c *ProductstatusesGetCall) doRequest(alt string) (*http.Response, error) {
  22278. reqHeaders := make(http.Header)
  22279. for k, v := range c.header_ {
  22280. reqHeaders[k] = v
  22281. }
  22282. reqHeaders.Set("User-Agent", c.s.userAgent())
  22283. if c.ifNoneMatch_ != "" {
  22284. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22285. }
  22286. var body io.Reader = nil
  22287. c.urlParams_.Set("alt", alt)
  22288. c.urlParams_.Set("prettyPrint", "false")
  22289. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses/{productId}")
  22290. urls += "?" + c.urlParams_.Encode()
  22291. req, err := http.NewRequest("GET", urls, body)
  22292. if err != nil {
  22293. return nil, err
  22294. }
  22295. req.Header = reqHeaders
  22296. googleapi.Expand(req.URL, map[string]string{
  22297. "merchantId": strconv.FormatUint(c.merchantId, 10),
  22298. "productId": c.productId,
  22299. })
  22300. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22301. }
  22302. // Do executes the "content.productstatuses.get" call.
  22303. // Exactly one of *ProductStatus or error will be non-nil. Any non-2xx
  22304. // status code is an error. Response headers are in either
  22305. // *ProductStatus.ServerResponse.Header or (if a response was returned
  22306. // at all) in error.(*googleapi.Error).Header. Use
  22307. // googleapi.IsNotModified to check whether the returned error was
  22308. // because http.StatusNotModified was returned.
  22309. func (c *ProductstatusesGetCall) Do(opts ...googleapi.CallOption) (*ProductStatus, error) {
  22310. gensupport.SetOptions(c.urlParams_, opts...)
  22311. res, err := c.doRequest("json")
  22312. if res != nil && res.StatusCode == http.StatusNotModified {
  22313. if res.Body != nil {
  22314. res.Body.Close()
  22315. }
  22316. return nil, &googleapi.Error{
  22317. Code: res.StatusCode,
  22318. Header: res.Header,
  22319. }
  22320. }
  22321. if err != nil {
  22322. return nil, err
  22323. }
  22324. defer googleapi.CloseBody(res)
  22325. if err := googleapi.CheckResponse(res); err != nil {
  22326. return nil, err
  22327. }
  22328. ret := &ProductStatus{
  22329. ServerResponse: googleapi.ServerResponse{
  22330. Header: res.Header,
  22331. HTTPStatusCode: res.StatusCode,
  22332. },
  22333. }
  22334. target := &ret
  22335. if err := gensupport.DecodeResponse(target, res); err != nil {
  22336. return nil, err
  22337. }
  22338. return ret, nil
  22339. // {
  22340. // "description": "Gets the status of a product from your Merchant Center account.",
  22341. // "httpMethod": "GET",
  22342. // "id": "content.productstatuses.get",
  22343. // "parameterOrder": [
  22344. // "merchantId",
  22345. // "productId"
  22346. // ],
  22347. // "parameters": {
  22348. // "destinations": {
  22349. // "description": "If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.",
  22350. // "location": "query",
  22351. // "repeated": true,
  22352. // "type": "string"
  22353. // },
  22354. // "includeAttributes": {
  22355. // "description": "Flag to include full product data in the result of this get request. The default value is false.",
  22356. // "location": "query",
  22357. // "type": "boolean"
  22358. // },
  22359. // "merchantId": {
  22360. // "description": "The ID of the account that contains the product. This account cannot be a multi-client account.",
  22361. // "format": "uint64",
  22362. // "location": "path",
  22363. // "required": true,
  22364. // "type": "string"
  22365. // },
  22366. // "productId": {
  22367. // "description": "The REST ID of the product.",
  22368. // "location": "path",
  22369. // "required": true,
  22370. // "type": "string"
  22371. // }
  22372. // },
  22373. // "path": "{merchantId}/productstatuses/{productId}",
  22374. // "response": {
  22375. // "$ref": "ProductStatus"
  22376. // },
  22377. // "scopes": [
  22378. // "https://www.googleapis.com/auth/content"
  22379. // ]
  22380. // }
  22381. }
  22382. // method id "content.productstatuses.list":
  22383. type ProductstatusesListCall struct {
  22384. s *APIService
  22385. merchantId uint64
  22386. urlParams_ gensupport.URLParams
  22387. ifNoneMatch_ string
  22388. ctx_ context.Context
  22389. header_ http.Header
  22390. }
  22391. // List: Lists the statuses of the products in your Merchant Center
  22392. // account.
  22393. func (r *ProductstatusesService) List(merchantId uint64) *ProductstatusesListCall {
  22394. c := &ProductstatusesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22395. c.merchantId = merchantId
  22396. return c
  22397. }
  22398. // Destinations sets the optional parameter "destinations": If set, only
  22399. // issues for the specified destinations are returned, otherwise only
  22400. // issues for the Shopping destination.
  22401. func (c *ProductstatusesListCall) Destinations(destinations ...string) *ProductstatusesListCall {
  22402. c.urlParams_.SetMulti("destinations", append([]string{}, destinations...))
  22403. return c
  22404. }
  22405. // IncludeAttributes sets the optional parameter "includeAttributes":
  22406. // Flag to include full product data in the results of the list request.
  22407. // The default value is false.
  22408. func (c *ProductstatusesListCall) IncludeAttributes(includeAttributes bool) *ProductstatusesListCall {
  22409. c.urlParams_.Set("includeAttributes", fmt.Sprint(includeAttributes))
  22410. return c
  22411. }
  22412. // IncludeInvalidInsertedItems sets the optional parameter
  22413. // "includeInvalidInsertedItems": Flag to include the invalid inserted
  22414. // items in the result of the list request. By default the invalid items
  22415. // are not shown (the default value is false).
  22416. func (c *ProductstatusesListCall) IncludeInvalidInsertedItems(includeInvalidInsertedItems bool) *ProductstatusesListCall {
  22417. c.urlParams_.Set("includeInvalidInsertedItems", fmt.Sprint(includeInvalidInsertedItems))
  22418. return c
  22419. }
  22420. // MaxResults sets the optional parameter "maxResults": The maximum
  22421. // number of product statuses to return in the response, used for
  22422. // paging.
  22423. func (c *ProductstatusesListCall) MaxResults(maxResults int64) *ProductstatusesListCall {
  22424. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22425. return c
  22426. }
  22427. // PageToken sets the optional parameter "pageToken": The token returned
  22428. // by the previous request.
  22429. func (c *ProductstatusesListCall) PageToken(pageToken string) *ProductstatusesListCall {
  22430. c.urlParams_.Set("pageToken", pageToken)
  22431. return c
  22432. }
  22433. // Fields allows partial responses to be retrieved. See
  22434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22435. // for more information.
  22436. func (c *ProductstatusesListCall) Fields(s ...googleapi.Field) *ProductstatusesListCall {
  22437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22438. return c
  22439. }
  22440. // IfNoneMatch sets the optional parameter which makes the operation
  22441. // fail if the object's ETag matches the given value. This is useful for
  22442. // getting updates only after the object has changed since the last
  22443. // request. Use googleapi.IsNotModified to check whether the response
  22444. // error from Do is the result of In-None-Match.
  22445. func (c *ProductstatusesListCall) IfNoneMatch(entityTag string) *ProductstatusesListCall {
  22446. c.ifNoneMatch_ = entityTag
  22447. return c
  22448. }
  22449. // Context sets the context to be used in this call's Do method. Any
  22450. // pending HTTP request will be aborted if the provided context is
  22451. // canceled.
  22452. func (c *ProductstatusesListCall) Context(ctx context.Context) *ProductstatusesListCall {
  22453. c.ctx_ = ctx
  22454. return c
  22455. }
  22456. // Header returns an http.Header that can be modified by the caller to
  22457. // add HTTP headers to the request.
  22458. func (c *ProductstatusesListCall) Header() http.Header {
  22459. if c.header_ == nil {
  22460. c.header_ = make(http.Header)
  22461. }
  22462. return c.header_
  22463. }
  22464. func (c *ProductstatusesListCall) doRequest(alt string) (*http.Response, error) {
  22465. reqHeaders := make(http.Header)
  22466. for k, v := range c.header_ {
  22467. reqHeaders[k] = v
  22468. }
  22469. reqHeaders.Set("User-Agent", c.s.userAgent())
  22470. if c.ifNoneMatch_ != "" {
  22471. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22472. }
  22473. var body io.Reader = nil
  22474. c.urlParams_.Set("alt", alt)
  22475. c.urlParams_.Set("prettyPrint", "false")
  22476. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/productstatuses")
  22477. urls += "?" + c.urlParams_.Encode()
  22478. req, err := http.NewRequest("GET", urls, body)
  22479. if err != nil {
  22480. return nil, err
  22481. }
  22482. req.Header = reqHeaders
  22483. googleapi.Expand(req.URL, map[string]string{
  22484. "merchantId": strconv.FormatUint(c.merchantId, 10),
  22485. })
  22486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22487. }
  22488. // Do executes the "content.productstatuses.list" call.
  22489. // Exactly one of *ProductstatusesListResponse or error will be non-nil.
  22490. // Any non-2xx status code is an error. Response headers are in either
  22491. // *ProductstatusesListResponse.ServerResponse.Header or (if a response
  22492. // was returned at all) in error.(*googleapi.Error).Header. Use
  22493. // googleapi.IsNotModified to check whether the returned error was
  22494. // because http.StatusNotModified was returned.
  22495. func (c *ProductstatusesListCall) Do(opts ...googleapi.CallOption) (*ProductstatusesListResponse, error) {
  22496. gensupport.SetOptions(c.urlParams_, opts...)
  22497. res, err := c.doRequest("json")
  22498. if res != nil && res.StatusCode == http.StatusNotModified {
  22499. if res.Body != nil {
  22500. res.Body.Close()
  22501. }
  22502. return nil, &googleapi.Error{
  22503. Code: res.StatusCode,
  22504. Header: res.Header,
  22505. }
  22506. }
  22507. if err != nil {
  22508. return nil, err
  22509. }
  22510. defer googleapi.CloseBody(res)
  22511. if err := googleapi.CheckResponse(res); err != nil {
  22512. return nil, err
  22513. }
  22514. ret := &ProductstatusesListResponse{
  22515. ServerResponse: googleapi.ServerResponse{
  22516. Header: res.Header,
  22517. HTTPStatusCode: res.StatusCode,
  22518. },
  22519. }
  22520. target := &ret
  22521. if err := gensupport.DecodeResponse(target, res); err != nil {
  22522. return nil, err
  22523. }
  22524. return ret, nil
  22525. // {
  22526. // "description": "Lists the statuses of the products in your Merchant Center account.",
  22527. // "httpMethod": "GET",
  22528. // "id": "content.productstatuses.list",
  22529. // "parameterOrder": [
  22530. // "merchantId"
  22531. // ],
  22532. // "parameters": {
  22533. // "destinations": {
  22534. // "description": "If set, only issues for the specified destinations are returned, otherwise only issues for the Shopping destination.",
  22535. // "location": "query",
  22536. // "repeated": true,
  22537. // "type": "string"
  22538. // },
  22539. // "includeAttributes": {
  22540. // "description": "Flag to include full product data in the results of the list request. The default value is false.",
  22541. // "location": "query",
  22542. // "type": "boolean"
  22543. // },
  22544. // "includeInvalidInsertedItems": {
  22545. // "description": "Flag to include the invalid inserted items in the result of the list request. By default the invalid items are not shown (the default value is false).",
  22546. // "location": "query",
  22547. // "type": "boolean"
  22548. // },
  22549. // "maxResults": {
  22550. // "description": "The maximum number of product statuses to return in the response, used for paging.",
  22551. // "format": "uint32",
  22552. // "location": "query",
  22553. // "type": "integer"
  22554. // },
  22555. // "merchantId": {
  22556. // "description": "The ID of the account that contains the products. This account cannot be a multi-client account.",
  22557. // "format": "uint64",
  22558. // "location": "path",
  22559. // "required": true,
  22560. // "type": "string"
  22561. // },
  22562. // "pageToken": {
  22563. // "description": "The token returned by the previous request.",
  22564. // "location": "query",
  22565. // "type": "string"
  22566. // }
  22567. // },
  22568. // "path": "{merchantId}/productstatuses",
  22569. // "response": {
  22570. // "$ref": "ProductstatusesListResponse"
  22571. // },
  22572. // "scopes": [
  22573. // "https://www.googleapis.com/auth/content"
  22574. // ]
  22575. // }
  22576. }
  22577. // Pages invokes f for each page of results.
  22578. // A non-nil error returned from f will halt the iteration.
  22579. // The provided context supersedes any context provided to the Context method.
  22580. func (c *ProductstatusesListCall) Pages(ctx context.Context, f func(*ProductstatusesListResponse) error) error {
  22581. c.ctx_ = ctx
  22582. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22583. for {
  22584. x, err := c.Do()
  22585. if err != nil {
  22586. return err
  22587. }
  22588. if err := f(x); err != nil {
  22589. return err
  22590. }
  22591. if x.NextPageToken == "" {
  22592. return nil
  22593. }
  22594. c.PageToken(x.NextPageToken)
  22595. }
  22596. }
  22597. // method id "content.shippingsettings.custombatch":
  22598. type ShippingsettingsCustombatchCall struct {
  22599. s *APIService
  22600. shippingsettingscustombatchrequest *ShippingsettingsCustomBatchRequest
  22601. urlParams_ gensupport.URLParams
  22602. ctx_ context.Context
  22603. header_ http.Header
  22604. }
  22605. // Custombatch: Retrieves and updates the shipping settings of multiple
  22606. // accounts in a single request.
  22607. func (r *ShippingsettingsService) Custombatch(shippingsettingscustombatchrequest *ShippingsettingsCustomBatchRequest) *ShippingsettingsCustombatchCall {
  22608. c := &ShippingsettingsCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22609. c.shippingsettingscustombatchrequest = shippingsettingscustombatchrequest
  22610. return c
  22611. }
  22612. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  22613. // request like in a live environment. If set to true, dry-run mode
  22614. // checks the validity of the request and returns errors (if any).
  22615. func (c *ShippingsettingsCustombatchCall) DryRun(dryRun bool) *ShippingsettingsCustombatchCall {
  22616. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  22617. return c
  22618. }
  22619. // Fields allows partial responses to be retrieved. See
  22620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22621. // for more information.
  22622. func (c *ShippingsettingsCustombatchCall) Fields(s ...googleapi.Field) *ShippingsettingsCustombatchCall {
  22623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22624. return c
  22625. }
  22626. // Context sets the context to be used in this call's Do method. Any
  22627. // pending HTTP request will be aborted if the provided context is
  22628. // canceled.
  22629. func (c *ShippingsettingsCustombatchCall) Context(ctx context.Context) *ShippingsettingsCustombatchCall {
  22630. c.ctx_ = ctx
  22631. return c
  22632. }
  22633. // Header returns an http.Header that can be modified by the caller to
  22634. // add HTTP headers to the request.
  22635. func (c *ShippingsettingsCustombatchCall) Header() http.Header {
  22636. if c.header_ == nil {
  22637. c.header_ = make(http.Header)
  22638. }
  22639. return c.header_
  22640. }
  22641. func (c *ShippingsettingsCustombatchCall) doRequest(alt string) (*http.Response, error) {
  22642. reqHeaders := make(http.Header)
  22643. for k, v := range c.header_ {
  22644. reqHeaders[k] = v
  22645. }
  22646. reqHeaders.Set("User-Agent", c.s.userAgent())
  22647. var body io.Reader = nil
  22648. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shippingsettingscustombatchrequest)
  22649. if err != nil {
  22650. return nil, err
  22651. }
  22652. reqHeaders.Set("Content-Type", "application/json")
  22653. c.urlParams_.Set("alt", alt)
  22654. c.urlParams_.Set("prettyPrint", "false")
  22655. urls := googleapi.ResolveRelative(c.s.BasePath, "shippingsettings/batch")
  22656. urls += "?" + c.urlParams_.Encode()
  22657. req, err := http.NewRequest("POST", urls, body)
  22658. if err != nil {
  22659. return nil, err
  22660. }
  22661. req.Header = reqHeaders
  22662. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22663. }
  22664. // Do executes the "content.shippingsettings.custombatch" call.
  22665. // Exactly one of *ShippingsettingsCustomBatchResponse or error will be
  22666. // non-nil. Any non-2xx status code is an error. Response headers are in
  22667. // either *ShippingsettingsCustomBatchResponse.ServerResponse.Header or
  22668. // (if a response was returned at all) in
  22669. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  22670. // whether the returned error was because http.StatusNotModified was
  22671. // returned.
  22672. func (c *ShippingsettingsCustombatchCall) Do(opts ...googleapi.CallOption) (*ShippingsettingsCustomBatchResponse, error) {
  22673. gensupport.SetOptions(c.urlParams_, opts...)
  22674. res, err := c.doRequest("json")
  22675. if res != nil && res.StatusCode == http.StatusNotModified {
  22676. if res.Body != nil {
  22677. res.Body.Close()
  22678. }
  22679. return nil, &googleapi.Error{
  22680. Code: res.StatusCode,
  22681. Header: res.Header,
  22682. }
  22683. }
  22684. if err != nil {
  22685. return nil, err
  22686. }
  22687. defer googleapi.CloseBody(res)
  22688. if err := googleapi.CheckResponse(res); err != nil {
  22689. return nil, err
  22690. }
  22691. ret := &ShippingsettingsCustomBatchResponse{
  22692. ServerResponse: googleapi.ServerResponse{
  22693. Header: res.Header,
  22694. HTTPStatusCode: res.StatusCode,
  22695. },
  22696. }
  22697. target := &ret
  22698. if err := gensupport.DecodeResponse(target, res); err != nil {
  22699. return nil, err
  22700. }
  22701. return ret, nil
  22702. // {
  22703. // "description": "Retrieves and updates the shipping settings of multiple accounts in a single request.",
  22704. // "httpMethod": "POST",
  22705. // "id": "content.shippingsettings.custombatch",
  22706. // "parameters": {
  22707. // "dryRun": {
  22708. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  22709. // "location": "query",
  22710. // "type": "boolean"
  22711. // }
  22712. // },
  22713. // "path": "shippingsettings/batch",
  22714. // "request": {
  22715. // "$ref": "ShippingsettingsCustomBatchRequest"
  22716. // },
  22717. // "response": {
  22718. // "$ref": "ShippingsettingsCustomBatchResponse"
  22719. // },
  22720. // "scopes": [
  22721. // "https://www.googleapis.com/auth/content"
  22722. // ]
  22723. // }
  22724. }
  22725. // method id "content.shippingsettings.get":
  22726. type ShippingsettingsGetCall struct {
  22727. s *APIService
  22728. merchantId uint64
  22729. accountId uint64
  22730. urlParams_ gensupport.URLParams
  22731. ifNoneMatch_ string
  22732. ctx_ context.Context
  22733. header_ http.Header
  22734. }
  22735. // Get: Retrieves the shipping settings of the account.
  22736. func (r *ShippingsettingsService) Get(merchantId uint64, accountId uint64) *ShippingsettingsGetCall {
  22737. c := &ShippingsettingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22738. c.merchantId = merchantId
  22739. c.accountId = accountId
  22740. return c
  22741. }
  22742. // Fields allows partial responses to be retrieved. See
  22743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22744. // for more information.
  22745. func (c *ShippingsettingsGetCall) Fields(s ...googleapi.Field) *ShippingsettingsGetCall {
  22746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22747. return c
  22748. }
  22749. // IfNoneMatch sets the optional parameter which makes the operation
  22750. // fail if the object's ETag matches the given value. This is useful for
  22751. // getting updates only after the object has changed since the last
  22752. // request. Use googleapi.IsNotModified to check whether the response
  22753. // error from Do is the result of In-None-Match.
  22754. func (c *ShippingsettingsGetCall) IfNoneMatch(entityTag string) *ShippingsettingsGetCall {
  22755. c.ifNoneMatch_ = entityTag
  22756. return c
  22757. }
  22758. // Context sets the context to be used in this call's Do method. Any
  22759. // pending HTTP request will be aborted if the provided context is
  22760. // canceled.
  22761. func (c *ShippingsettingsGetCall) Context(ctx context.Context) *ShippingsettingsGetCall {
  22762. c.ctx_ = ctx
  22763. return c
  22764. }
  22765. // Header returns an http.Header that can be modified by the caller to
  22766. // add HTTP headers to the request.
  22767. func (c *ShippingsettingsGetCall) Header() http.Header {
  22768. if c.header_ == nil {
  22769. c.header_ = make(http.Header)
  22770. }
  22771. return c.header_
  22772. }
  22773. func (c *ShippingsettingsGetCall) doRequest(alt string) (*http.Response, error) {
  22774. reqHeaders := make(http.Header)
  22775. for k, v := range c.header_ {
  22776. reqHeaders[k] = v
  22777. }
  22778. reqHeaders.Set("User-Agent", c.s.userAgent())
  22779. if c.ifNoneMatch_ != "" {
  22780. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22781. }
  22782. var body io.Reader = nil
  22783. c.urlParams_.Set("alt", alt)
  22784. c.urlParams_.Set("prettyPrint", "false")
  22785. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/shippingsettings/{accountId}")
  22786. urls += "?" + c.urlParams_.Encode()
  22787. req, err := http.NewRequest("GET", urls, body)
  22788. if err != nil {
  22789. return nil, err
  22790. }
  22791. req.Header = reqHeaders
  22792. googleapi.Expand(req.URL, map[string]string{
  22793. "merchantId": strconv.FormatUint(c.merchantId, 10),
  22794. "accountId": strconv.FormatUint(c.accountId, 10),
  22795. })
  22796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22797. }
  22798. // Do executes the "content.shippingsettings.get" call.
  22799. // Exactly one of *ShippingSettings or error will be non-nil. Any
  22800. // non-2xx status code is an error. Response headers are in either
  22801. // *ShippingSettings.ServerResponse.Header or (if a response was
  22802. // returned at all) in error.(*googleapi.Error).Header. Use
  22803. // googleapi.IsNotModified to check whether the returned error was
  22804. // because http.StatusNotModified was returned.
  22805. func (c *ShippingsettingsGetCall) Do(opts ...googleapi.CallOption) (*ShippingSettings, error) {
  22806. gensupport.SetOptions(c.urlParams_, opts...)
  22807. res, err := c.doRequest("json")
  22808. if res != nil && res.StatusCode == http.StatusNotModified {
  22809. if res.Body != nil {
  22810. res.Body.Close()
  22811. }
  22812. return nil, &googleapi.Error{
  22813. Code: res.StatusCode,
  22814. Header: res.Header,
  22815. }
  22816. }
  22817. if err != nil {
  22818. return nil, err
  22819. }
  22820. defer googleapi.CloseBody(res)
  22821. if err := googleapi.CheckResponse(res); err != nil {
  22822. return nil, err
  22823. }
  22824. ret := &ShippingSettings{
  22825. ServerResponse: googleapi.ServerResponse{
  22826. Header: res.Header,
  22827. HTTPStatusCode: res.StatusCode,
  22828. },
  22829. }
  22830. target := &ret
  22831. if err := gensupport.DecodeResponse(target, res); err != nil {
  22832. return nil, err
  22833. }
  22834. return ret, nil
  22835. // {
  22836. // "description": "Retrieves the shipping settings of the account.",
  22837. // "httpMethod": "GET",
  22838. // "id": "content.shippingsettings.get",
  22839. // "parameterOrder": [
  22840. // "merchantId",
  22841. // "accountId"
  22842. // ],
  22843. // "parameters": {
  22844. // "accountId": {
  22845. // "description": "The ID of the account for which to get/update shipping settings.",
  22846. // "format": "uint64",
  22847. // "location": "path",
  22848. // "required": true,
  22849. // "type": "string"
  22850. // },
  22851. // "merchantId": {
  22852. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  22853. // "format": "uint64",
  22854. // "location": "path",
  22855. // "required": true,
  22856. // "type": "string"
  22857. // }
  22858. // },
  22859. // "path": "{merchantId}/shippingsettings/{accountId}",
  22860. // "response": {
  22861. // "$ref": "ShippingSettings"
  22862. // },
  22863. // "scopes": [
  22864. // "https://www.googleapis.com/auth/content"
  22865. // ]
  22866. // }
  22867. }
  22868. // method id "content.shippingsettings.getsupportedcarriers":
  22869. type ShippingsettingsGetsupportedcarriersCall struct {
  22870. s *APIService
  22871. merchantId uint64
  22872. urlParams_ gensupport.URLParams
  22873. ifNoneMatch_ string
  22874. ctx_ context.Context
  22875. header_ http.Header
  22876. }
  22877. // Getsupportedcarriers: Retrieves supported carriers and carrier
  22878. // services for an account.
  22879. func (r *ShippingsettingsService) Getsupportedcarriers(merchantId uint64) *ShippingsettingsGetsupportedcarriersCall {
  22880. c := &ShippingsettingsGetsupportedcarriersCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22881. c.merchantId = merchantId
  22882. return c
  22883. }
  22884. // Fields allows partial responses to be retrieved. See
  22885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22886. // for more information.
  22887. func (c *ShippingsettingsGetsupportedcarriersCall) Fields(s ...googleapi.Field) *ShippingsettingsGetsupportedcarriersCall {
  22888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22889. return c
  22890. }
  22891. // IfNoneMatch sets the optional parameter which makes the operation
  22892. // fail if the object's ETag matches the given value. This is useful for
  22893. // getting updates only after the object has changed since the last
  22894. // request. Use googleapi.IsNotModified to check whether the response
  22895. // error from Do is the result of In-None-Match.
  22896. func (c *ShippingsettingsGetsupportedcarriersCall) IfNoneMatch(entityTag string) *ShippingsettingsGetsupportedcarriersCall {
  22897. c.ifNoneMatch_ = entityTag
  22898. return c
  22899. }
  22900. // Context sets the context to be used in this call's Do method. Any
  22901. // pending HTTP request will be aborted if the provided context is
  22902. // canceled.
  22903. func (c *ShippingsettingsGetsupportedcarriersCall) Context(ctx context.Context) *ShippingsettingsGetsupportedcarriersCall {
  22904. c.ctx_ = ctx
  22905. return c
  22906. }
  22907. // Header returns an http.Header that can be modified by the caller to
  22908. // add HTTP headers to the request.
  22909. func (c *ShippingsettingsGetsupportedcarriersCall) Header() http.Header {
  22910. if c.header_ == nil {
  22911. c.header_ = make(http.Header)
  22912. }
  22913. return c.header_
  22914. }
  22915. func (c *ShippingsettingsGetsupportedcarriersCall) doRequest(alt string) (*http.Response, error) {
  22916. reqHeaders := make(http.Header)
  22917. for k, v := range c.header_ {
  22918. reqHeaders[k] = v
  22919. }
  22920. reqHeaders.Set("User-Agent", c.s.userAgent())
  22921. if c.ifNoneMatch_ != "" {
  22922. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22923. }
  22924. var body io.Reader = nil
  22925. c.urlParams_.Set("alt", alt)
  22926. c.urlParams_.Set("prettyPrint", "false")
  22927. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/supportedCarriers")
  22928. urls += "?" + c.urlParams_.Encode()
  22929. req, err := http.NewRequest("GET", urls, body)
  22930. if err != nil {
  22931. return nil, err
  22932. }
  22933. req.Header = reqHeaders
  22934. googleapi.Expand(req.URL, map[string]string{
  22935. "merchantId": strconv.FormatUint(c.merchantId, 10),
  22936. })
  22937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22938. }
  22939. // Do executes the "content.shippingsettings.getsupportedcarriers" call.
  22940. // Exactly one of *ShippingsettingsGetSupportedCarriersResponse or error
  22941. // will be non-nil. Any non-2xx status code is an error. Response
  22942. // headers are in either
  22943. // *ShippingsettingsGetSupportedCarriersResponse.ServerResponse.Header
  22944. // or (if a response was returned at all) in
  22945. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  22946. // whether the returned error was because http.StatusNotModified was
  22947. // returned.
  22948. func (c *ShippingsettingsGetsupportedcarriersCall) Do(opts ...googleapi.CallOption) (*ShippingsettingsGetSupportedCarriersResponse, error) {
  22949. gensupport.SetOptions(c.urlParams_, opts...)
  22950. res, err := c.doRequest("json")
  22951. if res != nil && res.StatusCode == http.StatusNotModified {
  22952. if res.Body != nil {
  22953. res.Body.Close()
  22954. }
  22955. return nil, &googleapi.Error{
  22956. Code: res.StatusCode,
  22957. Header: res.Header,
  22958. }
  22959. }
  22960. if err != nil {
  22961. return nil, err
  22962. }
  22963. defer googleapi.CloseBody(res)
  22964. if err := googleapi.CheckResponse(res); err != nil {
  22965. return nil, err
  22966. }
  22967. ret := &ShippingsettingsGetSupportedCarriersResponse{
  22968. ServerResponse: googleapi.ServerResponse{
  22969. Header: res.Header,
  22970. HTTPStatusCode: res.StatusCode,
  22971. },
  22972. }
  22973. target := &ret
  22974. if err := gensupport.DecodeResponse(target, res); err != nil {
  22975. return nil, err
  22976. }
  22977. return ret, nil
  22978. // {
  22979. // "description": "Retrieves supported carriers and carrier services for an account.",
  22980. // "httpMethod": "GET",
  22981. // "id": "content.shippingsettings.getsupportedcarriers",
  22982. // "parameterOrder": [
  22983. // "merchantId"
  22984. // ],
  22985. // "parameters": {
  22986. // "merchantId": {
  22987. // "description": "The ID of the account for which to retrieve the supported carriers.",
  22988. // "format": "uint64",
  22989. // "location": "path",
  22990. // "required": true,
  22991. // "type": "string"
  22992. // }
  22993. // },
  22994. // "path": "{merchantId}/supportedCarriers",
  22995. // "response": {
  22996. // "$ref": "ShippingsettingsGetSupportedCarriersResponse"
  22997. // },
  22998. // "scopes": [
  22999. // "https://www.googleapis.com/auth/content"
  23000. // ]
  23001. // }
  23002. }
  23003. // method id "content.shippingsettings.getsupportedholidays":
  23004. type ShippingsettingsGetsupportedholidaysCall struct {
  23005. s *APIService
  23006. merchantId uint64
  23007. urlParams_ gensupport.URLParams
  23008. ifNoneMatch_ string
  23009. ctx_ context.Context
  23010. header_ http.Header
  23011. }
  23012. // Getsupportedholidays: Retrieves supported holidays for an account.
  23013. func (r *ShippingsettingsService) Getsupportedholidays(merchantId uint64) *ShippingsettingsGetsupportedholidaysCall {
  23014. c := &ShippingsettingsGetsupportedholidaysCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23015. c.merchantId = merchantId
  23016. return c
  23017. }
  23018. // Fields allows partial responses to be retrieved. See
  23019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23020. // for more information.
  23021. func (c *ShippingsettingsGetsupportedholidaysCall) Fields(s ...googleapi.Field) *ShippingsettingsGetsupportedholidaysCall {
  23022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23023. return c
  23024. }
  23025. // IfNoneMatch sets the optional parameter which makes the operation
  23026. // fail if the object's ETag matches the given value. This is useful for
  23027. // getting updates only after the object has changed since the last
  23028. // request. Use googleapi.IsNotModified to check whether the response
  23029. // error from Do is the result of In-None-Match.
  23030. func (c *ShippingsettingsGetsupportedholidaysCall) IfNoneMatch(entityTag string) *ShippingsettingsGetsupportedholidaysCall {
  23031. c.ifNoneMatch_ = entityTag
  23032. return c
  23033. }
  23034. // Context sets the context to be used in this call's Do method. Any
  23035. // pending HTTP request will be aborted if the provided context is
  23036. // canceled.
  23037. func (c *ShippingsettingsGetsupportedholidaysCall) Context(ctx context.Context) *ShippingsettingsGetsupportedholidaysCall {
  23038. c.ctx_ = ctx
  23039. return c
  23040. }
  23041. // Header returns an http.Header that can be modified by the caller to
  23042. // add HTTP headers to the request.
  23043. func (c *ShippingsettingsGetsupportedholidaysCall) Header() http.Header {
  23044. if c.header_ == nil {
  23045. c.header_ = make(http.Header)
  23046. }
  23047. return c.header_
  23048. }
  23049. func (c *ShippingsettingsGetsupportedholidaysCall) doRequest(alt string) (*http.Response, error) {
  23050. reqHeaders := make(http.Header)
  23051. for k, v := range c.header_ {
  23052. reqHeaders[k] = v
  23053. }
  23054. reqHeaders.Set("User-Agent", c.s.userAgent())
  23055. if c.ifNoneMatch_ != "" {
  23056. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23057. }
  23058. var body io.Reader = nil
  23059. c.urlParams_.Set("alt", alt)
  23060. c.urlParams_.Set("prettyPrint", "false")
  23061. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/supportedHolidays")
  23062. urls += "?" + c.urlParams_.Encode()
  23063. req, err := http.NewRequest("GET", urls, body)
  23064. if err != nil {
  23065. return nil, err
  23066. }
  23067. req.Header = reqHeaders
  23068. googleapi.Expand(req.URL, map[string]string{
  23069. "merchantId": strconv.FormatUint(c.merchantId, 10),
  23070. })
  23071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23072. }
  23073. // Do executes the "content.shippingsettings.getsupportedholidays" call.
  23074. // Exactly one of *ShippingsettingsGetSupportedHolidaysResponse or error
  23075. // will be non-nil. Any non-2xx status code is an error. Response
  23076. // headers are in either
  23077. // *ShippingsettingsGetSupportedHolidaysResponse.ServerResponse.Header
  23078. // or (if a response was returned at all) in
  23079. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  23080. // whether the returned error was because http.StatusNotModified was
  23081. // returned.
  23082. func (c *ShippingsettingsGetsupportedholidaysCall) Do(opts ...googleapi.CallOption) (*ShippingsettingsGetSupportedHolidaysResponse, error) {
  23083. gensupport.SetOptions(c.urlParams_, opts...)
  23084. res, err := c.doRequest("json")
  23085. if res != nil && res.StatusCode == http.StatusNotModified {
  23086. if res.Body != nil {
  23087. res.Body.Close()
  23088. }
  23089. return nil, &googleapi.Error{
  23090. Code: res.StatusCode,
  23091. Header: res.Header,
  23092. }
  23093. }
  23094. if err != nil {
  23095. return nil, err
  23096. }
  23097. defer googleapi.CloseBody(res)
  23098. if err := googleapi.CheckResponse(res); err != nil {
  23099. return nil, err
  23100. }
  23101. ret := &ShippingsettingsGetSupportedHolidaysResponse{
  23102. ServerResponse: googleapi.ServerResponse{
  23103. Header: res.Header,
  23104. HTTPStatusCode: res.StatusCode,
  23105. },
  23106. }
  23107. target := &ret
  23108. if err := gensupport.DecodeResponse(target, res); err != nil {
  23109. return nil, err
  23110. }
  23111. return ret, nil
  23112. // {
  23113. // "description": "Retrieves supported holidays for an account.",
  23114. // "httpMethod": "GET",
  23115. // "id": "content.shippingsettings.getsupportedholidays",
  23116. // "parameterOrder": [
  23117. // "merchantId"
  23118. // ],
  23119. // "parameters": {
  23120. // "merchantId": {
  23121. // "description": "The ID of the account for which to retrieve the supported holidays.",
  23122. // "format": "uint64",
  23123. // "location": "path",
  23124. // "required": true,
  23125. // "type": "string"
  23126. // }
  23127. // },
  23128. // "path": "{merchantId}/supportedHolidays",
  23129. // "response": {
  23130. // "$ref": "ShippingsettingsGetSupportedHolidaysResponse"
  23131. // },
  23132. // "scopes": [
  23133. // "https://www.googleapis.com/auth/content"
  23134. // ]
  23135. // }
  23136. }
  23137. // method id "content.shippingsettings.list":
  23138. type ShippingsettingsListCall struct {
  23139. s *APIService
  23140. merchantId uint64
  23141. urlParams_ gensupport.URLParams
  23142. ifNoneMatch_ string
  23143. ctx_ context.Context
  23144. header_ http.Header
  23145. }
  23146. // List: Lists the shipping settings of the sub-accounts in your
  23147. // Merchant Center account.
  23148. func (r *ShippingsettingsService) List(merchantId uint64) *ShippingsettingsListCall {
  23149. c := &ShippingsettingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23150. c.merchantId = merchantId
  23151. return c
  23152. }
  23153. // MaxResults sets the optional parameter "maxResults": The maximum
  23154. // number of shipping settings to return in the response, used for
  23155. // paging.
  23156. func (c *ShippingsettingsListCall) MaxResults(maxResults int64) *ShippingsettingsListCall {
  23157. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23158. return c
  23159. }
  23160. // PageToken sets the optional parameter "pageToken": The token returned
  23161. // by the previous request.
  23162. func (c *ShippingsettingsListCall) PageToken(pageToken string) *ShippingsettingsListCall {
  23163. c.urlParams_.Set("pageToken", pageToken)
  23164. return c
  23165. }
  23166. // Fields allows partial responses to be retrieved. See
  23167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23168. // for more information.
  23169. func (c *ShippingsettingsListCall) Fields(s ...googleapi.Field) *ShippingsettingsListCall {
  23170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23171. return c
  23172. }
  23173. // IfNoneMatch sets the optional parameter which makes the operation
  23174. // fail if the object's ETag matches the given value. This is useful for
  23175. // getting updates only after the object has changed since the last
  23176. // request. Use googleapi.IsNotModified to check whether the response
  23177. // error from Do is the result of In-None-Match.
  23178. func (c *ShippingsettingsListCall) IfNoneMatch(entityTag string) *ShippingsettingsListCall {
  23179. c.ifNoneMatch_ = entityTag
  23180. return c
  23181. }
  23182. // Context sets the context to be used in this call's Do method. Any
  23183. // pending HTTP request will be aborted if the provided context is
  23184. // canceled.
  23185. func (c *ShippingsettingsListCall) Context(ctx context.Context) *ShippingsettingsListCall {
  23186. c.ctx_ = ctx
  23187. return c
  23188. }
  23189. // Header returns an http.Header that can be modified by the caller to
  23190. // add HTTP headers to the request.
  23191. func (c *ShippingsettingsListCall) Header() http.Header {
  23192. if c.header_ == nil {
  23193. c.header_ = make(http.Header)
  23194. }
  23195. return c.header_
  23196. }
  23197. func (c *ShippingsettingsListCall) doRequest(alt string) (*http.Response, error) {
  23198. reqHeaders := make(http.Header)
  23199. for k, v := range c.header_ {
  23200. reqHeaders[k] = v
  23201. }
  23202. reqHeaders.Set("User-Agent", c.s.userAgent())
  23203. if c.ifNoneMatch_ != "" {
  23204. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23205. }
  23206. var body io.Reader = nil
  23207. c.urlParams_.Set("alt", alt)
  23208. c.urlParams_.Set("prettyPrint", "false")
  23209. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/shippingsettings")
  23210. urls += "?" + c.urlParams_.Encode()
  23211. req, err := http.NewRequest("GET", urls, body)
  23212. if err != nil {
  23213. return nil, err
  23214. }
  23215. req.Header = reqHeaders
  23216. googleapi.Expand(req.URL, map[string]string{
  23217. "merchantId": strconv.FormatUint(c.merchantId, 10),
  23218. })
  23219. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23220. }
  23221. // Do executes the "content.shippingsettings.list" call.
  23222. // Exactly one of *ShippingsettingsListResponse or error will be
  23223. // non-nil. Any non-2xx status code is an error. Response headers are in
  23224. // either *ShippingsettingsListResponse.ServerResponse.Header or (if a
  23225. // response was returned at all) in error.(*googleapi.Error).Header. Use
  23226. // googleapi.IsNotModified to check whether the returned error was
  23227. // because http.StatusNotModified was returned.
  23228. func (c *ShippingsettingsListCall) Do(opts ...googleapi.CallOption) (*ShippingsettingsListResponse, error) {
  23229. gensupport.SetOptions(c.urlParams_, opts...)
  23230. res, err := c.doRequest("json")
  23231. if res != nil && res.StatusCode == http.StatusNotModified {
  23232. if res.Body != nil {
  23233. res.Body.Close()
  23234. }
  23235. return nil, &googleapi.Error{
  23236. Code: res.StatusCode,
  23237. Header: res.Header,
  23238. }
  23239. }
  23240. if err != nil {
  23241. return nil, err
  23242. }
  23243. defer googleapi.CloseBody(res)
  23244. if err := googleapi.CheckResponse(res); err != nil {
  23245. return nil, err
  23246. }
  23247. ret := &ShippingsettingsListResponse{
  23248. ServerResponse: googleapi.ServerResponse{
  23249. Header: res.Header,
  23250. HTTPStatusCode: res.StatusCode,
  23251. },
  23252. }
  23253. target := &ret
  23254. if err := gensupport.DecodeResponse(target, res); err != nil {
  23255. return nil, err
  23256. }
  23257. return ret, nil
  23258. // {
  23259. // "description": "Lists the shipping settings of the sub-accounts in your Merchant Center account.",
  23260. // "httpMethod": "GET",
  23261. // "id": "content.shippingsettings.list",
  23262. // "parameterOrder": [
  23263. // "merchantId"
  23264. // ],
  23265. // "parameters": {
  23266. // "maxResults": {
  23267. // "description": "The maximum number of shipping settings to return in the response, used for paging.",
  23268. // "format": "uint32",
  23269. // "location": "query",
  23270. // "type": "integer"
  23271. // },
  23272. // "merchantId": {
  23273. // "description": "The ID of the managing account. This must be a multi-client account.",
  23274. // "format": "uint64",
  23275. // "location": "path",
  23276. // "required": true,
  23277. // "type": "string"
  23278. // },
  23279. // "pageToken": {
  23280. // "description": "The token returned by the previous request.",
  23281. // "location": "query",
  23282. // "type": "string"
  23283. // }
  23284. // },
  23285. // "path": "{merchantId}/shippingsettings",
  23286. // "response": {
  23287. // "$ref": "ShippingsettingsListResponse"
  23288. // },
  23289. // "scopes": [
  23290. // "https://www.googleapis.com/auth/content"
  23291. // ]
  23292. // }
  23293. }
  23294. // Pages invokes f for each page of results.
  23295. // A non-nil error returned from f will halt the iteration.
  23296. // The provided context supersedes any context provided to the Context method.
  23297. func (c *ShippingsettingsListCall) Pages(ctx context.Context, f func(*ShippingsettingsListResponse) error) error {
  23298. c.ctx_ = ctx
  23299. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23300. for {
  23301. x, err := c.Do()
  23302. if err != nil {
  23303. return err
  23304. }
  23305. if err := f(x); err != nil {
  23306. return err
  23307. }
  23308. if x.NextPageToken == "" {
  23309. return nil
  23310. }
  23311. c.PageToken(x.NextPageToken)
  23312. }
  23313. }
  23314. // method id "content.shippingsettings.patch":
  23315. type ShippingsettingsPatchCall struct {
  23316. s *APIService
  23317. merchantId uint64
  23318. accountId uint64
  23319. shippingsettings *ShippingSettings
  23320. urlParams_ gensupport.URLParams
  23321. ctx_ context.Context
  23322. header_ http.Header
  23323. }
  23324. // Patch: Updates the shipping settings of the account. This method
  23325. // supports patch semantics.
  23326. func (r *ShippingsettingsService) Patch(merchantId uint64, accountId uint64, shippingsettings *ShippingSettings) *ShippingsettingsPatchCall {
  23327. c := &ShippingsettingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23328. c.merchantId = merchantId
  23329. c.accountId = accountId
  23330. c.shippingsettings = shippingsettings
  23331. return c
  23332. }
  23333. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  23334. // request like in a live environment. If set to true, dry-run mode
  23335. // checks the validity of the request and returns errors (if any).
  23336. func (c *ShippingsettingsPatchCall) DryRun(dryRun bool) *ShippingsettingsPatchCall {
  23337. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  23338. return c
  23339. }
  23340. // Fields allows partial responses to be retrieved. See
  23341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23342. // for more information.
  23343. func (c *ShippingsettingsPatchCall) Fields(s ...googleapi.Field) *ShippingsettingsPatchCall {
  23344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23345. return c
  23346. }
  23347. // Context sets the context to be used in this call's Do method. Any
  23348. // pending HTTP request will be aborted if the provided context is
  23349. // canceled.
  23350. func (c *ShippingsettingsPatchCall) Context(ctx context.Context) *ShippingsettingsPatchCall {
  23351. c.ctx_ = ctx
  23352. return c
  23353. }
  23354. // Header returns an http.Header that can be modified by the caller to
  23355. // add HTTP headers to the request.
  23356. func (c *ShippingsettingsPatchCall) Header() http.Header {
  23357. if c.header_ == nil {
  23358. c.header_ = make(http.Header)
  23359. }
  23360. return c.header_
  23361. }
  23362. func (c *ShippingsettingsPatchCall) doRequest(alt string) (*http.Response, error) {
  23363. reqHeaders := make(http.Header)
  23364. for k, v := range c.header_ {
  23365. reqHeaders[k] = v
  23366. }
  23367. reqHeaders.Set("User-Agent", c.s.userAgent())
  23368. var body io.Reader = nil
  23369. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shippingsettings)
  23370. if err != nil {
  23371. return nil, err
  23372. }
  23373. reqHeaders.Set("Content-Type", "application/json")
  23374. c.urlParams_.Set("alt", alt)
  23375. c.urlParams_.Set("prettyPrint", "false")
  23376. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/shippingsettings/{accountId}")
  23377. urls += "?" + c.urlParams_.Encode()
  23378. req, err := http.NewRequest("PATCH", urls, body)
  23379. if err != nil {
  23380. return nil, err
  23381. }
  23382. req.Header = reqHeaders
  23383. googleapi.Expand(req.URL, map[string]string{
  23384. "merchantId": strconv.FormatUint(c.merchantId, 10),
  23385. "accountId": strconv.FormatUint(c.accountId, 10),
  23386. })
  23387. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23388. }
  23389. // Do executes the "content.shippingsettings.patch" call.
  23390. // Exactly one of *ShippingSettings or error will be non-nil. Any
  23391. // non-2xx status code is an error. Response headers are in either
  23392. // *ShippingSettings.ServerResponse.Header or (if a response was
  23393. // returned at all) in error.(*googleapi.Error).Header. Use
  23394. // googleapi.IsNotModified to check whether the returned error was
  23395. // because http.StatusNotModified was returned.
  23396. func (c *ShippingsettingsPatchCall) Do(opts ...googleapi.CallOption) (*ShippingSettings, error) {
  23397. gensupport.SetOptions(c.urlParams_, opts...)
  23398. res, err := c.doRequest("json")
  23399. if res != nil && res.StatusCode == http.StatusNotModified {
  23400. if res.Body != nil {
  23401. res.Body.Close()
  23402. }
  23403. return nil, &googleapi.Error{
  23404. Code: res.StatusCode,
  23405. Header: res.Header,
  23406. }
  23407. }
  23408. if err != nil {
  23409. return nil, err
  23410. }
  23411. defer googleapi.CloseBody(res)
  23412. if err := googleapi.CheckResponse(res); err != nil {
  23413. return nil, err
  23414. }
  23415. ret := &ShippingSettings{
  23416. ServerResponse: googleapi.ServerResponse{
  23417. Header: res.Header,
  23418. HTTPStatusCode: res.StatusCode,
  23419. },
  23420. }
  23421. target := &ret
  23422. if err := gensupport.DecodeResponse(target, res); err != nil {
  23423. return nil, err
  23424. }
  23425. return ret, nil
  23426. // {
  23427. // "description": "Updates the shipping settings of the account. This method supports patch semantics.",
  23428. // "httpMethod": "PATCH",
  23429. // "id": "content.shippingsettings.patch",
  23430. // "parameterOrder": [
  23431. // "merchantId",
  23432. // "accountId"
  23433. // ],
  23434. // "parameters": {
  23435. // "accountId": {
  23436. // "description": "The ID of the account for which to get/update shipping settings.",
  23437. // "format": "uint64",
  23438. // "location": "path",
  23439. // "required": true,
  23440. // "type": "string"
  23441. // },
  23442. // "dryRun": {
  23443. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  23444. // "location": "query",
  23445. // "type": "boolean"
  23446. // },
  23447. // "merchantId": {
  23448. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  23449. // "format": "uint64",
  23450. // "location": "path",
  23451. // "required": true,
  23452. // "type": "string"
  23453. // }
  23454. // },
  23455. // "path": "{merchantId}/shippingsettings/{accountId}",
  23456. // "request": {
  23457. // "$ref": "ShippingSettings"
  23458. // },
  23459. // "response": {
  23460. // "$ref": "ShippingSettings"
  23461. // },
  23462. // "scopes": [
  23463. // "https://www.googleapis.com/auth/content"
  23464. // ]
  23465. // }
  23466. }
  23467. // method id "content.shippingsettings.update":
  23468. type ShippingsettingsUpdateCall struct {
  23469. s *APIService
  23470. merchantId uint64
  23471. accountId uint64
  23472. shippingsettings *ShippingSettings
  23473. urlParams_ gensupport.URLParams
  23474. ctx_ context.Context
  23475. header_ http.Header
  23476. }
  23477. // Update: Updates the shipping settings of the account.
  23478. func (r *ShippingsettingsService) Update(merchantId uint64, accountId uint64, shippingsettings *ShippingSettings) *ShippingsettingsUpdateCall {
  23479. c := &ShippingsettingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23480. c.merchantId = merchantId
  23481. c.accountId = accountId
  23482. c.shippingsettings = shippingsettings
  23483. return c
  23484. }
  23485. // DryRun sets the optional parameter "dryRun": Flag to simulate a
  23486. // request like in a live environment. If set to true, dry-run mode
  23487. // checks the validity of the request and returns errors (if any).
  23488. func (c *ShippingsettingsUpdateCall) DryRun(dryRun bool) *ShippingsettingsUpdateCall {
  23489. c.urlParams_.Set("dryRun", fmt.Sprint(dryRun))
  23490. return c
  23491. }
  23492. // Fields allows partial responses to be retrieved. See
  23493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23494. // for more information.
  23495. func (c *ShippingsettingsUpdateCall) Fields(s ...googleapi.Field) *ShippingsettingsUpdateCall {
  23496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23497. return c
  23498. }
  23499. // Context sets the context to be used in this call's Do method. Any
  23500. // pending HTTP request will be aborted if the provided context is
  23501. // canceled.
  23502. func (c *ShippingsettingsUpdateCall) Context(ctx context.Context) *ShippingsettingsUpdateCall {
  23503. c.ctx_ = ctx
  23504. return c
  23505. }
  23506. // Header returns an http.Header that can be modified by the caller to
  23507. // add HTTP headers to the request.
  23508. func (c *ShippingsettingsUpdateCall) Header() http.Header {
  23509. if c.header_ == nil {
  23510. c.header_ = make(http.Header)
  23511. }
  23512. return c.header_
  23513. }
  23514. func (c *ShippingsettingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  23515. reqHeaders := make(http.Header)
  23516. for k, v := range c.header_ {
  23517. reqHeaders[k] = v
  23518. }
  23519. reqHeaders.Set("User-Agent", c.s.userAgent())
  23520. var body io.Reader = nil
  23521. body, err := googleapi.WithoutDataWrapper.JSONReader(c.shippingsettings)
  23522. if err != nil {
  23523. return nil, err
  23524. }
  23525. reqHeaders.Set("Content-Type", "application/json")
  23526. c.urlParams_.Set("alt", alt)
  23527. c.urlParams_.Set("prettyPrint", "false")
  23528. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/shippingsettings/{accountId}")
  23529. urls += "?" + c.urlParams_.Encode()
  23530. req, err := http.NewRequest("PUT", urls, body)
  23531. if err != nil {
  23532. return nil, err
  23533. }
  23534. req.Header = reqHeaders
  23535. googleapi.Expand(req.URL, map[string]string{
  23536. "merchantId": strconv.FormatUint(c.merchantId, 10),
  23537. "accountId": strconv.FormatUint(c.accountId, 10),
  23538. })
  23539. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23540. }
  23541. // Do executes the "content.shippingsettings.update" call.
  23542. // Exactly one of *ShippingSettings or error will be non-nil. Any
  23543. // non-2xx status code is an error. Response headers are in either
  23544. // *ShippingSettings.ServerResponse.Header or (if a response was
  23545. // returned at all) in error.(*googleapi.Error).Header. Use
  23546. // googleapi.IsNotModified to check whether the returned error was
  23547. // because http.StatusNotModified was returned.
  23548. func (c *ShippingsettingsUpdateCall) Do(opts ...googleapi.CallOption) (*ShippingSettings, error) {
  23549. gensupport.SetOptions(c.urlParams_, opts...)
  23550. res, err := c.doRequest("json")
  23551. if res != nil && res.StatusCode == http.StatusNotModified {
  23552. if res.Body != nil {
  23553. res.Body.Close()
  23554. }
  23555. return nil, &googleapi.Error{
  23556. Code: res.StatusCode,
  23557. Header: res.Header,
  23558. }
  23559. }
  23560. if err != nil {
  23561. return nil, err
  23562. }
  23563. defer googleapi.CloseBody(res)
  23564. if err := googleapi.CheckResponse(res); err != nil {
  23565. return nil, err
  23566. }
  23567. ret := &ShippingSettings{
  23568. ServerResponse: googleapi.ServerResponse{
  23569. Header: res.Header,
  23570. HTTPStatusCode: res.StatusCode,
  23571. },
  23572. }
  23573. target := &ret
  23574. if err := gensupport.DecodeResponse(target, res); err != nil {
  23575. return nil, err
  23576. }
  23577. return ret, nil
  23578. // {
  23579. // "description": "Updates the shipping settings of the account.",
  23580. // "httpMethod": "PUT",
  23581. // "id": "content.shippingsettings.update",
  23582. // "parameterOrder": [
  23583. // "merchantId",
  23584. // "accountId"
  23585. // ],
  23586. // "parameters": {
  23587. // "accountId": {
  23588. // "description": "The ID of the account for which to get/update shipping settings.",
  23589. // "format": "uint64",
  23590. // "location": "path",
  23591. // "required": true,
  23592. // "type": "string"
  23593. // },
  23594. // "dryRun": {
  23595. // "description": "Flag to simulate a request like in a live environment. If set to true, dry-run mode checks the validity of the request and returns errors (if any).",
  23596. // "location": "query",
  23597. // "type": "boolean"
  23598. // },
  23599. // "merchantId": {
  23600. // "description": "The ID of the managing account. If this parameter is not the same as accountId, then this account must be a multi-client account and accountId must be the ID of a sub-account of this account.",
  23601. // "format": "uint64",
  23602. // "location": "path",
  23603. // "required": true,
  23604. // "type": "string"
  23605. // }
  23606. // },
  23607. // "path": "{merchantId}/shippingsettings/{accountId}",
  23608. // "request": {
  23609. // "$ref": "ShippingSettings"
  23610. // },
  23611. // "response": {
  23612. // "$ref": "ShippingSettings"
  23613. // },
  23614. // "scopes": [
  23615. // "https://www.googleapis.com/auth/content"
  23616. // ]
  23617. // }
  23618. }