...

Source file src/google.golang.org/api/localservices/v1/localservices-gen.go

Documentation: google.golang.org/api/localservices/v1

     1  // Copyright 2024 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 localservices provides access to the Local Services API.
     8  //
     9  // For product documentation, see: https://ads.google.com/local-services-ads/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/localservices/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	localservicesService, err := localservices.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	localservicesService, err := localservices.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	localservicesService, err := localservices.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package localservices // import "google.golang.org/api/localservices/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "localservices:v1"
    90  const apiName = "localservices"
    91  const apiVersion = "v1"
    92  const basePath = "https://localservices.googleapis.com/"
    93  const basePathTemplate = "https://localservices.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://localservices.mtls.googleapis.com/"
    95  
    96  // OAuth2 scopes used by this API.
    97  const (
    98  	// See, edit, create, and delete your Google Ads accounts and data.
    99  	AdwordsScope = "https://www.googleapis.com/auth/adwords"
   100  )
   101  
   102  // NewService creates a new Service.
   103  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   104  	scopesOption := internaloption.WithDefaultScopes(
   105  		"https://www.googleapis.com/auth/adwords",
   106  	)
   107  	// NOTE: prepend, so we don't override user-specified scopes.
   108  	opts = append([]option.ClientOption{scopesOption}, opts...)
   109  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   110  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   111  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   112  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   113  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   114  	if err != nil {
   115  		return nil, err
   116  	}
   117  	s, err := New(client)
   118  	if err != nil {
   119  		return nil, err
   120  	}
   121  	if endpoint != "" {
   122  		s.BasePath = endpoint
   123  	}
   124  	return s, nil
   125  }
   126  
   127  // New creates a new Service. It uses the provided http.Client for requests.
   128  //
   129  // Deprecated: please use NewService instead.
   130  // To provide a custom HTTP client, use option.WithHTTPClient.
   131  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   132  func New(client *http.Client) (*Service, error) {
   133  	if client == nil {
   134  		return nil, errors.New("client is nil")
   135  	}
   136  	s := &Service{client: client, BasePath: basePath}
   137  	s.AccountReports = NewAccountReportsService(s)
   138  	s.DetailedLeadReports = NewDetailedLeadReportsService(s)
   139  	return s, nil
   140  }
   141  
   142  type Service struct {
   143  	client    *http.Client
   144  	BasePath  string // API endpoint base URL
   145  	UserAgent string // optional additional User-Agent fragment
   146  
   147  	AccountReports *AccountReportsService
   148  
   149  	DetailedLeadReports *DetailedLeadReportsService
   150  }
   151  
   152  func (s *Service) userAgent() string {
   153  	if s.UserAgent == "" {
   154  		return googleapi.UserAgent
   155  	}
   156  	return googleapi.UserAgent + " " + s.UserAgent
   157  }
   158  
   159  func NewAccountReportsService(s *Service) *AccountReportsService {
   160  	rs := &AccountReportsService{s: s}
   161  	return rs
   162  }
   163  
   164  type AccountReportsService struct {
   165  	s *Service
   166  }
   167  
   168  func NewDetailedLeadReportsService(s *Service) *DetailedLeadReportsService {
   169  	rs := &DetailedLeadReportsService{s: s}
   170  	return rs
   171  }
   172  
   173  type DetailedLeadReportsService struct {
   174  	s *Service
   175  }
   176  
   177  // GoogleAdsHomeservicesLocalservicesV1AccountReport: An Account Report of a
   178  // GLS account identified by their account id containing aggregate data
   179  // gathered from a particular date range. Next ID: 18
   180  type GoogleAdsHomeservicesLocalservicesV1AccountReport struct {
   181  	// AccountId: Unique identifier of the GLS account.
   182  	AccountId int64 `json:"accountId,omitempty,string"`
   183  	// AggregatorInfo: Aggregator specific information related to the account.
   184  	AggregatorInfo *GoogleAdsHomeservicesLocalservicesV1AggregatorInfo `json:"aggregatorInfo,omitempty"`
   185  	// AverageFiveStarRating: Average review rating score from 1-5 stars.
   186  	AverageFiveStarRating float64 `json:"averageFiveStarRating,omitempty"`
   187  	// AverageWeeklyBudget: Average weekly budget in the currency code of the
   188  	// account.
   189  	AverageWeeklyBudget float64 `json:"averageWeeklyBudget,omitempty"`
   190  	// BusinessName: Business name of the account.
   191  	BusinessName string `json:"businessName,omitempty"`
   192  	// CurrencyCode: Currency code of the account.
   193  	CurrencyCode string `json:"currencyCode,omitempty"`
   194  	// CurrentPeriodChargedLeads: Number of charged leads the account received in
   195  	// current specified period.
   196  	CurrentPeriodChargedLeads int64 `json:"currentPeriodChargedLeads,omitempty,string"`
   197  	// CurrentPeriodConnectedPhoneCalls: Number of connected phone calls (duration
   198  	// over 30s) in current specified period.
   199  	CurrentPeriodConnectedPhoneCalls int64 `json:"currentPeriodConnectedPhoneCalls,omitempty,string"`
   200  	// CurrentPeriodPhoneCalls: Number of phone calls in current specified period,
   201  	// including both connected and unconnected calls.
   202  	CurrentPeriodPhoneCalls int64 `json:"currentPeriodPhoneCalls,omitempty,string"`
   203  	// CurrentPeriodTotalCost: Total cost of the account in current specified
   204  	// period in the account's specified currency.
   205  	CurrentPeriodTotalCost float64 `json:"currentPeriodTotalCost,omitempty"`
   206  	// ImpressionsLastTwoDays: Number of impressions that customers have had in the
   207  	// past 2 days.
   208  	ImpressionsLastTwoDays int64 `json:"impressionsLastTwoDays,omitempty,string"`
   209  	// PhoneLeadResponsiveness: Phone lead responsiveness of the account for the
   210  	// past 90 days from current date. This is computed by taking the total number
   211  	// of connected calls from charged phone leads and dividing by the total number
   212  	// of calls received.
   213  	PhoneLeadResponsiveness float64 `json:"phoneLeadResponsiveness,omitempty"`
   214  	// PreviousPeriodChargedLeads: Number of charged leads the account received in
   215  	// previous specified period.
   216  	PreviousPeriodChargedLeads int64 `json:"previousPeriodChargedLeads,omitempty,string"`
   217  	// PreviousPeriodConnectedPhoneCalls: Number of connected phone calls (duration
   218  	// over 30s) in previous specified period.
   219  	PreviousPeriodConnectedPhoneCalls int64 `json:"previousPeriodConnectedPhoneCalls,omitempty,string"`
   220  	// PreviousPeriodPhoneCalls: Number of phone calls in previous specified
   221  	// period, including both connected and unconnected calls.
   222  	PreviousPeriodPhoneCalls int64 `json:"previousPeriodPhoneCalls,omitempty,string"`
   223  	// PreviousPeriodTotalCost: Total cost of the account in previous specified
   224  	// period in the account's specified currency.
   225  	PreviousPeriodTotalCost float64 `json:"previousPeriodTotalCost,omitempty"`
   226  	// TotalReview: Total number of reviews the account has up to current date.
   227  	TotalReview int64 `json:"totalReview,omitempty"`
   228  	// ForceSendFields is a list of field names (e.g. "AccountId") to
   229  	// unconditionally include in API requests. By default, fields with empty or
   230  	// default values are omitted from API requests. See
   231  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   232  	// details.
   233  	ForceSendFields []string `json:"-"`
   234  	// NullFields is a list of field names (e.g. "AccountId") to include in API
   235  	// requests with the JSON null value. By default, fields with empty values are
   236  	// omitted from API requests. See
   237  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   238  	NullFields []string `json:"-"`
   239  }
   240  
   241  func (s *GoogleAdsHomeservicesLocalservicesV1AccountReport) MarshalJSON() ([]byte, error) {
   242  	type NoMethod GoogleAdsHomeservicesLocalservicesV1AccountReport
   243  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   244  }
   245  
   246  func (s *GoogleAdsHomeservicesLocalservicesV1AccountReport) UnmarshalJSON(data []byte) error {
   247  	type NoMethod GoogleAdsHomeservicesLocalservicesV1AccountReport
   248  	var s1 struct {
   249  		AverageFiveStarRating   gensupport.JSONFloat64 `json:"averageFiveStarRating"`
   250  		AverageWeeklyBudget     gensupport.JSONFloat64 `json:"averageWeeklyBudget"`
   251  		CurrentPeriodTotalCost  gensupport.JSONFloat64 `json:"currentPeriodTotalCost"`
   252  		PhoneLeadResponsiveness gensupport.JSONFloat64 `json:"phoneLeadResponsiveness"`
   253  		PreviousPeriodTotalCost gensupport.JSONFloat64 `json:"previousPeriodTotalCost"`
   254  		*NoMethod
   255  	}
   256  	s1.NoMethod = (*NoMethod)(s)
   257  	if err := json.Unmarshal(data, &s1); err != nil {
   258  		return err
   259  	}
   260  	s.AverageFiveStarRating = float64(s1.AverageFiveStarRating)
   261  	s.AverageWeeklyBudget = float64(s1.AverageWeeklyBudget)
   262  	s.CurrentPeriodTotalCost = float64(s1.CurrentPeriodTotalCost)
   263  	s.PhoneLeadResponsiveness = float64(s1.PhoneLeadResponsiveness)
   264  	s.PreviousPeriodTotalCost = float64(s1.PreviousPeriodTotalCost)
   265  	return nil
   266  }
   267  
   268  // GoogleAdsHomeservicesLocalservicesV1AggregatorInfo: Conatiner for aggregator
   269  // specific information if lead is for an aggregator GLS account.
   270  type GoogleAdsHomeservicesLocalservicesV1AggregatorInfo struct {
   271  	// AggregatorProviderId: Provider id (listed in aggregator system) which maps
   272  	// to a account id in GLS system.
   273  	AggregatorProviderId string `json:"aggregatorProviderId,omitempty"`
   274  	// ForceSendFields is a list of field names (e.g. "AggregatorProviderId") to
   275  	// unconditionally include in API requests. By default, fields with empty or
   276  	// default values are omitted from API requests. See
   277  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   278  	// details.
   279  	ForceSendFields []string `json:"-"`
   280  	// NullFields is a list of field names (e.g. "AggregatorProviderId") to include
   281  	// in API requests with the JSON null value. By default, fields with empty
   282  	// values are omitted from API requests. See
   283  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   284  	NullFields []string `json:"-"`
   285  }
   286  
   287  func (s *GoogleAdsHomeservicesLocalservicesV1AggregatorInfo) MarshalJSON() ([]byte, error) {
   288  	type NoMethod GoogleAdsHomeservicesLocalservicesV1AggregatorInfo
   289  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   290  }
   291  
   292  // GoogleAdsHomeservicesLocalservicesV1BookingLead: Container for booking lead
   293  // specific information.
   294  type GoogleAdsHomeservicesLocalservicesV1BookingLead struct {
   295  	// BookingAppointmentTimestamp: Timestamp of when service is provided by
   296  	// advertiser.
   297  	BookingAppointmentTimestamp string `json:"bookingAppointmentTimestamp,omitempty"`
   298  	// ConsumerEmail: Consumer email associated with the booking lead.
   299  	ConsumerEmail string `json:"consumerEmail,omitempty"`
   300  	// ConsumerPhoneNumber: Consumer phone number associated with the booking lead.
   301  	ConsumerPhoneNumber string `json:"consumerPhoneNumber,omitempty"`
   302  	// CustomerName: Name of the customer who created the lead.
   303  	CustomerName string `json:"customerName,omitempty"`
   304  	// JobType: The job type of the specified lead.
   305  	JobType string `json:"jobType,omitempty"`
   306  	// ForceSendFields is a list of field names (e.g.
   307  	// "BookingAppointmentTimestamp") to unconditionally include in API requests.
   308  	// By default, fields with empty or default values are omitted from API
   309  	// requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
   310  	// for more details.
   311  	ForceSendFields []string `json:"-"`
   312  	// NullFields is a list of field names (e.g. "BookingAppointmentTimestamp") to
   313  	// include in API requests with the JSON null value. By default, fields with
   314  	// empty values are omitted from API requests. See
   315  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   316  	NullFields []string `json:"-"`
   317  }
   318  
   319  func (s *GoogleAdsHomeservicesLocalservicesV1BookingLead) MarshalJSON() ([]byte, error) {
   320  	type NoMethod GoogleAdsHomeservicesLocalservicesV1BookingLead
   321  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   322  }
   323  
   324  // GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport: A Detailed Lead
   325  // Report of a lead identified by their lead id and contains consumer, account,
   326  // monetization, and lead data.
   327  type GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport struct {
   328  	// AccountId: Identifies account that received the lead.
   329  	AccountId int64 `json:"accountId,omitempty,string"`
   330  	// AggregatorInfo: Aggregator specific information related to the lead.
   331  	AggregatorInfo *GoogleAdsHomeservicesLocalservicesV1AggregatorInfo `json:"aggregatorInfo,omitempty"`
   332  	// BookingLead: More information associated to only booking leads.
   333  	BookingLead *GoogleAdsHomeservicesLocalservicesV1BookingLead `json:"bookingLead,omitempty"`
   334  	// BusinessName: Business name associated to the account.
   335  	BusinessName string `json:"businessName,omitempty"`
   336  	// ChargeStatus: Whether the lead has been charged.
   337  	//
   338  	// Possible values:
   339  	//   "CHARGE_STATUS_UNSPECIFIED" - Not specified.
   340  	//   "CHARGED" - Charged.
   341  	//   "NOT_CHARGED" - Not charged.
   342  	ChargeStatus string `json:"chargeStatus,omitempty"`
   343  	// CurrencyCode: Currency code.
   344  	CurrencyCode string `json:"currencyCode,omitempty"`
   345  	// DisputeStatus: Dispute status related to the lead.
   346  	DisputeStatus string `json:"disputeStatus,omitempty"`
   347  	// Geo: Location of the associated account's home city.
   348  	Geo string `json:"geo,omitempty"`
   349  	// GoogleAdsLeadId: Unique identifier of a Detailed Lead Report.
   350  	GoogleAdsLeadId int64 `json:"googleAdsLeadId,omitempty,string"`
   351  	// LeadCategory: Lead category (e.g. hvac, plumber)
   352  	LeadCategory string `json:"leadCategory,omitempty"`
   353  	// LeadCreationTimestamp: Timestamp of when the lead was created.
   354  	LeadCreationTimestamp string `json:"leadCreationTimestamp,omitempty"`
   355  	// LeadId: Deprecated in favor of google_ads_lead_id. Unique identifier of a
   356  	// Detailed Lead Report.
   357  	LeadId int64 `json:"leadId,omitempty,string"`
   358  	// LeadPrice: Price of the lead (available only after it has been charged).
   359  	LeadPrice float64 `json:"leadPrice,omitempty"`
   360  	// LeadType: Lead type.
   361  	//
   362  	// Possible values:
   363  	//   "LEAD_TYPE_UNSPECIFIED" - Not specified.
   364  	//   "MESSAGE" - Message lead.
   365  	//   "PHONE_CALL" - Phone call lead.
   366  	//   "BOOKING" - Booking lead.
   367  	LeadType string `json:"leadType,omitempty"`
   368  	// MessageLead: More information associated to only message leads.
   369  	MessageLead *GoogleAdsHomeservicesLocalservicesV1MessageLead `json:"messageLead,omitempty"`
   370  	// PhoneLead: More information associated to only phone leads.
   371  	PhoneLead *GoogleAdsHomeservicesLocalservicesV1PhoneLead `json:"phoneLead,omitempty"`
   372  	// Timezone: Timezone of the particular provider associated to a lead.
   373  	Timezone *GoogleTypeTimeZone `json:"timezone,omitempty"`
   374  	// ForceSendFields is a list of field names (e.g. "AccountId") to
   375  	// unconditionally include in API requests. By default, fields with empty or
   376  	// default values are omitted from API requests. See
   377  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   378  	// details.
   379  	ForceSendFields []string `json:"-"`
   380  	// NullFields is a list of field names (e.g. "AccountId") to include in API
   381  	// requests with the JSON null value. By default, fields with empty values are
   382  	// omitted from API requests. See
   383  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   384  	NullFields []string `json:"-"`
   385  }
   386  
   387  func (s *GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport) MarshalJSON() ([]byte, error) {
   388  	type NoMethod GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport
   389  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   390  }
   391  
   392  func (s *GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport) UnmarshalJSON(data []byte) error {
   393  	type NoMethod GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport
   394  	var s1 struct {
   395  		LeadPrice gensupport.JSONFloat64 `json:"leadPrice"`
   396  		*NoMethod
   397  	}
   398  	s1.NoMethod = (*NoMethod)(s)
   399  	if err := json.Unmarshal(data, &s1); err != nil {
   400  		return err
   401  	}
   402  	s.LeadPrice = float64(s1.LeadPrice)
   403  	return nil
   404  }
   405  
   406  // GoogleAdsHomeservicesLocalservicesV1MessageLead: Container for message lead
   407  // specific information.
   408  type GoogleAdsHomeservicesLocalservicesV1MessageLead struct {
   409  	// ConsumerPhoneNumber: Consumer phone number associated with the message lead.
   410  	ConsumerPhoneNumber string `json:"consumerPhoneNumber,omitempty"`
   411  	// CustomerName: Name of the customer who created the lead.
   412  	CustomerName string `json:"customerName,omitempty"`
   413  	// JobType: The job type of the specified lead.
   414  	JobType string `json:"jobType,omitempty"`
   415  	// PostalCode: The postal code of the customer who created the lead.
   416  	PostalCode string `json:"postalCode,omitempty"`
   417  	// ForceSendFields is a list of field names (e.g. "ConsumerPhoneNumber") to
   418  	// unconditionally include in API requests. By default, fields with empty or
   419  	// default values are omitted from API requests. See
   420  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   421  	// details.
   422  	ForceSendFields []string `json:"-"`
   423  	// NullFields is a list of field names (e.g. "ConsumerPhoneNumber") to include
   424  	// in API requests with the JSON null value. By default, fields with empty
   425  	// values are omitted from API requests. See
   426  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   427  	NullFields []string `json:"-"`
   428  }
   429  
   430  func (s *GoogleAdsHomeservicesLocalservicesV1MessageLead) MarshalJSON() ([]byte, error) {
   431  	type NoMethod GoogleAdsHomeservicesLocalservicesV1MessageLead
   432  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   433  }
   434  
   435  // GoogleAdsHomeservicesLocalservicesV1PhoneLead: Container for phone lead
   436  // specific information.
   437  type GoogleAdsHomeservicesLocalservicesV1PhoneLead struct {
   438  	// ChargedCallTimestamp: Timestamp of the phone call which resulted in a
   439  	// charged phone lead.
   440  	ChargedCallTimestamp string `json:"chargedCallTimestamp,omitempty"`
   441  	// ChargedConnectedCallDurationSeconds: Duration of the charged phone call in
   442  	// seconds.
   443  	ChargedConnectedCallDurationSeconds string `json:"chargedConnectedCallDurationSeconds,omitempty"`
   444  	// ConsumerPhoneNumber: Consumer phone number associated with the phone lead.
   445  	ConsumerPhoneNumber string `json:"consumerPhoneNumber,omitempty"`
   446  	// ForceSendFields is a list of field names (e.g. "ChargedCallTimestamp") to
   447  	// unconditionally include in API requests. By default, fields with empty or
   448  	// default values are omitted from API requests. See
   449  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   450  	// details.
   451  	ForceSendFields []string `json:"-"`
   452  	// NullFields is a list of field names (e.g. "ChargedCallTimestamp") to include
   453  	// in API requests with the JSON null value. By default, fields with empty
   454  	// values are omitted from API requests. See
   455  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   456  	NullFields []string `json:"-"`
   457  }
   458  
   459  func (s *GoogleAdsHomeservicesLocalservicesV1PhoneLead) MarshalJSON() ([]byte, error) {
   460  	type NoMethod GoogleAdsHomeservicesLocalservicesV1PhoneLead
   461  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   462  }
   463  
   464  // GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse: A page of
   465  // the response received from the SearchAccountReports method. A paginated
   466  // response where more pages are available has `next_page_token` set. This
   467  // token can be used in a subsequent request to retrieve the next request page.
   468  type GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse struct {
   469  	// AccountReports: List of account reports which maps 1:1 to a particular
   470  	// linked GLS account.
   471  	AccountReports []*GoogleAdsHomeservicesLocalservicesV1AccountReport `json:"accountReports,omitempty"`
   472  	// NextPageToken: Pagination token to retrieve the next page of results. When
   473  	// `next_page_token` is not filled in, there is no next page and the list
   474  	// returned is the last page in the result set.
   475  	NextPageToken string `json:"nextPageToken,omitempty"`
   476  
   477  	// ServerResponse contains the HTTP response code and headers from the server.
   478  	googleapi.ServerResponse `json:"-"`
   479  	// ForceSendFields is a list of field names (e.g. "AccountReports") to
   480  	// unconditionally include in API requests. By default, fields with empty or
   481  	// default values are omitted from API requests. See
   482  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   483  	// details.
   484  	ForceSendFields []string `json:"-"`
   485  	// NullFields is a list of field names (e.g. "AccountReports") to include in
   486  	// API requests with the JSON null value. By default, fields with empty values
   487  	// are omitted from API requests. See
   488  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   489  	NullFields []string `json:"-"`
   490  }
   491  
   492  func (s *GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse) MarshalJSON() ([]byte, error) {
   493  	type NoMethod GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse
   494  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   495  }
   496  
   497  // GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse: A
   498  // page of the response received from the SearchDetailedLeadReports method. A
   499  // paginated response where more pages are available has `next_page_token` set.
   500  // This token can be used in a subsequent request to retrieve the next request
   501  // page.
   502  type GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse struct {
   503  	// DetailedLeadReports: List of detailed lead reports uniquely identified by
   504  	// external lead id.
   505  	DetailedLeadReports []*GoogleAdsHomeservicesLocalservicesV1DetailedLeadReport `json:"detailedLeadReports,omitempty"`
   506  	// NextPageToken: Pagination token to retrieve the next page of results. When
   507  	// `next_page_token` is not filled in, there is no next page and the list
   508  	// returned is the last page in the result set.
   509  	NextPageToken string `json:"nextPageToken,omitempty"`
   510  
   511  	// ServerResponse contains the HTTP response code and headers from the server.
   512  	googleapi.ServerResponse `json:"-"`
   513  	// ForceSendFields is a list of field names (e.g. "DetailedLeadReports") to
   514  	// unconditionally include in API requests. By default, fields with empty or
   515  	// default values are omitted from API requests. See
   516  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   517  	// details.
   518  	ForceSendFields []string `json:"-"`
   519  	// NullFields is a list of field names (e.g. "DetailedLeadReports") to include
   520  	// in API requests with the JSON null value. By default, fields with empty
   521  	// values are omitted from API requests. See
   522  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   523  	NullFields []string `json:"-"`
   524  }
   525  
   526  func (s *GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse) MarshalJSON() ([]byte, error) {
   527  	type NoMethod GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse
   528  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   529  }
   530  
   531  // GoogleTypeTimeZone: Represents a time zone from the IANA Time Zone Database
   532  // (https://www.iana.org/time-zones).
   533  type GoogleTypeTimeZone struct {
   534  	// Id: IANA Time Zone Database time zone, e.g. "America/New_York".
   535  	Id string `json:"id,omitempty"`
   536  	// Version: Optional. IANA Time Zone Database version number, e.g. "2019a".
   537  	Version string `json:"version,omitempty"`
   538  	// ForceSendFields is a list of field names (e.g. "Id") to unconditionally
   539  	// include in API requests. By default, fields with empty or default values are
   540  	// omitted from API requests. See
   541  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   542  	// details.
   543  	ForceSendFields []string `json:"-"`
   544  	// NullFields is a list of field names (e.g. "Id") to include in API requests
   545  	// with the JSON null value. By default, fields with empty values are omitted
   546  	// from API requests. See
   547  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   548  	NullFields []string `json:"-"`
   549  }
   550  
   551  func (s *GoogleTypeTimeZone) MarshalJSON() ([]byte, error) {
   552  	type NoMethod GoogleTypeTimeZone
   553  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   554  }
   555  
   556  type AccountReportsSearchCall struct {
   557  	s            *Service
   558  	urlParams_   gensupport.URLParams
   559  	ifNoneMatch_ string
   560  	ctx_         context.Context
   561  	header_      http.Header
   562  }
   563  
   564  // Search: Get account reports containing aggregate account data of all linked
   565  // GLS accounts. Caller needs to provide their manager customer id and the
   566  // associated auth credential that allows them read permissions on their linked
   567  // accounts.
   568  func (r *AccountReportsService) Search() *AccountReportsSearchCall {
   569  	c := &AccountReportsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   570  	return c
   571  }
   572  
   573  // EndDateDay sets the optional parameter "endDate.day": Day of a month. Must
   574  // be from 1 to 31 and valid for the year and month, or 0 to specify a year by
   575  // itself or a year and month where the day isn't significant.
   576  func (c *AccountReportsSearchCall) EndDateDay(endDateDay int64) *AccountReportsSearchCall {
   577  	c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
   578  	return c
   579  }
   580  
   581  // EndDateMonth sets the optional parameter "endDate.month": Month of a year.
   582  // Must be from 1 to 12, or 0 to specify a year without a month and day.
   583  func (c *AccountReportsSearchCall) EndDateMonth(endDateMonth int64) *AccountReportsSearchCall {
   584  	c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
   585  	return c
   586  }
   587  
   588  // EndDateYear sets the optional parameter "endDate.year": Year of the date.
   589  // Must be from 1 to 9999, or 0 to specify a date without a year.
   590  func (c *AccountReportsSearchCall) EndDateYear(endDateYear int64) *AccountReportsSearchCall {
   591  	c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
   592  	return c
   593  }
   594  
   595  // PageSize sets the optional parameter "pageSize": The maximum number of
   596  // accounts to return. If the page size is unset, page size will default to
   597  // 1000. Maximum page_size is 10000.
   598  func (c *AccountReportsSearchCall) PageSize(pageSize int64) *AccountReportsSearchCall {
   599  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   600  	return c
   601  }
   602  
   603  // PageToken sets the optional parameter "pageToken": The `next_page_token`
   604  // value returned from a previous request to SearchAccountReports that
   605  // indicates where listing should continue.
   606  func (c *AccountReportsSearchCall) PageToken(pageToken string) *AccountReportsSearchCall {
   607  	c.urlParams_.Set("pageToken", pageToken)
   608  	return c
   609  }
   610  
   611  // Query sets the optional parameter "query": A query string for searching for
   612  // account reports. Caller must provide a customer id of their MCC account with
   613  // an associated Gaia Mint that allows read permission on their linked
   614  // accounts. Search expressions are case insensitive. Example query: | Query |
   615  // Description |
   616  // |-------------------------|-----------------------------------------------|
   617  // | manager_customer_id:123 | Get Account Report for Manager with id 123. |
   618  // Required.
   619  func (c *AccountReportsSearchCall) Query(query string) *AccountReportsSearchCall {
   620  	c.urlParams_.Set("query", query)
   621  	return c
   622  }
   623  
   624  // StartDateDay sets the optional parameter "startDate.day": Day of a month.
   625  // Must be from 1 to 31 and valid for the year and month, or 0 to specify a
   626  // year by itself or a year and month where the day isn't significant.
   627  func (c *AccountReportsSearchCall) StartDateDay(startDateDay int64) *AccountReportsSearchCall {
   628  	c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
   629  	return c
   630  }
   631  
   632  // StartDateMonth sets the optional parameter "startDate.month": Month of a
   633  // year. Must be from 1 to 12, or 0 to specify a year without a month and day.
   634  func (c *AccountReportsSearchCall) StartDateMonth(startDateMonth int64) *AccountReportsSearchCall {
   635  	c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
   636  	return c
   637  }
   638  
   639  // StartDateYear sets the optional parameter "startDate.year": Year of the
   640  // date. Must be from 1 to 9999, or 0 to specify a date without a year.
   641  func (c *AccountReportsSearchCall) StartDateYear(startDateYear int64) *AccountReportsSearchCall {
   642  	c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
   643  	return c
   644  }
   645  
   646  // Fields allows partial responses to be retrieved. See
   647  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   648  // details.
   649  func (c *AccountReportsSearchCall) Fields(s ...googleapi.Field) *AccountReportsSearchCall {
   650  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   651  	return c
   652  }
   653  
   654  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   655  // object's ETag matches the given value. This is useful for getting updates
   656  // only after the object has changed since the last request.
   657  func (c *AccountReportsSearchCall) IfNoneMatch(entityTag string) *AccountReportsSearchCall {
   658  	c.ifNoneMatch_ = entityTag
   659  	return c
   660  }
   661  
   662  // Context sets the context to be used in this call's Do method.
   663  func (c *AccountReportsSearchCall) Context(ctx context.Context) *AccountReportsSearchCall {
   664  	c.ctx_ = ctx
   665  	return c
   666  }
   667  
   668  // Header returns a http.Header that can be modified by the caller to add
   669  // headers to the request.
   670  func (c *AccountReportsSearchCall) Header() http.Header {
   671  	if c.header_ == nil {
   672  		c.header_ = make(http.Header)
   673  	}
   674  	return c.header_
   675  }
   676  
   677  func (c *AccountReportsSearchCall) doRequest(alt string) (*http.Response, error) {
   678  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   679  	if c.ifNoneMatch_ != "" {
   680  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   681  	}
   682  	var body io.Reader = nil
   683  	c.urlParams_.Set("alt", alt)
   684  	c.urlParams_.Set("prettyPrint", "false")
   685  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accountReports:search")
   686  	urls += "?" + c.urlParams_.Encode()
   687  	req, err := http.NewRequest("GET", urls, body)
   688  	if err != nil {
   689  		return nil, err
   690  	}
   691  	req.Header = reqHeaders
   692  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   693  }
   694  
   695  // Do executes the "localservices.accountReports.search" call.
   696  // Any non-2xx status code is an error. Response headers are in either
   697  // *GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse.ServerRespo
   698  // nse.Header or (if a response was returned at all) in
   699  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   700  // whether the returned error was because http.StatusNotModified was returned.
   701  func (c *AccountReportsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse, error) {
   702  	gensupport.SetOptions(c.urlParams_, opts...)
   703  	res, err := c.doRequest("json")
   704  	if res != nil && res.StatusCode == http.StatusNotModified {
   705  		if res.Body != nil {
   706  			res.Body.Close()
   707  		}
   708  		return nil, gensupport.WrapError(&googleapi.Error{
   709  			Code:   res.StatusCode,
   710  			Header: res.Header,
   711  		})
   712  	}
   713  	if err != nil {
   714  		return nil, err
   715  	}
   716  	defer googleapi.CloseBody(res)
   717  	if err := googleapi.CheckResponse(res); err != nil {
   718  		return nil, gensupport.WrapError(err)
   719  	}
   720  	ret := &GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse{
   721  		ServerResponse: googleapi.ServerResponse{
   722  			Header:         res.Header,
   723  			HTTPStatusCode: res.StatusCode,
   724  		},
   725  	}
   726  	target := &ret
   727  	if err := gensupport.DecodeResponse(target, res); err != nil {
   728  		return nil, err
   729  	}
   730  	return ret, nil
   731  }
   732  
   733  // Pages invokes f for each page of results.
   734  // A non-nil error returned from f will halt the iteration.
   735  // The provided context supersedes any context provided to the Context method.
   736  func (c *AccountReportsSearchCall) Pages(ctx context.Context, f func(*GoogleAdsHomeservicesLocalservicesV1SearchAccountReportsResponse) error) error {
   737  	c.ctx_ = ctx
   738  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   739  	for {
   740  		x, err := c.Do()
   741  		if err != nil {
   742  			return err
   743  		}
   744  		if err := f(x); err != nil {
   745  			return err
   746  		}
   747  		if x.NextPageToken == "" {
   748  			return nil
   749  		}
   750  		c.PageToken(x.NextPageToken)
   751  	}
   752  }
   753  
   754  type DetailedLeadReportsSearchCall struct {
   755  	s            *Service
   756  	urlParams_   gensupport.URLParams
   757  	ifNoneMatch_ string
   758  	ctx_         context.Context
   759  	header_      http.Header
   760  }
   761  
   762  // Search: Get detailed lead reports containing leads that have been received
   763  // by all linked GLS accounts. Caller needs to provide their manager customer
   764  // id and the associated auth credential that allows them read permissions on
   765  // their linked accounts.
   766  func (r *DetailedLeadReportsService) Search() *DetailedLeadReportsSearchCall {
   767  	c := &DetailedLeadReportsSearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   768  	return c
   769  }
   770  
   771  // EndDateDay sets the optional parameter "endDate.day": Day of a month. Must
   772  // be from 1 to 31 and valid for the year and month, or 0 to specify a year by
   773  // itself or a year and month where the day isn't significant.
   774  func (c *DetailedLeadReportsSearchCall) EndDateDay(endDateDay int64) *DetailedLeadReportsSearchCall {
   775  	c.urlParams_.Set("endDate.day", fmt.Sprint(endDateDay))
   776  	return c
   777  }
   778  
   779  // EndDateMonth sets the optional parameter "endDate.month": Month of a year.
   780  // Must be from 1 to 12, or 0 to specify a year without a month and day.
   781  func (c *DetailedLeadReportsSearchCall) EndDateMonth(endDateMonth int64) *DetailedLeadReportsSearchCall {
   782  	c.urlParams_.Set("endDate.month", fmt.Sprint(endDateMonth))
   783  	return c
   784  }
   785  
   786  // EndDateYear sets the optional parameter "endDate.year": Year of the date.
   787  // Must be from 1 to 9999, or 0 to specify a date without a year.
   788  func (c *DetailedLeadReportsSearchCall) EndDateYear(endDateYear int64) *DetailedLeadReportsSearchCall {
   789  	c.urlParams_.Set("endDate.year", fmt.Sprint(endDateYear))
   790  	return c
   791  }
   792  
   793  // PageSize sets the optional parameter "pageSize": The maximum number of
   794  // accounts to return. If the page size is unset, page size will default to
   795  // 1000. Maximum page_size is 10000.
   796  func (c *DetailedLeadReportsSearchCall) PageSize(pageSize int64) *DetailedLeadReportsSearchCall {
   797  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   798  	return c
   799  }
   800  
   801  // PageToken sets the optional parameter "pageToken": The `next_page_token`
   802  // value returned from a previous request to SearchDetailedLeadReports that
   803  // indicates where listing should continue.
   804  func (c *DetailedLeadReportsSearchCall) PageToken(pageToken string) *DetailedLeadReportsSearchCall {
   805  	c.urlParams_.Set("pageToken", pageToken)
   806  	return c
   807  }
   808  
   809  // Query sets the optional parameter "query": A query string for searching for
   810  // account reports. Caller must provide a customer id of their MCC account with
   811  // an associated Gaia Mint that allows read permission on their linked
   812  // accounts. Search expressions are case insensitive. Example query: | Query |
   813  // Description |
   814  // |-------------------------|-----------------------------------------------|
   815  // | manager_customer_id:123 | Get Detailed Lead Report for Manager with id | |
   816  // | 123. | Required.
   817  func (c *DetailedLeadReportsSearchCall) Query(query string) *DetailedLeadReportsSearchCall {
   818  	c.urlParams_.Set("query", query)
   819  	return c
   820  }
   821  
   822  // StartDateDay sets the optional parameter "startDate.day": Day of a month.
   823  // Must be from 1 to 31 and valid for the year and month, or 0 to specify a
   824  // year by itself or a year and month where the day isn't significant.
   825  func (c *DetailedLeadReportsSearchCall) StartDateDay(startDateDay int64) *DetailedLeadReportsSearchCall {
   826  	c.urlParams_.Set("startDate.day", fmt.Sprint(startDateDay))
   827  	return c
   828  }
   829  
   830  // StartDateMonth sets the optional parameter "startDate.month": Month of a
   831  // year. Must be from 1 to 12, or 0 to specify a year without a month and day.
   832  func (c *DetailedLeadReportsSearchCall) StartDateMonth(startDateMonth int64) *DetailedLeadReportsSearchCall {
   833  	c.urlParams_.Set("startDate.month", fmt.Sprint(startDateMonth))
   834  	return c
   835  }
   836  
   837  // StartDateYear sets the optional parameter "startDate.year": Year of the
   838  // date. Must be from 1 to 9999, or 0 to specify a date without a year.
   839  func (c *DetailedLeadReportsSearchCall) StartDateYear(startDateYear int64) *DetailedLeadReportsSearchCall {
   840  	c.urlParams_.Set("startDate.year", fmt.Sprint(startDateYear))
   841  	return c
   842  }
   843  
   844  // Fields allows partial responses to be retrieved. See
   845  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   846  // details.
   847  func (c *DetailedLeadReportsSearchCall) Fields(s ...googleapi.Field) *DetailedLeadReportsSearchCall {
   848  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   849  	return c
   850  }
   851  
   852  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   853  // object's ETag matches the given value. This is useful for getting updates
   854  // only after the object has changed since the last request.
   855  func (c *DetailedLeadReportsSearchCall) IfNoneMatch(entityTag string) *DetailedLeadReportsSearchCall {
   856  	c.ifNoneMatch_ = entityTag
   857  	return c
   858  }
   859  
   860  // Context sets the context to be used in this call's Do method.
   861  func (c *DetailedLeadReportsSearchCall) Context(ctx context.Context) *DetailedLeadReportsSearchCall {
   862  	c.ctx_ = ctx
   863  	return c
   864  }
   865  
   866  // Header returns a http.Header that can be modified by the caller to add
   867  // headers to the request.
   868  func (c *DetailedLeadReportsSearchCall) Header() http.Header {
   869  	if c.header_ == nil {
   870  		c.header_ = make(http.Header)
   871  	}
   872  	return c.header_
   873  }
   874  
   875  func (c *DetailedLeadReportsSearchCall) doRequest(alt string) (*http.Response, error) {
   876  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   877  	if c.ifNoneMatch_ != "" {
   878  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   879  	}
   880  	var body io.Reader = nil
   881  	c.urlParams_.Set("alt", alt)
   882  	c.urlParams_.Set("prettyPrint", "false")
   883  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/detailedLeadReports:search")
   884  	urls += "?" + c.urlParams_.Encode()
   885  	req, err := http.NewRequest("GET", urls, body)
   886  	if err != nil {
   887  		return nil, err
   888  	}
   889  	req.Header = reqHeaders
   890  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   891  }
   892  
   893  // Do executes the "localservices.detailedLeadReports.search" call.
   894  // Any non-2xx status code is an error. Response headers are in either
   895  // *GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse.Server
   896  // Response.Header or (if a response was returned at all) in
   897  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   898  // whether the returned error was because http.StatusNotModified was returned.
   899  func (c *DetailedLeadReportsSearchCall) Do(opts ...googleapi.CallOption) (*GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse, error) {
   900  	gensupport.SetOptions(c.urlParams_, opts...)
   901  	res, err := c.doRequest("json")
   902  	if res != nil && res.StatusCode == http.StatusNotModified {
   903  		if res.Body != nil {
   904  			res.Body.Close()
   905  		}
   906  		return nil, gensupport.WrapError(&googleapi.Error{
   907  			Code:   res.StatusCode,
   908  			Header: res.Header,
   909  		})
   910  	}
   911  	if err != nil {
   912  		return nil, err
   913  	}
   914  	defer googleapi.CloseBody(res)
   915  	if err := googleapi.CheckResponse(res); err != nil {
   916  		return nil, gensupport.WrapError(err)
   917  	}
   918  	ret := &GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse{
   919  		ServerResponse: googleapi.ServerResponse{
   920  			Header:         res.Header,
   921  			HTTPStatusCode: res.StatusCode,
   922  		},
   923  	}
   924  	target := &ret
   925  	if err := gensupport.DecodeResponse(target, res); err != nil {
   926  		return nil, err
   927  	}
   928  	return ret, nil
   929  }
   930  
   931  // Pages invokes f for each page of results.
   932  // A non-nil error returned from f will halt the iteration.
   933  // The provided context supersedes any context provided to the Context method.
   934  func (c *DetailedLeadReportsSearchCall) Pages(ctx context.Context, f func(*GoogleAdsHomeservicesLocalservicesV1SearchDetailedLeadReportsResponse) error) error {
   935  	c.ctx_ = ctx
   936  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   937  	for {
   938  		x, err := c.Do()
   939  		if err != nil {
   940  			return err
   941  		}
   942  		if err := f(x); err != nil {
   943  			return err
   944  		}
   945  		if x.NextPageToken == "" {
   946  			return nil
   947  		}
   948  		c.PageToken(x.NextPageToken)
   949  	}
   950  }
   951  

View as plain text