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

7309 lines
278 KiB

  1. // Copyright 2018 Google Inc. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package partners provides access to the Google Partners API.
  6. //
  7. // See https://developers.google.com/partners/
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/partners/v2"
  12. // ...
  13. // partnersService, err := partners.New(oauthHttpClient)
  14. package partners // import "google.golang.org/api/partners/v2"
  15. import (
  16. "bytes"
  17. "context"
  18. "encoding/json"
  19. "errors"
  20. "fmt"
  21. "io"
  22. "net/http"
  23. "net/url"
  24. "strconv"
  25. "strings"
  26. gensupport "google.golang.org/api/gensupport"
  27. googleapi "google.golang.org/api/googleapi"
  28. )
  29. // Always reference these packages, just in case the auto-generated code
  30. // below doesn't.
  31. var _ = bytes.NewBuffer
  32. var _ = strconv.Itoa
  33. var _ = fmt.Sprintf
  34. var _ = json.NewDecoder
  35. var _ = io.Copy
  36. var _ = url.Parse
  37. var _ = gensupport.MarshalJSON
  38. var _ = googleapi.Version
  39. var _ = errors.New
  40. var _ = strings.Replace
  41. var _ = context.Canceled
  42. const apiId = "partners:v2"
  43. const apiName = "partners"
  44. const apiVersion = "v2"
  45. const basePath = "https://partners.googleapis.com/"
  46. func New(client *http.Client) (*Service, error) {
  47. if client == nil {
  48. return nil, errors.New("client is nil")
  49. }
  50. s := &Service{client: client, BasePath: basePath}
  51. s.Analytics = NewAnalyticsService(s)
  52. s.ClientMessages = NewClientMessagesService(s)
  53. s.Companies = NewCompaniesService(s)
  54. s.Leads = NewLeadsService(s)
  55. s.Offers = NewOffersService(s)
  56. s.UserEvents = NewUserEventsService(s)
  57. s.UserStates = NewUserStatesService(s)
  58. s.Users = NewUsersService(s)
  59. s.V2 = NewV2Service(s)
  60. return s, nil
  61. }
  62. type Service struct {
  63. client *http.Client
  64. BasePath string // API endpoint base URL
  65. UserAgent string // optional additional User-Agent fragment
  66. Analytics *AnalyticsService
  67. ClientMessages *ClientMessagesService
  68. Companies *CompaniesService
  69. Leads *LeadsService
  70. Offers *OffersService
  71. UserEvents *UserEventsService
  72. UserStates *UserStatesService
  73. Users *UsersService
  74. V2 *V2Service
  75. }
  76. func (s *Service) userAgent() string {
  77. if s.UserAgent == "" {
  78. return googleapi.UserAgent
  79. }
  80. return googleapi.UserAgent + " " + s.UserAgent
  81. }
  82. func NewAnalyticsService(s *Service) *AnalyticsService {
  83. rs := &AnalyticsService{s: s}
  84. return rs
  85. }
  86. type AnalyticsService struct {
  87. s *Service
  88. }
  89. func NewClientMessagesService(s *Service) *ClientMessagesService {
  90. rs := &ClientMessagesService{s: s}
  91. return rs
  92. }
  93. type ClientMessagesService struct {
  94. s *Service
  95. }
  96. func NewCompaniesService(s *Service) *CompaniesService {
  97. rs := &CompaniesService{s: s}
  98. rs.Leads = NewCompaniesLeadsService(s)
  99. return rs
  100. }
  101. type CompaniesService struct {
  102. s *Service
  103. Leads *CompaniesLeadsService
  104. }
  105. func NewCompaniesLeadsService(s *Service) *CompaniesLeadsService {
  106. rs := &CompaniesLeadsService{s: s}
  107. return rs
  108. }
  109. type CompaniesLeadsService struct {
  110. s *Service
  111. }
  112. func NewLeadsService(s *Service) *LeadsService {
  113. rs := &LeadsService{s: s}
  114. return rs
  115. }
  116. type LeadsService struct {
  117. s *Service
  118. }
  119. func NewOffersService(s *Service) *OffersService {
  120. rs := &OffersService{s: s}
  121. rs.History = NewOffersHistoryService(s)
  122. return rs
  123. }
  124. type OffersService struct {
  125. s *Service
  126. History *OffersHistoryService
  127. }
  128. func NewOffersHistoryService(s *Service) *OffersHistoryService {
  129. rs := &OffersHistoryService{s: s}
  130. return rs
  131. }
  132. type OffersHistoryService struct {
  133. s *Service
  134. }
  135. func NewUserEventsService(s *Service) *UserEventsService {
  136. rs := &UserEventsService{s: s}
  137. return rs
  138. }
  139. type UserEventsService struct {
  140. s *Service
  141. }
  142. func NewUserStatesService(s *Service) *UserStatesService {
  143. rs := &UserStatesService{s: s}
  144. return rs
  145. }
  146. type UserStatesService struct {
  147. s *Service
  148. }
  149. func NewUsersService(s *Service) *UsersService {
  150. rs := &UsersService{s: s}
  151. return rs
  152. }
  153. type UsersService struct {
  154. s *Service
  155. }
  156. func NewV2Service(s *Service) *V2Service {
  157. rs := &V2Service{s: s}
  158. return rs
  159. }
  160. type V2Service struct {
  161. s *Service
  162. }
  163. // AdWordsManagerAccountInfo: Information about a particular AdWords
  164. // Manager Account.
  165. // Read more at https://support.google.com/adwords/answer/6139186
  166. type AdWordsManagerAccountInfo struct {
  167. // CustomerName: Name of the customer this account represents.
  168. CustomerName string `json:"customerName,omitempty"`
  169. // Id: The AdWords Manager Account id.
  170. Id int64 `json:"id,omitempty,string"`
  171. // ForceSendFields is a list of field names (e.g. "CustomerName") to
  172. // unconditionally include in API requests. By default, fields with
  173. // empty values are omitted from API requests. However, any non-pointer,
  174. // non-interface field appearing in ForceSendFields will be sent to the
  175. // server regardless of whether the field is empty or not. This may be
  176. // used to include empty fields in Patch requests.
  177. ForceSendFields []string `json:"-"`
  178. // NullFields is a list of field names (e.g. "CustomerName") to include
  179. // in API requests with the JSON null value. By default, fields with
  180. // empty values are omitted from API requests. However, any field with
  181. // an empty value appearing in NullFields will be sent to the server as
  182. // null. It is an error if a field in this list has a non-empty value.
  183. // This may be used to include null fields in Patch requests.
  184. NullFields []string `json:"-"`
  185. }
  186. func (s *AdWordsManagerAccountInfo) MarshalJSON() ([]byte, error) {
  187. type NoMethod AdWordsManagerAccountInfo
  188. raw := NoMethod(*s)
  189. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  190. }
  191. // Analytics: Analytics data for a `Company` within a single day.
  192. type Analytics struct {
  193. // Contacts: Instances of users contacting the `Company`
  194. // on the specified date.
  195. Contacts *AnalyticsDataPoint `json:"contacts,omitempty"`
  196. // EventDate: Date on which these events occurred.
  197. EventDate *Date `json:"eventDate,omitempty"`
  198. // ProfileViews: Instances of users viewing the `Company` profile
  199. // on the specified date.
  200. ProfileViews *AnalyticsDataPoint `json:"profileViews,omitempty"`
  201. // SearchViews: Instances of users seeing the `Company` in Google
  202. // Partners Search results
  203. // on the specified date.
  204. SearchViews *AnalyticsDataPoint `json:"searchViews,omitempty"`
  205. // ForceSendFields is a list of field names (e.g. "Contacts") to
  206. // unconditionally include in API requests. By default, fields with
  207. // empty values are omitted from API requests. However, any non-pointer,
  208. // non-interface field appearing in ForceSendFields will be sent to the
  209. // server regardless of whether the field is empty or not. This may be
  210. // used to include empty fields in Patch requests.
  211. ForceSendFields []string `json:"-"`
  212. // NullFields is a list of field names (e.g. "Contacts") to include in
  213. // API requests with the JSON null value. By default, fields with empty
  214. // values are omitted from API requests. However, any field with an
  215. // empty value appearing in NullFields will be sent to the server as
  216. // null. It is an error if a field in this list has a non-empty value.
  217. // This may be used to include null fields in Patch requests.
  218. NullFields []string `json:"-"`
  219. }
  220. func (s *Analytics) MarshalJSON() ([]byte, error) {
  221. type NoMethod Analytics
  222. raw := NoMethod(*s)
  223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  224. }
  225. // AnalyticsDataPoint: Details of the analytics events for a `Company`
  226. // within a single day.
  227. type AnalyticsDataPoint struct {
  228. // EventCount: Number of times the type of event occurred.
  229. // Meaning depends on context (e.g. profile views, contacts, etc.).
  230. EventCount int64 `json:"eventCount,omitempty"`
  231. // EventLocations: Location information of where these events occurred.
  232. EventLocations []*LatLng `json:"eventLocations,omitempty"`
  233. // ForceSendFields is a list of field names (e.g. "EventCount") to
  234. // unconditionally include in API requests. By default, fields with
  235. // empty values are omitted from API requests. However, any non-pointer,
  236. // non-interface field appearing in ForceSendFields will be sent to the
  237. // server regardless of whether the field is empty or not. This may be
  238. // used to include empty fields in Patch requests.
  239. ForceSendFields []string `json:"-"`
  240. // NullFields is a list of field names (e.g. "EventCount") to include in
  241. // API requests with the JSON null value. By default, fields with empty
  242. // values are omitted from API requests. However, any field with an
  243. // empty value appearing in NullFields will be sent to the server as
  244. // null. It is an error if a field in this list has a non-empty value.
  245. // This may be used to include null fields in Patch requests.
  246. NullFields []string `json:"-"`
  247. }
  248. func (s *AnalyticsDataPoint) MarshalJSON() ([]byte, error) {
  249. type NoMethod AnalyticsDataPoint
  250. raw := NoMethod(*s)
  251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  252. }
  253. // AnalyticsSummary: Analytics aggregated data for a `Company` for a
  254. // given date range.
  255. type AnalyticsSummary struct {
  256. // ContactsCount: Aggregated number of times users contacted the
  257. // `Company`
  258. // for given date range.
  259. ContactsCount int64 `json:"contactsCount,omitempty"`
  260. // ProfileViewsCount: Aggregated number of profile views for the
  261. // `Company` for given date range.
  262. ProfileViewsCount int64 `json:"profileViewsCount,omitempty"`
  263. // SearchViewsCount: Aggregated number of times users saw the
  264. // `Company`
  265. // in Google Partners Search results for given date range.
  266. SearchViewsCount int64 `json:"searchViewsCount,omitempty"`
  267. // ForceSendFields is a list of field names (e.g. "ContactsCount") to
  268. // unconditionally include in API requests. By default, fields with
  269. // empty values are omitted from API requests. However, any non-pointer,
  270. // non-interface field appearing in ForceSendFields will be sent to the
  271. // server regardless of whether the field is empty or not. This may be
  272. // used to include empty fields in Patch requests.
  273. ForceSendFields []string `json:"-"`
  274. // NullFields is a list of field names (e.g. "ContactsCount") to include
  275. // in API requests with the JSON null value. By default, fields with
  276. // empty values are omitted from API requests. However, any field with
  277. // an empty value appearing in NullFields will be sent to the server as
  278. // null. It is an error if a field in this list has a non-empty value.
  279. // This may be used to include null fields in Patch requests.
  280. NullFields []string `json:"-"`
  281. }
  282. func (s *AnalyticsSummary) MarshalJSON() ([]byte, error) {
  283. type NoMethod AnalyticsSummary
  284. raw := NoMethod(*s)
  285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  286. }
  287. // AvailableOffer: Available Offers to be distributed.
  288. type AvailableOffer struct {
  289. // Available: The number of codes for this offer that are available for
  290. // distribution.
  291. Available int64 `json:"available,omitempty"`
  292. // CountryOfferInfos: Offer info by country.
  293. CountryOfferInfos []*CountryOfferInfo `json:"countryOfferInfos,omitempty"`
  294. // Description: Description of the offer.
  295. Description string `json:"description,omitempty"`
  296. // Id: ID of this offer.
  297. Id int64 `json:"id,omitempty,string"`
  298. // MaxAccountAge: The maximum age of an account [in days] to be
  299. // eligible.
  300. MaxAccountAge int64 `json:"maxAccountAge,omitempty"`
  301. // Name: Name of the offer.
  302. Name string `json:"name,omitempty"`
  303. // OfferLevel: Level of this offer.
  304. //
  305. // Possible values:
  306. // "OFFER_LEVEL_UNSPECIFIED" - Unset.
  307. // "OFFER_LEVEL_DENY_PROBLEM" - Users/Agencies that have no offers
  308. // because of a problem.
  309. // "OFFER_LEVEL_DENY_CONTRACT" - Users/Agencies that have no offers
  310. // due to contractural agreements.
  311. // "OFFER_LEVEL_MANUAL" - Users/Agencies that have a
  312. // manually-configured limit.
  313. // "OFFER_LEVEL_LIMIT_0" - Some Agencies don't get any offers.
  314. // "OFFER_LEVEL_LIMIT_5" - Basic level gets 5 per month.
  315. // "OFFER_LEVEL_LIMIT_15" - Agencies with adequate AHI and spend get
  316. // 15/month.
  317. // "OFFER_LEVEL_LIMIT_50" - Badged partners (even in grace) get 50 per
  318. // month.
  319. OfferLevel string `json:"offerLevel,omitempty"`
  320. // OfferType: Type of offer.
  321. //
  322. // Possible values:
  323. // "OFFER_TYPE_UNSPECIFIED" - Unset.
  324. // "OFFER_TYPE_SPEND_X_GET_Y" - AdWords spend X get Y.
  325. // "OFFER_TYPE_VIDEO" - Youtube video.
  326. // "OFFER_TYPE_SPEND_MATCH" - Spend Match up to Y.
  327. OfferType string `json:"offerType,omitempty"`
  328. // QualifiedCustomer: Customers who qualify for this offer.
  329. QualifiedCustomer []*OfferCustomer `json:"qualifiedCustomer,omitempty"`
  330. // QualifiedCustomersComplete: Whether or not the list of qualified
  331. // customers is definitely complete.
  332. QualifiedCustomersComplete bool `json:"qualifiedCustomersComplete,omitempty"`
  333. // ShowSpecialOfferCopy: Should special text be shown on the offers
  334. // page.
  335. ShowSpecialOfferCopy bool `json:"showSpecialOfferCopy,omitempty"`
  336. // Terms: Terms of the offer.
  337. Terms string `json:"terms,omitempty"`
  338. // ForceSendFields is a list of field names (e.g. "Available") to
  339. // unconditionally include in API requests. By default, fields with
  340. // empty values are omitted from API requests. However, any non-pointer,
  341. // non-interface field appearing in ForceSendFields will be sent to the
  342. // server regardless of whether the field is empty or not. This may be
  343. // used to include empty fields in Patch requests.
  344. ForceSendFields []string `json:"-"`
  345. // NullFields is a list of field names (e.g. "Available") to include in
  346. // API requests with the JSON null value. By default, fields with empty
  347. // values are omitted from API requests. However, any field with an
  348. // empty value appearing in NullFields will be sent to the server as
  349. // null. It is an error if a field in this list has a non-empty value.
  350. // This may be used to include null fields in Patch requests.
  351. NullFields []string `json:"-"`
  352. }
  353. func (s *AvailableOffer) MarshalJSON() ([]byte, error) {
  354. type NoMethod AvailableOffer
  355. raw := NoMethod(*s)
  356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  357. }
  358. // Certification: A user's information on a specific certification.
  359. type Certification struct {
  360. // Achieved: Whether this certification has been achieved.
  361. Achieved bool `json:"achieved,omitempty"`
  362. // CertificationType: The type of certification, the area of expertise.
  363. //
  364. // Possible values:
  365. // "CERTIFICATION_TYPE_UNSPECIFIED" - Unchosen.
  366. // "CT_ADWORDS" - AdWords certified.
  367. // "CT_YOUTUBE" - YouTube certified.
  368. // "CT_VIDEOADS" - VideoAds certified.
  369. // "CT_ANALYTICS" - Analytics certified.
  370. // "CT_DOUBLECLICK" - DoubleClick certified.
  371. // "CT_SHOPPING" - Shopping certified.
  372. // "CT_MOBILE" - Mobile certified.
  373. // "CT_DIGITAL_SALES" - Digital sales certified.
  374. // "CT_ADWORDS_SEARCH" - AdWords Search certified.
  375. // "CT_ADWORDS_DISPLAY" - AdWords Display certified.
  376. // "CT_MOBILE_SITES" - Mobile Sites certified.
  377. CertificationType string `json:"certificationType,omitempty"`
  378. // Expiration: Date this certification is due to expire.
  379. Expiration string `json:"expiration,omitempty"`
  380. // LastAchieved: The date the user last achieved certification.
  381. LastAchieved string `json:"lastAchieved,omitempty"`
  382. // Warning: Whether this certification is in the state of warning.
  383. Warning bool `json:"warning,omitempty"`
  384. // ForceSendFields is a list of field names (e.g. "Achieved") to
  385. // unconditionally include in API requests. By default, fields with
  386. // empty values are omitted from API requests. However, any non-pointer,
  387. // non-interface field appearing in ForceSendFields will be sent to the
  388. // server regardless of whether the field is empty or not. This may be
  389. // used to include empty fields in Patch requests.
  390. ForceSendFields []string `json:"-"`
  391. // NullFields is a list of field names (e.g. "Achieved") to include in
  392. // API requests with the JSON null value. By default, fields with empty
  393. // values are omitted from API requests. However, any field with an
  394. // empty value appearing in NullFields will be sent to the server as
  395. // null. It is an error if a field in this list has a non-empty value.
  396. // This may be used to include null fields in Patch requests.
  397. NullFields []string `json:"-"`
  398. }
  399. func (s *Certification) MarshalJSON() ([]byte, error) {
  400. type NoMethod Certification
  401. raw := NoMethod(*s)
  402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  403. }
  404. // CertificationExamStatus: Status for a Google Partners certification
  405. // exam.
  406. type CertificationExamStatus struct {
  407. // NumberUsersPass: The number of people who have passed the
  408. // certification exam.
  409. NumberUsersPass int64 `json:"numberUsersPass,omitempty"`
  410. // Type: The type of certification exam.
  411. //
  412. // Possible values:
  413. // "CERTIFICATION_EXAM_TYPE_UNSPECIFIED" - Unchosen.
  414. // "CET_ADWORDS_FUNDAMENTALS" - Adwords Fundamentals exam.
  415. // "CET_ADWORDS_ADVANCED_SEARCH" - AdWords advanced search exam.
  416. // "CET_ADWORDS_ADVANCED_DISPLAY" - AdWords advanced display exam.
  417. // "CET_VIDEO_ADS" - VideoAds exam.
  418. // "CET_DOUBLECLICK" - DoubleClick exam.
  419. // "CET_ANALYTICS" - Analytics exam.
  420. // "CET_SHOPPING" - Shopping exam.
  421. // "CET_MOBILE" - Mobile exam.
  422. // "CET_DIGITAL_SALES" - Digital Sales exam.
  423. // "CET_MOBILE_SITES" - Mobile Sites exam.
  424. Type string `json:"type,omitempty"`
  425. // ForceSendFields is a list of field names (e.g. "NumberUsersPass") to
  426. // unconditionally include in API requests. By default, fields with
  427. // empty values are omitted from API requests. However, any non-pointer,
  428. // non-interface field appearing in ForceSendFields will be sent to the
  429. // server regardless of whether the field is empty or not. This may be
  430. // used to include empty fields in Patch requests.
  431. ForceSendFields []string `json:"-"`
  432. // NullFields is a list of field names (e.g. "NumberUsersPass") to
  433. // include in API requests with the JSON null value. By default, fields
  434. // with empty values are omitted from API requests. However, any field
  435. // with an empty value appearing in NullFields will be sent to the
  436. // server as null. It is an error if a field in this list has a
  437. // non-empty value. This may be used to include null fields in Patch
  438. // requests.
  439. NullFields []string `json:"-"`
  440. }
  441. func (s *CertificationExamStatus) MarshalJSON() ([]byte, error) {
  442. type NoMethod CertificationExamStatus
  443. raw := NoMethod(*s)
  444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  445. }
  446. // CertificationStatus: Google Partners certification status.
  447. type CertificationStatus struct {
  448. // ExamStatuses: List of certification exam statuses.
  449. ExamStatuses []*CertificationExamStatus `json:"examStatuses,omitempty"`
  450. // IsCertified: Whether certification is passing.
  451. IsCertified bool `json:"isCertified,omitempty"`
  452. // Type: The type of the certification.
  453. //
  454. // Possible values:
  455. // "CERTIFICATION_TYPE_UNSPECIFIED" - Unchosen.
  456. // "CT_ADWORDS" - AdWords certified.
  457. // "CT_YOUTUBE" - YouTube certified.
  458. // "CT_VIDEOADS" - VideoAds certified.
  459. // "CT_ANALYTICS" - Analytics certified.
  460. // "CT_DOUBLECLICK" - DoubleClick certified.
  461. // "CT_SHOPPING" - Shopping certified.
  462. // "CT_MOBILE" - Mobile certified.
  463. // "CT_DIGITAL_SALES" - Digital sales certified.
  464. // "CT_ADWORDS_SEARCH" - AdWords Search certified.
  465. // "CT_ADWORDS_DISPLAY" - AdWords Display certified.
  466. // "CT_MOBILE_SITES" - Mobile Sites certified.
  467. Type string `json:"type,omitempty"`
  468. // UserCount: Number of people who are certified,
  469. UserCount int64 `json:"userCount,omitempty"`
  470. // ForceSendFields is a list of field names (e.g. "ExamStatuses") to
  471. // unconditionally include in API requests. By default, fields with
  472. // empty values are omitted from API requests. However, any non-pointer,
  473. // non-interface field appearing in ForceSendFields will be sent to the
  474. // server regardless of whether the field is empty or not. This may be
  475. // used to include empty fields in Patch requests.
  476. ForceSendFields []string `json:"-"`
  477. // NullFields is a list of field names (e.g. "ExamStatuses") to include
  478. // in API requests with the JSON null value. By default, fields with
  479. // empty values are omitted from API requests. However, any field with
  480. // an empty value appearing in NullFields will be sent to the server as
  481. // null. It is an error if a field in this list has a non-empty value.
  482. // This may be used to include null fields in Patch requests.
  483. NullFields []string `json:"-"`
  484. }
  485. func (s *CertificationStatus) MarshalJSON() ([]byte, error) {
  486. type NoMethod CertificationStatus
  487. raw := NoMethod(*s)
  488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  489. }
  490. // Company: A company resource in the Google Partners API. Once
  491. // certified, it qualifies
  492. // for being searched by advertisers.
  493. type Company struct {
  494. // AdditionalWebsites: URL of the company's additional websites used to
  495. // verify the dynamic badges.
  496. // These are stored as full URLs as entered by the user, but only the
  497. // TLD will
  498. // be used for the actual verification.
  499. AdditionalWebsites []string `json:"additionalWebsites,omitempty"`
  500. // AutoApprovalEmailDomains: Email domains that allow users with a
  501. // matching email address to get
  502. // auto-approved for associating with this company.
  503. AutoApprovalEmailDomains []string `json:"autoApprovalEmailDomains,omitempty"`
  504. // BadgeAuthorityInAwn: Whether the company's badge authority is in AWN
  505. BadgeAuthorityInAwn bool `json:"badgeAuthorityInAwn,omitempty"`
  506. // BadgeTier: Partner badge tier
  507. //
  508. // Possible values:
  509. // "BADGE_TIER_NONE" - Tier badge is not set.
  510. // "BADGE_TIER_REGULAR" - Agency has regular partner badge.
  511. // "BADGE_TIER_PREMIER" - Agency has premier badge.
  512. BadgeTier string `json:"badgeTier,omitempty"`
  513. // CertificationStatuses: The list of Google Partners certification
  514. // statuses for the company.
  515. CertificationStatuses []*CertificationStatus `json:"certificationStatuses,omitempty"`
  516. // CompanyTypes: Company type labels listed on the company's profile.
  517. //
  518. // Possible values:
  519. // "COMPANY_TYPE_UNSPECIFIED" - Unchosen.
  520. // "FULL_SERVICE_AGENCY" - Handles all aspects of the advertising
  521. // process.
  522. // "MEDIA_AGENCY" - Focuses solely on an advertiser's media placement.
  523. // "CREATIVE_AGENCY" - Plans/executes advertising campaigns.
  524. // "CDIGITAL_AGENCY" - Like a
  525. // FULL_SERVICE_AGENCY,
  526. // but specializing in digital.
  527. // "SEM_SEO" - Increases visibility in search engine result pages.
  528. // "PERFORMANCE_MARKETING" - Drives promotional efforts for immediate
  529. // impact.
  530. // "ADVERTISING_TOOL_DEVELOPMENT" - Focuses on bid management,
  531. // conversion, reporting.
  532. // "PR" - Establishes favorable relationship with public through
  533. // low/no-cost
  534. // communications.
  535. // "SELF_MANAGED" - Does not manage other company's accounts, manages
  536. // own marketing programs.
  537. // "RESELLER" - Full-service AdWords account management for local
  538. // businesses.
  539. CompanyTypes []string `json:"companyTypes,omitempty"`
  540. // ConvertedMinMonthlyBudget: The minimum monthly budget that the
  541. // company accepts for partner business,
  542. // converted to the requested currency code.
  543. ConvertedMinMonthlyBudget *Money `json:"convertedMinMonthlyBudget,omitempty"`
  544. // Id: The ID of the company.
  545. Id string `json:"id,omitempty"`
  546. // Industries: Industries the company can help with.
  547. //
  548. // Possible values:
  549. // "INDUSTRY_UNSPECIFIED" - Unchosen.
  550. // "I_AUTOMOTIVE" - The automotive industry.
  551. // "I_BUSINESS_TO_BUSINESS" - The business-to-business industry.
  552. // "I_CONSUMER_PACKAGED_GOODS" - The consumer packaged goods industry.
  553. // "I_EDUCATION" - The education industry.
  554. // "I_FINANCE" - The finance industry.
  555. // "I_HEALTHCARE" - The healthcare industry.
  556. // "I_MEDIA_AND_ENTERTAINMENT" - The media and entertainment industry.
  557. // "I_RETAIL" - The retail industry.
  558. // "I_TECHNOLOGY" - The technology industry.
  559. // "I_TRAVEL" - The travel industry.
  560. Industries []string `json:"industries,omitempty"`
  561. // LocalizedInfos: The list of localized info for the company.
  562. LocalizedInfos []*LocalizedCompanyInfo `json:"localizedInfos,omitempty"`
  563. // Locations: The list of all company locations.
  564. // If set, must include the
  565. // primary_location
  566. // in the list.
  567. Locations []*Location `json:"locations,omitempty"`
  568. // Name: The name of the company.
  569. Name string `json:"name,omitempty"`
  570. // OriginalMinMonthlyBudget: The unconverted minimum monthly budget that
  571. // the company accepts for partner
  572. // business.
  573. OriginalMinMonthlyBudget *Money `json:"originalMinMonthlyBudget,omitempty"`
  574. // PrimaryAdwordsManagerAccountId: The Primary AdWords Manager Account
  575. // id.
  576. PrimaryAdwordsManagerAccountId int64 `json:"primaryAdwordsManagerAccountId,omitempty,string"`
  577. // PrimaryLanguageCode: The primary language code of the company, as
  578. // defined by
  579. // <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>
  580. // (IETF BCP 47, "Tags for Identifying Languages").
  581. PrimaryLanguageCode string `json:"primaryLanguageCode,omitempty"`
  582. // PrimaryLocation: The primary location of the company.
  583. PrimaryLocation *Location `json:"primaryLocation,omitempty"`
  584. // ProfileStatus: The public viewability status of the company's
  585. // profile.
  586. //
  587. // Possible values:
  588. // "COMPANY_PROFILE_STATUS_UNSPECIFIED" - Unchosen.
  589. // "HIDDEN" - Company profile does not show up publicly.
  590. // "PUBLISHED" - Company profile can only be viewed by the profile's
  591. // URL
  592. // and not by Google Partner Search.
  593. // "SEARCHABLE" - Company profile can be viewed by the profile's
  594. // URL
  595. // and by Google Partner Search.
  596. ProfileStatus string `json:"profileStatus,omitempty"`
  597. // PublicProfile: Basic information from the company's public profile.
  598. PublicProfile *PublicProfile `json:"publicProfile,omitempty"`
  599. // Ranks: Information related to the ranking of the company within the
  600. // list of
  601. // companies.
  602. Ranks []*Rank `json:"ranks,omitempty"`
  603. // Services: Services the company can help with.
  604. //
  605. // Possible values:
  606. // "SERVICE_UNSPECIFIED" - Unchosen.
  607. // "S_ADVANCED_ADWORDS_SUPPORT" - Help with advanced AdWords support.
  608. // "S_ADVERTISING_ON_GOOGLE" - Help with advertising on Google.
  609. // "S_AN_ENHANCED_WEBSITE" - Help with an enhanced website.
  610. // "S_AN_ONLINE_MARKETING_PLAN" - Help with an online marketing plan.
  611. // "S_MOBILE_AND_VIDEO_ADS" - Help with mobile and video ads.
  612. // "S_MOBILE_WEBSITE_SERVICES" - Help with mobile websites.
  613. Services []string `json:"services,omitempty"`
  614. // SpecializationStatus: The list of Google Partners specialization
  615. // statuses for the company.
  616. SpecializationStatus []*SpecializationStatus `json:"specializationStatus,omitempty"`
  617. // WebsiteUrl: URL of the company's website.
  618. WebsiteUrl string `json:"websiteUrl,omitempty"`
  619. // ServerResponse contains the HTTP response code and headers from the
  620. // server.
  621. googleapi.ServerResponse `json:"-"`
  622. // ForceSendFields is a list of field names (e.g. "AdditionalWebsites")
  623. // to unconditionally include in API requests. By default, fields with
  624. // empty values are omitted from API requests. However, any non-pointer,
  625. // non-interface field appearing in ForceSendFields will be sent to the
  626. // server regardless of whether the field is empty or not. This may be
  627. // used to include empty fields in Patch requests.
  628. ForceSendFields []string `json:"-"`
  629. // NullFields is a list of field names (e.g. "AdditionalWebsites") to
  630. // include in API requests with the JSON null value. By default, fields
  631. // with empty values are omitted from API requests. However, any field
  632. // with an empty value appearing in NullFields will be sent to the
  633. // server as null. It is an error if a field in this list has a
  634. // non-empty value. This may be used to include null fields in Patch
  635. // requests.
  636. NullFields []string `json:"-"`
  637. }
  638. func (s *Company) MarshalJSON() ([]byte, error) {
  639. type NoMethod Company
  640. raw := NoMethod(*s)
  641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  642. }
  643. // CompanyRelation: A CompanyRelation resource representing information
  644. // about a user's
  645. // affiliation and standing with a company in Partners.
  646. type CompanyRelation struct {
  647. // Address: The primary address for this company.
  648. Address string `json:"address,omitempty"`
  649. // BadgeTier: Whether the company is a Partner.
  650. //
  651. // Possible values:
  652. // "BADGE_TIER_NONE" - Tier badge is not set.
  653. // "BADGE_TIER_REGULAR" - Agency has regular partner badge.
  654. // "BADGE_TIER_PREMIER" - Agency has premier badge.
  655. BadgeTier string `json:"badgeTier,omitempty"`
  656. // CompanyAdmin: Indicates if the user is an admin for this company.
  657. CompanyAdmin bool `json:"companyAdmin,omitempty"`
  658. // CompanyId: The ID of the company. There may be no id if this is
  659. // a
  660. // pending company.5
  661. CompanyId string `json:"companyId,omitempty"`
  662. // CreationTime: The timestamp of when affiliation was
  663. // requested.
  664. // @OutputOnly
  665. CreationTime string `json:"creationTime,omitempty"`
  666. // InternalCompanyId: The internal company ID.
  667. // Only available for a whitelisted set of api clients.
  668. InternalCompanyId string `json:"internalCompanyId,omitempty"`
  669. // IsPending: The flag that indicates if the company is pending
  670. // verification.
  671. IsPending bool `json:"isPending,omitempty"`
  672. // LogoUrl: A URL to a profile photo, e.g. a G+ profile photo.
  673. LogoUrl string `json:"logoUrl,omitempty"`
  674. // ManagerAccount: The AdWords manager account # associated this
  675. // company.
  676. ManagerAccount int64 `json:"managerAccount,omitempty,string"`
  677. // Name: The name (in the company's primary language) for the company.
  678. Name string `json:"name,omitempty"`
  679. // PhoneNumber: The phone number for the company's primary address.
  680. PhoneNumber string `json:"phoneNumber,omitempty"`
  681. // PrimaryAddress: The primary location of the company.
  682. PrimaryAddress *Location `json:"primaryAddress,omitempty"`
  683. // PrimaryCountryCode: The primary country code of the company.
  684. PrimaryCountryCode string `json:"primaryCountryCode,omitempty"`
  685. // PrimaryLanguageCode: The primary language code of the company.
  686. PrimaryLanguageCode string `json:"primaryLanguageCode,omitempty"`
  687. // ResolvedTimestamp: The timestamp when the user was
  688. // approved.
  689. // @OutputOnly
  690. ResolvedTimestamp string `json:"resolvedTimestamp,omitempty"`
  691. // Segment: The segment the company is classified as.
  692. //
  693. // Possible values:
  694. // "COMPANY_SEGMENT_UNKNOWN" - Default segment indicates an unknown.
  695. // "COMPANY_SEGMENT_NAL" - Segment representing a selected group of
  696. // Partners
  697. // "COMPANY_SEGMENT_PSP" - Segment representing Premier SMB Partners,
  698. // an AdWords partnership program.
  699. // "COMPANY_SEGMENT_PPSP" - A segment of Premier SMB Partners that
  700. // have relationship with Google.
  701. Segment []string `json:"segment,omitempty"`
  702. // SpecializationStatus: The list of Google Partners specialization
  703. // statuses for the company.
  704. SpecializationStatus []*SpecializationStatus `json:"specializationStatus,omitempty"`
  705. // State: The state of relationship, in terms of approvals.
  706. //
  707. // Possible values:
  708. // "USER_COMPANY_REATION_STATE_NONE_SPECIFIED" - Default unspecified
  709. // value.
  710. // "USER_COMPANY_RELATION_STATE_AWAIT_EMAIL" - User has filled in a
  711. // request to be associated with an company.
  712. // Now waiting email confirmation.
  713. // "USER_COMPANY_RELATION_STATE_AWAIT_ADMIN" - Pending approval from
  714. // company.
  715. // Email confirmation will not approve this one.
  716. // "USER_COMPANY_RELATION_STATE_APPROVED" - Approved by company.
  717. State string `json:"state,omitempty"`
  718. // Website: The website URL for this company.
  719. Website string `json:"website,omitempty"`
  720. // ServerResponse contains the HTTP response code and headers from the
  721. // server.
  722. googleapi.ServerResponse `json:"-"`
  723. // ForceSendFields is a list of field names (e.g. "Address") to
  724. // unconditionally include in API requests. By default, fields with
  725. // empty values are omitted from API requests. However, any non-pointer,
  726. // non-interface field appearing in ForceSendFields will be sent to the
  727. // server regardless of whether the field is empty or not. This may be
  728. // used to include empty fields in Patch requests.
  729. ForceSendFields []string `json:"-"`
  730. // NullFields is a list of field names (e.g. "Address") to include in
  731. // API requests with the JSON null value. By default, fields with empty
  732. // values are omitted from API requests. However, any field with an
  733. // empty value appearing in NullFields will be sent to the server as
  734. // null. It is an error if a field in this list has a non-empty value.
  735. // This may be used to include null fields in Patch requests.
  736. NullFields []string `json:"-"`
  737. }
  738. func (s *CompanyRelation) MarshalJSON() ([]byte, error) {
  739. type NoMethod CompanyRelation
  740. raw := NoMethod(*s)
  741. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  742. }
  743. // CountryOfferInfo: Offer info by country.
  744. type CountryOfferInfo struct {
  745. // GetYAmount: (localized) Get Y amount for that country's offer.
  746. GetYAmount string `json:"getYAmount,omitempty"`
  747. // OfferCountryCode: Country code for which offer codes may be
  748. // requested.
  749. OfferCountryCode string `json:"offerCountryCode,omitempty"`
  750. // OfferType: Type of offer country is eligible for.
  751. //
  752. // Possible values:
  753. // "OFFER_TYPE_UNSPECIFIED" - Unset.
  754. // "OFFER_TYPE_SPEND_X_GET_Y" - AdWords spend X get Y.
  755. // "OFFER_TYPE_VIDEO" - Youtube video.
  756. // "OFFER_TYPE_SPEND_MATCH" - Spend Match up to Y.
  757. OfferType string `json:"offerType,omitempty"`
  758. // SpendXAmount: (localized) Spend X amount for that country's offer.
  759. SpendXAmount string `json:"spendXAmount,omitempty"`
  760. // ForceSendFields is a list of field names (e.g. "GetYAmount") to
  761. // unconditionally include in API requests. By default, fields with
  762. // empty values are omitted from API requests. However, any non-pointer,
  763. // non-interface field appearing in ForceSendFields will be sent to the
  764. // server regardless of whether the field is empty or not. This may be
  765. // used to include empty fields in Patch requests.
  766. ForceSendFields []string `json:"-"`
  767. // NullFields is a list of field names (e.g. "GetYAmount") to include in
  768. // API requests with the JSON null value. By default, fields with empty
  769. // values are omitted from API requests. However, any field with an
  770. // empty value appearing in NullFields will be sent to the server as
  771. // null. It is an error if a field in this list has a non-empty value.
  772. // This may be used to include null fields in Patch requests.
  773. NullFields []string `json:"-"`
  774. }
  775. func (s *CountryOfferInfo) MarshalJSON() ([]byte, error) {
  776. type NoMethod CountryOfferInfo
  777. raw := NoMethod(*s)
  778. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  779. }
  780. // CreateLeadRequest: Request message for CreateLead.
  781. type CreateLeadRequest struct {
  782. // Lead: The lead resource. The `LeadType` must not be
  783. // `LEAD_TYPE_UNSPECIFIED`
  784. // and either `email` or `phone_number` must be provided.
  785. Lead *Lead `json:"lead,omitempty"`
  786. // RecaptchaChallenge: <a
  787. // href="https://www.google.com/recaptcha/">reCaptcha</a> challenge
  788. // info.
  789. RecaptchaChallenge *RecaptchaChallenge `json:"recaptchaChallenge,omitempty"`
  790. // RequestMetadata: Current request metadata.
  791. RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"`
  792. // ForceSendFields is a list of field names (e.g. "Lead") to
  793. // unconditionally include in API requests. By default, fields with
  794. // empty values are omitted from API requests. However, any non-pointer,
  795. // non-interface field appearing in ForceSendFields will be sent to the
  796. // server regardless of whether the field is empty or not. This may be
  797. // used to include empty fields in Patch requests.
  798. ForceSendFields []string `json:"-"`
  799. // NullFields is a list of field names (e.g. "Lead") to include in API
  800. // requests with the JSON null value. By default, fields with empty
  801. // values are omitted from API requests. However, any field with an
  802. // empty value appearing in NullFields will be sent to the server as
  803. // null. It is an error if a field in this list has a non-empty value.
  804. // This may be used to include null fields in Patch requests.
  805. NullFields []string `json:"-"`
  806. }
  807. func (s *CreateLeadRequest) MarshalJSON() ([]byte, error) {
  808. type NoMethod CreateLeadRequest
  809. raw := NoMethod(*s)
  810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  811. }
  812. // CreateLeadResponse: Response message for CreateLead.
  813. type CreateLeadResponse struct {
  814. // Lead: Lead that was created depending on the outcome of
  815. // <a href="https://www.google.com/recaptcha/">reCaptcha</a> validation.
  816. Lead *Lead `json:"lead,omitempty"`
  817. // RecaptchaStatus: The outcome of <a
  818. // href="https://www.google.com/recaptcha/">reCaptcha</a>
  819. // validation.
  820. //
  821. // Possible values:
  822. // "RECAPTCHA_STATUS_UNSPECIFIED" - Unchosen.
  823. // "RS_NOT_NEEDED" - No reCaptcha validation needed.
  824. // "RS_PASSED" - reCaptcha challenge passed.
  825. // "RS_FAILED" - reCaptcha challenge failed.
  826. RecaptchaStatus string `json:"recaptchaStatus,omitempty"`
  827. // ResponseMetadata: Current response metadata.
  828. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  829. // ServerResponse contains the HTTP response code and headers from the
  830. // server.
  831. googleapi.ServerResponse `json:"-"`
  832. // ForceSendFields is a list of field names (e.g. "Lead") to
  833. // unconditionally include in API requests. By default, fields with
  834. // empty values are omitted from API requests. However, any non-pointer,
  835. // non-interface field appearing in ForceSendFields will be sent to the
  836. // server regardless of whether the field is empty or not. This may be
  837. // used to include empty fields in Patch requests.
  838. ForceSendFields []string `json:"-"`
  839. // NullFields is a list of field names (e.g. "Lead") to include in API
  840. // requests with the JSON null value. By default, fields with empty
  841. // values are omitted from API requests. However, any field with an
  842. // empty value appearing in NullFields will be sent to the server as
  843. // null. It is an error if a field in this list has a non-empty value.
  844. // This may be used to include null fields in Patch requests.
  845. NullFields []string `json:"-"`
  846. }
  847. func (s *CreateLeadResponse) MarshalJSON() ([]byte, error) {
  848. type NoMethod CreateLeadResponse
  849. raw := NoMethod(*s)
  850. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  851. }
  852. // Date: Represents a whole or partial calendar date, e.g. a birthday.
  853. // The time of day
  854. // and time zone are either specified elsewhere or are not significant.
  855. // The date
  856. // is relative to the Proleptic Gregorian Calendar. This can
  857. // represent:
  858. //
  859. // * A full date, with non-zero year, month and day values
  860. // * A month and day value, with a zero year, e.g. an anniversary
  861. // * A year on its own, with zero month and day values
  862. // * A year and month value, with a zero day, e.g. a credit card
  863. // expiration date
  864. //
  865. // Related types are google.type.TimeOfDay and
  866. // `google.protobuf.Timestamp`.
  867. type Date struct {
  868. // Day: Day of month. Must be from 1 to 31 and valid for the year and
  869. // month, or 0
  870. // if specifying a year by itself or a year and month where the day is
  871. // not
  872. // significant.
  873. Day int64 `json:"day,omitempty"`
  874. // Month: Month of year. Must be from 1 to 12, or 0 if specifying a year
  875. // without a
  876. // month and day.
  877. Month int64 `json:"month,omitempty"`
  878. // Year: Year of date. Must be from 1 to 9999, or 0 if specifying a date
  879. // without
  880. // a year.
  881. Year int64 `json:"year,omitempty"`
  882. // ForceSendFields is a list of field names (e.g. "Day") to
  883. // unconditionally include in API requests. By default, fields with
  884. // empty values are omitted from API requests. However, any non-pointer,
  885. // non-interface field appearing in ForceSendFields will be sent to the
  886. // server regardless of whether the field is empty or not. This may be
  887. // used to include empty fields in Patch requests.
  888. ForceSendFields []string `json:"-"`
  889. // NullFields is a list of field names (e.g. "Day") to include in API
  890. // requests with the JSON null value. By default, fields with empty
  891. // values are omitted from API requests. However, any field with an
  892. // empty value appearing in NullFields will be sent to the server as
  893. // null. It is an error if a field in this list has a non-empty value.
  894. // This may be used to include null fields in Patch requests.
  895. NullFields []string `json:"-"`
  896. }
  897. func (s *Date) MarshalJSON() ([]byte, error) {
  898. type NoMethod Date
  899. raw := NoMethod(*s)
  900. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  901. }
  902. // DebugInfo: Debug information about this request.
  903. type DebugInfo struct {
  904. // ServerInfo: Info about the server that serviced this request.
  905. ServerInfo string `json:"serverInfo,omitempty"`
  906. // ServerTraceInfo: Server-side debug stack trace.
  907. ServerTraceInfo string `json:"serverTraceInfo,omitempty"`
  908. // ServiceUrl: URL of the service that handled this request.
  909. ServiceUrl string `json:"serviceUrl,omitempty"`
  910. // ForceSendFields is a list of field names (e.g. "ServerInfo") to
  911. // unconditionally include in API requests. By default, fields with
  912. // empty values are omitted from API requests. However, any non-pointer,
  913. // non-interface field appearing in ForceSendFields will be sent to the
  914. // server regardless of whether the field is empty or not. This may be
  915. // used to include empty fields in Patch requests.
  916. ForceSendFields []string `json:"-"`
  917. // NullFields is a list of field names (e.g. "ServerInfo") to include in
  918. // API requests with the JSON null value. By default, fields with empty
  919. // values are omitted from API requests. However, any field with an
  920. // empty value appearing in NullFields will be sent to the server as
  921. // null. It is an error if a field in this list has a non-empty value.
  922. // This may be used to include null fields in Patch requests.
  923. NullFields []string `json:"-"`
  924. }
  925. func (s *DebugInfo) MarshalJSON() ([]byte, error) {
  926. type NoMethod DebugInfo
  927. raw := NoMethod(*s)
  928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  929. }
  930. // Empty: A generic empty message that you can re-use to avoid defining
  931. // duplicated
  932. // empty messages in your APIs. A typical example is to use it as the
  933. // request
  934. // or the response type of an API method. For instance:
  935. //
  936. // service Foo {
  937. // rpc Bar(google.protobuf.Empty) returns
  938. // (google.protobuf.Empty);
  939. // }
  940. //
  941. // The JSON representation for `Empty` is empty JSON object `{}`.
  942. type Empty struct {
  943. // ServerResponse contains the HTTP response code and headers from the
  944. // server.
  945. googleapi.ServerResponse `json:"-"`
  946. }
  947. // EventData: Key value data pair for an event.
  948. type EventData struct {
  949. // Key: Data type.
  950. //
  951. // Possible values:
  952. // "EVENT_DATA_TYPE_UNSPECIFIED" - Unchosen.
  953. // "ACTION" - Action data.
  954. // "AGENCY_ID" - Agency ID data.
  955. // "AGENCY_NAME" - Agency name data.
  956. // "AGENCY_PHONE_NUMBER" - Agency phone number data.
  957. // "AGENCY_WEBSITE" - Agency website data.
  958. // "BUDGET" - Budget data.
  959. // "CENTER_POINT" - Center-point data.
  960. // "CERTIFICATION" - Certification data.
  961. // "COMMENT" - Comment data.
  962. // "COUNTRY" - Country data.
  963. // "CURRENCY" - Currency data.
  964. // "CURRENTLY_VIEWED_AGENCY_ID" - Currently viewed agency ID data.
  965. // "DISTANCE" - Distance data.
  966. // "DISTANCE_TYPE" - Distance type data.
  967. // "EXAM" - Exam data.
  968. // "HISTORY_TOKEN" - History token data.
  969. // "ID" - Identifier data.
  970. // "INDUSTRY" - Industry data.
  971. // "INSIGHT_TAG" - Insight tag data.
  972. // "LANGUAGE" - Language data.
  973. // "LOCATION" - Location data.
  974. // "MARKETING_OPT_IN" - Marketing opt-in data.
  975. // "QUERY" - Query data.
  976. // "SEARCH_START_INDEX" - Search start index data.
  977. // "SERVICE" - Service data.
  978. // "SHOW_VOW" - Show vow data.
  979. // "SOLUTION" - Solution data.
  980. // "TRAFFIC_SOURCE_ID" - Traffic source ID data.
  981. // "TRAFFIC_SUB_ID" - Traffic sub ID data.
  982. // "VIEW_PORT" - Viewport data.
  983. // "WEBSITE" - Website data.
  984. // "DETAILS" - Details data.
  985. // "EXPERIMENT_ID" - Experiment ID data.
  986. // "GPS_MOTIVATION" - Google Partner Search motivation data.
  987. // "URL" - URL data.
  988. // "ELEMENT_FOCUS" - Element we wanted user to focus on.
  989. // "PROGRESS" - Progress when viewing an item \[0-100\].
  990. Key string `json:"key,omitempty"`
  991. // Values: Data values.
  992. Values []string `json:"values,omitempty"`
  993. // ForceSendFields is a list of field names (e.g. "Key") to
  994. // unconditionally include in API requests. By default, fields with
  995. // empty values are omitted from API requests. However, any non-pointer,
  996. // non-interface field appearing in ForceSendFields will be sent to the
  997. // server regardless of whether the field is empty or not. This may be
  998. // used to include empty fields in Patch requests.
  999. ForceSendFields []string `json:"-"`
  1000. // NullFields is a list of field names (e.g. "Key") to include in API
  1001. // requests with the JSON null value. By default, fields with empty
  1002. // values are omitted from API requests. However, any field with an
  1003. // empty value appearing in NullFields will be sent to the server as
  1004. // null. It is an error if a field in this list has a non-empty value.
  1005. // This may be used to include null fields in Patch requests.
  1006. NullFields []string `json:"-"`
  1007. }
  1008. func (s *EventData) MarshalJSON() ([]byte, error) {
  1009. type NoMethod EventData
  1010. raw := NoMethod(*s)
  1011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1012. }
  1013. // ExamStatus: A user's information on a specific exam.
  1014. type ExamStatus struct {
  1015. // ExamType: The type of the exam.
  1016. //
  1017. // Possible values:
  1018. // "CERTIFICATION_EXAM_TYPE_UNSPECIFIED" - Unchosen.
  1019. // "CET_ADWORDS_FUNDAMENTALS" - Adwords Fundamentals exam.
  1020. // "CET_ADWORDS_ADVANCED_SEARCH" - AdWords advanced search exam.
  1021. // "CET_ADWORDS_ADVANCED_DISPLAY" - AdWords advanced display exam.
  1022. // "CET_VIDEO_ADS" - VideoAds exam.
  1023. // "CET_DOUBLECLICK" - DoubleClick exam.
  1024. // "CET_ANALYTICS" - Analytics exam.
  1025. // "CET_SHOPPING" - Shopping exam.
  1026. // "CET_MOBILE" - Mobile exam.
  1027. // "CET_DIGITAL_SALES" - Digital Sales exam.
  1028. // "CET_MOBILE_SITES" - Mobile Sites exam.
  1029. ExamType string `json:"examType,omitempty"`
  1030. // Expiration: Date this exam is due to expire.
  1031. Expiration string `json:"expiration,omitempty"`
  1032. // LastPassed: The date the user last passed this exam.
  1033. LastPassed string `json:"lastPassed,omitempty"`
  1034. // Passed: Whether this exam has been passed and not expired.
  1035. Passed bool `json:"passed,omitempty"`
  1036. // Taken: The date the user last taken this exam.
  1037. Taken string `json:"taken,omitempty"`
  1038. // Warning: Whether this exam is in the state of warning.
  1039. Warning bool `json:"warning,omitempty"`
  1040. // ForceSendFields is a list of field names (e.g. "ExamType") to
  1041. // unconditionally include in API requests. By default, fields with
  1042. // empty values are omitted from API requests. However, any non-pointer,
  1043. // non-interface field appearing in ForceSendFields will be sent to the
  1044. // server regardless of whether the field is empty or not. This may be
  1045. // used to include empty fields in Patch requests.
  1046. ForceSendFields []string `json:"-"`
  1047. // NullFields is a list of field names (e.g. "ExamType") to include in
  1048. // API requests with the JSON null value. By default, fields with empty
  1049. // values are omitted from API requests. However, any field with an
  1050. // empty value appearing in NullFields will be sent to the server as
  1051. // null. It is an error if a field in this list has a non-empty value.
  1052. // This may be used to include null fields in Patch requests.
  1053. NullFields []string `json:"-"`
  1054. }
  1055. func (s *ExamStatus) MarshalJSON() ([]byte, error) {
  1056. type NoMethod ExamStatus
  1057. raw := NoMethod(*s)
  1058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1059. }
  1060. // GetCompanyResponse: Response message for GetCompany.
  1061. type GetCompanyResponse struct {
  1062. // Company: The company.
  1063. Company *Company `json:"company,omitempty"`
  1064. // ResponseMetadata: Current response metadata.
  1065. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1066. // ServerResponse contains the HTTP response code and headers from the
  1067. // server.
  1068. googleapi.ServerResponse `json:"-"`
  1069. // ForceSendFields is a list of field names (e.g. "Company") to
  1070. // unconditionally include in API requests. By default, fields with
  1071. // empty values are omitted from API requests. However, any non-pointer,
  1072. // non-interface field appearing in ForceSendFields will be sent to the
  1073. // server regardless of whether the field is empty or not. This may be
  1074. // used to include empty fields in Patch requests.
  1075. ForceSendFields []string `json:"-"`
  1076. // NullFields is a list of field names (e.g. "Company") to include in
  1077. // API requests with the JSON null value. By default, fields with empty
  1078. // values are omitted from API requests. However, any field with an
  1079. // empty value appearing in NullFields will be sent to the server as
  1080. // null. It is an error if a field in this list has a non-empty value.
  1081. // This may be used to include null fields in Patch requests.
  1082. NullFields []string `json:"-"`
  1083. }
  1084. func (s *GetCompanyResponse) MarshalJSON() ([]byte, error) {
  1085. type NoMethod GetCompanyResponse
  1086. raw := NoMethod(*s)
  1087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1088. }
  1089. // GetPartnersStatusResponse: Response message for
  1090. // GetPartnersStatus.
  1091. type GetPartnersStatusResponse struct {
  1092. // ResponseMetadata: Current response metadata.
  1093. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1094. // ServerResponse contains the HTTP response code and headers from the
  1095. // server.
  1096. googleapi.ServerResponse `json:"-"`
  1097. // ForceSendFields is a list of field names (e.g. "ResponseMetadata") to
  1098. // unconditionally include in API requests. By default, fields with
  1099. // empty values are omitted from API requests. However, any non-pointer,
  1100. // non-interface field appearing in ForceSendFields will be sent to the
  1101. // server regardless of whether the field is empty or not. This may be
  1102. // used to include empty fields in Patch requests.
  1103. ForceSendFields []string `json:"-"`
  1104. // NullFields is a list of field names (e.g. "ResponseMetadata") to
  1105. // include in API requests with the JSON null value. By default, fields
  1106. // with empty values are omitted from API requests. However, any field
  1107. // with an empty value appearing in NullFields will be sent to the
  1108. // server as null. It is an error if a field in this list has a
  1109. // non-empty value. This may be used to include null fields in Patch
  1110. // requests.
  1111. NullFields []string `json:"-"`
  1112. }
  1113. func (s *GetPartnersStatusResponse) MarshalJSON() ([]byte, error) {
  1114. type NoMethod GetPartnersStatusResponse
  1115. raw := NoMethod(*s)
  1116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1117. }
  1118. // HistoricalOffer: Historical information about a Google Partners
  1119. // Offer.
  1120. type HistoricalOffer struct {
  1121. // AdwordsUrl: Client's AdWords page URL.
  1122. AdwordsUrl string `json:"adwordsUrl,omitempty"`
  1123. // ClientEmail: Email address for client.
  1124. ClientEmail string `json:"clientEmail,omitempty"`
  1125. // ClientId: ID of client.
  1126. ClientId int64 `json:"clientId,omitempty,string"`
  1127. // ClientName: Name of the client.
  1128. ClientName string `json:"clientName,omitempty"`
  1129. // CreationTime: Time offer was first created.
  1130. CreationTime string `json:"creationTime,omitempty"`
  1131. // ExpirationTime: Time this offer expires.
  1132. ExpirationTime string `json:"expirationTime,omitempty"`
  1133. // LastModifiedTime: Time last action was taken.
  1134. LastModifiedTime string `json:"lastModifiedTime,omitempty"`
  1135. // OfferCode: Offer code.
  1136. OfferCode string `json:"offerCode,omitempty"`
  1137. // OfferCountryCode: Country Code for the offer country.
  1138. OfferCountryCode string `json:"offerCountryCode,omitempty"`
  1139. // OfferType: Type of offer.
  1140. //
  1141. // Possible values:
  1142. // "OFFER_TYPE_UNSPECIFIED" - Unset.
  1143. // "OFFER_TYPE_SPEND_X_GET_Y" - AdWords spend X get Y.
  1144. // "OFFER_TYPE_VIDEO" - Youtube video.
  1145. // "OFFER_TYPE_SPEND_MATCH" - Spend Match up to Y.
  1146. OfferType string `json:"offerType,omitempty"`
  1147. // SenderName: Name (First + Last) of the partners user to whom the
  1148. // incentive is allocated.
  1149. SenderName string `json:"senderName,omitempty"`
  1150. // Status: Status of the offer.
  1151. //
  1152. // Possible values:
  1153. // "OFFER_STATUS_UNSPECIFIED" - Unset.
  1154. // "OFFER_STATUS_DISTRIBUTED" - Offer distributed.
  1155. // "OFFER_STATUS_REDEEMED" - Offer redeemed.
  1156. // "OFFER_STATUS_AWARDED" - Offer awarded.
  1157. // "OFFER_STATUS_EXPIRED" - Offer expired.
  1158. Status string `json:"status,omitempty"`
  1159. // ForceSendFields is a list of field names (e.g. "AdwordsUrl") to
  1160. // unconditionally include in API requests. By default, fields with
  1161. // empty values are omitted from API requests. However, any non-pointer,
  1162. // non-interface field appearing in ForceSendFields will be sent to the
  1163. // server regardless of whether the field is empty or not. This may be
  1164. // used to include empty fields in Patch requests.
  1165. ForceSendFields []string `json:"-"`
  1166. // NullFields is a list of field names (e.g. "AdwordsUrl") to include in
  1167. // API requests with the JSON null value. By default, fields with empty
  1168. // values are omitted from API requests. However, any field with an
  1169. // empty value appearing in NullFields will be sent to the server as
  1170. // null. It is an error if a field in this list has a non-empty value.
  1171. // This may be used to include null fields in Patch requests.
  1172. NullFields []string `json:"-"`
  1173. }
  1174. func (s *HistoricalOffer) MarshalJSON() ([]byte, error) {
  1175. type NoMethod HistoricalOffer
  1176. raw := NoMethod(*s)
  1177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1178. }
  1179. // LatLng: An object representing a latitude/longitude pair. This is
  1180. // expressed as a pair
  1181. // of doubles representing degrees latitude and degrees longitude.
  1182. // Unless
  1183. // specified otherwise, this must conform to the
  1184. // <a
  1185. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  1186. // st
  1187. // andard</a>. Values must be within normalized ranges.
  1188. type LatLng struct {
  1189. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  1190. // +90.0].
  1191. Latitude float64 `json:"latitude,omitempty"`
  1192. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  1193. // +180.0].
  1194. Longitude float64 `json:"longitude,omitempty"`
  1195. // ForceSendFields is a list of field names (e.g. "Latitude") to
  1196. // unconditionally include in API requests. By default, fields with
  1197. // empty values are omitted from API requests. However, any non-pointer,
  1198. // non-interface field appearing in ForceSendFields will be sent to the
  1199. // server regardless of whether the field is empty or not. This may be
  1200. // used to include empty fields in Patch requests.
  1201. ForceSendFields []string `json:"-"`
  1202. // NullFields is a list of field names (e.g. "Latitude") to include in
  1203. // API requests with the JSON null value. By default, fields with empty
  1204. // values are omitted from API requests. However, any field with an
  1205. // empty value appearing in NullFields will be sent to the server as
  1206. // null. It is an error if a field in this list has a non-empty value.
  1207. // This may be used to include null fields in Patch requests.
  1208. NullFields []string `json:"-"`
  1209. }
  1210. func (s *LatLng) MarshalJSON() ([]byte, error) {
  1211. type NoMethod LatLng
  1212. raw := NoMethod(*s)
  1213. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1214. }
  1215. func (s *LatLng) UnmarshalJSON(data []byte) error {
  1216. type NoMethod LatLng
  1217. var s1 struct {
  1218. Latitude gensupport.JSONFloat64 `json:"latitude"`
  1219. Longitude gensupport.JSONFloat64 `json:"longitude"`
  1220. *NoMethod
  1221. }
  1222. s1.NoMethod = (*NoMethod)(s)
  1223. if err := json.Unmarshal(data, &s1); err != nil {
  1224. return err
  1225. }
  1226. s.Latitude = float64(s1.Latitude)
  1227. s.Longitude = float64(s1.Longitude)
  1228. return nil
  1229. }
  1230. // Lead: A lead resource that represents an advertiser contact for a
  1231. // `Company`. These
  1232. // are usually generated via Google Partner Search (the advertiser
  1233. // portal).
  1234. type Lead struct {
  1235. // AdwordsCustomerId: The AdWords Customer ID of the lead.
  1236. AdwordsCustomerId int64 `json:"adwordsCustomerId,omitempty,string"`
  1237. // Comments: Comments lead source gave.
  1238. Comments string `json:"comments,omitempty"`
  1239. // CreateTime: Timestamp of when this lead was created.
  1240. CreateTime string `json:"createTime,omitempty"`
  1241. // Email: Email address of lead source.
  1242. Email string `json:"email,omitempty"`
  1243. // FamilyName: Last name of lead source.
  1244. FamilyName string `json:"familyName,omitempty"`
  1245. // GivenName: First name of lead source.
  1246. GivenName string `json:"givenName,omitempty"`
  1247. // GpsMotivations: List of reasons for using Google Partner Search and
  1248. // creating a lead.
  1249. //
  1250. // Possible values:
  1251. // "GPS_MOTIVATION_UNSPECIFIED" - Unchosen.
  1252. // "GPSM_HELP_WITH_ADVERTISING" - Advertiser needs help with their
  1253. // advertising.
  1254. // "GPSM_HELP_WITH_WEBSITE" - Advertiser needs help with their
  1255. // website.
  1256. // "GPSM_NO_WEBSITE" - Advertiser does not have a website.
  1257. GpsMotivations []string `json:"gpsMotivations,omitempty"`
  1258. // Id: ID of the lead.
  1259. Id string `json:"id,omitempty"`
  1260. // LanguageCode: Language code of the lead's language preference, as
  1261. // defined by
  1262. // <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>
  1263. // (IETF BCP 47, "Tags for Identifying Languages").
  1264. LanguageCode string `json:"languageCode,omitempty"`
  1265. // MarketingOptIn: Whether or not the lead signed up for marketing
  1266. // emails
  1267. MarketingOptIn bool `json:"marketingOptIn,omitempty"`
  1268. // MinMonthlyBudget: The minimum monthly budget lead source is willing
  1269. // to spend.
  1270. MinMonthlyBudget *Money `json:"minMonthlyBudget,omitempty"`
  1271. // PhoneNumber: Phone number of lead source.
  1272. PhoneNumber string `json:"phoneNumber,omitempty"`
  1273. // State: The lead's state in relation to the company.
  1274. //
  1275. // Possible values:
  1276. // "LEAD_STATE_UNSPECIFIED" - Unchosen.
  1277. // "LEAD" - Lead not yet contacted.
  1278. // "CONTACTED" - Lead has been contacted.
  1279. // "CLIENT" - Lead has become a client.
  1280. // "OTHER" - Lead in a state not covered by other options.
  1281. State string `json:"state,omitempty"`
  1282. // Type: Type of lead.
  1283. //
  1284. // Possible values:
  1285. // "LEAD_TYPE_UNSPECIFIED" - Unchosen.
  1286. // "LT_GPS" - Google Partner Search.
  1287. Type string `json:"type,omitempty"`
  1288. // WebsiteUrl: Website URL of lead source.
  1289. WebsiteUrl string `json:"websiteUrl,omitempty"`
  1290. // ServerResponse contains the HTTP response code and headers from the
  1291. // server.
  1292. googleapi.ServerResponse `json:"-"`
  1293. // ForceSendFields is a list of field names (e.g. "AdwordsCustomerId")
  1294. // to unconditionally include in API requests. By default, fields with
  1295. // empty values are omitted from API requests. However, any non-pointer,
  1296. // non-interface field appearing in ForceSendFields will be sent to the
  1297. // server regardless of whether the field is empty or not. This may be
  1298. // used to include empty fields in Patch requests.
  1299. ForceSendFields []string `json:"-"`
  1300. // NullFields is a list of field names (e.g. "AdwordsCustomerId") to
  1301. // include in API requests with the JSON null value. By default, fields
  1302. // with empty values are omitted from API requests. However, any field
  1303. // with an empty value appearing in NullFields will be sent to the
  1304. // server as null. It is an error if a field in this list has a
  1305. // non-empty value. This may be used to include null fields in Patch
  1306. // requests.
  1307. NullFields []string `json:"-"`
  1308. }
  1309. func (s *Lead) MarshalJSON() ([]byte, error) {
  1310. type NoMethod Lead
  1311. raw := NoMethod(*s)
  1312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1313. }
  1314. // ListAnalyticsResponse: Response message for
  1315. // ListAnalytics.
  1316. type ListAnalyticsResponse struct {
  1317. // Analytics: The list of analytics.
  1318. // Sorted in ascending order of
  1319. // Analytics.event_date.
  1320. Analytics []*Analytics `json:"analytics,omitempty"`
  1321. // AnalyticsSummary: Aggregated information across the
  1322. // response's
  1323. // analytics.
  1324. AnalyticsSummary *AnalyticsSummary `json:"analyticsSummary,omitempty"`
  1325. // NextPageToken: A token to retrieve next page of results.
  1326. // Pass this value in the `ListAnalyticsRequest.page_token` field in
  1327. // the
  1328. // subsequent call to
  1329. // ListAnalytics to retrieve the
  1330. // next page of results.
  1331. NextPageToken string `json:"nextPageToken,omitempty"`
  1332. // ResponseMetadata: Current response metadata.
  1333. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1334. // ServerResponse contains the HTTP response code and headers from the
  1335. // server.
  1336. googleapi.ServerResponse `json:"-"`
  1337. // ForceSendFields is a list of field names (e.g. "Analytics") to
  1338. // unconditionally include in API requests. By default, fields with
  1339. // empty values are omitted from API requests. However, any non-pointer,
  1340. // non-interface field appearing in ForceSendFields will be sent to the
  1341. // server regardless of whether the field is empty or not. This may be
  1342. // used to include empty fields in Patch requests.
  1343. ForceSendFields []string `json:"-"`
  1344. // NullFields is a list of field names (e.g. "Analytics") to include in
  1345. // API requests with the JSON null value. By default, fields with empty
  1346. // values are omitted from API requests. However, any field with an
  1347. // empty value appearing in NullFields will be sent to the server as
  1348. // null. It is an error if a field in this list has a non-empty value.
  1349. // This may be used to include null fields in Patch requests.
  1350. NullFields []string `json:"-"`
  1351. }
  1352. func (s *ListAnalyticsResponse) MarshalJSON() ([]byte, error) {
  1353. type NoMethod ListAnalyticsResponse
  1354. raw := NoMethod(*s)
  1355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1356. }
  1357. // ListCompaniesResponse: Response message for
  1358. // ListCompanies.
  1359. type ListCompaniesResponse struct {
  1360. // Companies: The list of companies.
  1361. Companies []*Company `json:"companies,omitempty"`
  1362. // NextPageToken: A token to retrieve next page of results.
  1363. // Pass this value in the `ListCompaniesRequest.page_token` field in
  1364. // the
  1365. // subsequent call to
  1366. // ListCompanies to retrieve the
  1367. // next page of results.
  1368. NextPageToken string `json:"nextPageToken,omitempty"`
  1369. // ResponseMetadata: Current response metadata.
  1370. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1371. // ServerResponse contains the HTTP response code and headers from the
  1372. // server.
  1373. googleapi.ServerResponse `json:"-"`
  1374. // ForceSendFields is a list of field names (e.g. "Companies") to
  1375. // unconditionally include in API requests. By default, fields with
  1376. // empty values are omitted from API requests. However, any non-pointer,
  1377. // non-interface field appearing in ForceSendFields will be sent to the
  1378. // server regardless of whether the field is empty or not. This may be
  1379. // used to include empty fields in Patch requests.
  1380. ForceSendFields []string `json:"-"`
  1381. // NullFields is a list of field names (e.g. "Companies") to include in
  1382. // API requests with the JSON null value. By default, fields with empty
  1383. // values are omitted from API requests. However, any field with an
  1384. // empty value appearing in NullFields will be sent to the server as
  1385. // null. It is an error if a field in this list has a non-empty value.
  1386. // This may be used to include null fields in Patch requests.
  1387. NullFields []string `json:"-"`
  1388. }
  1389. func (s *ListCompaniesResponse) MarshalJSON() ([]byte, error) {
  1390. type NoMethod ListCompaniesResponse
  1391. raw := NoMethod(*s)
  1392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1393. }
  1394. // ListLeadsResponse: Response message for ListLeads.
  1395. type ListLeadsResponse struct {
  1396. // Leads: The list of leads.
  1397. Leads []*Lead `json:"leads,omitempty"`
  1398. // NextPageToken: A token to retrieve next page of results.
  1399. // Pass this value in the `ListLeadsRequest.page_token` field in
  1400. // the
  1401. // subsequent call to
  1402. // ListLeads to retrieve the
  1403. // next page of results.
  1404. NextPageToken string `json:"nextPageToken,omitempty"`
  1405. // ResponseMetadata: Current response metadata.
  1406. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1407. // TotalSize: The total count of leads for the given company.
  1408. TotalSize int64 `json:"totalSize,omitempty"`
  1409. // ServerResponse contains the HTTP response code and headers from the
  1410. // server.
  1411. googleapi.ServerResponse `json:"-"`
  1412. // ForceSendFields is a list of field names (e.g. "Leads") to
  1413. // unconditionally include in API requests. By default, fields with
  1414. // empty values are omitted from API requests. However, any non-pointer,
  1415. // non-interface field appearing in ForceSendFields will be sent to the
  1416. // server regardless of whether the field is empty or not. This may be
  1417. // used to include empty fields in Patch requests.
  1418. ForceSendFields []string `json:"-"`
  1419. // NullFields is a list of field names (e.g. "Leads") to include in API
  1420. // requests with the JSON null value. By default, fields with empty
  1421. // values are omitted from API requests. However, any field with an
  1422. // empty value appearing in NullFields will be sent to the server as
  1423. // null. It is an error if a field in this list has a non-empty value.
  1424. // This may be used to include null fields in Patch requests.
  1425. NullFields []string `json:"-"`
  1426. }
  1427. func (s *ListLeadsResponse) MarshalJSON() ([]byte, error) {
  1428. type NoMethod ListLeadsResponse
  1429. raw := NoMethod(*s)
  1430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1431. }
  1432. // ListOffersHistoryResponse: Response for ListOfferHistory.
  1433. type ListOffersHistoryResponse struct {
  1434. // CanShowEntireCompany: True if the user has the option to show entire
  1435. // company history.
  1436. CanShowEntireCompany bool `json:"canShowEntireCompany,omitempty"`
  1437. // NextPageToken: Supply this token in a ListOffersHistoryRequest to
  1438. // retrieve the next page.
  1439. NextPageToken string `json:"nextPageToken,omitempty"`
  1440. // Offers: Historical offers meeting request.
  1441. Offers []*HistoricalOffer `json:"offers,omitempty"`
  1442. // ResponseMetadata: Current response metadata.
  1443. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1444. // ShowingEntireCompany: True if this response is showing entire company
  1445. // history.
  1446. ShowingEntireCompany bool `json:"showingEntireCompany,omitempty"`
  1447. // TotalResults: Number of results across all pages.
  1448. TotalResults int64 `json:"totalResults,omitempty"`
  1449. // ServerResponse contains the HTTP response code and headers from the
  1450. // server.
  1451. googleapi.ServerResponse `json:"-"`
  1452. // ForceSendFields is a list of field names (e.g.
  1453. // "CanShowEntireCompany") to unconditionally include in API requests.
  1454. // By default, fields with empty values are omitted from API requests.
  1455. // However, any non-pointer, non-interface field appearing in
  1456. // ForceSendFields will be sent to the server regardless of whether the
  1457. // field is empty or not. This may be used to include empty fields in
  1458. // Patch requests.
  1459. ForceSendFields []string `json:"-"`
  1460. // NullFields is a list of field names (e.g. "CanShowEntireCompany") to
  1461. // include in API requests with the JSON null value. By default, fields
  1462. // with empty values are omitted from API requests. However, any field
  1463. // with an empty value appearing in NullFields will be sent to the
  1464. // server as null. It is an error if a field in this list has a
  1465. // non-empty value. This may be used to include null fields in Patch
  1466. // requests.
  1467. NullFields []string `json:"-"`
  1468. }
  1469. func (s *ListOffersHistoryResponse) MarshalJSON() ([]byte, error) {
  1470. type NoMethod ListOffersHistoryResponse
  1471. raw := NoMethod(*s)
  1472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1473. }
  1474. // ListOffersResponse: Response for ListOffer.
  1475. type ListOffersResponse struct {
  1476. // AvailableOffers: Available Offers to be distributed.
  1477. AvailableOffers []*AvailableOffer `json:"availableOffers,omitempty"`
  1478. // NoOfferReason: Reason why no Offers are available.
  1479. //
  1480. // Possible values:
  1481. // "NO_OFFER_REASON_UNSPECIFIED" - Unset.
  1482. // "NO_OFFER_REASON_NO_MCC" - Not an MCC.
  1483. // "NO_OFFER_REASON_LIMIT_REACHED" - Offer limit has been reached.
  1484. // "NO_OFFER_REASON_INELIGIBLE" - Ineligible for offers.
  1485. NoOfferReason string `json:"noOfferReason,omitempty"`
  1486. // ResponseMetadata: Current response metadata.
  1487. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1488. // ServerResponse contains the HTTP response code and headers from the
  1489. // server.
  1490. googleapi.ServerResponse `json:"-"`
  1491. // ForceSendFields is a list of field names (e.g. "AvailableOffers") to
  1492. // unconditionally include in API requests. By default, fields with
  1493. // empty values are omitted from API requests. However, any non-pointer,
  1494. // non-interface field appearing in ForceSendFields will be sent to the
  1495. // server regardless of whether the field is empty or not. This may be
  1496. // used to include empty fields in Patch requests.
  1497. ForceSendFields []string `json:"-"`
  1498. // NullFields is a list of field names (e.g. "AvailableOffers") to
  1499. // include in API requests with the JSON null value. By default, fields
  1500. // with empty values are omitted from API requests. However, any field
  1501. // with an empty value appearing in NullFields will be sent to the
  1502. // server as null. It is an error if a field in this list has a
  1503. // non-empty value. This may be used to include null fields in Patch
  1504. // requests.
  1505. NullFields []string `json:"-"`
  1506. }
  1507. func (s *ListOffersResponse) MarshalJSON() ([]byte, error) {
  1508. type NoMethod ListOffersResponse
  1509. raw := NoMethod(*s)
  1510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1511. }
  1512. // ListUserStatesResponse: Response message for
  1513. // ListUserStates.
  1514. type ListUserStatesResponse struct {
  1515. // ResponseMetadata: Current response metadata.
  1516. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1517. // UserStates: User's states.
  1518. //
  1519. // Possible values:
  1520. // "USER_STATE_UNSPECIFIED" - Unchosen.
  1521. // "US_REQUIRES_RECAPTCHA_FOR_GPS_CONTACT" - User must pass <a
  1522. // href="https://www.google.com/recaptcha/">reCaptcha</a> to
  1523. // contact a Partner via Google Partner Search.
  1524. UserStates []string `json:"userStates,omitempty"`
  1525. // ServerResponse contains the HTTP response code and headers from the
  1526. // server.
  1527. googleapi.ServerResponse `json:"-"`
  1528. // ForceSendFields is a list of field names (e.g. "ResponseMetadata") to
  1529. // unconditionally include in API requests. By default, fields with
  1530. // empty values are omitted from API requests. However, any non-pointer,
  1531. // non-interface field appearing in ForceSendFields will be sent to the
  1532. // server regardless of whether the field is empty or not. This may be
  1533. // used to include empty fields in Patch requests.
  1534. ForceSendFields []string `json:"-"`
  1535. // NullFields is a list of field names (e.g. "ResponseMetadata") to
  1536. // include in API requests with the JSON null value. By default, fields
  1537. // with empty values are omitted from API requests. However, any field
  1538. // with an empty value appearing in NullFields will be sent to the
  1539. // server as null. It is an error if a field in this list has a
  1540. // non-empty value. This may be used to include null fields in Patch
  1541. // requests.
  1542. NullFields []string `json:"-"`
  1543. }
  1544. func (s *ListUserStatesResponse) MarshalJSON() ([]byte, error) {
  1545. type NoMethod ListUserStatesResponse
  1546. raw := NoMethod(*s)
  1547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1548. }
  1549. // LocalizedCompanyInfo: The localized company information.
  1550. type LocalizedCompanyInfo struct {
  1551. // CountryCodes: List of country codes for the localized company info.
  1552. CountryCodes []string `json:"countryCodes,omitempty"`
  1553. // DisplayName: Localized display name.
  1554. DisplayName string `json:"displayName,omitempty"`
  1555. // LanguageCode: Language code of the localized company info, as defined
  1556. // by
  1557. // <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>
  1558. // (IETF BCP 47, "Tags for Identifying Languages").
  1559. LanguageCode string `json:"languageCode,omitempty"`
  1560. // Overview: Localized brief description that the company uses to
  1561. // advertise themselves.
  1562. Overview string `json:"overview,omitempty"`
  1563. // ForceSendFields is a list of field names (e.g. "CountryCodes") to
  1564. // unconditionally include in API requests. By default, fields with
  1565. // empty values are omitted from API requests. However, any non-pointer,
  1566. // non-interface field appearing in ForceSendFields will be sent to the
  1567. // server regardless of whether the field is empty or not. This may be
  1568. // used to include empty fields in Patch requests.
  1569. ForceSendFields []string `json:"-"`
  1570. // NullFields is a list of field names (e.g. "CountryCodes") to include
  1571. // in API requests with the JSON null value. By default, fields with
  1572. // empty values are omitted from API requests. However, any field with
  1573. // an empty value appearing in NullFields will be sent to the server as
  1574. // null. It is an error if a field in this list has a non-empty value.
  1575. // This may be used to include null fields in Patch requests.
  1576. NullFields []string `json:"-"`
  1577. }
  1578. func (s *LocalizedCompanyInfo) MarshalJSON() ([]byte, error) {
  1579. type NoMethod LocalizedCompanyInfo
  1580. raw := NoMethod(*s)
  1581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1582. }
  1583. // Location: A location with address and geographic coordinates. May
  1584. // optionally contain a
  1585. // detailed (multi-field) version of the address.
  1586. type Location struct {
  1587. // Address: The single string version of the address.
  1588. Address string `json:"address,omitempty"`
  1589. // AddressLine: The following address lines represent the most specific
  1590. // part of any
  1591. // address.
  1592. AddressLine []string `json:"addressLine,omitempty"`
  1593. // AdministrativeArea: Top-level administrative subdivision of this
  1594. // country.
  1595. AdministrativeArea string `json:"administrativeArea,omitempty"`
  1596. // DependentLocality: Dependent locality or sublocality. Used for UK
  1597. // dependent localities, or
  1598. // neighborhoods or boroughs in other locations.
  1599. DependentLocality string `json:"dependentLocality,omitempty"`
  1600. // LanguageCode: Language code of the address. Should be in BCP 47
  1601. // format.
  1602. LanguageCode string `json:"languageCode,omitempty"`
  1603. // LatLng: The latitude and longitude of the location, in degrees.
  1604. LatLng *LatLng `json:"latLng,omitempty"`
  1605. // Locality: Generally refers to the city/town portion of an address.
  1606. Locality string `json:"locality,omitempty"`
  1607. // PostalCode: Values are frequently alphanumeric.
  1608. PostalCode string `json:"postalCode,omitempty"`
  1609. // RegionCode: CLDR (Common Locale Data Repository) region code .
  1610. RegionCode string `json:"regionCode,omitempty"`
  1611. // SortingCode: Use of this code is very country-specific, but will
  1612. // refer to a secondary
  1613. // classification code for sorting mail.
  1614. SortingCode string `json:"sortingCode,omitempty"`
  1615. // ForceSendFields is a list of field names (e.g. "Address") to
  1616. // unconditionally include in API requests. By default, fields with
  1617. // empty values are omitted from API requests. However, any non-pointer,
  1618. // non-interface field appearing in ForceSendFields will be sent to the
  1619. // server regardless of whether the field is empty or not. This may be
  1620. // used to include empty fields in Patch requests.
  1621. ForceSendFields []string `json:"-"`
  1622. // NullFields is a list of field names (e.g. "Address") to include in
  1623. // API requests with the JSON null value. By default, fields with empty
  1624. // values are omitted from API requests. However, any field with an
  1625. // empty value appearing in NullFields will be sent to the server as
  1626. // null. It is an error if a field in this list has a non-empty value.
  1627. // This may be used to include null fields in Patch requests.
  1628. NullFields []string `json:"-"`
  1629. }
  1630. func (s *Location) MarshalJSON() ([]byte, error) {
  1631. type NoMethod Location
  1632. raw := NoMethod(*s)
  1633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1634. }
  1635. // LogMessageRequest: Request message for
  1636. // LogClientMessage.
  1637. type LogMessageRequest struct {
  1638. // ClientInfo: Map of client info, such as URL, browser navigator,
  1639. // browser platform, etc.
  1640. ClientInfo map[string]string `json:"clientInfo,omitempty"`
  1641. // Details: Details about the client message.
  1642. Details string `json:"details,omitempty"`
  1643. // Level: Message level of client message.
  1644. //
  1645. // Possible values:
  1646. // "MESSAGE_LEVEL_UNSPECIFIED" - Unchosen.
  1647. // "ML_FINE" - Message level for tracing information.
  1648. // "ML_INFO" - Message level for informational messages.
  1649. // "ML_WARNING" - Message level for potential problems.
  1650. // "ML_SEVERE" - Message level for serious failures.
  1651. Level string `json:"level,omitempty"`
  1652. // RequestMetadata: Current request metadata.
  1653. RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"`
  1654. // ForceSendFields is a list of field names (e.g. "ClientInfo") to
  1655. // unconditionally include in API requests. By default, fields with
  1656. // empty values are omitted from API requests. However, any non-pointer,
  1657. // non-interface field appearing in ForceSendFields will be sent to the
  1658. // server regardless of whether the field is empty or not. This may be
  1659. // used to include empty fields in Patch requests.
  1660. ForceSendFields []string `json:"-"`
  1661. // NullFields is a list of field names (e.g. "ClientInfo") to include in
  1662. // API requests with the JSON null value. By default, fields with empty
  1663. // values are omitted from API requests. However, any field with an
  1664. // empty value appearing in NullFields will be sent to the server as
  1665. // null. It is an error if a field in this list has a non-empty value.
  1666. // This may be used to include null fields in Patch requests.
  1667. NullFields []string `json:"-"`
  1668. }
  1669. func (s *LogMessageRequest) MarshalJSON() ([]byte, error) {
  1670. type NoMethod LogMessageRequest
  1671. raw := NoMethod(*s)
  1672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1673. }
  1674. // LogMessageResponse: Response message for
  1675. // LogClientMessage.
  1676. type LogMessageResponse struct {
  1677. // ResponseMetadata: Current response metadata.
  1678. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  1679. // ServerResponse contains the HTTP response code and headers from the
  1680. // server.
  1681. googleapi.ServerResponse `json:"-"`
  1682. // ForceSendFields is a list of field names (e.g. "ResponseMetadata") to
  1683. // unconditionally include in API requests. By default, fields with
  1684. // empty values are omitted from API requests. However, any non-pointer,
  1685. // non-interface field appearing in ForceSendFields will be sent to the
  1686. // server regardless of whether the field is empty or not. This may be
  1687. // used to include empty fields in Patch requests.
  1688. ForceSendFields []string `json:"-"`
  1689. // NullFields is a list of field names (e.g. "ResponseMetadata") to
  1690. // include in API requests with the JSON null value. By default, fields
  1691. // with empty values are omitted from API requests. However, any field
  1692. // with an empty value appearing in NullFields will be sent to the
  1693. // server as null. It is an error if a field in this list has a
  1694. // non-empty value. This may be used to include null fields in Patch
  1695. // requests.
  1696. NullFields []string `json:"-"`
  1697. }
  1698. func (s *LogMessageResponse) MarshalJSON() ([]byte, error) {
  1699. type NoMethod LogMessageResponse
  1700. raw := NoMethod(*s)
  1701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1702. }
  1703. // LogUserEventRequest: Request message for
  1704. // LogUserEvent.
  1705. type LogUserEventRequest struct {
  1706. // EventAction: The action that occurred.
  1707. //
  1708. // Possible values:
  1709. // "EVENT_ACTION_UNSPECIFIED" - Unchosen.
  1710. // "SMB_CLICKED_FIND_A_PARTNER_BUTTON_BOTTOM" - Advertiser clicked
  1711. // `Find a partner` bottom button.
  1712. // "SMB_CLICKED_FIND_A_PARTNER_BUTTON_TOP" - Advertiser clicked `Find
  1713. // a partner` top button.
  1714. // "AGENCY_CLICKED_JOIN_NOW_BUTTON_BOTTOM" - Agency clicked `Join now`
  1715. // bottom button.
  1716. // "AGENCY_CLICKED_JOIN_NOW_BUTTON_TOP" - Agency clicked `Join now`
  1717. // top button.
  1718. // "SMB_CANCELED_PARTNER_CONTACT_FORM" - Advertiser canceled partner
  1719. // contact form.
  1720. // "SMB_CLICKED_CONTACT_A_PARTNER" - Advertiser started partner
  1721. // contact form.
  1722. // "SMB_COMPLETED_PARTNER_CONTACT_FORM" - Advertiser completed partner
  1723. // contact form.
  1724. // "SMB_ENTERED_EMAIL_IN_CONTACT_PARTNER_FORM" - Advertiser entered
  1725. // email in contact form.
  1726. // "SMB_ENTERED_NAME_IN_CONTACT_PARTNER_FORM" - Advertiser entered
  1727. // name in contact form.
  1728. // "SMB_ENTERED_PHONE_IN_CONTACT_PARTNER_FORM" - Advertiser entered
  1729. // phone in contact form.
  1730. // "SMB_FAILED_RECAPTCHA_IN_CONTACT_PARTNER_FORM" - Advertiser failed
  1731. // <a href="https://www.google.com/recaptcha/">reCaptcha</a>
  1732. // in contact form.
  1733. // "PARTNER_VIEWED_BY_SMB" - Company viewed by advertiser.
  1734. // "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_GPS" - Advertiser canceled
  1735. // partner contact form on Google Partner Search.
  1736. // "SMB_CHANGED_A_SEARCH_PARAMETER_TOP" - Advertiser changed a top
  1737. // search parameter.
  1738. // "SMB_CLICKED_CONTACT_A_PARTNER_ON_GPS" - Advertiser started partner
  1739. // contact form on Google Partner Search.
  1740. // "SMB_CLICKED_SHOW_MORE_PARTNERS_BUTTON_BOTTOM" - Advertiser clicked
  1741. // `Show more partners` bottom button.
  1742. // "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_GPS" - Advertiser completed
  1743. // partner contact form on Google Partner Search.
  1744. // "SMB_NO_PARTNERS_AVAILABLE_WITH_SEARCH_CRITERIA" - Advertiser saw
  1745. // no partners available with search criteria.
  1746. // "SMB_PERFORMED_SEARCH_ON_GPS" - Advertiser performed search on
  1747. // Google Partner Search.
  1748. // "SMB_VIEWED_A_PARTNER_ON_GPS" - Advertiser viewed a partner on
  1749. // Google Partner Search.
  1750. // "SMB_CANCELED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE" - Advertiser
  1751. // canceled partner contact form on profile page.
  1752. // "SMB_CLICKED_CONTACT_A_PARTNER_ON_PROFILE_PAGE" - Advertiser
  1753. // started partner contact form on profile page.
  1754. // "SMB_CLICKED_PARTNER_WEBSITE" - Advertiser clicked partner website.
  1755. // "SMB_COMPLETED_PARTNER_CONTACT_FORM_ON_PROFILE_PAGE" - Advertiser
  1756. // completed contact form on profile page.
  1757. // "SMB_VIEWED_A_PARTNER_PROFILE" - Advertiser viewed a partner
  1758. // profile.
  1759. // "AGENCY_CLICKED_ACCEPT_TOS_BUTTON" - Agency clicked `accept Terms
  1760. // Of Service` button.
  1761. // "AGENCY_CHANGED_TOS_COUNTRY" - Agency changed Terms Of Service
  1762. // country.
  1763. // "AGENCY_ADDED_ADDRESS_IN_MY_PROFILE_PORTAL" - Agency added address
  1764. // in profile portal.
  1765. // "AGENCY_ADDED_PHONE_NUMBER_IN_MY_PROFILE_PORTAL" - Agency added
  1766. // phone number in profile portal.
  1767. // "AGENCY_CHANGED_PRIMARY_ACCOUNT_ASSOCIATION" - Agency changed
  1768. // primary account association.
  1769. // "AGENCY_CHANGED_PRIMARY_COUNTRY_ASSOCIATION" - Agency changed
  1770. // primary country association.
  1771. // "AGENCY_CLICKED_AFFILIATE_BUTTON_IN_MY_PROFILE_IN_PORTAL" - Agency
  1772. // clicked `affiliate` button in profile portal.
  1773. // "AGENCY_CLICKED_GIVE_EDIT_ACCESS_IN_MY_PROFILE_PORTAL" - Agency
  1774. // clicked `give edit access` in profile portal.
  1775. // "AGENCY_CLICKED_LOG_OUT_IN_MY_PROFILE_PORTAL" - Agency clicked `log
  1776. // out` in profile portal.
  1777. // "AGENCY_CLICKED_MY_PROFILE_LEFT_NAV_IN_PORTAL" - Agency clicked
  1778. // profile portal left nav.
  1779. // "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_COMPLETE_PROFILE" -
  1780. // Agency clicked `save and continue` at bottom of complete profile.
  1781. // "AGENCY_CLICKED_UNAFFILIATE_IN_MY_PROFILE_PORTAL" - Agency clicked
  1782. // `unaffiliate` in profile portal.
  1783. // "AGENCY_FILLED_OUT_COMP_AFFILIATION_IN_MY_PROFILE_PORTAL" - Agency
  1784. // filled out company affiliation in profile portal.
  1785. // "AGENCY_SUCCESSFULLY_CONNECTED_WITH_COMPANY_IN_MY_PROFILE" - Agency
  1786. // successfully connected with company in profile portal.
  1787. // "AGENCY_CLICKED_CREATE_MCC_IN_MY_PROFILE_PORTAL" - Agency clicked
  1788. // create MCC in profile portal.
  1789. // "AGENCY_DIDNT_HAVE_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE" - Agency
  1790. // did not have an MCC associated on profile portal.
  1791. // "AGENCY_HAD_AN_MCC_ASSOCIATED_ON_COMPLETE_PROFILE" - Agency had an
  1792. // MCC associated on profile portal.
  1793. // "AGENCY_ADDED_JOB_FUNCTION_IN_MY_PROFILE_PORTAL" - Agency added job
  1794. // function in profile portal.
  1795. // "AGENCY_LOOKED_AT_JOB_FUNCTION_DROP_DOWN" - Agency looked at job
  1796. // function drop-down.
  1797. // "AGENCY_SELECTED_ACCOUNT_MANAGER_AS_JOB_FUNCTION" - Agency selected
  1798. // `account manage` as job function.
  1799. // "AGENCY_SELECTED_ACCOUNT_PLANNER_AS_JOB_FUNCTION" - Agency selected
  1800. // `account planner` as job function.
  1801. // "AGENCY_SELECTED_ANALYTICS_AS_JOB_FUNCTION" - Agency selected
  1802. // `Analytics` as job function.
  1803. // "AGENCY_SELECTED_CREATIVE_AS_JOB_FUNCTION" - Agency selected
  1804. // `creative` as job function.
  1805. // "AGENCY_SELECTED_MEDIA_BUYER_AS_JOB_FUNCTION" - Agency selected
  1806. // `media buyer` as job function.
  1807. // "AGENCY_SELECTED_MEDIA_PLANNER_AS_JOB_FUNCTION" - Agency selected
  1808. // `media planner` as job function.
  1809. // "AGENCY_SELECTED_OTHER_AS_JOB_FUNCTION" - Agency selected `other`
  1810. // as job function.
  1811. // "AGENCY_SELECTED_PRODUCTION_AS_JOB_FUNCTION" - Agency selected
  1812. // `production` as job function.
  1813. // "AGENCY_SELECTED_SEO_AS_JOB_FUNCTION" - Agency selected `SEO` as
  1814. // job function.
  1815. // "AGENCY_SELECTED_SALES_REP_AS_JOB_FUNCTION" - Agency selected
  1816. // `sales rep` as job function.
  1817. // "AGENCY_SELECTED_SEARCH_SPECIALIST_AS_JOB_FUNCTION" - Agency
  1818. // selected `search specialist` as job function.
  1819. // "AGENCY_ADDED_CHANNELS_IN_MY_PROFILE_PORTAL" - Agency added
  1820. // channels in profile portal.
  1821. // "AGENCY_LOOKED_AT_ADD_CHANNEL_DROP_DOWN" - Agency looked at `add
  1822. // channel` drop-down.
  1823. // "AGENCY_SELECTED_CROSS_CHANNEL_FROM_ADD_CHANNEL" - Agency selected
  1824. // `cross channel` from add channel drop-down.
  1825. // "AGENCY_SELECTED_DISPLAY_FROM_ADD_CHANNEL" - Agency selected
  1826. // `display` from add channel drop-down.
  1827. // "AGENCY_SELECTED_MOBILE_FROM_ADD_CHANNEL" - Agency selected
  1828. // `mobile` from add channel drop-down.
  1829. // "AGENCY_SELECTED_SEARCH_FROM_ADD_CHANNEL" - Agency selected
  1830. // `search` from add channel drop-down.
  1831. // "AGENCY_SELECTED_SOCIAL_FROM_ADD_CHANNEL" - Agency selected
  1832. // `social` from add channel drop-down.
  1833. // "AGENCY_SELECTED_TOOLS_FROM_ADD_CHANNEL" - Agency selected `tools`
  1834. // from add channel drop-down.
  1835. // "AGENCY_SELECTED_YOUTUBE_FROM_ADD_CHANNEL" - Agency selected
  1836. // `YouTube` from add channel drop-down.
  1837. // "AGENCY_ADDED_INDUSTRIES_IN_MY_PROFILE_PORTAL" - Agency added
  1838. // industries in profile portal.
  1839. // "AGENCY_CHANGED_ADD_INDUSTRIES_DROP_DOWN" - Agency changed `add
  1840. // industries` drop-down.
  1841. // "AGENCY_ADDED_MARKETS_IN_MY_PROFILE_PORTAL" - Agency added markets
  1842. // in profile portal.
  1843. // "AGENCY_CHANGED_ADD_MARKETS_DROP_DOWN" - Agency changed `add
  1844. // markets` drop-down.
  1845. // "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_MYPROFILE" - Agency checked
  1846. // `recieve mail promotions` in profile portal.
  1847. // "AGENCY_CHECKED_RECIEVE_MAIL_PROMOTIONS_SIGNUP" - Agency checked
  1848. // `recieve mail promotions` in sign-up.
  1849. // "AGENCY_SELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH" - Agency
  1850. // selected `opt-in beta tests and market research`.
  1851. // "AGENCY_SELECTED_OPT_IN_BETA_TESTS_IN_MY_PROFILE_PORTAL" - Agency
  1852. // selected `opt-in beta tests` in profile portal.
  1853. // "AGENCY_SELECTED_OPT_IN_NEWS_IN_MY_PROFILE_PORTAL" - Agency
  1854. // selected `opt-in news` in profile portal.
  1855. // "AGENCY_SELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS" - Agency
  1856. // selected `opt-in news invitations and promotions`.
  1857. // "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUG_IN_MY_PROFILE_PORTAL" -
  1858. // Agency selected `opt-in performance SUG` in profile portal.
  1859. // "AGENCY_SELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS" - Agency selected
  1860. // `opt-in performance suggestions`.
  1861. // "AGENCY_SELECTED_OPT_IN_SELECT_ALL_EMAIL_NOTIFICATIONS" - Agency
  1862. // selected `opt-in select all email notifications`.
  1863. // "AGENCY_SELECTED_SELECT_ALL_OPT_INS_IN_MY_PROFILE_PORTAL" - Agency
  1864. // selected `select all opt-ins` in profile portal.
  1865. // "AGENCY_CLICKED_BACK_BUTTON_ON_CONNECT_WITH_COMPANY" - Agency
  1866. // clicked back button on `connect with company`.
  1867. // "AGENCY_CLICKED_CONTINUE_TO_OVERVIEW_ON_CONNECT_WITH_COMPANY" -
  1868. // Agency clicked continue to overview on `connect with company`.
  1869. // "AGECNY_CLICKED_CREATE_MCC_CONNECT_WITH_COMPANY_NOT_FOUND" - Agency
  1870. // clicked `create MCC connect with company not found`.
  1871. // "AGECNY_CLICKED_GIVE_EDIT_ACCESS_CONNECT_WITH_COMPANY_NOT_FOUND" -
  1872. // Agency clicked `give edit access connect with company not found`.
  1873. // "AGECNY_CLICKED_LOG_OUT_CONNECT_WITH_COMPANY_NOT_FOUND" - Agency
  1874. // clicked `log out connect with company not found`.
  1875. // "AGENCY_CLICKED_SKIP_FOR_NOW_ON_CONNECT_WITH_COMPANY_PAGE" - Agency
  1876. // clicked `skip for now on connect with company page`.
  1877. // "AGENCY_CLOSED_CONNECTED_TO_COMPANY_X_BUTTON_WRONG_COMPANY" -
  1878. // Agency closed connection to company.
  1879. // "AGENCY_COMPLETED_FIELD_CONNECT_WITH_COMPANY" - Agency completed
  1880. // field connect with company.
  1881. // "AGECNY_FOUND_COMPANY_TO_CONNECT_WITH" - Agency found company to
  1882. // connect with.
  1883. // "AGENCY_SUCCESSFULLY_CREATED_COMPANY" - Agency successfully created
  1884. // company.
  1885. // "AGENCY_ADDED_NEW_COMPANY_LOCATION" - Agency added new company
  1886. // location.
  1887. // "AGENCY_CLICKED_COMMUNITY_JOIN_NOW_LINK_IN_PORTAL_NOTIFICATIONS" -
  1888. // Agency clicked community `join now link` in portal notifications.
  1889. // "AGENCY_CLICKED_CONNECT_TO_COMPANY_LINK_IN_PORTAL_NOTIFICATIONS" -
  1890. // Agency clicked `connect to company` link in portal notifications.
  1891. // "AGENCY_CLICKED_GET_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS" -
  1892. // Agency cliecked `get certified` link in portal notifications.
  1893. //
  1894. // "AGENCY_CLICKED_GET_VIDEO_ADS_CERTIFIED_LINK_IN_PORTAL_NOTIFICATIONS"
  1895. // - Agency clicked `get VideoAds certified` link in portal
  1896. // notifications.
  1897. // "AGENCY_CLICKED_LINK_TO_MCC_LINK_IN_PORTAL_NOTIFICATIONS" - Agency
  1898. // clicked `link to MCC` link in portal notifications.
  1899. // "AGENCY_CLICKED_INSIGHT_CONTENT_IN_PORTAL" - Agency clicked
  1900. // `insight content` in portal.
  1901. // "AGENCY_CLICKED_INSIGHTS_VIEW_NOW_PITCH_DECKS_IN_PORTAL" - Agency
  1902. // clicked `insights view now pitch decks` in portal.
  1903. // "AGENCY_CLICKED_INSIGHTS_LEFT_NAV_IN_PORTAL" - Agency clicked
  1904. // `insights` left nav in portal.
  1905. // "AGENCY_CLICKED_INSIGHTS_UPLOAD_CONTENT" - Agency clicked `insights
  1906. // upload content`.
  1907. // "AGENCY_CLICKED_INSIGHTS_VIEWED_DEPRECATED" - Agency clicked
  1908. // `insights viewed deprecated`.
  1909. // "AGENCY_CLICKED_COMMUNITY_LEFT_NAV_IN_PORTAL" - Agency clicked
  1910. // `community` left nav in portal.
  1911. // "AGENCY_CLICKED_JOIN_COMMUNITY_BUTTON_COMMUNITY_PORTAL" - Agency
  1912. // clicked `join community` button in community portal.
  1913. // "AGENCY_CLICKED_CERTIFICATIONS_LEFT_NAV_IN_PORTAL" - Agency clicked
  1914. // `certifications` left nav in portal.
  1915. // "AGENCY_CLICKED_CERTIFICATIONS_PRODUCT_LEFT_NAV_IN_PORTAL" - Agency
  1916. // clicked `certifications product` left nav in portal.
  1917. // "AGENCY_CLICKED_PARTNER_STATUS_LEFT_NAV_IN_PORTAL" - Agency clicked
  1918. // `partner status` left nav in portal.
  1919. // "AGENCY_CLICKED_PARTNER_STATUS_PRODUCT_LEFT_NAV_IN_PORTAL" - Agency
  1920. // clicked `partner status product` left nav in portal.
  1921. // "AGENCY_CLICKED_OFFERS_LEFT_NAV_IN_PORTAL" - Agency clicked
  1922. // `offers` left nav in portal.
  1923. // "AGENCY_CLICKED_SEND_BUTTON_ON_OFFERS_PAGE" - Agency clicked `send`
  1924. // button on offers page.
  1925. // "AGENCY_CLICKED_EXAM_DETAILS_ON_CERT_ADWORDS_PAGE" - Agency clicked
  1926. // `exam details` on certifications AdWords page.
  1927. // "AGENCY_CLICKED_SEE_EXAMS_CERTIFICATION_MAIN_PAGE" - Agency clicked
  1928. // `see exams` certifications main page.
  1929. // "AGENCY_CLICKED_TAKE_EXAM_ON_CERT_EXAM_PAGE" - Agency clicked `take
  1930. // exam` on certifications exam page.
  1931. // "AGENCY_OPENED_LAST_ADMIN_DIALOG" - Agency opened `last admin`
  1932. // dialog.
  1933. // "AGENCY_OPENED_DIALOG_WITH_NO_USERS" - Agency opened dialog with no
  1934. // users.
  1935. // "AGENCY_PROMOTED_USER_TO_ADMIN" - Agency promoted user to admin.
  1936. // "AGENCY_UNAFFILIATED" - Agency unaffiliated.
  1937. // "AGENCY_CHANGED_ROLES" - Agency changed roles.
  1938. // "SMB_CLICKED_COMPANY_NAME_LINK_TO_PROFILE" - Advertiser clicked
  1939. // `company name` link to profile.
  1940. // "SMB_VIEWED_ADWORDS_CERTIFICATE" - Advertiser viewed AdWords
  1941. // certificate.
  1942. // "SMB_VIEWED_ADWORDS_SEARCH_CERTIFICATE" - Advertiser viewed AdWords
  1943. // Search certificate.
  1944. // "SMB_VIEWED_ADWORDS_DISPLAY_CERTIFICATE" - Advertiser viewed
  1945. // AdWords Display certificate.
  1946. // "SMB_CLICKED_ADWORDS_CERTIFICATE_HELP_ICON" - Advertiser clicked
  1947. // AdWords certificate help icon.
  1948. // "SMB_VIEWED_ANALYTICS_CERTIFICATE" - Advertiser viewed Analytics
  1949. // certificate.
  1950. // "SMB_VIEWED_DOUBLECLICK_CERTIFICATE" - Advertiser viewed
  1951. // DoubleClick certificate.
  1952. // "SMB_VIEWED_MOBILE_SITES_CERTIFICATE" - Advertiser viewed Mobile
  1953. // Sites certificate.
  1954. // "SMB_VIEWED_VIDEO_ADS_CERTIFICATE" - Advertiser viewed VideoAds
  1955. // certificate.
  1956. // "SMB_VIEWED_SHOPPING_CERTIFICATE" - Advertiser clicked Shopping
  1957. // certificate help icon.
  1958. // "SMB_CLICKED_VIDEO_ADS_CERTIFICATE_HELP_ICON" - Advertiser clicked
  1959. // VideoAds certificate help icon.
  1960. // "SMB_VIEWED_DIGITAL_SALES_CERTIFICATE" - Advertiser viewed Digital
  1961. // Sales certificate.
  1962. // "CLICKED_HELP_AT_BOTTOM" - Clicked `help` at bottom.
  1963. // "CLICKED_HELP_AT_TOP" - Clicked `help` at top.
  1964. // "CLIENT_ERROR" - Client error occurred.
  1965. // "AGENCY_CLICKED_LEFT_NAV_STORIES" - Agency clicked left nav
  1966. // `stories`.
  1967. // "CLICKED" - Click occured.
  1968. // "SMB_VIEWED_MOBILE_CERTIFICATE" - Advertiser clicked Mobile
  1969. // certificate help icon.
  1970. // "AGENCY_FAILED_COMPANY_VERIFICATION" - Agency failed the company
  1971. // verification.
  1972. // "VISITED_LANDING" - User visited the landing portion of Google
  1973. // Partners.
  1974. // "VISITED_GPS" - User visited the Google Partner Search portion of
  1975. // Google Partners.
  1976. // "VISITED_AGENCY_PORTAL" - User visited the agency portal portion of
  1977. // Google Partners.
  1978. // "CANCELLED_INDIVIDUAL_SIGN_UP" - User cancelled signing up.
  1979. // "CANCELLED_COMPANY_SIGN_UP" - User cancelled signing up their
  1980. // company.
  1981. // "AGENCY_CLICKED_SIGN_IN_BUTTON_TOP" - Agency clicked `Sign in` top
  1982. // button.
  1983. // "AGENCY_CLICKED_SAVE_AND_CONTINUE_AT_BOT_OF_INCOMPLETE_PROFILE" -
  1984. // Agency clicked `save and continue` at bottom of incomplete profile.
  1985. // "AGENCY_UNSELECTED_OPT_IN_NEWS_INVITATIONS_AND_PROMOS" - Agency
  1986. // unselected `opt-in news invitations and promotions`.
  1987. // "AGENCY_UNSELECTED_OPT_IN_BETA_TESTS_AND_MKT_RESEARCH" - Agency
  1988. // unselected `opt-in beta tests and market research`.
  1989. // "AGENCY_UNSELECTED_OPT_IN_PERFORMANCE_SUGGESTIONS" - Agency
  1990. // unselected `opt-in performance suggestions`.
  1991. // "AGENCY_SELECTED_OPT_OUT_UNSELECT_ALL_EMAIL_NOTIFICATIONS" - Agency
  1992. // selected `opt-out unselect all email notifications`.
  1993. // "AGENCY_LINKED_INDIVIDUAL_MCC" - Agency linked their individual
  1994. // MCC.
  1995. // "AGENCY_SUGGESTED_TO_USER" - Agency was suggested to user for
  1996. // affiliation.
  1997. // "AGENCY_IGNORED_SUGGESTED_AGENCIES_AND_SEARCHED" - Agency ignored
  1998. // suggested agencies and begin searching.
  1999. // "AGENCY_PICKED_SUGGESTED_AGENCY" - Agency picked a suggested
  2000. // agency.
  2001. // "AGENCY_SEARCHED_FOR_AGENCIES" - Agency searched for agencies.
  2002. // "AGENCY_PICKED_SEARCHED_AGENCY" - Agency picked a searched agency.
  2003. // "AGENCY_DISMISSED_AFFILIATION_WIDGET" - Agency dismissed
  2004. // affiliation widget.
  2005. // "AGENCY_CLICKED_INSIGHTS_DOWNLOAD_CONTENT" - Agency clicked on the
  2006. // download link for downloading content.
  2007. // "AGENCY_PROGRESS_INSIGHTS_VIEW_CONTENT" - Agency user is maklingg
  2008. // progress viewing a content item.
  2009. // "AGENCY_CLICKED_CANCEL_ACCEPT_TOS_BUTTON" - Agency clicked `cancel
  2010. // Terms Of Service` button.
  2011. // "SMB_ENTERED_WEBSITE_IN_CONTACT_PARTNER_FORM" - Advertiser entered
  2012. // website in contact form.
  2013. // "AGENCY_SELECTED_OPT_IN_AFA_MIGRATION" - Agency opted in for
  2014. // migrating their exams to Academy for Ads.
  2015. // "AGENCY_SELECTED_OPT_OUT_AFA_MIGRATION" - Agency opted out for
  2016. // migrating their exams to Academy for Ads.
  2017. EventAction string `json:"eventAction,omitempty"`
  2018. // EventCategory: The category the action belongs to.
  2019. //
  2020. // Possible values:
  2021. // "EVENT_CATEGORY_UNSPECIFIED" - Unchosen.
  2022. // "GOOGLE_PARTNER_SEARCH" - Google Partner Search category.
  2023. // "GOOGLE_PARTNER_SIGNUP_FLOW" - Google Partner sign-up flow
  2024. // category.
  2025. // "GOOGLE_PARTNER_PORTAL" - Google Partner portal category.
  2026. // "GOOGLE_PARTNER_PORTAL_MY_PROFILE" - Google Partner portal
  2027. // my-profile category.
  2028. // "GOOGLE_PARTNER_PORTAL_CERTIFICATIONS" - Google Partner portal
  2029. // certifications category.
  2030. // "GOOGLE_PARTNER_PORTAL_COMMUNITY" - Google Partner portal community
  2031. // category.
  2032. // "GOOGLE_PARTNER_PORTAL_INSIGHTS" - Google Partner portal insights
  2033. // category.
  2034. // "GOOGLE_PARTNER_PORTAL_CLIENTS" - Google Partner portal clients
  2035. // category.
  2036. // "GOOGLE_PARTNER_PUBLIC_USER_PROFILE" - Google Partner portal public
  2037. // user profile category.
  2038. // "GOOGLE_PARTNER_PANEL" - Google Partner panel category.
  2039. // "GOOGLE_PARTNER_PORTAL_LAST_ADMIN_DIALOG" - Google Partner portal
  2040. // last admin dialog category.
  2041. // "GOOGLE_PARTNER_CLIENT" - Google Partner client category.
  2042. // "GOOGLE_PARTNER_PORTAL_COMPANY_PROFILE" - Google Partner portal
  2043. // company profile category.
  2044. // "EXTERNAL_LINKS" - External links category.
  2045. // "GOOGLE_PARTNER_LANDING" - Google Partner landing category.
  2046. EventCategory string `json:"eventCategory,omitempty"`
  2047. // EventDatas: List of event data for the event.
  2048. EventDatas []*EventData `json:"eventDatas,omitempty"`
  2049. // EventScope: The scope of the event.
  2050. //
  2051. // Possible values:
  2052. // "EVENT_SCOPE_UNSPECIFIED" - Unchosen.
  2053. // "VISITOR" - Based on visitor.
  2054. // "SESSION" - Based on session.
  2055. // "PAGE" - Based on page visit.
  2056. EventScope string `json:"eventScope,omitempty"`
  2057. // Lead: Advertiser lead information.
  2058. Lead *Lead `json:"lead,omitempty"`
  2059. // RequestMetadata: Current request metadata.
  2060. RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"`
  2061. // Url: The URL where the event occurred.
  2062. Url string `json:"url,omitempty"`
  2063. // ForceSendFields is a list of field names (e.g. "EventAction") to
  2064. // unconditionally include in API requests. By default, fields with
  2065. // empty values are omitted from API requests. However, any non-pointer,
  2066. // non-interface field appearing in ForceSendFields will be sent to the
  2067. // server regardless of whether the field is empty or not. This may be
  2068. // used to include empty fields in Patch requests.
  2069. ForceSendFields []string `json:"-"`
  2070. // NullFields is a list of field names (e.g. "EventAction") to include
  2071. // in API requests with the JSON null value. By default, fields with
  2072. // empty values are omitted from API requests. However, any field with
  2073. // an empty value appearing in NullFields will be sent to the server as
  2074. // null. It is an error if a field in this list has a non-empty value.
  2075. // This may be used to include null fields in Patch requests.
  2076. NullFields []string `json:"-"`
  2077. }
  2078. func (s *LogUserEventRequest) MarshalJSON() ([]byte, error) {
  2079. type NoMethod LogUserEventRequest
  2080. raw := NoMethod(*s)
  2081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2082. }
  2083. // LogUserEventResponse: Response message for
  2084. // LogUserEvent.
  2085. type LogUserEventResponse struct {
  2086. // ResponseMetadata: Current response metadata.
  2087. ResponseMetadata *ResponseMetadata `json:"responseMetadata,omitempty"`
  2088. // ServerResponse contains the HTTP response code and headers from the
  2089. // server.
  2090. googleapi.ServerResponse `json:"-"`
  2091. // ForceSendFields is a list of field names (e.g. "ResponseMetadata") to
  2092. // unconditionally include in API requests. By default, fields with
  2093. // empty values are omitted from API requests. However, any non-pointer,
  2094. // non-interface field appearing in ForceSendFields will be sent to the
  2095. // server regardless of whether the field is empty or not. This may be
  2096. // used to include empty fields in Patch requests.
  2097. ForceSendFields []string `json:"-"`
  2098. // NullFields is a list of field names (e.g. "ResponseMetadata") to
  2099. // include in API requests with the JSON null value. By default, fields
  2100. // with empty values are omitted from API requests. However, any field
  2101. // with an empty value appearing in NullFields will be sent to the
  2102. // server as null. It is an error if a field in this list has a
  2103. // non-empty value. This may be used to include null fields in Patch
  2104. // requests.
  2105. NullFields []string `json:"-"`
  2106. }
  2107. func (s *LogUserEventResponse) MarshalJSON() ([]byte, error) {
  2108. type NoMethod LogUserEventResponse
  2109. raw := NoMethod(*s)
  2110. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2111. }
  2112. // Money: Represents an amount of money with its currency type.
  2113. type Money struct {
  2114. // CurrencyCode: The 3-letter currency code defined in ISO 4217.
  2115. CurrencyCode string `json:"currencyCode,omitempty"`
  2116. // Nanos: Number of nano (10^-9) units of the amount.
  2117. // The value must be between -999,999,999 and +999,999,999 inclusive.
  2118. // If `units` is positive, `nanos` must be positive or zero.
  2119. // If `units` is zero, `nanos` can be positive, zero, or negative.
  2120. // If `units` is negative, `nanos` must be negative or zero.
  2121. // For example $-1.75 is represented as `units`=-1 and
  2122. // `nanos`=-750,000,000.
  2123. Nanos int64 `json:"nanos,omitempty"`
  2124. // Units: The whole units of the amount.
  2125. // For example if `currencyCode` is "USD", then 1 unit is one US
  2126. // dollar.
  2127. Units int64 `json:"units,omitempty,string"`
  2128. // ForceSendFields is a list of field names (e.g. "CurrencyCode") to
  2129. // unconditionally include in API requests. By default, fields with
  2130. // empty values are omitted from API requests. However, any non-pointer,
  2131. // non-interface field appearing in ForceSendFields will be sent to the
  2132. // server regardless of whether the field is empty or not. This may be
  2133. // used to include empty fields in Patch requests.
  2134. ForceSendFields []string `json:"-"`
  2135. // NullFields is a list of field names (e.g. "CurrencyCode") to include
  2136. // in API requests with the JSON null value. By default, fields with
  2137. // empty values are omitted from API requests. However, any field with
  2138. // an empty value appearing in NullFields will be sent to the server as
  2139. // null. It is an error if a field in this list has a non-empty value.
  2140. // This may be used to include null fields in Patch requests.
  2141. NullFields []string `json:"-"`
  2142. }
  2143. func (s *Money) MarshalJSON() ([]byte, error) {
  2144. type NoMethod Money
  2145. raw := NoMethod(*s)
  2146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2147. }
  2148. // OfferCustomer: Customers qualified for an offer.
  2149. type OfferCustomer struct {
  2150. // AdwordsUrl: URL to the customer's AdWords page.
  2151. AdwordsUrl string `json:"adwordsUrl,omitempty"`
  2152. // CountryCode: Country code of the customer.
  2153. CountryCode string `json:"countryCode,omitempty"`
  2154. // CreationTime: Time the customer was created.
  2155. CreationTime string `json:"creationTime,omitempty"`
  2156. // EligibilityDaysLeft: Days the customer is still eligible.
  2157. EligibilityDaysLeft int64 `json:"eligibilityDaysLeft,omitempty"`
  2158. // ExternalCid: External CID for the customer.
  2159. ExternalCid int64 `json:"externalCid,omitempty,string"`
  2160. // GetYAmount: Formatted Get Y amount with currency code.
  2161. GetYAmount string `json:"getYAmount,omitempty"`
  2162. // Name: Name of the customer.
  2163. Name string `json:"name,omitempty"`
  2164. // OfferType: Type of the offer
  2165. //
  2166. // Possible values:
  2167. // "OFFER_TYPE_UNSPECIFIED" - Unset.
  2168. // "OFFER_TYPE_SPEND_X_GET_Y" - AdWords spend X get Y.
  2169. // "OFFER_TYPE_VIDEO" - Youtube video.
  2170. // "OFFER_TYPE_SPEND_MATCH" - Spend Match up to Y.
  2171. OfferType string `json:"offerType,omitempty"`
  2172. // SpendXAmount: Formatted Spend X amount with currency code.
  2173. SpendXAmount string `json:"spendXAmount,omitempty"`
  2174. // ForceSendFields is a list of field names (e.g. "AdwordsUrl") to
  2175. // unconditionally include in API requests. By default, fields with
  2176. // empty values are omitted from API requests. However, any non-pointer,
  2177. // non-interface field appearing in ForceSendFields will be sent to the
  2178. // server regardless of whether the field is empty or not. This may be
  2179. // used to include empty fields in Patch requests.
  2180. ForceSendFields []string `json:"-"`
  2181. // NullFields is a list of field names (e.g. "AdwordsUrl") to include in
  2182. // API requests with the JSON null value. By default, fields with empty
  2183. // values are omitted from API requests. However, any field with an
  2184. // empty value appearing in NullFields will be sent to the server as
  2185. // null. It is an error if a field in this list has a non-empty value.
  2186. // This may be used to include null fields in Patch requests.
  2187. NullFields []string `json:"-"`
  2188. }
  2189. func (s *OfferCustomer) MarshalJSON() ([]byte, error) {
  2190. type NoMethod OfferCustomer
  2191. raw := NoMethod(*s)
  2192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2193. }
  2194. // OptIns: A set of opt-ins for a user.
  2195. type OptIns struct {
  2196. // MarketComm: An opt-in about receiving email from Partners marketing
  2197. // teams. Includes
  2198. // member-only events and special promotional offers for Google
  2199. // products.
  2200. MarketComm bool `json:"marketComm,omitempty"`
  2201. // PerformanceSuggestions: An opt-in about receiving email with
  2202. // customized AdWords campaign management
  2203. // tips.
  2204. PerformanceSuggestions bool `json:"performanceSuggestions,omitempty"`
  2205. // PhoneContact: An opt-in to allow recieivng phone calls about their
  2206. // Partners account.
  2207. PhoneContact bool `json:"phoneContact,omitempty"`
  2208. // PhysicalMail: An opt-in to receive special promotional gifts and
  2209. // material in the mail.
  2210. PhysicalMail bool `json:"physicalMail,omitempty"`
  2211. // SpecialOffers: An opt-in about receiving email regarding new features
  2212. // and products.
  2213. SpecialOffers bool `json:"specialOffers,omitempty"`
  2214. // ForceSendFields is a list of field names (e.g. "MarketComm") to
  2215. // unconditionally include in API requests. By default, fields with
  2216. // empty values are omitted from API requests. However, any non-pointer,
  2217. // non-interface field appearing in ForceSendFields will be sent to the
  2218. // server regardless of whether the field is empty or not. This may be
  2219. // used to include empty fields in Patch requests.
  2220. ForceSendFields []string `json:"-"`
  2221. // NullFields is a list of field names (e.g. "MarketComm") to include in
  2222. // API requests with the JSON null value. By default, fields with empty
  2223. // values are omitted from API requests. However, any field with an
  2224. // empty value appearing in NullFields will be sent to the server as
  2225. // null. It is an error if a field in this list has a non-empty value.
  2226. // This may be used to include null fields in Patch requests.
  2227. NullFields []string `json:"-"`
  2228. }
  2229. func (s *OptIns) MarshalJSON() ([]byte, error) {
  2230. type NoMethod OptIns
  2231. raw := NoMethod(*s)
  2232. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2233. }
  2234. // PublicProfile: Basic information from a public profile.
  2235. type PublicProfile struct {
  2236. // DisplayImageUrl: The URL to the main display image of the public
  2237. // profile. Being deprecated.
  2238. DisplayImageUrl string `json:"displayImageUrl,omitempty"`
  2239. // DisplayName: The display name of the public profile.
  2240. DisplayName string `json:"displayName,omitempty"`
  2241. // Id: The ID which can be used to retrieve more details about the
  2242. // public profile.
  2243. Id string `json:"id,omitempty"`
  2244. // ProfileImage: The URL to the main profile image of the public
  2245. // profile.
  2246. ProfileImage string `json:"profileImage,omitempty"`
  2247. // Url: The URL of the public profile.
  2248. Url string `json:"url,omitempty"`
  2249. // ForceSendFields is a list of field names (e.g. "DisplayImageUrl") to
  2250. // unconditionally include in API requests. By default, fields with
  2251. // empty values are omitted from API requests. However, any non-pointer,
  2252. // non-interface field appearing in ForceSendFields will be sent to the
  2253. // server regardless of whether the field is empty or not. This may be
  2254. // used to include empty fields in Patch requests.
  2255. ForceSendFields []string `json:"-"`
  2256. // NullFields is a list of field names (e.g. "DisplayImageUrl") to
  2257. // include in API requests with the JSON null value. By default, fields
  2258. // with empty values are omitted from API requests. However, any field
  2259. // with an empty value appearing in NullFields will be sent to the
  2260. // server as null. It is an error if a field in this list has a
  2261. // non-empty value. This may be used to include null fields in Patch
  2262. // requests.
  2263. NullFields []string `json:"-"`
  2264. }
  2265. func (s *PublicProfile) MarshalJSON() ([]byte, error) {
  2266. type NoMethod PublicProfile
  2267. raw := NoMethod(*s)
  2268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2269. }
  2270. // Rank: Information related to ranking of results.
  2271. type Rank struct {
  2272. // Type: The type of rank.
  2273. //
  2274. // Possible values:
  2275. // "RANK_TYPE_UNSPECIFIED" - Unchosen.
  2276. // "RT_FINAL_SCORE" - Total final score.
  2277. Type string `json:"type,omitempty"`
  2278. // Value: The numerical value of the rank.
  2279. Value float64 `json:"value,omitempty"`
  2280. // ForceSendFields is a list of field names (e.g. "Type") to
  2281. // unconditionally include in API requests. By default, fields with
  2282. // empty values are omitted from API requests. However, any non-pointer,
  2283. // non-interface field appearing in ForceSendFields will be sent to the
  2284. // server regardless of whether the field is empty or not. This may be
  2285. // used to include empty fields in Patch requests.
  2286. ForceSendFields []string `json:"-"`
  2287. // NullFields is a list of field names (e.g. "Type") to include in API
  2288. // requests with the JSON null value. By default, fields with empty
  2289. // values are omitted from API requests. However, any field with an
  2290. // empty value appearing in NullFields will be sent to the server as
  2291. // null. It is an error if a field in this list has a non-empty value.
  2292. // This may be used to include null fields in Patch requests.
  2293. NullFields []string `json:"-"`
  2294. }
  2295. func (s *Rank) MarshalJSON() ([]byte, error) {
  2296. type NoMethod Rank
  2297. raw := NoMethod(*s)
  2298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2299. }
  2300. func (s *Rank) UnmarshalJSON(data []byte) error {
  2301. type NoMethod Rank
  2302. var s1 struct {
  2303. Value gensupport.JSONFloat64 `json:"value"`
  2304. *NoMethod
  2305. }
  2306. s1.NoMethod = (*NoMethod)(s)
  2307. if err := json.Unmarshal(data, &s1); err != nil {
  2308. return err
  2309. }
  2310. s.Value = float64(s1.Value)
  2311. return nil
  2312. }
  2313. // RecaptchaChallenge: <a
  2314. // href="https://www.google.com/recaptcha/">reCaptcha</a> challenge
  2315. // info.
  2316. type RecaptchaChallenge struct {
  2317. // Id: The ID of the reCaptcha challenge.
  2318. Id string `json:"id,omitempty"`
  2319. // Response: The response to the reCaptcha challenge.
  2320. Response string `json:"response,omitempty"`
  2321. // ForceSendFields is a list of field names (e.g. "Id") to
  2322. // unconditionally include in API requests. By default, fields with
  2323. // empty values are omitted from API requests. However, any non-pointer,
  2324. // non-interface field appearing in ForceSendFields will be sent to the
  2325. // server regardless of whether the field is empty or not. This may be
  2326. // used to include empty fields in Patch requests.
  2327. ForceSendFields []string `json:"-"`
  2328. // NullFields is a list of field names (e.g. "Id") to include in API
  2329. // requests with the JSON null value. By default, fields with empty
  2330. // values are omitted from API requests. However, any field with an
  2331. // empty value appearing in NullFields will be sent to the server as
  2332. // null. It is an error if a field in this list has a non-empty value.
  2333. // This may be used to include null fields in Patch requests.
  2334. NullFields []string `json:"-"`
  2335. }
  2336. func (s *RecaptchaChallenge) MarshalJSON() ([]byte, error) {
  2337. type NoMethod RecaptchaChallenge
  2338. raw := NoMethod(*s)
  2339. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2340. }
  2341. // RequestMetadata: Common data that is in each API request.
  2342. type RequestMetadata struct {
  2343. // ExperimentIds: Experiment IDs the current request belongs to.
  2344. ExperimentIds []string `json:"experimentIds,omitempty"`
  2345. // Locale: Locale to use for the current request.
  2346. Locale string `json:"locale,omitempty"`
  2347. // PartnersSessionId: Google Partners session ID.
  2348. PartnersSessionId string `json:"partnersSessionId,omitempty"`
  2349. // TrafficSource: Source of traffic for the current request.
  2350. TrafficSource *TrafficSource `json:"trafficSource,omitempty"`
  2351. // UserOverrides: Values to use instead of the user's respective
  2352. // defaults for the current
  2353. // request. These are only honored by whitelisted products.
  2354. UserOverrides *UserOverrides `json:"userOverrides,omitempty"`
  2355. // ForceSendFields is a list of field names (e.g. "ExperimentIds") to
  2356. // unconditionally include in API requests. By default, fields with
  2357. // empty values are omitted from API requests. However, any non-pointer,
  2358. // non-interface field appearing in ForceSendFields will be sent to the
  2359. // server regardless of whether the field is empty or not. This may be
  2360. // used to include empty fields in Patch requests.
  2361. ForceSendFields []string `json:"-"`
  2362. // NullFields is a list of field names (e.g. "ExperimentIds") to include
  2363. // in API requests with the JSON null value. By default, fields with
  2364. // empty values are omitted from API requests. However, any field with
  2365. // an empty value appearing in NullFields will be sent to the server as
  2366. // null. It is an error if a field in this list has a non-empty value.
  2367. // This may be used to include null fields in Patch requests.
  2368. NullFields []string `json:"-"`
  2369. }
  2370. func (s *RequestMetadata) MarshalJSON() ([]byte, error) {
  2371. type NoMethod RequestMetadata
  2372. raw := NoMethod(*s)
  2373. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2374. }
  2375. // ResponseMetadata: Common data that is in each API response.
  2376. type ResponseMetadata struct {
  2377. // DebugInfo: Debug information about this request.
  2378. DebugInfo *DebugInfo `json:"debugInfo,omitempty"`
  2379. // ForceSendFields is a list of field names (e.g. "DebugInfo") to
  2380. // unconditionally include in API requests. By default, fields with
  2381. // empty values are omitted from API requests. However, any non-pointer,
  2382. // non-interface field appearing in ForceSendFields will be sent to the
  2383. // server regardless of whether the field is empty or not. This may be
  2384. // used to include empty fields in Patch requests.
  2385. ForceSendFields []string `json:"-"`
  2386. // NullFields is a list of field names (e.g. "DebugInfo") to include in
  2387. // API requests with the JSON null value. By default, fields with empty
  2388. // values are omitted from API requests. However, any field with an
  2389. // empty value appearing in NullFields will be sent to the server as
  2390. // null. It is an error if a field in this list has a non-empty value.
  2391. // This may be used to include null fields in Patch requests.
  2392. NullFields []string `json:"-"`
  2393. }
  2394. func (s *ResponseMetadata) MarshalJSON() ([]byte, error) {
  2395. type NoMethod ResponseMetadata
  2396. raw := NoMethod(*s)
  2397. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2398. }
  2399. // SpecializationStatus: Agency specialization status
  2400. type SpecializationStatus struct {
  2401. // BadgeSpecialization: The specialization this status is for.
  2402. //
  2403. // Possible values:
  2404. // "BADGE_SPECIALIZATION_UNKNOWN" - Unknown specialization
  2405. // "BADGE_SPECIALIZATION_ADWORDS_SEARCH" - AdWords Search
  2406. // specialization
  2407. // "BADGE_SPECIALIZATION_ADWORDS_DISPLAY" - AdWords Display
  2408. // specialization
  2409. // "BADGE_SPECIALIZATION_ADWORDS_MOBILE" - AdWords Mobile
  2410. // specialization
  2411. // "BADGE_SPECIALIZATION_ADWORDS_VIDEO" - AdWords Video specialization
  2412. // "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" - AdWords Shopping
  2413. // specialization
  2414. BadgeSpecialization string `json:"badgeSpecialization,omitempty"`
  2415. // BadgeSpecializationState: State of agency specialization.
  2416. //
  2417. // Possible values:
  2418. // "BADGE_SPECIALIZATION_STATE_UNKNOWN" - Unknown state
  2419. // "BADGE_SPECIALIZATION_STATE_PASSED" - Specialization passed
  2420. // "BADGE_SPECIALIZATION_STATE_NOT_PASSED" - Specialization not passed
  2421. // "BADGE_SPECIALIZATION_STATE_IN_GRACE" - Specialization in grace
  2422. BadgeSpecializationState string `json:"badgeSpecializationState,omitempty"`
  2423. // ForceSendFields is a list of field names (e.g. "BadgeSpecialization")
  2424. // to unconditionally include in API requests. By default, fields with
  2425. // empty values are omitted from API requests. However, any non-pointer,
  2426. // non-interface field appearing in ForceSendFields will be sent to the
  2427. // server regardless of whether the field is empty or not. This may be
  2428. // used to include empty fields in Patch requests.
  2429. ForceSendFields []string `json:"-"`
  2430. // NullFields is a list of field names (e.g. "BadgeSpecialization") to
  2431. // include in API requests with the JSON null value. By default, fields
  2432. // with empty values are omitted from API requests. However, any field
  2433. // with an empty value appearing in NullFields will be sent to the
  2434. // server as null. It is an error if a field in this list has a
  2435. // non-empty value. This may be used to include null fields in Patch
  2436. // requests.
  2437. NullFields []string `json:"-"`
  2438. }
  2439. func (s *SpecializationStatus) MarshalJSON() ([]byte, error) {
  2440. type NoMethod SpecializationStatus
  2441. raw := NoMethod(*s)
  2442. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2443. }
  2444. // TrafficSource: Source of traffic for the current request.
  2445. type TrafficSource struct {
  2446. // TrafficSourceId: Identifier to indicate where the traffic comes
  2447. // from.
  2448. // An identifier has multiple letters created by a team which redirected
  2449. // the
  2450. // traffic to us.
  2451. TrafficSourceId string `json:"trafficSourceId,omitempty"`
  2452. // TrafficSubId: Second level identifier to indicate where the traffic
  2453. // comes from.
  2454. // An identifier has multiple letters created by a team which redirected
  2455. // the
  2456. // traffic to us.
  2457. TrafficSubId string `json:"trafficSubId,omitempty"`
  2458. // ForceSendFields is a list of field names (e.g. "TrafficSourceId") to
  2459. // unconditionally include in API requests. By default, fields with
  2460. // empty values are omitted from API requests. However, any non-pointer,
  2461. // non-interface field appearing in ForceSendFields will be sent to the
  2462. // server regardless of whether the field is empty or not. This may be
  2463. // used to include empty fields in Patch requests.
  2464. ForceSendFields []string `json:"-"`
  2465. // NullFields is a list of field names (e.g. "TrafficSourceId") to
  2466. // include in API requests with the JSON null value. By default, fields
  2467. // with empty values are omitted from API requests. However, any field
  2468. // with an empty value appearing in NullFields will be sent to the
  2469. // server as null. It is an error if a field in this list has a
  2470. // non-empty value. This may be used to include null fields in Patch
  2471. // requests.
  2472. NullFields []string `json:"-"`
  2473. }
  2474. func (s *TrafficSource) MarshalJSON() ([]byte, error) {
  2475. type NoMethod TrafficSource
  2476. raw := NoMethod(*s)
  2477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2478. }
  2479. // User: A resource representing a user of the Partners platform.
  2480. type User struct {
  2481. // AfaInfoShared: Whether or not the user has opted to share their
  2482. // Academy for Ads info with
  2483. // Google Partners.
  2484. AfaInfoShared bool `json:"afaInfoShared,omitempty"`
  2485. // AvailableAdwordsManagerAccounts: This is the list of AdWords Manager
  2486. // Accounts the user has edit access to.
  2487. // If the user has edit access to multiple accounts, the user can choose
  2488. // the
  2489. // preferred account and we use this when a personal account is needed.
  2490. // Can
  2491. // be empty meaning the user has access to no accounts.
  2492. // @OutputOnly
  2493. AvailableAdwordsManagerAccounts []*AdWordsManagerAccountInfo `json:"availableAdwordsManagerAccounts,omitempty"`
  2494. // CertificationStatus: The list of achieved certifications. These are
  2495. // calculated based on exam
  2496. // results and other requirements.
  2497. // @OutputOnly
  2498. CertificationStatus []*Certification `json:"certificationStatus,omitempty"`
  2499. // Company: The company that the user is associated with.
  2500. // If not present, the user is not associated with any company.
  2501. Company *CompanyRelation `json:"company,omitempty"`
  2502. // CompanyVerificationEmail: The email address used by the user used for
  2503. // company verification.
  2504. // @OutputOnly
  2505. CompanyVerificationEmail string `json:"companyVerificationEmail,omitempty"`
  2506. // ExamStatus: The list of exams the user ever taken. For each type of
  2507. // exam, only one
  2508. // entry is listed.
  2509. ExamStatus []*ExamStatus `json:"examStatus,omitempty"`
  2510. // Id: The ID of the user.
  2511. Id string `json:"id,omitempty"`
  2512. // InternalId: The internal user ID.
  2513. // Only available for a whitelisted set of api clients.
  2514. InternalId string `json:"internalId,omitempty"`
  2515. // LastAccessTime: The most recent time the user interacted with the
  2516. // Partners site.
  2517. // @OutputOnly
  2518. LastAccessTime string `json:"lastAccessTime,omitempty"`
  2519. // PrimaryEmails: The list of emails the user has access to/can select
  2520. // as primary.
  2521. // @OutputOnly
  2522. PrimaryEmails []string `json:"primaryEmails,omitempty"`
  2523. // Profile: The profile information of a Partners user, contains all the
  2524. // directly
  2525. // editable user information.
  2526. Profile *UserProfile `json:"profile,omitempty"`
  2527. // PublicProfile: Information about a user's external public profile
  2528. // outside Google Partners.
  2529. PublicProfile *PublicProfile `json:"publicProfile,omitempty"`
  2530. // ServerResponse contains the HTTP response code and headers from the
  2531. // server.
  2532. googleapi.ServerResponse `json:"-"`
  2533. // ForceSendFields is a list of field names (e.g. "AfaInfoShared") to
  2534. // unconditionally include in API requests. By default, fields with
  2535. // empty values are omitted from API requests. However, any non-pointer,
  2536. // non-interface field appearing in ForceSendFields will be sent to the
  2537. // server regardless of whether the field is empty or not. This may be
  2538. // used to include empty fields in Patch requests.
  2539. ForceSendFields []string `json:"-"`
  2540. // NullFields is a list of field names (e.g. "AfaInfoShared") to include
  2541. // in API requests with the JSON null value. By default, fields with
  2542. // empty values are omitted from API requests. However, any field with
  2543. // an empty value appearing in NullFields will be sent to the server as
  2544. // null. It is an error if a field in this list has a non-empty value.
  2545. // This may be used to include null fields in Patch requests.
  2546. NullFields []string `json:"-"`
  2547. }
  2548. func (s *User) MarshalJSON() ([]byte, error) {
  2549. type NoMethod User
  2550. raw := NoMethod(*s)
  2551. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2552. }
  2553. // UserOverrides: Values to use instead of the user's respective
  2554. // defaults. These are only
  2555. // honored by whitelisted products.
  2556. type UserOverrides struct {
  2557. // IpAddress: IP address to use instead of the user's geo-located IP
  2558. // address.
  2559. IpAddress string `json:"ipAddress,omitempty"`
  2560. // UserId: Logged-in user ID to impersonate instead of the user's ID.
  2561. UserId string `json:"userId,omitempty"`
  2562. // ForceSendFields is a list of field names (e.g. "IpAddress") to
  2563. // unconditionally include in API requests. By default, fields with
  2564. // empty values are omitted from API requests. However, any non-pointer,
  2565. // non-interface field appearing in ForceSendFields will be sent to the
  2566. // server regardless of whether the field is empty or not. This may be
  2567. // used to include empty fields in Patch requests.
  2568. ForceSendFields []string `json:"-"`
  2569. // NullFields is a list of field names (e.g. "IpAddress") to include in
  2570. // API requests with the JSON null value. By default, fields with empty
  2571. // values are omitted from API requests. However, any field with an
  2572. // empty value appearing in NullFields will be sent to the server as
  2573. // null. It is an error if a field in this list has a non-empty value.
  2574. // This may be used to include null fields in Patch requests.
  2575. NullFields []string `json:"-"`
  2576. }
  2577. func (s *UserOverrides) MarshalJSON() ([]byte, error) {
  2578. type NoMethod UserOverrides
  2579. raw := NoMethod(*s)
  2580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2581. }
  2582. // UserProfile: The profile information of a Partners user.
  2583. type UserProfile struct {
  2584. // Address: The user's mailing address, contains multiple fields.
  2585. Address *Location `json:"address,omitempty"`
  2586. // AdwordsManagerAccount: If the user has edit access to multiple
  2587. // accounts, the user can choose the
  2588. // preferred account and it is used when a personal account is needed.
  2589. // Can
  2590. // be empty.
  2591. AdwordsManagerAccount int64 `json:"adwordsManagerAccount,omitempty,string"`
  2592. // Channels: A list of ids representing which channels the user selected
  2593. // they were in.
  2594. Channels []string `json:"channels,omitempty"`
  2595. // EmailAddress: The email address the user has selected on the Partners
  2596. // site as primary.
  2597. EmailAddress string `json:"emailAddress,omitempty"`
  2598. // EmailOptIns: The list of opt-ins for the user, related to
  2599. // communication preferences.
  2600. EmailOptIns *OptIns `json:"emailOptIns,omitempty"`
  2601. // FamilyName: The user's family name.
  2602. FamilyName string `json:"familyName,omitempty"`
  2603. // GivenName: The user's given name.
  2604. GivenName string `json:"givenName,omitempty"`
  2605. // Industries: A list of ids representing which industries the user
  2606. // selected.
  2607. Industries []string `json:"industries,omitempty"`
  2608. // JobFunctions: A list of ids represnting which job categories the user
  2609. // selected.
  2610. JobFunctions []string `json:"jobFunctions,omitempty"`
  2611. // Languages: The list of languages this user understands.
  2612. Languages []string `json:"languages,omitempty"`
  2613. // Markets: A list of ids representing which markets the user was
  2614. // interested in.
  2615. Markets []string `json:"markets,omitempty"`
  2616. // MigrateToAfa: Whether or not to migrate the user's exam data to
  2617. // Academy for Ads.
  2618. MigrateToAfa bool `json:"migrateToAfa,omitempty"`
  2619. // PhoneNumber: The user's phone number.
  2620. PhoneNumber string `json:"phoneNumber,omitempty"`
  2621. // PrimaryCountryCode: The user's primary country, an ISO 2-character
  2622. // code.
  2623. PrimaryCountryCode string `json:"primaryCountryCode,omitempty"`
  2624. // ProfilePublic: Whether the user's public profile is visible to anyone
  2625. // with the URL.
  2626. ProfilePublic bool `json:"profilePublic,omitempty"`
  2627. // ServerResponse contains the HTTP response code and headers from the
  2628. // server.
  2629. googleapi.ServerResponse `json:"-"`
  2630. // ForceSendFields is a list of field names (e.g. "Address") to
  2631. // unconditionally include in API requests. By default, fields with
  2632. // empty values are omitted from API requests. However, any non-pointer,
  2633. // non-interface field appearing in ForceSendFields will be sent to the
  2634. // server regardless of whether the field is empty or not. This may be
  2635. // used to include empty fields in Patch requests.
  2636. ForceSendFields []string `json:"-"`
  2637. // NullFields is a list of field names (e.g. "Address") to include in
  2638. // API requests with the JSON null value. By default, fields with empty
  2639. // values are omitted from API requests. However, any field with an
  2640. // empty value appearing in NullFields will be sent to the server as
  2641. // null. It is an error if a field in this list has a non-empty value.
  2642. // This may be used to include null fields in Patch requests.
  2643. NullFields []string `json:"-"`
  2644. }
  2645. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  2646. type NoMethod UserProfile
  2647. raw := NoMethod(*s)
  2648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2649. }
  2650. // method id "partners.analytics.list":
  2651. type AnalyticsListCall struct {
  2652. s *Service
  2653. urlParams_ gensupport.URLParams
  2654. ifNoneMatch_ string
  2655. ctx_ context.Context
  2656. header_ http.Header
  2657. }
  2658. // List: Lists analytics data for a user's associated company.
  2659. // Should only be called within the context of an authorized logged in
  2660. // user.
  2661. func (r *AnalyticsService) List() *AnalyticsListCall {
  2662. c := &AnalyticsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2663. return c
  2664. }
  2665. // PageSize sets the optional parameter "pageSize": Requested page size.
  2666. // Server may return fewer analytics than requested.
  2667. // If unspecified or set to 0, default value is 30.
  2668. // Specifies the number of days in the date range when querying
  2669. // analytics.
  2670. // The `page_token` represents the end date of the date range
  2671. // and the start date is calculated using the `page_size` as the
  2672. // number
  2673. // of days BEFORE the end date.
  2674. // Must be a non-negative integer.
  2675. func (c *AnalyticsListCall) PageSize(pageSize int64) *AnalyticsListCall {
  2676. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2677. return c
  2678. }
  2679. // PageToken sets the optional parameter "pageToken": A token
  2680. // identifying a page of results that the server returns.
  2681. // Typically, this is the value of
  2682. // `ListAnalyticsResponse.next_page_token`
  2683. // returned from the previous call to
  2684. // ListAnalytics.
  2685. // Will be a date string in `YYYY-MM-DD` format representing the end
  2686. // date
  2687. // of the date range of results to return.
  2688. // If unspecified or set to "", default value is the current date.
  2689. func (c *AnalyticsListCall) PageToken(pageToken string) *AnalyticsListCall {
  2690. c.urlParams_.Set("pageToken", pageToken)
  2691. return c
  2692. }
  2693. // RequestMetadataExperimentIds sets the optional parameter
  2694. // "requestMetadata.experimentIds": Experiment IDs the current request
  2695. // belongs to.
  2696. func (c *AnalyticsListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *AnalyticsListCall {
  2697. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  2698. return c
  2699. }
  2700. // RequestMetadataLocale sets the optional parameter
  2701. // "requestMetadata.locale": Locale to use for the current request.
  2702. func (c *AnalyticsListCall) RequestMetadataLocale(requestMetadataLocale string) *AnalyticsListCall {
  2703. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  2704. return c
  2705. }
  2706. // RequestMetadataPartnersSessionId sets the optional parameter
  2707. // "requestMetadata.partnersSessionId": Google Partners session ID.
  2708. func (c *AnalyticsListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *AnalyticsListCall {
  2709. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  2710. return c
  2711. }
  2712. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  2713. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  2714. // to indicate where the traffic comes from.
  2715. // An identifier has multiple letters created by a team which redirected
  2716. // the
  2717. // traffic to us.
  2718. func (c *AnalyticsListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *AnalyticsListCall {
  2719. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  2720. return c
  2721. }
  2722. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  2723. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  2724. // to indicate where the traffic comes from.
  2725. // An identifier has multiple letters created by a team which redirected
  2726. // the
  2727. // traffic to us.
  2728. func (c *AnalyticsListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *AnalyticsListCall {
  2729. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  2730. return c
  2731. }
  2732. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  2733. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  2734. // of the user's geo-located IP address.
  2735. func (c *AnalyticsListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *AnalyticsListCall {
  2736. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  2737. return c
  2738. }
  2739. // RequestMetadataUserOverridesUserId sets the optional parameter
  2740. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  2741. // impersonate instead of the user's ID.
  2742. func (c *AnalyticsListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *AnalyticsListCall {
  2743. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  2744. return c
  2745. }
  2746. // Fields allows partial responses to be retrieved. See
  2747. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2748. // for more information.
  2749. func (c *AnalyticsListCall) Fields(s ...googleapi.Field) *AnalyticsListCall {
  2750. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2751. return c
  2752. }
  2753. // IfNoneMatch sets the optional parameter which makes the operation
  2754. // fail if the object's ETag matches the given value. This is useful for
  2755. // getting updates only after the object has changed since the last
  2756. // request. Use googleapi.IsNotModified to check whether the response
  2757. // error from Do is the result of In-None-Match.
  2758. func (c *AnalyticsListCall) IfNoneMatch(entityTag string) *AnalyticsListCall {
  2759. c.ifNoneMatch_ = entityTag
  2760. return c
  2761. }
  2762. // Context sets the context to be used in this call's Do method. Any
  2763. // pending HTTP request will be aborted if the provided context is
  2764. // canceled.
  2765. func (c *AnalyticsListCall) Context(ctx context.Context) *AnalyticsListCall {
  2766. c.ctx_ = ctx
  2767. return c
  2768. }
  2769. // Header returns an http.Header that can be modified by the caller to
  2770. // add HTTP headers to the request.
  2771. func (c *AnalyticsListCall) Header() http.Header {
  2772. if c.header_ == nil {
  2773. c.header_ = make(http.Header)
  2774. }
  2775. return c.header_
  2776. }
  2777. func (c *AnalyticsListCall) doRequest(alt string) (*http.Response, error) {
  2778. reqHeaders := make(http.Header)
  2779. for k, v := range c.header_ {
  2780. reqHeaders[k] = v
  2781. }
  2782. reqHeaders.Set("User-Agent", c.s.userAgent())
  2783. if c.ifNoneMatch_ != "" {
  2784. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2785. }
  2786. var body io.Reader = nil
  2787. c.urlParams_.Set("alt", alt)
  2788. c.urlParams_.Set("prettyPrint", "false")
  2789. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/analytics")
  2790. urls += "?" + c.urlParams_.Encode()
  2791. req, err := http.NewRequest("GET", urls, body)
  2792. if err != nil {
  2793. return nil, err
  2794. }
  2795. req.Header = reqHeaders
  2796. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2797. }
  2798. // Do executes the "partners.analytics.list" call.
  2799. // Exactly one of *ListAnalyticsResponse or error will be non-nil. Any
  2800. // non-2xx status code is an error. Response headers are in either
  2801. // *ListAnalyticsResponse.ServerResponse.Header or (if a response was
  2802. // returned at all) in error.(*googleapi.Error).Header. Use
  2803. // googleapi.IsNotModified to check whether the returned error was
  2804. // because http.StatusNotModified was returned.
  2805. func (c *AnalyticsListCall) Do(opts ...googleapi.CallOption) (*ListAnalyticsResponse, error) {
  2806. gensupport.SetOptions(c.urlParams_, opts...)
  2807. res, err := c.doRequest("json")
  2808. if res != nil && res.StatusCode == http.StatusNotModified {
  2809. if res.Body != nil {
  2810. res.Body.Close()
  2811. }
  2812. return nil, &googleapi.Error{
  2813. Code: res.StatusCode,
  2814. Header: res.Header,
  2815. }
  2816. }
  2817. if err != nil {
  2818. return nil, err
  2819. }
  2820. defer googleapi.CloseBody(res)
  2821. if err := googleapi.CheckResponse(res); err != nil {
  2822. return nil, err
  2823. }
  2824. ret := &ListAnalyticsResponse{
  2825. ServerResponse: googleapi.ServerResponse{
  2826. Header: res.Header,
  2827. HTTPStatusCode: res.StatusCode,
  2828. },
  2829. }
  2830. target := &ret
  2831. if err := gensupport.DecodeResponse(target, res); err != nil {
  2832. return nil, err
  2833. }
  2834. return ret, nil
  2835. // {
  2836. // "description": "Lists analytics data for a user's associated company.\nShould only be called within the context of an authorized logged in user.",
  2837. // "flatPath": "v2/analytics",
  2838. // "httpMethod": "GET",
  2839. // "id": "partners.analytics.list",
  2840. // "parameterOrder": [],
  2841. // "parameters": {
  2842. // "pageSize": {
  2843. // "description": "Requested page size. Server may return fewer analytics than requested.\nIf unspecified or set to 0, default value is 30.\nSpecifies the number of days in the date range when querying analytics.\nThe `page_token` represents the end date of the date range\nand the start date is calculated using the `page_size` as the number\nof days BEFORE the end date.\nMust be a non-negative integer.",
  2844. // "format": "int32",
  2845. // "location": "query",
  2846. // "type": "integer"
  2847. // },
  2848. // "pageToken": {
  2849. // "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListAnalyticsResponse.next_page_token`\nreturned from the previous call to\nListAnalytics.\nWill be a date string in `YYYY-MM-DD` format representing the end date\nof the date range of results to return.\nIf unspecified or set to \"\", default value is the current date.",
  2850. // "location": "query",
  2851. // "type": "string"
  2852. // },
  2853. // "requestMetadata.experimentIds": {
  2854. // "description": "Experiment IDs the current request belongs to.",
  2855. // "location": "query",
  2856. // "repeated": true,
  2857. // "type": "string"
  2858. // },
  2859. // "requestMetadata.locale": {
  2860. // "description": "Locale to use for the current request.",
  2861. // "location": "query",
  2862. // "type": "string"
  2863. // },
  2864. // "requestMetadata.partnersSessionId": {
  2865. // "description": "Google Partners session ID.",
  2866. // "location": "query",
  2867. // "type": "string"
  2868. // },
  2869. // "requestMetadata.trafficSource.trafficSourceId": {
  2870. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  2871. // "location": "query",
  2872. // "type": "string"
  2873. // },
  2874. // "requestMetadata.trafficSource.trafficSubId": {
  2875. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  2876. // "location": "query",
  2877. // "type": "string"
  2878. // },
  2879. // "requestMetadata.userOverrides.ipAddress": {
  2880. // "description": "IP address to use instead of the user's geo-located IP address.",
  2881. // "location": "query",
  2882. // "type": "string"
  2883. // },
  2884. // "requestMetadata.userOverrides.userId": {
  2885. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  2886. // "location": "query",
  2887. // "type": "string"
  2888. // }
  2889. // },
  2890. // "path": "v2/analytics",
  2891. // "response": {
  2892. // "$ref": "ListAnalyticsResponse"
  2893. // }
  2894. // }
  2895. }
  2896. // Pages invokes f for each page of results.
  2897. // A non-nil error returned from f will halt the iteration.
  2898. // The provided context supersedes any context provided to the Context method.
  2899. func (c *AnalyticsListCall) Pages(ctx context.Context, f func(*ListAnalyticsResponse) error) error {
  2900. c.ctx_ = ctx
  2901. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2902. for {
  2903. x, err := c.Do()
  2904. if err != nil {
  2905. return err
  2906. }
  2907. if err := f(x); err != nil {
  2908. return err
  2909. }
  2910. if x.NextPageToken == "" {
  2911. return nil
  2912. }
  2913. c.PageToken(x.NextPageToken)
  2914. }
  2915. }
  2916. // method id "partners.clientMessages.log":
  2917. type ClientMessagesLogCall struct {
  2918. s *Service
  2919. logmessagerequest *LogMessageRequest
  2920. urlParams_ gensupport.URLParams
  2921. ctx_ context.Context
  2922. header_ http.Header
  2923. }
  2924. // Log: Logs a generic message from the client, such as
  2925. // `Failed to render component`, `Profile page is running slow`,
  2926. // `More than 500 users have accessed this result.`, etc.
  2927. func (r *ClientMessagesService) Log(logmessagerequest *LogMessageRequest) *ClientMessagesLogCall {
  2928. c := &ClientMessagesLogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2929. c.logmessagerequest = logmessagerequest
  2930. return c
  2931. }
  2932. // Fields allows partial responses to be retrieved. See
  2933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2934. // for more information.
  2935. func (c *ClientMessagesLogCall) Fields(s ...googleapi.Field) *ClientMessagesLogCall {
  2936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2937. return c
  2938. }
  2939. // Context sets the context to be used in this call's Do method. Any
  2940. // pending HTTP request will be aborted if the provided context is
  2941. // canceled.
  2942. func (c *ClientMessagesLogCall) Context(ctx context.Context) *ClientMessagesLogCall {
  2943. c.ctx_ = ctx
  2944. return c
  2945. }
  2946. // Header returns an http.Header that can be modified by the caller to
  2947. // add HTTP headers to the request.
  2948. func (c *ClientMessagesLogCall) Header() http.Header {
  2949. if c.header_ == nil {
  2950. c.header_ = make(http.Header)
  2951. }
  2952. return c.header_
  2953. }
  2954. func (c *ClientMessagesLogCall) doRequest(alt string) (*http.Response, error) {
  2955. reqHeaders := make(http.Header)
  2956. for k, v := range c.header_ {
  2957. reqHeaders[k] = v
  2958. }
  2959. reqHeaders.Set("User-Agent", c.s.userAgent())
  2960. var body io.Reader = nil
  2961. body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmessagerequest)
  2962. if err != nil {
  2963. return nil, err
  2964. }
  2965. reqHeaders.Set("Content-Type", "application/json")
  2966. c.urlParams_.Set("alt", alt)
  2967. c.urlParams_.Set("prettyPrint", "false")
  2968. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/clientMessages:log")
  2969. urls += "?" + c.urlParams_.Encode()
  2970. req, err := http.NewRequest("POST", urls, body)
  2971. if err != nil {
  2972. return nil, err
  2973. }
  2974. req.Header = reqHeaders
  2975. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2976. }
  2977. // Do executes the "partners.clientMessages.log" call.
  2978. // Exactly one of *LogMessageResponse or error will be non-nil. Any
  2979. // non-2xx status code is an error. Response headers are in either
  2980. // *LogMessageResponse.ServerResponse.Header or (if a response was
  2981. // returned at all) in error.(*googleapi.Error).Header. Use
  2982. // googleapi.IsNotModified to check whether the returned error was
  2983. // because http.StatusNotModified was returned.
  2984. func (c *ClientMessagesLogCall) Do(opts ...googleapi.CallOption) (*LogMessageResponse, error) {
  2985. gensupport.SetOptions(c.urlParams_, opts...)
  2986. res, err := c.doRequest("json")
  2987. if res != nil && res.StatusCode == http.StatusNotModified {
  2988. if res.Body != nil {
  2989. res.Body.Close()
  2990. }
  2991. return nil, &googleapi.Error{
  2992. Code: res.StatusCode,
  2993. Header: res.Header,
  2994. }
  2995. }
  2996. if err != nil {
  2997. return nil, err
  2998. }
  2999. defer googleapi.CloseBody(res)
  3000. if err := googleapi.CheckResponse(res); err != nil {
  3001. return nil, err
  3002. }
  3003. ret := &LogMessageResponse{
  3004. ServerResponse: googleapi.ServerResponse{
  3005. Header: res.Header,
  3006. HTTPStatusCode: res.StatusCode,
  3007. },
  3008. }
  3009. target := &ret
  3010. if err := gensupport.DecodeResponse(target, res); err != nil {
  3011. return nil, err
  3012. }
  3013. return ret, nil
  3014. // {
  3015. // "description": "Logs a generic message from the client, such as\n`Failed to render component`, `Profile page is running slow`,\n`More than 500 users have accessed this result.`, etc.",
  3016. // "flatPath": "v2/clientMessages:log",
  3017. // "httpMethod": "POST",
  3018. // "id": "partners.clientMessages.log",
  3019. // "parameterOrder": [],
  3020. // "parameters": {},
  3021. // "path": "v2/clientMessages:log",
  3022. // "request": {
  3023. // "$ref": "LogMessageRequest"
  3024. // },
  3025. // "response": {
  3026. // "$ref": "LogMessageResponse"
  3027. // }
  3028. // }
  3029. }
  3030. // method id "partners.companies.get":
  3031. type CompaniesGetCall struct {
  3032. s *Service
  3033. companyId string
  3034. urlParams_ gensupport.URLParams
  3035. ifNoneMatch_ string
  3036. ctx_ context.Context
  3037. header_ http.Header
  3038. }
  3039. // Get: Gets a company.
  3040. func (r *CompaniesService) Get(companyId string) *CompaniesGetCall {
  3041. c := &CompaniesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3042. c.companyId = companyId
  3043. return c
  3044. }
  3045. // Address sets the optional parameter "address": The address to use for
  3046. // sorting the company's addresses by proximity.
  3047. // If not given, the geo-located address of the request is used.
  3048. // Used when order_by is set.
  3049. func (c *CompaniesGetCall) Address(address string) *CompaniesGetCall {
  3050. c.urlParams_.Set("address", address)
  3051. return c
  3052. }
  3053. // CurrencyCode sets the optional parameter "currencyCode": If the
  3054. // company's budget is in a different currency code than this one,
  3055. // then
  3056. // the converted budget is converted to this currency code.
  3057. func (c *CompaniesGetCall) CurrencyCode(currencyCode string) *CompaniesGetCall {
  3058. c.urlParams_.Set("currencyCode", currencyCode)
  3059. return c
  3060. }
  3061. // OrderBy sets the optional parameter "orderBy": How to order addresses
  3062. // within the returned company. Currently, only
  3063. // `address` and `address desc` is supported which will sorted by
  3064. // closest to
  3065. // farthest in distance from given address and farthest to closest
  3066. // distance
  3067. // from given address respectively.
  3068. func (c *CompaniesGetCall) OrderBy(orderBy string) *CompaniesGetCall {
  3069. c.urlParams_.Set("orderBy", orderBy)
  3070. return c
  3071. }
  3072. // RequestMetadataExperimentIds sets the optional parameter
  3073. // "requestMetadata.experimentIds": Experiment IDs the current request
  3074. // belongs to.
  3075. func (c *CompaniesGetCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *CompaniesGetCall {
  3076. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  3077. return c
  3078. }
  3079. // RequestMetadataLocale sets the optional parameter
  3080. // "requestMetadata.locale": Locale to use for the current request.
  3081. func (c *CompaniesGetCall) RequestMetadataLocale(requestMetadataLocale string) *CompaniesGetCall {
  3082. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  3083. return c
  3084. }
  3085. // RequestMetadataPartnersSessionId sets the optional parameter
  3086. // "requestMetadata.partnersSessionId": Google Partners session ID.
  3087. func (c *CompaniesGetCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *CompaniesGetCall {
  3088. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  3089. return c
  3090. }
  3091. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  3092. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  3093. // to indicate where the traffic comes from.
  3094. // An identifier has multiple letters created by a team which redirected
  3095. // the
  3096. // traffic to us.
  3097. func (c *CompaniesGetCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *CompaniesGetCall {
  3098. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  3099. return c
  3100. }
  3101. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  3102. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  3103. // to indicate where the traffic comes from.
  3104. // An identifier has multiple letters created by a team which redirected
  3105. // the
  3106. // traffic to us.
  3107. func (c *CompaniesGetCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *CompaniesGetCall {
  3108. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  3109. return c
  3110. }
  3111. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  3112. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  3113. // of the user's geo-located IP address.
  3114. func (c *CompaniesGetCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *CompaniesGetCall {
  3115. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  3116. return c
  3117. }
  3118. // RequestMetadataUserOverridesUserId sets the optional parameter
  3119. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  3120. // impersonate instead of the user's ID.
  3121. func (c *CompaniesGetCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *CompaniesGetCall {
  3122. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  3123. return c
  3124. }
  3125. // View sets the optional parameter "view": The view of `Company`
  3126. // resource to be returned. This must not be
  3127. // `COMPANY_VIEW_UNSPECIFIED`.
  3128. //
  3129. // Possible values:
  3130. // "COMPANY_VIEW_UNSPECIFIED"
  3131. // "CV_GOOGLE_PARTNER_SEARCH"
  3132. func (c *CompaniesGetCall) View(view string) *CompaniesGetCall {
  3133. c.urlParams_.Set("view", view)
  3134. return c
  3135. }
  3136. // Fields allows partial responses to be retrieved. See
  3137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3138. // for more information.
  3139. func (c *CompaniesGetCall) Fields(s ...googleapi.Field) *CompaniesGetCall {
  3140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3141. return c
  3142. }
  3143. // IfNoneMatch sets the optional parameter which makes the operation
  3144. // fail if the object's ETag matches the given value. This is useful for
  3145. // getting updates only after the object has changed since the last
  3146. // request. Use googleapi.IsNotModified to check whether the response
  3147. // error from Do is the result of In-None-Match.
  3148. func (c *CompaniesGetCall) IfNoneMatch(entityTag string) *CompaniesGetCall {
  3149. c.ifNoneMatch_ = entityTag
  3150. return c
  3151. }
  3152. // Context sets the context to be used in this call's Do method. Any
  3153. // pending HTTP request will be aborted if the provided context is
  3154. // canceled.
  3155. func (c *CompaniesGetCall) Context(ctx context.Context) *CompaniesGetCall {
  3156. c.ctx_ = ctx
  3157. return c
  3158. }
  3159. // Header returns an http.Header that can be modified by the caller to
  3160. // add HTTP headers to the request.
  3161. func (c *CompaniesGetCall) Header() http.Header {
  3162. if c.header_ == nil {
  3163. c.header_ = make(http.Header)
  3164. }
  3165. return c.header_
  3166. }
  3167. func (c *CompaniesGetCall) doRequest(alt string) (*http.Response, error) {
  3168. reqHeaders := make(http.Header)
  3169. for k, v := range c.header_ {
  3170. reqHeaders[k] = v
  3171. }
  3172. reqHeaders.Set("User-Agent", c.s.userAgent())
  3173. if c.ifNoneMatch_ != "" {
  3174. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3175. }
  3176. var body io.Reader = nil
  3177. c.urlParams_.Set("alt", alt)
  3178. c.urlParams_.Set("prettyPrint", "false")
  3179. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies/{companyId}")
  3180. urls += "?" + c.urlParams_.Encode()
  3181. req, err := http.NewRequest("GET", urls, body)
  3182. if err != nil {
  3183. return nil, err
  3184. }
  3185. req.Header = reqHeaders
  3186. googleapi.Expand(req.URL, map[string]string{
  3187. "companyId": c.companyId,
  3188. })
  3189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3190. }
  3191. // Do executes the "partners.companies.get" call.
  3192. // Exactly one of *GetCompanyResponse or error will be non-nil. Any
  3193. // non-2xx status code is an error. Response headers are in either
  3194. // *GetCompanyResponse.ServerResponse.Header or (if a response was
  3195. // returned at all) in error.(*googleapi.Error).Header. Use
  3196. // googleapi.IsNotModified to check whether the returned error was
  3197. // because http.StatusNotModified was returned.
  3198. func (c *CompaniesGetCall) Do(opts ...googleapi.CallOption) (*GetCompanyResponse, error) {
  3199. gensupport.SetOptions(c.urlParams_, opts...)
  3200. res, err := c.doRequest("json")
  3201. if res != nil && res.StatusCode == http.StatusNotModified {
  3202. if res.Body != nil {
  3203. res.Body.Close()
  3204. }
  3205. return nil, &googleapi.Error{
  3206. Code: res.StatusCode,
  3207. Header: res.Header,
  3208. }
  3209. }
  3210. if err != nil {
  3211. return nil, err
  3212. }
  3213. defer googleapi.CloseBody(res)
  3214. if err := googleapi.CheckResponse(res); err != nil {
  3215. return nil, err
  3216. }
  3217. ret := &GetCompanyResponse{
  3218. ServerResponse: googleapi.ServerResponse{
  3219. Header: res.Header,
  3220. HTTPStatusCode: res.StatusCode,
  3221. },
  3222. }
  3223. target := &ret
  3224. if err := gensupport.DecodeResponse(target, res); err != nil {
  3225. return nil, err
  3226. }
  3227. return ret, nil
  3228. // {
  3229. // "description": "Gets a company.",
  3230. // "flatPath": "v2/companies/{companyId}",
  3231. // "httpMethod": "GET",
  3232. // "id": "partners.companies.get",
  3233. // "parameterOrder": [
  3234. // "companyId"
  3235. // ],
  3236. // "parameters": {
  3237. // "address": {
  3238. // "description": "The address to use for sorting the company's addresses by proximity.\nIf not given, the geo-located address of the request is used.\nUsed when order_by is set.",
  3239. // "location": "query",
  3240. // "type": "string"
  3241. // },
  3242. // "companyId": {
  3243. // "description": "The ID of the company to retrieve.",
  3244. // "location": "path",
  3245. // "required": true,
  3246. // "type": "string"
  3247. // },
  3248. // "currencyCode": {
  3249. // "description": "If the company's budget is in a different currency code than this one, then\nthe converted budget is converted to this currency code.",
  3250. // "location": "query",
  3251. // "type": "string"
  3252. // },
  3253. // "orderBy": {
  3254. // "description": "How to order addresses within the returned company. Currently, only\n`address` and `address desc` is supported which will sorted by closest to\nfarthest in distance from given address and farthest to closest distance\nfrom given address respectively.",
  3255. // "location": "query",
  3256. // "type": "string"
  3257. // },
  3258. // "requestMetadata.experimentIds": {
  3259. // "description": "Experiment IDs the current request belongs to.",
  3260. // "location": "query",
  3261. // "repeated": true,
  3262. // "type": "string"
  3263. // },
  3264. // "requestMetadata.locale": {
  3265. // "description": "Locale to use for the current request.",
  3266. // "location": "query",
  3267. // "type": "string"
  3268. // },
  3269. // "requestMetadata.partnersSessionId": {
  3270. // "description": "Google Partners session ID.",
  3271. // "location": "query",
  3272. // "type": "string"
  3273. // },
  3274. // "requestMetadata.trafficSource.trafficSourceId": {
  3275. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  3276. // "location": "query",
  3277. // "type": "string"
  3278. // },
  3279. // "requestMetadata.trafficSource.trafficSubId": {
  3280. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  3281. // "location": "query",
  3282. // "type": "string"
  3283. // },
  3284. // "requestMetadata.userOverrides.ipAddress": {
  3285. // "description": "IP address to use instead of the user's geo-located IP address.",
  3286. // "location": "query",
  3287. // "type": "string"
  3288. // },
  3289. // "requestMetadata.userOverrides.userId": {
  3290. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  3291. // "location": "query",
  3292. // "type": "string"
  3293. // },
  3294. // "view": {
  3295. // "description": "The view of `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.",
  3296. // "enum": [
  3297. // "COMPANY_VIEW_UNSPECIFIED",
  3298. // "CV_GOOGLE_PARTNER_SEARCH"
  3299. // ],
  3300. // "location": "query",
  3301. // "type": "string"
  3302. // }
  3303. // },
  3304. // "path": "v2/companies/{companyId}",
  3305. // "response": {
  3306. // "$ref": "GetCompanyResponse"
  3307. // }
  3308. // }
  3309. }
  3310. // method id "partners.companies.list":
  3311. type CompaniesListCall struct {
  3312. s *Service
  3313. urlParams_ gensupport.URLParams
  3314. ifNoneMatch_ string
  3315. ctx_ context.Context
  3316. header_ http.Header
  3317. }
  3318. // List: Lists companies.
  3319. func (r *CompaniesService) List() *CompaniesListCall {
  3320. c := &CompaniesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3321. return c
  3322. }
  3323. // Address sets the optional parameter "address": The address to use
  3324. // when searching for companies.
  3325. // If not given, the geo-located address of the request is used.
  3326. func (c *CompaniesListCall) Address(address string) *CompaniesListCall {
  3327. c.urlParams_.Set("address", address)
  3328. return c
  3329. }
  3330. // CompanyName sets the optional parameter "companyName": Company name
  3331. // to search for.
  3332. func (c *CompaniesListCall) CompanyName(companyName string) *CompaniesListCall {
  3333. c.urlParams_.Set("companyName", companyName)
  3334. return c
  3335. }
  3336. // GpsMotivations sets the optional parameter "gpsMotivations": List of
  3337. // reasons for using Google Partner Search to get companies.
  3338. //
  3339. // Possible values:
  3340. // "GPS_MOTIVATION_UNSPECIFIED"
  3341. // "GPSM_HELP_WITH_ADVERTISING"
  3342. // "GPSM_HELP_WITH_WEBSITE"
  3343. // "GPSM_NO_WEBSITE"
  3344. func (c *CompaniesListCall) GpsMotivations(gpsMotivations ...string) *CompaniesListCall {
  3345. c.urlParams_.SetMulti("gpsMotivations", append([]string{}, gpsMotivations...))
  3346. return c
  3347. }
  3348. // Industries sets the optional parameter "industries": List of
  3349. // industries the company can help with.
  3350. //
  3351. // Possible values:
  3352. // "INDUSTRY_UNSPECIFIED"
  3353. // "I_AUTOMOTIVE"
  3354. // "I_BUSINESS_TO_BUSINESS"
  3355. // "I_CONSUMER_PACKAGED_GOODS"
  3356. // "I_EDUCATION"
  3357. // "I_FINANCE"
  3358. // "I_HEALTHCARE"
  3359. // "I_MEDIA_AND_ENTERTAINMENT"
  3360. // "I_RETAIL"
  3361. // "I_TECHNOLOGY"
  3362. // "I_TRAVEL"
  3363. func (c *CompaniesListCall) Industries(industries ...string) *CompaniesListCall {
  3364. c.urlParams_.SetMulti("industries", append([]string{}, industries...))
  3365. return c
  3366. }
  3367. // LanguageCodes sets the optional parameter "languageCodes": List of
  3368. // language codes that company can support. Only primary
  3369. // language
  3370. // subtags are accepted as defined by
  3371. // <a href="https://tools.ietf.org/html/bcp47">BCP 47</a>
  3372. // (IETF BCP 47, "Tags for Identifying Languages").
  3373. func (c *CompaniesListCall) LanguageCodes(languageCodes ...string) *CompaniesListCall {
  3374. c.urlParams_.SetMulti("languageCodes", append([]string{}, languageCodes...))
  3375. return c
  3376. }
  3377. // MaxMonthlyBudgetCurrencyCode sets the optional parameter
  3378. // "maxMonthlyBudget.currencyCode": The 3-letter currency code defined
  3379. // in ISO 4217.
  3380. func (c *CompaniesListCall) MaxMonthlyBudgetCurrencyCode(maxMonthlyBudgetCurrencyCode string) *CompaniesListCall {
  3381. c.urlParams_.Set("maxMonthlyBudget.currencyCode", maxMonthlyBudgetCurrencyCode)
  3382. return c
  3383. }
  3384. // MaxMonthlyBudgetNanos sets the optional parameter
  3385. // "maxMonthlyBudget.nanos": Number of nano (10^-9) units of the
  3386. // amount.
  3387. // The value must be between -999,999,999 and +999,999,999 inclusive.
  3388. // If `units` is positive, `nanos` must be positive or zero.
  3389. // If `units` is zero, `nanos` can be positive, zero, or negative.
  3390. // If `units` is negative, `nanos` must be negative or zero.
  3391. // For example $-1.75 is represented as `units`=-1 and
  3392. // `nanos`=-750,000,000.
  3393. func (c *CompaniesListCall) MaxMonthlyBudgetNanos(maxMonthlyBudgetNanos int64) *CompaniesListCall {
  3394. c.urlParams_.Set("maxMonthlyBudget.nanos", fmt.Sprint(maxMonthlyBudgetNanos))
  3395. return c
  3396. }
  3397. // MaxMonthlyBudgetUnits sets the optional parameter
  3398. // "maxMonthlyBudget.units": The whole units of the amount.
  3399. // For example if `currencyCode` is "USD", then 1 unit is one US
  3400. // dollar.
  3401. func (c *CompaniesListCall) MaxMonthlyBudgetUnits(maxMonthlyBudgetUnits int64) *CompaniesListCall {
  3402. c.urlParams_.Set("maxMonthlyBudget.units", fmt.Sprint(maxMonthlyBudgetUnits))
  3403. return c
  3404. }
  3405. // MinMonthlyBudgetCurrencyCode sets the optional parameter
  3406. // "minMonthlyBudget.currencyCode": The 3-letter currency code defined
  3407. // in ISO 4217.
  3408. func (c *CompaniesListCall) MinMonthlyBudgetCurrencyCode(minMonthlyBudgetCurrencyCode string) *CompaniesListCall {
  3409. c.urlParams_.Set("minMonthlyBudget.currencyCode", minMonthlyBudgetCurrencyCode)
  3410. return c
  3411. }
  3412. // MinMonthlyBudgetNanos sets the optional parameter
  3413. // "minMonthlyBudget.nanos": Number of nano (10^-9) units of the
  3414. // amount.
  3415. // The value must be between -999,999,999 and +999,999,999 inclusive.
  3416. // If `units` is positive, `nanos` must be positive or zero.
  3417. // If `units` is zero, `nanos` can be positive, zero, or negative.
  3418. // If `units` is negative, `nanos` must be negative or zero.
  3419. // For example $-1.75 is represented as `units`=-1 and
  3420. // `nanos`=-750,000,000.
  3421. func (c *CompaniesListCall) MinMonthlyBudgetNanos(minMonthlyBudgetNanos int64) *CompaniesListCall {
  3422. c.urlParams_.Set("minMonthlyBudget.nanos", fmt.Sprint(minMonthlyBudgetNanos))
  3423. return c
  3424. }
  3425. // MinMonthlyBudgetUnits sets the optional parameter
  3426. // "minMonthlyBudget.units": The whole units of the amount.
  3427. // For example if `currencyCode` is "USD", then 1 unit is one US
  3428. // dollar.
  3429. func (c *CompaniesListCall) MinMonthlyBudgetUnits(minMonthlyBudgetUnits int64) *CompaniesListCall {
  3430. c.urlParams_.Set("minMonthlyBudget.units", fmt.Sprint(minMonthlyBudgetUnits))
  3431. return c
  3432. }
  3433. // OrderBy sets the optional parameter "orderBy": How to order addresses
  3434. // within the returned companies. Currently, only
  3435. // `address` and `address desc` is supported which will sorted by
  3436. // closest to
  3437. // farthest in distance from given address and farthest to closest
  3438. // distance
  3439. // from given address respectively.
  3440. func (c *CompaniesListCall) OrderBy(orderBy string) *CompaniesListCall {
  3441. c.urlParams_.Set("orderBy", orderBy)
  3442. return c
  3443. }
  3444. // PageSize sets the optional parameter "pageSize": Requested page size.
  3445. // Server may return fewer companies than requested.
  3446. // If unspecified, server picks an appropriate default.
  3447. func (c *CompaniesListCall) PageSize(pageSize int64) *CompaniesListCall {
  3448. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3449. return c
  3450. }
  3451. // PageToken sets the optional parameter "pageToken": A token
  3452. // identifying a page of results that the server returns.
  3453. // Typically, this is the value of
  3454. // `ListCompaniesResponse.next_page_token`
  3455. // returned from the previous call to
  3456. // ListCompanies.
  3457. func (c *CompaniesListCall) PageToken(pageToken string) *CompaniesListCall {
  3458. c.urlParams_.Set("pageToken", pageToken)
  3459. return c
  3460. }
  3461. // RequestMetadataExperimentIds sets the optional parameter
  3462. // "requestMetadata.experimentIds": Experiment IDs the current request
  3463. // belongs to.
  3464. func (c *CompaniesListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *CompaniesListCall {
  3465. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  3466. return c
  3467. }
  3468. // RequestMetadataLocale sets the optional parameter
  3469. // "requestMetadata.locale": Locale to use for the current request.
  3470. func (c *CompaniesListCall) RequestMetadataLocale(requestMetadataLocale string) *CompaniesListCall {
  3471. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  3472. return c
  3473. }
  3474. // RequestMetadataPartnersSessionId sets the optional parameter
  3475. // "requestMetadata.partnersSessionId": Google Partners session ID.
  3476. func (c *CompaniesListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *CompaniesListCall {
  3477. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  3478. return c
  3479. }
  3480. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  3481. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  3482. // to indicate where the traffic comes from.
  3483. // An identifier has multiple letters created by a team which redirected
  3484. // the
  3485. // traffic to us.
  3486. func (c *CompaniesListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *CompaniesListCall {
  3487. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  3488. return c
  3489. }
  3490. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  3491. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  3492. // to indicate where the traffic comes from.
  3493. // An identifier has multiple letters created by a team which redirected
  3494. // the
  3495. // traffic to us.
  3496. func (c *CompaniesListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *CompaniesListCall {
  3497. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  3498. return c
  3499. }
  3500. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  3501. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  3502. // of the user's geo-located IP address.
  3503. func (c *CompaniesListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *CompaniesListCall {
  3504. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  3505. return c
  3506. }
  3507. // RequestMetadataUserOverridesUserId sets the optional parameter
  3508. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  3509. // impersonate instead of the user's ID.
  3510. func (c *CompaniesListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *CompaniesListCall {
  3511. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  3512. return c
  3513. }
  3514. // Services sets the optional parameter "services": List of services
  3515. // that the returned agencies should provide. If this is
  3516. // not empty, any returned agency must have at least one of these
  3517. // services,
  3518. // or one of the specializations in the "specializations" field.
  3519. //
  3520. // Possible values:
  3521. // "SERVICE_UNSPECIFIED"
  3522. // "S_ADVANCED_ADWORDS_SUPPORT"
  3523. // "S_ADVERTISING_ON_GOOGLE"
  3524. // "S_AN_ENHANCED_WEBSITE"
  3525. // "S_AN_ONLINE_MARKETING_PLAN"
  3526. // "S_MOBILE_AND_VIDEO_ADS"
  3527. // "S_MOBILE_WEBSITE_SERVICES"
  3528. func (c *CompaniesListCall) Services(services ...string) *CompaniesListCall {
  3529. c.urlParams_.SetMulti("services", append([]string{}, services...))
  3530. return c
  3531. }
  3532. // Specializations sets the optional parameter "specializations": List
  3533. // of specializations that the returned agencies should provide. If
  3534. // this
  3535. // is not empty, any returned agency must have at least one of
  3536. // these
  3537. // specializations, or one of the services in the "services" field.
  3538. //
  3539. // Possible values:
  3540. // "BADGE_SPECIALIZATION_UNKNOWN"
  3541. // "BADGE_SPECIALIZATION_ADWORDS_SEARCH"
  3542. // "BADGE_SPECIALIZATION_ADWORDS_DISPLAY"
  3543. // "BADGE_SPECIALIZATION_ADWORDS_MOBILE"
  3544. // "BADGE_SPECIALIZATION_ADWORDS_VIDEO"
  3545. // "BADGE_SPECIALIZATION_ADWORDS_SHOPPING"
  3546. func (c *CompaniesListCall) Specializations(specializations ...string) *CompaniesListCall {
  3547. c.urlParams_.SetMulti("specializations", append([]string{}, specializations...))
  3548. return c
  3549. }
  3550. // View sets the optional parameter "view": The view of the `Company`
  3551. // resource to be returned. This must not be
  3552. // `COMPANY_VIEW_UNSPECIFIED`.
  3553. //
  3554. // Possible values:
  3555. // "COMPANY_VIEW_UNSPECIFIED"
  3556. // "CV_GOOGLE_PARTNER_SEARCH"
  3557. func (c *CompaniesListCall) View(view string) *CompaniesListCall {
  3558. c.urlParams_.Set("view", view)
  3559. return c
  3560. }
  3561. // WebsiteUrl sets the optional parameter "websiteUrl": Website URL that
  3562. // will help to find a better matched company.
  3563. // .
  3564. func (c *CompaniesListCall) WebsiteUrl(websiteUrl string) *CompaniesListCall {
  3565. c.urlParams_.Set("websiteUrl", websiteUrl)
  3566. return c
  3567. }
  3568. // Fields allows partial responses to be retrieved. See
  3569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3570. // for more information.
  3571. func (c *CompaniesListCall) Fields(s ...googleapi.Field) *CompaniesListCall {
  3572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3573. return c
  3574. }
  3575. // IfNoneMatch sets the optional parameter which makes the operation
  3576. // fail if the object's ETag matches the given value. This is useful for
  3577. // getting updates only after the object has changed since the last
  3578. // request. Use googleapi.IsNotModified to check whether the response
  3579. // error from Do is the result of In-None-Match.
  3580. func (c *CompaniesListCall) IfNoneMatch(entityTag string) *CompaniesListCall {
  3581. c.ifNoneMatch_ = entityTag
  3582. return c
  3583. }
  3584. // Context sets the context to be used in this call's Do method. Any
  3585. // pending HTTP request will be aborted if the provided context is
  3586. // canceled.
  3587. func (c *CompaniesListCall) Context(ctx context.Context) *CompaniesListCall {
  3588. c.ctx_ = ctx
  3589. return c
  3590. }
  3591. // Header returns an http.Header that can be modified by the caller to
  3592. // add HTTP headers to the request.
  3593. func (c *CompaniesListCall) Header() http.Header {
  3594. if c.header_ == nil {
  3595. c.header_ = make(http.Header)
  3596. }
  3597. return c.header_
  3598. }
  3599. func (c *CompaniesListCall) doRequest(alt string) (*http.Response, error) {
  3600. reqHeaders := make(http.Header)
  3601. for k, v := range c.header_ {
  3602. reqHeaders[k] = v
  3603. }
  3604. reqHeaders.Set("User-Agent", c.s.userAgent())
  3605. if c.ifNoneMatch_ != "" {
  3606. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3607. }
  3608. var body io.Reader = nil
  3609. c.urlParams_.Set("alt", alt)
  3610. c.urlParams_.Set("prettyPrint", "false")
  3611. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies")
  3612. urls += "?" + c.urlParams_.Encode()
  3613. req, err := http.NewRequest("GET", urls, body)
  3614. if err != nil {
  3615. return nil, err
  3616. }
  3617. req.Header = reqHeaders
  3618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3619. }
  3620. // Do executes the "partners.companies.list" call.
  3621. // Exactly one of *ListCompaniesResponse or error will be non-nil. Any
  3622. // non-2xx status code is an error. Response headers are in either
  3623. // *ListCompaniesResponse.ServerResponse.Header or (if a response was
  3624. // returned at all) in error.(*googleapi.Error).Header. Use
  3625. // googleapi.IsNotModified to check whether the returned error was
  3626. // because http.StatusNotModified was returned.
  3627. func (c *CompaniesListCall) Do(opts ...googleapi.CallOption) (*ListCompaniesResponse, error) {
  3628. gensupport.SetOptions(c.urlParams_, opts...)
  3629. res, err := c.doRequest("json")
  3630. if res != nil && res.StatusCode == http.StatusNotModified {
  3631. if res.Body != nil {
  3632. res.Body.Close()
  3633. }
  3634. return nil, &googleapi.Error{
  3635. Code: res.StatusCode,
  3636. Header: res.Header,
  3637. }
  3638. }
  3639. if err != nil {
  3640. return nil, err
  3641. }
  3642. defer googleapi.CloseBody(res)
  3643. if err := googleapi.CheckResponse(res); err != nil {
  3644. return nil, err
  3645. }
  3646. ret := &ListCompaniesResponse{
  3647. ServerResponse: googleapi.ServerResponse{
  3648. Header: res.Header,
  3649. HTTPStatusCode: res.StatusCode,
  3650. },
  3651. }
  3652. target := &ret
  3653. if err := gensupport.DecodeResponse(target, res); err != nil {
  3654. return nil, err
  3655. }
  3656. return ret, nil
  3657. // {
  3658. // "description": "Lists companies.",
  3659. // "flatPath": "v2/companies",
  3660. // "httpMethod": "GET",
  3661. // "id": "partners.companies.list",
  3662. // "parameterOrder": [],
  3663. // "parameters": {
  3664. // "address": {
  3665. // "description": "The address to use when searching for companies.\nIf not given, the geo-located address of the request is used.",
  3666. // "location": "query",
  3667. // "type": "string"
  3668. // },
  3669. // "companyName": {
  3670. // "description": "Company name to search for.",
  3671. // "location": "query",
  3672. // "type": "string"
  3673. // },
  3674. // "gpsMotivations": {
  3675. // "description": "List of reasons for using Google Partner Search to get companies.",
  3676. // "enum": [
  3677. // "GPS_MOTIVATION_UNSPECIFIED",
  3678. // "GPSM_HELP_WITH_ADVERTISING",
  3679. // "GPSM_HELP_WITH_WEBSITE",
  3680. // "GPSM_NO_WEBSITE"
  3681. // ],
  3682. // "location": "query",
  3683. // "repeated": true,
  3684. // "type": "string"
  3685. // },
  3686. // "industries": {
  3687. // "description": "List of industries the company can help with.",
  3688. // "enum": [
  3689. // "INDUSTRY_UNSPECIFIED",
  3690. // "I_AUTOMOTIVE",
  3691. // "I_BUSINESS_TO_BUSINESS",
  3692. // "I_CONSUMER_PACKAGED_GOODS",
  3693. // "I_EDUCATION",
  3694. // "I_FINANCE",
  3695. // "I_HEALTHCARE",
  3696. // "I_MEDIA_AND_ENTERTAINMENT",
  3697. // "I_RETAIL",
  3698. // "I_TECHNOLOGY",
  3699. // "I_TRAVEL"
  3700. // ],
  3701. // "location": "query",
  3702. // "repeated": true,
  3703. // "type": "string"
  3704. // },
  3705. // "languageCodes": {
  3706. // "description": "List of language codes that company can support. Only primary language\nsubtags are accepted as defined by\n\u003ca href=\"https://tools.ietf.org/html/bcp47\"\u003eBCP 47\u003c/a\u003e\n(IETF BCP 47, \"Tags for Identifying Languages\").",
  3707. // "location": "query",
  3708. // "repeated": true,
  3709. // "type": "string"
  3710. // },
  3711. // "maxMonthlyBudget.currencyCode": {
  3712. // "description": "The 3-letter currency code defined in ISO 4217.",
  3713. // "location": "query",
  3714. // "type": "string"
  3715. // },
  3716. // "maxMonthlyBudget.nanos": {
  3717. // "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.",
  3718. // "format": "int32",
  3719. // "location": "query",
  3720. // "type": "integer"
  3721. // },
  3722. // "maxMonthlyBudget.units": {
  3723. // "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.",
  3724. // "format": "int64",
  3725. // "location": "query",
  3726. // "type": "string"
  3727. // },
  3728. // "minMonthlyBudget.currencyCode": {
  3729. // "description": "The 3-letter currency code defined in ISO 4217.",
  3730. // "location": "query",
  3731. // "type": "string"
  3732. // },
  3733. // "minMonthlyBudget.nanos": {
  3734. // "description": "Number of nano (10^-9) units of the amount.\nThe value must be between -999,999,999 and +999,999,999 inclusive.\nIf `units` is positive, `nanos` must be positive or zero.\nIf `units` is zero, `nanos` can be positive, zero, or negative.\nIf `units` is negative, `nanos` must be negative or zero.\nFor example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.",
  3735. // "format": "int32",
  3736. // "location": "query",
  3737. // "type": "integer"
  3738. // },
  3739. // "minMonthlyBudget.units": {
  3740. // "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.",
  3741. // "format": "int64",
  3742. // "location": "query",
  3743. // "type": "string"
  3744. // },
  3745. // "orderBy": {
  3746. // "description": "How to order addresses within the returned companies. Currently, only\n`address` and `address desc` is supported which will sorted by closest to\nfarthest in distance from given address and farthest to closest distance\nfrom given address respectively.",
  3747. // "location": "query",
  3748. // "type": "string"
  3749. // },
  3750. // "pageSize": {
  3751. // "description": "Requested page size. Server may return fewer companies than requested.\nIf unspecified, server picks an appropriate default.",
  3752. // "format": "int32",
  3753. // "location": "query",
  3754. // "type": "integer"
  3755. // },
  3756. // "pageToken": {
  3757. // "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListCompaniesResponse.next_page_token`\nreturned from the previous call to\nListCompanies.",
  3758. // "location": "query",
  3759. // "type": "string"
  3760. // },
  3761. // "requestMetadata.experimentIds": {
  3762. // "description": "Experiment IDs the current request belongs to.",
  3763. // "location": "query",
  3764. // "repeated": true,
  3765. // "type": "string"
  3766. // },
  3767. // "requestMetadata.locale": {
  3768. // "description": "Locale to use for the current request.",
  3769. // "location": "query",
  3770. // "type": "string"
  3771. // },
  3772. // "requestMetadata.partnersSessionId": {
  3773. // "description": "Google Partners session ID.",
  3774. // "location": "query",
  3775. // "type": "string"
  3776. // },
  3777. // "requestMetadata.trafficSource.trafficSourceId": {
  3778. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  3779. // "location": "query",
  3780. // "type": "string"
  3781. // },
  3782. // "requestMetadata.trafficSource.trafficSubId": {
  3783. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  3784. // "location": "query",
  3785. // "type": "string"
  3786. // },
  3787. // "requestMetadata.userOverrides.ipAddress": {
  3788. // "description": "IP address to use instead of the user's geo-located IP address.",
  3789. // "location": "query",
  3790. // "type": "string"
  3791. // },
  3792. // "requestMetadata.userOverrides.userId": {
  3793. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  3794. // "location": "query",
  3795. // "type": "string"
  3796. // },
  3797. // "services": {
  3798. // "description": "List of services that the returned agencies should provide. If this is\nnot empty, any returned agency must have at least one of these services,\nor one of the specializations in the \"specializations\" field.",
  3799. // "enum": [
  3800. // "SERVICE_UNSPECIFIED",
  3801. // "S_ADVANCED_ADWORDS_SUPPORT",
  3802. // "S_ADVERTISING_ON_GOOGLE",
  3803. // "S_AN_ENHANCED_WEBSITE",
  3804. // "S_AN_ONLINE_MARKETING_PLAN",
  3805. // "S_MOBILE_AND_VIDEO_ADS",
  3806. // "S_MOBILE_WEBSITE_SERVICES"
  3807. // ],
  3808. // "location": "query",
  3809. // "repeated": true,
  3810. // "type": "string"
  3811. // },
  3812. // "specializations": {
  3813. // "description": "List of specializations that the returned agencies should provide. If this\nis not empty, any returned agency must have at least one of these\nspecializations, or one of the services in the \"services\" field.",
  3814. // "enum": [
  3815. // "BADGE_SPECIALIZATION_UNKNOWN",
  3816. // "BADGE_SPECIALIZATION_ADWORDS_SEARCH",
  3817. // "BADGE_SPECIALIZATION_ADWORDS_DISPLAY",
  3818. // "BADGE_SPECIALIZATION_ADWORDS_MOBILE",
  3819. // "BADGE_SPECIALIZATION_ADWORDS_VIDEO",
  3820. // "BADGE_SPECIALIZATION_ADWORDS_SHOPPING"
  3821. // ],
  3822. // "location": "query",
  3823. // "repeated": true,
  3824. // "type": "string"
  3825. // },
  3826. // "view": {
  3827. // "description": "The view of the `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.",
  3828. // "enum": [
  3829. // "COMPANY_VIEW_UNSPECIFIED",
  3830. // "CV_GOOGLE_PARTNER_SEARCH"
  3831. // ],
  3832. // "location": "query",
  3833. // "type": "string"
  3834. // },
  3835. // "websiteUrl": {
  3836. // "description": "Website URL that will help to find a better matched company.\n.",
  3837. // "location": "query",
  3838. // "type": "string"
  3839. // }
  3840. // },
  3841. // "path": "v2/companies",
  3842. // "response": {
  3843. // "$ref": "ListCompaniesResponse"
  3844. // }
  3845. // }
  3846. }
  3847. // Pages invokes f for each page of results.
  3848. // A non-nil error returned from f will halt the iteration.
  3849. // The provided context supersedes any context provided to the Context method.
  3850. func (c *CompaniesListCall) Pages(ctx context.Context, f func(*ListCompaniesResponse) error) error {
  3851. c.ctx_ = ctx
  3852. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3853. for {
  3854. x, err := c.Do()
  3855. if err != nil {
  3856. return err
  3857. }
  3858. if err := f(x); err != nil {
  3859. return err
  3860. }
  3861. if x.NextPageToken == "" {
  3862. return nil
  3863. }
  3864. c.PageToken(x.NextPageToken)
  3865. }
  3866. }
  3867. // method id "partners.companies.leads.create":
  3868. type CompaniesLeadsCreateCall struct {
  3869. s *Service
  3870. companyId string
  3871. createleadrequest *CreateLeadRequest
  3872. urlParams_ gensupport.URLParams
  3873. ctx_ context.Context
  3874. header_ http.Header
  3875. }
  3876. // Create: Creates an advertiser lead for the given company ID.
  3877. func (r *CompaniesLeadsService) Create(companyId string, createleadrequest *CreateLeadRequest) *CompaniesLeadsCreateCall {
  3878. c := &CompaniesLeadsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3879. c.companyId = companyId
  3880. c.createleadrequest = createleadrequest
  3881. return c
  3882. }
  3883. // Fields allows partial responses to be retrieved. See
  3884. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3885. // for more information.
  3886. func (c *CompaniesLeadsCreateCall) Fields(s ...googleapi.Field) *CompaniesLeadsCreateCall {
  3887. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3888. return c
  3889. }
  3890. // Context sets the context to be used in this call's Do method. Any
  3891. // pending HTTP request will be aborted if the provided context is
  3892. // canceled.
  3893. func (c *CompaniesLeadsCreateCall) Context(ctx context.Context) *CompaniesLeadsCreateCall {
  3894. c.ctx_ = ctx
  3895. return c
  3896. }
  3897. // Header returns an http.Header that can be modified by the caller to
  3898. // add HTTP headers to the request.
  3899. func (c *CompaniesLeadsCreateCall) Header() http.Header {
  3900. if c.header_ == nil {
  3901. c.header_ = make(http.Header)
  3902. }
  3903. return c.header_
  3904. }
  3905. func (c *CompaniesLeadsCreateCall) doRequest(alt string) (*http.Response, error) {
  3906. reqHeaders := make(http.Header)
  3907. for k, v := range c.header_ {
  3908. reqHeaders[k] = v
  3909. }
  3910. reqHeaders.Set("User-Agent", c.s.userAgent())
  3911. var body io.Reader = nil
  3912. body, err := googleapi.WithoutDataWrapper.JSONReader(c.createleadrequest)
  3913. if err != nil {
  3914. return nil, err
  3915. }
  3916. reqHeaders.Set("Content-Type", "application/json")
  3917. c.urlParams_.Set("alt", alt)
  3918. c.urlParams_.Set("prettyPrint", "false")
  3919. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies/{companyId}/leads")
  3920. urls += "?" + c.urlParams_.Encode()
  3921. req, err := http.NewRequest("POST", urls, body)
  3922. if err != nil {
  3923. return nil, err
  3924. }
  3925. req.Header = reqHeaders
  3926. googleapi.Expand(req.URL, map[string]string{
  3927. "companyId": c.companyId,
  3928. })
  3929. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3930. }
  3931. // Do executes the "partners.companies.leads.create" call.
  3932. // Exactly one of *CreateLeadResponse or error will be non-nil. Any
  3933. // non-2xx status code is an error. Response headers are in either
  3934. // *CreateLeadResponse.ServerResponse.Header or (if a response was
  3935. // returned at all) in error.(*googleapi.Error).Header. Use
  3936. // googleapi.IsNotModified to check whether the returned error was
  3937. // because http.StatusNotModified was returned.
  3938. func (c *CompaniesLeadsCreateCall) Do(opts ...googleapi.CallOption) (*CreateLeadResponse, error) {
  3939. gensupport.SetOptions(c.urlParams_, opts...)
  3940. res, err := c.doRequest("json")
  3941. if res != nil && res.StatusCode == http.StatusNotModified {
  3942. if res.Body != nil {
  3943. res.Body.Close()
  3944. }
  3945. return nil, &googleapi.Error{
  3946. Code: res.StatusCode,
  3947. Header: res.Header,
  3948. }
  3949. }
  3950. if err != nil {
  3951. return nil, err
  3952. }
  3953. defer googleapi.CloseBody(res)
  3954. if err := googleapi.CheckResponse(res); err != nil {
  3955. return nil, err
  3956. }
  3957. ret := &CreateLeadResponse{
  3958. ServerResponse: googleapi.ServerResponse{
  3959. Header: res.Header,
  3960. HTTPStatusCode: res.StatusCode,
  3961. },
  3962. }
  3963. target := &ret
  3964. if err := gensupport.DecodeResponse(target, res); err != nil {
  3965. return nil, err
  3966. }
  3967. return ret, nil
  3968. // {
  3969. // "description": "Creates an advertiser lead for the given company ID.",
  3970. // "flatPath": "v2/companies/{companyId}/leads",
  3971. // "httpMethod": "POST",
  3972. // "id": "partners.companies.leads.create",
  3973. // "parameterOrder": [
  3974. // "companyId"
  3975. // ],
  3976. // "parameters": {
  3977. // "companyId": {
  3978. // "description": "The ID of the company to contact.",
  3979. // "location": "path",
  3980. // "required": true,
  3981. // "type": "string"
  3982. // }
  3983. // },
  3984. // "path": "v2/companies/{companyId}/leads",
  3985. // "request": {
  3986. // "$ref": "CreateLeadRequest"
  3987. // },
  3988. // "response": {
  3989. // "$ref": "CreateLeadResponse"
  3990. // }
  3991. // }
  3992. }
  3993. // method id "partners.leads.list":
  3994. type LeadsListCall struct {
  3995. s *Service
  3996. urlParams_ gensupport.URLParams
  3997. ifNoneMatch_ string
  3998. ctx_ context.Context
  3999. header_ http.Header
  4000. }
  4001. // List: Lists advertiser leads for a user's associated company.
  4002. // Should only be called within the context of an authorized logged in
  4003. // user.
  4004. func (r *LeadsService) List() *LeadsListCall {
  4005. c := &LeadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4006. return c
  4007. }
  4008. // OrderBy sets the optional parameter "orderBy": How to order Leads.
  4009. // Currently, only `create_time`
  4010. // and `create_time desc` are supported
  4011. func (c *LeadsListCall) OrderBy(orderBy string) *LeadsListCall {
  4012. c.urlParams_.Set("orderBy", orderBy)
  4013. return c
  4014. }
  4015. // PageSize sets the optional parameter "pageSize": Requested page size.
  4016. // Server may return fewer leads than requested.
  4017. // If unspecified, server picks an appropriate default.
  4018. func (c *LeadsListCall) PageSize(pageSize int64) *LeadsListCall {
  4019. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4020. return c
  4021. }
  4022. // PageToken sets the optional parameter "pageToken": A token
  4023. // identifying a page of results that the server returns.
  4024. // Typically, this is the value of
  4025. // `ListLeadsResponse.next_page_token`
  4026. // returned from the previous call to
  4027. // ListLeads.
  4028. func (c *LeadsListCall) PageToken(pageToken string) *LeadsListCall {
  4029. c.urlParams_.Set("pageToken", pageToken)
  4030. return c
  4031. }
  4032. // RequestMetadataExperimentIds sets the optional parameter
  4033. // "requestMetadata.experimentIds": Experiment IDs the current request
  4034. // belongs to.
  4035. func (c *LeadsListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *LeadsListCall {
  4036. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  4037. return c
  4038. }
  4039. // RequestMetadataLocale sets the optional parameter
  4040. // "requestMetadata.locale": Locale to use for the current request.
  4041. func (c *LeadsListCall) RequestMetadataLocale(requestMetadataLocale string) *LeadsListCall {
  4042. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  4043. return c
  4044. }
  4045. // RequestMetadataPartnersSessionId sets the optional parameter
  4046. // "requestMetadata.partnersSessionId": Google Partners session ID.
  4047. func (c *LeadsListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *LeadsListCall {
  4048. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  4049. return c
  4050. }
  4051. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  4052. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  4053. // to indicate where the traffic comes from.
  4054. // An identifier has multiple letters created by a team which redirected
  4055. // the
  4056. // traffic to us.
  4057. func (c *LeadsListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *LeadsListCall {
  4058. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  4059. return c
  4060. }
  4061. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  4062. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  4063. // to indicate where the traffic comes from.
  4064. // An identifier has multiple letters created by a team which redirected
  4065. // the
  4066. // traffic to us.
  4067. func (c *LeadsListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *LeadsListCall {
  4068. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  4069. return c
  4070. }
  4071. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  4072. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  4073. // of the user's geo-located IP address.
  4074. func (c *LeadsListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *LeadsListCall {
  4075. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  4076. return c
  4077. }
  4078. // RequestMetadataUserOverridesUserId sets the optional parameter
  4079. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  4080. // impersonate instead of the user's ID.
  4081. func (c *LeadsListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *LeadsListCall {
  4082. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  4083. return c
  4084. }
  4085. // Fields allows partial responses to be retrieved. See
  4086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4087. // for more information.
  4088. func (c *LeadsListCall) Fields(s ...googleapi.Field) *LeadsListCall {
  4089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4090. return c
  4091. }
  4092. // IfNoneMatch sets the optional parameter which makes the operation
  4093. // fail if the object's ETag matches the given value. This is useful for
  4094. // getting updates only after the object has changed since the last
  4095. // request. Use googleapi.IsNotModified to check whether the response
  4096. // error from Do is the result of In-None-Match.
  4097. func (c *LeadsListCall) IfNoneMatch(entityTag string) *LeadsListCall {
  4098. c.ifNoneMatch_ = entityTag
  4099. return c
  4100. }
  4101. // Context sets the context to be used in this call's Do method. Any
  4102. // pending HTTP request will be aborted if the provided context is
  4103. // canceled.
  4104. func (c *LeadsListCall) Context(ctx context.Context) *LeadsListCall {
  4105. c.ctx_ = ctx
  4106. return c
  4107. }
  4108. // Header returns an http.Header that can be modified by the caller to
  4109. // add HTTP headers to the request.
  4110. func (c *LeadsListCall) Header() http.Header {
  4111. if c.header_ == nil {
  4112. c.header_ = make(http.Header)
  4113. }
  4114. return c.header_
  4115. }
  4116. func (c *LeadsListCall) doRequest(alt string) (*http.Response, error) {
  4117. reqHeaders := make(http.Header)
  4118. for k, v := range c.header_ {
  4119. reqHeaders[k] = v
  4120. }
  4121. reqHeaders.Set("User-Agent", c.s.userAgent())
  4122. if c.ifNoneMatch_ != "" {
  4123. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4124. }
  4125. var body io.Reader = nil
  4126. c.urlParams_.Set("alt", alt)
  4127. c.urlParams_.Set("prettyPrint", "false")
  4128. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/leads")
  4129. urls += "?" + c.urlParams_.Encode()
  4130. req, err := http.NewRequest("GET", urls, body)
  4131. if err != nil {
  4132. return nil, err
  4133. }
  4134. req.Header = reqHeaders
  4135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4136. }
  4137. // Do executes the "partners.leads.list" call.
  4138. // Exactly one of *ListLeadsResponse or error will be non-nil. Any
  4139. // non-2xx status code is an error. Response headers are in either
  4140. // *ListLeadsResponse.ServerResponse.Header or (if a response was
  4141. // returned at all) in error.(*googleapi.Error).Header. Use
  4142. // googleapi.IsNotModified to check whether the returned error was
  4143. // because http.StatusNotModified was returned.
  4144. func (c *LeadsListCall) Do(opts ...googleapi.CallOption) (*ListLeadsResponse, error) {
  4145. gensupport.SetOptions(c.urlParams_, opts...)
  4146. res, err := c.doRequest("json")
  4147. if res != nil && res.StatusCode == http.StatusNotModified {
  4148. if res.Body != nil {
  4149. res.Body.Close()
  4150. }
  4151. return nil, &googleapi.Error{
  4152. Code: res.StatusCode,
  4153. Header: res.Header,
  4154. }
  4155. }
  4156. if err != nil {
  4157. return nil, err
  4158. }
  4159. defer googleapi.CloseBody(res)
  4160. if err := googleapi.CheckResponse(res); err != nil {
  4161. return nil, err
  4162. }
  4163. ret := &ListLeadsResponse{
  4164. ServerResponse: googleapi.ServerResponse{
  4165. Header: res.Header,
  4166. HTTPStatusCode: res.StatusCode,
  4167. },
  4168. }
  4169. target := &ret
  4170. if err := gensupport.DecodeResponse(target, res); err != nil {
  4171. return nil, err
  4172. }
  4173. return ret, nil
  4174. // {
  4175. // "description": "Lists advertiser leads for a user's associated company.\nShould only be called within the context of an authorized logged in user.",
  4176. // "flatPath": "v2/leads",
  4177. // "httpMethod": "GET",
  4178. // "id": "partners.leads.list",
  4179. // "parameterOrder": [],
  4180. // "parameters": {
  4181. // "orderBy": {
  4182. // "description": "How to order Leads. Currently, only `create_time`\nand `create_time desc` are supported",
  4183. // "location": "query",
  4184. // "type": "string"
  4185. // },
  4186. // "pageSize": {
  4187. // "description": "Requested page size. Server may return fewer leads than requested.\nIf unspecified, server picks an appropriate default.",
  4188. // "format": "int32",
  4189. // "location": "query",
  4190. // "type": "integer"
  4191. // },
  4192. // "pageToken": {
  4193. // "description": "A token identifying a page of results that the server returns.\nTypically, this is the value of `ListLeadsResponse.next_page_token`\nreturned from the previous call to\nListLeads.",
  4194. // "location": "query",
  4195. // "type": "string"
  4196. // },
  4197. // "requestMetadata.experimentIds": {
  4198. // "description": "Experiment IDs the current request belongs to.",
  4199. // "location": "query",
  4200. // "repeated": true,
  4201. // "type": "string"
  4202. // },
  4203. // "requestMetadata.locale": {
  4204. // "description": "Locale to use for the current request.",
  4205. // "location": "query",
  4206. // "type": "string"
  4207. // },
  4208. // "requestMetadata.partnersSessionId": {
  4209. // "description": "Google Partners session ID.",
  4210. // "location": "query",
  4211. // "type": "string"
  4212. // },
  4213. // "requestMetadata.trafficSource.trafficSourceId": {
  4214. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  4215. // "location": "query",
  4216. // "type": "string"
  4217. // },
  4218. // "requestMetadata.trafficSource.trafficSubId": {
  4219. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  4220. // "location": "query",
  4221. // "type": "string"
  4222. // },
  4223. // "requestMetadata.userOverrides.ipAddress": {
  4224. // "description": "IP address to use instead of the user's geo-located IP address.",
  4225. // "location": "query",
  4226. // "type": "string"
  4227. // },
  4228. // "requestMetadata.userOverrides.userId": {
  4229. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  4230. // "location": "query",
  4231. // "type": "string"
  4232. // }
  4233. // },
  4234. // "path": "v2/leads",
  4235. // "response": {
  4236. // "$ref": "ListLeadsResponse"
  4237. // }
  4238. // }
  4239. }
  4240. // Pages invokes f for each page of results.
  4241. // A non-nil error returned from f will halt the iteration.
  4242. // The provided context supersedes any context provided to the Context method.
  4243. func (c *LeadsListCall) Pages(ctx context.Context, f func(*ListLeadsResponse) error) error {
  4244. c.ctx_ = ctx
  4245. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4246. for {
  4247. x, err := c.Do()
  4248. if err != nil {
  4249. return err
  4250. }
  4251. if err := f(x); err != nil {
  4252. return err
  4253. }
  4254. if x.NextPageToken == "" {
  4255. return nil
  4256. }
  4257. c.PageToken(x.NextPageToken)
  4258. }
  4259. }
  4260. // method id "partners.offers.list":
  4261. type OffersListCall struct {
  4262. s *Service
  4263. urlParams_ gensupport.URLParams
  4264. ifNoneMatch_ string
  4265. ctx_ context.Context
  4266. header_ http.Header
  4267. }
  4268. // List: Lists the Offers available for the current user
  4269. func (r *OffersService) List() *OffersListCall {
  4270. c := &OffersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4271. return c
  4272. }
  4273. // RequestMetadataExperimentIds sets the optional parameter
  4274. // "requestMetadata.experimentIds": Experiment IDs the current request
  4275. // belongs to.
  4276. func (c *OffersListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *OffersListCall {
  4277. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  4278. return c
  4279. }
  4280. // RequestMetadataLocale sets the optional parameter
  4281. // "requestMetadata.locale": Locale to use for the current request.
  4282. func (c *OffersListCall) RequestMetadataLocale(requestMetadataLocale string) *OffersListCall {
  4283. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  4284. return c
  4285. }
  4286. // RequestMetadataPartnersSessionId sets the optional parameter
  4287. // "requestMetadata.partnersSessionId": Google Partners session ID.
  4288. func (c *OffersListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *OffersListCall {
  4289. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  4290. return c
  4291. }
  4292. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  4293. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  4294. // to indicate where the traffic comes from.
  4295. // An identifier has multiple letters created by a team which redirected
  4296. // the
  4297. // traffic to us.
  4298. func (c *OffersListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *OffersListCall {
  4299. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  4300. return c
  4301. }
  4302. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  4303. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  4304. // to indicate where the traffic comes from.
  4305. // An identifier has multiple letters created by a team which redirected
  4306. // the
  4307. // traffic to us.
  4308. func (c *OffersListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *OffersListCall {
  4309. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  4310. return c
  4311. }
  4312. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  4313. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  4314. // of the user's geo-located IP address.
  4315. func (c *OffersListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *OffersListCall {
  4316. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  4317. return c
  4318. }
  4319. // RequestMetadataUserOverridesUserId sets the optional parameter
  4320. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  4321. // impersonate instead of the user's ID.
  4322. func (c *OffersListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *OffersListCall {
  4323. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  4324. return c
  4325. }
  4326. // Fields allows partial responses to be retrieved. See
  4327. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4328. // for more information.
  4329. func (c *OffersListCall) Fields(s ...googleapi.Field) *OffersListCall {
  4330. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4331. return c
  4332. }
  4333. // IfNoneMatch sets the optional parameter which makes the operation
  4334. // fail if the object's ETag matches the given value. This is useful for
  4335. // getting updates only after the object has changed since the last
  4336. // request. Use googleapi.IsNotModified to check whether the response
  4337. // error from Do is the result of In-None-Match.
  4338. func (c *OffersListCall) IfNoneMatch(entityTag string) *OffersListCall {
  4339. c.ifNoneMatch_ = entityTag
  4340. return c
  4341. }
  4342. // Context sets the context to be used in this call's Do method. Any
  4343. // pending HTTP request will be aborted if the provided context is
  4344. // canceled.
  4345. func (c *OffersListCall) Context(ctx context.Context) *OffersListCall {
  4346. c.ctx_ = ctx
  4347. return c
  4348. }
  4349. // Header returns an http.Header that can be modified by the caller to
  4350. // add HTTP headers to the request.
  4351. func (c *OffersListCall) Header() http.Header {
  4352. if c.header_ == nil {
  4353. c.header_ = make(http.Header)
  4354. }
  4355. return c.header_
  4356. }
  4357. func (c *OffersListCall) doRequest(alt string) (*http.Response, error) {
  4358. reqHeaders := make(http.Header)
  4359. for k, v := range c.header_ {
  4360. reqHeaders[k] = v
  4361. }
  4362. reqHeaders.Set("User-Agent", c.s.userAgent())
  4363. if c.ifNoneMatch_ != "" {
  4364. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4365. }
  4366. var body io.Reader = nil
  4367. c.urlParams_.Set("alt", alt)
  4368. c.urlParams_.Set("prettyPrint", "false")
  4369. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/offers")
  4370. urls += "?" + c.urlParams_.Encode()
  4371. req, err := http.NewRequest("GET", urls, body)
  4372. if err != nil {
  4373. return nil, err
  4374. }
  4375. req.Header = reqHeaders
  4376. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4377. }
  4378. // Do executes the "partners.offers.list" call.
  4379. // Exactly one of *ListOffersResponse or error will be non-nil. Any
  4380. // non-2xx status code is an error. Response headers are in either
  4381. // *ListOffersResponse.ServerResponse.Header or (if a response was
  4382. // returned at all) in error.(*googleapi.Error).Header. Use
  4383. // googleapi.IsNotModified to check whether the returned error was
  4384. // because http.StatusNotModified was returned.
  4385. func (c *OffersListCall) Do(opts ...googleapi.CallOption) (*ListOffersResponse, error) {
  4386. gensupport.SetOptions(c.urlParams_, opts...)
  4387. res, err := c.doRequest("json")
  4388. if res != nil && res.StatusCode == http.StatusNotModified {
  4389. if res.Body != nil {
  4390. res.Body.Close()
  4391. }
  4392. return nil, &googleapi.Error{
  4393. Code: res.StatusCode,
  4394. Header: res.Header,
  4395. }
  4396. }
  4397. if err != nil {
  4398. return nil, err
  4399. }
  4400. defer googleapi.CloseBody(res)
  4401. if err := googleapi.CheckResponse(res); err != nil {
  4402. return nil, err
  4403. }
  4404. ret := &ListOffersResponse{
  4405. ServerResponse: googleapi.ServerResponse{
  4406. Header: res.Header,
  4407. HTTPStatusCode: res.StatusCode,
  4408. },
  4409. }
  4410. target := &ret
  4411. if err := gensupport.DecodeResponse(target, res); err != nil {
  4412. return nil, err
  4413. }
  4414. return ret, nil
  4415. // {
  4416. // "description": "Lists the Offers available for the current user",
  4417. // "flatPath": "v2/offers",
  4418. // "httpMethod": "GET",
  4419. // "id": "partners.offers.list",
  4420. // "parameterOrder": [],
  4421. // "parameters": {
  4422. // "requestMetadata.experimentIds": {
  4423. // "description": "Experiment IDs the current request belongs to.",
  4424. // "location": "query",
  4425. // "repeated": true,
  4426. // "type": "string"
  4427. // },
  4428. // "requestMetadata.locale": {
  4429. // "description": "Locale to use for the current request.",
  4430. // "location": "query",
  4431. // "type": "string"
  4432. // },
  4433. // "requestMetadata.partnersSessionId": {
  4434. // "description": "Google Partners session ID.",
  4435. // "location": "query",
  4436. // "type": "string"
  4437. // },
  4438. // "requestMetadata.trafficSource.trafficSourceId": {
  4439. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  4440. // "location": "query",
  4441. // "type": "string"
  4442. // },
  4443. // "requestMetadata.trafficSource.trafficSubId": {
  4444. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  4445. // "location": "query",
  4446. // "type": "string"
  4447. // },
  4448. // "requestMetadata.userOverrides.ipAddress": {
  4449. // "description": "IP address to use instead of the user's geo-located IP address.",
  4450. // "location": "query",
  4451. // "type": "string"
  4452. // },
  4453. // "requestMetadata.userOverrides.userId": {
  4454. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  4455. // "location": "query",
  4456. // "type": "string"
  4457. // }
  4458. // },
  4459. // "path": "v2/offers",
  4460. // "response": {
  4461. // "$ref": "ListOffersResponse"
  4462. // }
  4463. // }
  4464. }
  4465. // method id "partners.offers.history.list":
  4466. type OffersHistoryListCall struct {
  4467. s *Service
  4468. urlParams_ gensupport.URLParams
  4469. ifNoneMatch_ string
  4470. ctx_ context.Context
  4471. header_ http.Header
  4472. }
  4473. // List: Lists the Historical Offers for the current user (or user's
  4474. // entire company)
  4475. func (r *OffersHistoryService) List() *OffersHistoryListCall {
  4476. c := &OffersHistoryListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4477. return c
  4478. }
  4479. // EntireCompany sets the optional parameter "entireCompany": if true,
  4480. // show history for the entire company. Requires user to be admin.
  4481. func (c *OffersHistoryListCall) EntireCompany(entireCompany bool) *OffersHistoryListCall {
  4482. c.urlParams_.Set("entireCompany", fmt.Sprint(entireCompany))
  4483. return c
  4484. }
  4485. // OrderBy sets the optional parameter "orderBy": Comma-separated list
  4486. // of fields to order by, e.g.: "foo,bar,baz".
  4487. // Use "foo desc" to sort descending.
  4488. // List of valid field names is: name, offer_code, expiration_time,
  4489. // status,
  4490. // last_modified_time, sender_name, creation_time, country_code,
  4491. // offer_type.
  4492. func (c *OffersHistoryListCall) OrderBy(orderBy string) *OffersHistoryListCall {
  4493. c.urlParams_.Set("orderBy", orderBy)
  4494. return c
  4495. }
  4496. // PageSize sets the optional parameter "pageSize": Maximum number of
  4497. // rows to return per page.
  4498. func (c *OffersHistoryListCall) PageSize(pageSize int64) *OffersHistoryListCall {
  4499. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4500. return c
  4501. }
  4502. // PageToken sets the optional parameter "pageToken": Token to retrieve
  4503. // a specific page.
  4504. func (c *OffersHistoryListCall) PageToken(pageToken string) *OffersHistoryListCall {
  4505. c.urlParams_.Set("pageToken", pageToken)
  4506. return c
  4507. }
  4508. // RequestMetadataExperimentIds sets the optional parameter
  4509. // "requestMetadata.experimentIds": Experiment IDs the current request
  4510. // belongs to.
  4511. func (c *OffersHistoryListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *OffersHistoryListCall {
  4512. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  4513. return c
  4514. }
  4515. // RequestMetadataLocale sets the optional parameter
  4516. // "requestMetadata.locale": Locale to use for the current request.
  4517. func (c *OffersHistoryListCall) RequestMetadataLocale(requestMetadataLocale string) *OffersHistoryListCall {
  4518. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  4519. return c
  4520. }
  4521. // RequestMetadataPartnersSessionId sets the optional parameter
  4522. // "requestMetadata.partnersSessionId": Google Partners session ID.
  4523. func (c *OffersHistoryListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *OffersHistoryListCall {
  4524. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  4525. return c
  4526. }
  4527. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  4528. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  4529. // to indicate where the traffic comes from.
  4530. // An identifier has multiple letters created by a team which redirected
  4531. // the
  4532. // traffic to us.
  4533. func (c *OffersHistoryListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *OffersHistoryListCall {
  4534. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  4535. return c
  4536. }
  4537. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  4538. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  4539. // to indicate where the traffic comes from.
  4540. // An identifier has multiple letters created by a team which redirected
  4541. // the
  4542. // traffic to us.
  4543. func (c *OffersHistoryListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *OffersHistoryListCall {
  4544. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  4545. return c
  4546. }
  4547. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  4548. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  4549. // of the user's geo-located IP address.
  4550. func (c *OffersHistoryListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *OffersHistoryListCall {
  4551. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  4552. return c
  4553. }
  4554. // RequestMetadataUserOverridesUserId sets the optional parameter
  4555. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  4556. // impersonate instead of the user's ID.
  4557. func (c *OffersHistoryListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *OffersHistoryListCall {
  4558. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  4559. return c
  4560. }
  4561. // Fields allows partial responses to be retrieved. See
  4562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4563. // for more information.
  4564. func (c *OffersHistoryListCall) Fields(s ...googleapi.Field) *OffersHistoryListCall {
  4565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4566. return c
  4567. }
  4568. // IfNoneMatch sets the optional parameter which makes the operation
  4569. // fail if the object's ETag matches the given value. This is useful for
  4570. // getting updates only after the object has changed since the last
  4571. // request. Use googleapi.IsNotModified to check whether the response
  4572. // error from Do is the result of In-None-Match.
  4573. func (c *OffersHistoryListCall) IfNoneMatch(entityTag string) *OffersHistoryListCall {
  4574. c.ifNoneMatch_ = entityTag
  4575. return c
  4576. }
  4577. // Context sets the context to be used in this call's Do method. Any
  4578. // pending HTTP request will be aborted if the provided context is
  4579. // canceled.
  4580. func (c *OffersHistoryListCall) Context(ctx context.Context) *OffersHistoryListCall {
  4581. c.ctx_ = ctx
  4582. return c
  4583. }
  4584. // Header returns an http.Header that can be modified by the caller to
  4585. // add HTTP headers to the request.
  4586. func (c *OffersHistoryListCall) Header() http.Header {
  4587. if c.header_ == nil {
  4588. c.header_ = make(http.Header)
  4589. }
  4590. return c.header_
  4591. }
  4592. func (c *OffersHistoryListCall) doRequest(alt string) (*http.Response, error) {
  4593. reqHeaders := make(http.Header)
  4594. for k, v := range c.header_ {
  4595. reqHeaders[k] = v
  4596. }
  4597. reqHeaders.Set("User-Agent", c.s.userAgent())
  4598. if c.ifNoneMatch_ != "" {
  4599. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4600. }
  4601. var body io.Reader = nil
  4602. c.urlParams_.Set("alt", alt)
  4603. c.urlParams_.Set("prettyPrint", "false")
  4604. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/offers/history")
  4605. urls += "?" + c.urlParams_.Encode()
  4606. req, err := http.NewRequest("GET", urls, body)
  4607. if err != nil {
  4608. return nil, err
  4609. }
  4610. req.Header = reqHeaders
  4611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4612. }
  4613. // Do executes the "partners.offers.history.list" call.
  4614. // Exactly one of *ListOffersHistoryResponse or error will be non-nil.
  4615. // Any non-2xx status code is an error. Response headers are in either
  4616. // *ListOffersHistoryResponse.ServerResponse.Header or (if a response
  4617. // was returned at all) in error.(*googleapi.Error).Header. Use
  4618. // googleapi.IsNotModified to check whether the returned error was
  4619. // because http.StatusNotModified was returned.
  4620. func (c *OffersHistoryListCall) Do(opts ...googleapi.CallOption) (*ListOffersHistoryResponse, error) {
  4621. gensupport.SetOptions(c.urlParams_, opts...)
  4622. res, err := c.doRequest("json")
  4623. if res != nil && res.StatusCode == http.StatusNotModified {
  4624. if res.Body != nil {
  4625. res.Body.Close()
  4626. }
  4627. return nil, &googleapi.Error{
  4628. Code: res.StatusCode,
  4629. Header: res.Header,
  4630. }
  4631. }
  4632. if err != nil {
  4633. return nil, err
  4634. }
  4635. defer googleapi.CloseBody(res)
  4636. if err := googleapi.CheckResponse(res); err != nil {
  4637. return nil, err
  4638. }
  4639. ret := &ListOffersHistoryResponse{
  4640. ServerResponse: googleapi.ServerResponse{
  4641. Header: res.Header,
  4642. HTTPStatusCode: res.StatusCode,
  4643. },
  4644. }
  4645. target := &ret
  4646. if err := gensupport.DecodeResponse(target, res); err != nil {
  4647. return nil, err
  4648. }
  4649. return ret, nil
  4650. // {
  4651. // "description": "Lists the Historical Offers for the current user (or user's entire company)",
  4652. // "flatPath": "v2/offers/history",
  4653. // "httpMethod": "GET",
  4654. // "id": "partners.offers.history.list",
  4655. // "parameterOrder": [],
  4656. // "parameters": {
  4657. // "entireCompany": {
  4658. // "description": "if true, show history for the entire company. Requires user to be admin.",
  4659. // "location": "query",
  4660. // "type": "boolean"
  4661. // },
  4662. // "orderBy": {
  4663. // "description": "Comma-separated list of fields to order by, e.g.: \"foo,bar,baz\".\nUse \"foo desc\" to sort descending.\nList of valid field names is: name, offer_code, expiration_time, status,\n last_modified_time, sender_name, creation_time, country_code,\n offer_type.",
  4664. // "location": "query",
  4665. // "type": "string"
  4666. // },
  4667. // "pageSize": {
  4668. // "description": "Maximum number of rows to return per page.",
  4669. // "format": "int32",
  4670. // "location": "query",
  4671. // "type": "integer"
  4672. // },
  4673. // "pageToken": {
  4674. // "description": "Token to retrieve a specific page.",
  4675. // "location": "query",
  4676. // "type": "string"
  4677. // },
  4678. // "requestMetadata.experimentIds": {
  4679. // "description": "Experiment IDs the current request belongs to.",
  4680. // "location": "query",
  4681. // "repeated": true,
  4682. // "type": "string"
  4683. // },
  4684. // "requestMetadata.locale": {
  4685. // "description": "Locale to use for the current request.",
  4686. // "location": "query",
  4687. // "type": "string"
  4688. // },
  4689. // "requestMetadata.partnersSessionId": {
  4690. // "description": "Google Partners session ID.",
  4691. // "location": "query",
  4692. // "type": "string"
  4693. // },
  4694. // "requestMetadata.trafficSource.trafficSourceId": {
  4695. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  4696. // "location": "query",
  4697. // "type": "string"
  4698. // },
  4699. // "requestMetadata.trafficSource.trafficSubId": {
  4700. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  4701. // "location": "query",
  4702. // "type": "string"
  4703. // },
  4704. // "requestMetadata.userOverrides.ipAddress": {
  4705. // "description": "IP address to use instead of the user's geo-located IP address.",
  4706. // "location": "query",
  4707. // "type": "string"
  4708. // },
  4709. // "requestMetadata.userOverrides.userId": {
  4710. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  4711. // "location": "query",
  4712. // "type": "string"
  4713. // }
  4714. // },
  4715. // "path": "v2/offers/history",
  4716. // "response": {
  4717. // "$ref": "ListOffersHistoryResponse"
  4718. // }
  4719. // }
  4720. }
  4721. // Pages invokes f for each page of results.
  4722. // A non-nil error returned from f will halt the iteration.
  4723. // The provided context supersedes any context provided to the Context method.
  4724. func (c *OffersHistoryListCall) Pages(ctx context.Context, f func(*ListOffersHistoryResponse) error) error {
  4725. c.ctx_ = ctx
  4726. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4727. for {
  4728. x, err := c.Do()
  4729. if err != nil {
  4730. return err
  4731. }
  4732. if err := f(x); err != nil {
  4733. return err
  4734. }
  4735. if x.NextPageToken == "" {
  4736. return nil
  4737. }
  4738. c.PageToken(x.NextPageToken)
  4739. }
  4740. }
  4741. // method id "partners.userEvents.log":
  4742. type UserEventsLogCall struct {
  4743. s *Service
  4744. logusereventrequest *LogUserEventRequest
  4745. urlParams_ gensupport.URLParams
  4746. ctx_ context.Context
  4747. header_ http.Header
  4748. }
  4749. // Log: Logs a user event.
  4750. func (r *UserEventsService) Log(logusereventrequest *LogUserEventRequest) *UserEventsLogCall {
  4751. c := &UserEventsLogCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4752. c.logusereventrequest = logusereventrequest
  4753. return c
  4754. }
  4755. // Fields allows partial responses to be retrieved. See
  4756. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4757. // for more information.
  4758. func (c *UserEventsLogCall) Fields(s ...googleapi.Field) *UserEventsLogCall {
  4759. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4760. return c
  4761. }
  4762. // Context sets the context to be used in this call's Do method. Any
  4763. // pending HTTP request will be aborted if the provided context is
  4764. // canceled.
  4765. func (c *UserEventsLogCall) Context(ctx context.Context) *UserEventsLogCall {
  4766. c.ctx_ = ctx
  4767. return c
  4768. }
  4769. // Header returns an http.Header that can be modified by the caller to
  4770. // add HTTP headers to the request.
  4771. func (c *UserEventsLogCall) Header() http.Header {
  4772. if c.header_ == nil {
  4773. c.header_ = make(http.Header)
  4774. }
  4775. return c.header_
  4776. }
  4777. func (c *UserEventsLogCall) doRequest(alt string) (*http.Response, error) {
  4778. reqHeaders := make(http.Header)
  4779. for k, v := range c.header_ {
  4780. reqHeaders[k] = v
  4781. }
  4782. reqHeaders.Set("User-Agent", c.s.userAgent())
  4783. var body io.Reader = nil
  4784. body, err := googleapi.WithoutDataWrapper.JSONReader(c.logusereventrequest)
  4785. if err != nil {
  4786. return nil, err
  4787. }
  4788. reqHeaders.Set("Content-Type", "application/json")
  4789. c.urlParams_.Set("alt", alt)
  4790. c.urlParams_.Set("prettyPrint", "false")
  4791. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/userEvents:log")
  4792. urls += "?" + c.urlParams_.Encode()
  4793. req, err := http.NewRequest("POST", urls, body)
  4794. if err != nil {
  4795. return nil, err
  4796. }
  4797. req.Header = reqHeaders
  4798. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4799. }
  4800. // Do executes the "partners.userEvents.log" call.
  4801. // Exactly one of *LogUserEventResponse or error will be non-nil. Any
  4802. // non-2xx status code is an error. Response headers are in either
  4803. // *LogUserEventResponse.ServerResponse.Header or (if a response was
  4804. // returned at all) in error.(*googleapi.Error).Header. Use
  4805. // googleapi.IsNotModified to check whether the returned error was
  4806. // because http.StatusNotModified was returned.
  4807. func (c *UserEventsLogCall) Do(opts ...googleapi.CallOption) (*LogUserEventResponse, error) {
  4808. gensupport.SetOptions(c.urlParams_, opts...)
  4809. res, err := c.doRequest("json")
  4810. if res != nil && res.StatusCode == http.StatusNotModified {
  4811. if res.Body != nil {
  4812. res.Body.Close()
  4813. }
  4814. return nil, &googleapi.Error{
  4815. Code: res.StatusCode,
  4816. Header: res.Header,
  4817. }
  4818. }
  4819. if err != nil {
  4820. return nil, err
  4821. }
  4822. defer googleapi.CloseBody(res)
  4823. if err := googleapi.CheckResponse(res); err != nil {
  4824. return nil, err
  4825. }
  4826. ret := &LogUserEventResponse{
  4827. ServerResponse: googleapi.ServerResponse{
  4828. Header: res.Header,
  4829. HTTPStatusCode: res.StatusCode,
  4830. },
  4831. }
  4832. target := &ret
  4833. if err := gensupport.DecodeResponse(target, res); err != nil {
  4834. return nil, err
  4835. }
  4836. return ret, nil
  4837. // {
  4838. // "description": "Logs a user event.",
  4839. // "flatPath": "v2/userEvents:log",
  4840. // "httpMethod": "POST",
  4841. // "id": "partners.userEvents.log",
  4842. // "parameterOrder": [],
  4843. // "parameters": {},
  4844. // "path": "v2/userEvents:log",
  4845. // "request": {
  4846. // "$ref": "LogUserEventRequest"
  4847. // },
  4848. // "response": {
  4849. // "$ref": "LogUserEventResponse"
  4850. // }
  4851. // }
  4852. }
  4853. // method id "partners.userStates.list":
  4854. type UserStatesListCall struct {
  4855. s *Service
  4856. urlParams_ gensupport.URLParams
  4857. ifNoneMatch_ string
  4858. ctx_ context.Context
  4859. header_ http.Header
  4860. }
  4861. // List: Lists states for current user.
  4862. func (r *UserStatesService) List() *UserStatesListCall {
  4863. c := &UserStatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4864. return c
  4865. }
  4866. // RequestMetadataExperimentIds sets the optional parameter
  4867. // "requestMetadata.experimentIds": Experiment IDs the current request
  4868. // belongs to.
  4869. func (c *UserStatesListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UserStatesListCall {
  4870. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  4871. return c
  4872. }
  4873. // RequestMetadataLocale sets the optional parameter
  4874. // "requestMetadata.locale": Locale to use for the current request.
  4875. func (c *UserStatesListCall) RequestMetadataLocale(requestMetadataLocale string) *UserStatesListCall {
  4876. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  4877. return c
  4878. }
  4879. // RequestMetadataPartnersSessionId sets the optional parameter
  4880. // "requestMetadata.partnersSessionId": Google Partners session ID.
  4881. func (c *UserStatesListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UserStatesListCall {
  4882. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  4883. return c
  4884. }
  4885. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  4886. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  4887. // to indicate where the traffic comes from.
  4888. // An identifier has multiple letters created by a team which redirected
  4889. // the
  4890. // traffic to us.
  4891. func (c *UserStatesListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UserStatesListCall {
  4892. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  4893. return c
  4894. }
  4895. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  4896. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  4897. // to indicate where the traffic comes from.
  4898. // An identifier has multiple letters created by a team which redirected
  4899. // the
  4900. // traffic to us.
  4901. func (c *UserStatesListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UserStatesListCall {
  4902. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  4903. return c
  4904. }
  4905. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  4906. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  4907. // of the user's geo-located IP address.
  4908. func (c *UserStatesListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UserStatesListCall {
  4909. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  4910. return c
  4911. }
  4912. // RequestMetadataUserOverridesUserId sets the optional parameter
  4913. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  4914. // impersonate instead of the user's ID.
  4915. func (c *UserStatesListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UserStatesListCall {
  4916. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  4917. return c
  4918. }
  4919. // Fields allows partial responses to be retrieved. See
  4920. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4921. // for more information.
  4922. func (c *UserStatesListCall) Fields(s ...googleapi.Field) *UserStatesListCall {
  4923. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4924. return c
  4925. }
  4926. // IfNoneMatch sets the optional parameter which makes the operation
  4927. // fail if the object's ETag matches the given value. This is useful for
  4928. // getting updates only after the object has changed since the last
  4929. // request. Use googleapi.IsNotModified to check whether the response
  4930. // error from Do is the result of In-None-Match.
  4931. func (c *UserStatesListCall) IfNoneMatch(entityTag string) *UserStatesListCall {
  4932. c.ifNoneMatch_ = entityTag
  4933. return c
  4934. }
  4935. // Context sets the context to be used in this call's Do method. Any
  4936. // pending HTTP request will be aborted if the provided context is
  4937. // canceled.
  4938. func (c *UserStatesListCall) Context(ctx context.Context) *UserStatesListCall {
  4939. c.ctx_ = ctx
  4940. return c
  4941. }
  4942. // Header returns an http.Header that can be modified by the caller to
  4943. // add HTTP headers to the request.
  4944. func (c *UserStatesListCall) Header() http.Header {
  4945. if c.header_ == nil {
  4946. c.header_ = make(http.Header)
  4947. }
  4948. return c.header_
  4949. }
  4950. func (c *UserStatesListCall) doRequest(alt string) (*http.Response, error) {
  4951. reqHeaders := make(http.Header)
  4952. for k, v := range c.header_ {
  4953. reqHeaders[k] = v
  4954. }
  4955. reqHeaders.Set("User-Agent", c.s.userAgent())
  4956. if c.ifNoneMatch_ != "" {
  4957. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4958. }
  4959. var body io.Reader = nil
  4960. c.urlParams_.Set("alt", alt)
  4961. c.urlParams_.Set("prettyPrint", "false")
  4962. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/userStates")
  4963. urls += "?" + c.urlParams_.Encode()
  4964. req, err := http.NewRequest("GET", urls, body)
  4965. if err != nil {
  4966. return nil, err
  4967. }
  4968. req.Header = reqHeaders
  4969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4970. }
  4971. // Do executes the "partners.userStates.list" call.
  4972. // Exactly one of *ListUserStatesResponse or error will be non-nil. Any
  4973. // non-2xx status code is an error. Response headers are in either
  4974. // *ListUserStatesResponse.ServerResponse.Header or (if a response was
  4975. // returned at all) in error.(*googleapi.Error).Header. Use
  4976. // googleapi.IsNotModified to check whether the returned error was
  4977. // because http.StatusNotModified was returned.
  4978. func (c *UserStatesListCall) Do(opts ...googleapi.CallOption) (*ListUserStatesResponse, error) {
  4979. gensupport.SetOptions(c.urlParams_, opts...)
  4980. res, err := c.doRequest("json")
  4981. if res != nil && res.StatusCode == http.StatusNotModified {
  4982. if res.Body != nil {
  4983. res.Body.Close()
  4984. }
  4985. return nil, &googleapi.Error{
  4986. Code: res.StatusCode,
  4987. Header: res.Header,
  4988. }
  4989. }
  4990. if err != nil {
  4991. return nil, err
  4992. }
  4993. defer googleapi.CloseBody(res)
  4994. if err := googleapi.CheckResponse(res); err != nil {
  4995. return nil, err
  4996. }
  4997. ret := &ListUserStatesResponse{
  4998. ServerResponse: googleapi.ServerResponse{
  4999. Header: res.Header,
  5000. HTTPStatusCode: res.StatusCode,
  5001. },
  5002. }
  5003. target := &ret
  5004. if err := gensupport.DecodeResponse(target, res); err != nil {
  5005. return nil, err
  5006. }
  5007. return ret, nil
  5008. // {
  5009. // "description": "Lists states for current user.",
  5010. // "flatPath": "v2/userStates",
  5011. // "httpMethod": "GET",
  5012. // "id": "partners.userStates.list",
  5013. // "parameterOrder": [],
  5014. // "parameters": {
  5015. // "requestMetadata.experimentIds": {
  5016. // "description": "Experiment IDs the current request belongs to.",
  5017. // "location": "query",
  5018. // "repeated": true,
  5019. // "type": "string"
  5020. // },
  5021. // "requestMetadata.locale": {
  5022. // "description": "Locale to use for the current request.",
  5023. // "location": "query",
  5024. // "type": "string"
  5025. // },
  5026. // "requestMetadata.partnersSessionId": {
  5027. // "description": "Google Partners session ID.",
  5028. // "location": "query",
  5029. // "type": "string"
  5030. // },
  5031. // "requestMetadata.trafficSource.trafficSourceId": {
  5032. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5033. // "location": "query",
  5034. // "type": "string"
  5035. // },
  5036. // "requestMetadata.trafficSource.trafficSubId": {
  5037. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5038. // "location": "query",
  5039. // "type": "string"
  5040. // },
  5041. // "requestMetadata.userOverrides.ipAddress": {
  5042. // "description": "IP address to use instead of the user's geo-located IP address.",
  5043. // "location": "query",
  5044. // "type": "string"
  5045. // },
  5046. // "requestMetadata.userOverrides.userId": {
  5047. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  5048. // "location": "query",
  5049. // "type": "string"
  5050. // }
  5051. // },
  5052. // "path": "v2/userStates",
  5053. // "response": {
  5054. // "$ref": "ListUserStatesResponse"
  5055. // }
  5056. // }
  5057. }
  5058. // method id "partners.users.createCompanyRelation":
  5059. type UsersCreateCompanyRelationCall struct {
  5060. s *Service
  5061. userId string
  5062. companyrelation *CompanyRelation
  5063. urlParams_ gensupport.URLParams
  5064. ctx_ context.Context
  5065. header_ http.Header
  5066. }
  5067. // CreateCompanyRelation: Creates a user's company relation. Affiliates
  5068. // the user to a company.
  5069. func (r *UsersService) CreateCompanyRelation(userId string, companyrelation *CompanyRelation) *UsersCreateCompanyRelationCall {
  5070. c := &UsersCreateCompanyRelationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5071. c.userId = userId
  5072. c.companyrelation = companyrelation
  5073. return c
  5074. }
  5075. // RequestMetadataExperimentIds sets the optional parameter
  5076. // "requestMetadata.experimentIds": Experiment IDs the current request
  5077. // belongs to.
  5078. func (c *UsersCreateCompanyRelationCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersCreateCompanyRelationCall {
  5079. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  5080. return c
  5081. }
  5082. // RequestMetadataLocale sets the optional parameter
  5083. // "requestMetadata.locale": Locale to use for the current request.
  5084. func (c *UsersCreateCompanyRelationCall) RequestMetadataLocale(requestMetadataLocale string) *UsersCreateCompanyRelationCall {
  5085. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  5086. return c
  5087. }
  5088. // RequestMetadataPartnersSessionId sets the optional parameter
  5089. // "requestMetadata.partnersSessionId": Google Partners session ID.
  5090. func (c *UsersCreateCompanyRelationCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersCreateCompanyRelationCall {
  5091. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  5092. return c
  5093. }
  5094. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  5095. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  5096. // to indicate where the traffic comes from.
  5097. // An identifier has multiple letters created by a team which redirected
  5098. // the
  5099. // traffic to us.
  5100. func (c *UsersCreateCompanyRelationCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersCreateCompanyRelationCall {
  5101. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  5102. return c
  5103. }
  5104. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  5105. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  5106. // to indicate where the traffic comes from.
  5107. // An identifier has multiple letters created by a team which redirected
  5108. // the
  5109. // traffic to us.
  5110. func (c *UsersCreateCompanyRelationCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersCreateCompanyRelationCall {
  5111. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  5112. return c
  5113. }
  5114. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  5115. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  5116. // of the user's geo-located IP address.
  5117. func (c *UsersCreateCompanyRelationCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersCreateCompanyRelationCall {
  5118. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  5119. return c
  5120. }
  5121. // RequestMetadataUserOverridesUserId sets the optional parameter
  5122. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  5123. // impersonate instead of the user's ID.
  5124. func (c *UsersCreateCompanyRelationCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersCreateCompanyRelationCall {
  5125. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  5126. return c
  5127. }
  5128. // Fields allows partial responses to be retrieved. See
  5129. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5130. // for more information.
  5131. func (c *UsersCreateCompanyRelationCall) Fields(s ...googleapi.Field) *UsersCreateCompanyRelationCall {
  5132. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5133. return c
  5134. }
  5135. // Context sets the context to be used in this call's Do method. Any
  5136. // pending HTTP request will be aborted if the provided context is
  5137. // canceled.
  5138. func (c *UsersCreateCompanyRelationCall) Context(ctx context.Context) *UsersCreateCompanyRelationCall {
  5139. c.ctx_ = ctx
  5140. return c
  5141. }
  5142. // Header returns an http.Header that can be modified by the caller to
  5143. // add HTTP headers to the request.
  5144. func (c *UsersCreateCompanyRelationCall) Header() http.Header {
  5145. if c.header_ == nil {
  5146. c.header_ = make(http.Header)
  5147. }
  5148. return c.header_
  5149. }
  5150. func (c *UsersCreateCompanyRelationCall) doRequest(alt string) (*http.Response, error) {
  5151. reqHeaders := make(http.Header)
  5152. for k, v := range c.header_ {
  5153. reqHeaders[k] = v
  5154. }
  5155. reqHeaders.Set("User-Agent", c.s.userAgent())
  5156. var body io.Reader = nil
  5157. body, err := googleapi.WithoutDataWrapper.JSONReader(c.companyrelation)
  5158. if err != nil {
  5159. return nil, err
  5160. }
  5161. reqHeaders.Set("Content-Type", "application/json")
  5162. c.urlParams_.Set("alt", alt)
  5163. c.urlParams_.Set("prettyPrint", "false")
  5164. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/companyRelation")
  5165. urls += "?" + c.urlParams_.Encode()
  5166. req, err := http.NewRequest("PUT", urls, body)
  5167. if err != nil {
  5168. return nil, err
  5169. }
  5170. req.Header = reqHeaders
  5171. googleapi.Expand(req.URL, map[string]string{
  5172. "userId": c.userId,
  5173. })
  5174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5175. }
  5176. // Do executes the "partners.users.createCompanyRelation" call.
  5177. // Exactly one of *CompanyRelation or error will be non-nil. Any non-2xx
  5178. // status code is an error. Response headers are in either
  5179. // *CompanyRelation.ServerResponse.Header or (if a response was returned
  5180. // at all) in error.(*googleapi.Error).Header. Use
  5181. // googleapi.IsNotModified to check whether the returned error was
  5182. // because http.StatusNotModified was returned.
  5183. func (c *UsersCreateCompanyRelationCall) Do(opts ...googleapi.CallOption) (*CompanyRelation, error) {
  5184. gensupport.SetOptions(c.urlParams_, opts...)
  5185. res, err := c.doRequest("json")
  5186. if res != nil && res.StatusCode == http.StatusNotModified {
  5187. if res.Body != nil {
  5188. res.Body.Close()
  5189. }
  5190. return nil, &googleapi.Error{
  5191. Code: res.StatusCode,
  5192. Header: res.Header,
  5193. }
  5194. }
  5195. if err != nil {
  5196. return nil, err
  5197. }
  5198. defer googleapi.CloseBody(res)
  5199. if err := googleapi.CheckResponse(res); err != nil {
  5200. return nil, err
  5201. }
  5202. ret := &CompanyRelation{
  5203. ServerResponse: googleapi.ServerResponse{
  5204. Header: res.Header,
  5205. HTTPStatusCode: res.StatusCode,
  5206. },
  5207. }
  5208. target := &ret
  5209. if err := gensupport.DecodeResponse(target, res); err != nil {
  5210. return nil, err
  5211. }
  5212. return ret, nil
  5213. // {
  5214. // "description": "Creates a user's company relation. Affiliates the user to a company.",
  5215. // "flatPath": "v2/users/{userId}/companyRelation",
  5216. // "httpMethod": "PUT",
  5217. // "id": "partners.users.createCompanyRelation",
  5218. // "parameterOrder": [
  5219. // "userId"
  5220. // ],
  5221. // "parameters": {
  5222. // "requestMetadata.experimentIds": {
  5223. // "description": "Experiment IDs the current request belongs to.",
  5224. // "location": "query",
  5225. // "repeated": true,
  5226. // "type": "string"
  5227. // },
  5228. // "requestMetadata.locale": {
  5229. // "description": "Locale to use for the current request.",
  5230. // "location": "query",
  5231. // "type": "string"
  5232. // },
  5233. // "requestMetadata.partnersSessionId": {
  5234. // "description": "Google Partners session ID.",
  5235. // "location": "query",
  5236. // "type": "string"
  5237. // },
  5238. // "requestMetadata.trafficSource.trafficSourceId": {
  5239. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5240. // "location": "query",
  5241. // "type": "string"
  5242. // },
  5243. // "requestMetadata.trafficSource.trafficSubId": {
  5244. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5245. // "location": "query",
  5246. // "type": "string"
  5247. // },
  5248. // "requestMetadata.userOverrides.ipAddress": {
  5249. // "description": "IP address to use instead of the user's geo-located IP address.",
  5250. // "location": "query",
  5251. // "type": "string"
  5252. // },
  5253. // "requestMetadata.userOverrides.userId": {
  5254. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  5255. // "location": "query",
  5256. // "type": "string"
  5257. // },
  5258. // "userId": {
  5259. // "description": "The ID of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean\nthe currently authenticated user.",
  5260. // "location": "path",
  5261. // "required": true,
  5262. // "type": "string"
  5263. // }
  5264. // },
  5265. // "path": "v2/users/{userId}/companyRelation",
  5266. // "request": {
  5267. // "$ref": "CompanyRelation"
  5268. // },
  5269. // "response": {
  5270. // "$ref": "CompanyRelation"
  5271. // }
  5272. // }
  5273. }
  5274. // method id "partners.users.deleteCompanyRelation":
  5275. type UsersDeleteCompanyRelationCall struct {
  5276. s *Service
  5277. userId string
  5278. urlParams_ gensupport.URLParams
  5279. ctx_ context.Context
  5280. header_ http.Header
  5281. }
  5282. // DeleteCompanyRelation: Deletes a user's company relation.
  5283. // Unaffiliaites the user from a company.
  5284. func (r *UsersService) DeleteCompanyRelation(userId string) *UsersDeleteCompanyRelationCall {
  5285. c := &UsersDeleteCompanyRelationCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5286. c.userId = userId
  5287. return c
  5288. }
  5289. // RequestMetadataExperimentIds sets the optional parameter
  5290. // "requestMetadata.experimentIds": Experiment IDs the current request
  5291. // belongs to.
  5292. func (c *UsersDeleteCompanyRelationCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersDeleteCompanyRelationCall {
  5293. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  5294. return c
  5295. }
  5296. // RequestMetadataLocale sets the optional parameter
  5297. // "requestMetadata.locale": Locale to use for the current request.
  5298. func (c *UsersDeleteCompanyRelationCall) RequestMetadataLocale(requestMetadataLocale string) *UsersDeleteCompanyRelationCall {
  5299. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  5300. return c
  5301. }
  5302. // RequestMetadataPartnersSessionId sets the optional parameter
  5303. // "requestMetadata.partnersSessionId": Google Partners session ID.
  5304. func (c *UsersDeleteCompanyRelationCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersDeleteCompanyRelationCall {
  5305. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  5306. return c
  5307. }
  5308. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  5309. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  5310. // to indicate where the traffic comes from.
  5311. // An identifier has multiple letters created by a team which redirected
  5312. // the
  5313. // traffic to us.
  5314. func (c *UsersDeleteCompanyRelationCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersDeleteCompanyRelationCall {
  5315. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  5316. return c
  5317. }
  5318. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  5319. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  5320. // to indicate where the traffic comes from.
  5321. // An identifier has multiple letters created by a team which redirected
  5322. // the
  5323. // traffic to us.
  5324. func (c *UsersDeleteCompanyRelationCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersDeleteCompanyRelationCall {
  5325. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  5326. return c
  5327. }
  5328. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  5329. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  5330. // of the user's geo-located IP address.
  5331. func (c *UsersDeleteCompanyRelationCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersDeleteCompanyRelationCall {
  5332. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  5333. return c
  5334. }
  5335. // RequestMetadataUserOverridesUserId sets the optional parameter
  5336. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  5337. // impersonate instead of the user's ID.
  5338. func (c *UsersDeleteCompanyRelationCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersDeleteCompanyRelationCall {
  5339. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  5340. return c
  5341. }
  5342. // Fields allows partial responses to be retrieved. See
  5343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5344. // for more information.
  5345. func (c *UsersDeleteCompanyRelationCall) Fields(s ...googleapi.Field) *UsersDeleteCompanyRelationCall {
  5346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5347. return c
  5348. }
  5349. // Context sets the context to be used in this call's Do method. Any
  5350. // pending HTTP request will be aborted if the provided context is
  5351. // canceled.
  5352. func (c *UsersDeleteCompanyRelationCall) Context(ctx context.Context) *UsersDeleteCompanyRelationCall {
  5353. c.ctx_ = ctx
  5354. return c
  5355. }
  5356. // Header returns an http.Header that can be modified by the caller to
  5357. // add HTTP headers to the request.
  5358. func (c *UsersDeleteCompanyRelationCall) Header() http.Header {
  5359. if c.header_ == nil {
  5360. c.header_ = make(http.Header)
  5361. }
  5362. return c.header_
  5363. }
  5364. func (c *UsersDeleteCompanyRelationCall) doRequest(alt string) (*http.Response, error) {
  5365. reqHeaders := make(http.Header)
  5366. for k, v := range c.header_ {
  5367. reqHeaders[k] = v
  5368. }
  5369. reqHeaders.Set("User-Agent", c.s.userAgent())
  5370. var body io.Reader = nil
  5371. c.urlParams_.Set("alt", alt)
  5372. c.urlParams_.Set("prettyPrint", "false")
  5373. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/companyRelation")
  5374. urls += "?" + c.urlParams_.Encode()
  5375. req, err := http.NewRequest("DELETE", urls, body)
  5376. if err != nil {
  5377. return nil, err
  5378. }
  5379. req.Header = reqHeaders
  5380. googleapi.Expand(req.URL, map[string]string{
  5381. "userId": c.userId,
  5382. })
  5383. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5384. }
  5385. // Do executes the "partners.users.deleteCompanyRelation" call.
  5386. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5387. // code is an error. Response headers are in either
  5388. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5389. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5390. // check whether the returned error was because http.StatusNotModified
  5391. // was returned.
  5392. func (c *UsersDeleteCompanyRelationCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5393. gensupport.SetOptions(c.urlParams_, opts...)
  5394. res, err := c.doRequest("json")
  5395. if res != nil && res.StatusCode == http.StatusNotModified {
  5396. if res.Body != nil {
  5397. res.Body.Close()
  5398. }
  5399. return nil, &googleapi.Error{
  5400. Code: res.StatusCode,
  5401. Header: res.Header,
  5402. }
  5403. }
  5404. if err != nil {
  5405. return nil, err
  5406. }
  5407. defer googleapi.CloseBody(res)
  5408. if err := googleapi.CheckResponse(res); err != nil {
  5409. return nil, err
  5410. }
  5411. ret := &Empty{
  5412. ServerResponse: googleapi.ServerResponse{
  5413. Header: res.Header,
  5414. HTTPStatusCode: res.StatusCode,
  5415. },
  5416. }
  5417. target := &ret
  5418. if err := gensupport.DecodeResponse(target, res); err != nil {
  5419. return nil, err
  5420. }
  5421. return ret, nil
  5422. // {
  5423. // "description": "Deletes a user's company relation. Unaffiliaites the user from a company.",
  5424. // "flatPath": "v2/users/{userId}/companyRelation",
  5425. // "httpMethod": "DELETE",
  5426. // "id": "partners.users.deleteCompanyRelation",
  5427. // "parameterOrder": [
  5428. // "userId"
  5429. // ],
  5430. // "parameters": {
  5431. // "requestMetadata.experimentIds": {
  5432. // "description": "Experiment IDs the current request belongs to.",
  5433. // "location": "query",
  5434. // "repeated": true,
  5435. // "type": "string"
  5436. // },
  5437. // "requestMetadata.locale": {
  5438. // "description": "Locale to use for the current request.",
  5439. // "location": "query",
  5440. // "type": "string"
  5441. // },
  5442. // "requestMetadata.partnersSessionId": {
  5443. // "description": "Google Partners session ID.",
  5444. // "location": "query",
  5445. // "type": "string"
  5446. // },
  5447. // "requestMetadata.trafficSource.trafficSourceId": {
  5448. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5449. // "location": "query",
  5450. // "type": "string"
  5451. // },
  5452. // "requestMetadata.trafficSource.trafficSubId": {
  5453. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5454. // "location": "query",
  5455. // "type": "string"
  5456. // },
  5457. // "requestMetadata.userOverrides.ipAddress": {
  5458. // "description": "IP address to use instead of the user's geo-located IP address.",
  5459. // "location": "query",
  5460. // "type": "string"
  5461. // },
  5462. // "requestMetadata.userOverrides.userId": {
  5463. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  5464. // "location": "query",
  5465. // "type": "string"
  5466. // },
  5467. // "userId": {
  5468. // "description": "The ID of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean\nthe currently authenticated user.",
  5469. // "location": "path",
  5470. // "required": true,
  5471. // "type": "string"
  5472. // }
  5473. // },
  5474. // "path": "v2/users/{userId}/companyRelation",
  5475. // "response": {
  5476. // "$ref": "Empty"
  5477. // }
  5478. // }
  5479. }
  5480. // method id "partners.users.get":
  5481. type UsersGetCall struct {
  5482. s *Service
  5483. userId string
  5484. urlParams_ gensupport.URLParams
  5485. ifNoneMatch_ string
  5486. ctx_ context.Context
  5487. header_ http.Header
  5488. }
  5489. // Get: Gets a user.
  5490. func (r *UsersService) Get(userId string) *UsersGetCall {
  5491. c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5492. c.userId = userId
  5493. return c
  5494. }
  5495. // RequestMetadataExperimentIds sets the optional parameter
  5496. // "requestMetadata.experimentIds": Experiment IDs the current request
  5497. // belongs to.
  5498. func (c *UsersGetCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersGetCall {
  5499. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  5500. return c
  5501. }
  5502. // RequestMetadataLocale sets the optional parameter
  5503. // "requestMetadata.locale": Locale to use for the current request.
  5504. func (c *UsersGetCall) RequestMetadataLocale(requestMetadataLocale string) *UsersGetCall {
  5505. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  5506. return c
  5507. }
  5508. // RequestMetadataPartnersSessionId sets the optional parameter
  5509. // "requestMetadata.partnersSessionId": Google Partners session ID.
  5510. func (c *UsersGetCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersGetCall {
  5511. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  5512. return c
  5513. }
  5514. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  5515. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  5516. // to indicate where the traffic comes from.
  5517. // An identifier has multiple letters created by a team which redirected
  5518. // the
  5519. // traffic to us.
  5520. func (c *UsersGetCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersGetCall {
  5521. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  5522. return c
  5523. }
  5524. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  5525. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  5526. // to indicate where the traffic comes from.
  5527. // An identifier has multiple letters created by a team which redirected
  5528. // the
  5529. // traffic to us.
  5530. func (c *UsersGetCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersGetCall {
  5531. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  5532. return c
  5533. }
  5534. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  5535. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  5536. // of the user's geo-located IP address.
  5537. func (c *UsersGetCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersGetCall {
  5538. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  5539. return c
  5540. }
  5541. // RequestMetadataUserOverridesUserId sets the optional parameter
  5542. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  5543. // impersonate instead of the user's ID.
  5544. func (c *UsersGetCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersGetCall {
  5545. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  5546. return c
  5547. }
  5548. // UserView sets the optional parameter "userView": Specifies what parts
  5549. // of the user information to return.
  5550. //
  5551. // Possible values:
  5552. // "BASIC"
  5553. // "PROFILE"
  5554. // "PUBLIC_PROFILE"
  5555. func (c *UsersGetCall) UserView(userView string) *UsersGetCall {
  5556. c.urlParams_.Set("userView", userView)
  5557. return c
  5558. }
  5559. // Fields allows partial responses to be retrieved. See
  5560. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5561. // for more information.
  5562. func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall {
  5563. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5564. return c
  5565. }
  5566. // IfNoneMatch sets the optional parameter which makes the operation
  5567. // fail if the object's ETag matches the given value. This is useful for
  5568. // getting updates only after the object has changed since the last
  5569. // request. Use googleapi.IsNotModified to check whether the response
  5570. // error from Do is the result of In-None-Match.
  5571. func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall {
  5572. c.ifNoneMatch_ = entityTag
  5573. return c
  5574. }
  5575. // Context sets the context to be used in this call's Do method. Any
  5576. // pending HTTP request will be aborted if the provided context is
  5577. // canceled.
  5578. func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall {
  5579. c.ctx_ = ctx
  5580. return c
  5581. }
  5582. // Header returns an http.Header that can be modified by the caller to
  5583. // add HTTP headers to the request.
  5584. func (c *UsersGetCall) Header() http.Header {
  5585. if c.header_ == nil {
  5586. c.header_ = make(http.Header)
  5587. }
  5588. return c.header_
  5589. }
  5590. func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) {
  5591. reqHeaders := make(http.Header)
  5592. for k, v := range c.header_ {
  5593. reqHeaders[k] = v
  5594. }
  5595. reqHeaders.Set("User-Agent", c.s.userAgent())
  5596. if c.ifNoneMatch_ != "" {
  5597. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5598. }
  5599. var body io.Reader = nil
  5600. c.urlParams_.Set("alt", alt)
  5601. c.urlParams_.Set("prettyPrint", "false")
  5602. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}")
  5603. urls += "?" + c.urlParams_.Encode()
  5604. req, err := http.NewRequest("GET", urls, body)
  5605. if err != nil {
  5606. return nil, err
  5607. }
  5608. req.Header = reqHeaders
  5609. googleapi.Expand(req.URL, map[string]string{
  5610. "userId": c.userId,
  5611. })
  5612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5613. }
  5614. // Do executes the "partners.users.get" call.
  5615. // Exactly one of *User or error will be non-nil. Any non-2xx status
  5616. // code is an error. Response headers are in either
  5617. // *User.ServerResponse.Header or (if a response was returned at all) in
  5618. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5619. // whether the returned error was because http.StatusNotModified was
  5620. // returned.
  5621. func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) {
  5622. gensupport.SetOptions(c.urlParams_, opts...)
  5623. res, err := c.doRequest("json")
  5624. if res != nil && res.StatusCode == http.StatusNotModified {
  5625. if res.Body != nil {
  5626. res.Body.Close()
  5627. }
  5628. return nil, &googleapi.Error{
  5629. Code: res.StatusCode,
  5630. Header: res.Header,
  5631. }
  5632. }
  5633. if err != nil {
  5634. return nil, err
  5635. }
  5636. defer googleapi.CloseBody(res)
  5637. if err := googleapi.CheckResponse(res); err != nil {
  5638. return nil, err
  5639. }
  5640. ret := &User{
  5641. ServerResponse: googleapi.ServerResponse{
  5642. Header: res.Header,
  5643. HTTPStatusCode: res.StatusCode,
  5644. },
  5645. }
  5646. target := &ret
  5647. if err := gensupport.DecodeResponse(target, res); err != nil {
  5648. return nil, err
  5649. }
  5650. return ret, nil
  5651. // {
  5652. // "description": "Gets a user.",
  5653. // "flatPath": "v2/users/{userId}",
  5654. // "httpMethod": "GET",
  5655. // "id": "partners.users.get",
  5656. // "parameterOrder": [
  5657. // "userId"
  5658. // ],
  5659. // "parameters": {
  5660. // "requestMetadata.experimentIds": {
  5661. // "description": "Experiment IDs the current request belongs to.",
  5662. // "location": "query",
  5663. // "repeated": true,
  5664. // "type": "string"
  5665. // },
  5666. // "requestMetadata.locale": {
  5667. // "description": "Locale to use for the current request.",
  5668. // "location": "query",
  5669. // "type": "string"
  5670. // },
  5671. // "requestMetadata.partnersSessionId": {
  5672. // "description": "Google Partners session ID.",
  5673. // "location": "query",
  5674. // "type": "string"
  5675. // },
  5676. // "requestMetadata.trafficSource.trafficSourceId": {
  5677. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5678. // "location": "query",
  5679. // "type": "string"
  5680. // },
  5681. // "requestMetadata.trafficSource.trafficSubId": {
  5682. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5683. // "location": "query",
  5684. // "type": "string"
  5685. // },
  5686. // "requestMetadata.userOverrides.ipAddress": {
  5687. // "description": "IP address to use instead of the user's geo-located IP address.",
  5688. // "location": "query",
  5689. // "type": "string"
  5690. // },
  5691. // "requestMetadata.userOverrides.userId": {
  5692. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  5693. // "location": "query",
  5694. // "type": "string"
  5695. // },
  5696. // "userId": {
  5697. // "description": "Identifier of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean the currently\nauthenticated user.",
  5698. // "location": "path",
  5699. // "required": true,
  5700. // "type": "string"
  5701. // },
  5702. // "userView": {
  5703. // "description": "Specifies what parts of the user information to return.",
  5704. // "enum": [
  5705. // "BASIC",
  5706. // "PROFILE",
  5707. // "PUBLIC_PROFILE"
  5708. // ],
  5709. // "location": "query",
  5710. // "type": "string"
  5711. // }
  5712. // },
  5713. // "path": "v2/users/{userId}",
  5714. // "response": {
  5715. // "$ref": "User"
  5716. // }
  5717. // }
  5718. }
  5719. // method id "partners.users.updateProfile":
  5720. type UsersUpdateProfileCall struct {
  5721. s *Service
  5722. userprofile *UserProfile
  5723. urlParams_ gensupport.URLParams
  5724. ctx_ context.Context
  5725. header_ http.Header
  5726. }
  5727. // UpdateProfile: Updates a user's profile. A user can only update their
  5728. // own profile and
  5729. // should only be called within the context of a logged in user.
  5730. func (r *UsersService) UpdateProfile(userprofile *UserProfile) *UsersUpdateProfileCall {
  5731. c := &UsersUpdateProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5732. c.userprofile = userprofile
  5733. return c
  5734. }
  5735. // RequestMetadataExperimentIds sets the optional parameter
  5736. // "requestMetadata.experimentIds": Experiment IDs the current request
  5737. // belongs to.
  5738. func (c *UsersUpdateProfileCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersUpdateProfileCall {
  5739. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  5740. return c
  5741. }
  5742. // RequestMetadataLocale sets the optional parameter
  5743. // "requestMetadata.locale": Locale to use for the current request.
  5744. func (c *UsersUpdateProfileCall) RequestMetadataLocale(requestMetadataLocale string) *UsersUpdateProfileCall {
  5745. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  5746. return c
  5747. }
  5748. // RequestMetadataPartnersSessionId sets the optional parameter
  5749. // "requestMetadata.partnersSessionId": Google Partners session ID.
  5750. func (c *UsersUpdateProfileCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersUpdateProfileCall {
  5751. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  5752. return c
  5753. }
  5754. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  5755. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  5756. // to indicate where the traffic comes from.
  5757. // An identifier has multiple letters created by a team which redirected
  5758. // the
  5759. // traffic to us.
  5760. func (c *UsersUpdateProfileCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersUpdateProfileCall {
  5761. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  5762. return c
  5763. }
  5764. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  5765. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  5766. // to indicate where the traffic comes from.
  5767. // An identifier has multiple letters created by a team which redirected
  5768. // the
  5769. // traffic to us.
  5770. func (c *UsersUpdateProfileCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersUpdateProfileCall {
  5771. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  5772. return c
  5773. }
  5774. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  5775. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  5776. // of the user's geo-located IP address.
  5777. func (c *UsersUpdateProfileCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersUpdateProfileCall {
  5778. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  5779. return c
  5780. }
  5781. // RequestMetadataUserOverridesUserId sets the optional parameter
  5782. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  5783. // impersonate instead of the user's ID.
  5784. func (c *UsersUpdateProfileCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersUpdateProfileCall {
  5785. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  5786. return c
  5787. }
  5788. // Fields allows partial responses to be retrieved. See
  5789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5790. // for more information.
  5791. func (c *UsersUpdateProfileCall) Fields(s ...googleapi.Field) *UsersUpdateProfileCall {
  5792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5793. return c
  5794. }
  5795. // Context sets the context to be used in this call's Do method. Any
  5796. // pending HTTP request will be aborted if the provided context is
  5797. // canceled.
  5798. func (c *UsersUpdateProfileCall) Context(ctx context.Context) *UsersUpdateProfileCall {
  5799. c.ctx_ = ctx
  5800. return c
  5801. }
  5802. // Header returns an http.Header that can be modified by the caller to
  5803. // add HTTP headers to the request.
  5804. func (c *UsersUpdateProfileCall) Header() http.Header {
  5805. if c.header_ == nil {
  5806. c.header_ = make(http.Header)
  5807. }
  5808. return c.header_
  5809. }
  5810. func (c *UsersUpdateProfileCall) doRequest(alt string) (*http.Response, error) {
  5811. reqHeaders := make(http.Header)
  5812. for k, v := range c.header_ {
  5813. reqHeaders[k] = v
  5814. }
  5815. reqHeaders.Set("User-Agent", c.s.userAgent())
  5816. var body io.Reader = nil
  5817. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userprofile)
  5818. if err != nil {
  5819. return nil, err
  5820. }
  5821. reqHeaders.Set("Content-Type", "application/json")
  5822. c.urlParams_.Set("alt", alt)
  5823. c.urlParams_.Set("prettyPrint", "false")
  5824. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/profile")
  5825. urls += "?" + c.urlParams_.Encode()
  5826. req, err := http.NewRequest("PATCH", urls, body)
  5827. if err != nil {
  5828. return nil, err
  5829. }
  5830. req.Header = reqHeaders
  5831. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5832. }
  5833. // Do executes the "partners.users.updateProfile" call.
  5834. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  5835. // status code is an error. Response headers are in either
  5836. // *UserProfile.ServerResponse.Header or (if a response was returned at
  5837. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5838. // to check whether the returned error was because
  5839. // http.StatusNotModified was returned.
  5840. func (c *UsersUpdateProfileCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  5841. gensupport.SetOptions(c.urlParams_, opts...)
  5842. res, err := c.doRequest("json")
  5843. if res != nil && res.StatusCode == http.StatusNotModified {
  5844. if res.Body != nil {
  5845. res.Body.Close()
  5846. }
  5847. return nil, &googleapi.Error{
  5848. Code: res.StatusCode,
  5849. Header: res.Header,
  5850. }
  5851. }
  5852. if err != nil {
  5853. return nil, err
  5854. }
  5855. defer googleapi.CloseBody(res)
  5856. if err := googleapi.CheckResponse(res); err != nil {
  5857. return nil, err
  5858. }
  5859. ret := &UserProfile{
  5860. ServerResponse: googleapi.ServerResponse{
  5861. Header: res.Header,
  5862. HTTPStatusCode: res.StatusCode,
  5863. },
  5864. }
  5865. target := &ret
  5866. if err := gensupport.DecodeResponse(target, res); err != nil {
  5867. return nil, err
  5868. }
  5869. return ret, nil
  5870. // {
  5871. // "description": "Updates a user's profile. A user can only update their own profile and\nshould only be called within the context of a logged in user.",
  5872. // "flatPath": "v2/users/profile",
  5873. // "httpMethod": "PATCH",
  5874. // "id": "partners.users.updateProfile",
  5875. // "parameterOrder": [],
  5876. // "parameters": {
  5877. // "requestMetadata.experimentIds": {
  5878. // "description": "Experiment IDs the current request belongs to.",
  5879. // "location": "query",
  5880. // "repeated": true,
  5881. // "type": "string"
  5882. // },
  5883. // "requestMetadata.locale": {
  5884. // "description": "Locale to use for the current request.",
  5885. // "location": "query",
  5886. // "type": "string"
  5887. // },
  5888. // "requestMetadata.partnersSessionId": {
  5889. // "description": "Google Partners session ID.",
  5890. // "location": "query",
  5891. // "type": "string"
  5892. // },
  5893. // "requestMetadata.trafficSource.trafficSourceId": {
  5894. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5895. // "location": "query",
  5896. // "type": "string"
  5897. // },
  5898. // "requestMetadata.trafficSource.trafficSubId": {
  5899. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  5900. // "location": "query",
  5901. // "type": "string"
  5902. // },
  5903. // "requestMetadata.userOverrides.ipAddress": {
  5904. // "description": "IP address to use instead of the user's geo-located IP address.",
  5905. // "location": "query",
  5906. // "type": "string"
  5907. // },
  5908. // "requestMetadata.userOverrides.userId": {
  5909. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  5910. // "location": "query",
  5911. // "type": "string"
  5912. // }
  5913. // },
  5914. // "path": "v2/users/profile",
  5915. // "request": {
  5916. // "$ref": "UserProfile"
  5917. // },
  5918. // "response": {
  5919. // "$ref": "UserProfile"
  5920. // }
  5921. // }
  5922. }
  5923. // method id "partners.getPartnersstatus":
  5924. type V2GetPartnersstatusCall struct {
  5925. s *Service
  5926. urlParams_ gensupport.URLParams
  5927. ifNoneMatch_ string
  5928. ctx_ context.Context
  5929. header_ http.Header
  5930. }
  5931. // GetPartnersstatus: Gets Partners Status of the logged in user's
  5932. // agency.
  5933. // Should only be called if the logged in user is the admin of the
  5934. // agency.
  5935. func (r *V2Service) GetPartnersstatus() *V2GetPartnersstatusCall {
  5936. c := &V2GetPartnersstatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5937. return c
  5938. }
  5939. // RequestMetadataExperimentIds sets the optional parameter
  5940. // "requestMetadata.experimentIds": Experiment IDs the current request
  5941. // belongs to.
  5942. func (c *V2GetPartnersstatusCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *V2GetPartnersstatusCall {
  5943. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  5944. return c
  5945. }
  5946. // RequestMetadataLocale sets the optional parameter
  5947. // "requestMetadata.locale": Locale to use for the current request.
  5948. func (c *V2GetPartnersstatusCall) RequestMetadataLocale(requestMetadataLocale string) *V2GetPartnersstatusCall {
  5949. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  5950. return c
  5951. }
  5952. // RequestMetadataPartnersSessionId sets the optional parameter
  5953. // "requestMetadata.partnersSessionId": Google Partners session ID.
  5954. func (c *V2GetPartnersstatusCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *V2GetPartnersstatusCall {
  5955. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  5956. return c
  5957. }
  5958. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  5959. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  5960. // to indicate where the traffic comes from.
  5961. // An identifier has multiple letters created by a team which redirected
  5962. // the
  5963. // traffic to us.
  5964. func (c *V2GetPartnersstatusCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *V2GetPartnersstatusCall {
  5965. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  5966. return c
  5967. }
  5968. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  5969. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  5970. // to indicate where the traffic comes from.
  5971. // An identifier has multiple letters created by a team which redirected
  5972. // the
  5973. // traffic to us.
  5974. func (c *V2GetPartnersstatusCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *V2GetPartnersstatusCall {
  5975. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  5976. return c
  5977. }
  5978. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  5979. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  5980. // of the user's geo-located IP address.
  5981. func (c *V2GetPartnersstatusCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *V2GetPartnersstatusCall {
  5982. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  5983. return c
  5984. }
  5985. // RequestMetadataUserOverridesUserId sets the optional parameter
  5986. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  5987. // impersonate instead of the user's ID.
  5988. func (c *V2GetPartnersstatusCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *V2GetPartnersstatusCall {
  5989. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  5990. return c
  5991. }
  5992. // Fields allows partial responses to be retrieved. See
  5993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5994. // for more information.
  5995. func (c *V2GetPartnersstatusCall) Fields(s ...googleapi.Field) *V2GetPartnersstatusCall {
  5996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5997. return c
  5998. }
  5999. // IfNoneMatch sets the optional parameter which makes the operation
  6000. // fail if the object's ETag matches the given value. This is useful for
  6001. // getting updates only after the object has changed since the last
  6002. // request. Use googleapi.IsNotModified to check whether the response
  6003. // error from Do is the result of In-None-Match.
  6004. func (c *V2GetPartnersstatusCall) IfNoneMatch(entityTag string) *V2GetPartnersstatusCall {
  6005. c.ifNoneMatch_ = entityTag
  6006. return c
  6007. }
  6008. // Context sets the context to be used in this call's Do method. Any
  6009. // pending HTTP request will be aborted if the provided context is
  6010. // canceled.
  6011. func (c *V2GetPartnersstatusCall) Context(ctx context.Context) *V2GetPartnersstatusCall {
  6012. c.ctx_ = ctx
  6013. return c
  6014. }
  6015. // Header returns an http.Header that can be modified by the caller to
  6016. // add HTTP headers to the request.
  6017. func (c *V2GetPartnersstatusCall) Header() http.Header {
  6018. if c.header_ == nil {
  6019. c.header_ = make(http.Header)
  6020. }
  6021. return c.header_
  6022. }
  6023. func (c *V2GetPartnersstatusCall) doRequest(alt string) (*http.Response, error) {
  6024. reqHeaders := make(http.Header)
  6025. for k, v := range c.header_ {
  6026. reqHeaders[k] = v
  6027. }
  6028. reqHeaders.Set("User-Agent", c.s.userAgent())
  6029. if c.ifNoneMatch_ != "" {
  6030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6031. }
  6032. var body io.Reader = nil
  6033. c.urlParams_.Set("alt", alt)
  6034. c.urlParams_.Set("prettyPrint", "false")
  6035. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partnersstatus")
  6036. urls += "?" + c.urlParams_.Encode()
  6037. req, err := http.NewRequest("GET", urls, body)
  6038. if err != nil {
  6039. return nil, err
  6040. }
  6041. req.Header = reqHeaders
  6042. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6043. }
  6044. // Do executes the "partners.getPartnersstatus" call.
  6045. // Exactly one of *GetPartnersStatusResponse or error will be non-nil.
  6046. // Any non-2xx status code is an error. Response headers are in either
  6047. // *GetPartnersStatusResponse.ServerResponse.Header or (if a response
  6048. // was returned at all) in error.(*googleapi.Error).Header. Use
  6049. // googleapi.IsNotModified to check whether the returned error was
  6050. // because http.StatusNotModified was returned.
  6051. func (c *V2GetPartnersstatusCall) Do(opts ...googleapi.CallOption) (*GetPartnersStatusResponse, error) {
  6052. gensupport.SetOptions(c.urlParams_, opts...)
  6053. res, err := c.doRequest("json")
  6054. if res != nil && res.StatusCode == http.StatusNotModified {
  6055. if res.Body != nil {
  6056. res.Body.Close()
  6057. }
  6058. return nil, &googleapi.Error{
  6059. Code: res.StatusCode,
  6060. Header: res.Header,
  6061. }
  6062. }
  6063. if err != nil {
  6064. return nil, err
  6065. }
  6066. defer googleapi.CloseBody(res)
  6067. if err := googleapi.CheckResponse(res); err != nil {
  6068. return nil, err
  6069. }
  6070. ret := &GetPartnersStatusResponse{
  6071. ServerResponse: googleapi.ServerResponse{
  6072. Header: res.Header,
  6073. HTTPStatusCode: res.StatusCode,
  6074. },
  6075. }
  6076. target := &ret
  6077. if err := gensupport.DecodeResponse(target, res); err != nil {
  6078. return nil, err
  6079. }
  6080. return ret, nil
  6081. // {
  6082. // "description": "Gets Partners Status of the logged in user's agency.\nShould only be called if the logged in user is the admin of the agency.",
  6083. // "flatPath": "v2/partnersstatus",
  6084. // "httpMethod": "GET",
  6085. // "id": "partners.getPartnersstatus",
  6086. // "parameterOrder": [],
  6087. // "parameters": {
  6088. // "requestMetadata.experimentIds": {
  6089. // "description": "Experiment IDs the current request belongs to.",
  6090. // "location": "query",
  6091. // "repeated": true,
  6092. // "type": "string"
  6093. // },
  6094. // "requestMetadata.locale": {
  6095. // "description": "Locale to use for the current request.",
  6096. // "location": "query",
  6097. // "type": "string"
  6098. // },
  6099. // "requestMetadata.partnersSessionId": {
  6100. // "description": "Google Partners session ID.",
  6101. // "location": "query",
  6102. // "type": "string"
  6103. // },
  6104. // "requestMetadata.trafficSource.trafficSourceId": {
  6105. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  6106. // "location": "query",
  6107. // "type": "string"
  6108. // },
  6109. // "requestMetadata.trafficSource.trafficSubId": {
  6110. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  6111. // "location": "query",
  6112. // "type": "string"
  6113. // },
  6114. // "requestMetadata.userOverrides.ipAddress": {
  6115. // "description": "IP address to use instead of the user's geo-located IP address.",
  6116. // "location": "query",
  6117. // "type": "string"
  6118. // },
  6119. // "requestMetadata.userOverrides.userId": {
  6120. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  6121. // "location": "query",
  6122. // "type": "string"
  6123. // }
  6124. // },
  6125. // "path": "v2/partnersstatus",
  6126. // "response": {
  6127. // "$ref": "GetPartnersStatusResponse"
  6128. // }
  6129. // }
  6130. }
  6131. // method id "partners.updateCompanies":
  6132. type V2UpdateCompaniesCall struct {
  6133. s *Service
  6134. company *Company
  6135. urlParams_ gensupport.URLParams
  6136. ctx_ context.Context
  6137. header_ http.Header
  6138. }
  6139. // UpdateCompanies: Update company.
  6140. // Should only be called within the context of an authorized logged in
  6141. // user.
  6142. func (r *V2Service) UpdateCompanies(company *Company) *V2UpdateCompaniesCall {
  6143. c := &V2UpdateCompaniesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6144. c.company = company
  6145. return c
  6146. }
  6147. // RequestMetadataExperimentIds sets the optional parameter
  6148. // "requestMetadata.experimentIds": Experiment IDs the current request
  6149. // belongs to.
  6150. func (c *V2UpdateCompaniesCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *V2UpdateCompaniesCall {
  6151. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  6152. return c
  6153. }
  6154. // RequestMetadataLocale sets the optional parameter
  6155. // "requestMetadata.locale": Locale to use for the current request.
  6156. func (c *V2UpdateCompaniesCall) RequestMetadataLocale(requestMetadataLocale string) *V2UpdateCompaniesCall {
  6157. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  6158. return c
  6159. }
  6160. // RequestMetadataPartnersSessionId sets the optional parameter
  6161. // "requestMetadata.partnersSessionId": Google Partners session ID.
  6162. func (c *V2UpdateCompaniesCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *V2UpdateCompaniesCall {
  6163. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  6164. return c
  6165. }
  6166. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  6167. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  6168. // to indicate where the traffic comes from.
  6169. // An identifier has multiple letters created by a team which redirected
  6170. // the
  6171. // traffic to us.
  6172. func (c *V2UpdateCompaniesCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *V2UpdateCompaniesCall {
  6173. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  6174. return c
  6175. }
  6176. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  6177. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  6178. // to indicate where the traffic comes from.
  6179. // An identifier has multiple letters created by a team which redirected
  6180. // the
  6181. // traffic to us.
  6182. func (c *V2UpdateCompaniesCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *V2UpdateCompaniesCall {
  6183. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  6184. return c
  6185. }
  6186. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  6187. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  6188. // of the user's geo-located IP address.
  6189. func (c *V2UpdateCompaniesCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *V2UpdateCompaniesCall {
  6190. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  6191. return c
  6192. }
  6193. // RequestMetadataUserOverridesUserId sets the optional parameter
  6194. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  6195. // impersonate instead of the user's ID.
  6196. func (c *V2UpdateCompaniesCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *V2UpdateCompaniesCall {
  6197. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  6198. return c
  6199. }
  6200. // UpdateMask sets the optional parameter "updateMask": Standard field
  6201. // mask for the set of fields to be updated.
  6202. // Required with at least 1 value in FieldMask's paths.
  6203. func (c *V2UpdateCompaniesCall) UpdateMask(updateMask string) *V2UpdateCompaniesCall {
  6204. c.urlParams_.Set("updateMask", updateMask)
  6205. return c
  6206. }
  6207. // Fields allows partial responses to be retrieved. See
  6208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6209. // for more information.
  6210. func (c *V2UpdateCompaniesCall) Fields(s ...googleapi.Field) *V2UpdateCompaniesCall {
  6211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6212. return c
  6213. }
  6214. // Context sets the context to be used in this call's Do method. Any
  6215. // pending HTTP request will be aborted if the provided context is
  6216. // canceled.
  6217. func (c *V2UpdateCompaniesCall) Context(ctx context.Context) *V2UpdateCompaniesCall {
  6218. c.ctx_ = ctx
  6219. return c
  6220. }
  6221. // Header returns an http.Header that can be modified by the caller to
  6222. // add HTTP headers to the request.
  6223. func (c *V2UpdateCompaniesCall) Header() http.Header {
  6224. if c.header_ == nil {
  6225. c.header_ = make(http.Header)
  6226. }
  6227. return c.header_
  6228. }
  6229. func (c *V2UpdateCompaniesCall) doRequest(alt string) (*http.Response, error) {
  6230. reqHeaders := make(http.Header)
  6231. for k, v := range c.header_ {
  6232. reqHeaders[k] = v
  6233. }
  6234. reqHeaders.Set("User-Agent", c.s.userAgent())
  6235. var body io.Reader = nil
  6236. body, err := googleapi.WithoutDataWrapper.JSONReader(c.company)
  6237. if err != nil {
  6238. return nil, err
  6239. }
  6240. reqHeaders.Set("Content-Type", "application/json")
  6241. c.urlParams_.Set("alt", alt)
  6242. c.urlParams_.Set("prettyPrint", "false")
  6243. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies")
  6244. urls += "?" + c.urlParams_.Encode()
  6245. req, err := http.NewRequest("PATCH", urls, body)
  6246. if err != nil {
  6247. return nil, err
  6248. }
  6249. req.Header = reqHeaders
  6250. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6251. }
  6252. // Do executes the "partners.updateCompanies" call.
  6253. // Exactly one of *Company or error will be non-nil. Any non-2xx status
  6254. // code is an error. Response headers are in either
  6255. // *Company.ServerResponse.Header or (if a response was returned at all)
  6256. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6257. // check whether the returned error was because http.StatusNotModified
  6258. // was returned.
  6259. func (c *V2UpdateCompaniesCall) Do(opts ...googleapi.CallOption) (*Company, error) {
  6260. gensupport.SetOptions(c.urlParams_, opts...)
  6261. res, err := c.doRequest("json")
  6262. if res != nil && res.StatusCode == http.StatusNotModified {
  6263. if res.Body != nil {
  6264. res.Body.Close()
  6265. }
  6266. return nil, &googleapi.Error{
  6267. Code: res.StatusCode,
  6268. Header: res.Header,
  6269. }
  6270. }
  6271. if err != nil {
  6272. return nil, err
  6273. }
  6274. defer googleapi.CloseBody(res)
  6275. if err := googleapi.CheckResponse(res); err != nil {
  6276. return nil, err
  6277. }
  6278. ret := &Company{
  6279. ServerResponse: googleapi.ServerResponse{
  6280. Header: res.Header,
  6281. HTTPStatusCode: res.StatusCode,
  6282. },
  6283. }
  6284. target := &ret
  6285. if err := gensupport.DecodeResponse(target, res); err != nil {
  6286. return nil, err
  6287. }
  6288. return ret, nil
  6289. // {
  6290. // "description": "Update company.\nShould only be called within the context of an authorized logged in user.",
  6291. // "flatPath": "v2/companies",
  6292. // "httpMethod": "PATCH",
  6293. // "id": "partners.updateCompanies",
  6294. // "parameterOrder": [],
  6295. // "parameters": {
  6296. // "requestMetadata.experimentIds": {
  6297. // "description": "Experiment IDs the current request belongs to.",
  6298. // "location": "query",
  6299. // "repeated": true,
  6300. // "type": "string"
  6301. // },
  6302. // "requestMetadata.locale": {
  6303. // "description": "Locale to use for the current request.",
  6304. // "location": "query",
  6305. // "type": "string"
  6306. // },
  6307. // "requestMetadata.partnersSessionId": {
  6308. // "description": "Google Partners session ID.",
  6309. // "location": "query",
  6310. // "type": "string"
  6311. // },
  6312. // "requestMetadata.trafficSource.trafficSourceId": {
  6313. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  6314. // "location": "query",
  6315. // "type": "string"
  6316. // },
  6317. // "requestMetadata.trafficSource.trafficSubId": {
  6318. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  6319. // "location": "query",
  6320. // "type": "string"
  6321. // },
  6322. // "requestMetadata.userOverrides.ipAddress": {
  6323. // "description": "IP address to use instead of the user's geo-located IP address.",
  6324. // "location": "query",
  6325. // "type": "string"
  6326. // },
  6327. // "requestMetadata.userOverrides.userId": {
  6328. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  6329. // "location": "query",
  6330. // "type": "string"
  6331. // },
  6332. // "updateMask": {
  6333. // "description": "Standard field mask for the set of fields to be updated.\nRequired with at least 1 value in FieldMask's paths.",
  6334. // "format": "google-fieldmask",
  6335. // "location": "query",
  6336. // "type": "string"
  6337. // }
  6338. // },
  6339. // "path": "v2/companies",
  6340. // "request": {
  6341. // "$ref": "Company"
  6342. // },
  6343. // "response": {
  6344. // "$ref": "Company"
  6345. // }
  6346. // }
  6347. }
  6348. // method id "partners.updateLeads":
  6349. type V2UpdateLeadsCall struct {
  6350. s *Service
  6351. lead *Lead
  6352. urlParams_ gensupport.URLParams
  6353. ctx_ context.Context
  6354. header_ http.Header
  6355. }
  6356. // UpdateLeads: Updates the specified lead.
  6357. func (r *V2Service) UpdateLeads(lead *Lead) *V2UpdateLeadsCall {
  6358. c := &V2UpdateLeadsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6359. c.lead = lead
  6360. return c
  6361. }
  6362. // RequestMetadataExperimentIds sets the optional parameter
  6363. // "requestMetadata.experimentIds": Experiment IDs the current request
  6364. // belongs to.
  6365. func (c *V2UpdateLeadsCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *V2UpdateLeadsCall {
  6366. c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...))
  6367. return c
  6368. }
  6369. // RequestMetadataLocale sets the optional parameter
  6370. // "requestMetadata.locale": Locale to use for the current request.
  6371. func (c *V2UpdateLeadsCall) RequestMetadataLocale(requestMetadataLocale string) *V2UpdateLeadsCall {
  6372. c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale)
  6373. return c
  6374. }
  6375. // RequestMetadataPartnersSessionId sets the optional parameter
  6376. // "requestMetadata.partnersSessionId": Google Partners session ID.
  6377. func (c *V2UpdateLeadsCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *V2UpdateLeadsCall {
  6378. c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId)
  6379. return c
  6380. }
  6381. // RequestMetadataTrafficSourceTrafficSourceId sets the optional
  6382. // parameter "requestMetadata.trafficSource.trafficSourceId": Identifier
  6383. // to indicate where the traffic comes from.
  6384. // An identifier has multiple letters created by a team which redirected
  6385. // the
  6386. // traffic to us.
  6387. func (c *V2UpdateLeadsCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *V2UpdateLeadsCall {
  6388. c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId)
  6389. return c
  6390. }
  6391. // RequestMetadataTrafficSourceTrafficSubId sets the optional parameter
  6392. // "requestMetadata.trafficSource.trafficSubId": Second level identifier
  6393. // to indicate where the traffic comes from.
  6394. // An identifier has multiple letters created by a team which redirected
  6395. // the
  6396. // traffic to us.
  6397. func (c *V2UpdateLeadsCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *V2UpdateLeadsCall {
  6398. c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId)
  6399. return c
  6400. }
  6401. // RequestMetadataUserOverridesIpAddress sets the optional parameter
  6402. // "requestMetadata.userOverrides.ipAddress": IP address to use instead
  6403. // of the user's geo-located IP address.
  6404. func (c *V2UpdateLeadsCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *V2UpdateLeadsCall {
  6405. c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress)
  6406. return c
  6407. }
  6408. // RequestMetadataUserOverridesUserId sets the optional parameter
  6409. // "requestMetadata.userOverrides.userId": Logged-in user ID to
  6410. // impersonate instead of the user's ID.
  6411. func (c *V2UpdateLeadsCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *V2UpdateLeadsCall {
  6412. c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId)
  6413. return c
  6414. }
  6415. // UpdateMask sets the optional parameter "updateMask": Standard field
  6416. // mask for the set of fields to be updated.
  6417. // Required with at least 1 value in FieldMask's paths.
  6418. // Only `state` and `adwords_customer_id` are currently supported.
  6419. func (c *V2UpdateLeadsCall) UpdateMask(updateMask string) *V2UpdateLeadsCall {
  6420. c.urlParams_.Set("updateMask", updateMask)
  6421. return c
  6422. }
  6423. // Fields allows partial responses to be retrieved. See
  6424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6425. // for more information.
  6426. func (c *V2UpdateLeadsCall) Fields(s ...googleapi.Field) *V2UpdateLeadsCall {
  6427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6428. return c
  6429. }
  6430. // Context sets the context to be used in this call's Do method. Any
  6431. // pending HTTP request will be aborted if the provided context is
  6432. // canceled.
  6433. func (c *V2UpdateLeadsCall) Context(ctx context.Context) *V2UpdateLeadsCall {
  6434. c.ctx_ = ctx
  6435. return c
  6436. }
  6437. // Header returns an http.Header that can be modified by the caller to
  6438. // add HTTP headers to the request.
  6439. func (c *V2UpdateLeadsCall) Header() http.Header {
  6440. if c.header_ == nil {
  6441. c.header_ = make(http.Header)
  6442. }
  6443. return c.header_
  6444. }
  6445. func (c *V2UpdateLeadsCall) doRequest(alt string) (*http.Response, error) {
  6446. reqHeaders := make(http.Header)
  6447. for k, v := range c.header_ {
  6448. reqHeaders[k] = v
  6449. }
  6450. reqHeaders.Set("User-Agent", c.s.userAgent())
  6451. var body io.Reader = nil
  6452. body, err := googleapi.WithoutDataWrapper.JSONReader(c.lead)
  6453. if err != nil {
  6454. return nil, err
  6455. }
  6456. reqHeaders.Set("Content-Type", "application/json")
  6457. c.urlParams_.Set("alt", alt)
  6458. c.urlParams_.Set("prettyPrint", "false")
  6459. urls := googleapi.ResolveRelative(c.s.BasePath, "v2/leads")
  6460. urls += "?" + c.urlParams_.Encode()
  6461. req, err := http.NewRequest("PATCH", urls, body)
  6462. if err != nil {
  6463. return nil, err
  6464. }
  6465. req.Header = reqHeaders
  6466. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6467. }
  6468. // Do executes the "partners.updateLeads" call.
  6469. // Exactly one of *Lead or error will be non-nil. Any non-2xx status
  6470. // code is an error. Response headers are in either
  6471. // *Lead.ServerResponse.Header or (if a response was returned at all) in
  6472. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6473. // whether the returned error was because http.StatusNotModified was
  6474. // returned.
  6475. func (c *V2UpdateLeadsCall) Do(opts ...googleapi.CallOption) (*Lead, error) {
  6476. gensupport.SetOptions(c.urlParams_, opts...)
  6477. res, err := c.doRequest("json")
  6478. if res != nil && res.StatusCode == http.StatusNotModified {
  6479. if res.Body != nil {
  6480. res.Body.Close()
  6481. }
  6482. return nil, &googleapi.Error{
  6483. Code: res.StatusCode,
  6484. Header: res.Header,
  6485. }
  6486. }
  6487. if err != nil {
  6488. return nil, err
  6489. }
  6490. defer googleapi.CloseBody(res)
  6491. if err := googleapi.CheckResponse(res); err != nil {
  6492. return nil, err
  6493. }
  6494. ret := &Lead{
  6495. ServerResponse: googleapi.ServerResponse{
  6496. Header: res.Header,
  6497. HTTPStatusCode: res.StatusCode,
  6498. },
  6499. }
  6500. target := &ret
  6501. if err := gensupport.DecodeResponse(target, res); err != nil {
  6502. return nil, err
  6503. }
  6504. return ret, nil
  6505. // {
  6506. // "description": "Updates the specified lead.",
  6507. // "flatPath": "v2/leads",
  6508. // "httpMethod": "PATCH",
  6509. // "id": "partners.updateLeads",
  6510. // "parameterOrder": [],
  6511. // "parameters": {
  6512. // "requestMetadata.experimentIds": {
  6513. // "description": "Experiment IDs the current request belongs to.",
  6514. // "location": "query",
  6515. // "repeated": true,
  6516. // "type": "string"
  6517. // },
  6518. // "requestMetadata.locale": {
  6519. // "description": "Locale to use for the current request.",
  6520. // "location": "query",
  6521. // "type": "string"
  6522. // },
  6523. // "requestMetadata.partnersSessionId": {
  6524. // "description": "Google Partners session ID.",
  6525. // "location": "query",
  6526. // "type": "string"
  6527. // },
  6528. // "requestMetadata.trafficSource.trafficSourceId": {
  6529. // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  6530. // "location": "query",
  6531. // "type": "string"
  6532. // },
  6533. // "requestMetadata.trafficSource.trafficSubId": {
  6534. // "description": "Second level identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.",
  6535. // "location": "query",
  6536. // "type": "string"
  6537. // },
  6538. // "requestMetadata.userOverrides.ipAddress": {
  6539. // "description": "IP address to use instead of the user's geo-located IP address.",
  6540. // "location": "query",
  6541. // "type": "string"
  6542. // },
  6543. // "requestMetadata.userOverrides.userId": {
  6544. // "description": "Logged-in user ID to impersonate instead of the user's ID.",
  6545. // "location": "query",
  6546. // "type": "string"
  6547. // },
  6548. // "updateMask": {
  6549. // "description": "Standard field mask for the set of fields to be updated.\nRequired with at least 1 value in FieldMask's paths.\nOnly `state` and `adwords_customer_id` are currently supported.",
  6550. // "format": "google-fieldmask",
  6551. // "location": "query",
  6552. // "type": "string"
  6553. // }
  6554. // },
  6555. // "path": "v2/leads",
  6556. // "request": {
  6557. // "$ref": "Lead"
  6558. // },
  6559. // "response": {
  6560. // "$ref": "Lead"
  6561. // }
  6562. // }
  6563. }