content-gen.go 137 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984
  1. // Package content provides access to the Content API for Shopping.
  2. //
  3. // See https://developers.google.com/shopping-content
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/content/v2sandbox"
  8. // ...
  9. // contentService, err := content.New(oauthHttpClient)
  10. package content // import "google.golang.org/api/content/v2sandbox"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "content:v2sandbox"
  41. const apiName = "content"
  42. const apiVersion = "v2sandbox"
  43. const basePath = "https://www.googleapis.com/content/v2sandbox/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your product listings and accounts for Google Shopping
  47. ContentScope = "https://www.googleapis.com/auth/content"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Orders = NewOrdersService(s)
  55. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Orders *OrdersService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewOrdersService(s *Service) *OrdersService {
  70. rs := &OrdersService{s: s}
  71. return rs
  72. }
  73. type OrdersService struct {
  74. s *Service
  75. }
  76. // Error: An error returned by the API.
  77. type Error struct {
  78. // Domain: The domain of the error.
  79. Domain string `json:"domain,omitempty"`
  80. // Message: A description of the error.
  81. Message string `json:"message,omitempty"`
  82. // Reason: The error code.
  83. Reason string `json:"reason,omitempty"`
  84. // ForceSendFields is a list of field names (e.g. "Domain") to
  85. // unconditionally include in API requests. By default, fields with
  86. // empty values are omitted from API requests. However, any non-pointer,
  87. // non-interface field appearing in ForceSendFields will be sent to the
  88. // server regardless of whether the field is empty or not. This may be
  89. // used to include empty fields in Patch requests.
  90. ForceSendFields []string `json:"-"`
  91. }
  92. func (s *Error) MarshalJSON() ([]byte, error) {
  93. type noMethod Error
  94. raw := noMethod(*s)
  95. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  96. }
  97. // Errors: A list of errors returned by a failed batch entry.
  98. type Errors struct {
  99. // Code: The HTTP status of the first error in errors.
  100. Code int64 `json:"code,omitempty"`
  101. // Errors: A list of errors.
  102. Errors []*Error `json:"errors,omitempty"`
  103. // Message: The message of the first error in errors.
  104. Message string `json:"message,omitempty"`
  105. // ForceSendFields is a list of field names (e.g. "Code") to
  106. // unconditionally include in API requests. By default, fields with
  107. // empty values are omitted from API requests. However, any non-pointer,
  108. // non-interface field appearing in ForceSendFields will be sent to the
  109. // server regardless of whether the field is empty or not. This may be
  110. // used to include empty fields in Patch requests.
  111. ForceSendFields []string `json:"-"`
  112. }
  113. func (s *Errors) MarshalJSON() ([]byte, error) {
  114. type noMethod Errors
  115. raw := noMethod(*s)
  116. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  117. }
  118. type Order struct {
  119. // Acknowledged: Whether the order was acknowledged.
  120. Acknowledged bool `json:"acknowledged,omitempty"`
  121. // Customer: The details of the customer who placed the order.
  122. Customer *OrderCustomer `json:"customer,omitempty"`
  123. // DeliveryDetails: The details for the delivery.
  124. DeliveryDetails *OrderDeliveryDetails `json:"deliveryDetails,omitempty"`
  125. // Id: The REST id of the order. Globally unique.
  126. Id string `json:"id,omitempty"`
  127. // Kind: Identifies what kind of resource this is. Value: the fixed
  128. // string "content#order".
  129. Kind string `json:"kind,omitempty"`
  130. // LineItems: Line items that are ordered.
  131. LineItems []*OrderLineItem `json:"lineItems,omitempty"`
  132. MerchantId uint64 `json:"merchantId,omitempty,string"`
  133. // MerchantOrderId: Merchant-provided id of the order.
  134. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  135. // NetAmount: The net amount for the order. For example, if an order was
  136. // originally for a grand total of $100 and a refund was issued for $20,
  137. // the net amount will be $80.
  138. NetAmount *Price `json:"netAmount,omitempty"`
  139. // PaymentMethod: The details of the payment method.
  140. PaymentMethod *OrderPaymentMethod `json:"paymentMethod,omitempty"`
  141. // PaymentStatus: The status of the payment.
  142. PaymentStatus string `json:"paymentStatus,omitempty"`
  143. // PlacedDate: The date when the order was placed, in ISO 8601 format.
  144. PlacedDate string `json:"placedDate,omitempty"`
  145. // Refunds: Refunds for the order.
  146. Refunds []*OrderRefund `json:"refunds,omitempty"`
  147. // Shipments: Shipments of the order.
  148. Shipments []*OrderShipment `json:"shipments,omitempty"`
  149. // ShippingCost: The total cost of shipping for all items.
  150. ShippingCost *Price `json:"shippingCost,omitempty"`
  151. // ShippingCostTax: The tax for the total shipping cost.
  152. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  153. // ShippingOption: The requested shipping option.
  154. ShippingOption string `json:"shippingOption,omitempty"`
  155. // Status: The status of the order.
  156. Status string `json:"status,omitempty"`
  157. // ServerResponse contains the HTTP response code and headers from the
  158. // server.
  159. googleapi.ServerResponse `json:"-"`
  160. // ForceSendFields is a list of field names (e.g. "Acknowledged") to
  161. // unconditionally include in API requests. By default, fields with
  162. // empty values are omitted from API requests. However, any non-pointer,
  163. // non-interface field appearing in ForceSendFields will be sent to the
  164. // server regardless of whether the field is empty or not. This may be
  165. // used to include empty fields in Patch requests.
  166. ForceSendFields []string `json:"-"`
  167. }
  168. func (s *Order) MarshalJSON() ([]byte, error) {
  169. type noMethod Order
  170. raw := noMethod(*s)
  171. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  172. }
  173. type OrderAddress struct {
  174. // Country: CLDR country code (e.g. "US").
  175. Country string `json:"country,omitempty"`
  176. // FullAddress: Strings representing the lines of the printed label for
  177. // mailing the order, for example:
  178. // John Smith
  179. // 1600 Amphitheatre Parkway
  180. // Mountain View, CA, 94043
  181. // United States
  182. FullAddress []string `json:"fullAddress,omitempty"`
  183. // IsPostOfficeBox: Whether the address is a post office box.
  184. IsPostOfficeBox bool `json:"isPostOfficeBox,omitempty"`
  185. // Locality: City, town or commune. May also include dependent
  186. // localities or sublocalities (e.g. neighborhoods or suburbs).
  187. Locality string `json:"locality,omitempty"`
  188. // PostalCode: Postal Code or ZIP (e.g. "94043").
  189. PostalCode string `json:"postalCode,omitempty"`
  190. // RecipientName: Name of the recipient.
  191. RecipientName string `json:"recipientName,omitempty"`
  192. // Region: Top-level administrative subdivision of the country (e.g.
  193. // "CA").
  194. Region string `json:"region,omitempty"`
  195. // StreetAddress: Street-level part of the address.
  196. StreetAddress []string `json:"streetAddress,omitempty"`
  197. // ForceSendFields is a list of field names (e.g. "Country") to
  198. // unconditionally include in API requests. By default, fields with
  199. // empty values are omitted from API requests. However, any non-pointer,
  200. // non-interface field appearing in ForceSendFields will be sent to the
  201. // server regardless of whether the field is empty or not. This may be
  202. // used to include empty fields in Patch requests.
  203. ForceSendFields []string `json:"-"`
  204. }
  205. func (s *OrderAddress) MarshalJSON() ([]byte, error) {
  206. type noMethod OrderAddress
  207. raw := noMethod(*s)
  208. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  209. }
  210. type OrderCancellation struct {
  211. // Actor: The actor that created the cancellation.
  212. Actor string `json:"actor,omitempty"`
  213. // CreationDate: Date on which the cancellation has been created, in ISO
  214. // 8601 format.
  215. CreationDate string `json:"creationDate,omitempty"`
  216. // Quantity: The quantity that was canceled.
  217. Quantity int64 `json:"quantity,omitempty"`
  218. // Reason: The reason for the cancellation.
  219. Reason string `json:"reason,omitempty"`
  220. // ReasonText: The explanation of the reason.
  221. ReasonText string `json:"reasonText,omitempty"`
  222. // ForceSendFields is a list of field names (e.g. "Actor") to
  223. // unconditionally include in API requests. By default, fields with
  224. // empty values are omitted from API requests. However, any non-pointer,
  225. // non-interface field appearing in ForceSendFields will be sent to the
  226. // server regardless of whether the field is empty or not. This may be
  227. // used to include empty fields in Patch requests.
  228. ForceSendFields []string `json:"-"`
  229. }
  230. func (s *OrderCancellation) MarshalJSON() ([]byte, error) {
  231. type noMethod OrderCancellation
  232. raw := noMethod(*s)
  233. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  234. }
  235. type OrderCustomer struct {
  236. // Email: Email address of the customer.
  237. Email string `json:"email,omitempty"`
  238. // ExplicitMarketingPreference: If set, this indicates the user had a
  239. // choice to opt in or out of providing marketing rights to the
  240. // merchant. If unset, this indicates the user has already made this
  241. // choice in a previous purchase, and was thus not shown the marketing
  242. // right opt in/out checkbox during the Purchases on Google checkout
  243. // flow.
  244. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  245. // FullName: Full name of the customer.
  246. FullName string `json:"fullName,omitempty"`
  247. // ForceSendFields is a list of field names (e.g. "Email") to
  248. // unconditionally include in API requests. By default, fields with
  249. // empty values are omitted from API requests. However, any non-pointer,
  250. // non-interface field appearing in ForceSendFields will be sent to the
  251. // server regardless of whether the field is empty or not. This may be
  252. // used to include empty fields in Patch requests.
  253. ForceSendFields []string `json:"-"`
  254. }
  255. func (s *OrderCustomer) MarshalJSON() ([]byte, error) {
  256. type noMethod OrderCustomer
  257. raw := noMethod(*s)
  258. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  259. }
  260. type OrderDeliveryDetails struct {
  261. // Address: The delivery address
  262. Address *OrderAddress `json:"address,omitempty"`
  263. // PhoneNumber: The phone number of the person receiving the delivery.
  264. PhoneNumber string `json:"phoneNumber,omitempty"`
  265. // ForceSendFields is a list of field names (e.g. "Address") to
  266. // unconditionally include in API requests. By default, fields with
  267. // empty values are omitted from API requests. However, any non-pointer,
  268. // non-interface field appearing in ForceSendFields will be sent to the
  269. // server regardless of whether the field is empty or not. This may be
  270. // used to include empty fields in Patch requests.
  271. ForceSendFields []string `json:"-"`
  272. }
  273. func (s *OrderDeliveryDetails) MarshalJSON() ([]byte, error) {
  274. type noMethod OrderDeliveryDetails
  275. raw := noMethod(*s)
  276. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  277. }
  278. type OrderLineItem struct {
  279. // Cancellations: Cancellations of the line item.
  280. Cancellations []*OrderCancellation `json:"cancellations,omitempty"`
  281. // Id: The id of the line item.
  282. Id string `json:"id,omitempty"`
  283. // Price: Total price for the line item. For example, if two items for
  284. // $10 are purchased, the total price will be $20.
  285. Price *Price `json:"price,omitempty"`
  286. // Product: Product data from the time of the order placement.
  287. Product *OrderLineItemProduct `json:"product,omitempty"`
  288. // QuantityCanceled: Number of items canceled.
  289. QuantityCanceled int64 `json:"quantityCanceled,omitempty"`
  290. // QuantityDelivered: Number of items delivered.
  291. QuantityDelivered int64 `json:"quantityDelivered,omitempty"`
  292. // QuantityOrdered: Number of items ordered.
  293. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  294. // QuantityPending: Number of items pending.
  295. QuantityPending int64 `json:"quantityPending,omitempty"`
  296. // QuantityReturned: Number of items returned.
  297. QuantityReturned int64 `json:"quantityReturned,omitempty"`
  298. // QuantityShipped: Number of items shipped.
  299. QuantityShipped int64 `json:"quantityShipped,omitempty"`
  300. // ReturnInfo: Details of the return policy for the line item.
  301. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  302. // Returns: Returns of the line item.
  303. Returns []*OrderReturn `json:"returns,omitempty"`
  304. // ShippingDetails: Details of the requested shipping for the line item.
  305. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  306. // Tax: Total tax amount for the line item. For example, if two items
  307. // are purchased, and each have a cost tax of $2, the total tax amount
  308. // will be $4.
  309. Tax *Price `json:"tax,omitempty"`
  310. // ForceSendFields is a list of field names (e.g. "Cancellations") to
  311. // unconditionally include in API requests. By default, fields with
  312. // empty values are omitted from API requests. However, any non-pointer,
  313. // non-interface field appearing in ForceSendFields will be sent to the
  314. // server regardless of whether the field is empty or not. This may be
  315. // used to include empty fields in Patch requests.
  316. ForceSendFields []string `json:"-"`
  317. }
  318. func (s *OrderLineItem) MarshalJSON() ([]byte, error) {
  319. type noMethod OrderLineItem
  320. raw := noMethod(*s)
  321. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  322. }
  323. type OrderLineItemProduct struct {
  324. // Brand: Brand of the item.
  325. Brand string `json:"brand,omitempty"`
  326. // Channel: The item's channel (online or local).
  327. Channel string `json:"channel,omitempty"`
  328. // Condition: Condition or state of the item.
  329. Condition string `json:"condition,omitempty"`
  330. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  331. ContentLanguage string `json:"contentLanguage,omitempty"`
  332. // Gtin: Global Trade Item Number (GTIN) of the item.
  333. Gtin string `json:"gtin,omitempty"`
  334. // Id: The REST id of the product.
  335. Id string `json:"id,omitempty"`
  336. // ImageLink: URL of an image of the item.
  337. ImageLink string `json:"imageLink,omitempty"`
  338. // ItemGroupId: Shared identifier for all variants of the same product.
  339. ItemGroupId string `json:"itemGroupId,omitempty"`
  340. // Mpn: Manufacturer Part Number (MPN) of the item.
  341. Mpn string `json:"mpn,omitempty"`
  342. // OfferId: An identifier of the item.
  343. OfferId string `json:"offerId,omitempty"`
  344. // Price: Price of the item.
  345. Price *Price `json:"price,omitempty"`
  346. // ShownImage: URL to the cached image shown to the user when order was
  347. // placed.
  348. ShownImage string `json:"shownImage,omitempty"`
  349. // TargetCountry: The CLDR territory code of the target country of the
  350. // product.
  351. TargetCountry string `json:"targetCountry,omitempty"`
  352. // Title: The title of the product.
  353. Title string `json:"title,omitempty"`
  354. // VariantAttributes: Variant attributes for the item. These are
  355. // dimensions of the product, such as color, gender, material, pattern,
  356. // and size. You can find a comprehensive list of variant attributes
  357. // here.
  358. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  359. // ForceSendFields is a list of field names (e.g. "Brand") to
  360. // unconditionally include in API requests. By default, fields with
  361. // empty values are omitted from API requests. However, any non-pointer,
  362. // non-interface field appearing in ForceSendFields will be sent to the
  363. // server regardless of whether the field is empty or not. This may be
  364. // used to include empty fields in Patch requests.
  365. ForceSendFields []string `json:"-"`
  366. }
  367. func (s *OrderLineItemProduct) MarshalJSON() ([]byte, error) {
  368. type noMethod OrderLineItemProduct
  369. raw := noMethod(*s)
  370. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  371. }
  372. type OrderLineItemProductVariantAttribute struct {
  373. // Dimension: The dimension of the variant.
  374. Dimension string `json:"dimension,omitempty"`
  375. // Value: The value for the dimension.
  376. Value string `json:"value,omitempty"`
  377. // ForceSendFields is a list of field names (e.g. "Dimension") to
  378. // unconditionally include in API requests. By default, fields with
  379. // empty values are omitted from API requests. However, any non-pointer,
  380. // non-interface field appearing in ForceSendFields will be sent to the
  381. // server regardless of whether the field is empty or not. This may be
  382. // used to include empty fields in Patch requests.
  383. ForceSendFields []string `json:"-"`
  384. }
  385. func (s *OrderLineItemProductVariantAttribute) MarshalJSON() ([]byte, error) {
  386. type noMethod OrderLineItemProductVariantAttribute
  387. raw := noMethod(*s)
  388. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  389. }
  390. type OrderLineItemReturnInfo struct {
  391. // DaysToReturn: How many days later the item can be returned.
  392. DaysToReturn int64 `json:"daysToReturn,omitempty"`
  393. // IsReturnable: Whether the item is returnable.
  394. IsReturnable bool `json:"isReturnable,omitempty"`
  395. // PolicyUrl: URL of the item return policy.
  396. PolicyUrl string `json:"policyUrl,omitempty"`
  397. // ForceSendFields is a list of field names (e.g. "DaysToReturn") to
  398. // unconditionally include in API requests. By default, fields with
  399. // empty values are omitted from API requests. However, any non-pointer,
  400. // non-interface field appearing in ForceSendFields will be sent to the
  401. // server regardless of whether the field is empty or not. This may be
  402. // used to include empty fields in Patch requests.
  403. ForceSendFields []string `json:"-"`
  404. }
  405. func (s *OrderLineItemReturnInfo) MarshalJSON() ([]byte, error) {
  406. type noMethod OrderLineItemReturnInfo
  407. raw := noMethod(*s)
  408. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  409. }
  410. type OrderLineItemShippingDetails struct {
  411. // DeliverByDate: The delivery by date, in ISO 8601 format.
  412. DeliverByDate string `json:"deliverByDate,omitempty"`
  413. // Method: Details of the shipping method.
  414. Method *OrderLineItemShippingDetailsMethod `json:"method,omitempty"`
  415. // ShipByDate: The ship by date, in ISO 8601 format.
  416. ShipByDate string `json:"shipByDate,omitempty"`
  417. // ForceSendFields is a list of field names (e.g. "DeliverByDate") to
  418. // unconditionally include in API requests. By default, fields with
  419. // empty values are omitted from API requests. However, any non-pointer,
  420. // non-interface field appearing in ForceSendFields will be sent to the
  421. // server regardless of whether the field is empty or not. This may be
  422. // used to include empty fields in Patch requests.
  423. ForceSendFields []string `json:"-"`
  424. }
  425. func (s *OrderLineItemShippingDetails) MarshalJSON() ([]byte, error) {
  426. type noMethod OrderLineItemShippingDetails
  427. raw := noMethod(*s)
  428. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  429. }
  430. type OrderLineItemShippingDetailsMethod struct {
  431. // Carrier: The carrier for the shipping. Optional.
  432. Carrier string `json:"carrier,omitempty"`
  433. // MaxDaysInTransit: Maximum transit time.
  434. MaxDaysInTransit int64 `json:"maxDaysInTransit,omitempty"`
  435. // MethodName: The name of the shipping method.
  436. MethodName string `json:"methodName,omitempty"`
  437. // MinDaysInTransit: Minimum transit time.
  438. MinDaysInTransit int64 `json:"minDaysInTransit,omitempty"`
  439. // ForceSendFields is a list of field names (e.g. "Carrier") to
  440. // unconditionally include in API requests. By default, fields with
  441. // empty values are omitted from API requests. However, any non-pointer,
  442. // non-interface field appearing in ForceSendFields will be sent to the
  443. // server regardless of whether the field is empty or not. This may be
  444. // used to include empty fields in Patch requests.
  445. ForceSendFields []string `json:"-"`
  446. }
  447. func (s *OrderLineItemShippingDetailsMethod) MarshalJSON() ([]byte, error) {
  448. type noMethod OrderLineItemShippingDetailsMethod
  449. raw := noMethod(*s)
  450. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  451. }
  452. type OrderPaymentMethod struct {
  453. // BillingAddress: The billing address.
  454. BillingAddress *OrderAddress `json:"billingAddress,omitempty"`
  455. // ExpirationMonth: The card expiration month (January = 1, February = 2
  456. // etc.).
  457. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  458. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  459. ExpirationYear int64 `json:"expirationYear,omitempty"`
  460. // LastFourDigits: The last four digits of the card number.
  461. LastFourDigits string `json:"lastFourDigits,omitempty"`
  462. // PhoneNumber: The billing phone number.
  463. PhoneNumber string `json:"phoneNumber,omitempty"`
  464. // Type: The type of instrument (VISA, Mastercard, etc).
  465. Type string `json:"type,omitempty"`
  466. // ForceSendFields is a list of field names (e.g. "BillingAddress") to
  467. // unconditionally include in API requests. By default, fields with
  468. // empty values are omitted from API requests. However, any non-pointer,
  469. // non-interface field appearing in ForceSendFields will be sent to the
  470. // server regardless of whether the field is empty or not. This may be
  471. // used to include empty fields in Patch requests.
  472. ForceSendFields []string `json:"-"`
  473. }
  474. func (s *OrderPaymentMethod) MarshalJSON() ([]byte, error) {
  475. type noMethod OrderPaymentMethod
  476. raw := noMethod(*s)
  477. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  478. }
  479. type OrderRefund struct {
  480. // Actor: The actor that created the refund.
  481. Actor string `json:"actor,omitempty"`
  482. // Amount: The amount that is refunded.
  483. Amount *Price `json:"amount,omitempty"`
  484. // CreationDate: Date on which the item has been created, in ISO 8601
  485. // format.
  486. CreationDate string `json:"creationDate,omitempty"`
  487. // Reason: The reason for the refund.
  488. Reason string `json:"reason,omitempty"`
  489. // ReasonText: The explanation of the reason.
  490. ReasonText string `json:"reasonText,omitempty"`
  491. // ForceSendFields is a list of field names (e.g. "Actor") to
  492. // unconditionally include in API requests. By default, fields with
  493. // empty values are omitted from API requests. However, any non-pointer,
  494. // non-interface field appearing in ForceSendFields will be sent to the
  495. // server regardless of whether the field is empty or not. This may be
  496. // used to include empty fields in Patch requests.
  497. ForceSendFields []string `json:"-"`
  498. }
  499. func (s *OrderRefund) MarshalJSON() ([]byte, error) {
  500. type noMethod OrderRefund
  501. raw := noMethod(*s)
  502. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  503. }
  504. type OrderReturn struct {
  505. // Actor: The actor that created the refund.
  506. Actor string `json:"actor,omitempty"`
  507. // CreationDate: Date on which the item has been created, in ISO 8601
  508. // format.
  509. CreationDate string `json:"creationDate,omitempty"`
  510. // Quantity: Quantity that is returned.
  511. Quantity int64 `json:"quantity,omitempty"`
  512. // Reason: The reason for the return.
  513. Reason string `json:"reason,omitempty"`
  514. // ReasonText: The explanation of the reason.
  515. ReasonText string `json:"reasonText,omitempty"`
  516. // ForceSendFields is a list of field names (e.g. "Actor") to
  517. // unconditionally include in API requests. By default, fields with
  518. // empty values are omitted from API requests. However, any non-pointer,
  519. // non-interface field appearing in ForceSendFields will be sent to the
  520. // server regardless of whether the field is empty or not. This may be
  521. // used to include empty fields in Patch requests.
  522. ForceSendFields []string `json:"-"`
  523. }
  524. func (s *OrderReturn) MarshalJSON() ([]byte, error) {
  525. type noMethod OrderReturn
  526. raw := noMethod(*s)
  527. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  528. }
  529. type OrderShipment struct {
  530. // Carrier: The carrier handling the shipment.
  531. Carrier string `json:"carrier,omitempty"`
  532. // CreationDate: Date on which the shipment has been created, in ISO
  533. // 8601 format.
  534. CreationDate string `json:"creationDate,omitempty"`
  535. // DeliveryDate: Date on which the shipment has been delivered, in ISO
  536. // 8601 format. Present only if status is delievered
  537. DeliveryDate string `json:"deliveryDate,omitempty"`
  538. // Id: The id of the shipment.
  539. Id string `json:"id,omitempty"`
  540. // LineItems: The line items that are shipped.
  541. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  542. // Status: The status of the shipment.
  543. Status string `json:"status,omitempty"`
  544. // TrackingId: The tracking id for the shipment.
  545. TrackingId string `json:"trackingId,omitempty"`
  546. // ForceSendFields is a list of field names (e.g. "Carrier") to
  547. // unconditionally include in API requests. By default, fields with
  548. // empty values are omitted from API requests. However, any non-pointer,
  549. // non-interface field appearing in ForceSendFields will be sent to the
  550. // server regardless of whether the field is empty or not. This may be
  551. // used to include empty fields in Patch requests.
  552. ForceSendFields []string `json:"-"`
  553. }
  554. func (s *OrderShipment) MarshalJSON() ([]byte, error) {
  555. type noMethod OrderShipment
  556. raw := noMethod(*s)
  557. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  558. }
  559. type OrderShipmentLineItemShipment struct {
  560. // LineItemId: The id of the line item that is shipped.
  561. LineItemId string `json:"lineItemId,omitempty"`
  562. // Quantity: The quantity that is shipped.
  563. Quantity int64 `json:"quantity,omitempty"`
  564. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  565. // unconditionally include in API requests. By default, fields with
  566. // empty values are omitted from API requests. However, any non-pointer,
  567. // non-interface field appearing in ForceSendFields will be sent to the
  568. // server regardless of whether the field is empty or not. This may be
  569. // used to include empty fields in Patch requests.
  570. ForceSendFields []string `json:"-"`
  571. }
  572. func (s *OrderShipmentLineItemShipment) MarshalJSON() ([]byte, error) {
  573. type noMethod OrderShipmentLineItemShipment
  574. raw := noMethod(*s)
  575. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  576. }
  577. type OrdersAcknowledgeRequest struct {
  578. // OperationId: The ID of the operation. Unique across all operations
  579. // for a given order.
  580. OperationId string `json:"operationId,omitempty"`
  581. // ForceSendFields is a list of field names (e.g. "OperationId") to
  582. // unconditionally include in API requests. By default, fields with
  583. // empty values are omitted from API requests. However, any non-pointer,
  584. // non-interface field appearing in ForceSendFields will be sent to the
  585. // server regardless of whether the field is empty or not. This may be
  586. // used to include empty fields in Patch requests.
  587. ForceSendFields []string `json:"-"`
  588. }
  589. func (s *OrdersAcknowledgeRequest) MarshalJSON() ([]byte, error) {
  590. type noMethod OrdersAcknowledgeRequest
  591. raw := noMethod(*s)
  592. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  593. }
  594. type OrdersAcknowledgeResponse struct {
  595. // ExecutionStatus: The status of the execution.
  596. ExecutionStatus string `json:"executionStatus,omitempty"`
  597. // Kind: Identifies what kind of resource this is. Value: the fixed
  598. // string "content#ordersAcknowledgeResponse".
  599. Kind string `json:"kind,omitempty"`
  600. // ServerResponse contains the HTTP response code and headers from the
  601. // server.
  602. googleapi.ServerResponse `json:"-"`
  603. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  604. // unconditionally include in API requests. By default, fields with
  605. // empty values are omitted from API requests. However, any non-pointer,
  606. // non-interface field appearing in ForceSendFields will be sent to the
  607. // server regardless of whether the field is empty or not. This may be
  608. // used to include empty fields in Patch requests.
  609. ForceSendFields []string `json:"-"`
  610. }
  611. func (s *OrdersAcknowledgeResponse) MarshalJSON() ([]byte, error) {
  612. type noMethod OrdersAcknowledgeResponse
  613. raw := noMethod(*s)
  614. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  615. }
  616. type OrdersAdvanceTestOrderResponse struct {
  617. // Kind: Identifies what kind of resource this is. Value: the fixed
  618. // string "content#ordersAdvanceTestOrderResponse".
  619. Kind string `json:"kind,omitempty"`
  620. // ServerResponse contains the HTTP response code and headers from the
  621. // server.
  622. googleapi.ServerResponse `json:"-"`
  623. // ForceSendFields is a list of field names (e.g. "Kind") to
  624. // unconditionally include in API requests. By default, fields with
  625. // empty values are omitted from API requests. However, any non-pointer,
  626. // non-interface field appearing in ForceSendFields will be sent to the
  627. // server regardless of whether the field is empty or not. This may be
  628. // used to include empty fields in Patch requests.
  629. ForceSendFields []string `json:"-"`
  630. }
  631. func (s *OrdersAdvanceTestOrderResponse) MarshalJSON() ([]byte, error) {
  632. type noMethod OrdersAdvanceTestOrderResponse
  633. raw := noMethod(*s)
  634. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  635. }
  636. type OrdersCancelLineItemRequest struct {
  637. // Amount: Amount to refund for the cancelation. Optional. If not set,
  638. // Google will calculate the default based on the price and tax of the
  639. // items involved. The amount must not be larger than the net amount
  640. // left on the order.
  641. Amount *Price `json:"amount,omitempty"`
  642. // LineItemId: The ID of the line item to cancel.
  643. LineItemId string `json:"lineItemId,omitempty"`
  644. // OperationId: The ID of the operation. Unique across all operations
  645. // for a given order.
  646. OperationId string `json:"operationId,omitempty"`
  647. // Quantity: The quantity to cancel.
  648. Quantity int64 `json:"quantity,omitempty"`
  649. // Reason: The reason for the cancellation.
  650. Reason string `json:"reason,omitempty"`
  651. // ReasonText: The explanation of the reason.
  652. ReasonText string `json:"reasonText,omitempty"`
  653. // ForceSendFields is a list of field names (e.g. "Amount") to
  654. // unconditionally include in API requests. By default, fields with
  655. // empty values are omitted from API requests. However, any non-pointer,
  656. // non-interface field appearing in ForceSendFields will be sent to the
  657. // server regardless of whether the field is empty or not. This may be
  658. // used to include empty fields in Patch requests.
  659. ForceSendFields []string `json:"-"`
  660. }
  661. func (s *OrdersCancelLineItemRequest) MarshalJSON() ([]byte, error) {
  662. type noMethod OrdersCancelLineItemRequest
  663. raw := noMethod(*s)
  664. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  665. }
  666. type OrdersCancelLineItemResponse struct {
  667. // ExecutionStatus: The status of the execution.
  668. ExecutionStatus string `json:"executionStatus,omitempty"`
  669. // Kind: Identifies what kind of resource this is. Value: the fixed
  670. // string "content#ordersCancelLineItemResponse".
  671. Kind string `json:"kind,omitempty"`
  672. // ServerResponse contains the HTTP response code and headers from the
  673. // server.
  674. googleapi.ServerResponse `json:"-"`
  675. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  676. // unconditionally include in API requests. By default, fields with
  677. // empty values are omitted from API requests. However, any non-pointer,
  678. // non-interface field appearing in ForceSendFields will be sent to the
  679. // server regardless of whether the field is empty or not. This may be
  680. // used to include empty fields in Patch requests.
  681. ForceSendFields []string `json:"-"`
  682. }
  683. func (s *OrdersCancelLineItemResponse) MarshalJSON() ([]byte, error) {
  684. type noMethod OrdersCancelLineItemResponse
  685. raw := noMethod(*s)
  686. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  687. }
  688. type OrdersCancelRequest struct {
  689. // OperationId: The ID of the operation. Unique across all operations
  690. // for a given order.
  691. OperationId string `json:"operationId,omitempty"`
  692. // Reason: The reason for the cancellation.
  693. Reason string `json:"reason,omitempty"`
  694. // ReasonText: The explanation of the reason.
  695. ReasonText string `json:"reasonText,omitempty"`
  696. // ForceSendFields is a list of field names (e.g. "OperationId") to
  697. // unconditionally include in API requests. By default, fields with
  698. // empty values are omitted from API requests. However, any non-pointer,
  699. // non-interface field appearing in ForceSendFields will be sent to the
  700. // server regardless of whether the field is empty or not. This may be
  701. // used to include empty fields in Patch requests.
  702. ForceSendFields []string `json:"-"`
  703. }
  704. func (s *OrdersCancelRequest) MarshalJSON() ([]byte, error) {
  705. type noMethod OrdersCancelRequest
  706. raw := noMethod(*s)
  707. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  708. }
  709. type OrdersCancelResponse struct {
  710. // ExecutionStatus: The status of the execution.
  711. ExecutionStatus string `json:"executionStatus,omitempty"`
  712. // Kind: Identifies what kind of resource this is. Value: the fixed
  713. // string "content#ordersCancelResponse".
  714. Kind string `json:"kind,omitempty"`
  715. // ServerResponse contains the HTTP response code and headers from the
  716. // server.
  717. googleapi.ServerResponse `json:"-"`
  718. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  719. // unconditionally include in API requests. By default, fields with
  720. // empty values are omitted from API requests. However, any non-pointer,
  721. // non-interface field appearing in ForceSendFields will be sent to the
  722. // server regardless of whether the field is empty or not. This may be
  723. // used to include empty fields in Patch requests.
  724. ForceSendFields []string `json:"-"`
  725. }
  726. func (s *OrdersCancelResponse) MarshalJSON() ([]byte, error) {
  727. type noMethod OrdersCancelResponse
  728. raw := noMethod(*s)
  729. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  730. }
  731. type OrdersCreateTestOrderRequest struct {
  732. // TemplateName: The test order template to use. Specify as an
  733. // alternative to testOrder as a shortcut for retrieving a template and
  734. // then creating an order using that template.
  735. TemplateName string `json:"templateName,omitempty"`
  736. // TestOrder: The test order to create.
  737. TestOrder *TestOrder `json:"testOrder,omitempty"`
  738. // ForceSendFields is a list of field names (e.g. "TemplateName") to
  739. // unconditionally include in API requests. By default, fields with
  740. // empty values are omitted from API requests. However, any non-pointer,
  741. // non-interface field appearing in ForceSendFields will be sent to the
  742. // server regardless of whether the field is empty or not. This may be
  743. // used to include empty fields in Patch requests.
  744. ForceSendFields []string `json:"-"`
  745. }
  746. func (s *OrdersCreateTestOrderRequest) MarshalJSON() ([]byte, error) {
  747. type noMethod OrdersCreateTestOrderRequest
  748. raw := noMethod(*s)
  749. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  750. }
  751. type OrdersCreateTestOrderResponse struct {
  752. // Kind: Identifies what kind of resource this is. Value: the fixed
  753. // string "content#ordersCreateTestOrderResponse".
  754. Kind string `json:"kind,omitempty"`
  755. // OrderId: The ID of the newly created test order.
  756. OrderId string `json:"orderId,omitempty"`
  757. // ServerResponse contains the HTTP response code and headers from the
  758. // server.
  759. googleapi.ServerResponse `json:"-"`
  760. // ForceSendFields is a list of field names (e.g. "Kind") to
  761. // unconditionally include in API requests. By default, fields with
  762. // empty values are omitted from API requests. However, any non-pointer,
  763. // non-interface field appearing in ForceSendFields will be sent to the
  764. // server regardless of whether the field is empty or not. This may be
  765. // used to include empty fields in Patch requests.
  766. ForceSendFields []string `json:"-"`
  767. }
  768. func (s *OrdersCreateTestOrderResponse) MarshalJSON() ([]byte, error) {
  769. type noMethod OrdersCreateTestOrderResponse
  770. raw := noMethod(*s)
  771. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  772. }
  773. type OrdersCustomBatchRequest struct {
  774. // Entries: The request entries to be processed in the batch.
  775. Entries []*OrdersCustomBatchRequestEntry `json:"entries,omitempty"`
  776. // ForceSendFields is a list of field names (e.g. "Entries") to
  777. // unconditionally include in API requests. By default, fields with
  778. // empty values are omitted from API requests. However, any non-pointer,
  779. // non-interface field appearing in ForceSendFields will be sent to the
  780. // server regardless of whether the field is empty or not. This may be
  781. // used to include empty fields in Patch requests.
  782. ForceSendFields []string `json:"-"`
  783. }
  784. func (s *OrdersCustomBatchRequest) MarshalJSON() ([]byte, error) {
  785. type noMethod OrdersCustomBatchRequest
  786. raw := noMethod(*s)
  787. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  788. }
  789. type OrdersCustomBatchRequestEntry struct {
  790. // BatchId: An entry ID, unique within the batch request.
  791. BatchId int64 `json:"batchId,omitempty"`
  792. // Cancel: Required for cancel method.
  793. Cancel *OrdersCustomBatchRequestEntryCancel `json:"cancel,omitempty"`
  794. // CancelLineItem: Required for cancelLineItem method.
  795. CancelLineItem *OrdersCustomBatchRequestEntryCancelLineItem `json:"cancelLineItem,omitempty"`
  796. // MerchantId: The ID of the managing account.
  797. MerchantId uint64 `json:"merchantId,omitempty,string"`
  798. // MerchantOrderId: The merchant order id. Required for
  799. // updateMerchantOrderId and getByMerchantOrderId methods.
  800. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  801. // Method: The method to apply.
  802. Method string `json:"method,omitempty"`
  803. // OperationId: The ID of the operation. Unique across all operations
  804. // for a given order. Required for all methods beside get and
  805. // getByMerchantOrderId.
  806. OperationId string `json:"operationId,omitempty"`
  807. // OrderId: The ID of the order. Required for all methods beside
  808. // getByMerchantOrderId.
  809. OrderId string `json:"orderId,omitempty"`
  810. // Refund: Required for refund method.
  811. Refund *OrdersCustomBatchRequestEntryRefund `json:"refund,omitempty"`
  812. // ReturnLineItem: Required for returnLineItem method.
  813. ReturnLineItem *OrdersCustomBatchRequestEntryReturnLineItem `json:"returnLineItem,omitempty"`
  814. // ShipLineItems: Required for shipLineItems method.
  815. ShipLineItems *OrdersCustomBatchRequestEntryShipLineItems `json:"shipLineItems,omitempty"`
  816. // UpdateShipment: Required for updateShipment method.
  817. UpdateShipment *OrdersCustomBatchRequestEntryUpdateShipment `json:"updateShipment,omitempty"`
  818. // ForceSendFields is a list of field names (e.g. "BatchId") to
  819. // unconditionally include in API requests. By default, fields with
  820. // empty values are omitted from API requests. However, any non-pointer,
  821. // non-interface field appearing in ForceSendFields will be sent to the
  822. // server regardless of whether the field is empty or not. This may be
  823. // used to include empty fields in Patch requests.
  824. ForceSendFields []string `json:"-"`
  825. }
  826. func (s *OrdersCustomBatchRequestEntry) MarshalJSON() ([]byte, error) {
  827. type noMethod OrdersCustomBatchRequestEntry
  828. raw := noMethod(*s)
  829. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  830. }
  831. type OrdersCustomBatchRequestEntryCancel struct {
  832. // Reason: The reason for the cancellation.
  833. Reason string `json:"reason,omitempty"`
  834. // ReasonText: The explanation of the reason.
  835. ReasonText string `json:"reasonText,omitempty"`
  836. // ForceSendFields is a list of field names (e.g. "Reason") to
  837. // unconditionally include in API requests. By default, fields with
  838. // empty values are omitted from API requests. However, any non-pointer,
  839. // non-interface field appearing in ForceSendFields will be sent to the
  840. // server regardless of whether the field is empty or not. This may be
  841. // used to include empty fields in Patch requests.
  842. ForceSendFields []string `json:"-"`
  843. }
  844. func (s *OrdersCustomBatchRequestEntryCancel) MarshalJSON() ([]byte, error) {
  845. type noMethod OrdersCustomBatchRequestEntryCancel
  846. raw := noMethod(*s)
  847. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  848. }
  849. type OrdersCustomBatchRequestEntryCancelLineItem struct {
  850. // Amount: Amount to refund for the cancelation. Optional. If not set,
  851. // Google will calculate the default based on the price and tax of the
  852. // items involved. The amount must not be larger than the net amount
  853. // left on the order.
  854. Amount *Price `json:"amount,omitempty"`
  855. // LineItemId: The ID of the line item to cancel.
  856. LineItemId string `json:"lineItemId,omitempty"`
  857. // Quantity: The quantity to cancel.
  858. Quantity int64 `json:"quantity,omitempty"`
  859. // Reason: The reason for the cancellation.
  860. Reason string `json:"reason,omitempty"`
  861. // ReasonText: The explanation of the reason.
  862. ReasonText string `json:"reasonText,omitempty"`
  863. // ForceSendFields is a list of field names (e.g. "Amount") to
  864. // unconditionally include in API requests. By default, fields with
  865. // empty values are omitted from API requests. However, any non-pointer,
  866. // non-interface field appearing in ForceSendFields will be sent to the
  867. // server regardless of whether the field is empty or not. This may be
  868. // used to include empty fields in Patch requests.
  869. ForceSendFields []string `json:"-"`
  870. }
  871. func (s *OrdersCustomBatchRequestEntryCancelLineItem) MarshalJSON() ([]byte, error) {
  872. type noMethod OrdersCustomBatchRequestEntryCancelLineItem
  873. raw := noMethod(*s)
  874. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  875. }
  876. type OrdersCustomBatchRequestEntryRefund struct {
  877. // Amount: The amount that is refunded.
  878. Amount *Price `json:"amount,omitempty"`
  879. // Reason: The reason for the refund.
  880. Reason string `json:"reason,omitempty"`
  881. // ReasonText: The explanation of the reason.
  882. ReasonText string `json:"reasonText,omitempty"`
  883. // ForceSendFields is a list of field names (e.g. "Amount") to
  884. // unconditionally include in API requests. By default, fields with
  885. // empty values are omitted from API requests. However, any non-pointer,
  886. // non-interface field appearing in ForceSendFields will be sent to the
  887. // server regardless of whether the field is empty or not. This may be
  888. // used to include empty fields in Patch requests.
  889. ForceSendFields []string `json:"-"`
  890. }
  891. func (s *OrdersCustomBatchRequestEntryRefund) MarshalJSON() ([]byte, error) {
  892. type noMethod OrdersCustomBatchRequestEntryRefund
  893. raw := noMethod(*s)
  894. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  895. }
  896. type OrdersCustomBatchRequestEntryReturnLineItem struct {
  897. // LineItemId: The ID of the line item to return.
  898. LineItemId string `json:"lineItemId,omitempty"`
  899. // Quantity: The quantity to return.
  900. Quantity int64 `json:"quantity,omitempty"`
  901. // Reason: The reason for the return.
  902. Reason string `json:"reason,omitempty"`
  903. // ReasonText: The explanation of the reason.
  904. ReasonText string `json:"reasonText,omitempty"`
  905. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  906. // unconditionally include in API requests. By default, fields with
  907. // empty values are omitted from API requests. However, any non-pointer,
  908. // non-interface field appearing in ForceSendFields will be sent to the
  909. // server regardless of whether the field is empty or not. This may be
  910. // used to include empty fields in Patch requests.
  911. ForceSendFields []string `json:"-"`
  912. }
  913. func (s *OrdersCustomBatchRequestEntryReturnLineItem) MarshalJSON() ([]byte, error) {
  914. type noMethod OrdersCustomBatchRequestEntryReturnLineItem
  915. raw := noMethod(*s)
  916. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  917. }
  918. type OrdersCustomBatchRequestEntryShipLineItems struct {
  919. // Carrier: The carrier handling the shipment.
  920. Carrier string `json:"carrier,omitempty"`
  921. // LineItems: Line items to ship.
  922. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  923. // ShipmentId: The ID of the shipment.
  924. ShipmentId string `json:"shipmentId,omitempty"`
  925. // TrackingId: The tracking id for the shipment.
  926. TrackingId string `json:"trackingId,omitempty"`
  927. // ForceSendFields is a list of field names (e.g. "Carrier") to
  928. // unconditionally include in API requests. By default, fields with
  929. // empty values are omitted from API requests. However, any non-pointer,
  930. // non-interface field appearing in ForceSendFields will be sent to the
  931. // server regardless of whether the field is empty or not. This may be
  932. // used to include empty fields in Patch requests.
  933. ForceSendFields []string `json:"-"`
  934. }
  935. func (s *OrdersCustomBatchRequestEntryShipLineItems) MarshalJSON() ([]byte, error) {
  936. type noMethod OrdersCustomBatchRequestEntryShipLineItems
  937. raw := noMethod(*s)
  938. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  939. }
  940. type OrdersCustomBatchRequestEntryUpdateShipment struct {
  941. // Carrier: The carrier handling the shipment. Not updated if missing.
  942. Carrier string `json:"carrier,omitempty"`
  943. // ShipmentId: The ID of the shipment.
  944. ShipmentId string `json:"shipmentId,omitempty"`
  945. // Status: New status for the shipment. Not updated if missing.
  946. Status string `json:"status,omitempty"`
  947. // TrackingId: The tracking id for the shipment. Not updated if missing.
  948. TrackingId string `json:"trackingId,omitempty"`
  949. // ForceSendFields is a list of field names (e.g. "Carrier") to
  950. // unconditionally include in API requests. By default, fields with
  951. // empty values are omitted from API requests. However, any non-pointer,
  952. // non-interface field appearing in ForceSendFields will be sent to the
  953. // server regardless of whether the field is empty or not. This may be
  954. // used to include empty fields in Patch requests.
  955. ForceSendFields []string `json:"-"`
  956. }
  957. func (s *OrdersCustomBatchRequestEntryUpdateShipment) MarshalJSON() ([]byte, error) {
  958. type noMethod OrdersCustomBatchRequestEntryUpdateShipment
  959. raw := noMethod(*s)
  960. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  961. }
  962. type OrdersCustomBatchResponse struct {
  963. // Entries: The result of the execution of the batch requests.
  964. Entries []*OrdersCustomBatchResponseEntry `json:"entries,omitempty"`
  965. // Kind: Identifies what kind of resource this is. Value: the fixed
  966. // string "content#ordersCustomBatchResponse".
  967. Kind string `json:"kind,omitempty"`
  968. // ServerResponse contains the HTTP response code and headers from the
  969. // server.
  970. googleapi.ServerResponse `json:"-"`
  971. // ForceSendFields is a list of field names (e.g. "Entries") to
  972. // unconditionally include in API requests. By default, fields with
  973. // empty values are omitted from API requests. However, any non-pointer,
  974. // non-interface field appearing in ForceSendFields will be sent to the
  975. // server regardless of whether the field is empty or not. This may be
  976. // used to include empty fields in Patch requests.
  977. ForceSendFields []string `json:"-"`
  978. }
  979. func (s *OrdersCustomBatchResponse) MarshalJSON() ([]byte, error) {
  980. type noMethod OrdersCustomBatchResponse
  981. raw := noMethod(*s)
  982. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  983. }
  984. type OrdersCustomBatchResponseEntry struct {
  985. // BatchId: The ID of the request entry this entry responds to.
  986. BatchId int64 `json:"batchId,omitempty"`
  987. // Errors: A list of errors defined if and only if the request failed.
  988. Errors *Errors `json:"errors,omitempty"`
  989. // ExecutionStatus: The status of the execution. Only defined if the
  990. // method is not get or getByMerchantOrderId and if the request was
  991. // successful.
  992. ExecutionStatus string `json:"executionStatus,omitempty"`
  993. // Kind: Identifies what kind of resource this is. Value: the fixed
  994. // string "content#ordersCustomBatchResponseEntry".
  995. Kind string `json:"kind,omitempty"`
  996. // Order: The retrieved order. Only defined if the method is get and if
  997. // the request was successful.
  998. Order *Order `json:"order,omitempty"`
  999. // ForceSendFields is a list of field names (e.g. "BatchId") to
  1000. // unconditionally include in API requests. By default, fields with
  1001. // empty values are omitted from API requests. However, any non-pointer,
  1002. // non-interface field appearing in ForceSendFields will be sent to the
  1003. // server regardless of whether the field is empty or not. This may be
  1004. // used to include empty fields in Patch requests.
  1005. ForceSendFields []string `json:"-"`
  1006. }
  1007. func (s *OrdersCustomBatchResponseEntry) MarshalJSON() ([]byte, error) {
  1008. type noMethod OrdersCustomBatchResponseEntry
  1009. raw := noMethod(*s)
  1010. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1011. }
  1012. type OrdersGetByMerchantOrderIdResponse struct {
  1013. // Kind: Identifies what kind of resource this is. Value: the fixed
  1014. // string "content#ordersGetByMerchantOrderIdResponse".
  1015. Kind string `json:"kind,omitempty"`
  1016. // Order: The requested order.
  1017. Order *Order `json:"order,omitempty"`
  1018. // ServerResponse contains the HTTP response code and headers from the
  1019. // server.
  1020. googleapi.ServerResponse `json:"-"`
  1021. // ForceSendFields is a list of field names (e.g. "Kind") to
  1022. // unconditionally include in API requests. By default, fields with
  1023. // empty values are omitted from API requests. However, any non-pointer,
  1024. // non-interface field appearing in ForceSendFields will be sent to the
  1025. // server regardless of whether the field is empty or not. This may be
  1026. // used to include empty fields in Patch requests.
  1027. ForceSendFields []string `json:"-"`
  1028. }
  1029. func (s *OrdersGetByMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  1030. type noMethod OrdersGetByMerchantOrderIdResponse
  1031. raw := noMethod(*s)
  1032. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1033. }
  1034. type OrdersGetTestOrderTemplateResponse struct {
  1035. // Kind: Identifies what kind of resource this is. Value: the fixed
  1036. // string "content#ordersGetTestOrderTemplateResponse".
  1037. Kind string `json:"kind,omitempty"`
  1038. // Template: The requested test order template.
  1039. Template *TestOrder `json:"template,omitempty"`
  1040. // ServerResponse contains the HTTP response code and headers from the
  1041. // server.
  1042. googleapi.ServerResponse `json:"-"`
  1043. // ForceSendFields is a list of field names (e.g. "Kind") to
  1044. // unconditionally include in API requests. By default, fields with
  1045. // empty values are omitted from API requests. However, any non-pointer,
  1046. // non-interface field appearing in ForceSendFields will be sent to the
  1047. // server regardless of whether the field is empty or not. This may be
  1048. // used to include empty fields in Patch requests.
  1049. ForceSendFields []string `json:"-"`
  1050. }
  1051. func (s *OrdersGetTestOrderTemplateResponse) MarshalJSON() ([]byte, error) {
  1052. type noMethod OrdersGetTestOrderTemplateResponse
  1053. raw := noMethod(*s)
  1054. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1055. }
  1056. type OrdersListResponse struct {
  1057. // Kind: Identifies what kind of resource this is. Value: the fixed
  1058. // string "content#ordersListResponse".
  1059. Kind string `json:"kind,omitempty"`
  1060. // NextPageToken: The token for the retrieval of the next page of
  1061. // orders.
  1062. NextPageToken string `json:"nextPageToken,omitempty"`
  1063. Resources []*Order `json:"resources,omitempty"`
  1064. // ServerResponse contains the HTTP response code and headers from the
  1065. // server.
  1066. googleapi.ServerResponse `json:"-"`
  1067. // ForceSendFields is a list of field names (e.g. "Kind") to
  1068. // unconditionally include in API requests. By default, fields with
  1069. // empty values are omitted from API requests. However, any non-pointer,
  1070. // non-interface field appearing in ForceSendFields will be sent to the
  1071. // server regardless of whether the field is empty or not. This may be
  1072. // used to include empty fields in Patch requests.
  1073. ForceSendFields []string `json:"-"`
  1074. }
  1075. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  1076. type noMethod OrdersListResponse
  1077. raw := noMethod(*s)
  1078. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1079. }
  1080. type OrdersRefundRequest struct {
  1081. // Amount: The amount that is refunded.
  1082. Amount *Price `json:"amount,omitempty"`
  1083. // OperationId: The ID of the operation. Unique across all operations
  1084. // for a given order.
  1085. OperationId string `json:"operationId,omitempty"`
  1086. // Reason: The reason for the refund.
  1087. Reason string `json:"reason,omitempty"`
  1088. // ReasonText: The explanation of the reason.
  1089. ReasonText string `json:"reasonText,omitempty"`
  1090. // ForceSendFields is a list of field names (e.g. "Amount") to
  1091. // unconditionally include in API requests. By default, fields with
  1092. // empty values are omitted from API requests. However, any non-pointer,
  1093. // non-interface field appearing in ForceSendFields will be sent to the
  1094. // server regardless of whether the field is empty or not. This may be
  1095. // used to include empty fields in Patch requests.
  1096. ForceSendFields []string `json:"-"`
  1097. }
  1098. func (s *OrdersRefundRequest) MarshalJSON() ([]byte, error) {
  1099. type noMethod OrdersRefundRequest
  1100. raw := noMethod(*s)
  1101. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1102. }
  1103. type OrdersRefundResponse struct {
  1104. // ExecutionStatus: The status of the execution.
  1105. ExecutionStatus string `json:"executionStatus,omitempty"`
  1106. // Kind: Identifies what kind of resource this is. Value: the fixed
  1107. // string "content#ordersRefundResponse".
  1108. Kind string `json:"kind,omitempty"`
  1109. // ServerResponse contains the HTTP response code and headers from the
  1110. // server.
  1111. googleapi.ServerResponse `json:"-"`
  1112. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1113. // unconditionally include in API requests. By default, fields with
  1114. // empty values are omitted from API requests. However, any non-pointer,
  1115. // non-interface field appearing in ForceSendFields will be sent to the
  1116. // server regardless of whether the field is empty or not. This may be
  1117. // used to include empty fields in Patch requests.
  1118. ForceSendFields []string `json:"-"`
  1119. }
  1120. func (s *OrdersRefundResponse) MarshalJSON() ([]byte, error) {
  1121. type noMethod OrdersRefundResponse
  1122. raw := noMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1124. }
  1125. type OrdersReturnLineItemRequest struct {
  1126. // LineItemId: The ID of the line item to return.
  1127. LineItemId string `json:"lineItemId,omitempty"`
  1128. // OperationId: The ID of the operation. Unique across all operations
  1129. // for a given order.
  1130. OperationId string `json:"operationId,omitempty"`
  1131. // Quantity: The quantity to return.
  1132. Quantity int64 `json:"quantity,omitempty"`
  1133. // Reason: The reason for the return.
  1134. Reason string `json:"reason,omitempty"`
  1135. // ReasonText: The explanation of the reason.
  1136. ReasonText string `json:"reasonText,omitempty"`
  1137. // ForceSendFields is a list of field names (e.g. "LineItemId") to
  1138. // unconditionally include in API requests. By default, fields with
  1139. // empty values are omitted from API requests. However, any non-pointer,
  1140. // non-interface field appearing in ForceSendFields will be sent to the
  1141. // server regardless of whether the field is empty or not. This may be
  1142. // used to include empty fields in Patch requests.
  1143. ForceSendFields []string `json:"-"`
  1144. }
  1145. func (s *OrdersReturnLineItemRequest) MarshalJSON() ([]byte, error) {
  1146. type noMethod OrdersReturnLineItemRequest
  1147. raw := noMethod(*s)
  1148. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1149. }
  1150. type OrdersReturnLineItemResponse struct {
  1151. // ExecutionStatus: The status of the execution.
  1152. ExecutionStatus string `json:"executionStatus,omitempty"`
  1153. // Kind: Identifies what kind of resource this is. Value: the fixed
  1154. // string "content#ordersReturnLineItemResponse".
  1155. Kind string `json:"kind,omitempty"`
  1156. // ServerResponse contains the HTTP response code and headers from the
  1157. // server.
  1158. googleapi.ServerResponse `json:"-"`
  1159. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1160. // unconditionally include in API requests. By default, fields with
  1161. // empty values are omitted from API requests. However, any non-pointer,
  1162. // non-interface field appearing in ForceSendFields will be sent to the
  1163. // server regardless of whether the field is empty or not. This may be
  1164. // used to include empty fields in Patch requests.
  1165. ForceSendFields []string `json:"-"`
  1166. }
  1167. func (s *OrdersReturnLineItemResponse) MarshalJSON() ([]byte, error) {
  1168. type noMethod OrdersReturnLineItemResponse
  1169. raw := noMethod(*s)
  1170. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1171. }
  1172. type OrdersShipLineItemsRequest struct {
  1173. // Carrier: The carrier handling the shipment.
  1174. Carrier string `json:"carrier,omitempty"`
  1175. // LineItems: Line items to ship.
  1176. LineItems []*OrderShipmentLineItemShipment `json:"lineItems,omitempty"`
  1177. // OperationId: The ID of the operation. Unique across all operations
  1178. // for a given order.
  1179. OperationId string `json:"operationId,omitempty"`
  1180. // ShipmentId: The ID of the shipment.
  1181. ShipmentId string `json:"shipmentId,omitempty"`
  1182. // TrackingId: The tracking id for the shipment.
  1183. TrackingId string `json:"trackingId,omitempty"`
  1184. // ForceSendFields is a list of field names (e.g. "Carrier") to
  1185. // unconditionally include in API requests. By default, fields with
  1186. // empty values are omitted from API requests. However, any non-pointer,
  1187. // non-interface field appearing in ForceSendFields will be sent to the
  1188. // server regardless of whether the field is empty or not. This may be
  1189. // used to include empty fields in Patch requests.
  1190. ForceSendFields []string `json:"-"`
  1191. }
  1192. func (s *OrdersShipLineItemsRequest) MarshalJSON() ([]byte, error) {
  1193. type noMethod OrdersShipLineItemsRequest
  1194. raw := noMethod(*s)
  1195. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1196. }
  1197. type OrdersShipLineItemsResponse struct {
  1198. // ExecutionStatus: The status of the execution.
  1199. ExecutionStatus string `json:"executionStatus,omitempty"`
  1200. // Kind: Identifies what kind of resource this is. Value: the fixed
  1201. // string "content#ordersShipLineItemsResponse".
  1202. Kind string `json:"kind,omitempty"`
  1203. // ServerResponse contains the HTTP response code and headers from the
  1204. // server.
  1205. googleapi.ServerResponse `json:"-"`
  1206. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1207. // unconditionally include in API requests. By default, fields with
  1208. // empty values are omitted from API requests. However, any non-pointer,
  1209. // non-interface field appearing in ForceSendFields will be sent to the
  1210. // server regardless of whether the field is empty or not. This may be
  1211. // used to include empty fields in Patch requests.
  1212. ForceSendFields []string `json:"-"`
  1213. }
  1214. func (s *OrdersShipLineItemsResponse) MarshalJSON() ([]byte, error) {
  1215. type noMethod OrdersShipLineItemsResponse
  1216. raw := noMethod(*s)
  1217. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1218. }
  1219. type OrdersUpdateMerchantOrderIdRequest struct {
  1220. // MerchantOrderId: The merchant order id to be assigned to the order.
  1221. // Must be unique per merchant.
  1222. MerchantOrderId string `json:"merchantOrderId,omitempty"`
  1223. // OperationId: The ID of the operation. Unique across all operations
  1224. // for a given order.
  1225. OperationId string `json:"operationId,omitempty"`
  1226. // ForceSendFields is a list of field names (e.g. "MerchantOrderId") to
  1227. // unconditionally include in API requests. By default, fields with
  1228. // empty values are omitted from API requests. However, any non-pointer,
  1229. // non-interface field appearing in ForceSendFields will be sent to the
  1230. // server regardless of whether the field is empty or not. This may be
  1231. // used to include empty fields in Patch requests.
  1232. ForceSendFields []string `json:"-"`
  1233. }
  1234. func (s *OrdersUpdateMerchantOrderIdRequest) MarshalJSON() ([]byte, error) {
  1235. type noMethod OrdersUpdateMerchantOrderIdRequest
  1236. raw := noMethod(*s)
  1237. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1238. }
  1239. type OrdersUpdateMerchantOrderIdResponse struct {
  1240. // ExecutionStatus: The status of the execution.
  1241. ExecutionStatus string `json:"executionStatus,omitempty"`
  1242. // Kind: Identifies what kind of resource this is. Value: the fixed
  1243. // string "content#ordersUpdateMerchantOrderIdResponse".
  1244. Kind string `json:"kind,omitempty"`
  1245. // ServerResponse contains the HTTP response code and headers from the
  1246. // server.
  1247. googleapi.ServerResponse `json:"-"`
  1248. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1249. // unconditionally include in API requests. By default, fields with
  1250. // empty values are omitted from API requests. However, any non-pointer,
  1251. // non-interface field appearing in ForceSendFields will be sent to the
  1252. // server regardless of whether the field is empty or not. This may be
  1253. // used to include empty fields in Patch requests.
  1254. ForceSendFields []string `json:"-"`
  1255. }
  1256. func (s *OrdersUpdateMerchantOrderIdResponse) MarshalJSON() ([]byte, error) {
  1257. type noMethod OrdersUpdateMerchantOrderIdResponse
  1258. raw := noMethod(*s)
  1259. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1260. }
  1261. type OrdersUpdateShipmentRequest struct {
  1262. // Carrier: The carrier handling the shipment. Not updated if missing.
  1263. Carrier string `json:"carrier,omitempty"`
  1264. // OperationId: The ID of the operation. Unique across all operations
  1265. // for a given order.
  1266. OperationId string `json:"operationId,omitempty"`
  1267. // ShipmentId: The ID of the shipment.
  1268. ShipmentId string `json:"shipmentId,omitempty"`
  1269. // Status: New status for the shipment. Not updated if missing.
  1270. Status string `json:"status,omitempty"`
  1271. // TrackingId: The tracking id for the shipment. Not updated if missing.
  1272. TrackingId string `json:"trackingId,omitempty"`
  1273. // ForceSendFields is a list of field names (e.g. "Carrier") to
  1274. // unconditionally include in API requests. By default, fields with
  1275. // empty values are omitted from API requests. However, any non-pointer,
  1276. // non-interface field appearing in ForceSendFields will be sent to the
  1277. // server regardless of whether the field is empty or not. This may be
  1278. // used to include empty fields in Patch requests.
  1279. ForceSendFields []string `json:"-"`
  1280. }
  1281. func (s *OrdersUpdateShipmentRequest) MarshalJSON() ([]byte, error) {
  1282. type noMethod OrdersUpdateShipmentRequest
  1283. raw := noMethod(*s)
  1284. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1285. }
  1286. type OrdersUpdateShipmentResponse struct {
  1287. // ExecutionStatus: The status of the execution.
  1288. ExecutionStatus string `json:"executionStatus,omitempty"`
  1289. // Kind: Identifies what kind of resource this is. Value: the fixed
  1290. // string "content#ordersUpdateShipmentResponse".
  1291. Kind string `json:"kind,omitempty"`
  1292. // ServerResponse contains the HTTP response code and headers from the
  1293. // server.
  1294. googleapi.ServerResponse `json:"-"`
  1295. // ForceSendFields is a list of field names (e.g. "ExecutionStatus") to
  1296. // unconditionally include in API requests. By default, fields with
  1297. // empty values are omitted from API requests. However, any non-pointer,
  1298. // non-interface field appearing in ForceSendFields will be sent to the
  1299. // server regardless of whether the field is empty or not. This may be
  1300. // used to include empty fields in Patch requests.
  1301. ForceSendFields []string `json:"-"`
  1302. }
  1303. func (s *OrdersUpdateShipmentResponse) MarshalJSON() ([]byte, error) {
  1304. type noMethod OrdersUpdateShipmentResponse
  1305. raw := noMethod(*s)
  1306. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1307. }
  1308. type Price struct {
  1309. // Currency: The currency of the price.
  1310. Currency string `json:"currency,omitempty"`
  1311. // Value: The price represented as a number.
  1312. Value string `json:"value,omitempty"`
  1313. // ForceSendFields is a list of field names (e.g. "Currency") to
  1314. // unconditionally include in API requests. By default, fields with
  1315. // empty values are omitted from API requests. However, any non-pointer,
  1316. // non-interface field appearing in ForceSendFields will be sent to the
  1317. // server regardless of whether the field is empty or not. This may be
  1318. // used to include empty fields in Patch requests.
  1319. ForceSendFields []string `json:"-"`
  1320. }
  1321. func (s *Price) MarshalJSON() ([]byte, error) {
  1322. type noMethod Price
  1323. raw := noMethod(*s)
  1324. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1325. }
  1326. type TestOrder struct {
  1327. // Customer: The details of the customer who placed the order.
  1328. Customer *TestOrderCustomer `json:"customer,omitempty"`
  1329. // Kind: Identifies what kind of resource this is. Value: the fixed
  1330. // string "content#testOrder".
  1331. Kind string `json:"kind,omitempty"`
  1332. // LineItems: Line items that are ordered. At least one line item must
  1333. // be provided.
  1334. LineItems []*TestOrderLineItem `json:"lineItems,omitempty"`
  1335. // PaymentMethod: The details of the payment method.
  1336. PaymentMethod *TestOrderPaymentMethod `json:"paymentMethod,omitempty"`
  1337. // PredefinedDeliveryAddress: Identifier of one of the predefined
  1338. // delivery addresses for the delivery.
  1339. PredefinedDeliveryAddress string `json:"predefinedDeliveryAddress,omitempty"`
  1340. // ShippingCost: The total cost of shipping for all items.
  1341. ShippingCost *Price `json:"shippingCost,omitempty"`
  1342. // ShippingCostTax: The tax for the total shipping cost.
  1343. ShippingCostTax *Price `json:"shippingCostTax,omitempty"`
  1344. // ShippingOption: The requested shipping option.
  1345. ShippingOption string `json:"shippingOption,omitempty"`
  1346. // ForceSendFields is a list of field names (e.g. "Customer") to
  1347. // unconditionally include in API requests. By default, fields with
  1348. // empty values are omitted from API requests. However, any non-pointer,
  1349. // non-interface field appearing in ForceSendFields will be sent to the
  1350. // server regardless of whether the field is empty or not. This may be
  1351. // used to include empty fields in Patch requests.
  1352. ForceSendFields []string `json:"-"`
  1353. }
  1354. func (s *TestOrder) MarshalJSON() ([]byte, error) {
  1355. type noMethod TestOrder
  1356. raw := noMethod(*s)
  1357. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1358. }
  1359. type TestOrderCustomer struct {
  1360. // Email: Email address of the customer.
  1361. Email string `json:"email,omitempty"`
  1362. // ExplicitMarketingPreference: If set, this indicates the user had a
  1363. // choice to opt in or out of providing marketing rights to the
  1364. // merchant. If unset, this indicates the user has already made this
  1365. // choice in a previous purchase, and was thus not shown the marketing
  1366. // right opt in/out checkbox during the Purchases on Google checkout
  1367. // flow. Optional.
  1368. ExplicitMarketingPreference bool `json:"explicitMarketingPreference,omitempty"`
  1369. // FullName: Full name of the customer.
  1370. FullName string `json:"fullName,omitempty"`
  1371. // ForceSendFields is a list of field names (e.g. "Email") to
  1372. // unconditionally include in API requests. By default, fields with
  1373. // empty values are omitted from API requests. However, any non-pointer,
  1374. // non-interface field appearing in ForceSendFields will be sent to the
  1375. // server regardless of whether the field is empty or not. This may be
  1376. // used to include empty fields in Patch requests.
  1377. ForceSendFields []string `json:"-"`
  1378. }
  1379. func (s *TestOrderCustomer) MarshalJSON() ([]byte, error) {
  1380. type noMethod TestOrderCustomer
  1381. raw := noMethod(*s)
  1382. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1383. }
  1384. type TestOrderLineItem struct {
  1385. // Product: Product data from the time of the order placement.
  1386. Product *TestOrderLineItemProduct `json:"product,omitempty"`
  1387. // QuantityOrdered: Number of items ordered.
  1388. QuantityOrdered int64 `json:"quantityOrdered,omitempty"`
  1389. // ReturnInfo: Details of the return policy for the line item.
  1390. ReturnInfo *OrderLineItemReturnInfo `json:"returnInfo,omitempty"`
  1391. // ShippingDetails: Details of the requested shipping for the line item.
  1392. ShippingDetails *OrderLineItemShippingDetails `json:"shippingDetails,omitempty"`
  1393. // UnitTax: Unit tax for the line item.
  1394. UnitTax *Price `json:"unitTax,omitempty"`
  1395. // ForceSendFields is a list of field names (e.g. "Product") to
  1396. // unconditionally include in API requests. By default, fields with
  1397. // empty values are omitted from API requests. However, any non-pointer,
  1398. // non-interface field appearing in ForceSendFields will be sent to the
  1399. // server regardless of whether the field is empty or not. This may be
  1400. // used to include empty fields in Patch requests.
  1401. ForceSendFields []string `json:"-"`
  1402. }
  1403. func (s *TestOrderLineItem) MarshalJSON() ([]byte, error) {
  1404. type noMethod TestOrderLineItem
  1405. raw := noMethod(*s)
  1406. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1407. }
  1408. type TestOrderLineItemProduct struct {
  1409. // Brand: Brand of the item.
  1410. Brand string `json:"brand,omitempty"`
  1411. // Channel: The item's channel.
  1412. Channel string `json:"channel,omitempty"`
  1413. // Condition: Condition or state of the item.
  1414. Condition string `json:"condition,omitempty"`
  1415. // ContentLanguage: The two-letter ISO 639-1 language code for the item.
  1416. ContentLanguage string `json:"contentLanguage,omitempty"`
  1417. // Gtin: Global Trade Item Number (GTIN) of the item. Optional.
  1418. Gtin string `json:"gtin,omitempty"`
  1419. // ImageLink: URL of an image of the item.
  1420. ImageLink string `json:"imageLink,omitempty"`
  1421. // ItemGroupId: Shared identifier for all variants of the same product.
  1422. // Optional.
  1423. ItemGroupId string `json:"itemGroupId,omitempty"`
  1424. // Mpn: Manufacturer Part Number (MPN) of the item. Optional.
  1425. Mpn string `json:"mpn,omitempty"`
  1426. // OfferId: An identifier of the item.
  1427. OfferId string `json:"offerId,omitempty"`
  1428. // Price: The price for the product.
  1429. Price *Price `json:"price,omitempty"`
  1430. // TargetCountry: The CLDR territory code of the target country of the
  1431. // product.
  1432. TargetCountry string `json:"targetCountry,omitempty"`
  1433. // Title: The title of the product.
  1434. Title string `json:"title,omitempty"`
  1435. // VariantAttributes: Variant attributes for the item. Optional.
  1436. VariantAttributes []*OrderLineItemProductVariantAttribute `json:"variantAttributes,omitempty"`
  1437. // ForceSendFields is a list of field names (e.g. "Brand") to
  1438. // unconditionally include in API requests. By default, fields with
  1439. // empty values are omitted from API requests. However, any non-pointer,
  1440. // non-interface field appearing in ForceSendFields will be sent to the
  1441. // server regardless of whether the field is empty or not. This may be
  1442. // used to include empty fields in Patch requests.
  1443. ForceSendFields []string `json:"-"`
  1444. }
  1445. func (s *TestOrderLineItemProduct) MarshalJSON() ([]byte, error) {
  1446. type noMethod TestOrderLineItemProduct
  1447. raw := noMethod(*s)
  1448. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1449. }
  1450. type TestOrderPaymentMethod struct {
  1451. // ExpirationMonth: The card expiration month (January = 1, February = 2
  1452. // etc.).
  1453. ExpirationMonth int64 `json:"expirationMonth,omitempty"`
  1454. // ExpirationYear: The card expiration year (4-digit, e.g. 2015).
  1455. ExpirationYear int64 `json:"expirationYear,omitempty"`
  1456. // LastFourDigits: The last four digits of the card number.
  1457. LastFourDigits string `json:"lastFourDigits,omitempty"`
  1458. // PredefinedBillingAddress: The billing address.
  1459. PredefinedBillingAddress string `json:"predefinedBillingAddress,omitempty"`
  1460. // Type: The type of instrument. Note that real orders might have
  1461. // different values than the four values accepted by createTestOrder.
  1462. Type string `json:"type,omitempty"`
  1463. // ForceSendFields is a list of field names (e.g. "ExpirationMonth") to
  1464. // unconditionally include in API requests. By default, fields with
  1465. // empty values are omitted from API requests. However, any non-pointer,
  1466. // non-interface field appearing in ForceSendFields will be sent to the
  1467. // server regardless of whether the field is empty or not. This may be
  1468. // used to include empty fields in Patch requests.
  1469. ForceSendFields []string `json:"-"`
  1470. }
  1471. func (s *TestOrderPaymentMethod) MarshalJSON() ([]byte, error) {
  1472. type noMethod TestOrderPaymentMethod
  1473. raw := noMethod(*s)
  1474. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  1475. }
  1476. // method id "content.orders.acknowledge":
  1477. type OrdersAcknowledgeCall struct {
  1478. s *Service
  1479. merchantId uint64
  1480. orderId string
  1481. ordersacknowledgerequest *OrdersAcknowledgeRequest
  1482. urlParams_ gensupport.URLParams
  1483. ctx_ context.Context
  1484. }
  1485. // Acknowledge: Marks an order as acknowledged.
  1486. func (r *OrdersService) Acknowledge(merchantId uint64, orderId string, ordersacknowledgerequest *OrdersAcknowledgeRequest) *OrdersAcknowledgeCall {
  1487. c := &OrdersAcknowledgeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1488. c.merchantId = merchantId
  1489. c.orderId = orderId
  1490. c.ordersacknowledgerequest = ordersacknowledgerequest
  1491. return c
  1492. }
  1493. // Fields allows partial responses to be retrieved. See
  1494. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1495. // for more information.
  1496. func (c *OrdersAcknowledgeCall) Fields(s ...googleapi.Field) *OrdersAcknowledgeCall {
  1497. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1498. return c
  1499. }
  1500. // Context sets the context to be used in this call's Do method. Any
  1501. // pending HTTP request will be aborted if the provided context is
  1502. // canceled.
  1503. func (c *OrdersAcknowledgeCall) Context(ctx context.Context) *OrdersAcknowledgeCall {
  1504. c.ctx_ = ctx
  1505. return c
  1506. }
  1507. func (c *OrdersAcknowledgeCall) doRequest(alt string) (*http.Response, error) {
  1508. var body io.Reader = nil
  1509. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersacknowledgerequest)
  1510. if err != nil {
  1511. return nil, err
  1512. }
  1513. ctype := "application/json"
  1514. c.urlParams_.Set("alt", alt)
  1515. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/acknowledge")
  1516. urls += "?" + c.urlParams_.Encode()
  1517. req, _ := http.NewRequest("POST", urls, body)
  1518. googleapi.Expand(req.URL, map[string]string{
  1519. "merchantId": strconv.FormatUint(c.merchantId, 10),
  1520. "orderId": c.orderId,
  1521. })
  1522. req.Header.Set("Content-Type", ctype)
  1523. req.Header.Set("User-Agent", c.s.userAgent())
  1524. if c.ctx_ != nil {
  1525. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1526. }
  1527. return c.s.client.Do(req)
  1528. }
  1529. // Do executes the "content.orders.acknowledge" call.
  1530. // Exactly one of *OrdersAcknowledgeResponse or error will be non-nil.
  1531. // Any non-2xx status code is an error. Response headers are in either
  1532. // *OrdersAcknowledgeResponse.ServerResponse.Header or (if a response
  1533. // was returned at all) in error.(*googleapi.Error).Header. Use
  1534. // googleapi.IsNotModified to check whether the returned error was
  1535. // because http.StatusNotModified was returned.
  1536. func (c *OrdersAcknowledgeCall) Do(opts ...googleapi.CallOption) (*OrdersAcknowledgeResponse, error) {
  1537. gensupport.SetOptions(c.urlParams_, opts...)
  1538. res, err := c.doRequest("json")
  1539. if res != nil && res.StatusCode == http.StatusNotModified {
  1540. if res.Body != nil {
  1541. res.Body.Close()
  1542. }
  1543. return nil, &googleapi.Error{
  1544. Code: res.StatusCode,
  1545. Header: res.Header,
  1546. }
  1547. }
  1548. if err != nil {
  1549. return nil, err
  1550. }
  1551. defer googleapi.CloseBody(res)
  1552. if err := googleapi.CheckResponse(res); err != nil {
  1553. return nil, err
  1554. }
  1555. ret := &OrdersAcknowledgeResponse{
  1556. ServerResponse: googleapi.ServerResponse{
  1557. Header: res.Header,
  1558. HTTPStatusCode: res.StatusCode,
  1559. },
  1560. }
  1561. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1562. return nil, err
  1563. }
  1564. return ret, nil
  1565. // {
  1566. // "description": "Marks an order as acknowledged.",
  1567. // "httpMethod": "POST",
  1568. // "id": "content.orders.acknowledge",
  1569. // "parameterOrder": [
  1570. // "merchantId",
  1571. // "orderId"
  1572. // ],
  1573. // "parameters": {
  1574. // "merchantId": {
  1575. // "description": "The ID of the managing account.",
  1576. // "format": "uint64",
  1577. // "location": "path",
  1578. // "required": true,
  1579. // "type": "string"
  1580. // },
  1581. // "orderId": {
  1582. // "description": "The ID of the order.",
  1583. // "location": "path",
  1584. // "required": true,
  1585. // "type": "string"
  1586. // }
  1587. // },
  1588. // "path": "{merchantId}/orders/{orderId}/acknowledge",
  1589. // "request": {
  1590. // "$ref": "OrdersAcknowledgeRequest"
  1591. // },
  1592. // "response": {
  1593. // "$ref": "OrdersAcknowledgeResponse"
  1594. // },
  1595. // "scopes": [
  1596. // "https://www.googleapis.com/auth/content"
  1597. // ]
  1598. // }
  1599. }
  1600. // method id "content.orders.advancetestorder":
  1601. type OrdersAdvancetestorderCall struct {
  1602. s *Service
  1603. merchantId uint64
  1604. orderId string
  1605. urlParams_ gensupport.URLParams
  1606. ctx_ context.Context
  1607. }
  1608. // Advancetestorder: Sandbox only. Moves a test order from state
  1609. // "inProgress" to state "pendingShipment".
  1610. func (r *OrdersService) Advancetestorder(merchantId uint64, orderId string) *OrdersAdvancetestorderCall {
  1611. c := &OrdersAdvancetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1612. c.merchantId = merchantId
  1613. c.orderId = orderId
  1614. return c
  1615. }
  1616. // Fields allows partial responses to be retrieved. See
  1617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1618. // for more information.
  1619. func (c *OrdersAdvancetestorderCall) Fields(s ...googleapi.Field) *OrdersAdvancetestorderCall {
  1620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1621. return c
  1622. }
  1623. // Context sets the context to be used in this call's Do method. Any
  1624. // pending HTTP request will be aborted if the provided context is
  1625. // canceled.
  1626. func (c *OrdersAdvancetestorderCall) Context(ctx context.Context) *OrdersAdvancetestorderCall {
  1627. c.ctx_ = ctx
  1628. return c
  1629. }
  1630. func (c *OrdersAdvancetestorderCall) doRequest(alt string) (*http.Response, error) {
  1631. var body io.Reader = nil
  1632. c.urlParams_.Set("alt", alt)
  1633. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders/{orderId}/advance")
  1634. urls += "?" + c.urlParams_.Encode()
  1635. req, _ := http.NewRequest("POST", urls, body)
  1636. googleapi.Expand(req.URL, map[string]string{
  1637. "merchantId": strconv.FormatUint(c.merchantId, 10),
  1638. "orderId": c.orderId,
  1639. })
  1640. req.Header.Set("User-Agent", c.s.userAgent())
  1641. if c.ctx_ != nil {
  1642. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1643. }
  1644. return c.s.client.Do(req)
  1645. }
  1646. // Do executes the "content.orders.advancetestorder" call.
  1647. // Exactly one of *OrdersAdvanceTestOrderResponse or error will be
  1648. // non-nil. Any non-2xx status code is an error. Response headers are in
  1649. // either *OrdersAdvanceTestOrderResponse.ServerResponse.Header or (if a
  1650. // response was returned at all) in error.(*googleapi.Error).Header. Use
  1651. // googleapi.IsNotModified to check whether the returned error was
  1652. // because http.StatusNotModified was returned.
  1653. func (c *OrdersAdvancetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersAdvanceTestOrderResponse, error) {
  1654. gensupport.SetOptions(c.urlParams_, opts...)
  1655. res, err := c.doRequest("json")
  1656. if res != nil && res.StatusCode == http.StatusNotModified {
  1657. if res.Body != nil {
  1658. res.Body.Close()
  1659. }
  1660. return nil, &googleapi.Error{
  1661. Code: res.StatusCode,
  1662. Header: res.Header,
  1663. }
  1664. }
  1665. if err != nil {
  1666. return nil, err
  1667. }
  1668. defer googleapi.CloseBody(res)
  1669. if err := googleapi.CheckResponse(res); err != nil {
  1670. return nil, err
  1671. }
  1672. ret := &OrdersAdvanceTestOrderResponse{
  1673. ServerResponse: googleapi.ServerResponse{
  1674. Header: res.Header,
  1675. HTTPStatusCode: res.StatusCode,
  1676. },
  1677. }
  1678. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1679. return nil, err
  1680. }
  1681. return ret, nil
  1682. // {
  1683. // "description": "Sandbox only. Moves a test order from state \"inProgress\" to state \"pendingShipment\".",
  1684. // "httpMethod": "POST",
  1685. // "id": "content.orders.advancetestorder",
  1686. // "parameterOrder": [
  1687. // "merchantId",
  1688. // "orderId"
  1689. // ],
  1690. // "parameters": {
  1691. // "merchantId": {
  1692. // "description": "The ID of the managing account.",
  1693. // "format": "uint64",
  1694. // "location": "path",
  1695. // "required": true,
  1696. // "type": "string"
  1697. // },
  1698. // "orderId": {
  1699. // "description": "The ID of the test order to modify.",
  1700. // "location": "path",
  1701. // "required": true,
  1702. // "type": "string"
  1703. // }
  1704. // },
  1705. // "path": "{merchantId}/testorders/{orderId}/advance",
  1706. // "response": {
  1707. // "$ref": "OrdersAdvanceTestOrderResponse"
  1708. // },
  1709. // "scopes": [
  1710. // "https://www.googleapis.com/auth/content"
  1711. // ]
  1712. // }
  1713. }
  1714. // method id "content.orders.cancel":
  1715. type OrdersCancelCall struct {
  1716. s *Service
  1717. merchantId uint64
  1718. orderId string
  1719. orderscancelrequest *OrdersCancelRequest
  1720. urlParams_ gensupport.URLParams
  1721. ctx_ context.Context
  1722. }
  1723. // Cancel: Cancels all line items in an order.
  1724. func (r *OrdersService) Cancel(merchantId uint64, orderId string, orderscancelrequest *OrdersCancelRequest) *OrdersCancelCall {
  1725. c := &OrdersCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1726. c.merchantId = merchantId
  1727. c.orderId = orderId
  1728. c.orderscancelrequest = orderscancelrequest
  1729. return c
  1730. }
  1731. // Fields allows partial responses to be retrieved. See
  1732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1733. // for more information.
  1734. func (c *OrdersCancelCall) Fields(s ...googleapi.Field) *OrdersCancelCall {
  1735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1736. return c
  1737. }
  1738. // Context sets the context to be used in this call's Do method. Any
  1739. // pending HTTP request will be aborted if the provided context is
  1740. // canceled.
  1741. func (c *OrdersCancelCall) Context(ctx context.Context) *OrdersCancelCall {
  1742. c.ctx_ = ctx
  1743. return c
  1744. }
  1745. func (c *OrdersCancelCall) doRequest(alt string) (*http.Response, error) {
  1746. var body io.Reader = nil
  1747. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancelrequest)
  1748. if err != nil {
  1749. return nil, err
  1750. }
  1751. ctype := "application/json"
  1752. c.urlParams_.Set("alt", alt)
  1753. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancel")
  1754. urls += "?" + c.urlParams_.Encode()
  1755. req, _ := http.NewRequest("POST", urls, body)
  1756. googleapi.Expand(req.URL, map[string]string{
  1757. "merchantId": strconv.FormatUint(c.merchantId, 10),
  1758. "orderId": c.orderId,
  1759. })
  1760. req.Header.Set("Content-Type", ctype)
  1761. req.Header.Set("User-Agent", c.s.userAgent())
  1762. if c.ctx_ != nil {
  1763. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1764. }
  1765. return c.s.client.Do(req)
  1766. }
  1767. // Do executes the "content.orders.cancel" call.
  1768. // Exactly one of *OrdersCancelResponse or error will be non-nil. Any
  1769. // non-2xx status code is an error. Response headers are in either
  1770. // *OrdersCancelResponse.ServerResponse.Header or (if a response was
  1771. // returned at all) in error.(*googleapi.Error).Header. Use
  1772. // googleapi.IsNotModified to check whether the returned error was
  1773. // because http.StatusNotModified was returned.
  1774. func (c *OrdersCancelCall) Do(opts ...googleapi.CallOption) (*OrdersCancelResponse, error) {
  1775. gensupport.SetOptions(c.urlParams_, opts...)
  1776. res, err := c.doRequest("json")
  1777. if res != nil && res.StatusCode == http.StatusNotModified {
  1778. if res.Body != nil {
  1779. res.Body.Close()
  1780. }
  1781. return nil, &googleapi.Error{
  1782. Code: res.StatusCode,
  1783. Header: res.Header,
  1784. }
  1785. }
  1786. if err != nil {
  1787. return nil, err
  1788. }
  1789. defer googleapi.CloseBody(res)
  1790. if err := googleapi.CheckResponse(res); err != nil {
  1791. return nil, err
  1792. }
  1793. ret := &OrdersCancelResponse{
  1794. ServerResponse: googleapi.ServerResponse{
  1795. Header: res.Header,
  1796. HTTPStatusCode: res.StatusCode,
  1797. },
  1798. }
  1799. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1800. return nil, err
  1801. }
  1802. return ret, nil
  1803. // {
  1804. // "description": "Cancels all line items in an order.",
  1805. // "httpMethod": "POST",
  1806. // "id": "content.orders.cancel",
  1807. // "parameterOrder": [
  1808. // "merchantId",
  1809. // "orderId"
  1810. // ],
  1811. // "parameters": {
  1812. // "merchantId": {
  1813. // "description": "The ID of the managing account.",
  1814. // "format": "uint64",
  1815. // "location": "path",
  1816. // "required": true,
  1817. // "type": "string"
  1818. // },
  1819. // "orderId": {
  1820. // "description": "The ID of the order to cancel.",
  1821. // "location": "path",
  1822. // "required": true,
  1823. // "type": "string"
  1824. // }
  1825. // },
  1826. // "path": "{merchantId}/orders/{orderId}/cancel",
  1827. // "request": {
  1828. // "$ref": "OrdersCancelRequest"
  1829. // },
  1830. // "response": {
  1831. // "$ref": "OrdersCancelResponse"
  1832. // },
  1833. // "scopes": [
  1834. // "https://www.googleapis.com/auth/content"
  1835. // ]
  1836. // }
  1837. }
  1838. // method id "content.orders.cancellineitem":
  1839. type OrdersCancellineitemCall struct {
  1840. s *Service
  1841. merchantId uint64
  1842. orderId string
  1843. orderscancellineitemrequest *OrdersCancelLineItemRequest
  1844. urlParams_ gensupport.URLParams
  1845. ctx_ context.Context
  1846. }
  1847. // Cancellineitem: Cancels a line item.
  1848. func (r *OrdersService) Cancellineitem(merchantId uint64, orderId string, orderscancellineitemrequest *OrdersCancelLineItemRequest) *OrdersCancellineitemCall {
  1849. c := &OrdersCancellineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1850. c.merchantId = merchantId
  1851. c.orderId = orderId
  1852. c.orderscancellineitemrequest = orderscancellineitemrequest
  1853. return c
  1854. }
  1855. // Fields allows partial responses to be retrieved. See
  1856. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1857. // for more information.
  1858. func (c *OrdersCancellineitemCall) Fields(s ...googleapi.Field) *OrdersCancellineitemCall {
  1859. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1860. return c
  1861. }
  1862. // Context sets the context to be used in this call's Do method. Any
  1863. // pending HTTP request will be aborted if the provided context is
  1864. // canceled.
  1865. func (c *OrdersCancellineitemCall) Context(ctx context.Context) *OrdersCancellineitemCall {
  1866. c.ctx_ = ctx
  1867. return c
  1868. }
  1869. func (c *OrdersCancellineitemCall) doRequest(alt string) (*http.Response, error) {
  1870. var body io.Reader = nil
  1871. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscancellineitemrequest)
  1872. if err != nil {
  1873. return nil, err
  1874. }
  1875. ctype := "application/json"
  1876. c.urlParams_.Set("alt", alt)
  1877. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/cancelLineItem")
  1878. urls += "?" + c.urlParams_.Encode()
  1879. req, _ := http.NewRequest("POST", urls, body)
  1880. googleapi.Expand(req.URL, map[string]string{
  1881. "merchantId": strconv.FormatUint(c.merchantId, 10),
  1882. "orderId": c.orderId,
  1883. })
  1884. req.Header.Set("Content-Type", ctype)
  1885. req.Header.Set("User-Agent", c.s.userAgent())
  1886. if c.ctx_ != nil {
  1887. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1888. }
  1889. return c.s.client.Do(req)
  1890. }
  1891. // Do executes the "content.orders.cancellineitem" call.
  1892. // Exactly one of *OrdersCancelLineItemResponse or error will be
  1893. // non-nil. Any non-2xx status code is an error. Response headers are in
  1894. // either *OrdersCancelLineItemResponse.ServerResponse.Header or (if a
  1895. // response was returned at all) in error.(*googleapi.Error).Header. Use
  1896. // googleapi.IsNotModified to check whether the returned error was
  1897. // because http.StatusNotModified was returned.
  1898. func (c *OrdersCancellineitemCall) Do(opts ...googleapi.CallOption) (*OrdersCancelLineItemResponse, error) {
  1899. gensupport.SetOptions(c.urlParams_, opts...)
  1900. res, err := c.doRequest("json")
  1901. if res != nil && res.StatusCode == http.StatusNotModified {
  1902. if res.Body != nil {
  1903. res.Body.Close()
  1904. }
  1905. return nil, &googleapi.Error{
  1906. Code: res.StatusCode,
  1907. Header: res.Header,
  1908. }
  1909. }
  1910. if err != nil {
  1911. return nil, err
  1912. }
  1913. defer googleapi.CloseBody(res)
  1914. if err := googleapi.CheckResponse(res); err != nil {
  1915. return nil, err
  1916. }
  1917. ret := &OrdersCancelLineItemResponse{
  1918. ServerResponse: googleapi.ServerResponse{
  1919. Header: res.Header,
  1920. HTTPStatusCode: res.StatusCode,
  1921. },
  1922. }
  1923. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1924. return nil, err
  1925. }
  1926. return ret, nil
  1927. // {
  1928. // "description": "Cancels a line item.",
  1929. // "httpMethod": "POST",
  1930. // "id": "content.orders.cancellineitem",
  1931. // "parameterOrder": [
  1932. // "merchantId",
  1933. // "orderId"
  1934. // ],
  1935. // "parameters": {
  1936. // "merchantId": {
  1937. // "description": "The ID of the managing account.",
  1938. // "format": "uint64",
  1939. // "location": "path",
  1940. // "required": true,
  1941. // "type": "string"
  1942. // },
  1943. // "orderId": {
  1944. // "description": "The ID of the order.",
  1945. // "location": "path",
  1946. // "required": true,
  1947. // "type": "string"
  1948. // }
  1949. // },
  1950. // "path": "{merchantId}/orders/{orderId}/cancelLineItem",
  1951. // "request": {
  1952. // "$ref": "OrdersCancelLineItemRequest"
  1953. // },
  1954. // "response": {
  1955. // "$ref": "OrdersCancelLineItemResponse"
  1956. // },
  1957. // "scopes": [
  1958. // "https://www.googleapis.com/auth/content"
  1959. // ]
  1960. // }
  1961. }
  1962. // method id "content.orders.createtestorder":
  1963. type OrdersCreatetestorderCall struct {
  1964. s *Service
  1965. merchantId uint64
  1966. orderscreatetestorderrequest *OrdersCreateTestOrderRequest
  1967. urlParams_ gensupport.URLParams
  1968. ctx_ context.Context
  1969. }
  1970. // Createtestorder: Sandbox only. Creates a test order.
  1971. func (r *OrdersService) Createtestorder(merchantId uint64, orderscreatetestorderrequest *OrdersCreateTestOrderRequest) *OrdersCreatetestorderCall {
  1972. c := &OrdersCreatetestorderCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1973. c.merchantId = merchantId
  1974. c.orderscreatetestorderrequest = orderscreatetestorderrequest
  1975. return c
  1976. }
  1977. // Fields allows partial responses to be retrieved. See
  1978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1979. // for more information.
  1980. func (c *OrdersCreatetestorderCall) Fields(s ...googleapi.Field) *OrdersCreatetestorderCall {
  1981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1982. return c
  1983. }
  1984. // Context sets the context to be used in this call's Do method. Any
  1985. // pending HTTP request will be aborted if the provided context is
  1986. // canceled.
  1987. func (c *OrdersCreatetestorderCall) Context(ctx context.Context) *OrdersCreatetestorderCall {
  1988. c.ctx_ = ctx
  1989. return c
  1990. }
  1991. func (c *OrdersCreatetestorderCall) doRequest(alt string) (*http.Response, error) {
  1992. var body io.Reader = nil
  1993. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscreatetestorderrequest)
  1994. if err != nil {
  1995. return nil, err
  1996. }
  1997. ctype := "application/json"
  1998. c.urlParams_.Set("alt", alt)
  1999. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testorders")
  2000. urls += "?" + c.urlParams_.Encode()
  2001. req, _ := http.NewRequest("POST", urls, body)
  2002. googleapi.Expand(req.URL, map[string]string{
  2003. "merchantId": strconv.FormatUint(c.merchantId, 10),
  2004. })
  2005. req.Header.Set("Content-Type", ctype)
  2006. req.Header.Set("User-Agent", c.s.userAgent())
  2007. if c.ctx_ != nil {
  2008. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2009. }
  2010. return c.s.client.Do(req)
  2011. }
  2012. // Do executes the "content.orders.createtestorder" call.
  2013. // Exactly one of *OrdersCreateTestOrderResponse or error will be
  2014. // non-nil. Any non-2xx status code is an error. Response headers are in
  2015. // either *OrdersCreateTestOrderResponse.ServerResponse.Header or (if a
  2016. // response was returned at all) in error.(*googleapi.Error).Header. Use
  2017. // googleapi.IsNotModified to check whether the returned error was
  2018. // because http.StatusNotModified was returned.
  2019. func (c *OrdersCreatetestorderCall) Do(opts ...googleapi.CallOption) (*OrdersCreateTestOrderResponse, error) {
  2020. gensupport.SetOptions(c.urlParams_, opts...)
  2021. res, err := c.doRequest("json")
  2022. if res != nil && res.StatusCode == http.StatusNotModified {
  2023. if res.Body != nil {
  2024. res.Body.Close()
  2025. }
  2026. return nil, &googleapi.Error{
  2027. Code: res.StatusCode,
  2028. Header: res.Header,
  2029. }
  2030. }
  2031. if err != nil {
  2032. return nil, err
  2033. }
  2034. defer googleapi.CloseBody(res)
  2035. if err := googleapi.CheckResponse(res); err != nil {
  2036. return nil, err
  2037. }
  2038. ret := &OrdersCreateTestOrderResponse{
  2039. ServerResponse: googleapi.ServerResponse{
  2040. Header: res.Header,
  2041. HTTPStatusCode: res.StatusCode,
  2042. },
  2043. }
  2044. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2045. return nil, err
  2046. }
  2047. return ret, nil
  2048. // {
  2049. // "description": "Sandbox only. Creates a test order.",
  2050. // "httpMethod": "POST",
  2051. // "id": "content.orders.createtestorder",
  2052. // "parameterOrder": [
  2053. // "merchantId"
  2054. // ],
  2055. // "parameters": {
  2056. // "merchantId": {
  2057. // "description": "The ID of the managing account.",
  2058. // "format": "uint64",
  2059. // "location": "path",
  2060. // "required": true,
  2061. // "type": "string"
  2062. // }
  2063. // },
  2064. // "path": "{merchantId}/testorders",
  2065. // "request": {
  2066. // "$ref": "OrdersCreateTestOrderRequest"
  2067. // },
  2068. // "response": {
  2069. // "$ref": "OrdersCreateTestOrderResponse"
  2070. // },
  2071. // "scopes": [
  2072. // "https://www.googleapis.com/auth/content"
  2073. // ]
  2074. // }
  2075. }
  2076. // method id "content.orders.custombatch":
  2077. type OrdersCustombatchCall struct {
  2078. s *Service
  2079. orderscustombatchrequest *OrdersCustomBatchRequest
  2080. urlParams_ gensupport.URLParams
  2081. ctx_ context.Context
  2082. }
  2083. // Custombatch: Retrieves or modifies multiple orders in a single
  2084. // request.
  2085. func (r *OrdersService) Custombatch(orderscustombatchrequest *OrdersCustomBatchRequest) *OrdersCustombatchCall {
  2086. c := &OrdersCustombatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2087. c.orderscustombatchrequest = orderscustombatchrequest
  2088. return c
  2089. }
  2090. // Fields allows partial responses to be retrieved. See
  2091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2092. // for more information.
  2093. func (c *OrdersCustombatchCall) Fields(s ...googleapi.Field) *OrdersCustombatchCall {
  2094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2095. return c
  2096. }
  2097. // Context sets the context to be used in this call's Do method. Any
  2098. // pending HTTP request will be aborted if the provided context is
  2099. // canceled.
  2100. func (c *OrdersCustombatchCall) Context(ctx context.Context) *OrdersCustombatchCall {
  2101. c.ctx_ = ctx
  2102. return c
  2103. }
  2104. func (c *OrdersCustombatchCall) doRequest(alt string) (*http.Response, error) {
  2105. var body io.Reader = nil
  2106. body, err := googleapi.WithoutDataWrapper.JSONReader(c.orderscustombatchrequest)
  2107. if err != nil {
  2108. return nil, err
  2109. }
  2110. ctype := "application/json"
  2111. c.urlParams_.Set("alt", alt)
  2112. urls := googleapi.ResolveRelative(c.s.BasePath, "orders/batch")
  2113. urls += "?" + c.urlParams_.Encode()
  2114. req, _ := http.NewRequest("POST", urls, body)
  2115. googleapi.SetOpaque(req.URL)
  2116. req.Header.Set("Content-Type", ctype)
  2117. req.Header.Set("User-Agent", c.s.userAgent())
  2118. if c.ctx_ != nil {
  2119. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2120. }
  2121. return c.s.client.Do(req)
  2122. }
  2123. // Do executes the "content.orders.custombatch" call.
  2124. // Exactly one of *OrdersCustomBatchResponse or error will be non-nil.
  2125. // Any non-2xx status code is an error. Response headers are in either
  2126. // *OrdersCustomBatchResponse.ServerResponse.Header or (if a response
  2127. // was returned at all) in error.(*googleapi.Error).Header. Use
  2128. // googleapi.IsNotModified to check whether the returned error was
  2129. // because http.StatusNotModified was returned.
  2130. func (c *OrdersCustombatchCall) Do(opts ...googleapi.CallOption) (*OrdersCustomBatchResponse, error) {
  2131. gensupport.SetOptions(c.urlParams_, opts...)
  2132. res, err := c.doRequest("json")
  2133. if res != nil && res.StatusCode == http.StatusNotModified {
  2134. if res.Body != nil {
  2135. res.Body.Close()
  2136. }
  2137. return nil, &googleapi.Error{
  2138. Code: res.StatusCode,
  2139. Header: res.Header,
  2140. }
  2141. }
  2142. if err != nil {
  2143. return nil, err
  2144. }
  2145. defer googleapi.CloseBody(res)
  2146. if err := googleapi.CheckResponse(res); err != nil {
  2147. return nil, err
  2148. }
  2149. ret := &OrdersCustomBatchResponse{
  2150. ServerResponse: googleapi.ServerResponse{
  2151. Header: res.Header,
  2152. HTTPStatusCode: res.StatusCode,
  2153. },
  2154. }
  2155. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2156. return nil, err
  2157. }
  2158. return ret, nil
  2159. // {
  2160. // "description": "Retrieves or modifies multiple orders in a single request.",
  2161. // "httpMethod": "POST",
  2162. // "id": "content.orders.custombatch",
  2163. // "path": "orders/batch",
  2164. // "request": {
  2165. // "$ref": "OrdersCustomBatchRequest"
  2166. // },
  2167. // "response": {
  2168. // "$ref": "OrdersCustomBatchResponse"
  2169. // },
  2170. // "scopes": [
  2171. // "https://www.googleapis.com/auth/content"
  2172. // ]
  2173. // }
  2174. }
  2175. // method id "content.orders.get":
  2176. type OrdersGetCall struct {
  2177. s *Service
  2178. merchantId uint64
  2179. orderId string
  2180. urlParams_ gensupport.URLParams
  2181. ifNoneMatch_ string
  2182. ctx_ context.Context
  2183. }
  2184. // Get: Retrieves an order from your Merchant Center account.
  2185. func (r *OrdersService) Get(merchantId uint64, orderId string) *OrdersGetCall {
  2186. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2187. c.merchantId = merchantId
  2188. c.orderId = orderId
  2189. return c
  2190. }
  2191. // Fields allows partial responses to be retrieved. See
  2192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2193. // for more information.
  2194. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  2195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2196. return c
  2197. }
  2198. // IfNoneMatch sets the optional parameter which makes the operation
  2199. // fail if the object's ETag matches the given value. This is useful for
  2200. // getting updates only after the object has changed since the last
  2201. // request. Use googleapi.IsNotModified to check whether the response
  2202. // error from Do is the result of In-None-Match.
  2203. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  2204. c.ifNoneMatch_ = entityTag
  2205. return c
  2206. }
  2207. // Context sets the context to be used in this call's Do method. Any
  2208. // pending HTTP request will be aborted if the provided context is
  2209. // canceled.
  2210. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  2211. c.ctx_ = ctx
  2212. return c
  2213. }
  2214. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  2215. var body io.Reader = nil
  2216. c.urlParams_.Set("alt", alt)
  2217. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}")
  2218. urls += "?" + c.urlParams_.Encode()
  2219. req, _ := http.NewRequest("GET", urls, body)
  2220. googleapi.Expand(req.URL, map[string]string{
  2221. "merchantId": strconv.FormatUint(c.merchantId, 10),
  2222. "orderId": c.orderId,
  2223. })
  2224. req.Header.Set("User-Agent", c.s.userAgent())
  2225. if c.ifNoneMatch_ != "" {
  2226. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2227. }
  2228. if c.ctx_ != nil {
  2229. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2230. }
  2231. return c.s.client.Do(req)
  2232. }
  2233. // Do executes the "content.orders.get" call.
  2234. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  2235. // code is an error. Response headers are in either
  2236. // *Order.ServerResponse.Header or (if a response was returned at all)
  2237. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2238. // check whether the returned error was because http.StatusNotModified
  2239. // was returned.
  2240. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  2241. gensupport.SetOptions(c.urlParams_, opts...)
  2242. res, err := c.doRequest("json")
  2243. if res != nil && res.StatusCode == http.StatusNotModified {
  2244. if res.Body != nil {
  2245. res.Body.Close()
  2246. }
  2247. return nil, &googleapi.Error{
  2248. Code: res.StatusCode,
  2249. Header: res.Header,
  2250. }
  2251. }
  2252. if err != nil {
  2253. return nil, err
  2254. }
  2255. defer googleapi.CloseBody(res)
  2256. if err := googleapi.CheckResponse(res); err != nil {
  2257. return nil, err
  2258. }
  2259. ret := &Order{
  2260. ServerResponse: googleapi.ServerResponse{
  2261. Header: res.Header,
  2262. HTTPStatusCode: res.StatusCode,
  2263. },
  2264. }
  2265. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2266. return nil, err
  2267. }
  2268. return ret, nil
  2269. // {
  2270. // "description": "Retrieves an order from your Merchant Center account.",
  2271. // "httpMethod": "GET",
  2272. // "id": "content.orders.get",
  2273. // "parameterOrder": [
  2274. // "merchantId",
  2275. // "orderId"
  2276. // ],
  2277. // "parameters": {
  2278. // "merchantId": {
  2279. // "description": "The ID of the managing account.",
  2280. // "format": "uint64",
  2281. // "location": "path",
  2282. // "required": true,
  2283. // "type": "string"
  2284. // },
  2285. // "orderId": {
  2286. // "description": "The ID of the order.",
  2287. // "location": "path",
  2288. // "required": true,
  2289. // "type": "string"
  2290. // }
  2291. // },
  2292. // "path": "{merchantId}/orders/{orderId}",
  2293. // "response": {
  2294. // "$ref": "Order"
  2295. // },
  2296. // "scopes": [
  2297. // "https://www.googleapis.com/auth/content"
  2298. // ]
  2299. // }
  2300. }
  2301. // method id "content.orders.getbymerchantorderid":
  2302. type OrdersGetbymerchantorderidCall struct {
  2303. s *Service
  2304. merchantId uint64
  2305. merchantOrderId string
  2306. urlParams_ gensupport.URLParams
  2307. ifNoneMatch_ string
  2308. ctx_ context.Context
  2309. }
  2310. // Getbymerchantorderid: Retrieves an order using merchant order id.
  2311. func (r *OrdersService) Getbymerchantorderid(merchantId uint64, merchantOrderId string) *OrdersGetbymerchantorderidCall {
  2312. c := &OrdersGetbymerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2313. c.merchantId = merchantId
  2314. c.merchantOrderId = merchantOrderId
  2315. return c
  2316. }
  2317. // Fields allows partial responses to be retrieved. See
  2318. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2319. // for more information.
  2320. func (c *OrdersGetbymerchantorderidCall) Fields(s ...googleapi.Field) *OrdersGetbymerchantorderidCall {
  2321. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2322. return c
  2323. }
  2324. // IfNoneMatch sets the optional parameter which makes the operation
  2325. // fail if the object's ETag matches the given value. This is useful for
  2326. // getting updates only after the object has changed since the last
  2327. // request. Use googleapi.IsNotModified to check whether the response
  2328. // error from Do is the result of In-None-Match.
  2329. func (c *OrdersGetbymerchantorderidCall) IfNoneMatch(entityTag string) *OrdersGetbymerchantorderidCall {
  2330. c.ifNoneMatch_ = entityTag
  2331. return c
  2332. }
  2333. // Context sets the context to be used in this call's Do method. Any
  2334. // pending HTTP request will be aborted if the provided context is
  2335. // canceled.
  2336. func (c *OrdersGetbymerchantorderidCall) Context(ctx context.Context) *OrdersGetbymerchantorderidCall {
  2337. c.ctx_ = ctx
  2338. return c
  2339. }
  2340. func (c *OrdersGetbymerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  2341. var body io.Reader = nil
  2342. c.urlParams_.Set("alt", alt)
  2343. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/ordersbymerchantid/{merchantOrderId}")
  2344. urls += "?" + c.urlParams_.Encode()
  2345. req, _ := http.NewRequest("GET", urls, body)
  2346. googleapi.Expand(req.URL, map[string]string{
  2347. "merchantId": strconv.FormatUint(c.merchantId, 10),
  2348. "merchantOrderId": c.merchantOrderId,
  2349. })
  2350. req.Header.Set("User-Agent", c.s.userAgent())
  2351. if c.ifNoneMatch_ != "" {
  2352. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2353. }
  2354. if c.ctx_ != nil {
  2355. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2356. }
  2357. return c.s.client.Do(req)
  2358. }
  2359. // Do executes the "content.orders.getbymerchantorderid" call.
  2360. // Exactly one of *OrdersGetByMerchantOrderIdResponse or error will be
  2361. // non-nil. Any non-2xx status code is an error. Response headers are in
  2362. // either *OrdersGetByMerchantOrderIdResponse.ServerResponse.Header or
  2363. // (if a response was returned at all) in
  2364. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2365. // whether the returned error was because http.StatusNotModified was
  2366. // returned.
  2367. func (c *OrdersGetbymerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersGetByMerchantOrderIdResponse, error) {
  2368. gensupport.SetOptions(c.urlParams_, opts...)
  2369. res, err := c.doRequest("json")
  2370. if res != nil && res.StatusCode == http.StatusNotModified {
  2371. if res.Body != nil {
  2372. res.Body.Close()
  2373. }
  2374. return nil, &googleapi.Error{
  2375. Code: res.StatusCode,
  2376. Header: res.Header,
  2377. }
  2378. }
  2379. if err != nil {
  2380. return nil, err
  2381. }
  2382. defer googleapi.CloseBody(res)
  2383. if err := googleapi.CheckResponse(res); err != nil {
  2384. return nil, err
  2385. }
  2386. ret := &OrdersGetByMerchantOrderIdResponse{
  2387. ServerResponse: googleapi.ServerResponse{
  2388. Header: res.Header,
  2389. HTTPStatusCode: res.StatusCode,
  2390. },
  2391. }
  2392. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2393. return nil, err
  2394. }
  2395. return ret, nil
  2396. // {
  2397. // "description": "Retrieves an order using merchant order id.",
  2398. // "httpMethod": "GET",
  2399. // "id": "content.orders.getbymerchantorderid",
  2400. // "parameterOrder": [
  2401. // "merchantId",
  2402. // "merchantOrderId"
  2403. // ],
  2404. // "parameters": {
  2405. // "merchantId": {
  2406. // "description": "The ID of the managing account.",
  2407. // "format": "uint64",
  2408. // "location": "path",
  2409. // "required": true,
  2410. // "type": "string"
  2411. // },
  2412. // "merchantOrderId": {
  2413. // "description": "The merchant order id to be looked for.",
  2414. // "location": "path",
  2415. // "required": true,
  2416. // "type": "string"
  2417. // }
  2418. // },
  2419. // "path": "{merchantId}/ordersbymerchantid/{merchantOrderId}",
  2420. // "response": {
  2421. // "$ref": "OrdersGetByMerchantOrderIdResponse"
  2422. // },
  2423. // "scopes": [
  2424. // "https://www.googleapis.com/auth/content"
  2425. // ]
  2426. // }
  2427. }
  2428. // method id "content.orders.gettestordertemplate":
  2429. type OrdersGettestordertemplateCall struct {
  2430. s *Service
  2431. merchantId uint64
  2432. templateName string
  2433. urlParams_ gensupport.URLParams
  2434. ifNoneMatch_ string
  2435. ctx_ context.Context
  2436. }
  2437. // Gettestordertemplate: Sandbox only. Retrieves an order template that
  2438. // can be used to quickly create a new order in sandbox.
  2439. func (r *OrdersService) Gettestordertemplate(merchantId uint64, templateName string) *OrdersGettestordertemplateCall {
  2440. c := &OrdersGettestordertemplateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2441. c.merchantId = merchantId
  2442. c.templateName = templateName
  2443. return c
  2444. }
  2445. // Fields allows partial responses to be retrieved. See
  2446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2447. // for more information.
  2448. func (c *OrdersGettestordertemplateCall) Fields(s ...googleapi.Field) *OrdersGettestordertemplateCall {
  2449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2450. return c
  2451. }
  2452. // IfNoneMatch sets the optional parameter which makes the operation
  2453. // fail if the object's ETag matches the given value. This is useful for
  2454. // getting updates only after the object has changed since the last
  2455. // request. Use googleapi.IsNotModified to check whether the response
  2456. // error from Do is the result of In-None-Match.
  2457. func (c *OrdersGettestordertemplateCall) IfNoneMatch(entityTag string) *OrdersGettestordertemplateCall {
  2458. c.ifNoneMatch_ = entityTag
  2459. return c
  2460. }
  2461. // Context sets the context to be used in this call's Do method. Any
  2462. // pending HTTP request will be aborted if the provided context is
  2463. // canceled.
  2464. func (c *OrdersGettestordertemplateCall) Context(ctx context.Context) *OrdersGettestordertemplateCall {
  2465. c.ctx_ = ctx
  2466. return c
  2467. }
  2468. func (c *OrdersGettestordertemplateCall) doRequest(alt string) (*http.Response, error) {
  2469. var body io.Reader = nil
  2470. c.urlParams_.Set("alt", alt)
  2471. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/testordertemplates/{templateName}")
  2472. urls += "?" + c.urlParams_.Encode()
  2473. req, _ := http.NewRequest("GET", urls, body)
  2474. googleapi.Expand(req.URL, map[string]string{
  2475. "merchantId": strconv.FormatUint(c.merchantId, 10),
  2476. "templateName": c.templateName,
  2477. })
  2478. req.Header.Set("User-Agent", c.s.userAgent())
  2479. if c.ifNoneMatch_ != "" {
  2480. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2481. }
  2482. if c.ctx_ != nil {
  2483. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2484. }
  2485. return c.s.client.Do(req)
  2486. }
  2487. // Do executes the "content.orders.gettestordertemplate" call.
  2488. // Exactly one of *OrdersGetTestOrderTemplateResponse or error will be
  2489. // non-nil. Any non-2xx status code is an error. Response headers are in
  2490. // either *OrdersGetTestOrderTemplateResponse.ServerResponse.Header or
  2491. // (if a response was returned at all) in
  2492. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2493. // whether the returned error was because http.StatusNotModified was
  2494. // returned.
  2495. func (c *OrdersGettestordertemplateCall) Do(opts ...googleapi.CallOption) (*OrdersGetTestOrderTemplateResponse, error) {
  2496. gensupport.SetOptions(c.urlParams_, opts...)
  2497. res, err := c.doRequest("json")
  2498. if res != nil && res.StatusCode == http.StatusNotModified {
  2499. if res.Body != nil {
  2500. res.Body.Close()
  2501. }
  2502. return nil, &googleapi.Error{
  2503. Code: res.StatusCode,
  2504. Header: res.Header,
  2505. }
  2506. }
  2507. if err != nil {
  2508. return nil, err
  2509. }
  2510. defer googleapi.CloseBody(res)
  2511. if err := googleapi.CheckResponse(res); err != nil {
  2512. return nil, err
  2513. }
  2514. ret := &OrdersGetTestOrderTemplateResponse{
  2515. ServerResponse: googleapi.ServerResponse{
  2516. Header: res.Header,
  2517. HTTPStatusCode: res.StatusCode,
  2518. },
  2519. }
  2520. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2521. return nil, err
  2522. }
  2523. return ret, nil
  2524. // {
  2525. // "description": "Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox.",
  2526. // "httpMethod": "GET",
  2527. // "id": "content.orders.gettestordertemplate",
  2528. // "parameterOrder": [
  2529. // "merchantId",
  2530. // "templateName"
  2531. // ],
  2532. // "parameters": {
  2533. // "merchantId": {
  2534. // "description": "The ID of the managing account.",
  2535. // "format": "uint64",
  2536. // "location": "path",
  2537. // "required": true,
  2538. // "type": "string"
  2539. // },
  2540. // "templateName": {
  2541. // "description": "The name of the template to retrieve.",
  2542. // "enum": [
  2543. // "template1",
  2544. // "template2"
  2545. // ],
  2546. // "enumDescriptions": [
  2547. // "",
  2548. // ""
  2549. // ],
  2550. // "location": "path",
  2551. // "required": true,
  2552. // "type": "string"
  2553. // }
  2554. // },
  2555. // "path": "{merchantId}/testordertemplates/{templateName}",
  2556. // "response": {
  2557. // "$ref": "OrdersGetTestOrderTemplateResponse"
  2558. // },
  2559. // "scopes": [
  2560. // "https://www.googleapis.com/auth/content"
  2561. // ]
  2562. // }
  2563. }
  2564. // method id "content.orders.list":
  2565. type OrdersListCall struct {
  2566. s *Service
  2567. merchantId uint64
  2568. urlParams_ gensupport.URLParams
  2569. ifNoneMatch_ string
  2570. ctx_ context.Context
  2571. }
  2572. // List: Lists the orders in your Merchant Center account.
  2573. func (r *OrdersService) List(merchantId uint64) *OrdersListCall {
  2574. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2575. c.merchantId = merchantId
  2576. return c
  2577. }
  2578. // Acknowledged sets the optional parameter "acknowledged": Obtains
  2579. // orders that match the acknowledgement status. When set to true,
  2580. // obtains orders that have been acknowledged. When false, obtains
  2581. // orders that have not been acknowledged.
  2582. // We recommend using this filter set to false, in conjunction with the
  2583. // acknowledge call, such that only un-acknowledged orders are returned.
  2584. func (c *OrdersListCall) Acknowledged(acknowledged bool) *OrdersListCall {
  2585. c.urlParams_.Set("acknowledged", fmt.Sprint(acknowledged))
  2586. return c
  2587. }
  2588. // MaxResults sets the optional parameter "maxResults": The maximum
  2589. // number of orders to return in the response, used for paging. The
  2590. // default value is 25 orders per page, and the maximum allowed value is
  2591. // 250 orders per page.
  2592. // Known issue: All List calls will return all Orders without limit
  2593. // regardless of the value of this field.
  2594. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  2595. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  2596. return c
  2597. }
  2598. // OrderBy sets the optional parameter "orderBy": The ordering of the
  2599. // returned list. The only supported value are placedDate desc and
  2600. // placedDate asc for now, which returns orders sorted by placement
  2601. // date. "placedDate desc" stands for listing orders by placement date,
  2602. // from oldest to most recent. "placedDate asc" stands for listing
  2603. // orders by placement date, from most recent to oldest. In future
  2604. // releases we'll support other sorting criteria.
  2605. //
  2606. // Possible values:
  2607. // "placedDate asc"
  2608. // "placedDate desc"
  2609. func (c *OrdersListCall) OrderBy(orderBy string) *OrdersListCall {
  2610. c.urlParams_.Set("orderBy", orderBy)
  2611. return c
  2612. }
  2613. // PageToken sets the optional parameter "pageToken": The token returned
  2614. // by the previous request.
  2615. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  2616. c.urlParams_.Set("pageToken", pageToken)
  2617. return c
  2618. }
  2619. // PlacedDateEnd sets the optional parameter "placedDateEnd": Obtains
  2620. // orders placed before this date (exclusively), in ISO 8601 format.
  2621. func (c *OrdersListCall) PlacedDateEnd(placedDateEnd string) *OrdersListCall {
  2622. c.urlParams_.Set("placedDateEnd", placedDateEnd)
  2623. return c
  2624. }
  2625. // PlacedDateStart sets the optional parameter "placedDateStart":
  2626. // Obtains orders placed after this date (inclusively), in ISO 8601
  2627. // format.
  2628. func (c *OrdersListCall) PlacedDateStart(placedDateStart string) *OrdersListCall {
  2629. c.urlParams_.Set("placedDateStart", placedDateStart)
  2630. return c
  2631. }
  2632. // Statuses sets the optional parameter "statuses": Obtains orders that
  2633. // match any of the specified statuses. Multiple values can be specified
  2634. // with comma separation. Additionally, please note that active is a
  2635. // shortcut for pendingShipment and partiallyShipped, and completed is a
  2636. // shortcut for shipped , partiallyDelivered, delivered,
  2637. // partiallyReturned, returned, and canceled.
  2638. //
  2639. // Possible values:
  2640. // "active"
  2641. // "canceled"
  2642. // "completed"
  2643. // "delivered"
  2644. // "inProgress"
  2645. // "partiallyDelivered"
  2646. // "partiallyReturned"
  2647. // "partiallyShipped"
  2648. // "pendingShipment"
  2649. // "returned"
  2650. // "shipped"
  2651. func (c *OrdersListCall) Statuses(statuses ...string) *OrdersListCall {
  2652. c.urlParams_.SetMulti("statuses", append([]string{}, statuses...))
  2653. return c
  2654. }
  2655. // Fields allows partial responses to be retrieved. See
  2656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2657. // for more information.
  2658. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  2659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2660. return c
  2661. }
  2662. // IfNoneMatch sets the optional parameter which makes the operation
  2663. // fail if the object's ETag matches the given value. This is useful for
  2664. // getting updates only after the object has changed since the last
  2665. // request. Use googleapi.IsNotModified to check whether the response
  2666. // error from Do is the result of In-None-Match.
  2667. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  2668. c.ifNoneMatch_ = entityTag
  2669. return c
  2670. }
  2671. // Context sets the context to be used in this call's Do method. Any
  2672. // pending HTTP request will be aborted if the provided context is
  2673. // canceled.
  2674. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  2675. c.ctx_ = ctx
  2676. return c
  2677. }
  2678. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  2679. var body io.Reader = nil
  2680. c.urlParams_.Set("alt", alt)
  2681. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders")
  2682. urls += "?" + c.urlParams_.Encode()
  2683. req, _ := http.NewRequest("GET", urls, body)
  2684. googleapi.Expand(req.URL, map[string]string{
  2685. "merchantId": strconv.FormatUint(c.merchantId, 10),
  2686. })
  2687. req.Header.Set("User-Agent", c.s.userAgent())
  2688. if c.ifNoneMatch_ != "" {
  2689. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  2690. }
  2691. if c.ctx_ != nil {
  2692. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2693. }
  2694. return c.s.client.Do(req)
  2695. }
  2696. // Do executes the "content.orders.list" call.
  2697. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  2698. // non-2xx status code is an error. Response headers are in either
  2699. // *OrdersListResponse.ServerResponse.Header or (if a response was
  2700. // returned at all) in error.(*googleapi.Error).Header. Use
  2701. // googleapi.IsNotModified to check whether the returned error was
  2702. // because http.StatusNotModified was returned.
  2703. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  2704. gensupport.SetOptions(c.urlParams_, opts...)
  2705. res, err := c.doRequest("json")
  2706. if res != nil && res.StatusCode == http.StatusNotModified {
  2707. if res.Body != nil {
  2708. res.Body.Close()
  2709. }
  2710. return nil, &googleapi.Error{
  2711. Code: res.StatusCode,
  2712. Header: res.Header,
  2713. }
  2714. }
  2715. if err != nil {
  2716. return nil, err
  2717. }
  2718. defer googleapi.CloseBody(res)
  2719. if err := googleapi.CheckResponse(res); err != nil {
  2720. return nil, err
  2721. }
  2722. ret := &OrdersListResponse{
  2723. ServerResponse: googleapi.ServerResponse{
  2724. Header: res.Header,
  2725. HTTPStatusCode: res.StatusCode,
  2726. },
  2727. }
  2728. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2729. return nil, err
  2730. }
  2731. return ret, nil
  2732. // {
  2733. // "description": "Lists the orders in your Merchant Center account.",
  2734. // "httpMethod": "GET",
  2735. // "id": "content.orders.list",
  2736. // "parameterOrder": [
  2737. // "merchantId"
  2738. // ],
  2739. // "parameters": {
  2740. // "acknowledged": {
  2741. // "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.",
  2742. // "location": "query",
  2743. // "type": "boolean"
  2744. // },
  2745. // "maxResults": {
  2746. // "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.",
  2747. // "format": "uint32",
  2748. // "location": "query",
  2749. // "type": "integer"
  2750. // },
  2751. // "merchantId": {
  2752. // "description": "The ID of the managing account.",
  2753. // "format": "uint64",
  2754. // "location": "path",
  2755. // "required": true,
  2756. // "type": "string"
  2757. // },
  2758. // "orderBy": {
  2759. // "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.",
  2760. // "enum": [
  2761. // "placedDate asc",
  2762. // "placedDate desc"
  2763. // ],
  2764. // "enumDescriptions": [
  2765. // "",
  2766. // ""
  2767. // ],
  2768. // "location": "query",
  2769. // "type": "string"
  2770. // },
  2771. // "pageToken": {
  2772. // "description": "The token returned by the previous request.",
  2773. // "location": "query",
  2774. // "type": "string"
  2775. // },
  2776. // "placedDateEnd": {
  2777. // "description": "Obtains orders placed before this date (exclusively), in ISO 8601 format.",
  2778. // "location": "query",
  2779. // "type": "string"
  2780. // },
  2781. // "placedDateStart": {
  2782. // "description": "Obtains orders placed after this date (inclusively), in ISO 8601 format.",
  2783. // "location": "query",
  2784. // "type": "string"
  2785. // },
  2786. // "statuses": {
  2787. // "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.",
  2788. // "enum": [
  2789. // "active",
  2790. // "canceled",
  2791. // "completed",
  2792. // "delivered",
  2793. // "inProgress",
  2794. // "partiallyDelivered",
  2795. // "partiallyReturned",
  2796. // "partiallyShipped",
  2797. // "pendingShipment",
  2798. // "returned",
  2799. // "shipped"
  2800. // ],
  2801. // "enumDescriptions": [
  2802. // "",
  2803. // "",
  2804. // "",
  2805. // "",
  2806. // "",
  2807. // "",
  2808. // "",
  2809. // "",
  2810. // "",
  2811. // "",
  2812. // ""
  2813. // ],
  2814. // "location": "query",
  2815. // "repeated": true,
  2816. // "type": "string"
  2817. // }
  2818. // },
  2819. // "path": "{merchantId}/orders",
  2820. // "response": {
  2821. // "$ref": "OrdersListResponse"
  2822. // },
  2823. // "scopes": [
  2824. // "https://www.googleapis.com/auth/content"
  2825. // ]
  2826. // }
  2827. }
  2828. // Pages invokes f for each page of results.
  2829. // A non-nil error returned from f will halt the iteration.
  2830. // The provided context supersedes any context provided to the Context method.
  2831. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  2832. c.ctx_ = ctx
  2833. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2834. for {
  2835. x, err := c.Do()
  2836. if err != nil {
  2837. return err
  2838. }
  2839. if err := f(x); err != nil {
  2840. return err
  2841. }
  2842. if x.NextPageToken == "" {
  2843. return nil
  2844. }
  2845. c.PageToken(x.NextPageToken)
  2846. }
  2847. }
  2848. // method id "content.orders.refund":
  2849. type OrdersRefundCall struct {
  2850. s *Service
  2851. merchantId uint64
  2852. orderId string
  2853. ordersrefundrequest *OrdersRefundRequest
  2854. urlParams_ gensupport.URLParams
  2855. ctx_ context.Context
  2856. }
  2857. // Refund: Refund a portion of the order, up to the full amount paid.
  2858. func (r *OrdersService) Refund(merchantId uint64, orderId string, ordersrefundrequest *OrdersRefundRequest) *OrdersRefundCall {
  2859. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2860. c.merchantId = merchantId
  2861. c.orderId = orderId
  2862. c.ordersrefundrequest = ordersrefundrequest
  2863. return c
  2864. }
  2865. // Fields allows partial responses to be retrieved. See
  2866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2867. // for more information.
  2868. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  2869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2870. return c
  2871. }
  2872. // Context sets the context to be used in this call's Do method. Any
  2873. // pending HTTP request will be aborted if the provided context is
  2874. // canceled.
  2875. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  2876. c.ctx_ = ctx
  2877. return c
  2878. }
  2879. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  2880. var body io.Reader = nil
  2881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersrefundrequest)
  2882. if err != nil {
  2883. return nil, err
  2884. }
  2885. ctype := "application/json"
  2886. c.urlParams_.Set("alt", alt)
  2887. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/refund")
  2888. urls += "?" + c.urlParams_.Encode()
  2889. req, _ := http.NewRequest("POST", urls, body)
  2890. googleapi.Expand(req.URL, map[string]string{
  2891. "merchantId": strconv.FormatUint(c.merchantId, 10),
  2892. "orderId": c.orderId,
  2893. })
  2894. req.Header.Set("Content-Type", ctype)
  2895. req.Header.Set("User-Agent", c.s.userAgent())
  2896. if c.ctx_ != nil {
  2897. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2898. }
  2899. return c.s.client.Do(req)
  2900. }
  2901. // Do executes the "content.orders.refund" call.
  2902. // Exactly one of *OrdersRefundResponse or error will be non-nil. Any
  2903. // non-2xx status code is an error. Response headers are in either
  2904. // *OrdersRefundResponse.ServerResponse.Header or (if a response was
  2905. // returned at all) in error.(*googleapi.Error).Header. Use
  2906. // googleapi.IsNotModified to check whether the returned error was
  2907. // because http.StatusNotModified was returned.
  2908. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) (*OrdersRefundResponse, error) {
  2909. gensupport.SetOptions(c.urlParams_, opts...)
  2910. res, err := c.doRequest("json")
  2911. if res != nil && res.StatusCode == http.StatusNotModified {
  2912. if res.Body != nil {
  2913. res.Body.Close()
  2914. }
  2915. return nil, &googleapi.Error{
  2916. Code: res.StatusCode,
  2917. Header: res.Header,
  2918. }
  2919. }
  2920. if err != nil {
  2921. return nil, err
  2922. }
  2923. defer googleapi.CloseBody(res)
  2924. if err := googleapi.CheckResponse(res); err != nil {
  2925. return nil, err
  2926. }
  2927. ret := &OrdersRefundResponse{
  2928. ServerResponse: googleapi.ServerResponse{
  2929. Header: res.Header,
  2930. HTTPStatusCode: res.StatusCode,
  2931. },
  2932. }
  2933. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2934. return nil, err
  2935. }
  2936. return ret, nil
  2937. // {
  2938. // "description": "Refund a portion of the order, up to the full amount paid.",
  2939. // "httpMethod": "POST",
  2940. // "id": "content.orders.refund",
  2941. // "parameterOrder": [
  2942. // "merchantId",
  2943. // "orderId"
  2944. // ],
  2945. // "parameters": {
  2946. // "merchantId": {
  2947. // "description": "The ID of the managing account.",
  2948. // "format": "uint64",
  2949. // "location": "path",
  2950. // "required": true,
  2951. // "type": "string"
  2952. // },
  2953. // "orderId": {
  2954. // "description": "The ID of the order to refund.",
  2955. // "location": "path",
  2956. // "required": true,
  2957. // "type": "string"
  2958. // }
  2959. // },
  2960. // "path": "{merchantId}/orders/{orderId}/refund",
  2961. // "request": {
  2962. // "$ref": "OrdersRefundRequest"
  2963. // },
  2964. // "response": {
  2965. // "$ref": "OrdersRefundResponse"
  2966. // },
  2967. // "scopes": [
  2968. // "https://www.googleapis.com/auth/content"
  2969. // ]
  2970. // }
  2971. }
  2972. // method id "content.orders.returnlineitem":
  2973. type OrdersReturnlineitemCall struct {
  2974. s *Service
  2975. merchantId uint64
  2976. orderId string
  2977. ordersreturnlineitemrequest *OrdersReturnLineItemRequest
  2978. urlParams_ gensupport.URLParams
  2979. ctx_ context.Context
  2980. }
  2981. // Returnlineitem: Returns a line item.
  2982. func (r *OrdersService) Returnlineitem(merchantId uint64, orderId string, ordersreturnlineitemrequest *OrdersReturnLineItemRequest) *OrdersReturnlineitemCall {
  2983. c := &OrdersReturnlineitemCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2984. c.merchantId = merchantId
  2985. c.orderId = orderId
  2986. c.ordersreturnlineitemrequest = ordersreturnlineitemrequest
  2987. return c
  2988. }
  2989. // Fields allows partial responses to be retrieved. See
  2990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2991. // for more information.
  2992. func (c *OrdersReturnlineitemCall) Fields(s ...googleapi.Field) *OrdersReturnlineitemCall {
  2993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2994. return c
  2995. }
  2996. // Context sets the context to be used in this call's Do method. Any
  2997. // pending HTTP request will be aborted if the provided context is
  2998. // canceled.
  2999. func (c *OrdersReturnlineitemCall) Context(ctx context.Context) *OrdersReturnlineitemCall {
  3000. c.ctx_ = ctx
  3001. return c
  3002. }
  3003. func (c *OrdersReturnlineitemCall) doRequest(alt string) (*http.Response, error) {
  3004. var body io.Reader = nil
  3005. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersreturnlineitemrequest)
  3006. if err != nil {
  3007. return nil, err
  3008. }
  3009. ctype := "application/json"
  3010. c.urlParams_.Set("alt", alt)
  3011. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/returnLineItem")
  3012. urls += "?" + c.urlParams_.Encode()
  3013. req, _ := http.NewRequest("POST", urls, body)
  3014. googleapi.Expand(req.URL, map[string]string{
  3015. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3016. "orderId": c.orderId,
  3017. })
  3018. req.Header.Set("Content-Type", ctype)
  3019. req.Header.Set("User-Agent", c.s.userAgent())
  3020. if c.ctx_ != nil {
  3021. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3022. }
  3023. return c.s.client.Do(req)
  3024. }
  3025. // Do executes the "content.orders.returnlineitem" call.
  3026. // Exactly one of *OrdersReturnLineItemResponse or error will be
  3027. // non-nil. Any non-2xx status code is an error. Response headers are in
  3028. // either *OrdersReturnLineItemResponse.ServerResponse.Header or (if a
  3029. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3030. // googleapi.IsNotModified to check whether the returned error was
  3031. // because http.StatusNotModified was returned.
  3032. func (c *OrdersReturnlineitemCall) Do(opts ...googleapi.CallOption) (*OrdersReturnLineItemResponse, error) {
  3033. gensupport.SetOptions(c.urlParams_, opts...)
  3034. res, err := c.doRequest("json")
  3035. if res != nil && res.StatusCode == http.StatusNotModified {
  3036. if res.Body != nil {
  3037. res.Body.Close()
  3038. }
  3039. return nil, &googleapi.Error{
  3040. Code: res.StatusCode,
  3041. Header: res.Header,
  3042. }
  3043. }
  3044. if err != nil {
  3045. return nil, err
  3046. }
  3047. defer googleapi.CloseBody(res)
  3048. if err := googleapi.CheckResponse(res); err != nil {
  3049. return nil, err
  3050. }
  3051. ret := &OrdersReturnLineItemResponse{
  3052. ServerResponse: googleapi.ServerResponse{
  3053. Header: res.Header,
  3054. HTTPStatusCode: res.StatusCode,
  3055. },
  3056. }
  3057. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3058. return nil, err
  3059. }
  3060. return ret, nil
  3061. // {
  3062. // "description": "Returns a line item.",
  3063. // "httpMethod": "POST",
  3064. // "id": "content.orders.returnlineitem",
  3065. // "parameterOrder": [
  3066. // "merchantId",
  3067. // "orderId"
  3068. // ],
  3069. // "parameters": {
  3070. // "merchantId": {
  3071. // "description": "The ID of the managing account.",
  3072. // "format": "uint64",
  3073. // "location": "path",
  3074. // "required": true,
  3075. // "type": "string"
  3076. // },
  3077. // "orderId": {
  3078. // "description": "The ID of the order.",
  3079. // "location": "path",
  3080. // "required": true,
  3081. // "type": "string"
  3082. // }
  3083. // },
  3084. // "path": "{merchantId}/orders/{orderId}/returnLineItem",
  3085. // "request": {
  3086. // "$ref": "OrdersReturnLineItemRequest"
  3087. // },
  3088. // "response": {
  3089. // "$ref": "OrdersReturnLineItemResponse"
  3090. // },
  3091. // "scopes": [
  3092. // "https://www.googleapis.com/auth/content"
  3093. // ]
  3094. // }
  3095. }
  3096. // method id "content.orders.shiplineitems":
  3097. type OrdersShiplineitemsCall struct {
  3098. s *Service
  3099. merchantId uint64
  3100. orderId string
  3101. ordersshiplineitemsrequest *OrdersShipLineItemsRequest
  3102. urlParams_ gensupport.URLParams
  3103. ctx_ context.Context
  3104. }
  3105. // Shiplineitems: Marks line item(s) as shipped.
  3106. func (r *OrdersService) Shiplineitems(merchantId uint64, orderId string, ordersshiplineitemsrequest *OrdersShipLineItemsRequest) *OrdersShiplineitemsCall {
  3107. c := &OrdersShiplineitemsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3108. c.merchantId = merchantId
  3109. c.orderId = orderId
  3110. c.ordersshiplineitemsrequest = ordersshiplineitemsrequest
  3111. return c
  3112. }
  3113. // Fields allows partial responses to be retrieved. See
  3114. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3115. // for more information.
  3116. func (c *OrdersShiplineitemsCall) Fields(s ...googleapi.Field) *OrdersShiplineitemsCall {
  3117. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3118. return c
  3119. }
  3120. // Context sets the context to be used in this call's Do method. Any
  3121. // pending HTTP request will be aborted if the provided context is
  3122. // canceled.
  3123. func (c *OrdersShiplineitemsCall) Context(ctx context.Context) *OrdersShiplineitemsCall {
  3124. c.ctx_ = ctx
  3125. return c
  3126. }
  3127. func (c *OrdersShiplineitemsCall) doRequest(alt string) (*http.Response, error) {
  3128. var body io.Reader = nil
  3129. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersshiplineitemsrequest)
  3130. if err != nil {
  3131. return nil, err
  3132. }
  3133. ctype := "application/json"
  3134. c.urlParams_.Set("alt", alt)
  3135. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/shipLineItems")
  3136. urls += "?" + c.urlParams_.Encode()
  3137. req, _ := http.NewRequest("POST", urls, body)
  3138. googleapi.Expand(req.URL, map[string]string{
  3139. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3140. "orderId": c.orderId,
  3141. })
  3142. req.Header.Set("Content-Type", ctype)
  3143. req.Header.Set("User-Agent", c.s.userAgent())
  3144. if c.ctx_ != nil {
  3145. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3146. }
  3147. return c.s.client.Do(req)
  3148. }
  3149. // Do executes the "content.orders.shiplineitems" call.
  3150. // Exactly one of *OrdersShipLineItemsResponse or error will be non-nil.
  3151. // Any non-2xx status code is an error. Response headers are in either
  3152. // *OrdersShipLineItemsResponse.ServerResponse.Header or (if a response
  3153. // was returned at all) in error.(*googleapi.Error).Header. Use
  3154. // googleapi.IsNotModified to check whether the returned error was
  3155. // because http.StatusNotModified was returned.
  3156. func (c *OrdersShiplineitemsCall) Do(opts ...googleapi.CallOption) (*OrdersShipLineItemsResponse, error) {
  3157. gensupport.SetOptions(c.urlParams_, opts...)
  3158. res, err := c.doRequest("json")
  3159. if res != nil && res.StatusCode == http.StatusNotModified {
  3160. if res.Body != nil {
  3161. res.Body.Close()
  3162. }
  3163. return nil, &googleapi.Error{
  3164. Code: res.StatusCode,
  3165. Header: res.Header,
  3166. }
  3167. }
  3168. if err != nil {
  3169. return nil, err
  3170. }
  3171. defer googleapi.CloseBody(res)
  3172. if err := googleapi.CheckResponse(res); err != nil {
  3173. return nil, err
  3174. }
  3175. ret := &OrdersShipLineItemsResponse{
  3176. ServerResponse: googleapi.ServerResponse{
  3177. Header: res.Header,
  3178. HTTPStatusCode: res.StatusCode,
  3179. },
  3180. }
  3181. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3182. return nil, err
  3183. }
  3184. return ret, nil
  3185. // {
  3186. // "description": "Marks line item(s) as shipped.",
  3187. // "httpMethod": "POST",
  3188. // "id": "content.orders.shiplineitems",
  3189. // "parameterOrder": [
  3190. // "merchantId",
  3191. // "orderId"
  3192. // ],
  3193. // "parameters": {
  3194. // "merchantId": {
  3195. // "description": "The ID of the managing account.",
  3196. // "format": "uint64",
  3197. // "location": "path",
  3198. // "required": true,
  3199. // "type": "string"
  3200. // },
  3201. // "orderId": {
  3202. // "description": "The ID of the order.",
  3203. // "location": "path",
  3204. // "required": true,
  3205. // "type": "string"
  3206. // }
  3207. // },
  3208. // "path": "{merchantId}/orders/{orderId}/shipLineItems",
  3209. // "request": {
  3210. // "$ref": "OrdersShipLineItemsRequest"
  3211. // },
  3212. // "response": {
  3213. // "$ref": "OrdersShipLineItemsResponse"
  3214. // },
  3215. // "scopes": [
  3216. // "https://www.googleapis.com/auth/content"
  3217. // ]
  3218. // }
  3219. }
  3220. // method id "content.orders.updatemerchantorderid":
  3221. type OrdersUpdatemerchantorderidCall struct {
  3222. s *Service
  3223. merchantId uint64
  3224. orderId string
  3225. ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest
  3226. urlParams_ gensupport.URLParams
  3227. ctx_ context.Context
  3228. }
  3229. // Updatemerchantorderid: Updates the merchant order ID for a given
  3230. // order.
  3231. func (r *OrdersService) Updatemerchantorderid(merchantId uint64, orderId string, ordersupdatemerchantorderidrequest *OrdersUpdateMerchantOrderIdRequest) *OrdersUpdatemerchantorderidCall {
  3232. c := &OrdersUpdatemerchantorderidCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3233. c.merchantId = merchantId
  3234. c.orderId = orderId
  3235. c.ordersupdatemerchantorderidrequest = ordersupdatemerchantorderidrequest
  3236. return c
  3237. }
  3238. // Fields allows partial responses to be retrieved. See
  3239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3240. // for more information.
  3241. func (c *OrdersUpdatemerchantorderidCall) Fields(s ...googleapi.Field) *OrdersUpdatemerchantorderidCall {
  3242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3243. return c
  3244. }
  3245. // Context sets the context to be used in this call's Do method. Any
  3246. // pending HTTP request will be aborted if the provided context is
  3247. // canceled.
  3248. func (c *OrdersUpdatemerchantorderidCall) Context(ctx context.Context) *OrdersUpdatemerchantorderidCall {
  3249. c.ctx_ = ctx
  3250. return c
  3251. }
  3252. func (c *OrdersUpdatemerchantorderidCall) doRequest(alt string) (*http.Response, error) {
  3253. var body io.Reader = nil
  3254. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdatemerchantorderidrequest)
  3255. if err != nil {
  3256. return nil, err
  3257. }
  3258. ctype := "application/json"
  3259. c.urlParams_.Set("alt", alt)
  3260. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateMerchantOrderId")
  3261. urls += "?" + c.urlParams_.Encode()
  3262. req, _ := http.NewRequest("POST", urls, body)
  3263. googleapi.Expand(req.URL, map[string]string{
  3264. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3265. "orderId": c.orderId,
  3266. })
  3267. req.Header.Set("Content-Type", ctype)
  3268. req.Header.Set("User-Agent", c.s.userAgent())
  3269. if c.ctx_ != nil {
  3270. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3271. }
  3272. return c.s.client.Do(req)
  3273. }
  3274. // Do executes the "content.orders.updatemerchantorderid" call.
  3275. // Exactly one of *OrdersUpdateMerchantOrderIdResponse or error will be
  3276. // non-nil. Any non-2xx status code is an error. Response headers are in
  3277. // either *OrdersUpdateMerchantOrderIdResponse.ServerResponse.Header or
  3278. // (if a response was returned at all) in
  3279. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3280. // whether the returned error was because http.StatusNotModified was
  3281. // returned.
  3282. func (c *OrdersUpdatemerchantorderidCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateMerchantOrderIdResponse, error) {
  3283. gensupport.SetOptions(c.urlParams_, opts...)
  3284. res, err := c.doRequest("json")
  3285. if res != nil && res.StatusCode == http.StatusNotModified {
  3286. if res.Body != nil {
  3287. res.Body.Close()
  3288. }
  3289. return nil, &googleapi.Error{
  3290. Code: res.StatusCode,
  3291. Header: res.Header,
  3292. }
  3293. }
  3294. if err != nil {
  3295. return nil, err
  3296. }
  3297. defer googleapi.CloseBody(res)
  3298. if err := googleapi.CheckResponse(res); err != nil {
  3299. return nil, err
  3300. }
  3301. ret := &OrdersUpdateMerchantOrderIdResponse{
  3302. ServerResponse: googleapi.ServerResponse{
  3303. Header: res.Header,
  3304. HTTPStatusCode: res.StatusCode,
  3305. },
  3306. }
  3307. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3308. return nil, err
  3309. }
  3310. return ret, nil
  3311. // {
  3312. // "description": "Updates the merchant order ID for a given order.",
  3313. // "httpMethod": "POST",
  3314. // "id": "content.orders.updatemerchantorderid",
  3315. // "parameterOrder": [
  3316. // "merchantId",
  3317. // "orderId"
  3318. // ],
  3319. // "parameters": {
  3320. // "merchantId": {
  3321. // "description": "The ID of the managing account.",
  3322. // "format": "uint64",
  3323. // "location": "path",
  3324. // "required": true,
  3325. // "type": "string"
  3326. // },
  3327. // "orderId": {
  3328. // "description": "The ID of the order.",
  3329. // "location": "path",
  3330. // "required": true,
  3331. // "type": "string"
  3332. // }
  3333. // },
  3334. // "path": "{merchantId}/orders/{orderId}/updateMerchantOrderId",
  3335. // "request": {
  3336. // "$ref": "OrdersUpdateMerchantOrderIdRequest"
  3337. // },
  3338. // "response": {
  3339. // "$ref": "OrdersUpdateMerchantOrderIdResponse"
  3340. // },
  3341. // "scopes": [
  3342. // "https://www.googleapis.com/auth/content"
  3343. // ]
  3344. // }
  3345. }
  3346. // method id "content.orders.updateshipment":
  3347. type OrdersUpdateshipmentCall struct {
  3348. s *Service
  3349. merchantId uint64
  3350. orderId string
  3351. ordersupdateshipmentrequest *OrdersUpdateShipmentRequest
  3352. urlParams_ gensupport.URLParams
  3353. ctx_ context.Context
  3354. }
  3355. // Updateshipment: Updates a shipment's status, carrier, and/or tracking
  3356. // ID.
  3357. func (r *OrdersService) Updateshipment(merchantId uint64, orderId string, ordersupdateshipmentrequest *OrdersUpdateShipmentRequest) *OrdersUpdateshipmentCall {
  3358. c := &OrdersUpdateshipmentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3359. c.merchantId = merchantId
  3360. c.orderId = orderId
  3361. c.ordersupdateshipmentrequest = ordersupdateshipmentrequest
  3362. return c
  3363. }
  3364. // Fields allows partial responses to be retrieved. See
  3365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3366. // for more information.
  3367. func (c *OrdersUpdateshipmentCall) Fields(s ...googleapi.Field) *OrdersUpdateshipmentCall {
  3368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3369. return c
  3370. }
  3371. // Context sets the context to be used in this call's Do method. Any
  3372. // pending HTTP request will be aborted if the provided context is
  3373. // canceled.
  3374. func (c *OrdersUpdateshipmentCall) Context(ctx context.Context) *OrdersUpdateshipmentCall {
  3375. c.ctx_ = ctx
  3376. return c
  3377. }
  3378. func (c *OrdersUpdateshipmentCall) doRequest(alt string) (*http.Response, error) {
  3379. var body io.Reader = nil
  3380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ordersupdateshipmentrequest)
  3381. if err != nil {
  3382. return nil, err
  3383. }
  3384. ctype := "application/json"
  3385. c.urlParams_.Set("alt", alt)
  3386. urls := googleapi.ResolveRelative(c.s.BasePath, "{merchantId}/orders/{orderId}/updateShipment")
  3387. urls += "?" + c.urlParams_.Encode()
  3388. req, _ := http.NewRequest("POST", urls, body)
  3389. googleapi.Expand(req.URL, map[string]string{
  3390. "merchantId": strconv.FormatUint(c.merchantId, 10),
  3391. "orderId": c.orderId,
  3392. })
  3393. req.Header.Set("Content-Type", ctype)
  3394. req.Header.Set("User-Agent", c.s.userAgent())
  3395. if c.ctx_ != nil {
  3396. return ctxhttp.Do(c.ctx_, c.s.client, req)
  3397. }
  3398. return c.s.client.Do(req)
  3399. }
  3400. // Do executes the "content.orders.updateshipment" call.
  3401. // Exactly one of *OrdersUpdateShipmentResponse or error will be
  3402. // non-nil. Any non-2xx status code is an error. Response headers are in
  3403. // either *OrdersUpdateShipmentResponse.ServerResponse.Header or (if a
  3404. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3405. // googleapi.IsNotModified to check whether the returned error was
  3406. // because http.StatusNotModified was returned.
  3407. func (c *OrdersUpdateshipmentCall) Do(opts ...googleapi.CallOption) (*OrdersUpdateShipmentResponse, error) {
  3408. gensupport.SetOptions(c.urlParams_, opts...)
  3409. res, err := c.doRequest("json")
  3410. if res != nil && res.StatusCode == http.StatusNotModified {
  3411. if res.Body != nil {
  3412. res.Body.Close()
  3413. }
  3414. return nil, &googleapi.Error{
  3415. Code: res.StatusCode,
  3416. Header: res.Header,
  3417. }
  3418. }
  3419. if err != nil {
  3420. return nil, err
  3421. }
  3422. defer googleapi.CloseBody(res)
  3423. if err := googleapi.CheckResponse(res); err != nil {
  3424. return nil, err
  3425. }
  3426. ret := &OrdersUpdateShipmentResponse{
  3427. ServerResponse: googleapi.ServerResponse{
  3428. Header: res.Header,
  3429. HTTPStatusCode: res.StatusCode,
  3430. },
  3431. }
  3432. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  3433. return nil, err
  3434. }
  3435. return ret, nil
  3436. // {
  3437. // "description": "Updates a shipment's status, carrier, and/or tracking ID.",
  3438. // "httpMethod": "POST",
  3439. // "id": "content.orders.updateshipment",
  3440. // "parameterOrder": [
  3441. // "merchantId",
  3442. // "orderId"
  3443. // ],
  3444. // "parameters": {
  3445. // "merchantId": {
  3446. // "description": "The ID of the managing account.",
  3447. // "format": "uint64",
  3448. // "location": "path",
  3449. // "required": true,
  3450. // "type": "string"
  3451. // },
  3452. // "orderId": {
  3453. // "description": "The ID of the order.",
  3454. // "location": "path",
  3455. // "required": true,
  3456. // "type": "string"
  3457. // }
  3458. // },
  3459. // "path": "{merchantId}/orders/{orderId}/updateShipment",
  3460. // "request": {
  3461. // "$ref": "OrdersUpdateShipmentRequest"
  3462. // },
  3463. // "response": {
  3464. // "$ref": "OrdersUpdateShipmentResponse"
  3465. // },
  3466. // "scopes": [
  3467. // "https://www.googleapis.com/auth/content"
  3468. // ]
  3469. // }
  3470. }