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.
 
 
 

7232 lines
276 KiB

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