1// Copyright 2020 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 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 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 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 3289 for k, v := range c.header_ { 3290 reqHeaders[k] = v 3291 } 3292 reqHeaders.Set("User-Agent", c.s.userAgent()) 3293 if c.ifNoneMatch_ != "" { 3294 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3295 } 3296 var body io.Reader = nil 3297 c.urlParams_.Set("alt", alt) 3298 c.urlParams_.Set("prettyPrint", "false") 3299 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/analytics") 3300 urls += "?" + c.urlParams_.Encode() 3301 req, err := http.NewRequest("GET", urls, body) 3302 if err != nil { 3303 return nil, err 3304 } 3305 req.Header = reqHeaders 3306 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3307} 3308 3309// Do executes the "partners.analytics.list" call. 3310// Exactly one of *ListAnalyticsResponse or error will be non-nil. Any 3311// non-2xx status code is an error. Response headers are in either 3312// *ListAnalyticsResponse.ServerResponse.Header or (if a response was 3313// returned at all) in error.(*googleapi.Error).Header. Use 3314// googleapi.IsNotModified to check whether the returned error was 3315// because http.StatusNotModified was returned. 3316func (c *AnalyticsListCall) Do(opts ...googleapi.CallOption) (*ListAnalyticsResponse, error) { 3317 gensupport.SetOptions(c.urlParams_, opts...) 3318 res, err := c.doRequest("json") 3319 if res != nil && res.StatusCode == http.StatusNotModified { 3320 if res.Body != nil { 3321 res.Body.Close() 3322 } 3323 return nil, &googleapi.Error{ 3324 Code: res.StatusCode, 3325 Header: res.Header, 3326 } 3327 } 3328 if err != nil { 3329 return nil, err 3330 } 3331 defer googleapi.CloseBody(res) 3332 if err := googleapi.CheckResponse(res); err != nil { 3333 return nil, err 3334 } 3335 ret := &ListAnalyticsResponse{ 3336 ServerResponse: googleapi.ServerResponse{ 3337 Header: res.Header, 3338 HTTPStatusCode: res.StatusCode, 3339 }, 3340 } 3341 target := &ret 3342 if err := gensupport.DecodeResponse(target, res); err != nil { 3343 return nil, err 3344 } 3345 return ret, nil 3346 // { 3347 // "description": "Lists analytics data for a user's associated company.\nShould only be called within the context of an authorized logged in user.", 3348 // "flatPath": "v2/analytics", 3349 // "httpMethod": "GET", 3350 // "id": "partners.analytics.list", 3351 // "parameterOrder": [], 3352 // "parameters": { 3353 // "pageSize": { 3354 // "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.", 3355 // "format": "int32", 3356 // "location": "query", 3357 // "type": "integer" 3358 // }, 3359 // "pageToken": { 3360 // "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.", 3361 // "location": "query", 3362 // "type": "string" 3363 // }, 3364 // "requestMetadata.experimentIds": { 3365 // "description": "Experiment IDs the current request belongs to.", 3366 // "location": "query", 3367 // "repeated": true, 3368 // "type": "string" 3369 // }, 3370 // "requestMetadata.locale": { 3371 // "description": "Locale to use for the current request.", 3372 // "location": "query", 3373 // "type": "string" 3374 // }, 3375 // "requestMetadata.partnersSessionId": { 3376 // "description": "Google Partners session ID.", 3377 // "location": "query", 3378 // "type": "string" 3379 // }, 3380 // "requestMetadata.trafficSource.trafficSourceId": { 3381 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 3382 // "location": "query", 3383 // "type": "string" 3384 // }, 3385 // "requestMetadata.trafficSource.trafficSubId": { 3386 // "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.", 3387 // "location": "query", 3388 // "type": "string" 3389 // }, 3390 // "requestMetadata.userOverrides.ipAddress": { 3391 // "description": "IP address to use instead of the user's geo-located IP address.", 3392 // "location": "query", 3393 // "type": "string" 3394 // }, 3395 // "requestMetadata.userOverrides.userId": { 3396 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 3397 // "location": "query", 3398 // "type": "string" 3399 // } 3400 // }, 3401 // "path": "v2/analytics", 3402 // "response": { 3403 // "$ref": "ListAnalyticsResponse" 3404 // } 3405 // } 3406 3407} 3408 3409// Pages invokes f for each page of results. 3410// A non-nil error returned from f will halt the iteration. 3411// The provided context supersedes any context provided to the Context method. 3412func (c *AnalyticsListCall) Pages(ctx context.Context, f func(*ListAnalyticsResponse) error) error { 3413 c.ctx_ = ctx 3414 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 3415 for { 3416 x, err := c.Do() 3417 if err != nil { 3418 return err 3419 } 3420 if err := f(x); err != nil { 3421 return err 3422 } 3423 if x.NextPageToken == "" { 3424 return nil 3425 } 3426 c.PageToken(x.NextPageToken) 3427 } 3428} 3429 3430// method id "partners.clientMessages.log": 3431 3432type ClientMessagesLogCall struct { 3433 s *Service 3434 logmessagerequest *LogMessageRequest 3435 urlParams_ gensupport.URLParams 3436 ctx_ context.Context 3437 header_ http.Header 3438} 3439 3440// Log: Logs a generic message from the client, such as 3441// `Failed to render component`, `Profile page is running slow`, 3442// `More than 500 users have accessed this result.`, etc. 3443func (r *ClientMessagesService) Log(logmessagerequest *LogMessageRequest) *ClientMessagesLogCall { 3444 c := &ClientMessagesLogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3445 c.logmessagerequest = logmessagerequest 3446 return c 3447} 3448 3449// Fields allows partial responses to be retrieved. See 3450// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3451// for more information. 3452func (c *ClientMessagesLogCall) Fields(s ...googleapi.Field) *ClientMessagesLogCall { 3453 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3454 return c 3455} 3456 3457// Context sets the context to be used in this call's Do method. Any 3458// pending HTTP request will be aborted if the provided context is 3459// canceled. 3460func (c *ClientMessagesLogCall) Context(ctx context.Context) *ClientMessagesLogCall { 3461 c.ctx_ = ctx 3462 return c 3463} 3464 3465// Header returns an http.Header that can be modified by the caller to 3466// add HTTP headers to the request. 3467func (c *ClientMessagesLogCall) Header() http.Header { 3468 if c.header_ == nil { 3469 c.header_ = make(http.Header) 3470 } 3471 return c.header_ 3472} 3473 3474func (c *ClientMessagesLogCall) doRequest(alt string) (*http.Response, error) { 3475 reqHeaders := make(http.Header) 3476 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 3477 for k, v := range c.header_ { 3478 reqHeaders[k] = v 3479 } 3480 reqHeaders.Set("User-Agent", c.s.userAgent()) 3481 var body io.Reader = nil 3482 body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmessagerequest) 3483 if err != nil { 3484 return nil, err 3485 } 3486 reqHeaders.Set("Content-Type", "application/json") 3487 c.urlParams_.Set("alt", alt) 3488 c.urlParams_.Set("prettyPrint", "false") 3489 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/clientMessages:log") 3490 urls += "?" + c.urlParams_.Encode() 3491 req, err := http.NewRequest("POST", urls, body) 3492 if err != nil { 3493 return nil, err 3494 } 3495 req.Header = reqHeaders 3496 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3497} 3498 3499// Do executes the "partners.clientMessages.log" call. 3500// Exactly one of *LogMessageResponse or error will be non-nil. Any 3501// non-2xx status code is an error. Response headers are in either 3502// *LogMessageResponse.ServerResponse.Header or (if a response was 3503// returned at all) in error.(*googleapi.Error).Header. Use 3504// googleapi.IsNotModified to check whether the returned error was 3505// because http.StatusNotModified was returned. 3506func (c *ClientMessagesLogCall) Do(opts ...googleapi.CallOption) (*LogMessageResponse, error) { 3507 gensupport.SetOptions(c.urlParams_, opts...) 3508 res, err := c.doRequest("json") 3509 if res != nil && res.StatusCode == http.StatusNotModified { 3510 if res.Body != nil { 3511 res.Body.Close() 3512 } 3513 return nil, &googleapi.Error{ 3514 Code: res.StatusCode, 3515 Header: res.Header, 3516 } 3517 } 3518 if err != nil { 3519 return nil, err 3520 } 3521 defer googleapi.CloseBody(res) 3522 if err := googleapi.CheckResponse(res); err != nil { 3523 return nil, err 3524 } 3525 ret := &LogMessageResponse{ 3526 ServerResponse: googleapi.ServerResponse{ 3527 Header: res.Header, 3528 HTTPStatusCode: res.StatusCode, 3529 }, 3530 } 3531 target := &ret 3532 if err := gensupport.DecodeResponse(target, res); err != nil { 3533 return nil, err 3534 } 3535 return ret, nil 3536 // { 3537 // "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.", 3538 // "flatPath": "v2/clientMessages:log", 3539 // "httpMethod": "POST", 3540 // "id": "partners.clientMessages.log", 3541 // "parameterOrder": [], 3542 // "parameters": {}, 3543 // "path": "v2/clientMessages:log", 3544 // "request": { 3545 // "$ref": "LogMessageRequest" 3546 // }, 3547 // "response": { 3548 // "$ref": "LogMessageResponse" 3549 // } 3550 // } 3551 3552} 3553 3554// method id "partners.companies.get": 3555 3556type CompaniesGetCall struct { 3557 s *Service 3558 companyId string 3559 urlParams_ gensupport.URLParams 3560 ifNoneMatch_ string 3561 ctx_ context.Context 3562 header_ http.Header 3563} 3564 3565// Get: Gets a company. 3566func (r *CompaniesService) Get(companyId string) *CompaniesGetCall { 3567 c := &CompaniesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3568 c.companyId = companyId 3569 return c 3570} 3571 3572// Address sets the optional parameter "address": The address to use for 3573// sorting the company's addresses by proximity. 3574// If not given, the geo-located address of the request is used. 3575// Used when order_by is set. 3576func (c *CompaniesGetCall) Address(address string) *CompaniesGetCall { 3577 c.urlParams_.Set("address", address) 3578 return c 3579} 3580 3581// CurrencyCode sets the optional parameter "currencyCode": If the 3582// company's budget is in a different currency code than this one, 3583// then 3584// the converted budget is converted to this currency code. 3585func (c *CompaniesGetCall) CurrencyCode(currencyCode string) *CompaniesGetCall { 3586 c.urlParams_.Set("currencyCode", currencyCode) 3587 return c 3588} 3589 3590// OrderBy sets the optional parameter "orderBy": How to order addresses 3591// within the returned company. Currently, only 3592// `address` and `address desc` is supported which will sorted by 3593// closest to 3594// farthest in distance from given address and farthest to closest 3595// distance 3596// from given address respectively. 3597func (c *CompaniesGetCall) OrderBy(orderBy string) *CompaniesGetCall { 3598 c.urlParams_.Set("orderBy", orderBy) 3599 return c 3600} 3601 3602// RequestMetadataExperimentIds sets the optional parameter 3603// "requestMetadata.experimentIds": Experiment IDs the current request 3604// belongs to. 3605func (c *CompaniesGetCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *CompaniesGetCall { 3606 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 3607 return c 3608} 3609 3610// RequestMetadataLocale sets the optional parameter 3611// "requestMetadata.locale": Locale to use for the current request. 3612func (c *CompaniesGetCall) RequestMetadataLocale(requestMetadataLocale string) *CompaniesGetCall { 3613 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 3614 return c 3615} 3616 3617// RequestMetadataPartnersSessionId sets the optional parameter 3618// "requestMetadata.partnersSessionId": Google Partners session ID. 3619func (c *CompaniesGetCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *CompaniesGetCall { 3620 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 3621 return c 3622} 3623 3624// RequestMetadataTrafficSourceTrafficSourceId sets the optional 3625// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 3626// to indicate where the traffic comes from. 3627// An identifier has multiple letters created by a team which redirected 3628// the 3629// traffic to us. 3630func (c *CompaniesGetCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *CompaniesGetCall { 3631 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 3632 return c 3633} 3634 3635// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 3636// "requestMetadata.trafficSource.trafficSubId": Second level identifier 3637// to indicate where the traffic comes from. 3638// An identifier has multiple letters created by a team which redirected 3639// the 3640// traffic to us. 3641func (c *CompaniesGetCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *CompaniesGetCall { 3642 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 3643 return c 3644} 3645 3646// RequestMetadataUserOverridesIpAddress sets the optional parameter 3647// "requestMetadata.userOverrides.ipAddress": IP address to use instead 3648// of the user's geo-located IP address. 3649func (c *CompaniesGetCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *CompaniesGetCall { 3650 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 3651 return c 3652} 3653 3654// RequestMetadataUserOverridesUserId sets the optional parameter 3655// "requestMetadata.userOverrides.userId": Logged-in user ID to 3656// impersonate instead of the user's ID. 3657func (c *CompaniesGetCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *CompaniesGetCall { 3658 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 3659 return c 3660} 3661 3662// View sets the optional parameter "view": The view of `Company` 3663// resource to be returned. This must not be 3664// `COMPANY_VIEW_UNSPECIFIED`. 3665// 3666// Possible values: 3667// "COMPANY_VIEW_UNSPECIFIED" 3668// "CV_GOOGLE_PARTNER_SEARCH" 3669func (c *CompaniesGetCall) View(view string) *CompaniesGetCall { 3670 c.urlParams_.Set("view", view) 3671 return c 3672} 3673 3674// Fields allows partial responses to be retrieved. See 3675// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3676// for more information. 3677func (c *CompaniesGetCall) Fields(s ...googleapi.Field) *CompaniesGetCall { 3678 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3679 return c 3680} 3681 3682// IfNoneMatch sets the optional parameter which makes the operation 3683// fail if the object's ETag matches the given value. This is useful for 3684// getting updates only after the object has changed since the last 3685// request. Use googleapi.IsNotModified to check whether the response 3686// error from Do is the result of In-None-Match. 3687func (c *CompaniesGetCall) IfNoneMatch(entityTag string) *CompaniesGetCall { 3688 c.ifNoneMatch_ = entityTag 3689 return c 3690} 3691 3692// Context sets the context to be used in this call's Do method. Any 3693// pending HTTP request will be aborted if the provided context is 3694// canceled. 3695func (c *CompaniesGetCall) Context(ctx context.Context) *CompaniesGetCall { 3696 c.ctx_ = ctx 3697 return c 3698} 3699 3700// Header returns an http.Header that can be modified by the caller to 3701// add HTTP headers to the request. 3702func (c *CompaniesGetCall) Header() http.Header { 3703 if c.header_ == nil { 3704 c.header_ = make(http.Header) 3705 } 3706 return c.header_ 3707} 3708 3709func (c *CompaniesGetCall) doRequest(alt string) (*http.Response, error) { 3710 reqHeaders := make(http.Header) 3711 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 3712 for k, v := range c.header_ { 3713 reqHeaders[k] = v 3714 } 3715 reqHeaders.Set("User-Agent", c.s.userAgent()) 3716 if c.ifNoneMatch_ != "" { 3717 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3718 } 3719 var body io.Reader = nil 3720 c.urlParams_.Set("alt", alt) 3721 c.urlParams_.Set("prettyPrint", "false") 3722 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies/{companyId}") 3723 urls += "?" + c.urlParams_.Encode() 3724 req, err := http.NewRequest("GET", urls, body) 3725 if err != nil { 3726 return nil, err 3727 } 3728 req.Header = reqHeaders 3729 googleapi.Expand(req.URL, map[string]string{ 3730 "companyId": c.companyId, 3731 }) 3732 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3733} 3734 3735// Do executes the "partners.companies.get" call. 3736// Exactly one of *GetCompanyResponse or error will be non-nil. Any 3737// non-2xx status code is an error. Response headers are in either 3738// *GetCompanyResponse.ServerResponse.Header or (if a response was 3739// returned at all) in error.(*googleapi.Error).Header. Use 3740// googleapi.IsNotModified to check whether the returned error was 3741// because http.StatusNotModified was returned. 3742func (c *CompaniesGetCall) Do(opts ...googleapi.CallOption) (*GetCompanyResponse, error) { 3743 gensupport.SetOptions(c.urlParams_, opts...) 3744 res, err := c.doRequest("json") 3745 if res != nil && res.StatusCode == http.StatusNotModified { 3746 if res.Body != nil { 3747 res.Body.Close() 3748 } 3749 return nil, &googleapi.Error{ 3750 Code: res.StatusCode, 3751 Header: res.Header, 3752 } 3753 } 3754 if err != nil { 3755 return nil, err 3756 } 3757 defer googleapi.CloseBody(res) 3758 if err := googleapi.CheckResponse(res); err != nil { 3759 return nil, err 3760 } 3761 ret := &GetCompanyResponse{ 3762 ServerResponse: googleapi.ServerResponse{ 3763 Header: res.Header, 3764 HTTPStatusCode: res.StatusCode, 3765 }, 3766 } 3767 target := &ret 3768 if err := gensupport.DecodeResponse(target, res); err != nil { 3769 return nil, err 3770 } 3771 return ret, nil 3772 // { 3773 // "description": "Gets a company.", 3774 // "flatPath": "v2/companies/{companyId}", 3775 // "httpMethod": "GET", 3776 // "id": "partners.companies.get", 3777 // "parameterOrder": [ 3778 // "companyId" 3779 // ], 3780 // "parameters": { 3781 // "address": { 3782 // "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.", 3783 // "location": "query", 3784 // "type": "string" 3785 // }, 3786 // "companyId": { 3787 // "description": "The ID of the company to retrieve.", 3788 // "location": "path", 3789 // "required": true, 3790 // "type": "string" 3791 // }, 3792 // "currencyCode": { 3793 // "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.", 3794 // "location": "query", 3795 // "type": "string" 3796 // }, 3797 // "orderBy": { 3798 // "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.", 3799 // "location": "query", 3800 // "type": "string" 3801 // }, 3802 // "requestMetadata.experimentIds": { 3803 // "description": "Experiment IDs the current request belongs to.", 3804 // "location": "query", 3805 // "repeated": true, 3806 // "type": "string" 3807 // }, 3808 // "requestMetadata.locale": { 3809 // "description": "Locale to use for the current request.", 3810 // "location": "query", 3811 // "type": "string" 3812 // }, 3813 // "requestMetadata.partnersSessionId": { 3814 // "description": "Google Partners session ID.", 3815 // "location": "query", 3816 // "type": "string" 3817 // }, 3818 // "requestMetadata.trafficSource.trafficSourceId": { 3819 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 3820 // "location": "query", 3821 // "type": "string" 3822 // }, 3823 // "requestMetadata.trafficSource.trafficSubId": { 3824 // "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.", 3825 // "location": "query", 3826 // "type": "string" 3827 // }, 3828 // "requestMetadata.userOverrides.ipAddress": { 3829 // "description": "IP address to use instead of the user's geo-located IP address.", 3830 // "location": "query", 3831 // "type": "string" 3832 // }, 3833 // "requestMetadata.userOverrides.userId": { 3834 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 3835 // "location": "query", 3836 // "type": "string" 3837 // }, 3838 // "view": { 3839 // "description": "The view of `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.", 3840 // "enum": [ 3841 // "COMPANY_VIEW_UNSPECIFIED", 3842 // "CV_GOOGLE_PARTNER_SEARCH" 3843 // ], 3844 // "location": "query", 3845 // "type": "string" 3846 // } 3847 // }, 3848 // "path": "v2/companies/{companyId}", 3849 // "response": { 3850 // "$ref": "GetCompanyResponse" 3851 // } 3852 // } 3853 3854} 3855 3856// method id "partners.companies.list": 3857 3858type CompaniesListCall struct { 3859 s *Service 3860 urlParams_ gensupport.URLParams 3861 ifNoneMatch_ string 3862 ctx_ context.Context 3863 header_ http.Header 3864} 3865 3866// List: Lists companies. 3867func (r *CompaniesService) List() *CompaniesListCall { 3868 c := &CompaniesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3869 return c 3870} 3871 3872// Address sets the optional parameter "address": The address to use 3873// when searching for companies. 3874// If not given, the geo-located address of the request is used. 3875func (c *CompaniesListCall) Address(address string) *CompaniesListCall { 3876 c.urlParams_.Set("address", address) 3877 return c 3878} 3879 3880// CompanyName sets the optional parameter "companyName": Company name 3881// to search for. 3882func (c *CompaniesListCall) CompanyName(companyName string) *CompaniesListCall { 3883 c.urlParams_.Set("companyName", companyName) 3884 return c 3885} 3886 3887// GpsMotivations sets the optional parameter "gpsMotivations": List of 3888// reasons for using Google Partner Search to get companies. 3889// 3890// Possible values: 3891// "GPS_MOTIVATION_UNSPECIFIED" 3892// "GPSM_HELP_WITH_ADVERTISING" 3893// "GPSM_HELP_WITH_WEBSITE" 3894// "GPSM_NO_WEBSITE" 3895func (c *CompaniesListCall) GpsMotivations(gpsMotivations ...string) *CompaniesListCall { 3896 c.urlParams_.SetMulti("gpsMotivations", append([]string{}, gpsMotivations...)) 3897 return c 3898} 3899 3900// Industries sets the optional parameter "industries": List of 3901// industries the company can help with. 3902// 3903// Possible values: 3904// "INDUSTRY_UNSPECIFIED" 3905// "I_AUTOMOTIVE" 3906// "I_BUSINESS_TO_BUSINESS" 3907// "I_CONSUMER_PACKAGED_GOODS" 3908// "I_EDUCATION" 3909// "I_FINANCE" 3910// "I_HEALTHCARE" 3911// "I_MEDIA_AND_ENTERTAINMENT" 3912// "I_RETAIL" 3913// "I_TECHNOLOGY" 3914// "I_TRAVEL" 3915func (c *CompaniesListCall) Industries(industries ...string) *CompaniesListCall { 3916 c.urlParams_.SetMulti("industries", append([]string{}, industries...)) 3917 return c 3918} 3919 3920// LanguageCodes sets the optional parameter "languageCodes": List of 3921// language codes that company can support. Only primary 3922// language 3923// subtags are accepted as defined by 3924// <a href="https://tools.ietf.org/html/bcp47">BCP 47</a> 3925// (IETF BCP 47, "Tags for Identifying Languages"). 3926func (c *CompaniesListCall) LanguageCodes(languageCodes ...string) *CompaniesListCall { 3927 c.urlParams_.SetMulti("languageCodes", append([]string{}, languageCodes...)) 3928 return c 3929} 3930 3931// MaxMonthlyBudgetCurrencyCode sets the optional parameter 3932// "maxMonthlyBudget.currencyCode": The 3-letter currency code defined 3933// in ISO 4217. 3934func (c *CompaniesListCall) MaxMonthlyBudgetCurrencyCode(maxMonthlyBudgetCurrencyCode string) *CompaniesListCall { 3935 c.urlParams_.Set("maxMonthlyBudget.currencyCode", maxMonthlyBudgetCurrencyCode) 3936 return c 3937} 3938 3939// MaxMonthlyBudgetNanos sets the optional parameter 3940// "maxMonthlyBudget.nanos": Number of nano (10^-9) units of the 3941// amount. 3942// The value must be between -999,999,999 and +999,999,999 inclusive. 3943// If `units` is positive, `nanos` must be positive or zero. 3944// If `units` is zero, `nanos` can be positive, zero, or negative. 3945// If `units` is negative, `nanos` must be negative or zero. 3946// For example $-1.75 is represented as `units`=-1 and 3947// `nanos`=-750,000,000. 3948func (c *CompaniesListCall) MaxMonthlyBudgetNanos(maxMonthlyBudgetNanos int64) *CompaniesListCall { 3949 c.urlParams_.Set("maxMonthlyBudget.nanos", fmt.Sprint(maxMonthlyBudgetNanos)) 3950 return c 3951} 3952 3953// MaxMonthlyBudgetUnits sets the optional parameter 3954// "maxMonthlyBudget.units": The whole units of the amount. 3955// For example if `currencyCode` is "USD", then 1 unit is one US 3956// dollar. 3957func (c *CompaniesListCall) MaxMonthlyBudgetUnits(maxMonthlyBudgetUnits int64) *CompaniesListCall { 3958 c.urlParams_.Set("maxMonthlyBudget.units", fmt.Sprint(maxMonthlyBudgetUnits)) 3959 return c 3960} 3961 3962// MinMonthlyBudgetCurrencyCode sets the optional parameter 3963// "minMonthlyBudget.currencyCode": The 3-letter currency code defined 3964// in ISO 4217. 3965func (c *CompaniesListCall) MinMonthlyBudgetCurrencyCode(minMonthlyBudgetCurrencyCode string) *CompaniesListCall { 3966 c.urlParams_.Set("minMonthlyBudget.currencyCode", minMonthlyBudgetCurrencyCode) 3967 return c 3968} 3969 3970// MinMonthlyBudgetNanos sets the optional parameter 3971// "minMonthlyBudget.nanos": Number of nano (10^-9) units of the 3972// amount. 3973// The value must be between -999,999,999 and +999,999,999 inclusive. 3974// If `units` is positive, `nanos` must be positive or zero. 3975// If `units` is zero, `nanos` can be positive, zero, or negative. 3976// If `units` is negative, `nanos` must be negative or zero. 3977// For example $-1.75 is represented as `units`=-1 and 3978// `nanos`=-750,000,000. 3979func (c *CompaniesListCall) MinMonthlyBudgetNanos(minMonthlyBudgetNanos int64) *CompaniesListCall { 3980 c.urlParams_.Set("minMonthlyBudget.nanos", fmt.Sprint(minMonthlyBudgetNanos)) 3981 return c 3982} 3983 3984// MinMonthlyBudgetUnits sets the optional parameter 3985// "minMonthlyBudget.units": The whole units of the amount. 3986// For example if `currencyCode` is "USD", then 1 unit is one US 3987// dollar. 3988func (c *CompaniesListCall) MinMonthlyBudgetUnits(minMonthlyBudgetUnits int64) *CompaniesListCall { 3989 c.urlParams_.Set("minMonthlyBudget.units", fmt.Sprint(minMonthlyBudgetUnits)) 3990 return c 3991} 3992 3993// OrderBy sets the optional parameter "orderBy": How to order addresses 3994// within the returned companies. Currently, only 3995// `address` and `address desc` is supported which will sorted by 3996// closest to 3997// farthest in distance from given address and farthest to closest 3998// distance 3999// from given address respectively. 4000func (c *CompaniesListCall) OrderBy(orderBy string) *CompaniesListCall { 4001 c.urlParams_.Set("orderBy", orderBy) 4002 return c 4003} 4004 4005// PageSize sets the optional parameter "pageSize": Requested page size. 4006// Server may return fewer companies than requested. 4007// If unspecified, server picks an appropriate default. 4008func (c *CompaniesListCall) PageSize(pageSize int64) *CompaniesListCall { 4009 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4010 return c 4011} 4012 4013// PageToken sets the optional parameter "pageToken": A token 4014// identifying a page of results that the server returns. 4015// Typically, this is the value of 4016// `ListCompaniesResponse.next_page_token` 4017// returned from the previous call to 4018// ListCompanies. 4019func (c *CompaniesListCall) PageToken(pageToken string) *CompaniesListCall { 4020 c.urlParams_.Set("pageToken", pageToken) 4021 return c 4022} 4023 4024// RequestMetadataExperimentIds sets the optional parameter 4025// "requestMetadata.experimentIds": Experiment IDs the current request 4026// belongs to. 4027func (c *CompaniesListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *CompaniesListCall { 4028 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 4029 return c 4030} 4031 4032// RequestMetadataLocale sets the optional parameter 4033// "requestMetadata.locale": Locale to use for the current request. 4034func (c *CompaniesListCall) RequestMetadataLocale(requestMetadataLocale string) *CompaniesListCall { 4035 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 4036 return c 4037} 4038 4039// RequestMetadataPartnersSessionId sets the optional parameter 4040// "requestMetadata.partnersSessionId": Google Partners session ID. 4041func (c *CompaniesListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *CompaniesListCall { 4042 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 4043 return c 4044} 4045 4046// RequestMetadataTrafficSourceTrafficSourceId sets the optional 4047// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 4048// to indicate where the traffic comes from. 4049// An identifier has multiple letters created by a team which redirected 4050// the 4051// traffic to us. 4052func (c *CompaniesListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *CompaniesListCall { 4053 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 4054 return c 4055} 4056 4057// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 4058// "requestMetadata.trafficSource.trafficSubId": Second level identifier 4059// to indicate where the traffic comes from. 4060// An identifier has multiple letters created by a team which redirected 4061// the 4062// traffic to us. 4063func (c *CompaniesListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *CompaniesListCall { 4064 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 4065 return c 4066} 4067 4068// RequestMetadataUserOverridesIpAddress sets the optional parameter 4069// "requestMetadata.userOverrides.ipAddress": IP address to use instead 4070// of the user's geo-located IP address. 4071func (c *CompaniesListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *CompaniesListCall { 4072 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 4073 return c 4074} 4075 4076// RequestMetadataUserOverridesUserId sets the optional parameter 4077// "requestMetadata.userOverrides.userId": Logged-in user ID to 4078// impersonate instead of the user's ID. 4079func (c *CompaniesListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *CompaniesListCall { 4080 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 4081 return c 4082} 4083 4084// Services sets the optional parameter "services": List of services 4085// that the returned agencies should provide. If this is 4086// not empty, any returned agency must have at least one of these 4087// services, 4088// or one of the specializations in the "specializations" field. 4089// 4090// Possible values: 4091// "SERVICE_UNSPECIFIED" 4092// "S_ADVANCED_ADWORDS_SUPPORT" 4093// "S_ADVERTISING_ON_GOOGLE" 4094// "S_AN_ENHANCED_WEBSITE" 4095// "S_AN_ONLINE_MARKETING_PLAN" 4096// "S_MOBILE_AND_VIDEO_ADS" 4097// "S_MOBILE_WEBSITE_SERVICES" 4098func (c *CompaniesListCall) Services(services ...string) *CompaniesListCall { 4099 c.urlParams_.SetMulti("services", append([]string{}, services...)) 4100 return c 4101} 4102 4103// Specializations sets the optional parameter "specializations": List 4104// of specializations that the returned agencies should provide. If 4105// this 4106// is not empty, any returned agency must have at least one of 4107// these 4108// specializations, or one of the services in the "services" field. 4109// 4110// Possible values: 4111// "BADGE_SPECIALIZATION_UNKNOWN" 4112// "BADGE_SPECIALIZATION_ADWORDS_SEARCH" 4113// "BADGE_SPECIALIZATION_ADWORDS_DISPLAY" 4114// "BADGE_SPECIALIZATION_ADWORDS_MOBILE" 4115// "BADGE_SPECIALIZATION_ADWORDS_VIDEO" 4116// "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" 4117func (c *CompaniesListCall) Specializations(specializations ...string) *CompaniesListCall { 4118 c.urlParams_.SetMulti("specializations", append([]string{}, specializations...)) 4119 return c 4120} 4121 4122// View sets the optional parameter "view": The view of the `Company` 4123// resource to be returned. This must not be 4124// `COMPANY_VIEW_UNSPECIFIED`. 4125// 4126// Possible values: 4127// "COMPANY_VIEW_UNSPECIFIED" 4128// "CV_GOOGLE_PARTNER_SEARCH" 4129func (c *CompaniesListCall) View(view string) *CompaniesListCall { 4130 c.urlParams_.Set("view", view) 4131 return c 4132} 4133 4134// WebsiteUrl sets the optional parameter "websiteUrl": Website URL that 4135// will help to find a better matched company. 4136// . 4137func (c *CompaniesListCall) WebsiteUrl(websiteUrl string) *CompaniesListCall { 4138 c.urlParams_.Set("websiteUrl", websiteUrl) 4139 return c 4140} 4141 4142// Fields allows partial responses to be retrieved. See 4143// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4144// for more information. 4145func (c *CompaniesListCall) Fields(s ...googleapi.Field) *CompaniesListCall { 4146 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4147 return c 4148} 4149 4150// IfNoneMatch sets the optional parameter which makes the operation 4151// fail if the object's ETag matches the given value. This is useful for 4152// getting updates only after the object has changed since the last 4153// request. Use googleapi.IsNotModified to check whether the response 4154// error from Do is the result of In-None-Match. 4155func (c *CompaniesListCall) IfNoneMatch(entityTag string) *CompaniesListCall { 4156 c.ifNoneMatch_ = entityTag 4157 return c 4158} 4159 4160// Context sets the context to be used in this call's Do method. Any 4161// pending HTTP request will be aborted if the provided context is 4162// canceled. 4163func (c *CompaniesListCall) Context(ctx context.Context) *CompaniesListCall { 4164 c.ctx_ = ctx 4165 return c 4166} 4167 4168// Header returns an http.Header that can be modified by the caller to 4169// add HTTP headers to the request. 4170func (c *CompaniesListCall) Header() http.Header { 4171 if c.header_ == nil { 4172 c.header_ = make(http.Header) 4173 } 4174 return c.header_ 4175} 4176 4177func (c *CompaniesListCall) doRequest(alt string) (*http.Response, error) { 4178 reqHeaders := make(http.Header) 4179 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 4180 for k, v := range c.header_ { 4181 reqHeaders[k] = v 4182 } 4183 reqHeaders.Set("User-Agent", c.s.userAgent()) 4184 if c.ifNoneMatch_ != "" { 4185 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4186 } 4187 var body io.Reader = nil 4188 c.urlParams_.Set("alt", alt) 4189 c.urlParams_.Set("prettyPrint", "false") 4190 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies") 4191 urls += "?" + c.urlParams_.Encode() 4192 req, err := http.NewRequest("GET", urls, body) 4193 if err != nil { 4194 return nil, err 4195 } 4196 req.Header = reqHeaders 4197 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4198} 4199 4200// Do executes the "partners.companies.list" call. 4201// Exactly one of *ListCompaniesResponse or error will be non-nil. Any 4202// non-2xx status code is an error. Response headers are in either 4203// *ListCompaniesResponse.ServerResponse.Header or (if a response was 4204// returned at all) in error.(*googleapi.Error).Header. Use 4205// googleapi.IsNotModified to check whether the returned error was 4206// because http.StatusNotModified was returned. 4207func (c *CompaniesListCall) Do(opts ...googleapi.CallOption) (*ListCompaniesResponse, error) { 4208 gensupport.SetOptions(c.urlParams_, opts...) 4209 res, err := c.doRequest("json") 4210 if res != nil && res.StatusCode == http.StatusNotModified { 4211 if res.Body != nil { 4212 res.Body.Close() 4213 } 4214 return nil, &googleapi.Error{ 4215 Code: res.StatusCode, 4216 Header: res.Header, 4217 } 4218 } 4219 if err != nil { 4220 return nil, err 4221 } 4222 defer googleapi.CloseBody(res) 4223 if err := googleapi.CheckResponse(res); err != nil { 4224 return nil, err 4225 } 4226 ret := &ListCompaniesResponse{ 4227 ServerResponse: googleapi.ServerResponse{ 4228 Header: res.Header, 4229 HTTPStatusCode: res.StatusCode, 4230 }, 4231 } 4232 target := &ret 4233 if err := gensupport.DecodeResponse(target, res); err != nil { 4234 return nil, err 4235 } 4236 return ret, nil 4237 // { 4238 // "description": "Lists companies.", 4239 // "flatPath": "v2/companies", 4240 // "httpMethod": "GET", 4241 // "id": "partners.companies.list", 4242 // "parameterOrder": [], 4243 // "parameters": { 4244 // "address": { 4245 // "description": "The address to use when searching for companies.\nIf not given, the geo-located address of the request is used.", 4246 // "location": "query", 4247 // "type": "string" 4248 // }, 4249 // "companyName": { 4250 // "description": "Company name to search for.", 4251 // "location": "query", 4252 // "type": "string" 4253 // }, 4254 // "gpsMotivations": { 4255 // "description": "List of reasons for using Google Partner Search to get companies.", 4256 // "enum": [ 4257 // "GPS_MOTIVATION_UNSPECIFIED", 4258 // "GPSM_HELP_WITH_ADVERTISING", 4259 // "GPSM_HELP_WITH_WEBSITE", 4260 // "GPSM_NO_WEBSITE" 4261 // ], 4262 // "location": "query", 4263 // "repeated": true, 4264 // "type": "string" 4265 // }, 4266 // "industries": { 4267 // "description": "List of industries the company can help with.", 4268 // "enum": [ 4269 // "INDUSTRY_UNSPECIFIED", 4270 // "I_AUTOMOTIVE", 4271 // "I_BUSINESS_TO_BUSINESS", 4272 // "I_CONSUMER_PACKAGED_GOODS", 4273 // "I_EDUCATION", 4274 // "I_FINANCE", 4275 // "I_HEALTHCARE", 4276 // "I_MEDIA_AND_ENTERTAINMENT", 4277 // "I_RETAIL", 4278 // "I_TECHNOLOGY", 4279 // "I_TRAVEL" 4280 // ], 4281 // "location": "query", 4282 // "repeated": true, 4283 // "type": "string" 4284 // }, 4285 // "languageCodes": { 4286 // "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\").", 4287 // "location": "query", 4288 // "repeated": true, 4289 // "type": "string" 4290 // }, 4291 // "maxMonthlyBudget.currencyCode": { 4292 // "description": "The 3-letter currency code defined in ISO 4217.", 4293 // "location": "query", 4294 // "type": "string" 4295 // }, 4296 // "maxMonthlyBudget.nanos": { 4297 // "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.", 4298 // "format": "int32", 4299 // "location": "query", 4300 // "type": "integer" 4301 // }, 4302 // "maxMonthlyBudget.units": { 4303 // "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", 4304 // "format": "int64", 4305 // "location": "query", 4306 // "type": "string" 4307 // }, 4308 // "minMonthlyBudget.currencyCode": { 4309 // "description": "The 3-letter currency code defined in ISO 4217.", 4310 // "location": "query", 4311 // "type": "string" 4312 // }, 4313 // "minMonthlyBudget.nanos": { 4314 // "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.", 4315 // "format": "int32", 4316 // "location": "query", 4317 // "type": "integer" 4318 // }, 4319 // "minMonthlyBudget.units": { 4320 // "description": "The whole units of the amount.\nFor example if `currencyCode` is `\"USD\"`, then 1 unit is one US dollar.", 4321 // "format": "int64", 4322 // "location": "query", 4323 // "type": "string" 4324 // }, 4325 // "orderBy": { 4326 // "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.", 4327 // "location": "query", 4328 // "type": "string" 4329 // }, 4330 // "pageSize": { 4331 // "description": "Requested page size. Server may return fewer companies than requested.\nIf unspecified, server picks an appropriate default.", 4332 // "format": "int32", 4333 // "location": "query", 4334 // "type": "integer" 4335 // }, 4336 // "pageToken": { 4337 // "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.", 4338 // "location": "query", 4339 // "type": "string" 4340 // }, 4341 // "requestMetadata.experimentIds": { 4342 // "description": "Experiment IDs the current request belongs to.", 4343 // "location": "query", 4344 // "repeated": true, 4345 // "type": "string" 4346 // }, 4347 // "requestMetadata.locale": { 4348 // "description": "Locale to use for the current request.", 4349 // "location": "query", 4350 // "type": "string" 4351 // }, 4352 // "requestMetadata.partnersSessionId": { 4353 // "description": "Google Partners session ID.", 4354 // "location": "query", 4355 // "type": "string" 4356 // }, 4357 // "requestMetadata.trafficSource.trafficSourceId": { 4358 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 4359 // "location": "query", 4360 // "type": "string" 4361 // }, 4362 // "requestMetadata.trafficSource.trafficSubId": { 4363 // "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.", 4364 // "location": "query", 4365 // "type": "string" 4366 // }, 4367 // "requestMetadata.userOverrides.ipAddress": { 4368 // "description": "IP address to use instead of the user's geo-located IP address.", 4369 // "location": "query", 4370 // "type": "string" 4371 // }, 4372 // "requestMetadata.userOverrides.userId": { 4373 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 4374 // "location": "query", 4375 // "type": "string" 4376 // }, 4377 // "services": { 4378 // "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.", 4379 // "enum": [ 4380 // "SERVICE_UNSPECIFIED", 4381 // "S_ADVANCED_ADWORDS_SUPPORT", 4382 // "S_ADVERTISING_ON_GOOGLE", 4383 // "S_AN_ENHANCED_WEBSITE", 4384 // "S_AN_ONLINE_MARKETING_PLAN", 4385 // "S_MOBILE_AND_VIDEO_ADS", 4386 // "S_MOBILE_WEBSITE_SERVICES" 4387 // ], 4388 // "location": "query", 4389 // "repeated": true, 4390 // "type": "string" 4391 // }, 4392 // "specializations": { 4393 // "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.", 4394 // "enum": [ 4395 // "BADGE_SPECIALIZATION_UNKNOWN", 4396 // "BADGE_SPECIALIZATION_ADWORDS_SEARCH", 4397 // "BADGE_SPECIALIZATION_ADWORDS_DISPLAY", 4398 // "BADGE_SPECIALIZATION_ADWORDS_MOBILE", 4399 // "BADGE_SPECIALIZATION_ADWORDS_VIDEO", 4400 // "BADGE_SPECIALIZATION_ADWORDS_SHOPPING" 4401 // ], 4402 // "location": "query", 4403 // "repeated": true, 4404 // "type": "string" 4405 // }, 4406 // "view": { 4407 // "description": "The view of the `Company` resource to be returned. This must not be\n`COMPANY_VIEW_UNSPECIFIED`.", 4408 // "enum": [ 4409 // "COMPANY_VIEW_UNSPECIFIED", 4410 // "CV_GOOGLE_PARTNER_SEARCH" 4411 // ], 4412 // "location": "query", 4413 // "type": "string" 4414 // }, 4415 // "websiteUrl": { 4416 // "description": "Website URL that will help to find a better matched company.\n.", 4417 // "location": "query", 4418 // "type": "string" 4419 // } 4420 // }, 4421 // "path": "v2/companies", 4422 // "response": { 4423 // "$ref": "ListCompaniesResponse" 4424 // } 4425 // } 4426 4427} 4428 4429// Pages invokes f for each page of results. 4430// A non-nil error returned from f will halt the iteration. 4431// The provided context supersedes any context provided to the Context method. 4432func (c *CompaniesListCall) Pages(ctx context.Context, f func(*ListCompaniesResponse) error) error { 4433 c.ctx_ = ctx 4434 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4435 for { 4436 x, err := c.Do() 4437 if err != nil { 4438 return err 4439 } 4440 if err := f(x); err != nil { 4441 return err 4442 } 4443 if x.NextPageToken == "" { 4444 return nil 4445 } 4446 c.PageToken(x.NextPageToken) 4447 } 4448} 4449 4450// method id "partners.companies.leads.create": 4451 4452type CompaniesLeadsCreateCall struct { 4453 s *Service 4454 companyId string 4455 createleadrequest *CreateLeadRequest 4456 urlParams_ gensupport.URLParams 4457 ctx_ context.Context 4458 header_ http.Header 4459} 4460 4461// Create: Creates an advertiser lead for the given company ID. 4462func (r *CompaniesLeadsService) Create(companyId string, createleadrequest *CreateLeadRequest) *CompaniesLeadsCreateCall { 4463 c := &CompaniesLeadsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4464 c.companyId = companyId 4465 c.createleadrequest = createleadrequest 4466 return c 4467} 4468 4469// Fields allows partial responses to be retrieved. See 4470// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4471// for more information. 4472func (c *CompaniesLeadsCreateCall) Fields(s ...googleapi.Field) *CompaniesLeadsCreateCall { 4473 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4474 return c 4475} 4476 4477// Context sets the context to be used in this call's Do method. Any 4478// pending HTTP request will be aborted if the provided context is 4479// canceled. 4480func (c *CompaniesLeadsCreateCall) Context(ctx context.Context) *CompaniesLeadsCreateCall { 4481 c.ctx_ = ctx 4482 return c 4483} 4484 4485// Header returns an http.Header that can be modified by the caller to 4486// add HTTP headers to the request. 4487func (c *CompaniesLeadsCreateCall) Header() http.Header { 4488 if c.header_ == nil { 4489 c.header_ = make(http.Header) 4490 } 4491 return c.header_ 4492} 4493 4494func (c *CompaniesLeadsCreateCall) doRequest(alt string) (*http.Response, error) { 4495 reqHeaders := make(http.Header) 4496 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 4497 for k, v := range c.header_ { 4498 reqHeaders[k] = v 4499 } 4500 reqHeaders.Set("User-Agent", c.s.userAgent()) 4501 var body io.Reader = nil 4502 body, err := googleapi.WithoutDataWrapper.JSONReader(c.createleadrequest) 4503 if err != nil { 4504 return nil, err 4505 } 4506 reqHeaders.Set("Content-Type", "application/json") 4507 c.urlParams_.Set("alt", alt) 4508 c.urlParams_.Set("prettyPrint", "false") 4509 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies/{companyId}/leads") 4510 urls += "?" + c.urlParams_.Encode() 4511 req, err := http.NewRequest("POST", urls, body) 4512 if err != nil { 4513 return nil, err 4514 } 4515 req.Header = reqHeaders 4516 googleapi.Expand(req.URL, map[string]string{ 4517 "companyId": c.companyId, 4518 }) 4519 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4520} 4521 4522// Do executes the "partners.companies.leads.create" call. 4523// Exactly one of *CreateLeadResponse or error will be non-nil. Any 4524// non-2xx status code is an error. Response headers are in either 4525// *CreateLeadResponse.ServerResponse.Header or (if a response was 4526// returned at all) in error.(*googleapi.Error).Header. Use 4527// googleapi.IsNotModified to check whether the returned error was 4528// because http.StatusNotModified was returned. 4529func (c *CompaniesLeadsCreateCall) Do(opts ...googleapi.CallOption) (*CreateLeadResponse, error) { 4530 gensupport.SetOptions(c.urlParams_, opts...) 4531 res, err := c.doRequest("json") 4532 if res != nil && res.StatusCode == http.StatusNotModified { 4533 if res.Body != nil { 4534 res.Body.Close() 4535 } 4536 return nil, &googleapi.Error{ 4537 Code: res.StatusCode, 4538 Header: res.Header, 4539 } 4540 } 4541 if err != nil { 4542 return nil, err 4543 } 4544 defer googleapi.CloseBody(res) 4545 if err := googleapi.CheckResponse(res); err != nil { 4546 return nil, err 4547 } 4548 ret := &CreateLeadResponse{ 4549 ServerResponse: googleapi.ServerResponse{ 4550 Header: res.Header, 4551 HTTPStatusCode: res.StatusCode, 4552 }, 4553 } 4554 target := &ret 4555 if err := gensupport.DecodeResponse(target, res); err != nil { 4556 return nil, err 4557 } 4558 return ret, nil 4559 // { 4560 // "description": "Creates an advertiser lead for the given company ID.", 4561 // "flatPath": "v2/companies/{companyId}/leads", 4562 // "httpMethod": "POST", 4563 // "id": "partners.companies.leads.create", 4564 // "parameterOrder": [ 4565 // "companyId" 4566 // ], 4567 // "parameters": { 4568 // "companyId": { 4569 // "description": "The ID of the company to contact.", 4570 // "location": "path", 4571 // "required": true, 4572 // "type": "string" 4573 // } 4574 // }, 4575 // "path": "v2/companies/{companyId}/leads", 4576 // "request": { 4577 // "$ref": "CreateLeadRequest" 4578 // }, 4579 // "response": { 4580 // "$ref": "CreateLeadResponse" 4581 // } 4582 // } 4583 4584} 4585 4586// method id "partners.leads.list": 4587 4588type LeadsListCall struct { 4589 s *Service 4590 urlParams_ gensupport.URLParams 4591 ifNoneMatch_ string 4592 ctx_ context.Context 4593 header_ http.Header 4594} 4595 4596// List: Lists advertiser leads for a user's associated company. 4597// Should only be called within the context of an authorized logged in 4598// user. 4599func (r *LeadsService) List() *LeadsListCall { 4600 c := &LeadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4601 return c 4602} 4603 4604// OrderBy sets the optional parameter "orderBy": How to order Leads. 4605// Currently, only `create_time` 4606// and `create_time desc` are supported 4607func (c *LeadsListCall) OrderBy(orderBy string) *LeadsListCall { 4608 c.urlParams_.Set("orderBy", orderBy) 4609 return c 4610} 4611 4612// PageSize sets the optional parameter "pageSize": Requested page size. 4613// Server may return fewer leads than requested. 4614// If unspecified, server picks an appropriate default. 4615func (c *LeadsListCall) PageSize(pageSize int64) *LeadsListCall { 4616 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4617 return c 4618} 4619 4620// PageToken sets the optional parameter "pageToken": A token 4621// identifying a page of results that the server returns. 4622// Typically, this is the value of 4623// `ListLeadsResponse.next_page_token` 4624// returned from the previous call to 4625// ListLeads. 4626func (c *LeadsListCall) PageToken(pageToken string) *LeadsListCall { 4627 c.urlParams_.Set("pageToken", pageToken) 4628 return c 4629} 4630 4631// RequestMetadataExperimentIds sets the optional parameter 4632// "requestMetadata.experimentIds": Experiment IDs the current request 4633// belongs to. 4634func (c *LeadsListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *LeadsListCall { 4635 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 4636 return c 4637} 4638 4639// RequestMetadataLocale sets the optional parameter 4640// "requestMetadata.locale": Locale to use for the current request. 4641func (c *LeadsListCall) RequestMetadataLocale(requestMetadataLocale string) *LeadsListCall { 4642 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 4643 return c 4644} 4645 4646// RequestMetadataPartnersSessionId sets the optional parameter 4647// "requestMetadata.partnersSessionId": Google Partners session ID. 4648func (c *LeadsListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *LeadsListCall { 4649 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 4650 return c 4651} 4652 4653// RequestMetadataTrafficSourceTrafficSourceId sets the optional 4654// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 4655// to indicate where the traffic comes from. 4656// An identifier has multiple letters created by a team which redirected 4657// the 4658// traffic to us. 4659func (c *LeadsListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *LeadsListCall { 4660 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 4661 return c 4662} 4663 4664// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 4665// "requestMetadata.trafficSource.trafficSubId": Second level identifier 4666// to indicate where the traffic comes from. 4667// An identifier has multiple letters created by a team which redirected 4668// the 4669// traffic to us. 4670func (c *LeadsListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *LeadsListCall { 4671 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 4672 return c 4673} 4674 4675// RequestMetadataUserOverridesIpAddress sets the optional parameter 4676// "requestMetadata.userOverrides.ipAddress": IP address to use instead 4677// of the user's geo-located IP address. 4678func (c *LeadsListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *LeadsListCall { 4679 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 4680 return c 4681} 4682 4683// RequestMetadataUserOverridesUserId sets the optional parameter 4684// "requestMetadata.userOverrides.userId": Logged-in user ID to 4685// impersonate instead of the user's ID. 4686func (c *LeadsListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *LeadsListCall { 4687 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 4688 return c 4689} 4690 4691// Fields allows partial responses to be retrieved. See 4692// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4693// for more information. 4694func (c *LeadsListCall) Fields(s ...googleapi.Field) *LeadsListCall { 4695 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4696 return c 4697} 4698 4699// IfNoneMatch sets the optional parameter which makes the operation 4700// fail if the object's ETag matches the given value. This is useful for 4701// getting updates only after the object has changed since the last 4702// request. Use googleapi.IsNotModified to check whether the response 4703// error from Do is the result of In-None-Match. 4704func (c *LeadsListCall) IfNoneMatch(entityTag string) *LeadsListCall { 4705 c.ifNoneMatch_ = entityTag 4706 return c 4707} 4708 4709// Context sets the context to be used in this call's Do method. Any 4710// pending HTTP request will be aborted if the provided context is 4711// canceled. 4712func (c *LeadsListCall) Context(ctx context.Context) *LeadsListCall { 4713 c.ctx_ = ctx 4714 return c 4715} 4716 4717// Header returns an http.Header that can be modified by the caller to 4718// add HTTP headers to the request. 4719func (c *LeadsListCall) Header() http.Header { 4720 if c.header_ == nil { 4721 c.header_ = make(http.Header) 4722 } 4723 return c.header_ 4724} 4725 4726func (c *LeadsListCall) doRequest(alt string) (*http.Response, error) { 4727 reqHeaders := make(http.Header) 4728 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 4729 for k, v := range c.header_ { 4730 reqHeaders[k] = v 4731 } 4732 reqHeaders.Set("User-Agent", c.s.userAgent()) 4733 if c.ifNoneMatch_ != "" { 4734 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4735 } 4736 var body io.Reader = nil 4737 c.urlParams_.Set("alt", alt) 4738 c.urlParams_.Set("prettyPrint", "false") 4739 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/leads") 4740 urls += "?" + c.urlParams_.Encode() 4741 req, err := http.NewRequest("GET", urls, body) 4742 if err != nil { 4743 return nil, err 4744 } 4745 req.Header = reqHeaders 4746 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4747} 4748 4749// Do executes the "partners.leads.list" call. 4750// Exactly one of *ListLeadsResponse or error will be non-nil. Any 4751// non-2xx status code is an error. Response headers are in either 4752// *ListLeadsResponse.ServerResponse.Header or (if a response was 4753// returned at all) in error.(*googleapi.Error).Header. Use 4754// googleapi.IsNotModified to check whether the returned error was 4755// because http.StatusNotModified was returned. 4756func (c *LeadsListCall) Do(opts ...googleapi.CallOption) (*ListLeadsResponse, error) { 4757 gensupport.SetOptions(c.urlParams_, opts...) 4758 res, err := c.doRequest("json") 4759 if res != nil && res.StatusCode == http.StatusNotModified { 4760 if res.Body != nil { 4761 res.Body.Close() 4762 } 4763 return nil, &googleapi.Error{ 4764 Code: res.StatusCode, 4765 Header: res.Header, 4766 } 4767 } 4768 if err != nil { 4769 return nil, err 4770 } 4771 defer googleapi.CloseBody(res) 4772 if err := googleapi.CheckResponse(res); err != nil { 4773 return nil, err 4774 } 4775 ret := &ListLeadsResponse{ 4776 ServerResponse: googleapi.ServerResponse{ 4777 Header: res.Header, 4778 HTTPStatusCode: res.StatusCode, 4779 }, 4780 } 4781 target := &ret 4782 if err := gensupport.DecodeResponse(target, res); err != nil { 4783 return nil, err 4784 } 4785 return ret, nil 4786 // { 4787 // "description": "Lists advertiser leads for a user's associated company.\nShould only be called within the context of an authorized logged in user.", 4788 // "flatPath": "v2/leads", 4789 // "httpMethod": "GET", 4790 // "id": "partners.leads.list", 4791 // "parameterOrder": [], 4792 // "parameters": { 4793 // "orderBy": { 4794 // "description": "How to order Leads. Currently, only `create_time`\nand `create_time desc` are supported", 4795 // "location": "query", 4796 // "type": "string" 4797 // }, 4798 // "pageSize": { 4799 // "description": "Requested page size. Server may return fewer leads than requested.\nIf unspecified, server picks an appropriate default.", 4800 // "format": "int32", 4801 // "location": "query", 4802 // "type": "integer" 4803 // }, 4804 // "pageToken": { 4805 // "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.", 4806 // "location": "query", 4807 // "type": "string" 4808 // }, 4809 // "requestMetadata.experimentIds": { 4810 // "description": "Experiment IDs the current request belongs to.", 4811 // "location": "query", 4812 // "repeated": true, 4813 // "type": "string" 4814 // }, 4815 // "requestMetadata.locale": { 4816 // "description": "Locale to use for the current request.", 4817 // "location": "query", 4818 // "type": "string" 4819 // }, 4820 // "requestMetadata.partnersSessionId": { 4821 // "description": "Google Partners session ID.", 4822 // "location": "query", 4823 // "type": "string" 4824 // }, 4825 // "requestMetadata.trafficSource.trafficSourceId": { 4826 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 4827 // "location": "query", 4828 // "type": "string" 4829 // }, 4830 // "requestMetadata.trafficSource.trafficSubId": { 4831 // "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.", 4832 // "location": "query", 4833 // "type": "string" 4834 // }, 4835 // "requestMetadata.userOverrides.ipAddress": { 4836 // "description": "IP address to use instead of the user's geo-located IP address.", 4837 // "location": "query", 4838 // "type": "string" 4839 // }, 4840 // "requestMetadata.userOverrides.userId": { 4841 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 4842 // "location": "query", 4843 // "type": "string" 4844 // } 4845 // }, 4846 // "path": "v2/leads", 4847 // "response": { 4848 // "$ref": "ListLeadsResponse" 4849 // } 4850 // } 4851 4852} 4853 4854// Pages invokes f for each page of results. 4855// A non-nil error returned from f will halt the iteration. 4856// The provided context supersedes any context provided to the Context method. 4857func (c *LeadsListCall) Pages(ctx context.Context, f func(*ListLeadsResponse) error) error { 4858 c.ctx_ = ctx 4859 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4860 for { 4861 x, err := c.Do() 4862 if err != nil { 4863 return err 4864 } 4865 if err := f(x); err != nil { 4866 return err 4867 } 4868 if x.NextPageToken == "" { 4869 return nil 4870 } 4871 c.PageToken(x.NextPageToken) 4872 } 4873} 4874 4875// method id "partners.offers.list": 4876 4877type OffersListCall struct { 4878 s *Service 4879 urlParams_ gensupport.URLParams 4880 ifNoneMatch_ string 4881 ctx_ context.Context 4882 header_ http.Header 4883} 4884 4885// List: Lists the Offers available for the current user 4886func (r *OffersService) List() *OffersListCall { 4887 c := &OffersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4888 return c 4889} 4890 4891// RequestMetadataExperimentIds sets the optional parameter 4892// "requestMetadata.experimentIds": Experiment IDs the current request 4893// belongs to. 4894func (c *OffersListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *OffersListCall { 4895 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 4896 return c 4897} 4898 4899// RequestMetadataLocale sets the optional parameter 4900// "requestMetadata.locale": Locale to use for the current request. 4901func (c *OffersListCall) RequestMetadataLocale(requestMetadataLocale string) *OffersListCall { 4902 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 4903 return c 4904} 4905 4906// RequestMetadataPartnersSessionId sets the optional parameter 4907// "requestMetadata.partnersSessionId": Google Partners session ID. 4908func (c *OffersListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *OffersListCall { 4909 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 4910 return c 4911} 4912 4913// RequestMetadataTrafficSourceTrafficSourceId sets the optional 4914// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 4915// to indicate where the traffic comes from. 4916// An identifier has multiple letters created by a team which redirected 4917// the 4918// traffic to us. 4919func (c *OffersListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *OffersListCall { 4920 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 4921 return c 4922} 4923 4924// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 4925// "requestMetadata.trafficSource.trafficSubId": Second level identifier 4926// to indicate where the traffic comes from. 4927// An identifier has multiple letters created by a team which redirected 4928// the 4929// traffic to us. 4930func (c *OffersListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *OffersListCall { 4931 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 4932 return c 4933} 4934 4935// RequestMetadataUserOverridesIpAddress sets the optional parameter 4936// "requestMetadata.userOverrides.ipAddress": IP address to use instead 4937// of the user's geo-located IP address. 4938func (c *OffersListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *OffersListCall { 4939 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 4940 return c 4941} 4942 4943// RequestMetadataUserOverridesUserId sets the optional parameter 4944// "requestMetadata.userOverrides.userId": Logged-in user ID to 4945// impersonate instead of the user's ID. 4946func (c *OffersListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *OffersListCall { 4947 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 4948 return c 4949} 4950 4951// Fields allows partial responses to be retrieved. See 4952// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4953// for more information. 4954func (c *OffersListCall) Fields(s ...googleapi.Field) *OffersListCall { 4955 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4956 return c 4957} 4958 4959// IfNoneMatch sets the optional parameter which makes the operation 4960// fail if the object's ETag matches the given value. This is useful for 4961// getting updates only after the object has changed since the last 4962// request. Use googleapi.IsNotModified to check whether the response 4963// error from Do is the result of In-None-Match. 4964func (c *OffersListCall) IfNoneMatch(entityTag string) *OffersListCall { 4965 c.ifNoneMatch_ = entityTag 4966 return c 4967} 4968 4969// Context sets the context to be used in this call's Do method. Any 4970// pending HTTP request will be aborted if the provided context is 4971// canceled. 4972func (c *OffersListCall) Context(ctx context.Context) *OffersListCall { 4973 c.ctx_ = ctx 4974 return c 4975} 4976 4977// Header returns an http.Header that can be modified by the caller to 4978// add HTTP headers to the request. 4979func (c *OffersListCall) Header() http.Header { 4980 if c.header_ == nil { 4981 c.header_ = make(http.Header) 4982 } 4983 return c.header_ 4984} 4985 4986func (c *OffersListCall) doRequest(alt string) (*http.Response, error) { 4987 reqHeaders := make(http.Header) 4988 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 4989 for k, v := range c.header_ { 4990 reqHeaders[k] = v 4991 } 4992 reqHeaders.Set("User-Agent", c.s.userAgent()) 4993 if c.ifNoneMatch_ != "" { 4994 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4995 } 4996 var body io.Reader = nil 4997 c.urlParams_.Set("alt", alt) 4998 c.urlParams_.Set("prettyPrint", "false") 4999 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/offers") 5000 urls += "?" + c.urlParams_.Encode() 5001 req, err := http.NewRequest("GET", urls, body) 5002 if err != nil { 5003 return nil, err 5004 } 5005 req.Header = reqHeaders 5006 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5007} 5008 5009// Do executes the "partners.offers.list" call. 5010// Exactly one of *ListOffersResponse or error will be non-nil. Any 5011// non-2xx status code is an error. Response headers are in either 5012// *ListOffersResponse.ServerResponse.Header or (if a response was 5013// returned at all) in error.(*googleapi.Error).Header. Use 5014// googleapi.IsNotModified to check whether the returned error was 5015// because http.StatusNotModified was returned. 5016func (c *OffersListCall) Do(opts ...googleapi.CallOption) (*ListOffersResponse, error) { 5017 gensupport.SetOptions(c.urlParams_, opts...) 5018 res, err := c.doRequest("json") 5019 if res != nil && res.StatusCode == http.StatusNotModified { 5020 if res.Body != nil { 5021 res.Body.Close() 5022 } 5023 return nil, &googleapi.Error{ 5024 Code: res.StatusCode, 5025 Header: res.Header, 5026 } 5027 } 5028 if err != nil { 5029 return nil, err 5030 } 5031 defer googleapi.CloseBody(res) 5032 if err := googleapi.CheckResponse(res); err != nil { 5033 return nil, err 5034 } 5035 ret := &ListOffersResponse{ 5036 ServerResponse: googleapi.ServerResponse{ 5037 Header: res.Header, 5038 HTTPStatusCode: res.StatusCode, 5039 }, 5040 } 5041 target := &ret 5042 if err := gensupport.DecodeResponse(target, res); err != nil { 5043 return nil, err 5044 } 5045 return ret, nil 5046 // { 5047 // "description": "Lists the Offers available for the current user", 5048 // "flatPath": "v2/offers", 5049 // "httpMethod": "GET", 5050 // "id": "partners.offers.list", 5051 // "parameterOrder": [], 5052 // "parameters": { 5053 // "requestMetadata.experimentIds": { 5054 // "description": "Experiment IDs the current request belongs to.", 5055 // "location": "query", 5056 // "repeated": true, 5057 // "type": "string" 5058 // }, 5059 // "requestMetadata.locale": { 5060 // "description": "Locale to use for the current request.", 5061 // "location": "query", 5062 // "type": "string" 5063 // }, 5064 // "requestMetadata.partnersSessionId": { 5065 // "description": "Google Partners session ID.", 5066 // "location": "query", 5067 // "type": "string" 5068 // }, 5069 // "requestMetadata.trafficSource.trafficSourceId": { 5070 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 5071 // "location": "query", 5072 // "type": "string" 5073 // }, 5074 // "requestMetadata.trafficSource.trafficSubId": { 5075 // "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.", 5076 // "location": "query", 5077 // "type": "string" 5078 // }, 5079 // "requestMetadata.userOverrides.ipAddress": { 5080 // "description": "IP address to use instead of the user's geo-located IP address.", 5081 // "location": "query", 5082 // "type": "string" 5083 // }, 5084 // "requestMetadata.userOverrides.userId": { 5085 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 5086 // "location": "query", 5087 // "type": "string" 5088 // } 5089 // }, 5090 // "path": "v2/offers", 5091 // "response": { 5092 // "$ref": "ListOffersResponse" 5093 // } 5094 // } 5095 5096} 5097 5098// method id "partners.offers.history.list": 5099 5100type OffersHistoryListCall struct { 5101 s *Service 5102 urlParams_ gensupport.URLParams 5103 ifNoneMatch_ string 5104 ctx_ context.Context 5105 header_ http.Header 5106} 5107 5108// List: Lists the Historical Offers for the current user (or user's 5109// entire company) 5110func (r *OffersHistoryService) List() *OffersHistoryListCall { 5111 c := &OffersHistoryListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5112 return c 5113} 5114 5115// EntireCompany sets the optional parameter "entireCompany": if true, 5116// show history for the entire company. Requires user to be admin. 5117func (c *OffersHistoryListCall) EntireCompany(entireCompany bool) *OffersHistoryListCall { 5118 c.urlParams_.Set("entireCompany", fmt.Sprint(entireCompany)) 5119 return c 5120} 5121 5122// OrderBy sets the optional parameter "orderBy": Comma-separated list 5123// of fields to order by, e.g.: "foo,bar,baz". 5124// Use "foo desc" to sort descending. 5125// List of valid field names is: name, offer_code, expiration_time, 5126// status, 5127// last_modified_time, sender_name, creation_time, country_code, 5128// offer_type. 5129func (c *OffersHistoryListCall) OrderBy(orderBy string) *OffersHistoryListCall { 5130 c.urlParams_.Set("orderBy", orderBy) 5131 return c 5132} 5133 5134// PageSize sets the optional parameter "pageSize": Maximum number of 5135// rows to return per page. 5136func (c *OffersHistoryListCall) PageSize(pageSize int64) *OffersHistoryListCall { 5137 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5138 return c 5139} 5140 5141// PageToken sets the optional parameter "pageToken": Token to retrieve 5142// a specific page. 5143func (c *OffersHistoryListCall) PageToken(pageToken string) *OffersHistoryListCall { 5144 c.urlParams_.Set("pageToken", pageToken) 5145 return c 5146} 5147 5148// RequestMetadataExperimentIds sets the optional parameter 5149// "requestMetadata.experimentIds": Experiment IDs the current request 5150// belongs to. 5151func (c *OffersHistoryListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *OffersHistoryListCall { 5152 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 5153 return c 5154} 5155 5156// RequestMetadataLocale sets the optional parameter 5157// "requestMetadata.locale": Locale to use for the current request. 5158func (c *OffersHistoryListCall) RequestMetadataLocale(requestMetadataLocale string) *OffersHistoryListCall { 5159 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 5160 return c 5161} 5162 5163// RequestMetadataPartnersSessionId sets the optional parameter 5164// "requestMetadata.partnersSessionId": Google Partners session ID. 5165func (c *OffersHistoryListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *OffersHistoryListCall { 5166 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 5167 return c 5168} 5169 5170// RequestMetadataTrafficSourceTrafficSourceId sets the optional 5171// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 5172// to indicate where the traffic comes from. 5173// An identifier has multiple letters created by a team which redirected 5174// the 5175// traffic to us. 5176func (c *OffersHistoryListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *OffersHistoryListCall { 5177 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 5178 return c 5179} 5180 5181// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 5182// "requestMetadata.trafficSource.trafficSubId": Second level identifier 5183// to indicate where the traffic comes from. 5184// An identifier has multiple letters created by a team which redirected 5185// the 5186// traffic to us. 5187func (c *OffersHistoryListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *OffersHistoryListCall { 5188 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 5189 return c 5190} 5191 5192// RequestMetadataUserOverridesIpAddress sets the optional parameter 5193// "requestMetadata.userOverrides.ipAddress": IP address to use instead 5194// of the user's geo-located IP address. 5195func (c *OffersHistoryListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *OffersHistoryListCall { 5196 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 5197 return c 5198} 5199 5200// RequestMetadataUserOverridesUserId sets the optional parameter 5201// "requestMetadata.userOverrides.userId": Logged-in user ID to 5202// impersonate instead of the user's ID. 5203func (c *OffersHistoryListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *OffersHistoryListCall { 5204 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 5205 return c 5206} 5207 5208// Fields allows partial responses to be retrieved. See 5209// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5210// for more information. 5211func (c *OffersHistoryListCall) Fields(s ...googleapi.Field) *OffersHistoryListCall { 5212 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5213 return c 5214} 5215 5216// IfNoneMatch sets the optional parameter which makes the operation 5217// fail if the object's ETag matches the given value. This is useful for 5218// getting updates only after the object has changed since the last 5219// request. Use googleapi.IsNotModified to check whether the response 5220// error from Do is the result of In-None-Match. 5221func (c *OffersHistoryListCall) IfNoneMatch(entityTag string) *OffersHistoryListCall { 5222 c.ifNoneMatch_ = entityTag 5223 return c 5224} 5225 5226// Context sets the context to be used in this call's Do method. Any 5227// pending HTTP request will be aborted if the provided context is 5228// canceled. 5229func (c *OffersHistoryListCall) Context(ctx context.Context) *OffersHistoryListCall { 5230 c.ctx_ = ctx 5231 return c 5232} 5233 5234// Header returns an http.Header that can be modified by the caller to 5235// add HTTP headers to the request. 5236func (c *OffersHistoryListCall) Header() http.Header { 5237 if c.header_ == nil { 5238 c.header_ = make(http.Header) 5239 } 5240 return c.header_ 5241} 5242 5243func (c *OffersHistoryListCall) doRequest(alt string) (*http.Response, error) { 5244 reqHeaders := make(http.Header) 5245 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 5246 for k, v := range c.header_ { 5247 reqHeaders[k] = v 5248 } 5249 reqHeaders.Set("User-Agent", c.s.userAgent()) 5250 if c.ifNoneMatch_ != "" { 5251 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5252 } 5253 var body io.Reader = nil 5254 c.urlParams_.Set("alt", alt) 5255 c.urlParams_.Set("prettyPrint", "false") 5256 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/offers/history") 5257 urls += "?" + c.urlParams_.Encode() 5258 req, err := http.NewRequest("GET", urls, body) 5259 if err != nil { 5260 return nil, err 5261 } 5262 req.Header = reqHeaders 5263 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5264} 5265 5266// Do executes the "partners.offers.history.list" call. 5267// Exactly one of *ListOffersHistoryResponse or error will be non-nil. 5268// Any non-2xx status code is an error. Response headers are in either 5269// *ListOffersHistoryResponse.ServerResponse.Header or (if a response 5270// was returned at all) in error.(*googleapi.Error).Header. Use 5271// googleapi.IsNotModified to check whether the returned error was 5272// because http.StatusNotModified was returned. 5273func (c *OffersHistoryListCall) Do(opts ...googleapi.CallOption) (*ListOffersHistoryResponse, error) { 5274 gensupport.SetOptions(c.urlParams_, opts...) 5275 res, err := c.doRequest("json") 5276 if res != nil && res.StatusCode == http.StatusNotModified { 5277 if res.Body != nil { 5278 res.Body.Close() 5279 } 5280 return nil, &googleapi.Error{ 5281 Code: res.StatusCode, 5282 Header: res.Header, 5283 } 5284 } 5285 if err != nil { 5286 return nil, err 5287 } 5288 defer googleapi.CloseBody(res) 5289 if err := googleapi.CheckResponse(res); err != nil { 5290 return nil, err 5291 } 5292 ret := &ListOffersHistoryResponse{ 5293 ServerResponse: googleapi.ServerResponse{ 5294 Header: res.Header, 5295 HTTPStatusCode: res.StatusCode, 5296 }, 5297 } 5298 target := &ret 5299 if err := gensupport.DecodeResponse(target, res); err != nil { 5300 return nil, err 5301 } 5302 return ret, nil 5303 // { 5304 // "description": "Lists the Historical Offers for the current user (or user's entire company)", 5305 // "flatPath": "v2/offers/history", 5306 // "httpMethod": "GET", 5307 // "id": "partners.offers.history.list", 5308 // "parameterOrder": [], 5309 // "parameters": { 5310 // "entireCompany": { 5311 // "description": "if true, show history for the entire company. Requires user to be admin.", 5312 // "location": "query", 5313 // "type": "boolean" 5314 // }, 5315 // "orderBy": { 5316 // "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.", 5317 // "location": "query", 5318 // "type": "string" 5319 // }, 5320 // "pageSize": { 5321 // "description": "Maximum number of rows to return per page.", 5322 // "format": "int32", 5323 // "location": "query", 5324 // "type": "integer" 5325 // }, 5326 // "pageToken": { 5327 // "description": "Token to retrieve a specific page.", 5328 // "location": "query", 5329 // "type": "string" 5330 // }, 5331 // "requestMetadata.experimentIds": { 5332 // "description": "Experiment IDs the current request belongs to.", 5333 // "location": "query", 5334 // "repeated": true, 5335 // "type": "string" 5336 // }, 5337 // "requestMetadata.locale": { 5338 // "description": "Locale to use for the current request.", 5339 // "location": "query", 5340 // "type": "string" 5341 // }, 5342 // "requestMetadata.partnersSessionId": { 5343 // "description": "Google Partners session ID.", 5344 // "location": "query", 5345 // "type": "string" 5346 // }, 5347 // "requestMetadata.trafficSource.trafficSourceId": { 5348 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 5349 // "location": "query", 5350 // "type": "string" 5351 // }, 5352 // "requestMetadata.trafficSource.trafficSubId": { 5353 // "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.", 5354 // "location": "query", 5355 // "type": "string" 5356 // }, 5357 // "requestMetadata.userOverrides.ipAddress": { 5358 // "description": "IP address to use instead of the user's geo-located IP address.", 5359 // "location": "query", 5360 // "type": "string" 5361 // }, 5362 // "requestMetadata.userOverrides.userId": { 5363 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 5364 // "location": "query", 5365 // "type": "string" 5366 // } 5367 // }, 5368 // "path": "v2/offers/history", 5369 // "response": { 5370 // "$ref": "ListOffersHistoryResponse" 5371 // } 5372 // } 5373 5374} 5375 5376// Pages invokes f for each page of results. 5377// A non-nil error returned from f will halt the iteration. 5378// The provided context supersedes any context provided to the Context method. 5379func (c *OffersHistoryListCall) Pages(ctx context.Context, f func(*ListOffersHistoryResponse) error) error { 5380 c.ctx_ = ctx 5381 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5382 for { 5383 x, err := c.Do() 5384 if err != nil { 5385 return err 5386 } 5387 if err := f(x); err != nil { 5388 return err 5389 } 5390 if x.NextPageToken == "" { 5391 return nil 5392 } 5393 c.PageToken(x.NextPageToken) 5394 } 5395} 5396 5397// method id "partners.userEvents.log": 5398 5399type UserEventsLogCall struct { 5400 s *Service 5401 logusereventrequest *LogUserEventRequest 5402 urlParams_ gensupport.URLParams 5403 ctx_ context.Context 5404 header_ http.Header 5405} 5406 5407// Log: Logs a user event. 5408func (r *UserEventsService) Log(logusereventrequest *LogUserEventRequest) *UserEventsLogCall { 5409 c := &UserEventsLogCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5410 c.logusereventrequest = logusereventrequest 5411 return c 5412} 5413 5414// Fields allows partial responses to be retrieved. See 5415// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5416// for more information. 5417func (c *UserEventsLogCall) Fields(s ...googleapi.Field) *UserEventsLogCall { 5418 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5419 return c 5420} 5421 5422// Context sets the context to be used in this call's Do method. Any 5423// pending HTTP request will be aborted if the provided context is 5424// canceled. 5425func (c *UserEventsLogCall) Context(ctx context.Context) *UserEventsLogCall { 5426 c.ctx_ = ctx 5427 return c 5428} 5429 5430// Header returns an http.Header that can be modified by the caller to 5431// add HTTP headers to the request. 5432func (c *UserEventsLogCall) Header() http.Header { 5433 if c.header_ == nil { 5434 c.header_ = make(http.Header) 5435 } 5436 return c.header_ 5437} 5438 5439func (c *UserEventsLogCall) doRequest(alt string) (*http.Response, error) { 5440 reqHeaders := make(http.Header) 5441 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 5442 for k, v := range c.header_ { 5443 reqHeaders[k] = v 5444 } 5445 reqHeaders.Set("User-Agent", c.s.userAgent()) 5446 var body io.Reader = nil 5447 body, err := googleapi.WithoutDataWrapper.JSONReader(c.logusereventrequest) 5448 if err != nil { 5449 return nil, err 5450 } 5451 reqHeaders.Set("Content-Type", "application/json") 5452 c.urlParams_.Set("alt", alt) 5453 c.urlParams_.Set("prettyPrint", "false") 5454 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/userEvents:log") 5455 urls += "?" + c.urlParams_.Encode() 5456 req, err := http.NewRequest("POST", urls, body) 5457 if err != nil { 5458 return nil, err 5459 } 5460 req.Header = reqHeaders 5461 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5462} 5463 5464// Do executes the "partners.userEvents.log" call. 5465// Exactly one of *LogUserEventResponse or error will be non-nil. Any 5466// non-2xx status code is an error. Response headers are in either 5467// *LogUserEventResponse.ServerResponse.Header or (if a response was 5468// returned at all) in error.(*googleapi.Error).Header. Use 5469// googleapi.IsNotModified to check whether the returned error was 5470// because http.StatusNotModified was returned. 5471func (c *UserEventsLogCall) Do(opts ...googleapi.CallOption) (*LogUserEventResponse, error) { 5472 gensupport.SetOptions(c.urlParams_, opts...) 5473 res, err := c.doRequest("json") 5474 if res != nil && res.StatusCode == http.StatusNotModified { 5475 if res.Body != nil { 5476 res.Body.Close() 5477 } 5478 return nil, &googleapi.Error{ 5479 Code: res.StatusCode, 5480 Header: res.Header, 5481 } 5482 } 5483 if err != nil { 5484 return nil, err 5485 } 5486 defer googleapi.CloseBody(res) 5487 if err := googleapi.CheckResponse(res); err != nil { 5488 return nil, err 5489 } 5490 ret := &LogUserEventResponse{ 5491 ServerResponse: googleapi.ServerResponse{ 5492 Header: res.Header, 5493 HTTPStatusCode: res.StatusCode, 5494 }, 5495 } 5496 target := &ret 5497 if err := gensupport.DecodeResponse(target, res); err != nil { 5498 return nil, err 5499 } 5500 return ret, nil 5501 // { 5502 // "description": "Logs a user event.", 5503 // "flatPath": "v2/userEvents:log", 5504 // "httpMethod": "POST", 5505 // "id": "partners.userEvents.log", 5506 // "parameterOrder": [], 5507 // "parameters": {}, 5508 // "path": "v2/userEvents:log", 5509 // "request": { 5510 // "$ref": "LogUserEventRequest" 5511 // }, 5512 // "response": { 5513 // "$ref": "LogUserEventResponse" 5514 // } 5515 // } 5516 5517} 5518 5519// method id "partners.userStates.list": 5520 5521type UserStatesListCall struct { 5522 s *Service 5523 urlParams_ gensupport.URLParams 5524 ifNoneMatch_ string 5525 ctx_ context.Context 5526 header_ http.Header 5527} 5528 5529// List: Lists states for current user. 5530func (r *UserStatesService) List() *UserStatesListCall { 5531 c := &UserStatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5532 return c 5533} 5534 5535// RequestMetadataExperimentIds sets the optional parameter 5536// "requestMetadata.experimentIds": Experiment IDs the current request 5537// belongs to. 5538func (c *UserStatesListCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UserStatesListCall { 5539 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 5540 return c 5541} 5542 5543// RequestMetadataLocale sets the optional parameter 5544// "requestMetadata.locale": Locale to use for the current request. 5545func (c *UserStatesListCall) RequestMetadataLocale(requestMetadataLocale string) *UserStatesListCall { 5546 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 5547 return c 5548} 5549 5550// RequestMetadataPartnersSessionId sets the optional parameter 5551// "requestMetadata.partnersSessionId": Google Partners session ID. 5552func (c *UserStatesListCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UserStatesListCall { 5553 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 5554 return c 5555} 5556 5557// RequestMetadataTrafficSourceTrafficSourceId sets the optional 5558// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 5559// to indicate where the traffic comes from. 5560// An identifier has multiple letters created by a team which redirected 5561// the 5562// traffic to us. 5563func (c *UserStatesListCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UserStatesListCall { 5564 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 5565 return c 5566} 5567 5568// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 5569// "requestMetadata.trafficSource.trafficSubId": Second level identifier 5570// to indicate where the traffic comes from. 5571// An identifier has multiple letters created by a team which redirected 5572// the 5573// traffic to us. 5574func (c *UserStatesListCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UserStatesListCall { 5575 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 5576 return c 5577} 5578 5579// RequestMetadataUserOverridesIpAddress sets the optional parameter 5580// "requestMetadata.userOverrides.ipAddress": IP address to use instead 5581// of the user's geo-located IP address. 5582func (c *UserStatesListCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UserStatesListCall { 5583 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 5584 return c 5585} 5586 5587// RequestMetadataUserOverridesUserId sets the optional parameter 5588// "requestMetadata.userOverrides.userId": Logged-in user ID to 5589// impersonate instead of the user's ID. 5590func (c *UserStatesListCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UserStatesListCall { 5591 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 5592 return c 5593} 5594 5595// Fields allows partial responses to be retrieved. See 5596// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5597// for more information. 5598func (c *UserStatesListCall) Fields(s ...googleapi.Field) *UserStatesListCall { 5599 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5600 return c 5601} 5602 5603// IfNoneMatch sets the optional parameter which makes the operation 5604// fail if the object's ETag matches the given value. This is useful for 5605// getting updates only after the object has changed since the last 5606// request. Use googleapi.IsNotModified to check whether the response 5607// error from Do is the result of In-None-Match. 5608func (c *UserStatesListCall) IfNoneMatch(entityTag string) *UserStatesListCall { 5609 c.ifNoneMatch_ = entityTag 5610 return c 5611} 5612 5613// Context sets the context to be used in this call's Do method. Any 5614// pending HTTP request will be aborted if the provided context is 5615// canceled. 5616func (c *UserStatesListCall) Context(ctx context.Context) *UserStatesListCall { 5617 c.ctx_ = ctx 5618 return c 5619} 5620 5621// Header returns an http.Header that can be modified by the caller to 5622// add HTTP headers to the request. 5623func (c *UserStatesListCall) Header() http.Header { 5624 if c.header_ == nil { 5625 c.header_ = make(http.Header) 5626 } 5627 return c.header_ 5628} 5629 5630func (c *UserStatesListCall) doRequest(alt string) (*http.Response, error) { 5631 reqHeaders := make(http.Header) 5632 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 5633 for k, v := range c.header_ { 5634 reqHeaders[k] = v 5635 } 5636 reqHeaders.Set("User-Agent", c.s.userAgent()) 5637 if c.ifNoneMatch_ != "" { 5638 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5639 } 5640 var body io.Reader = nil 5641 c.urlParams_.Set("alt", alt) 5642 c.urlParams_.Set("prettyPrint", "false") 5643 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/userStates") 5644 urls += "?" + c.urlParams_.Encode() 5645 req, err := http.NewRequest("GET", urls, body) 5646 if err != nil { 5647 return nil, err 5648 } 5649 req.Header = reqHeaders 5650 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5651} 5652 5653// Do executes the "partners.userStates.list" call. 5654// Exactly one of *ListUserStatesResponse or error will be non-nil. Any 5655// non-2xx status code is an error. Response headers are in either 5656// *ListUserStatesResponse.ServerResponse.Header or (if a response was 5657// returned at all) in error.(*googleapi.Error).Header. Use 5658// googleapi.IsNotModified to check whether the returned error was 5659// because http.StatusNotModified was returned. 5660func (c *UserStatesListCall) Do(opts ...googleapi.CallOption) (*ListUserStatesResponse, error) { 5661 gensupport.SetOptions(c.urlParams_, opts...) 5662 res, err := c.doRequest("json") 5663 if res != nil && res.StatusCode == http.StatusNotModified { 5664 if res.Body != nil { 5665 res.Body.Close() 5666 } 5667 return nil, &googleapi.Error{ 5668 Code: res.StatusCode, 5669 Header: res.Header, 5670 } 5671 } 5672 if err != nil { 5673 return nil, err 5674 } 5675 defer googleapi.CloseBody(res) 5676 if err := googleapi.CheckResponse(res); err != nil { 5677 return nil, err 5678 } 5679 ret := &ListUserStatesResponse{ 5680 ServerResponse: googleapi.ServerResponse{ 5681 Header: res.Header, 5682 HTTPStatusCode: res.StatusCode, 5683 }, 5684 } 5685 target := &ret 5686 if err := gensupport.DecodeResponse(target, res); err != nil { 5687 return nil, err 5688 } 5689 return ret, nil 5690 // { 5691 // "description": "Lists states for current user.", 5692 // "flatPath": "v2/userStates", 5693 // "httpMethod": "GET", 5694 // "id": "partners.userStates.list", 5695 // "parameterOrder": [], 5696 // "parameters": { 5697 // "requestMetadata.experimentIds": { 5698 // "description": "Experiment IDs the current request belongs to.", 5699 // "location": "query", 5700 // "repeated": true, 5701 // "type": "string" 5702 // }, 5703 // "requestMetadata.locale": { 5704 // "description": "Locale to use for the current request.", 5705 // "location": "query", 5706 // "type": "string" 5707 // }, 5708 // "requestMetadata.partnersSessionId": { 5709 // "description": "Google Partners session ID.", 5710 // "location": "query", 5711 // "type": "string" 5712 // }, 5713 // "requestMetadata.trafficSource.trafficSourceId": { 5714 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 5715 // "location": "query", 5716 // "type": "string" 5717 // }, 5718 // "requestMetadata.trafficSource.trafficSubId": { 5719 // "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.", 5720 // "location": "query", 5721 // "type": "string" 5722 // }, 5723 // "requestMetadata.userOverrides.ipAddress": { 5724 // "description": "IP address to use instead of the user's geo-located IP address.", 5725 // "location": "query", 5726 // "type": "string" 5727 // }, 5728 // "requestMetadata.userOverrides.userId": { 5729 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 5730 // "location": "query", 5731 // "type": "string" 5732 // } 5733 // }, 5734 // "path": "v2/userStates", 5735 // "response": { 5736 // "$ref": "ListUserStatesResponse" 5737 // } 5738 // } 5739 5740} 5741 5742// method id "partners.users.createCompanyRelation": 5743 5744type UsersCreateCompanyRelationCall struct { 5745 s *Service 5746 userId string 5747 companyrelation *CompanyRelation 5748 urlParams_ gensupport.URLParams 5749 ctx_ context.Context 5750 header_ http.Header 5751} 5752 5753// CreateCompanyRelation: Creates a user's company relation. Affiliates 5754// the user to a company. 5755func (r *UsersService) CreateCompanyRelation(userId string, companyrelation *CompanyRelation) *UsersCreateCompanyRelationCall { 5756 c := &UsersCreateCompanyRelationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5757 c.userId = userId 5758 c.companyrelation = companyrelation 5759 return c 5760} 5761 5762// RequestMetadataExperimentIds sets the optional parameter 5763// "requestMetadata.experimentIds": Experiment IDs the current request 5764// belongs to. 5765func (c *UsersCreateCompanyRelationCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersCreateCompanyRelationCall { 5766 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 5767 return c 5768} 5769 5770// RequestMetadataLocale sets the optional parameter 5771// "requestMetadata.locale": Locale to use for the current request. 5772func (c *UsersCreateCompanyRelationCall) RequestMetadataLocale(requestMetadataLocale string) *UsersCreateCompanyRelationCall { 5773 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 5774 return c 5775} 5776 5777// RequestMetadataPartnersSessionId sets the optional parameter 5778// "requestMetadata.partnersSessionId": Google Partners session ID. 5779func (c *UsersCreateCompanyRelationCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersCreateCompanyRelationCall { 5780 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 5781 return c 5782} 5783 5784// RequestMetadataTrafficSourceTrafficSourceId sets the optional 5785// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 5786// to indicate where the traffic comes from. 5787// An identifier has multiple letters created by a team which redirected 5788// the 5789// traffic to us. 5790func (c *UsersCreateCompanyRelationCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersCreateCompanyRelationCall { 5791 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 5792 return c 5793} 5794 5795// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 5796// "requestMetadata.trafficSource.trafficSubId": Second level identifier 5797// to indicate where the traffic comes from. 5798// An identifier has multiple letters created by a team which redirected 5799// the 5800// traffic to us. 5801func (c *UsersCreateCompanyRelationCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersCreateCompanyRelationCall { 5802 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 5803 return c 5804} 5805 5806// RequestMetadataUserOverridesIpAddress sets the optional parameter 5807// "requestMetadata.userOverrides.ipAddress": IP address to use instead 5808// of the user's geo-located IP address. 5809func (c *UsersCreateCompanyRelationCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersCreateCompanyRelationCall { 5810 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 5811 return c 5812} 5813 5814// RequestMetadataUserOverridesUserId sets the optional parameter 5815// "requestMetadata.userOverrides.userId": Logged-in user ID to 5816// impersonate instead of the user's ID. 5817func (c *UsersCreateCompanyRelationCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersCreateCompanyRelationCall { 5818 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 5819 return c 5820} 5821 5822// Fields allows partial responses to be retrieved. See 5823// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5824// for more information. 5825func (c *UsersCreateCompanyRelationCall) Fields(s ...googleapi.Field) *UsersCreateCompanyRelationCall { 5826 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5827 return c 5828} 5829 5830// Context sets the context to be used in this call's Do method. Any 5831// pending HTTP request will be aborted if the provided context is 5832// canceled. 5833func (c *UsersCreateCompanyRelationCall) Context(ctx context.Context) *UsersCreateCompanyRelationCall { 5834 c.ctx_ = ctx 5835 return c 5836} 5837 5838// Header returns an http.Header that can be modified by the caller to 5839// add HTTP headers to the request. 5840func (c *UsersCreateCompanyRelationCall) Header() http.Header { 5841 if c.header_ == nil { 5842 c.header_ = make(http.Header) 5843 } 5844 return c.header_ 5845} 5846 5847func (c *UsersCreateCompanyRelationCall) doRequest(alt string) (*http.Response, error) { 5848 reqHeaders := make(http.Header) 5849 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 5850 for k, v := range c.header_ { 5851 reqHeaders[k] = v 5852 } 5853 reqHeaders.Set("User-Agent", c.s.userAgent()) 5854 var body io.Reader = nil 5855 body, err := googleapi.WithoutDataWrapper.JSONReader(c.companyrelation) 5856 if err != nil { 5857 return nil, err 5858 } 5859 reqHeaders.Set("Content-Type", "application/json") 5860 c.urlParams_.Set("alt", alt) 5861 c.urlParams_.Set("prettyPrint", "false") 5862 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/companyRelation") 5863 urls += "?" + c.urlParams_.Encode() 5864 req, err := http.NewRequest("PUT", urls, body) 5865 if err != nil { 5866 return nil, err 5867 } 5868 req.Header = reqHeaders 5869 googleapi.Expand(req.URL, map[string]string{ 5870 "userId": c.userId, 5871 }) 5872 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5873} 5874 5875// Do executes the "partners.users.createCompanyRelation" call. 5876// Exactly one of *CompanyRelation or error will be non-nil. Any non-2xx 5877// status code is an error. Response headers are in either 5878// *CompanyRelation.ServerResponse.Header or (if a response was returned 5879// at all) in error.(*googleapi.Error).Header. Use 5880// googleapi.IsNotModified to check whether the returned error was 5881// because http.StatusNotModified was returned. 5882func (c *UsersCreateCompanyRelationCall) Do(opts ...googleapi.CallOption) (*CompanyRelation, error) { 5883 gensupport.SetOptions(c.urlParams_, opts...) 5884 res, err := c.doRequest("json") 5885 if res != nil && res.StatusCode == http.StatusNotModified { 5886 if res.Body != nil { 5887 res.Body.Close() 5888 } 5889 return nil, &googleapi.Error{ 5890 Code: res.StatusCode, 5891 Header: res.Header, 5892 } 5893 } 5894 if err != nil { 5895 return nil, err 5896 } 5897 defer googleapi.CloseBody(res) 5898 if err := googleapi.CheckResponse(res); err != nil { 5899 return nil, err 5900 } 5901 ret := &CompanyRelation{ 5902 ServerResponse: googleapi.ServerResponse{ 5903 Header: res.Header, 5904 HTTPStatusCode: res.StatusCode, 5905 }, 5906 } 5907 target := &ret 5908 if err := gensupport.DecodeResponse(target, res); err != nil { 5909 return nil, err 5910 } 5911 return ret, nil 5912 // { 5913 // "description": "Creates a user's company relation. Affiliates the user to a company.", 5914 // "flatPath": "v2/users/{userId}/companyRelation", 5915 // "httpMethod": "PUT", 5916 // "id": "partners.users.createCompanyRelation", 5917 // "parameterOrder": [ 5918 // "userId" 5919 // ], 5920 // "parameters": { 5921 // "requestMetadata.experimentIds": { 5922 // "description": "Experiment IDs the current request belongs to.", 5923 // "location": "query", 5924 // "repeated": true, 5925 // "type": "string" 5926 // }, 5927 // "requestMetadata.locale": { 5928 // "description": "Locale to use for the current request.", 5929 // "location": "query", 5930 // "type": "string" 5931 // }, 5932 // "requestMetadata.partnersSessionId": { 5933 // "description": "Google Partners session ID.", 5934 // "location": "query", 5935 // "type": "string" 5936 // }, 5937 // "requestMetadata.trafficSource.trafficSourceId": { 5938 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 5939 // "location": "query", 5940 // "type": "string" 5941 // }, 5942 // "requestMetadata.trafficSource.trafficSubId": { 5943 // "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.", 5944 // "location": "query", 5945 // "type": "string" 5946 // }, 5947 // "requestMetadata.userOverrides.ipAddress": { 5948 // "description": "IP address to use instead of the user's geo-located IP address.", 5949 // "location": "query", 5950 // "type": "string" 5951 // }, 5952 // "requestMetadata.userOverrides.userId": { 5953 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 5954 // "location": "query", 5955 // "type": "string" 5956 // }, 5957 // "userId": { 5958 // "description": "The ID of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean\nthe currently authenticated user.", 5959 // "location": "path", 5960 // "required": true, 5961 // "type": "string" 5962 // } 5963 // }, 5964 // "path": "v2/users/{userId}/companyRelation", 5965 // "request": { 5966 // "$ref": "CompanyRelation" 5967 // }, 5968 // "response": { 5969 // "$ref": "CompanyRelation" 5970 // } 5971 // } 5972 5973} 5974 5975// method id "partners.users.deleteCompanyRelation": 5976 5977type UsersDeleteCompanyRelationCall struct { 5978 s *Service 5979 userId string 5980 urlParams_ gensupport.URLParams 5981 ctx_ context.Context 5982 header_ http.Header 5983} 5984 5985// DeleteCompanyRelation: Deletes a user's company relation. 5986// Unaffiliaites the user from a company. 5987func (r *UsersService) DeleteCompanyRelation(userId string) *UsersDeleteCompanyRelationCall { 5988 c := &UsersDeleteCompanyRelationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5989 c.userId = userId 5990 return c 5991} 5992 5993// RequestMetadataExperimentIds sets the optional parameter 5994// "requestMetadata.experimentIds": Experiment IDs the current request 5995// belongs to. 5996func (c *UsersDeleteCompanyRelationCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersDeleteCompanyRelationCall { 5997 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 5998 return c 5999} 6000 6001// RequestMetadataLocale sets the optional parameter 6002// "requestMetadata.locale": Locale to use for the current request. 6003func (c *UsersDeleteCompanyRelationCall) RequestMetadataLocale(requestMetadataLocale string) *UsersDeleteCompanyRelationCall { 6004 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 6005 return c 6006} 6007 6008// RequestMetadataPartnersSessionId sets the optional parameter 6009// "requestMetadata.partnersSessionId": Google Partners session ID. 6010func (c *UsersDeleteCompanyRelationCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersDeleteCompanyRelationCall { 6011 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 6012 return c 6013} 6014 6015// RequestMetadataTrafficSourceTrafficSourceId sets the optional 6016// parameter "requestMetadata.trafficSource.trafficSourceId": 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) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersDeleteCompanyRelationCall { 6022 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 6023 return c 6024} 6025 6026// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 6027// "requestMetadata.trafficSource.trafficSubId": Second level identifier 6028// to indicate where the traffic comes from. 6029// An identifier has multiple letters created by a team which redirected 6030// the 6031// traffic to us. 6032func (c *UsersDeleteCompanyRelationCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersDeleteCompanyRelationCall { 6033 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 6034 return c 6035} 6036 6037// RequestMetadataUserOverridesIpAddress sets the optional parameter 6038// "requestMetadata.userOverrides.ipAddress": IP address to use instead 6039// of the user's geo-located IP address. 6040func (c *UsersDeleteCompanyRelationCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersDeleteCompanyRelationCall { 6041 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 6042 return c 6043} 6044 6045// RequestMetadataUserOverridesUserId sets the optional parameter 6046// "requestMetadata.userOverrides.userId": Logged-in user ID to 6047// impersonate instead of the user's ID. 6048func (c *UsersDeleteCompanyRelationCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersDeleteCompanyRelationCall { 6049 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 6050 return c 6051} 6052 6053// Fields allows partial responses to be retrieved. See 6054// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6055// for more information. 6056func (c *UsersDeleteCompanyRelationCall) Fields(s ...googleapi.Field) *UsersDeleteCompanyRelationCall { 6057 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6058 return c 6059} 6060 6061// Context sets the context to be used in this call's Do method. Any 6062// pending HTTP request will be aborted if the provided context is 6063// canceled. 6064func (c *UsersDeleteCompanyRelationCall) Context(ctx context.Context) *UsersDeleteCompanyRelationCall { 6065 c.ctx_ = ctx 6066 return c 6067} 6068 6069// Header returns an http.Header that can be modified by the caller to 6070// add HTTP headers to the request. 6071func (c *UsersDeleteCompanyRelationCall) Header() http.Header { 6072 if c.header_ == nil { 6073 c.header_ = make(http.Header) 6074 } 6075 return c.header_ 6076} 6077 6078func (c *UsersDeleteCompanyRelationCall) doRequest(alt string) (*http.Response, error) { 6079 reqHeaders := make(http.Header) 6080 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 6081 for k, v := range c.header_ { 6082 reqHeaders[k] = v 6083 } 6084 reqHeaders.Set("User-Agent", c.s.userAgent()) 6085 var body io.Reader = nil 6086 c.urlParams_.Set("alt", alt) 6087 c.urlParams_.Set("prettyPrint", "false") 6088 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}/companyRelation") 6089 urls += "?" + c.urlParams_.Encode() 6090 req, err := http.NewRequest("DELETE", urls, body) 6091 if err != nil { 6092 return nil, err 6093 } 6094 req.Header = reqHeaders 6095 googleapi.Expand(req.URL, map[string]string{ 6096 "userId": c.userId, 6097 }) 6098 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6099} 6100 6101// Do executes the "partners.users.deleteCompanyRelation" call. 6102// Exactly one of *Empty or error will be non-nil. Any non-2xx status 6103// code is an error. Response headers are in either 6104// *Empty.ServerResponse.Header or (if a response was returned at all) 6105// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6106// check whether the returned error was because http.StatusNotModified 6107// was returned. 6108func (c *UsersDeleteCompanyRelationCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 6109 gensupport.SetOptions(c.urlParams_, opts...) 6110 res, err := c.doRequest("json") 6111 if res != nil && res.StatusCode == http.StatusNotModified { 6112 if res.Body != nil { 6113 res.Body.Close() 6114 } 6115 return nil, &googleapi.Error{ 6116 Code: res.StatusCode, 6117 Header: res.Header, 6118 } 6119 } 6120 if err != nil { 6121 return nil, err 6122 } 6123 defer googleapi.CloseBody(res) 6124 if err := googleapi.CheckResponse(res); err != nil { 6125 return nil, err 6126 } 6127 ret := &Empty{ 6128 ServerResponse: googleapi.ServerResponse{ 6129 Header: res.Header, 6130 HTTPStatusCode: res.StatusCode, 6131 }, 6132 } 6133 target := &ret 6134 if err := gensupport.DecodeResponse(target, res); err != nil { 6135 return nil, err 6136 } 6137 return ret, nil 6138 // { 6139 // "description": "Deletes a user's company relation. Unaffiliaites the user from a company.", 6140 // "flatPath": "v2/users/{userId}/companyRelation", 6141 // "httpMethod": "DELETE", 6142 // "id": "partners.users.deleteCompanyRelation", 6143 // "parameterOrder": [ 6144 // "userId" 6145 // ], 6146 // "parameters": { 6147 // "requestMetadata.experimentIds": { 6148 // "description": "Experiment IDs the current request belongs to.", 6149 // "location": "query", 6150 // "repeated": true, 6151 // "type": "string" 6152 // }, 6153 // "requestMetadata.locale": { 6154 // "description": "Locale to use for the current request.", 6155 // "location": "query", 6156 // "type": "string" 6157 // }, 6158 // "requestMetadata.partnersSessionId": { 6159 // "description": "Google Partners session ID.", 6160 // "location": "query", 6161 // "type": "string" 6162 // }, 6163 // "requestMetadata.trafficSource.trafficSourceId": { 6164 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 6165 // "location": "query", 6166 // "type": "string" 6167 // }, 6168 // "requestMetadata.trafficSource.trafficSubId": { 6169 // "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.", 6170 // "location": "query", 6171 // "type": "string" 6172 // }, 6173 // "requestMetadata.userOverrides.ipAddress": { 6174 // "description": "IP address to use instead of the user's geo-located IP address.", 6175 // "location": "query", 6176 // "type": "string" 6177 // }, 6178 // "requestMetadata.userOverrides.userId": { 6179 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 6180 // "location": "query", 6181 // "type": "string" 6182 // }, 6183 // "userId": { 6184 // "description": "The ID of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean\nthe currently authenticated user.", 6185 // "location": "path", 6186 // "required": true, 6187 // "type": "string" 6188 // } 6189 // }, 6190 // "path": "v2/users/{userId}/companyRelation", 6191 // "response": { 6192 // "$ref": "Empty" 6193 // } 6194 // } 6195 6196} 6197 6198// method id "partners.users.get": 6199 6200type UsersGetCall struct { 6201 s *Service 6202 userId string 6203 urlParams_ gensupport.URLParams 6204 ifNoneMatch_ string 6205 ctx_ context.Context 6206 header_ http.Header 6207} 6208 6209// Get: Gets a user. 6210func (r *UsersService) Get(userId string) *UsersGetCall { 6211 c := &UsersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6212 c.userId = userId 6213 return c 6214} 6215 6216// RequestMetadataExperimentIds sets the optional parameter 6217// "requestMetadata.experimentIds": Experiment IDs the current request 6218// belongs to. 6219func (c *UsersGetCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersGetCall { 6220 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 6221 return c 6222} 6223 6224// RequestMetadataLocale sets the optional parameter 6225// "requestMetadata.locale": Locale to use for the current request. 6226func (c *UsersGetCall) RequestMetadataLocale(requestMetadataLocale string) *UsersGetCall { 6227 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 6228 return c 6229} 6230 6231// RequestMetadataPartnersSessionId sets the optional parameter 6232// "requestMetadata.partnersSessionId": Google Partners session ID. 6233func (c *UsersGetCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersGetCall { 6234 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 6235 return c 6236} 6237 6238// RequestMetadataTrafficSourceTrafficSourceId sets the optional 6239// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 6240// to indicate where the traffic comes from. 6241// An identifier has multiple letters created by a team which redirected 6242// the 6243// traffic to us. 6244func (c *UsersGetCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersGetCall { 6245 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 6246 return c 6247} 6248 6249// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 6250// "requestMetadata.trafficSource.trafficSubId": Second level identifier 6251// to indicate where the traffic comes from. 6252// An identifier has multiple letters created by a team which redirected 6253// the 6254// traffic to us. 6255func (c *UsersGetCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersGetCall { 6256 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 6257 return c 6258} 6259 6260// RequestMetadataUserOverridesIpAddress sets the optional parameter 6261// "requestMetadata.userOverrides.ipAddress": IP address to use instead 6262// of the user's geo-located IP address. 6263func (c *UsersGetCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersGetCall { 6264 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 6265 return c 6266} 6267 6268// RequestMetadataUserOverridesUserId sets the optional parameter 6269// "requestMetadata.userOverrides.userId": Logged-in user ID to 6270// impersonate instead of the user's ID. 6271func (c *UsersGetCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersGetCall { 6272 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 6273 return c 6274} 6275 6276// UserView sets the optional parameter "userView": Specifies what parts 6277// of the user information to return. 6278// 6279// Possible values: 6280// "BASIC" 6281// "PROFILE" 6282// "PUBLIC_PROFILE" 6283func (c *UsersGetCall) UserView(userView string) *UsersGetCall { 6284 c.urlParams_.Set("userView", userView) 6285 return c 6286} 6287 6288// Fields allows partial responses to be retrieved. See 6289// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6290// for more information. 6291func (c *UsersGetCall) Fields(s ...googleapi.Field) *UsersGetCall { 6292 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6293 return c 6294} 6295 6296// IfNoneMatch sets the optional parameter which makes the operation 6297// fail if the object's ETag matches the given value. This is useful for 6298// getting updates only after the object has changed since the last 6299// request. Use googleapi.IsNotModified to check whether the response 6300// error from Do is the result of In-None-Match. 6301func (c *UsersGetCall) IfNoneMatch(entityTag string) *UsersGetCall { 6302 c.ifNoneMatch_ = entityTag 6303 return c 6304} 6305 6306// Context sets the context to be used in this call's Do method. Any 6307// pending HTTP request will be aborted if the provided context is 6308// canceled. 6309func (c *UsersGetCall) Context(ctx context.Context) *UsersGetCall { 6310 c.ctx_ = ctx 6311 return c 6312} 6313 6314// Header returns an http.Header that can be modified by the caller to 6315// add HTTP headers to the request. 6316func (c *UsersGetCall) Header() http.Header { 6317 if c.header_ == nil { 6318 c.header_ = make(http.Header) 6319 } 6320 return c.header_ 6321} 6322 6323func (c *UsersGetCall) doRequest(alt string) (*http.Response, error) { 6324 reqHeaders := make(http.Header) 6325 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 6326 for k, v := range c.header_ { 6327 reqHeaders[k] = v 6328 } 6329 reqHeaders.Set("User-Agent", c.s.userAgent()) 6330 if c.ifNoneMatch_ != "" { 6331 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6332 } 6333 var body io.Reader = nil 6334 c.urlParams_.Set("alt", alt) 6335 c.urlParams_.Set("prettyPrint", "false") 6336 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/{userId}") 6337 urls += "?" + c.urlParams_.Encode() 6338 req, err := http.NewRequest("GET", urls, body) 6339 if err != nil { 6340 return nil, err 6341 } 6342 req.Header = reqHeaders 6343 googleapi.Expand(req.URL, map[string]string{ 6344 "userId": c.userId, 6345 }) 6346 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6347} 6348 6349// Do executes the "partners.users.get" call. 6350// Exactly one of *User or error will be non-nil. Any non-2xx status 6351// code is an error. Response headers are in either 6352// *User.ServerResponse.Header or (if a response was returned at all) in 6353// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6354// whether the returned error was because http.StatusNotModified was 6355// returned. 6356func (c *UsersGetCall) Do(opts ...googleapi.CallOption) (*User, error) { 6357 gensupport.SetOptions(c.urlParams_, opts...) 6358 res, err := c.doRequest("json") 6359 if res != nil && res.StatusCode == http.StatusNotModified { 6360 if res.Body != nil { 6361 res.Body.Close() 6362 } 6363 return nil, &googleapi.Error{ 6364 Code: res.StatusCode, 6365 Header: res.Header, 6366 } 6367 } 6368 if err != nil { 6369 return nil, err 6370 } 6371 defer googleapi.CloseBody(res) 6372 if err := googleapi.CheckResponse(res); err != nil { 6373 return nil, err 6374 } 6375 ret := &User{ 6376 ServerResponse: googleapi.ServerResponse{ 6377 Header: res.Header, 6378 HTTPStatusCode: res.StatusCode, 6379 }, 6380 } 6381 target := &ret 6382 if err := gensupport.DecodeResponse(target, res); err != nil { 6383 return nil, err 6384 } 6385 return ret, nil 6386 // { 6387 // "description": "Gets a user.", 6388 // "flatPath": "v2/users/{userId}", 6389 // "httpMethod": "GET", 6390 // "id": "partners.users.get", 6391 // "parameterOrder": [ 6392 // "userId" 6393 // ], 6394 // "parameters": { 6395 // "requestMetadata.experimentIds": { 6396 // "description": "Experiment IDs the current request belongs to.", 6397 // "location": "query", 6398 // "repeated": true, 6399 // "type": "string" 6400 // }, 6401 // "requestMetadata.locale": { 6402 // "description": "Locale to use for the current request.", 6403 // "location": "query", 6404 // "type": "string" 6405 // }, 6406 // "requestMetadata.partnersSessionId": { 6407 // "description": "Google Partners session ID.", 6408 // "location": "query", 6409 // "type": "string" 6410 // }, 6411 // "requestMetadata.trafficSource.trafficSourceId": { 6412 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 6413 // "location": "query", 6414 // "type": "string" 6415 // }, 6416 // "requestMetadata.trafficSource.trafficSubId": { 6417 // "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.", 6418 // "location": "query", 6419 // "type": "string" 6420 // }, 6421 // "requestMetadata.userOverrides.ipAddress": { 6422 // "description": "IP address to use instead of the user's geo-located IP address.", 6423 // "location": "query", 6424 // "type": "string" 6425 // }, 6426 // "requestMetadata.userOverrides.userId": { 6427 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 6428 // "location": "query", 6429 // "type": "string" 6430 // }, 6431 // "userId": { 6432 // "description": "Identifier of the user. Can be set to \u003ccode\u003eme\u003c/code\u003e to mean the currently\nauthenticated user.", 6433 // "location": "path", 6434 // "required": true, 6435 // "type": "string" 6436 // }, 6437 // "userView": { 6438 // "description": "Specifies what parts of the user information to return.", 6439 // "enum": [ 6440 // "BASIC", 6441 // "PROFILE", 6442 // "PUBLIC_PROFILE" 6443 // ], 6444 // "location": "query", 6445 // "type": "string" 6446 // } 6447 // }, 6448 // "path": "v2/users/{userId}", 6449 // "response": { 6450 // "$ref": "User" 6451 // } 6452 // } 6453 6454} 6455 6456// method id "partners.users.updateProfile": 6457 6458type UsersUpdateProfileCall struct { 6459 s *Service 6460 userprofile *UserProfile 6461 urlParams_ gensupport.URLParams 6462 ctx_ context.Context 6463 header_ http.Header 6464} 6465 6466// UpdateProfile: Updates a user's profile. A user can only update their 6467// own profile and 6468// should only be called within the context of a logged in user. 6469func (r *UsersService) UpdateProfile(userprofile *UserProfile) *UsersUpdateProfileCall { 6470 c := &UsersUpdateProfileCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6471 c.userprofile = userprofile 6472 return c 6473} 6474 6475// RequestMetadataExperimentIds sets the optional parameter 6476// "requestMetadata.experimentIds": Experiment IDs the current request 6477// belongs to. 6478func (c *UsersUpdateProfileCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *UsersUpdateProfileCall { 6479 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 6480 return c 6481} 6482 6483// RequestMetadataLocale sets the optional parameter 6484// "requestMetadata.locale": Locale to use for the current request. 6485func (c *UsersUpdateProfileCall) RequestMetadataLocale(requestMetadataLocale string) *UsersUpdateProfileCall { 6486 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 6487 return c 6488} 6489 6490// RequestMetadataPartnersSessionId sets the optional parameter 6491// "requestMetadata.partnersSessionId": Google Partners session ID. 6492func (c *UsersUpdateProfileCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *UsersUpdateProfileCall { 6493 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 6494 return c 6495} 6496 6497// RequestMetadataTrafficSourceTrafficSourceId sets the optional 6498// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 6499// to indicate where the traffic comes from. 6500// An identifier has multiple letters created by a team which redirected 6501// the 6502// traffic to us. 6503func (c *UsersUpdateProfileCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *UsersUpdateProfileCall { 6504 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 6505 return c 6506} 6507 6508// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 6509// "requestMetadata.trafficSource.trafficSubId": Second level identifier 6510// to indicate where the traffic comes from. 6511// An identifier has multiple letters created by a team which redirected 6512// the 6513// traffic to us. 6514func (c *UsersUpdateProfileCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *UsersUpdateProfileCall { 6515 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 6516 return c 6517} 6518 6519// RequestMetadataUserOverridesIpAddress sets the optional parameter 6520// "requestMetadata.userOverrides.ipAddress": IP address to use instead 6521// of the user's geo-located IP address. 6522func (c *UsersUpdateProfileCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *UsersUpdateProfileCall { 6523 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 6524 return c 6525} 6526 6527// RequestMetadataUserOverridesUserId sets the optional parameter 6528// "requestMetadata.userOverrides.userId": Logged-in user ID to 6529// impersonate instead of the user's ID. 6530func (c *UsersUpdateProfileCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *UsersUpdateProfileCall { 6531 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 6532 return c 6533} 6534 6535// Fields allows partial responses to be retrieved. See 6536// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6537// for more information. 6538func (c *UsersUpdateProfileCall) Fields(s ...googleapi.Field) *UsersUpdateProfileCall { 6539 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6540 return c 6541} 6542 6543// Context sets the context to be used in this call's Do method. Any 6544// pending HTTP request will be aborted if the provided context is 6545// canceled. 6546func (c *UsersUpdateProfileCall) Context(ctx context.Context) *UsersUpdateProfileCall { 6547 c.ctx_ = ctx 6548 return c 6549} 6550 6551// Header returns an http.Header that can be modified by the caller to 6552// add HTTP headers to the request. 6553func (c *UsersUpdateProfileCall) Header() http.Header { 6554 if c.header_ == nil { 6555 c.header_ = make(http.Header) 6556 } 6557 return c.header_ 6558} 6559 6560func (c *UsersUpdateProfileCall) doRequest(alt string) (*http.Response, error) { 6561 reqHeaders := make(http.Header) 6562 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 6563 for k, v := range c.header_ { 6564 reqHeaders[k] = v 6565 } 6566 reqHeaders.Set("User-Agent", c.s.userAgent()) 6567 var body io.Reader = nil 6568 body, err := googleapi.WithoutDataWrapper.JSONReader(c.userprofile) 6569 if err != nil { 6570 return nil, err 6571 } 6572 reqHeaders.Set("Content-Type", "application/json") 6573 c.urlParams_.Set("alt", alt) 6574 c.urlParams_.Set("prettyPrint", "false") 6575 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/users/profile") 6576 urls += "?" + c.urlParams_.Encode() 6577 req, err := http.NewRequest("PATCH", urls, body) 6578 if err != nil { 6579 return nil, err 6580 } 6581 req.Header = reqHeaders 6582 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6583} 6584 6585// Do executes the "partners.users.updateProfile" call. 6586// Exactly one of *UserProfile or error will be non-nil. Any non-2xx 6587// status code is an error. Response headers are in either 6588// *UserProfile.ServerResponse.Header or (if a response was returned at 6589// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6590// to check whether the returned error was because 6591// http.StatusNotModified was returned. 6592func (c *UsersUpdateProfileCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) { 6593 gensupport.SetOptions(c.urlParams_, opts...) 6594 res, err := c.doRequest("json") 6595 if res != nil && res.StatusCode == http.StatusNotModified { 6596 if res.Body != nil { 6597 res.Body.Close() 6598 } 6599 return nil, &googleapi.Error{ 6600 Code: res.StatusCode, 6601 Header: res.Header, 6602 } 6603 } 6604 if err != nil { 6605 return nil, err 6606 } 6607 defer googleapi.CloseBody(res) 6608 if err := googleapi.CheckResponse(res); err != nil { 6609 return nil, err 6610 } 6611 ret := &UserProfile{ 6612 ServerResponse: googleapi.ServerResponse{ 6613 Header: res.Header, 6614 HTTPStatusCode: res.StatusCode, 6615 }, 6616 } 6617 target := &ret 6618 if err := gensupport.DecodeResponse(target, res); err != nil { 6619 return nil, err 6620 } 6621 return ret, nil 6622 // { 6623 // "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.", 6624 // "flatPath": "v2/users/profile", 6625 // "httpMethod": "PATCH", 6626 // "id": "partners.users.updateProfile", 6627 // "parameterOrder": [], 6628 // "parameters": { 6629 // "requestMetadata.experimentIds": { 6630 // "description": "Experiment IDs the current request belongs to.", 6631 // "location": "query", 6632 // "repeated": true, 6633 // "type": "string" 6634 // }, 6635 // "requestMetadata.locale": { 6636 // "description": "Locale to use for the current request.", 6637 // "location": "query", 6638 // "type": "string" 6639 // }, 6640 // "requestMetadata.partnersSessionId": { 6641 // "description": "Google Partners session ID.", 6642 // "location": "query", 6643 // "type": "string" 6644 // }, 6645 // "requestMetadata.trafficSource.trafficSourceId": { 6646 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 6647 // "location": "query", 6648 // "type": "string" 6649 // }, 6650 // "requestMetadata.trafficSource.trafficSubId": { 6651 // "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.", 6652 // "location": "query", 6653 // "type": "string" 6654 // }, 6655 // "requestMetadata.userOverrides.ipAddress": { 6656 // "description": "IP address to use instead of the user's geo-located IP address.", 6657 // "location": "query", 6658 // "type": "string" 6659 // }, 6660 // "requestMetadata.userOverrides.userId": { 6661 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 6662 // "location": "query", 6663 // "type": "string" 6664 // } 6665 // }, 6666 // "path": "v2/users/profile", 6667 // "request": { 6668 // "$ref": "UserProfile" 6669 // }, 6670 // "response": { 6671 // "$ref": "UserProfile" 6672 // } 6673 // } 6674 6675} 6676 6677// method id "partners.getPartnersstatus": 6678 6679type V2GetPartnersstatusCall struct { 6680 s *Service 6681 urlParams_ gensupport.URLParams 6682 ifNoneMatch_ string 6683 ctx_ context.Context 6684 header_ http.Header 6685} 6686 6687// GetPartnersstatus: Gets Partners Status of the logged in user's 6688// agency. 6689// Should only be called if the logged in user is the admin of the 6690// agency. 6691func (r *V2Service) GetPartnersstatus() *V2GetPartnersstatusCall { 6692 c := &V2GetPartnersstatusCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6693 return c 6694} 6695 6696// RequestMetadataExperimentIds sets the optional parameter 6697// "requestMetadata.experimentIds": Experiment IDs the current request 6698// belongs to. 6699func (c *V2GetPartnersstatusCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *V2GetPartnersstatusCall { 6700 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 6701 return c 6702} 6703 6704// RequestMetadataLocale sets the optional parameter 6705// "requestMetadata.locale": Locale to use for the current request. 6706func (c *V2GetPartnersstatusCall) RequestMetadataLocale(requestMetadataLocale string) *V2GetPartnersstatusCall { 6707 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 6708 return c 6709} 6710 6711// RequestMetadataPartnersSessionId sets the optional parameter 6712// "requestMetadata.partnersSessionId": Google Partners session ID. 6713func (c *V2GetPartnersstatusCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *V2GetPartnersstatusCall { 6714 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 6715 return c 6716} 6717 6718// RequestMetadataTrafficSourceTrafficSourceId sets the optional 6719// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 6720// to indicate where the traffic comes from. 6721// An identifier has multiple letters created by a team which redirected 6722// the 6723// traffic to us. 6724func (c *V2GetPartnersstatusCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *V2GetPartnersstatusCall { 6725 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 6726 return c 6727} 6728 6729// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 6730// "requestMetadata.trafficSource.trafficSubId": Second level identifier 6731// to indicate where the traffic comes from. 6732// An identifier has multiple letters created by a team which redirected 6733// the 6734// traffic to us. 6735func (c *V2GetPartnersstatusCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *V2GetPartnersstatusCall { 6736 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 6737 return c 6738} 6739 6740// RequestMetadataUserOverridesIpAddress sets the optional parameter 6741// "requestMetadata.userOverrides.ipAddress": IP address to use instead 6742// of the user's geo-located IP address. 6743func (c *V2GetPartnersstatusCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *V2GetPartnersstatusCall { 6744 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 6745 return c 6746} 6747 6748// RequestMetadataUserOverridesUserId sets the optional parameter 6749// "requestMetadata.userOverrides.userId": Logged-in user ID to 6750// impersonate instead of the user's ID. 6751func (c *V2GetPartnersstatusCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *V2GetPartnersstatusCall { 6752 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 6753 return c 6754} 6755 6756// Fields allows partial responses to be retrieved. See 6757// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6758// for more information. 6759func (c *V2GetPartnersstatusCall) Fields(s ...googleapi.Field) *V2GetPartnersstatusCall { 6760 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6761 return c 6762} 6763 6764// IfNoneMatch sets the optional parameter which makes the operation 6765// fail if the object's ETag matches the given value. This is useful for 6766// getting updates only after the object has changed since the last 6767// request. Use googleapi.IsNotModified to check whether the response 6768// error from Do is the result of In-None-Match. 6769func (c *V2GetPartnersstatusCall) IfNoneMatch(entityTag string) *V2GetPartnersstatusCall { 6770 c.ifNoneMatch_ = entityTag 6771 return c 6772} 6773 6774// Context sets the context to be used in this call's Do method. Any 6775// pending HTTP request will be aborted if the provided context is 6776// canceled. 6777func (c *V2GetPartnersstatusCall) Context(ctx context.Context) *V2GetPartnersstatusCall { 6778 c.ctx_ = ctx 6779 return c 6780} 6781 6782// Header returns an http.Header that can be modified by the caller to 6783// add HTTP headers to the request. 6784func (c *V2GetPartnersstatusCall) Header() http.Header { 6785 if c.header_ == nil { 6786 c.header_ = make(http.Header) 6787 } 6788 return c.header_ 6789} 6790 6791func (c *V2GetPartnersstatusCall) doRequest(alt string) (*http.Response, error) { 6792 reqHeaders := make(http.Header) 6793 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 6794 for k, v := range c.header_ { 6795 reqHeaders[k] = v 6796 } 6797 reqHeaders.Set("User-Agent", c.s.userAgent()) 6798 if c.ifNoneMatch_ != "" { 6799 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6800 } 6801 var body io.Reader = nil 6802 c.urlParams_.Set("alt", alt) 6803 c.urlParams_.Set("prettyPrint", "false") 6804 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/partnersstatus") 6805 urls += "?" + c.urlParams_.Encode() 6806 req, err := http.NewRequest("GET", urls, body) 6807 if err != nil { 6808 return nil, err 6809 } 6810 req.Header = reqHeaders 6811 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6812} 6813 6814// Do executes the "partners.getPartnersstatus" call. 6815// Exactly one of *GetPartnersStatusResponse or error will be non-nil. 6816// Any non-2xx status code is an error. Response headers are in either 6817// *GetPartnersStatusResponse.ServerResponse.Header or (if a response 6818// was returned at all) in error.(*googleapi.Error).Header. Use 6819// googleapi.IsNotModified to check whether the returned error was 6820// because http.StatusNotModified was returned. 6821func (c *V2GetPartnersstatusCall) Do(opts ...googleapi.CallOption) (*GetPartnersStatusResponse, error) { 6822 gensupport.SetOptions(c.urlParams_, opts...) 6823 res, err := c.doRequest("json") 6824 if res != nil && res.StatusCode == http.StatusNotModified { 6825 if res.Body != nil { 6826 res.Body.Close() 6827 } 6828 return nil, &googleapi.Error{ 6829 Code: res.StatusCode, 6830 Header: res.Header, 6831 } 6832 } 6833 if err != nil { 6834 return nil, err 6835 } 6836 defer googleapi.CloseBody(res) 6837 if err := googleapi.CheckResponse(res); err != nil { 6838 return nil, err 6839 } 6840 ret := &GetPartnersStatusResponse{ 6841 ServerResponse: googleapi.ServerResponse{ 6842 Header: res.Header, 6843 HTTPStatusCode: res.StatusCode, 6844 }, 6845 } 6846 target := &ret 6847 if err := gensupport.DecodeResponse(target, res); err != nil { 6848 return nil, err 6849 } 6850 return ret, nil 6851 // { 6852 // "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.", 6853 // "flatPath": "v2/partnersstatus", 6854 // "httpMethod": "GET", 6855 // "id": "partners.getPartnersstatus", 6856 // "parameterOrder": [], 6857 // "parameters": { 6858 // "requestMetadata.experimentIds": { 6859 // "description": "Experiment IDs the current request belongs to.", 6860 // "location": "query", 6861 // "repeated": true, 6862 // "type": "string" 6863 // }, 6864 // "requestMetadata.locale": { 6865 // "description": "Locale to use for the current request.", 6866 // "location": "query", 6867 // "type": "string" 6868 // }, 6869 // "requestMetadata.partnersSessionId": { 6870 // "description": "Google Partners session ID.", 6871 // "location": "query", 6872 // "type": "string" 6873 // }, 6874 // "requestMetadata.trafficSource.trafficSourceId": { 6875 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 6876 // "location": "query", 6877 // "type": "string" 6878 // }, 6879 // "requestMetadata.trafficSource.trafficSubId": { 6880 // "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.", 6881 // "location": "query", 6882 // "type": "string" 6883 // }, 6884 // "requestMetadata.userOverrides.ipAddress": { 6885 // "description": "IP address to use instead of the user's geo-located IP address.", 6886 // "location": "query", 6887 // "type": "string" 6888 // }, 6889 // "requestMetadata.userOverrides.userId": { 6890 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 6891 // "location": "query", 6892 // "type": "string" 6893 // } 6894 // }, 6895 // "path": "v2/partnersstatus", 6896 // "response": { 6897 // "$ref": "GetPartnersStatusResponse" 6898 // } 6899 // } 6900 6901} 6902 6903// method id "partners.updateCompanies": 6904 6905type V2UpdateCompaniesCall struct { 6906 s *Service 6907 company *Company 6908 urlParams_ gensupport.URLParams 6909 ctx_ context.Context 6910 header_ http.Header 6911} 6912 6913// UpdateCompanies: Update company. 6914// Should only be called within the context of an authorized logged in 6915// user. 6916func (r *V2Service) UpdateCompanies(company *Company) *V2UpdateCompaniesCall { 6917 c := &V2UpdateCompaniesCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6918 c.company = company 6919 return c 6920} 6921 6922// RequestMetadataExperimentIds sets the optional parameter 6923// "requestMetadata.experimentIds": Experiment IDs the current request 6924// belongs to. 6925func (c *V2UpdateCompaniesCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *V2UpdateCompaniesCall { 6926 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 6927 return c 6928} 6929 6930// RequestMetadataLocale sets the optional parameter 6931// "requestMetadata.locale": Locale to use for the current request. 6932func (c *V2UpdateCompaniesCall) RequestMetadataLocale(requestMetadataLocale string) *V2UpdateCompaniesCall { 6933 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 6934 return c 6935} 6936 6937// RequestMetadataPartnersSessionId sets the optional parameter 6938// "requestMetadata.partnersSessionId": Google Partners session ID. 6939func (c *V2UpdateCompaniesCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *V2UpdateCompaniesCall { 6940 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 6941 return c 6942} 6943 6944// RequestMetadataTrafficSourceTrafficSourceId sets the optional 6945// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 6946// to indicate where the traffic comes from. 6947// An identifier has multiple letters created by a team which redirected 6948// the 6949// traffic to us. 6950func (c *V2UpdateCompaniesCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *V2UpdateCompaniesCall { 6951 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 6952 return c 6953} 6954 6955// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 6956// "requestMetadata.trafficSource.trafficSubId": Second level identifier 6957// to indicate where the traffic comes from. 6958// An identifier has multiple letters created by a team which redirected 6959// the 6960// traffic to us. 6961func (c *V2UpdateCompaniesCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *V2UpdateCompaniesCall { 6962 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 6963 return c 6964} 6965 6966// RequestMetadataUserOverridesIpAddress sets the optional parameter 6967// "requestMetadata.userOverrides.ipAddress": IP address to use instead 6968// of the user's geo-located IP address. 6969func (c *V2UpdateCompaniesCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *V2UpdateCompaniesCall { 6970 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 6971 return c 6972} 6973 6974// RequestMetadataUserOverridesUserId sets the optional parameter 6975// "requestMetadata.userOverrides.userId": Logged-in user ID to 6976// impersonate instead of the user's ID. 6977func (c *V2UpdateCompaniesCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *V2UpdateCompaniesCall { 6978 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 6979 return c 6980} 6981 6982// UpdateMask sets the optional parameter "updateMask": Standard field 6983// mask for the set of fields to be updated. 6984// Required with at least 1 value in FieldMask's paths. 6985func (c *V2UpdateCompaniesCall) UpdateMask(updateMask string) *V2UpdateCompaniesCall { 6986 c.urlParams_.Set("updateMask", updateMask) 6987 return c 6988} 6989 6990// Fields allows partial responses to be retrieved. See 6991// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6992// for more information. 6993func (c *V2UpdateCompaniesCall) Fields(s ...googleapi.Field) *V2UpdateCompaniesCall { 6994 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6995 return c 6996} 6997 6998// Context sets the context to be used in this call's Do method. Any 6999// pending HTTP request will be aborted if the provided context is 7000// canceled. 7001func (c *V2UpdateCompaniesCall) Context(ctx context.Context) *V2UpdateCompaniesCall { 7002 c.ctx_ = ctx 7003 return c 7004} 7005 7006// Header returns an http.Header that can be modified by the caller to 7007// add HTTP headers to the request. 7008func (c *V2UpdateCompaniesCall) Header() http.Header { 7009 if c.header_ == nil { 7010 c.header_ = make(http.Header) 7011 } 7012 return c.header_ 7013} 7014 7015func (c *V2UpdateCompaniesCall) doRequest(alt string) (*http.Response, error) { 7016 reqHeaders := make(http.Header) 7017 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 7018 for k, v := range c.header_ { 7019 reqHeaders[k] = v 7020 } 7021 reqHeaders.Set("User-Agent", c.s.userAgent()) 7022 var body io.Reader = nil 7023 body, err := googleapi.WithoutDataWrapper.JSONReader(c.company) 7024 if err != nil { 7025 return nil, err 7026 } 7027 reqHeaders.Set("Content-Type", "application/json") 7028 c.urlParams_.Set("alt", alt) 7029 c.urlParams_.Set("prettyPrint", "false") 7030 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/companies") 7031 urls += "?" + c.urlParams_.Encode() 7032 req, err := http.NewRequest("PATCH", urls, body) 7033 if err != nil { 7034 return nil, err 7035 } 7036 req.Header = reqHeaders 7037 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7038} 7039 7040// Do executes the "partners.updateCompanies" call. 7041// Exactly one of *Company or error will be non-nil. Any non-2xx status 7042// code is an error. Response headers are in either 7043// *Company.ServerResponse.Header or (if a response was returned at all) 7044// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7045// check whether the returned error was because http.StatusNotModified 7046// was returned. 7047func (c *V2UpdateCompaniesCall) Do(opts ...googleapi.CallOption) (*Company, error) { 7048 gensupport.SetOptions(c.urlParams_, opts...) 7049 res, err := c.doRequest("json") 7050 if res != nil && res.StatusCode == http.StatusNotModified { 7051 if res.Body != nil { 7052 res.Body.Close() 7053 } 7054 return nil, &googleapi.Error{ 7055 Code: res.StatusCode, 7056 Header: res.Header, 7057 } 7058 } 7059 if err != nil { 7060 return nil, err 7061 } 7062 defer googleapi.CloseBody(res) 7063 if err := googleapi.CheckResponse(res); err != nil { 7064 return nil, err 7065 } 7066 ret := &Company{ 7067 ServerResponse: googleapi.ServerResponse{ 7068 Header: res.Header, 7069 HTTPStatusCode: res.StatusCode, 7070 }, 7071 } 7072 target := &ret 7073 if err := gensupport.DecodeResponse(target, res); err != nil { 7074 return nil, err 7075 } 7076 return ret, nil 7077 // { 7078 // "description": "Update company.\nShould only be called within the context of an authorized logged in user.", 7079 // "flatPath": "v2/companies", 7080 // "httpMethod": "PATCH", 7081 // "id": "partners.updateCompanies", 7082 // "parameterOrder": [], 7083 // "parameters": { 7084 // "requestMetadata.experimentIds": { 7085 // "description": "Experiment IDs the current request belongs to.", 7086 // "location": "query", 7087 // "repeated": true, 7088 // "type": "string" 7089 // }, 7090 // "requestMetadata.locale": { 7091 // "description": "Locale to use for the current request.", 7092 // "location": "query", 7093 // "type": "string" 7094 // }, 7095 // "requestMetadata.partnersSessionId": { 7096 // "description": "Google Partners session ID.", 7097 // "location": "query", 7098 // "type": "string" 7099 // }, 7100 // "requestMetadata.trafficSource.trafficSourceId": { 7101 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 7102 // "location": "query", 7103 // "type": "string" 7104 // }, 7105 // "requestMetadata.trafficSource.trafficSubId": { 7106 // "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.", 7107 // "location": "query", 7108 // "type": "string" 7109 // }, 7110 // "requestMetadata.userOverrides.ipAddress": { 7111 // "description": "IP address to use instead of the user's geo-located IP address.", 7112 // "location": "query", 7113 // "type": "string" 7114 // }, 7115 // "requestMetadata.userOverrides.userId": { 7116 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 7117 // "location": "query", 7118 // "type": "string" 7119 // }, 7120 // "updateMask": { 7121 // "description": "Standard field mask for the set of fields to be updated.\nRequired with at least 1 value in FieldMask's paths.", 7122 // "format": "google-fieldmask", 7123 // "location": "query", 7124 // "type": "string" 7125 // } 7126 // }, 7127 // "path": "v2/companies", 7128 // "request": { 7129 // "$ref": "Company" 7130 // }, 7131 // "response": { 7132 // "$ref": "Company" 7133 // } 7134 // } 7135 7136} 7137 7138// method id "partners.updateLeads": 7139 7140type V2UpdateLeadsCall struct { 7141 s *Service 7142 lead *Lead 7143 urlParams_ gensupport.URLParams 7144 ctx_ context.Context 7145 header_ http.Header 7146} 7147 7148// UpdateLeads: Updates the specified lead. 7149func (r *V2Service) UpdateLeads(lead *Lead) *V2UpdateLeadsCall { 7150 c := &V2UpdateLeadsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7151 c.lead = lead 7152 return c 7153} 7154 7155// RequestMetadataExperimentIds sets the optional parameter 7156// "requestMetadata.experimentIds": Experiment IDs the current request 7157// belongs to. 7158func (c *V2UpdateLeadsCall) RequestMetadataExperimentIds(requestMetadataExperimentIds ...string) *V2UpdateLeadsCall { 7159 c.urlParams_.SetMulti("requestMetadata.experimentIds", append([]string{}, requestMetadataExperimentIds...)) 7160 return c 7161} 7162 7163// RequestMetadataLocale sets the optional parameter 7164// "requestMetadata.locale": Locale to use for the current request. 7165func (c *V2UpdateLeadsCall) RequestMetadataLocale(requestMetadataLocale string) *V2UpdateLeadsCall { 7166 c.urlParams_.Set("requestMetadata.locale", requestMetadataLocale) 7167 return c 7168} 7169 7170// RequestMetadataPartnersSessionId sets the optional parameter 7171// "requestMetadata.partnersSessionId": Google Partners session ID. 7172func (c *V2UpdateLeadsCall) RequestMetadataPartnersSessionId(requestMetadataPartnersSessionId string) *V2UpdateLeadsCall { 7173 c.urlParams_.Set("requestMetadata.partnersSessionId", requestMetadataPartnersSessionId) 7174 return c 7175} 7176 7177// RequestMetadataTrafficSourceTrafficSourceId sets the optional 7178// parameter "requestMetadata.trafficSource.trafficSourceId": Identifier 7179// to indicate where the traffic comes from. 7180// An identifier has multiple letters created by a team which redirected 7181// the 7182// traffic to us. 7183func (c *V2UpdateLeadsCall) RequestMetadataTrafficSourceTrafficSourceId(requestMetadataTrafficSourceTrafficSourceId string) *V2UpdateLeadsCall { 7184 c.urlParams_.Set("requestMetadata.trafficSource.trafficSourceId", requestMetadataTrafficSourceTrafficSourceId) 7185 return c 7186} 7187 7188// RequestMetadataTrafficSourceTrafficSubId sets the optional parameter 7189// "requestMetadata.trafficSource.trafficSubId": Second level identifier 7190// to indicate where the traffic comes from. 7191// An identifier has multiple letters created by a team which redirected 7192// the 7193// traffic to us. 7194func (c *V2UpdateLeadsCall) RequestMetadataTrafficSourceTrafficSubId(requestMetadataTrafficSourceTrafficSubId string) *V2UpdateLeadsCall { 7195 c.urlParams_.Set("requestMetadata.trafficSource.trafficSubId", requestMetadataTrafficSourceTrafficSubId) 7196 return c 7197} 7198 7199// RequestMetadataUserOverridesIpAddress sets the optional parameter 7200// "requestMetadata.userOverrides.ipAddress": IP address to use instead 7201// of the user's geo-located IP address. 7202func (c *V2UpdateLeadsCall) RequestMetadataUserOverridesIpAddress(requestMetadataUserOverridesIpAddress string) *V2UpdateLeadsCall { 7203 c.urlParams_.Set("requestMetadata.userOverrides.ipAddress", requestMetadataUserOverridesIpAddress) 7204 return c 7205} 7206 7207// RequestMetadataUserOverridesUserId sets the optional parameter 7208// "requestMetadata.userOverrides.userId": Logged-in user ID to 7209// impersonate instead of the user's ID. 7210func (c *V2UpdateLeadsCall) RequestMetadataUserOverridesUserId(requestMetadataUserOverridesUserId string) *V2UpdateLeadsCall { 7211 c.urlParams_.Set("requestMetadata.userOverrides.userId", requestMetadataUserOverridesUserId) 7212 return c 7213} 7214 7215// UpdateMask sets the optional parameter "updateMask": Standard field 7216// mask for the set of fields to be updated. 7217// Required with at least 1 value in FieldMask's paths. 7218// Only `state` and `adwords_customer_id` are currently supported. 7219func (c *V2UpdateLeadsCall) UpdateMask(updateMask string) *V2UpdateLeadsCall { 7220 c.urlParams_.Set("updateMask", updateMask) 7221 return c 7222} 7223 7224// Fields allows partial responses to be retrieved. See 7225// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7226// for more information. 7227func (c *V2UpdateLeadsCall) Fields(s ...googleapi.Field) *V2UpdateLeadsCall { 7228 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7229 return c 7230} 7231 7232// Context sets the context to be used in this call's Do method. Any 7233// pending HTTP request will be aborted if the provided context is 7234// canceled. 7235func (c *V2UpdateLeadsCall) Context(ctx context.Context) *V2UpdateLeadsCall { 7236 c.ctx_ = ctx 7237 return c 7238} 7239 7240// Header returns an http.Header that can be modified by the caller to 7241// add HTTP headers to the request. 7242func (c *V2UpdateLeadsCall) Header() http.Header { 7243 if c.header_ == nil { 7244 c.header_ = make(http.Header) 7245 } 7246 return c.header_ 7247} 7248 7249func (c *V2UpdateLeadsCall) doRequest(alt string) (*http.Response, error) { 7250 reqHeaders := make(http.Header) 7251 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 7252 for k, v := range c.header_ { 7253 reqHeaders[k] = v 7254 } 7255 reqHeaders.Set("User-Agent", c.s.userAgent()) 7256 var body io.Reader = nil 7257 body, err := googleapi.WithoutDataWrapper.JSONReader(c.lead) 7258 if err != nil { 7259 return nil, err 7260 } 7261 reqHeaders.Set("Content-Type", "application/json") 7262 c.urlParams_.Set("alt", alt) 7263 c.urlParams_.Set("prettyPrint", "false") 7264 urls := googleapi.ResolveRelative(c.s.BasePath, "v2/leads") 7265 urls += "?" + c.urlParams_.Encode() 7266 req, err := http.NewRequest("PATCH", urls, body) 7267 if err != nil { 7268 return nil, err 7269 } 7270 req.Header = reqHeaders 7271 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7272} 7273 7274// Do executes the "partners.updateLeads" call. 7275// Exactly one of *Lead or error will be non-nil. Any non-2xx status 7276// code is an error. Response headers are in either 7277// *Lead.ServerResponse.Header or (if a response was returned at all) in 7278// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7279// whether the returned error was because http.StatusNotModified was 7280// returned. 7281func (c *V2UpdateLeadsCall) Do(opts ...googleapi.CallOption) (*Lead, error) { 7282 gensupport.SetOptions(c.urlParams_, opts...) 7283 res, err := c.doRequest("json") 7284 if res != nil && res.StatusCode == http.StatusNotModified { 7285 if res.Body != nil { 7286 res.Body.Close() 7287 } 7288 return nil, &googleapi.Error{ 7289 Code: res.StatusCode, 7290 Header: res.Header, 7291 } 7292 } 7293 if err != nil { 7294 return nil, err 7295 } 7296 defer googleapi.CloseBody(res) 7297 if err := googleapi.CheckResponse(res); err != nil { 7298 return nil, err 7299 } 7300 ret := &Lead{ 7301 ServerResponse: googleapi.ServerResponse{ 7302 Header: res.Header, 7303 HTTPStatusCode: res.StatusCode, 7304 }, 7305 } 7306 target := &ret 7307 if err := gensupport.DecodeResponse(target, res); err != nil { 7308 return nil, err 7309 } 7310 return ret, nil 7311 // { 7312 // "description": "Updates the specified lead.", 7313 // "flatPath": "v2/leads", 7314 // "httpMethod": "PATCH", 7315 // "id": "partners.updateLeads", 7316 // "parameterOrder": [], 7317 // "parameters": { 7318 // "requestMetadata.experimentIds": { 7319 // "description": "Experiment IDs the current request belongs to.", 7320 // "location": "query", 7321 // "repeated": true, 7322 // "type": "string" 7323 // }, 7324 // "requestMetadata.locale": { 7325 // "description": "Locale to use for the current request.", 7326 // "location": "query", 7327 // "type": "string" 7328 // }, 7329 // "requestMetadata.partnersSessionId": { 7330 // "description": "Google Partners session ID.", 7331 // "location": "query", 7332 // "type": "string" 7333 // }, 7334 // "requestMetadata.trafficSource.trafficSourceId": { 7335 // "description": "Identifier to indicate where the traffic comes from.\nAn identifier has multiple letters created by a team which redirected the\ntraffic to us.", 7336 // "location": "query", 7337 // "type": "string" 7338 // }, 7339 // "requestMetadata.trafficSource.trafficSubId": { 7340 // "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.", 7341 // "location": "query", 7342 // "type": "string" 7343 // }, 7344 // "requestMetadata.userOverrides.ipAddress": { 7345 // "description": "IP address to use instead of the user's geo-located IP address.", 7346 // "location": "query", 7347 // "type": "string" 7348 // }, 7349 // "requestMetadata.userOverrides.userId": { 7350 // "description": "Logged-in user ID to impersonate instead of the user's ID.", 7351 // "location": "query", 7352 // "type": "string" 7353 // }, 7354 // "updateMask": { 7355 // "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.", 7356 // "format": "google-fieldmask", 7357 // "location": "query", 7358 // "type": "string" 7359 // } 7360 // }, 7361 // "path": "v2/leads", 7362 // "request": { 7363 // "$ref": "Lead" 7364 // }, 7365 // "response": { 7366 // "$ref": "Lead" 7367 // } 7368 // } 7369 7370} 7371