reseller-gen.go 75 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322
  1. // Package reseller provides access to the Enterprise Apps Reseller API.
  2. //
  3. // See https://developers.google.com/google-apps/reseller/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/reseller/v1"
  8. // ...
  9. // resellerService, err := reseller.New(oauthHttpClient)
  10. package reseller // import "google.golang.org/api/reseller/v1"
  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 = "reseller:v1"
  41. const apiName = "reseller"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/apps/reseller/v1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage users on your domain
  47. AppsOrderScope = "https://www.googleapis.com/auth/apps.order"
  48. // Manage users on your domain
  49. AppsOrderReadonlyScope = "https://www.googleapis.com/auth/apps.order.readonly"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Customers = NewCustomersService(s)
  57. s.Subscriptions = NewSubscriptionsService(s)
  58. return s, nil
  59. }
  60. type Service struct {
  61. client *http.Client
  62. BasePath string // API endpoint base URL
  63. UserAgent string // optional additional User-Agent fragment
  64. Customers *CustomersService
  65. Subscriptions *SubscriptionsService
  66. }
  67. func (s *Service) userAgent() string {
  68. if s.UserAgent == "" {
  69. return googleapi.UserAgent
  70. }
  71. return googleapi.UserAgent + " " + s.UserAgent
  72. }
  73. func NewCustomersService(s *Service) *CustomersService {
  74. rs := &CustomersService{s: s}
  75. return rs
  76. }
  77. type CustomersService struct {
  78. s *Service
  79. }
  80. func NewSubscriptionsService(s *Service) *SubscriptionsService {
  81. rs := &SubscriptionsService{s: s}
  82. return rs
  83. }
  84. type SubscriptionsService struct {
  85. s *Service
  86. }
  87. // Address: JSON template for address of a customer.
  88. type Address struct {
  89. // AddressLine1: Address line 1 of the address.
  90. AddressLine1 string `json:"addressLine1,omitempty"`
  91. // AddressLine2: Address line 2 of the address.
  92. AddressLine2 string `json:"addressLine2,omitempty"`
  93. // AddressLine3: Address line 3 of the address.
  94. AddressLine3 string `json:"addressLine3,omitempty"`
  95. // ContactName: Name of the contact person.
  96. ContactName string `json:"contactName,omitempty"`
  97. // CountryCode: ISO 3166 country code.
  98. CountryCode string `json:"countryCode,omitempty"`
  99. // Kind: Identifies the resource as a customer address.
  100. Kind string `json:"kind,omitempty"`
  101. // Locality: Name of the locality. This is in accordance with -
  102. // http://portablecontacts.net/draft-spec.html#address_element.
  103. Locality string `json:"locality,omitempty"`
  104. // OrganizationName: Name of the organization.
  105. OrganizationName string `json:"organizationName,omitempty"`
  106. // PostalCode: The postal code. This is in accordance with -
  107. // http://portablecontacts.net/draft-spec.html#address_element.
  108. PostalCode string `json:"postalCode,omitempty"`
  109. // Region: Name of the region. This is in accordance with -
  110. // http://portablecontacts.net/draft-spec.html#address_element.
  111. Region string `json:"region,omitempty"`
  112. // ForceSendFields is a list of field names (e.g. "AddressLine1") to
  113. // unconditionally include in API requests. By default, fields with
  114. // empty values are omitted from API requests. However, any non-pointer,
  115. // non-interface field appearing in ForceSendFields will be sent to the
  116. // server regardless of whether the field is empty or not. This may be
  117. // used to include empty fields in Patch requests.
  118. ForceSendFields []string `json:"-"`
  119. }
  120. func (s *Address) MarshalJSON() ([]byte, error) {
  121. type noMethod Address
  122. raw := noMethod(*s)
  123. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  124. }
  125. // ChangePlanRequest: JSON template for the ChangePlan rpc request.
  126. type ChangePlanRequest struct {
  127. // Kind: Identifies the resource as a subscription change plan request.
  128. Kind string `json:"kind,omitempty"`
  129. // PlanName: Name of the plan to change to.
  130. PlanName string `json:"planName,omitempty"`
  131. // PurchaseOrderId: Purchase order id for your order tracking purposes.
  132. PurchaseOrderId string `json:"purchaseOrderId,omitempty"`
  133. // Seats: Number/Limit of seats in the new plan.
  134. Seats *Seats `json:"seats,omitempty"`
  135. // ForceSendFields is a list of field names (e.g. "Kind") to
  136. // unconditionally include in API requests. By default, fields with
  137. // empty values are omitted from API requests. However, any non-pointer,
  138. // non-interface field appearing in ForceSendFields will be sent to the
  139. // server regardless of whether the field is empty or not. This may be
  140. // used to include empty fields in Patch requests.
  141. ForceSendFields []string `json:"-"`
  142. }
  143. func (s *ChangePlanRequest) MarshalJSON() ([]byte, error) {
  144. type noMethod ChangePlanRequest
  145. raw := noMethod(*s)
  146. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  147. }
  148. // Customer: JSON template for a customer.
  149. type Customer struct {
  150. // AlternateEmail: The alternate email of the customer.
  151. AlternateEmail string `json:"alternateEmail,omitempty"`
  152. // CustomerDomain: The domain name of the customer.
  153. CustomerDomain string `json:"customerDomain,omitempty"`
  154. // CustomerDomainVerified: Whether the customer's primary domain has
  155. // been verified.
  156. CustomerDomainVerified bool `json:"customerDomainVerified,omitempty"`
  157. // CustomerId: The id of the customer.
  158. CustomerId string `json:"customerId,omitempty"`
  159. // Kind: Identifies the resource as a customer.
  160. Kind string `json:"kind,omitempty"`
  161. // PhoneNumber: The phone number of the customer.
  162. PhoneNumber string `json:"phoneNumber,omitempty"`
  163. // PostalAddress: The postal address of the customer.
  164. PostalAddress *Address `json:"postalAddress,omitempty"`
  165. // ResourceUiUrl: Ui url for customer resource.
  166. ResourceUiUrl string `json:"resourceUiUrl,omitempty"`
  167. // ServerResponse contains the HTTP response code and headers from the
  168. // server.
  169. googleapi.ServerResponse `json:"-"`
  170. // ForceSendFields is a list of field names (e.g. "AlternateEmail") to
  171. // unconditionally include in API requests. By default, fields with
  172. // empty values are omitted from API requests. However, any non-pointer,
  173. // non-interface field appearing in ForceSendFields will be sent to the
  174. // server regardless of whether the field is empty or not. This may be
  175. // used to include empty fields in Patch requests.
  176. ForceSendFields []string `json:"-"`
  177. }
  178. func (s *Customer) MarshalJSON() ([]byte, error) {
  179. type noMethod Customer
  180. raw := noMethod(*s)
  181. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  182. }
  183. // RenewalSettings: JSON template for a subscription renewal settings.
  184. type RenewalSettings struct {
  185. // Kind: Identifies the resource as a subscription renewal setting.
  186. Kind string `json:"kind,omitempty"`
  187. // RenewalType: Subscription renewal type.
  188. RenewalType string `json:"renewalType,omitempty"`
  189. // ForceSendFields is a list of field names (e.g. "Kind") to
  190. // unconditionally include in API requests. By default, fields with
  191. // empty values are omitted from API requests. However, any non-pointer,
  192. // non-interface field appearing in ForceSendFields will be sent to the
  193. // server regardless of whether the field is empty or not. This may be
  194. // used to include empty fields in Patch requests.
  195. ForceSendFields []string `json:"-"`
  196. }
  197. func (s *RenewalSettings) MarshalJSON() ([]byte, error) {
  198. type noMethod RenewalSettings
  199. raw := noMethod(*s)
  200. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  201. }
  202. // Seats: JSON template for subscription seats.
  203. type Seats struct {
  204. // Kind: Identifies the resource as a subscription change plan request.
  205. Kind string `json:"kind,omitempty"`
  206. // LicensedNumberOfSeats: Read-only field containing the current number
  207. // of licensed seats for FLEXIBLE Google-Apps subscriptions and
  208. // secondary subscriptions such as Google-Vault and Drive-storage.
  209. LicensedNumberOfSeats int64 `json:"licensedNumberOfSeats,omitempty"`
  210. // MaximumNumberOfSeats: Maximum number of seats that can be purchased.
  211. // This needs to be provided only for a non-commitment plan. For a
  212. // commitment plan it is decided by the contract.
  213. MaximumNumberOfSeats int64 `json:"maximumNumberOfSeats,omitempty"`
  214. // NumberOfSeats: Number of seats to purchase. This is applicable only
  215. // for a commitment plan.
  216. NumberOfSeats int64 `json:"numberOfSeats,omitempty"`
  217. // ForceSendFields is a list of field names (e.g. "Kind") to
  218. // unconditionally include in API requests. By default, fields with
  219. // empty values are omitted from API requests. However, any non-pointer,
  220. // non-interface field appearing in ForceSendFields will be sent to the
  221. // server regardless of whether the field is empty or not. This may be
  222. // used to include empty fields in Patch requests.
  223. ForceSendFields []string `json:"-"`
  224. }
  225. func (s *Seats) MarshalJSON() ([]byte, error) {
  226. type noMethod Seats
  227. raw := noMethod(*s)
  228. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  229. }
  230. // Subscription: JSON template for a subscription.
  231. type Subscription struct {
  232. // BillingMethod: Billing method of this subscription.
  233. BillingMethod string `json:"billingMethod,omitempty"`
  234. // CreationTime: Creation time of this subscription in milliseconds
  235. // since Unix epoch.
  236. CreationTime int64 `json:"creationTime,omitempty,string"`
  237. // CustomerId: The id of the customer to whom the subscription belongs.
  238. CustomerId string `json:"customerId,omitempty"`
  239. // Kind: Identifies the resource as a Subscription.
  240. Kind string `json:"kind,omitempty"`
  241. // Plan: Plan details of the subscription
  242. Plan *SubscriptionPlan `json:"plan,omitempty"`
  243. // PurchaseOrderId: Purchase order id for your order tracking purposes.
  244. PurchaseOrderId string `json:"purchaseOrderId,omitempty"`
  245. // RenewalSettings: Renewal settings of the subscription.
  246. RenewalSettings *RenewalSettings `json:"renewalSettings,omitempty"`
  247. // ResourceUiUrl: Ui url for subscription resource.
  248. ResourceUiUrl string `json:"resourceUiUrl,omitempty"`
  249. // Seats: Number/Limit of seats in the new plan.
  250. Seats *Seats `json:"seats,omitempty"`
  251. // SkuId: Name of the sku for which this subscription is purchased.
  252. SkuId string `json:"skuId,omitempty"`
  253. // Status: Status of the subscription.
  254. Status string `json:"status,omitempty"`
  255. // SubscriptionId: The id of the subscription.
  256. SubscriptionId string `json:"subscriptionId,omitempty"`
  257. // SuspensionReasons: field listing all current reasons the subscription
  258. // is suspended. It is possible for a subscription to have multiple
  259. // suspension reasons. A subscription's status is SUSPENDED until all
  260. // pending suspensions are removed. Possible options include:
  261. // - PENDING_TOS_ACCEPTANCE — The customer has not logged in and
  262. // accepted the Google Apps Resold Terms of Services.
  263. // - RENEWAL_WITH_TYPE_CANCEL — The customer's commitment ended and
  264. // their service was cancelled at the end of their term.
  265. // - RESELLER_INITIATED — A manual suspension invoked by a Reseller.
  266. //
  267. // - TRIAL_ENDED — The customer's trial expired without a plan
  268. // selected.
  269. // - OTHER — The customer is suspended for an internal Google reason
  270. // (e.g. abuse or otherwise).
  271. SuspensionReasons []string `json:"suspensionReasons,omitempty"`
  272. // TransferInfo: Transfer related information for the subscription.
  273. TransferInfo *SubscriptionTransferInfo `json:"transferInfo,omitempty"`
  274. // TrialSettings: Trial Settings of the subscription.
  275. TrialSettings *SubscriptionTrialSettings `json:"trialSettings,omitempty"`
  276. // ServerResponse contains the HTTP response code and headers from the
  277. // server.
  278. googleapi.ServerResponse `json:"-"`
  279. // ForceSendFields is a list of field names (e.g. "BillingMethod") to
  280. // unconditionally include in API requests. By default, fields with
  281. // empty values are omitted from API requests. However, any non-pointer,
  282. // non-interface field appearing in ForceSendFields will be sent to the
  283. // server regardless of whether the field is empty or not. This may be
  284. // used to include empty fields in Patch requests.
  285. ForceSendFields []string `json:"-"`
  286. }
  287. func (s *Subscription) MarshalJSON() ([]byte, error) {
  288. type noMethod Subscription
  289. raw := noMethod(*s)
  290. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  291. }
  292. // SubscriptionPlan: Plan details of the subscription
  293. type SubscriptionPlan struct {
  294. // CommitmentInterval: Interval of the commitment if it is a commitment
  295. // plan.
  296. CommitmentInterval *SubscriptionPlanCommitmentInterval `json:"commitmentInterval,omitempty"`
  297. // IsCommitmentPlan: Whether the plan is a commitment plan or not.
  298. IsCommitmentPlan bool `json:"isCommitmentPlan,omitempty"`
  299. // PlanName: The plan name of this subscription's plan.
  300. PlanName string `json:"planName,omitempty"`
  301. // ForceSendFields is a list of field names (e.g. "CommitmentInterval")
  302. // to unconditionally include in API requests. By default, fields with
  303. // empty values are omitted from API requests. However, any non-pointer,
  304. // non-interface field appearing in ForceSendFields will be sent to the
  305. // server regardless of whether the field is empty or not. This may be
  306. // used to include empty fields in Patch requests.
  307. ForceSendFields []string `json:"-"`
  308. }
  309. func (s *SubscriptionPlan) MarshalJSON() ([]byte, error) {
  310. type noMethod SubscriptionPlan
  311. raw := noMethod(*s)
  312. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  313. }
  314. // SubscriptionPlanCommitmentInterval: Interval of the commitment if it
  315. // is a commitment plan.
  316. type SubscriptionPlanCommitmentInterval struct {
  317. // EndTime: End time of the commitment interval in milliseconds since
  318. // Unix epoch.
  319. EndTime int64 `json:"endTime,omitempty,string"`
  320. // StartTime: Start time of the commitment interval in milliseconds
  321. // since Unix epoch.
  322. StartTime int64 `json:"startTime,omitempty,string"`
  323. // ForceSendFields is a list of field names (e.g. "EndTime") to
  324. // unconditionally include in API requests. By default, fields with
  325. // empty values are omitted from API requests. However, any non-pointer,
  326. // non-interface field appearing in ForceSendFields will be sent to the
  327. // server regardless of whether the field is empty or not. This may be
  328. // used to include empty fields in Patch requests.
  329. ForceSendFields []string `json:"-"`
  330. }
  331. func (s *SubscriptionPlanCommitmentInterval) MarshalJSON() ([]byte, error) {
  332. type noMethod SubscriptionPlanCommitmentInterval
  333. raw := noMethod(*s)
  334. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  335. }
  336. // SubscriptionTransferInfo: Transfer related information for the
  337. // subscription.
  338. type SubscriptionTransferInfo struct {
  339. MinimumTransferableSeats int64 `json:"minimumTransferableSeats,omitempty"`
  340. // TransferabilityExpirationTime: Time when transfer token or intent to
  341. // transfer will expire.
  342. TransferabilityExpirationTime int64 `json:"transferabilityExpirationTime,omitempty,string"`
  343. // ForceSendFields is a list of field names (e.g.
  344. // "MinimumTransferableSeats") to unconditionally include in API
  345. // requests. By default, fields with empty values are omitted from API
  346. // requests. However, any non-pointer, non-interface field appearing in
  347. // ForceSendFields will be sent to the server regardless of whether the
  348. // field is empty or not. This may be used to include empty fields in
  349. // Patch requests.
  350. ForceSendFields []string `json:"-"`
  351. }
  352. func (s *SubscriptionTransferInfo) MarshalJSON() ([]byte, error) {
  353. type noMethod SubscriptionTransferInfo
  354. raw := noMethod(*s)
  355. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  356. }
  357. // SubscriptionTrialSettings: Trial Settings of the subscription.
  358. type SubscriptionTrialSettings struct {
  359. // IsInTrial: Whether the subscription is in trial.
  360. IsInTrial bool `json:"isInTrial,omitempty"`
  361. // TrialEndTime: End time of the trial in milliseconds since Unix epoch.
  362. TrialEndTime int64 `json:"trialEndTime,omitempty,string"`
  363. // ForceSendFields is a list of field names (e.g. "IsInTrial") to
  364. // unconditionally include in API requests. By default, fields with
  365. // empty values are omitted from API requests. However, any non-pointer,
  366. // non-interface field appearing in ForceSendFields will be sent to the
  367. // server regardless of whether the field is empty or not. This may be
  368. // used to include empty fields in Patch requests.
  369. ForceSendFields []string `json:"-"`
  370. }
  371. func (s *SubscriptionTrialSettings) MarshalJSON() ([]byte, error) {
  372. type noMethod SubscriptionTrialSettings
  373. raw := noMethod(*s)
  374. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  375. }
  376. // Subscriptions: JSON template for a subscription list.
  377. type Subscriptions struct {
  378. // Kind: Identifies the resource as a collection of subscriptions.
  379. Kind string `json:"kind,omitempty"`
  380. // NextPageToken: The continuation token, used to page through large
  381. // result sets. Provide this value in a subsequent request to return the
  382. // next page of results.
  383. NextPageToken string `json:"nextPageToken,omitempty"`
  384. // Subscriptions: The subscriptions in this page of results.
  385. Subscriptions []*Subscription `json:"subscriptions,omitempty"`
  386. // ServerResponse contains the HTTP response code and headers from the
  387. // server.
  388. googleapi.ServerResponse `json:"-"`
  389. // ForceSendFields is a list of field names (e.g. "Kind") to
  390. // unconditionally include in API requests. By default, fields with
  391. // empty values are omitted from API requests. However, any non-pointer,
  392. // non-interface field appearing in ForceSendFields will be sent to the
  393. // server regardless of whether the field is empty or not. This may be
  394. // used to include empty fields in Patch requests.
  395. ForceSendFields []string `json:"-"`
  396. }
  397. func (s *Subscriptions) MarshalJSON() ([]byte, error) {
  398. type noMethod Subscriptions
  399. raw := noMethod(*s)
  400. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  401. }
  402. // method id "reseller.customers.get":
  403. type CustomersGetCall struct {
  404. s *Service
  405. customerId string
  406. urlParams_ gensupport.URLParams
  407. ifNoneMatch_ string
  408. ctx_ context.Context
  409. }
  410. // Get: Gets a customer resource if one exists and is owned by the
  411. // reseller.
  412. func (r *CustomersService) Get(customerId string) *CustomersGetCall {
  413. c := &CustomersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  414. c.customerId = customerId
  415. return c
  416. }
  417. // Fields allows partial responses to be retrieved. See
  418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  419. // for more information.
  420. func (c *CustomersGetCall) Fields(s ...googleapi.Field) *CustomersGetCall {
  421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  422. return c
  423. }
  424. // IfNoneMatch sets the optional parameter which makes the operation
  425. // fail if the object's ETag matches the given value. This is useful for
  426. // getting updates only after the object has changed since the last
  427. // request. Use googleapi.IsNotModified to check whether the response
  428. // error from Do is the result of In-None-Match.
  429. func (c *CustomersGetCall) IfNoneMatch(entityTag string) *CustomersGetCall {
  430. c.ifNoneMatch_ = entityTag
  431. return c
  432. }
  433. // Context sets the context to be used in this call's Do method. Any
  434. // pending HTTP request will be aborted if the provided context is
  435. // canceled.
  436. func (c *CustomersGetCall) Context(ctx context.Context) *CustomersGetCall {
  437. c.ctx_ = ctx
  438. return c
  439. }
  440. func (c *CustomersGetCall) doRequest(alt string) (*http.Response, error) {
  441. var body io.Reader = nil
  442. c.urlParams_.Set("alt", alt)
  443. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}")
  444. urls += "?" + c.urlParams_.Encode()
  445. req, _ := http.NewRequest("GET", urls, body)
  446. googleapi.Expand(req.URL, map[string]string{
  447. "customerId": c.customerId,
  448. })
  449. req.Header.Set("User-Agent", c.s.userAgent())
  450. if c.ifNoneMatch_ != "" {
  451. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  452. }
  453. if c.ctx_ != nil {
  454. return ctxhttp.Do(c.ctx_, c.s.client, req)
  455. }
  456. return c.s.client.Do(req)
  457. }
  458. // Do executes the "reseller.customers.get" call.
  459. // Exactly one of *Customer or error will be non-nil. Any non-2xx status
  460. // code is an error. Response headers are in either
  461. // *Customer.ServerResponse.Header or (if a response was returned at
  462. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  463. // to check whether the returned error was because
  464. // http.StatusNotModified was returned.
  465. func (c *CustomersGetCall) Do(opts ...googleapi.CallOption) (*Customer, error) {
  466. gensupport.SetOptions(c.urlParams_, opts...)
  467. res, err := c.doRequest("json")
  468. if res != nil && res.StatusCode == http.StatusNotModified {
  469. if res.Body != nil {
  470. res.Body.Close()
  471. }
  472. return nil, &googleapi.Error{
  473. Code: res.StatusCode,
  474. Header: res.Header,
  475. }
  476. }
  477. if err != nil {
  478. return nil, err
  479. }
  480. defer googleapi.CloseBody(res)
  481. if err := googleapi.CheckResponse(res); err != nil {
  482. return nil, err
  483. }
  484. ret := &Customer{
  485. ServerResponse: googleapi.ServerResponse{
  486. Header: res.Header,
  487. HTTPStatusCode: res.StatusCode,
  488. },
  489. }
  490. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  491. return nil, err
  492. }
  493. return ret, nil
  494. // {
  495. // "description": "Gets a customer resource if one exists and is owned by the reseller.",
  496. // "httpMethod": "GET",
  497. // "id": "reseller.customers.get",
  498. // "parameterOrder": [
  499. // "customerId"
  500. // ],
  501. // "parameters": {
  502. // "customerId": {
  503. // "description": "Id of the Customer",
  504. // "location": "path",
  505. // "required": true,
  506. // "type": "string"
  507. // }
  508. // },
  509. // "path": "customers/{customerId}",
  510. // "response": {
  511. // "$ref": "Customer"
  512. // },
  513. // "scopes": [
  514. // "https://www.googleapis.com/auth/apps.order",
  515. // "https://www.googleapis.com/auth/apps.order.readonly"
  516. // ]
  517. // }
  518. }
  519. // method id "reseller.customers.insert":
  520. type CustomersInsertCall struct {
  521. s *Service
  522. customer *Customer
  523. urlParams_ gensupport.URLParams
  524. ctx_ context.Context
  525. }
  526. // Insert: Creates a customer resource if one does not already exist.
  527. func (r *CustomersService) Insert(customer *Customer) *CustomersInsertCall {
  528. c := &CustomersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  529. c.customer = customer
  530. return c
  531. }
  532. // CustomerAuthToken sets the optional parameter "customerAuthToken": An
  533. // auth token needed for inserting a customer for which domain already
  534. // exists. Can be generated at https://admin.google.com/TransferToken.
  535. func (c *CustomersInsertCall) CustomerAuthToken(customerAuthToken string) *CustomersInsertCall {
  536. c.urlParams_.Set("customerAuthToken", customerAuthToken)
  537. return c
  538. }
  539. // Fields allows partial responses to be retrieved. See
  540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  541. // for more information.
  542. func (c *CustomersInsertCall) Fields(s ...googleapi.Field) *CustomersInsertCall {
  543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  544. return c
  545. }
  546. // Context sets the context to be used in this call's Do method. Any
  547. // pending HTTP request will be aborted if the provided context is
  548. // canceled.
  549. func (c *CustomersInsertCall) Context(ctx context.Context) *CustomersInsertCall {
  550. c.ctx_ = ctx
  551. return c
  552. }
  553. func (c *CustomersInsertCall) doRequest(alt string) (*http.Response, error) {
  554. var body io.Reader = nil
  555. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer)
  556. if err != nil {
  557. return nil, err
  558. }
  559. ctype := "application/json"
  560. c.urlParams_.Set("alt", alt)
  561. urls := googleapi.ResolveRelative(c.s.BasePath, "customers")
  562. urls += "?" + c.urlParams_.Encode()
  563. req, _ := http.NewRequest("POST", urls, body)
  564. googleapi.SetOpaque(req.URL)
  565. req.Header.Set("Content-Type", ctype)
  566. req.Header.Set("User-Agent", c.s.userAgent())
  567. if c.ctx_ != nil {
  568. return ctxhttp.Do(c.ctx_, c.s.client, req)
  569. }
  570. return c.s.client.Do(req)
  571. }
  572. // Do executes the "reseller.customers.insert" call.
  573. // Exactly one of *Customer or error will be non-nil. Any non-2xx status
  574. // code is an error. Response headers are in either
  575. // *Customer.ServerResponse.Header or (if a response was returned at
  576. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  577. // to check whether the returned error was because
  578. // http.StatusNotModified was returned.
  579. func (c *CustomersInsertCall) Do(opts ...googleapi.CallOption) (*Customer, error) {
  580. gensupport.SetOptions(c.urlParams_, opts...)
  581. res, err := c.doRequest("json")
  582. if res != nil && res.StatusCode == http.StatusNotModified {
  583. if res.Body != nil {
  584. res.Body.Close()
  585. }
  586. return nil, &googleapi.Error{
  587. Code: res.StatusCode,
  588. Header: res.Header,
  589. }
  590. }
  591. if err != nil {
  592. return nil, err
  593. }
  594. defer googleapi.CloseBody(res)
  595. if err := googleapi.CheckResponse(res); err != nil {
  596. return nil, err
  597. }
  598. ret := &Customer{
  599. ServerResponse: googleapi.ServerResponse{
  600. Header: res.Header,
  601. HTTPStatusCode: res.StatusCode,
  602. },
  603. }
  604. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  605. return nil, err
  606. }
  607. return ret, nil
  608. // {
  609. // "description": "Creates a customer resource if one does not already exist.",
  610. // "httpMethod": "POST",
  611. // "id": "reseller.customers.insert",
  612. // "parameters": {
  613. // "customerAuthToken": {
  614. // "description": "An auth token needed for inserting a customer for which domain already exists. Can be generated at https://admin.google.com/TransferToken. Optional.",
  615. // "location": "query",
  616. // "type": "string"
  617. // }
  618. // },
  619. // "path": "customers",
  620. // "request": {
  621. // "$ref": "Customer"
  622. // },
  623. // "response": {
  624. // "$ref": "Customer"
  625. // },
  626. // "scopes": [
  627. // "https://www.googleapis.com/auth/apps.order"
  628. // ]
  629. // }
  630. }
  631. // method id "reseller.customers.patch":
  632. type CustomersPatchCall struct {
  633. s *Service
  634. customerId string
  635. customer *Customer
  636. urlParams_ gensupport.URLParams
  637. ctx_ context.Context
  638. }
  639. // Patch: Update a customer resource if one it exists and is owned by
  640. // the reseller. This method supports patch semantics.
  641. func (r *CustomersService) Patch(customerId string, customer *Customer) *CustomersPatchCall {
  642. c := &CustomersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  643. c.customerId = customerId
  644. c.customer = customer
  645. return c
  646. }
  647. // Fields allows partial responses to be retrieved. See
  648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  649. // for more information.
  650. func (c *CustomersPatchCall) Fields(s ...googleapi.Field) *CustomersPatchCall {
  651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  652. return c
  653. }
  654. // Context sets the context to be used in this call's Do method. Any
  655. // pending HTTP request will be aborted if the provided context is
  656. // canceled.
  657. func (c *CustomersPatchCall) Context(ctx context.Context) *CustomersPatchCall {
  658. c.ctx_ = ctx
  659. return c
  660. }
  661. func (c *CustomersPatchCall) doRequest(alt string) (*http.Response, error) {
  662. var body io.Reader = nil
  663. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer)
  664. if err != nil {
  665. return nil, err
  666. }
  667. ctype := "application/json"
  668. c.urlParams_.Set("alt", alt)
  669. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}")
  670. urls += "?" + c.urlParams_.Encode()
  671. req, _ := http.NewRequest("PATCH", urls, body)
  672. googleapi.Expand(req.URL, map[string]string{
  673. "customerId": c.customerId,
  674. })
  675. req.Header.Set("Content-Type", ctype)
  676. req.Header.Set("User-Agent", c.s.userAgent())
  677. if c.ctx_ != nil {
  678. return ctxhttp.Do(c.ctx_, c.s.client, req)
  679. }
  680. return c.s.client.Do(req)
  681. }
  682. // Do executes the "reseller.customers.patch" call.
  683. // Exactly one of *Customer or error will be non-nil. Any non-2xx status
  684. // code is an error. Response headers are in either
  685. // *Customer.ServerResponse.Header or (if a response was returned at
  686. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  687. // to check whether the returned error was because
  688. // http.StatusNotModified was returned.
  689. func (c *CustomersPatchCall) Do(opts ...googleapi.CallOption) (*Customer, error) {
  690. gensupport.SetOptions(c.urlParams_, opts...)
  691. res, err := c.doRequest("json")
  692. if res != nil && res.StatusCode == http.StatusNotModified {
  693. if res.Body != nil {
  694. res.Body.Close()
  695. }
  696. return nil, &googleapi.Error{
  697. Code: res.StatusCode,
  698. Header: res.Header,
  699. }
  700. }
  701. if err != nil {
  702. return nil, err
  703. }
  704. defer googleapi.CloseBody(res)
  705. if err := googleapi.CheckResponse(res); err != nil {
  706. return nil, err
  707. }
  708. ret := &Customer{
  709. ServerResponse: googleapi.ServerResponse{
  710. Header: res.Header,
  711. HTTPStatusCode: res.StatusCode,
  712. },
  713. }
  714. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  715. return nil, err
  716. }
  717. return ret, nil
  718. // {
  719. // "description": "Update a customer resource if one it exists and is owned by the reseller. This method supports patch semantics.",
  720. // "httpMethod": "PATCH",
  721. // "id": "reseller.customers.patch",
  722. // "parameterOrder": [
  723. // "customerId"
  724. // ],
  725. // "parameters": {
  726. // "customerId": {
  727. // "description": "Id of the Customer",
  728. // "location": "path",
  729. // "required": true,
  730. // "type": "string"
  731. // }
  732. // },
  733. // "path": "customers/{customerId}",
  734. // "request": {
  735. // "$ref": "Customer"
  736. // },
  737. // "response": {
  738. // "$ref": "Customer"
  739. // },
  740. // "scopes": [
  741. // "https://www.googleapis.com/auth/apps.order"
  742. // ]
  743. // }
  744. }
  745. // method id "reseller.customers.update":
  746. type CustomersUpdateCall struct {
  747. s *Service
  748. customerId string
  749. customer *Customer
  750. urlParams_ gensupport.URLParams
  751. ctx_ context.Context
  752. }
  753. // Update: Update a customer resource if one it exists and is owned by
  754. // the reseller.
  755. func (r *CustomersService) Update(customerId string, customer *Customer) *CustomersUpdateCall {
  756. c := &CustomersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  757. c.customerId = customerId
  758. c.customer = customer
  759. return c
  760. }
  761. // Fields allows partial responses to be retrieved. See
  762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  763. // for more information.
  764. func (c *CustomersUpdateCall) Fields(s ...googleapi.Field) *CustomersUpdateCall {
  765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  766. return c
  767. }
  768. // Context sets the context to be used in this call's Do method. Any
  769. // pending HTTP request will be aborted if the provided context is
  770. // canceled.
  771. func (c *CustomersUpdateCall) Context(ctx context.Context) *CustomersUpdateCall {
  772. c.ctx_ = ctx
  773. return c
  774. }
  775. func (c *CustomersUpdateCall) doRequest(alt string) (*http.Response, error) {
  776. var body io.Reader = nil
  777. body, err := googleapi.WithoutDataWrapper.JSONReader(c.customer)
  778. if err != nil {
  779. return nil, err
  780. }
  781. ctype := "application/json"
  782. c.urlParams_.Set("alt", alt)
  783. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}")
  784. urls += "?" + c.urlParams_.Encode()
  785. req, _ := http.NewRequest("PUT", urls, body)
  786. googleapi.Expand(req.URL, map[string]string{
  787. "customerId": c.customerId,
  788. })
  789. req.Header.Set("Content-Type", ctype)
  790. req.Header.Set("User-Agent", c.s.userAgent())
  791. if c.ctx_ != nil {
  792. return ctxhttp.Do(c.ctx_, c.s.client, req)
  793. }
  794. return c.s.client.Do(req)
  795. }
  796. // Do executes the "reseller.customers.update" call.
  797. // Exactly one of *Customer or error will be non-nil. Any non-2xx status
  798. // code is an error. Response headers are in either
  799. // *Customer.ServerResponse.Header or (if a response was returned at
  800. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  801. // to check whether the returned error was because
  802. // http.StatusNotModified was returned.
  803. func (c *CustomersUpdateCall) Do(opts ...googleapi.CallOption) (*Customer, error) {
  804. gensupport.SetOptions(c.urlParams_, opts...)
  805. res, err := c.doRequest("json")
  806. if res != nil && res.StatusCode == http.StatusNotModified {
  807. if res.Body != nil {
  808. res.Body.Close()
  809. }
  810. return nil, &googleapi.Error{
  811. Code: res.StatusCode,
  812. Header: res.Header,
  813. }
  814. }
  815. if err != nil {
  816. return nil, err
  817. }
  818. defer googleapi.CloseBody(res)
  819. if err := googleapi.CheckResponse(res); err != nil {
  820. return nil, err
  821. }
  822. ret := &Customer{
  823. ServerResponse: googleapi.ServerResponse{
  824. Header: res.Header,
  825. HTTPStatusCode: res.StatusCode,
  826. },
  827. }
  828. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  829. return nil, err
  830. }
  831. return ret, nil
  832. // {
  833. // "description": "Update a customer resource if one it exists and is owned by the reseller.",
  834. // "httpMethod": "PUT",
  835. // "id": "reseller.customers.update",
  836. // "parameterOrder": [
  837. // "customerId"
  838. // ],
  839. // "parameters": {
  840. // "customerId": {
  841. // "description": "Id of the Customer",
  842. // "location": "path",
  843. // "required": true,
  844. // "type": "string"
  845. // }
  846. // },
  847. // "path": "customers/{customerId}",
  848. // "request": {
  849. // "$ref": "Customer"
  850. // },
  851. // "response": {
  852. // "$ref": "Customer"
  853. // },
  854. // "scopes": [
  855. // "https://www.googleapis.com/auth/apps.order"
  856. // ]
  857. // }
  858. }
  859. // method id "reseller.subscriptions.activate":
  860. type SubscriptionsActivateCall struct {
  861. s *Service
  862. customerId string
  863. subscriptionId string
  864. urlParams_ gensupport.URLParams
  865. ctx_ context.Context
  866. }
  867. // Activate: Activates a subscription previously suspended by the
  868. // reseller
  869. func (r *SubscriptionsService) Activate(customerId string, subscriptionId string) *SubscriptionsActivateCall {
  870. c := &SubscriptionsActivateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  871. c.customerId = customerId
  872. c.subscriptionId = subscriptionId
  873. return c
  874. }
  875. // Fields allows partial responses to be retrieved. See
  876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  877. // for more information.
  878. func (c *SubscriptionsActivateCall) Fields(s ...googleapi.Field) *SubscriptionsActivateCall {
  879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  880. return c
  881. }
  882. // Context sets the context to be used in this call's Do method. Any
  883. // pending HTTP request will be aborted if the provided context is
  884. // canceled.
  885. func (c *SubscriptionsActivateCall) Context(ctx context.Context) *SubscriptionsActivateCall {
  886. c.ctx_ = ctx
  887. return c
  888. }
  889. func (c *SubscriptionsActivateCall) doRequest(alt string) (*http.Response, error) {
  890. var body io.Reader = nil
  891. c.urlParams_.Set("alt", alt)
  892. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/activate")
  893. urls += "?" + c.urlParams_.Encode()
  894. req, _ := http.NewRequest("POST", urls, body)
  895. googleapi.Expand(req.URL, map[string]string{
  896. "customerId": c.customerId,
  897. "subscriptionId": c.subscriptionId,
  898. })
  899. req.Header.Set("User-Agent", c.s.userAgent())
  900. if c.ctx_ != nil {
  901. return ctxhttp.Do(c.ctx_, c.s.client, req)
  902. }
  903. return c.s.client.Do(req)
  904. }
  905. // Do executes the "reseller.subscriptions.activate" call.
  906. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  907. // status code is an error. Response headers are in either
  908. // *Subscription.ServerResponse.Header or (if a response was returned at
  909. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  910. // to check whether the returned error was because
  911. // http.StatusNotModified was returned.
  912. func (c *SubscriptionsActivateCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  913. gensupport.SetOptions(c.urlParams_, opts...)
  914. res, err := c.doRequest("json")
  915. if res != nil && res.StatusCode == http.StatusNotModified {
  916. if res.Body != nil {
  917. res.Body.Close()
  918. }
  919. return nil, &googleapi.Error{
  920. Code: res.StatusCode,
  921. Header: res.Header,
  922. }
  923. }
  924. if err != nil {
  925. return nil, err
  926. }
  927. defer googleapi.CloseBody(res)
  928. if err := googleapi.CheckResponse(res); err != nil {
  929. return nil, err
  930. }
  931. ret := &Subscription{
  932. ServerResponse: googleapi.ServerResponse{
  933. Header: res.Header,
  934. HTTPStatusCode: res.StatusCode,
  935. },
  936. }
  937. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  938. return nil, err
  939. }
  940. return ret, nil
  941. // {
  942. // "description": "Activates a subscription previously suspended by the reseller",
  943. // "httpMethod": "POST",
  944. // "id": "reseller.subscriptions.activate",
  945. // "parameterOrder": [
  946. // "customerId",
  947. // "subscriptionId"
  948. // ],
  949. // "parameters": {
  950. // "customerId": {
  951. // "description": "Id of the Customer",
  952. // "location": "path",
  953. // "required": true,
  954. // "type": "string"
  955. // },
  956. // "subscriptionId": {
  957. // "description": "Id of the subscription, which is unique for a customer",
  958. // "location": "path",
  959. // "required": true,
  960. // "type": "string"
  961. // }
  962. // },
  963. // "path": "customers/{customerId}/subscriptions/{subscriptionId}/activate",
  964. // "response": {
  965. // "$ref": "Subscription"
  966. // },
  967. // "scopes": [
  968. // "https://www.googleapis.com/auth/apps.order"
  969. // ]
  970. // }
  971. }
  972. // method id "reseller.subscriptions.changePlan":
  973. type SubscriptionsChangePlanCall struct {
  974. s *Service
  975. customerId string
  976. subscriptionId string
  977. changeplanrequest *ChangePlanRequest
  978. urlParams_ gensupport.URLParams
  979. ctx_ context.Context
  980. }
  981. // ChangePlan: Changes the plan of a subscription
  982. func (r *SubscriptionsService) ChangePlan(customerId string, subscriptionId string, changeplanrequest *ChangePlanRequest) *SubscriptionsChangePlanCall {
  983. c := &SubscriptionsChangePlanCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  984. c.customerId = customerId
  985. c.subscriptionId = subscriptionId
  986. c.changeplanrequest = changeplanrequest
  987. return c
  988. }
  989. // Fields allows partial responses to be retrieved. See
  990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  991. // for more information.
  992. func (c *SubscriptionsChangePlanCall) Fields(s ...googleapi.Field) *SubscriptionsChangePlanCall {
  993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  994. return c
  995. }
  996. // Context sets the context to be used in this call's Do method. Any
  997. // pending HTTP request will be aborted if the provided context is
  998. // canceled.
  999. func (c *SubscriptionsChangePlanCall) Context(ctx context.Context) *SubscriptionsChangePlanCall {
  1000. c.ctx_ = ctx
  1001. return c
  1002. }
  1003. func (c *SubscriptionsChangePlanCall) doRequest(alt string) (*http.Response, error) {
  1004. var body io.Reader = nil
  1005. body, err := googleapi.WithoutDataWrapper.JSONReader(c.changeplanrequest)
  1006. if err != nil {
  1007. return nil, err
  1008. }
  1009. ctype := "application/json"
  1010. c.urlParams_.Set("alt", alt)
  1011. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changePlan")
  1012. urls += "?" + c.urlParams_.Encode()
  1013. req, _ := http.NewRequest("POST", urls, body)
  1014. googleapi.Expand(req.URL, map[string]string{
  1015. "customerId": c.customerId,
  1016. "subscriptionId": c.subscriptionId,
  1017. })
  1018. req.Header.Set("Content-Type", ctype)
  1019. req.Header.Set("User-Agent", c.s.userAgent())
  1020. if c.ctx_ != nil {
  1021. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1022. }
  1023. return c.s.client.Do(req)
  1024. }
  1025. // Do executes the "reseller.subscriptions.changePlan" call.
  1026. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  1027. // status code is an error. Response headers are in either
  1028. // *Subscription.ServerResponse.Header or (if a response was returned at
  1029. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1030. // to check whether the returned error was because
  1031. // http.StatusNotModified was returned.
  1032. func (c *SubscriptionsChangePlanCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  1033. gensupport.SetOptions(c.urlParams_, opts...)
  1034. res, err := c.doRequest("json")
  1035. if res != nil && res.StatusCode == http.StatusNotModified {
  1036. if res.Body != nil {
  1037. res.Body.Close()
  1038. }
  1039. return nil, &googleapi.Error{
  1040. Code: res.StatusCode,
  1041. Header: res.Header,
  1042. }
  1043. }
  1044. if err != nil {
  1045. return nil, err
  1046. }
  1047. defer googleapi.CloseBody(res)
  1048. if err := googleapi.CheckResponse(res); err != nil {
  1049. return nil, err
  1050. }
  1051. ret := &Subscription{
  1052. ServerResponse: googleapi.ServerResponse{
  1053. Header: res.Header,
  1054. HTTPStatusCode: res.StatusCode,
  1055. },
  1056. }
  1057. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1058. return nil, err
  1059. }
  1060. return ret, nil
  1061. // {
  1062. // "description": "Changes the plan of a subscription",
  1063. // "httpMethod": "POST",
  1064. // "id": "reseller.subscriptions.changePlan",
  1065. // "parameterOrder": [
  1066. // "customerId",
  1067. // "subscriptionId"
  1068. // ],
  1069. // "parameters": {
  1070. // "customerId": {
  1071. // "description": "Id of the Customer",
  1072. // "location": "path",
  1073. // "required": true,
  1074. // "type": "string"
  1075. // },
  1076. // "subscriptionId": {
  1077. // "description": "Id of the subscription, which is unique for a customer",
  1078. // "location": "path",
  1079. // "required": true,
  1080. // "type": "string"
  1081. // }
  1082. // },
  1083. // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changePlan",
  1084. // "request": {
  1085. // "$ref": "ChangePlanRequest"
  1086. // },
  1087. // "response": {
  1088. // "$ref": "Subscription"
  1089. // },
  1090. // "scopes": [
  1091. // "https://www.googleapis.com/auth/apps.order"
  1092. // ]
  1093. // }
  1094. }
  1095. // method id "reseller.subscriptions.changeRenewalSettings":
  1096. type SubscriptionsChangeRenewalSettingsCall struct {
  1097. s *Service
  1098. customerId string
  1099. subscriptionId string
  1100. renewalsettings *RenewalSettings
  1101. urlParams_ gensupport.URLParams
  1102. ctx_ context.Context
  1103. }
  1104. // ChangeRenewalSettings: Changes the renewal settings of a subscription
  1105. func (r *SubscriptionsService) ChangeRenewalSettings(customerId string, subscriptionId string, renewalsettings *RenewalSettings) *SubscriptionsChangeRenewalSettingsCall {
  1106. c := &SubscriptionsChangeRenewalSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1107. c.customerId = customerId
  1108. c.subscriptionId = subscriptionId
  1109. c.renewalsettings = renewalsettings
  1110. return c
  1111. }
  1112. // Fields allows partial responses to be retrieved. See
  1113. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1114. // for more information.
  1115. func (c *SubscriptionsChangeRenewalSettingsCall) Fields(s ...googleapi.Field) *SubscriptionsChangeRenewalSettingsCall {
  1116. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1117. return c
  1118. }
  1119. // Context sets the context to be used in this call's Do method. Any
  1120. // pending HTTP request will be aborted if the provided context is
  1121. // canceled.
  1122. func (c *SubscriptionsChangeRenewalSettingsCall) Context(ctx context.Context) *SubscriptionsChangeRenewalSettingsCall {
  1123. c.ctx_ = ctx
  1124. return c
  1125. }
  1126. func (c *SubscriptionsChangeRenewalSettingsCall) doRequest(alt string) (*http.Response, error) {
  1127. var body io.Reader = nil
  1128. body, err := googleapi.WithoutDataWrapper.JSONReader(c.renewalsettings)
  1129. if err != nil {
  1130. return nil, err
  1131. }
  1132. ctype := "application/json"
  1133. c.urlParams_.Set("alt", alt)
  1134. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings")
  1135. urls += "?" + c.urlParams_.Encode()
  1136. req, _ := http.NewRequest("POST", urls, body)
  1137. googleapi.Expand(req.URL, map[string]string{
  1138. "customerId": c.customerId,
  1139. "subscriptionId": c.subscriptionId,
  1140. })
  1141. req.Header.Set("Content-Type", ctype)
  1142. req.Header.Set("User-Agent", c.s.userAgent())
  1143. if c.ctx_ != nil {
  1144. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1145. }
  1146. return c.s.client.Do(req)
  1147. }
  1148. // Do executes the "reseller.subscriptions.changeRenewalSettings" call.
  1149. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  1150. // status code is an error. Response headers are in either
  1151. // *Subscription.ServerResponse.Header or (if a response was returned at
  1152. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1153. // to check whether the returned error was because
  1154. // http.StatusNotModified was returned.
  1155. func (c *SubscriptionsChangeRenewalSettingsCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  1156. gensupport.SetOptions(c.urlParams_, opts...)
  1157. res, err := c.doRequest("json")
  1158. if res != nil && res.StatusCode == http.StatusNotModified {
  1159. if res.Body != nil {
  1160. res.Body.Close()
  1161. }
  1162. return nil, &googleapi.Error{
  1163. Code: res.StatusCode,
  1164. Header: res.Header,
  1165. }
  1166. }
  1167. if err != nil {
  1168. return nil, err
  1169. }
  1170. defer googleapi.CloseBody(res)
  1171. if err := googleapi.CheckResponse(res); err != nil {
  1172. return nil, err
  1173. }
  1174. ret := &Subscription{
  1175. ServerResponse: googleapi.ServerResponse{
  1176. Header: res.Header,
  1177. HTTPStatusCode: res.StatusCode,
  1178. },
  1179. }
  1180. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1181. return nil, err
  1182. }
  1183. return ret, nil
  1184. // {
  1185. // "description": "Changes the renewal settings of a subscription",
  1186. // "httpMethod": "POST",
  1187. // "id": "reseller.subscriptions.changeRenewalSettings",
  1188. // "parameterOrder": [
  1189. // "customerId",
  1190. // "subscriptionId"
  1191. // ],
  1192. // "parameters": {
  1193. // "customerId": {
  1194. // "description": "Id of the Customer",
  1195. // "location": "path",
  1196. // "required": true,
  1197. // "type": "string"
  1198. // },
  1199. // "subscriptionId": {
  1200. // "description": "Id of the subscription, which is unique for a customer",
  1201. // "location": "path",
  1202. // "required": true,
  1203. // "type": "string"
  1204. // }
  1205. // },
  1206. // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings",
  1207. // "request": {
  1208. // "$ref": "RenewalSettings"
  1209. // },
  1210. // "response": {
  1211. // "$ref": "Subscription"
  1212. // },
  1213. // "scopes": [
  1214. // "https://www.googleapis.com/auth/apps.order"
  1215. // ]
  1216. // }
  1217. }
  1218. // method id "reseller.subscriptions.changeSeats":
  1219. type SubscriptionsChangeSeatsCall struct {
  1220. s *Service
  1221. customerId string
  1222. subscriptionId string
  1223. seats *Seats
  1224. urlParams_ gensupport.URLParams
  1225. ctx_ context.Context
  1226. }
  1227. // ChangeSeats: Changes the seats configuration of a subscription
  1228. func (r *SubscriptionsService) ChangeSeats(customerId string, subscriptionId string, seats *Seats) *SubscriptionsChangeSeatsCall {
  1229. c := &SubscriptionsChangeSeatsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1230. c.customerId = customerId
  1231. c.subscriptionId = subscriptionId
  1232. c.seats = seats
  1233. return c
  1234. }
  1235. // Fields allows partial responses to be retrieved. See
  1236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1237. // for more information.
  1238. func (c *SubscriptionsChangeSeatsCall) Fields(s ...googleapi.Field) *SubscriptionsChangeSeatsCall {
  1239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1240. return c
  1241. }
  1242. // Context sets the context to be used in this call's Do method. Any
  1243. // pending HTTP request will be aborted if the provided context is
  1244. // canceled.
  1245. func (c *SubscriptionsChangeSeatsCall) Context(ctx context.Context) *SubscriptionsChangeSeatsCall {
  1246. c.ctx_ = ctx
  1247. return c
  1248. }
  1249. func (c *SubscriptionsChangeSeatsCall) doRequest(alt string) (*http.Response, error) {
  1250. var body io.Reader = nil
  1251. body, err := googleapi.WithoutDataWrapper.JSONReader(c.seats)
  1252. if err != nil {
  1253. return nil, err
  1254. }
  1255. ctype := "application/json"
  1256. c.urlParams_.Set("alt", alt)
  1257. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats")
  1258. urls += "?" + c.urlParams_.Encode()
  1259. req, _ := http.NewRequest("POST", urls, body)
  1260. googleapi.Expand(req.URL, map[string]string{
  1261. "customerId": c.customerId,
  1262. "subscriptionId": c.subscriptionId,
  1263. })
  1264. req.Header.Set("Content-Type", ctype)
  1265. req.Header.Set("User-Agent", c.s.userAgent())
  1266. if c.ctx_ != nil {
  1267. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1268. }
  1269. return c.s.client.Do(req)
  1270. }
  1271. // Do executes the "reseller.subscriptions.changeSeats" call.
  1272. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  1273. // status code is an error. Response headers are in either
  1274. // *Subscription.ServerResponse.Header or (if a response was returned at
  1275. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1276. // to check whether the returned error was because
  1277. // http.StatusNotModified was returned.
  1278. func (c *SubscriptionsChangeSeatsCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  1279. gensupport.SetOptions(c.urlParams_, opts...)
  1280. res, err := c.doRequest("json")
  1281. if res != nil && res.StatusCode == http.StatusNotModified {
  1282. if res.Body != nil {
  1283. res.Body.Close()
  1284. }
  1285. return nil, &googleapi.Error{
  1286. Code: res.StatusCode,
  1287. Header: res.Header,
  1288. }
  1289. }
  1290. if err != nil {
  1291. return nil, err
  1292. }
  1293. defer googleapi.CloseBody(res)
  1294. if err := googleapi.CheckResponse(res); err != nil {
  1295. return nil, err
  1296. }
  1297. ret := &Subscription{
  1298. ServerResponse: googleapi.ServerResponse{
  1299. Header: res.Header,
  1300. HTTPStatusCode: res.StatusCode,
  1301. },
  1302. }
  1303. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1304. return nil, err
  1305. }
  1306. return ret, nil
  1307. // {
  1308. // "description": "Changes the seats configuration of a subscription",
  1309. // "httpMethod": "POST",
  1310. // "id": "reseller.subscriptions.changeSeats",
  1311. // "parameterOrder": [
  1312. // "customerId",
  1313. // "subscriptionId"
  1314. // ],
  1315. // "parameters": {
  1316. // "customerId": {
  1317. // "description": "Id of the Customer",
  1318. // "location": "path",
  1319. // "required": true,
  1320. // "type": "string"
  1321. // },
  1322. // "subscriptionId": {
  1323. // "description": "Id of the subscription, which is unique for a customer",
  1324. // "location": "path",
  1325. // "required": true,
  1326. // "type": "string"
  1327. // }
  1328. // },
  1329. // "path": "customers/{customerId}/subscriptions/{subscriptionId}/changeSeats",
  1330. // "request": {
  1331. // "$ref": "Seats"
  1332. // },
  1333. // "response": {
  1334. // "$ref": "Subscription"
  1335. // },
  1336. // "scopes": [
  1337. // "https://www.googleapis.com/auth/apps.order"
  1338. // ]
  1339. // }
  1340. }
  1341. // method id "reseller.subscriptions.delete":
  1342. type SubscriptionsDeleteCall struct {
  1343. s *Service
  1344. customerId string
  1345. subscriptionId string
  1346. urlParams_ gensupport.URLParams
  1347. ctx_ context.Context
  1348. }
  1349. // Delete: Cancels/Downgrades a subscription.
  1350. func (r *SubscriptionsService) Delete(customerId string, subscriptionId string, deletionType string) *SubscriptionsDeleteCall {
  1351. c := &SubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1352. c.customerId = customerId
  1353. c.subscriptionId = subscriptionId
  1354. c.urlParams_.Set("deletionType", deletionType)
  1355. return c
  1356. }
  1357. // Fields allows partial responses to be retrieved. See
  1358. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1359. // for more information.
  1360. func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
  1361. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1362. return c
  1363. }
  1364. // Context sets the context to be used in this call's Do method. Any
  1365. // pending HTTP request will be aborted if the provided context is
  1366. // canceled.
  1367. func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall {
  1368. c.ctx_ = ctx
  1369. return c
  1370. }
  1371. func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1372. var body io.Reader = nil
  1373. c.urlParams_.Set("alt", alt)
  1374. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}")
  1375. urls += "?" + c.urlParams_.Encode()
  1376. req, _ := http.NewRequest("DELETE", urls, body)
  1377. googleapi.Expand(req.URL, map[string]string{
  1378. "customerId": c.customerId,
  1379. "subscriptionId": c.subscriptionId,
  1380. })
  1381. req.Header.Set("User-Agent", c.s.userAgent())
  1382. if c.ctx_ != nil {
  1383. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1384. }
  1385. return c.s.client.Do(req)
  1386. }
  1387. // Do executes the "reseller.subscriptions.delete" call.
  1388. func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1389. gensupport.SetOptions(c.urlParams_, opts...)
  1390. res, err := c.doRequest("json")
  1391. if err != nil {
  1392. return err
  1393. }
  1394. defer googleapi.CloseBody(res)
  1395. if err := googleapi.CheckResponse(res); err != nil {
  1396. return err
  1397. }
  1398. return nil
  1399. // {
  1400. // "description": "Cancels/Downgrades a subscription.",
  1401. // "httpMethod": "DELETE",
  1402. // "id": "reseller.subscriptions.delete",
  1403. // "parameterOrder": [
  1404. // "customerId",
  1405. // "subscriptionId",
  1406. // "deletionType"
  1407. // ],
  1408. // "parameters": {
  1409. // "customerId": {
  1410. // "description": "Id of the Customer",
  1411. // "location": "path",
  1412. // "required": true,
  1413. // "type": "string"
  1414. // },
  1415. // "deletionType": {
  1416. // "description": "Whether the subscription is to be fully cancelled or downgraded",
  1417. // "enum": [
  1418. // "cancel",
  1419. // "downgrade",
  1420. // "suspend",
  1421. // "transfer_to_direct"
  1422. // ],
  1423. // "enumDescriptions": [
  1424. // "Cancels the subscription immediately",
  1425. // "Downgrades a Google Apps for Business subscription to Google Apps",
  1426. // "Suspends the subscriptions for 4 days before cancelling it",
  1427. // "Transfers a subscription directly to Google"
  1428. // ],
  1429. // "location": "query",
  1430. // "required": true,
  1431. // "type": "string"
  1432. // },
  1433. // "subscriptionId": {
  1434. // "description": "Id of the subscription, which is unique for a customer",
  1435. // "location": "path",
  1436. // "required": true,
  1437. // "type": "string"
  1438. // }
  1439. // },
  1440. // "path": "customers/{customerId}/subscriptions/{subscriptionId}",
  1441. // "scopes": [
  1442. // "https://www.googleapis.com/auth/apps.order"
  1443. // ]
  1444. // }
  1445. }
  1446. // method id "reseller.subscriptions.get":
  1447. type SubscriptionsGetCall struct {
  1448. s *Service
  1449. customerId string
  1450. subscriptionId string
  1451. urlParams_ gensupport.URLParams
  1452. ifNoneMatch_ string
  1453. ctx_ context.Context
  1454. }
  1455. // Get: Gets a subscription of the customer.
  1456. func (r *SubscriptionsService) Get(customerId string, subscriptionId string) *SubscriptionsGetCall {
  1457. c := &SubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1458. c.customerId = customerId
  1459. c.subscriptionId = subscriptionId
  1460. return c
  1461. }
  1462. // Fields allows partial responses to be retrieved. See
  1463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1464. // for more information.
  1465. func (c *SubscriptionsGetCall) Fields(s ...googleapi.Field) *SubscriptionsGetCall {
  1466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1467. return c
  1468. }
  1469. // IfNoneMatch sets the optional parameter which makes the operation
  1470. // fail if the object's ETag matches the given value. This is useful for
  1471. // getting updates only after the object has changed since the last
  1472. // request. Use googleapi.IsNotModified to check whether the response
  1473. // error from Do is the result of In-None-Match.
  1474. func (c *SubscriptionsGetCall) IfNoneMatch(entityTag string) *SubscriptionsGetCall {
  1475. c.ifNoneMatch_ = entityTag
  1476. return c
  1477. }
  1478. // Context sets the context to be used in this call's Do method. Any
  1479. // pending HTTP request will be aborted if the provided context is
  1480. // canceled.
  1481. func (c *SubscriptionsGetCall) Context(ctx context.Context) *SubscriptionsGetCall {
  1482. c.ctx_ = ctx
  1483. return c
  1484. }
  1485. func (c *SubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  1486. var body io.Reader = nil
  1487. c.urlParams_.Set("alt", alt)
  1488. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}")
  1489. urls += "?" + c.urlParams_.Encode()
  1490. req, _ := http.NewRequest("GET", urls, body)
  1491. googleapi.Expand(req.URL, map[string]string{
  1492. "customerId": c.customerId,
  1493. "subscriptionId": c.subscriptionId,
  1494. })
  1495. req.Header.Set("User-Agent", c.s.userAgent())
  1496. if c.ifNoneMatch_ != "" {
  1497. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1498. }
  1499. if c.ctx_ != nil {
  1500. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1501. }
  1502. return c.s.client.Do(req)
  1503. }
  1504. // Do executes the "reseller.subscriptions.get" call.
  1505. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  1506. // status code is an error. Response headers are in either
  1507. // *Subscription.ServerResponse.Header or (if a response was returned at
  1508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1509. // to check whether the returned error was because
  1510. // http.StatusNotModified was returned.
  1511. func (c *SubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  1512. gensupport.SetOptions(c.urlParams_, opts...)
  1513. res, err := c.doRequest("json")
  1514. if res != nil && res.StatusCode == http.StatusNotModified {
  1515. if res.Body != nil {
  1516. res.Body.Close()
  1517. }
  1518. return nil, &googleapi.Error{
  1519. Code: res.StatusCode,
  1520. Header: res.Header,
  1521. }
  1522. }
  1523. if err != nil {
  1524. return nil, err
  1525. }
  1526. defer googleapi.CloseBody(res)
  1527. if err := googleapi.CheckResponse(res); err != nil {
  1528. return nil, err
  1529. }
  1530. ret := &Subscription{
  1531. ServerResponse: googleapi.ServerResponse{
  1532. Header: res.Header,
  1533. HTTPStatusCode: res.StatusCode,
  1534. },
  1535. }
  1536. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1537. return nil, err
  1538. }
  1539. return ret, nil
  1540. // {
  1541. // "description": "Gets a subscription of the customer.",
  1542. // "httpMethod": "GET",
  1543. // "id": "reseller.subscriptions.get",
  1544. // "parameterOrder": [
  1545. // "customerId",
  1546. // "subscriptionId"
  1547. // ],
  1548. // "parameters": {
  1549. // "customerId": {
  1550. // "description": "Id of the Customer",
  1551. // "location": "path",
  1552. // "required": true,
  1553. // "type": "string"
  1554. // },
  1555. // "subscriptionId": {
  1556. // "description": "Id of the subscription, which is unique for a customer",
  1557. // "location": "path",
  1558. // "required": true,
  1559. // "type": "string"
  1560. // }
  1561. // },
  1562. // "path": "customers/{customerId}/subscriptions/{subscriptionId}",
  1563. // "response": {
  1564. // "$ref": "Subscription"
  1565. // },
  1566. // "scopes": [
  1567. // "https://www.googleapis.com/auth/apps.order",
  1568. // "https://www.googleapis.com/auth/apps.order.readonly"
  1569. // ]
  1570. // }
  1571. }
  1572. // method id "reseller.subscriptions.insert":
  1573. type SubscriptionsInsertCall struct {
  1574. s *Service
  1575. customerId string
  1576. subscription *Subscription
  1577. urlParams_ gensupport.URLParams
  1578. ctx_ context.Context
  1579. }
  1580. // Insert: Creates/Transfers a subscription for the customer.
  1581. func (r *SubscriptionsService) Insert(customerId string, subscription *Subscription) *SubscriptionsInsertCall {
  1582. c := &SubscriptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1583. c.customerId = customerId
  1584. c.subscription = subscription
  1585. return c
  1586. }
  1587. // CustomerAuthToken sets the optional parameter "customerAuthToken": An
  1588. // auth token needed for transferring a subscription. Can be generated
  1589. // at https://www.google.com/a/cpanel/customer-domain/TransferToken.
  1590. func (c *SubscriptionsInsertCall) CustomerAuthToken(customerAuthToken string) *SubscriptionsInsertCall {
  1591. c.urlParams_.Set("customerAuthToken", customerAuthToken)
  1592. return c
  1593. }
  1594. // Fields allows partial responses to be retrieved. See
  1595. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1596. // for more information.
  1597. func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
  1598. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1599. return c
  1600. }
  1601. // Context sets the context to be used in this call's Do method. Any
  1602. // pending HTTP request will be aborted if the provided context is
  1603. // canceled.
  1604. func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall {
  1605. c.ctx_ = ctx
  1606. return c
  1607. }
  1608. func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  1609. var body io.Reader = nil
  1610. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  1611. if err != nil {
  1612. return nil, err
  1613. }
  1614. ctype := "application/json"
  1615. c.urlParams_.Set("alt", alt)
  1616. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions")
  1617. urls += "?" + c.urlParams_.Encode()
  1618. req, _ := http.NewRequest("POST", urls, body)
  1619. googleapi.Expand(req.URL, map[string]string{
  1620. "customerId": c.customerId,
  1621. })
  1622. req.Header.Set("Content-Type", ctype)
  1623. req.Header.Set("User-Agent", c.s.userAgent())
  1624. if c.ctx_ != nil {
  1625. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1626. }
  1627. return c.s.client.Do(req)
  1628. }
  1629. // Do executes the "reseller.subscriptions.insert" call.
  1630. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  1631. // status code is an error. Response headers are in either
  1632. // *Subscription.ServerResponse.Header or (if a response was returned at
  1633. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1634. // to check whether the returned error was because
  1635. // http.StatusNotModified was returned.
  1636. func (c *SubscriptionsInsertCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  1637. gensupport.SetOptions(c.urlParams_, opts...)
  1638. res, err := c.doRequest("json")
  1639. if res != nil && res.StatusCode == http.StatusNotModified {
  1640. if res.Body != nil {
  1641. res.Body.Close()
  1642. }
  1643. return nil, &googleapi.Error{
  1644. Code: res.StatusCode,
  1645. Header: res.Header,
  1646. }
  1647. }
  1648. if err != nil {
  1649. return nil, err
  1650. }
  1651. defer googleapi.CloseBody(res)
  1652. if err := googleapi.CheckResponse(res); err != nil {
  1653. return nil, err
  1654. }
  1655. ret := &Subscription{
  1656. ServerResponse: googleapi.ServerResponse{
  1657. Header: res.Header,
  1658. HTTPStatusCode: res.StatusCode,
  1659. },
  1660. }
  1661. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1662. return nil, err
  1663. }
  1664. return ret, nil
  1665. // {
  1666. // "description": "Creates/Transfers a subscription for the customer.",
  1667. // "httpMethod": "POST",
  1668. // "id": "reseller.subscriptions.insert",
  1669. // "parameterOrder": [
  1670. // "customerId"
  1671. // ],
  1672. // "parameters": {
  1673. // "customerAuthToken": {
  1674. // "description": "An auth token needed for transferring a subscription. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken. Optional.",
  1675. // "location": "query",
  1676. // "type": "string"
  1677. // },
  1678. // "customerId": {
  1679. // "description": "Id of the Customer",
  1680. // "location": "path",
  1681. // "required": true,
  1682. // "type": "string"
  1683. // }
  1684. // },
  1685. // "path": "customers/{customerId}/subscriptions",
  1686. // "request": {
  1687. // "$ref": "Subscription"
  1688. // },
  1689. // "response": {
  1690. // "$ref": "Subscription"
  1691. // },
  1692. // "scopes": [
  1693. // "https://www.googleapis.com/auth/apps.order"
  1694. // ]
  1695. // }
  1696. }
  1697. // method id "reseller.subscriptions.list":
  1698. type SubscriptionsListCall struct {
  1699. s *Service
  1700. urlParams_ gensupport.URLParams
  1701. ifNoneMatch_ string
  1702. ctx_ context.Context
  1703. }
  1704. // List: Lists subscriptions of a reseller, optionally filtered by a
  1705. // customer name prefix.
  1706. func (r *SubscriptionsService) List() *SubscriptionsListCall {
  1707. c := &SubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1708. return c
  1709. }
  1710. // CustomerAuthToken sets the optional parameter "customerAuthToken": An
  1711. // auth token needed if the customer is not a resold customer of this
  1712. // reseller. Can be generated at
  1713. // https://www.google.com/a/cpanel/customer-domain/TransferToken.
  1714. func (c *SubscriptionsListCall) CustomerAuthToken(customerAuthToken string) *SubscriptionsListCall {
  1715. c.urlParams_.Set("customerAuthToken", customerAuthToken)
  1716. return c
  1717. }
  1718. // CustomerId sets the optional parameter "customerId": Id of the
  1719. // Customer
  1720. func (c *SubscriptionsListCall) CustomerId(customerId string) *SubscriptionsListCall {
  1721. c.urlParams_.Set("customerId", customerId)
  1722. return c
  1723. }
  1724. // CustomerNamePrefix sets the optional parameter "customerNamePrefix":
  1725. // Prefix of the customer's domain name by which the subscriptions
  1726. // should be filtered. Optional
  1727. func (c *SubscriptionsListCall) CustomerNamePrefix(customerNamePrefix string) *SubscriptionsListCall {
  1728. c.urlParams_.Set("customerNamePrefix", customerNamePrefix)
  1729. return c
  1730. }
  1731. // MaxResults sets the optional parameter "maxResults": Maximum number
  1732. // of results to return
  1733. func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall {
  1734. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1735. return c
  1736. }
  1737. // PageToken sets the optional parameter "pageToken": Token to specify
  1738. // next page in the list
  1739. func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall {
  1740. c.urlParams_.Set("pageToken", pageToken)
  1741. return c
  1742. }
  1743. // Fields allows partial responses to be retrieved. See
  1744. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1745. // for more information.
  1746. func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
  1747. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1748. return c
  1749. }
  1750. // IfNoneMatch sets the optional parameter which makes the operation
  1751. // fail if the object's ETag matches the given value. This is useful for
  1752. // getting updates only after the object has changed since the last
  1753. // request. Use googleapi.IsNotModified to check whether the response
  1754. // error from Do is the result of In-None-Match.
  1755. func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall {
  1756. c.ifNoneMatch_ = entityTag
  1757. return c
  1758. }
  1759. // Context sets the context to be used in this call's Do method. Any
  1760. // pending HTTP request will be aborted if the provided context is
  1761. // canceled.
  1762. func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall {
  1763. c.ctx_ = ctx
  1764. return c
  1765. }
  1766. func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  1767. var body io.Reader = nil
  1768. c.urlParams_.Set("alt", alt)
  1769. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  1770. urls += "?" + c.urlParams_.Encode()
  1771. req, _ := http.NewRequest("GET", urls, body)
  1772. googleapi.SetOpaque(req.URL)
  1773. req.Header.Set("User-Agent", c.s.userAgent())
  1774. if c.ifNoneMatch_ != "" {
  1775. req.Header.Set("If-None-Match", c.ifNoneMatch_)
  1776. }
  1777. if c.ctx_ != nil {
  1778. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1779. }
  1780. return c.s.client.Do(req)
  1781. }
  1782. // Do executes the "reseller.subscriptions.list" call.
  1783. // Exactly one of *Subscriptions or error will be non-nil. Any non-2xx
  1784. // status code is an error. Response headers are in either
  1785. // *Subscriptions.ServerResponse.Header or (if a response was returned
  1786. // at all) in error.(*googleapi.Error).Header. Use
  1787. // googleapi.IsNotModified to check whether the returned error was
  1788. // because http.StatusNotModified was returned.
  1789. func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*Subscriptions, error) {
  1790. gensupport.SetOptions(c.urlParams_, opts...)
  1791. res, err := c.doRequest("json")
  1792. if res != nil && res.StatusCode == http.StatusNotModified {
  1793. if res.Body != nil {
  1794. res.Body.Close()
  1795. }
  1796. return nil, &googleapi.Error{
  1797. Code: res.StatusCode,
  1798. Header: res.Header,
  1799. }
  1800. }
  1801. if err != nil {
  1802. return nil, err
  1803. }
  1804. defer googleapi.CloseBody(res)
  1805. if err := googleapi.CheckResponse(res); err != nil {
  1806. return nil, err
  1807. }
  1808. ret := &Subscriptions{
  1809. ServerResponse: googleapi.ServerResponse{
  1810. Header: res.Header,
  1811. HTTPStatusCode: res.StatusCode,
  1812. },
  1813. }
  1814. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1815. return nil, err
  1816. }
  1817. return ret, nil
  1818. // {
  1819. // "description": "Lists subscriptions of a reseller, optionally filtered by a customer name prefix.",
  1820. // "httpMethod": "GET",
  1821. // "id": "reseller.subscriptions.list",
  1822. // "parameters": {
  1823. // "customerAuthToken": {
  1824. // "description": "An auth token needed if the customer is not a resold customer of this reseller. Can be generated at https://www.google.com/a/cpanel/customer-domain/TransferToken.Optional.",
  1825. // "location": "query",
  1826. // "type": "string"
  1827. // },
  1828. // "customerId": {
  1829. // "description": "Id of the Customer",
  1830. // "location": "query",
  1831. // "type": "string"
  1832. // },
  1833. // "customerNamePrefix": {
  1834. // "description": "Prefix of the customer's domain name by which the subscriptions should be filtered. Optional",
  1835. // "location": "query",
  1836. // "type": "string"
  1837. // },
  1838. // "maxResults": {
  1839. // "description": "Maximum number of results to return",
  1840. // "format": "uint32",
  1841. // "location": "query",
  1842. // "maximum": "100",
  1843. // "minimum": "1",
  1844. // "type": "integer"
  1845. // },
  1846. // "pageToken": {
  1847. // "description": "Token to specify next page in the list",
  1848. // "location": "query",
  1849. // "type": "string"
  1850. // }
  1851. // },
  1852. // "path": "subscriptions",
  1853. // "response": {
  1854. // "$ref": "Subscriptions"
  1855. // },
  1856. // "scopes": [
  1857. // "https://www.googleapis.com/auth/apps.order",
  1858. // "https://www.googleapis.com/auth/apps.order.readonly"
  1859. // ]
  1860. // }
  1861. }
  1862. // Pages invokes f for each page of results.
  1863. // A non-nil error returned from f will halt the iteration.
  1864. // The provided context supersedes any context provided to the Context method.
  1865. func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*Subscriptions) error) error {
  1866. c.ctx_ = ctx
  1867. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1868. for {
  1869. x, err := c.Do()
  1870. if err != nil {
  1871. return err
  1872. }
  1873. if err := f(x); err != nil {
  1874. return err
  1875. }
  1876. if x.NextPageToken == "" {
  1877. return nil
  1878. }
  1879. c.PageToken(x.NextPageToken)
  1880. }
  1881. }
  1882. // method id "reseller.subscriptions.startPaidService":
  1883. type SubscriptionsStartPaidServiceCall struct {
  1884. s *Service
  1885. customerId string
  1886. subscriptionId string
  1887. urlParams_ gensupport.URLParams
  1888. ctx_ context.Context
  1889. }
  1890. // StartPaidService: Starts paid service of a trial subscription
  1891. func (r *SubscriptionsService) StartPaidService(customerId string, subscriptionId string) *SubscriptionsStartPaidServiceCall {
  1892. c := &SubscriptionsStartPaidServiceCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1893. c.customerId = customerId
  1894. c.subscriptionId = subscriptionId
  1895. return c
  1896. }
  1897. // Fields allows partial responses to be retrieved. See
  1898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1899. // for more information.
  1900. func (c *SubscriptionsStartPaidServiceCall) Fields(s ...googleapi.Field) *SubscriptionsStartPaidServiceCall {
  1901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1902. return c
  1903. }
  1904. // Context sets the context to be used in this call's Do method. Any
  1905. // pending HTTP request will be aborted if the provided context is
  1906. // canceled.
  1907. func (c *SubscriptionsStartPaidServiceCall) Context(ctx context.Context) *SubscriptionsStartPaidServiceCall {
  1908. c.ctx_ = ctx
  1909. return c
  1910. }
  1911. func (c *SubscriptionsStartPaidServiceCall) doRequest(alt string) (*http.Response, error) {
  1912. var body io.Reader = nil
  1913. c.urlParams_.Set("alt", alt)
  1914. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService")
  1915. urls += "?" + c.urlParams_.Encode()
  1916. req, _ := http.NewRequest("POST", urls, body)
  1917. googleapi.Expand(req.URL, map[string]string{
  1918. "customerId": c.customerId,
  1919. "subscriptionId": c.subscriptionId,
  1920. })
  1921. req.Header.Set("User-Agent", c.s.userAgent())
  1922. if c.ctx_ != nil {
  1923. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1924. }
  1925. return c.s.client.Do(req)
  1926. }
  1927. // Do executes the "reseller.subscriptions.startPaidService" call.
  1928. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  1929. // status code is an error. Response headers are in either
  1930. // *Subscription.ServerResponse.Header or (if a response was returned at
  1931. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1932. // to check whether the returned error was because
  1933. // http.StatusNotModified was returned.
  1934. func (c *SubscriptionsStartPaidServiceCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  1935. gensupport.SetOptions(c.urlParams_, opts...)
  1936. res, err := c.doRequest("json")
  1937. if res != nil && res.StatusCode == http.StatusNotModified {
  1938. if res.Body != nil {
  1939. res.Body.Close()
  1940. }
  1941. return nil, &googleapi.Error{
  1942. Code: res.StatusCode,
  1943. Header: res.Header,
  1944. }
  1945. }
  1946. if err != nil {
  1947. return nil, err
  1948. }
  1949. defer googleapi.CloseBody(res)
  1950. if err := googleapi.CheckResponse(res); err != nil {
  1951. return nil, err
  1952. }
  1953. ret := &Subscription{
  1954. ServerResponse: googleapi.ServerResponse{
  1955. Header: res.Header,
  1956. HTTPStatusCode: res.StatusCode,
  1957. },
  1958. }
  1959. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1960. return nil, err
  1961. }
  1962. return ret, nil
  1963. // {
  1964. // "description": "Starts paid service of a trial subscription",
  1965. // "httpMethod": "POST",
  1966. // "id": "reseller.subscriptions.startPaidService",
  1967. // "parameterOrder": [
  1968. // "customerId",
  1969. // "subscriptionId"
  1970. // ],
  1971. // "parameters": {
  1972. // "customerId": {
  1973. // "description": "Id of the Customer",
  1974. // "location": "path",
  1975. // "required": true,
  1976. // "type": "string"
  1977. // },
  1978. // "subscriptionId": {
  1979. // "description": "Id of the subscription, which is unique for a customer",
  1980. // "location": "path",
  1981. // "required": true,
  1982. // "type": "string"
  1983. // }
  1984. // },
  1985. // "path": "customers/{customerId}/subscriptions/{subscriptionId}/startPaidService",
  1986. // "response": {
  1987. // "$ref": "Subscription"
  1988. // },
  1989. // "scopes": [
  1990. // "https://www.googleapis.com/auth/apps.order"
  1991. // ]
  1992. // }
  1993. }
  1994. // method id "reseller.subscriptions.suspend":
  1995. type SubscriptionsSuspendCall struct {
  1996. s *Service
  1997. customerId string
  1998. subscriptionId string
  1999. urlParams_ gensupport.URLParams
  2000. ctx_ context.Context
  2001. }
  2002. // Suspend: Suspends an active subscription
  2003. func (r *SubscriptionsService) Suspend(customerId string, subscriptionId string) *SubscriptionsSuspendCall {
  2004. c := &SubscriptionsSuspendCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2005. c.customerId = customerId
  2006. c.subscriptionId = subscriptionId
  2007. return c
  2008. }
  2009. // Fields allows partial responses to be retrieved. See
  2010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2011. // for more information.
  2012. func (c *SubscriptionsSuspendCall) Fields(s ...googleapi.Field) *SubscriptionsSuspendCall {
  2013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2014. return c
  2015. }
  2016. // Context sets the context to be used in this call's Do method. Any
  2017. // pending HTTP request will be aborted if the provided context is
  2018. // canceled.
  2019. func (c *SubscriptionsSuspendCall) Context(ctx context.Context) *SubscriptionsSuspendCall {
  2020. c.ctx_ = ctx
  2021. return c
  2022. }
  2023. func (c *SubscriptionsSuspendCall) doRequest(alt string) (*http.Response, error) {
  2024. var body io.Reader = nil
  2025. c.urlParams_.Set("alt", alt)
  2026. urls := googleapi.ResolveRelative(c.s.BasePath, "customers/{customerId}/subscriptions/{subscriptionId}/suspend")
  2027. urls += "?" + c.urlParams_.Encode()
  2028. req, _ := http.NewRequest("POST", urls, body)
  2029. googleapi.Expand(req.URL, map[string]string{
  2030. "customerId": c.customerId,
  2031. "subscriptionId": c.subscriptionId,
  2032. })
  2033. req.Header.Set("User-Agent", c.s.userAgent())
  2034. if c.ctx_ != nil {
  2035. return ctxhttp.Do(c.ctx_, c.s.client, req)
  2036. }
  2037. return c.s.client.Do(req)
  2038. }
  2039. // Do executes the "reseller.subscriptions.suspend" call.
  2040. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  2041. // status code is an error. Response headers are in either
  2042. // *Subscription.ServerResponse.Header or (if a response was returned at
  2043. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2044. // to check whether the returned error was because
  2045. // http.StatusNotModified was returned.
  2046. func (c *SubscriptionsSuspendCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  2047. gensupport.SetOptions(c.urlParams_, opts...)
  2048. res, err := c.doRequest("json")
  2049. if res != nil && res.StatusCode == http.StatusNotModified {
  2050. if res.Body != nil {
  2051. res.Body.Close()
  2052. }
  2053. return nil, &googleapi.Error{
  2054. Code: res.StatusCode,
  2055. Header: res.Header,
  2056. }
  2057. }
  2058. if err != nil {
  2059. return nil, err
  2060. }
  2061. defer googleapi.CloseBody(res)
  2062. if err := googleapi.CheckResponse(res); err != nil {
  2063. return nil, err
  2064. }
  2065. ret := &Subscription{
  2066. ServerResponse: googleapi.ServerResponse{
  2067. Header: res.Header,
  2068. HTTPStatusCode: res.StatusCode,
  2069. },
  2070. }
  2071. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  2072. return nil, err
  2073. }
  2074. return ret, nil
  2075. // {
  2076. // "description": "Suspends an active subscription",
  2077. // "httpMethod": "POST",
  2078. // "id": "reseller.subscriptions.suspend",
  2079. // "parameterOrder": [
  2080. // "customerId",
  2081. // "subscriptionId"
  2082. // ],
  2083. // "parameters": {
  2084. // "customerId": {
  2085. // "description": "Id of the Customer",
  2086. // "location": "path",
  2087. // "required": true,
  2088. // "type": "string"
  2089. // },
  2090. // "subscriptionId": {
  2091. // "description": "Id of the subscription, which is unique for a customer",
  2092. // "location": "path",
  2093. // "required": true,
  2094. // "type": "string"
  2095. // }
  2096. // },
  2097. // "path": "customers/{customerId}/subscriptions/{subscriptionId}/suspend",
  2098. // "response": {
  2099. // "$ref": "Subscription"
  2100. // },
  2101. // "scopes": [
  2102. // "https://www.googleapis.com/auth/apps.order"
  2103. // ]
  2104. // }
  2105. }