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