// Copyright 2026 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Code generated file. DO NOT EDIT.

// Package agenciesandbrands provides access to the Agencies and Brands API.
//
// For product documentation, see: https://developers.google.com/authorized-buyers/agencies-and-brands/get-started/start
//
// # Library status
//
// These client libraries are officially supported by Google. However, this
// library is considered complete and is in maintenance mode. This means
// that we will address critical bugs and security issues but will not add
// any new features.
//
// When possible, we recommend using our newer
// [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
// that are still actively being worked and iterated on.
//
// # Creating a client
//
// Usage example:
//
//	import "google.golang.org/api/agenciesandbrands/v1"
//	...
//	ctx := context.Background()
//	agenciesandbrandsService, err := agenciesandbrands.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for
// authentication. For information on how to create and obtain Application
// Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// # Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API
// keys), use [google.golang.org/api/option.WithAPIKey]:
//
//	agenciesandbrandsService, err := agenciesandbrands.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
// flow, use [google.golang.org/api/option.WithTokenSource]:
//
//	config := &oauth2.Config{...}
//	// ...
//	token, err := config.Exchange(ctx, ...)
//	agenciesandbrandsService, err := agenciesandbrands.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See [google.golang.org/api/option.ClientOption] for details on options.
package agenciesandbrands // import "google.golang.org/api/agenciesandbrands/v1"

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"log/slog"
	"net/http"
	"net/url"
	"strconv"
	"strings"

	"github.com/googleapis/gax-go/v2/internallog"
	googleapi "google.golang.org/api/googleapi"
	internal "google.golang.org/api/internal"
	gensupport "google.golang.org/api/internal/gensupport"
	option "google.golang.org/api/option"
	internaloption "google.golang.org/api/option/internaloption"
	htransport "google.golang.org/api/transport/http"
)

// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
var _ = internal.Version
var _ = internallog.New

const apiId = "agenciesandbrands:v1"
const apiName = "agenciesandbrands"
const apiVersion = "v1"
const basePath = "https://agenciesandbrands.googleapis.com/"
const basePathTemplate = "https://agenciesandbrands.UNIVERSE_DOMAIN/"
const mtlsBasePath = "https://agenciesandbrands.mtls.googleapis.com/"

// OAuth2 scopes used by this API.
const (
	// View, create, edit, and delete data entities in your Agency account.
	AgenciesAndBrandsScope = "https://www.googleapis.com/auth/agencies-and-brands"
)

// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
	scopesOption := internaloption.WithDefaultScopes(
		"https://www.googleapis.com/auth/agencies-and-brands",
	)
	// NOTE: prepend, so we don't override user-specified scopes.
	opts = append([]option.ClientOption{scopesOption}, opts...)
	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
	opts = append(opts, internaloption.EnableNewAuthLibrary())
	client, endpoint, err := htransport.NewClient(ctx, opts...)
	if err != nil {
		return nil, err
	}
	s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
	s.Agencies = NewAgenciesService(s)
	if endpoint != "" {
		s.BasePath = endpoint
	}
	return s, nil
}

// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
	if client == nil {
		return nil, errors.New("client is nil")
	}
	return NewService(context.TODO(), option.WithHTTPClient(client))
}

type Service struct {
	client    *http.Client
	logger    *slog.Logger
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	Agencies *AgenciesService
}

func (s *Service) userAgent() string {
	if s.UserAgent == "" {
		return googleapi.UserAgent
	}
	return googleapi.UserAgent + " " + s.UserAgent
}

func NewAgenciesService(s *Service) *AgenciesService {
	rs := &AgenciesService{s: s}
	rs.Reports = NewAgenciesReportsService(s)
	return rs
}

type AgenciesService struct {
	s *Service

	Reports *AgenciesReportsService
}

func NewAgenciesReportsService(s *Service) *AgenciesReportsService {
	rs := &AgenciesReportsService{s: s}
	rs.Operations = NewAgenciesReportsOperationsService(s)
	rs.Results = NewAgenciesReportsResultsService(s)
	return rs
}

type AgenciesReportsService struct {
	s *Service

	Operations *AgenciesReportsOperationsService

	Results *AgenciesReportsResultsService
}

func NewAgenciesReportsOperationsService(s *Service) *AgenciesReportsOperationsService {
	rs := &AgenciesReportsOperationsService{s: s}
	return rs
}

type AgenciesReportsOperationsService struct {
	s *Service
}

func NewAgenciesReportsResultsService(s *Service) *AgenciesReportsResultsService {
	rs := &AgenciesReportsResultsService{s: s}
	return rs
}

type AgenciesReportsResultsService struct {
	s *Service
}

// Date: Represents a whole or partial calendar date, such as a birthday. The
// time of day and time zone are either specified elsewhere or are
// insignificant. The date is relative to the Gregorian Calendar. This can
// represent one of the following: * A full date, with non-zero year, month,
// and day values. * A month and day, with a zero year (for example, an
// anniversary). * A year on its own, with a zero month and a zero day. * A
// year and month, with a zero day (for example, a credit card expiration
// date). Related types: * google.type.TimeOfDay * google.type.DateTime *
// google.protobuf.Timestamp
type Date struct {
	// Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
	// or 0 to specify a year by itself or a year and month where the day isn't
	// significant.
	Day int64 `json:"day,omitempty"`
	// Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
	// a month and day.
	Month int64 `json:"month,omitempty"`
	// Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
	// without a year.
	Year int64 `json:"year,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Day") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Day") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Date) MarshalJSON() ([]byte, error) {
	type NoMethod Date
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// DateRange: A date range for a report.
type DateRange struct {
	// Fixed: A fixed date range.
	Fixed *FixedDateRange `json:"fixed,omitempty"`
	// Relative: A relative date range.
	//
	// Possible values:
	//   "RELATIVE_DATE_RANGE_UNSPECIFIED" - Default value. This value is unused.
	//   "TODAY" - The date the report is run.
	//   "YESTERDAY" - The date a day before the date that the report is run.
	//   "THIS_WEEK_TO_DATE" - From the beginning of the calendar week in which the
	// up to and including the day the report is run.
	//   "THIS_WEEK_TO_YESTERDAY" - From the beginning of the calendar week in
	// which the report is run, up to and including the day before the report is
	// run.
	//   "THIS_MONTH_TO_DATE" - From the beginning of the calendar month in which
	// the report is run, to up to and including the day the report is run.
	//   "THIS_MONTH_TO_YESTERDAY" - From the beginning of the calendar month in
	// which the report is run, up to and including the day before the report is
	// run.
	//   "THIS_QUARTER_TO_DATE" - From the beginning of the calendar quarter in
	// which the report is run, up to and including the day the report is run.
	//   "THIS_QUARTER_TO_YESTERDAY" - From the beginning of the calendar quarter
	// in which the report is run, up to and including the day before the report is
	// run.
	//   "THIS_YEAR_TO_DATE" - From the beginning of the calendar year in which the
	// report is run, to up to and including the day the report is run.
	//   "THIS_YEAR_TO_YESTERDAY" - From the beginning of the calendar year in
	// which the report is run, to up to and including the day before the report is
	// run.
	//   "LAST_WEEK" - The entire previous calendar week, Monday to Sunday
	// (inclusive), preceding the calendar week the report is run.
	//   "LAST_WEEK_STARTING_SUNDAY" - The entire previous calendar week, Sunday to
	// Saturday (inclusive), preceding the calendar week the report is run.
	//   "LAST_MONTH" - The entire previous calendar month preceding the calendar
	// month the report is run.
	//   "LAST_QUARTER" - The entire previous calendar quarter preceding the
	// calendar quarter the report is run.
	//   "LAST_YEAR" - The entire previous calendar year preceding the calendar
	// year the report is run.
	//   "LAST_7_DAYS" - The 7 days preceding the day the report is run.
	//   "LAST_30_DAYS" - The 30 days preceding the day the report is run.
	//   "LAST_60_DAYS" - The 60 days preceding the day the report is run.
	//   "LAST_90_DAYS" - The 90 days preceding the day the report is run.
	//   "LAST_93_DAYS" - The 93 days preceding the day the report is run.
	//   "LAST_180_DAYS" - The 180 days preceding the day the report is run.
	//   "LAST_360_DAYS" - The 360 days preceding the day the report is run.
	//   "LAST_365_DAYS" - The 365 days preceding the day the report is run.
	//   "LAST_3_MONTHS" - The entire previous 3 calendar months preceding the
	// calendar month the report is run.
	//   "LAST_6_MONTHS" - The entire previous 6 calendar months preceding the
	// calendar month the report is run.
	//   "LAST_12_MONTHS" - The entire previous 12 calendar months preceding the
	// calendar month the report is run.
	//   "ALL_AVAILABLE" - From 3 years before the report is run, to the day before
	// the report is run, inclusive.
	Relative string `json:"relative,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Fixed") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Fixed") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s DateRange) MarshalJSON() ([]byte, error) {
	type NoMethod DateRange
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// DoubleList: A list of double values.
type DoubleList struct {
	// Values: The values
	Values []float64 `json:"values,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Values") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Values") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s DoubleList) MarshalJSON() ([]byte, error) {
	type NoMethod DoubleList
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

func (s *DoubleList) UnmarshalJSON(data []byte) error {
	type NoMethod DoubleList
	var s1 struct {
		Values []gensupport.JSONFloat64 `json:"values"`
		*NoMethod
	}
	s1.NoMethod = (*NoMethod)(s)
	if err := json.Unmarshal(data, &s1); err != nil {
		return err
	}
	s.Values = make([]float64, len(s1.Values))
	for i := range s1.Values {
		s.Values[i] = float64(s1.Values[i])
	}
	return nil
}

// Empty: A generic empty message that you can re-use to avoid defining
// duplicated empty messages in your APIs. A typical example is to use it as
// the request or the response type of an API method. For instance: service Foo
// { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
type Empty struct {
	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
}

// FetchReportResultRowsResponse: The response message for the fetch report
// result rows endpoint.
type FetchReportResultRowsResponse struct {
	// DateRanges: The computed fixed date ranges this report includes. Only
	// returned with the first page of results (when page_token is not included in
	// the request).
	DateRanges []*FixedDateRange `json:"dateRanges,omitempty"`
	// NextPageToken: A token that can be sent as `page_token` to retrieve the next
	// page. If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken,omitempty"`
	// Rows: Up to `page_size` rows of report data.
	Rows []*Row `json:"rows,omitempty"`
	// RunTime: The time at which the report was scheduled to run. For
	// non-scheduled reports, this is the time at which the report was requested to
	// be run.
	RunTime string `json:"runTime,omitempty"`
	// TotalRowCount: The total number of rows available from this report. Useful
	// for pagination. Only returned with the first page of results (when
	// page_token is not included in the request).
	TotalRowCount int64 `json:"totalRowCount,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "DateRanges") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "DateRanges") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s FetchReportResultRowsResponse) MarshalJSON() ([]byte, error) {
	type NoMethod FetchReportResultRowsResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// Field: A dimension or a metric in a report.
type Field struct {
	// Dimension: The dimension this field represents.
	//
	// Possible values:
	//   "DIMENSION_UNSPECIFIED" - Default value. This value is unused.
	//   "ADVERTISER_DOMAIN" - The domain of the advertiser.
	//   "AGENCY_ACCOUNT_ID" - Agency account ID.
	//   "AGENCY_ACCOUNT_NAME" - Agency account name.
	//   "BID_FILTERING_REASON" - Reason that a Real-time Bidding bid was filtered
	// from the auction.
	//   "BID_FILTERING_REASON_NAME" - The short description of the reason that a
	// Real-time Bidding bid was filtered from the auction.
	//   "BUYER_SDK" - A boolean indicating whether the impression was rendered by
	// a buyer SDK. If set to true, the impression was rendered by a buyer SDK.
	//   "CAMPAIGN_ID" - The ID of the agency campaign.
	//   "CAMPAIGN_NAME" - The display name of the agency campaign.
	//   "COUNTRY" - Display name of a country.
	//   "CREATIVE_FORMAT" - Creative format, "Display" vs. "Video".
	//   "CREATIVE_ID" - Creative ID.
	//   "CREATIVE_POLICIES" - Applied creative policies.
	//   "CREATIVE_POLICIES_NAME" - The localized display name of applied creative
	// policies.
	//   "CREATIVE_SIZE" - Creative size.
	//   "CURATION_DATA_SEGMENT_ID" - The ID of the data segment created by a
	// curator.
	//   "CURATION_PARTNER_NAME" - The display name of the curation partner.
	//   "CURATOR_FEE_TYPE" - The type of curation service (e.g. packaging or data
	// segment).
	//   "DATE" - Date.
	//   "DEAL_ID" - Deal ID.
	//   "DEAL_NAME" - Deal name.
	//   "DETECTED_ADVERTISER_NAME" - Display name of the detected advertiser.
	//   "DSP_NAME" - Display name of the DSP.
	//   "DSP_SEAT_ID" - DSP Seat ID.
	//   "ENVIRONMENT" - The user device and container environment where the
	// impression originates. Supported values are "app" and "web".
	//   "ENVIRONMENT_NAME" - The localized display name of the user device and
	// container environment where the impression originates. Supported values are
	// "app" and "web".
	//   "GMA_SDK" - A boolean indicating whether the impression was rendered by
	// the Google Mobile Ads SDK. If set to true, the impression was rendered by
	// the Google Mobile Ads SDK.
	//   "HOUR" - Hour.
	//   "MOBILE_APP_ID" - Mobile App ID.
	//   "MOBILE_APP_NAME" - Mobile App Name.
	//   "MOBILE_OS" - Mobile operating system.
	//   "MONTH" - Month.
	//   "PACKAGE_FEE_VISIBILITY" - The visibility of the package fee (e.g.
	// disclosed or non-disclosed).
	//   "PLACEMENT_ID" - Placement ID.
	//   "PLATFORM" - Platform, e.g. "desktop" vs. "mobile".
	//   "PUBLISHER_DOMAIN" - Publisher domain.
	//   "PUBLISHER_ID" - Publisher identifier.
	//   "PUBLISHER_NAME" - Publisher name.
	//   "PUBLISHER_PROTECTIONS" - Whether publisher protections are applied.
	//   "PUBLISHER_PROTECTIONS_NAME" - The localized display name indicating
	// whether publisher protections are applied.
	//   "SELLER_AUTHORIZATION" - Seller authorization.
	//   "SELLER_AUTHORIZATION_NAME" - The localized display name of seller
	// authorization.
	//   "SUPPLY_PATH_TYPE" - The supply path type of the deal for Agency Direct.
	//   "SUPPLY_PATH_TYPE_NAME" - The localized display name of the supply path
	// type of the deal for Agency Direct.
	//   "TRANSACTION_TYPE" - The transaction type of the deal.
	//   "VAST_ERROR_CODE" - VAST error code.
	//   "WEEK" - Week.
	Dimension string `json:"dimension,omitempty"`
	// Metric: The metric this field represents.
	//
	// Possible values:
	//   "METRIC_UNSPECIFIED" - Default value. This value is unused.
	//   "ACTIVE_VIEW_MEASURABILITY_RATE" - Active View measurability rate.
	//   "ACTIVE_VIEW_MEASURABLE" - Active View measurable.
	//   "ACTIVE_VIEW_VIEWABILITY_RATE" - Active view viewability rate.
	//   "ACTIVE_VIEW_VIEWABLE" - Active View viewable imps.
	//   "AUCTIONS_WON" - Auctions won.
	//   "BIDS" - Bids.
	//   "BIDS_IN_AUCTION" - Bids in auction.
	//   "CLICKS" - Clicks.
	//   "CPC" - CPC.
	//   "CPM" - CPM.
	//   "CURATION_PARTNER_FEE" - Curator fee. This will be redacted to 0.00 if the
	// package's visibility is set to non-disclosed. Use the PACKAGE_FEE_VISIBILITY
	// dimension to check if the package's fee is disclosed.
	//   "DISCOUNT_AMOUNT" - Discount amount in media planner currency.
	//   "EFFECTIVE_DISCOUNT_RATE" - Discount rate in media planner currency.
	//   "ENGAGED_VIEWS" - Engaged views.
	//   "IMPRESSIONS" - Impressions.
	//   "PRE_DISCOUNT_SPEND" - Discount spend in media planner currency.
	//   "PRE_DISCOUNT_SPEND_WITHOUT_CURATION_PARTNER_FEE" - Gross media cost in
	// media planner currency.
	//   "REACHED_QUERIES" - Queries that are reached in the mediation chain.
	//   "SPEND" - Spend in reporting currency specified in the request. Defaults
	// to USD.
	//   "SPEND_WITHOUT_CURATION_PARTNER_FEE" - Net media cost in media planner
	// currency.
	//   "VAST_ERROR_COUNT" - Number of video impressions failed to render due to
	// VAST errors.
	//   "VIDEO_COMPLETE" - Number of video impressions played to completion.
	//   "VIDEO_FIRST_QUARTILE" - Number of video impressions played to the first
	// quartile.
	//   "VIDEO_MIDPOINT" - Number of video impressions played to the midpoint.
	//   "VIDEO_START" - Number of video impressions played.
	//   "VIDEO_THIRD_QUARTILE" - Number of video impressions played to the third
	// quartile.
	//   "VIDEO_VTR" - The rate in which video impressions were watched to
	// completion.
	Metric string `json:"metric,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Dimension") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Dimension") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Field) MarshalJSON() ([]byte, error) {
	type NoMethod Field
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// FieldFilter: A filter on a specific field.
type FieldFilter struct {
	// Field: Required. The field to filter on.
	Field *Field `json:"field,omitempty"`
	// Operation: Required. The operation of this filter.
	//
	// Possible values:
	//   "IN" - For scalar operands, checks if the operand is in the set of
	// provided filter values. For list operands, checks if any element in the
	// operand is in the set of provided filter values. Default value.
	//   "NOT_IN" - For scalar operands, checks that the operand is not in the set
	// of provided filter values. For list operands, checks that none of the
	// elements in the operand is in the set of provided filter values.
	//   "CONTAINS" - For scalar string operands, checks if the operand contains
	// any of the provided filter substrings. For string list operands, checks if
	// any string in the operand contains any of the provided filter substrings.
	//   "NOT_CONTAINS" - For scalar string operands, checks that the operand
	// contains none of the provided filter substrings. For string list operands,
	// checks that none of the strings in the operand contain none of the provided
	// filter substrings.
	//   "LESS_THAN" - Operand is less than the provided filter value.
	//   "LESS_THAN_EQUALS" - Operand is less than or equal to provided filter
	// value.
	//   "GREATER_THAN" - Operand is greater than provided filter value.
	//   "GREATER_THAN_EQUALS" - Operand is greater than or equal to provided
	// filter value.
	//   "BETWEEN" - Operand is between provided filter values.
	//   "MATCHES" - Operand matches against a regular expression or set of regular
	// expressions (one must match).
	//   "NOT_MATCHES" - Operand negative matches against a regular expression or
	// set of regular expressions (none must match).
	Operation string `json:"operation,omitempty"`
	// Values: Required. Values to filter to.
	Values []*ReportValue `json:"values,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Field") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Field") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s FieldFilter) MarshalJSON() ([]byte, error) {
	type NoMethod FieldFilter
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// Filter: A filter over one or more fields.
type Filter struct {
	// AndFilter: A list of filters whose results are AND-ed.
	AndFilter *FilterList `json:"andFilter,omitempty"`
	// FieldFilter: A filter on a single field.
	FieldFilter *FieldFilter `json:"fieldFilter,omitempty"`
	// NotFilter: A filter whose result is negated.
	NotFilter *Filter `json:"notFilter,omitempty"`
	// OrFilter: A list of filters whose results are OR-ed.
	OrFilter *FilterList `json:"orFilter,omitempty"`
	// ForceSendFields is a list of field names (e.g. "AndFilter") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "AndFilter") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Filter) MarshalJSON() ([]byte, error) {
	type NoMethod Filter
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// FilterList: A list of filters.
type FilterList struct {
	// Filters: Required. A list of filters.
	Filters []*Filter `json:"filters,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Filters") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Filters") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s FilterList) MarshalJSON() ([]byte, error) {
	type NoMethod FilterList
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// FixedDateRange: A date range between two fixed dates (inclusive of end
// date).
type FixedDateRange struct {
	// EndDate: Required. The end date (inclusive) of this date range.
	EndDate *Date `json:"endDate,omitempty"`
	// StartDate: Required. The start date of this date range.
	StartDate *Date `json:"startDate,omitempty"`
	// ForceSendFields is a list of field names (e.g. "EndDate") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "EndDate") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s FixedDateRange) MarshalJSON() ([]byte, error) {
	type NoMethod FixedDateRange
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// IntList: A list of integer values.
type IntList struct {
	// Values: The values
	Values googleapi.Int64s `json:"values,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Values") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Values") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s IntList) MarshalJSON() ([]byte, error) {
	type NoMethod IntList
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// ListReportsResponse: Response object for `ListReportsResponse` containing
// matching `Report` objects.
type ListReportsResponse struct {
	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
	// next page. If this field is omitted, there are no subsequent pages.
	NextPageToken string `json:"nextPageToken,omitempty"`
	// Reports: The `Report` objects from the specified network.
	Reports []*Report `json:"reports,omitempty"`
	// TotalSize: Total number of `Report` objects. If a filter was included in the
	// request, this reflects the total number after the filtering is applied.
	// `total_size` won't be calculated in the response unless it has been included
	// in a response field mask. The response field mask can be provided to the
	// method by using the URL parameter `$fields` or `fields`, or by using the
	// HTTP/gRPC header `X-Goog-FieldMask`. For more information, see
	// https://developers.google.com/ad-manager/api/beta/field-masks
	TotalSize int64 `json:"totalSize,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s ListReportsResponse) MarshalJSON() ([]byte, error) {
	type NoMethod ListReportsResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// MetricValueGroup: Contains all metric values requested for a single date
// range and set of column dimension values (returned in the columns field of
// the response). The order of the metrics in each field corresponds to the
// order of the metrics specified in the request.
type MetricValueGroup struct {
	// PrimaryValues: Data for the PRIMARY MetricValueType.
	PrimaryValues []*ReportValue `json:"primaryValues,omitempty"`
	// ForceSendFields is a list of field names (e.g. "PrimaryValues") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "PrimaryValues") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s MetricValueGroup) MarshalJSON() ([]byte, error) {
	type NoMethod MetricValueGroup
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// Operation: This resource represents a long-running operation that is the
// result of a network API call.
type Operation struct {
	// Done: If the value is `false`, it means the operation is still in progress.
	// If `true`, the operation is completed, and either `error` or `response` is
	// available.
	Done bool `json:"done,omitempty"`
	// Error: The error result of the operation in case of failure or cancellation.
	Error *Status `json:"error,omitempty"`
	// Metadata: Service-specific metadata associated with the operation. It
	// typically contains progress information and common metadata such as create
	// time. Some services might not provide such metadata. Any method that returns
	// a long-running operation should document the metadata type, if any.
	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
	// Name: The server-assigned name, which is only unique within the same service
	// that originally returns it. If you use the default HTTP mapping, the `name`
	// should be a resource name ending with `operations/{unique_id}`.
	Name string `json:"name,omitempty"`
	// Response: The normal, successful response of the operation. If the original
	// method returns no data on success, such as `Delete`, the response is
	// `google.protobuf.Empty`. If the original method is standard
	// `Get`/`Create`/`Update`, the response should be the resource. For other
	// methods, the response should have the type `XxxResponse`, where `Xxx` is the
	// original method name. For example, if the original method name is
	// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
	Response googleapi.RawMessage `json:"response,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Done") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Operation) MarshalJSON() ([]byte, error) {
	type NoMethod Operation
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// Report: The `Report` resource.
type Report struct {
	// CreateTime: Output only. The instant this report was created.
	CreateTime string `json:"createTime,omitempty"`
	// DisplayName: Optional. Display name for the report.
	DisplayName string `json:"displayName,omitempty"`
	// Locale: Output only. The locale of this report. Locale is set from the
	// user's locale at the time of the request. Locale can't be modified.
	Locale string `json:"locale,omitempty"`
	// Name: Identifier. The resource name of the report. Report resource name have
	// the form: `agencies/{account_id}/reports/{report_id}`
	Name string `json:"name,omitempty"`
	// ReportDefinition: Required. The report definition of the report.
	ReportDefinition *ReportDefinition `json:"reportDefinition,omitempty"`
	// ReportId: Output only. Report ID.
	ReportId int64 `json:"reportId,omitempty,string"`
	// UpdateTime: Output only. The instant this report was last modified.
	UpdateTime string `json:"updateTime,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "CreateTime") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CreateTime") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Report) MarshalJSON() ([]byte, error) {
	type NoMethod Report
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// ReportDefinition: The definition of how a report should be run.
type ReportDefinition struct {
	// CurrencyCode: Optional. The ISO 4217 currency code for this report. Defaults
	// to account currency code if not specified.
	CurrencyCode string `json:"currencyCode,omitempty"`
	// DateRange: Required. The primary date range of this report.
	DateRange *DateRange `json:"dateRange,omitempty"`
	// Dimensions: Required. The list of dimensions to report on. If empty, the
	// report will have no dimensions, and any metrics will be totals.
	//
	// Possible values:
	//   "DIMENSION_UNSPECIFIED" - Default value. This value is unused.
	//   "ADVERTISER_DOMAIN" - The domain of the advertiser.
	//   "AGENCY_ACCOUNT_ID" - Agency account ID.
	//   "AGENCY_ACCOUNT_NAME" - Agency account name.
	//   "BID_FILTERING_REASON" - Reason that a Real-time Bidding bid was filtered
	// from the auction.
	//   "BID_FILTERING_REASON_NAME" - The short description of the reason that a
	// Real-time Bidding bid was filtered from the auction.
	//   "BUYER_SDK" - A boolean indicating whether the impression was rendered by
	// a buyer SDK. If set to true, the impression was rendered by a buyer SDK.
	//   "CAMPAIGN_ID" - The ID of the agency campaign.
	//   "CAMPAIGN_NAME" - The display name of the agency campaign.
	//   "COUNTRY" - Display name of a country.
	//   "CREATIVE_FORMAT" - Creative format, "Display" vs. "Video".
	//   "CREATIVE_ID" - Creative ID.
	//   "CREATIVE_POLICIES" - Applied creative policies.
	//   "CREATIVE_POLICIES_NAME" - The localized display name of applied creative
	// policies.
	//   "CREATIVE_SIZE" - Creative size.
	//   "CURATION_DATA_SEGMENT_ID" - The ID of the data segment created by a
	// curator.
	//   "CURATION_PARTNER_NAME" - The display name of the curation partner.
	//   "CURATOR_FEE_TYPE" - The type of curation service (e.g. packaging or data
	// segment).
	//   "DATE" - Date.
	//   "DEAL_ID" - Deal ID.
	//   "DEAL_NAME" - Deal name.
	//   "DETECTED_ADVERTISER_NAME" - Display name of the detected advertiser.
	//   "DSP_NAME" - Display name of the DSP.
	//   "DSP_SEAT_ID" - DSP Seat ID.
	//   "ENVIRONMENT" - The user device and container environment where the
	// impression originates. Supported values are "app" and "web".
	//   "ENVIRONMENT_NAME" - The localized display name of the user device and
	// container environment where the impression originates. Supported values are
	// "app" and "web".
	//   "GMA_SDK" - A boolean indicating whether the impression was rendered by
	// the Google Mobile Ads SDK. If set to true, the impression was rendered by
	// the Google Mobile Ads SDK.
	//   "HOUR" - Hour.
	//   "MOBILE_APP_ID" - Mobile App ID.
	//   "MOBILE_APP_NAME" - Mobile App Name.
	//   "MOBILE_OS" - Mobile operating system.
	//   "MONTH" - Month.
	//   "PACKAGE_FEE_VISIBILITY" - The visibility of the package fee (e.g.
	// disclosed or non-disclosed).
	//   "PLACEMENT_ID" - Placement ID.
	//   "PLATFORM" - Platform, e.g. "desktop" vs. "mobile".
	//   "PUBLISHER_DOMAIN" - Publisher domain.
	//   "PUBLISHER_ID" - Publisher identifier.
	//   "PUBLISHER_NAME" - Publisher name.
	//   "PUBLISHER_PROTECTIONS" - Whether publisher protections are applied.
	//   "PUBLISHER_PROTECTIONS_NAME" - The localized display name indicating
	// whether publisher protections are applied.
	//   "SELLER_AUTHORIZATION" - Seller authorization.
	//   "SELLER_AUTHORIZATION_NAME" - The localized display name of seller
	// authorization.
	//   "SUPPLY_PATH_TYPE" - The supply path type of the deal for Agency Direct.
	//   "SUPPLY_PATH_TYPE_NAME" - The localized display name of the supply path
	// type of the deal for Agency Direct.
	//   "TRANSACTION_TYPE" - The transaction type of the deal.
	//   "VAST_ERROR_CODE" - VAST error code.
	//   "WEEK" - Week.
	Dimensions []string `json:"dimensions,omitempty"`
	// Filters: Optional. The filters for this report.
	Filters []*Filter `json:"filters,omitempty"`
	// Metrics: Required. The list of metrics to report on. If empty, the report
	// will have no metrics.
	//
	// Possible values:
	//   "METRIC_UNSPECIFIED" - Default value. This value is unused.
	//   "ACTIVE_VIEW_MEASURABILITY_RATE" - Active View measurability rate.
	//   "ACTIVE_VIEW_MEASURABLE" - Active View measurable.
	//   "ACTIVE_VIEW_VIEWABILITY_RATE" - Active view viewability rate.
	//   "ACTIVE_VIEW_VIEWABLE" - Active View viewable imps.
	//   "AUCTIONS_WON" - Auctions won.
	//   "BIDS" - Bids.
	//   "BIDS_IN_AUCTION" - Bids in auction.
	//   "CLICKS" - Clicks.
	//   "CPC" - CPC.
	//   "CPM" - CPM.
	//   "CURATION_PARTNER_FEE" - Curator fee. This will be redacted to 0.00 if the
	// package's visibility is set to non-disclosed. Use the PACKAGE_FEE_VISIBILITY
	// dimension to check if the package's fee is disclosed.
	//   "DISCOUNT_AMOUNT" - Discount amount in media planner currency.
	//   "EFFECTIVE_DISCOUNT_RATE" - Discount rate in media planner currency.
	//   "ENGAGED_VIEWS" - Engaged views.
	//   "IMPRESSIONS" - Impressions.
	//   "PRE_DISCOUNT_SPEND" - Discount spend in media planner currency.
	//   "PRE_DISCOUNT_SPEND_WITHOUT_CURATION_PARTNER_FEE" - Gross media cost in
	// media planner currency.
	//   "REACHED_QUERIES" - Queries that are reached in the mediation chain.
	//   "SPEND" - Spend in reporting currency specified in the request. Defaults
	// to USD.
	//   "SPEND_WITHOUT_CURATION_PARTNER_FEE" - Net media cost in media planner
	// currency.
	//   "VAST_ERROR_COUNT" - Number of video impressions failed to render due to
	// VAST errors.
	//   "VIDEO_COMPLETE" - Number of video impressions played to completion.
	//   "VIDEO_FIRST_QUARTILE" - Number of video impressions played to the first
	// quartile.
	//   "VIDEO_MIDPOINT" - Number of video impressions played to the midpoint.
	//   "VIDEO_START" - Number of video impressions played.
	//   "VIDEO_THIRD_QUARTILE" - Number of video impressions played to the third
	// quartile.
	//   "VIDEO_VTR" - The rate in which video impressions were watched to
	// completion.
	Metrics []string `json:"metrics,omitempty"`
	// Sorts: Optional. Default sorts to apply to this report.
	Sorts []*Sort `json:"sorts,omitempty"`
	// TimeZone: Optional. If time_zone_source is PROVIDED, this is the time zone
	// to use for this report. Leave empty for any other time zone source. Time
	// zone in IANA format. For example, "America/New_York".
	TimeZone string `json:"timeZone,omitempty"`
	// TimeZoneSource: Optional. Where to get the time zone for this report.
	// Defaults to using the Pacific time zone (PT). If source is PROVIDED, the
	// time_zone field in the report definition must also set a time zone.
	//
	// Possible values:
	//   "TIME_ZONE_SOURCE_UNSPECIFIED" - Unspecified default value.
	//   "AD_EXCHANGE" - Use the Pacific time zone(PT).
	//   "UTC" - Use UTC time zone.
	//   "PROVIDED" - Use the time zone provided in the ReportDefinition.time_zone
	// field. Reports may take longer to run since the dates are dynamically
	// calculated at request time.
	//   "AGENCY" - Use the time zone from the agency's account settings.
	TimeZoneSource string `json:"timeZoneSource,omitempty"`
	// ForceSendFields is a list of field names (e.g. "CurrencyCode") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "CurrencyCode") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s ReportDefinition) MarshalJSON() ([]byte, error) {
	type NoMethod ReportDefinition
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// ReportValue: Represents a single value in a report.
type ReportValue struct {
	// BoolValue: For boolean values.
	BoolValue bool `json:"boolValue,omitempty"`
	// BytesValue: For bytes values.
	BytesValue string `json:"bytesValue,omitempty"`
	// DoubleListValue: For lists of double values.
	DoubleListValue *DoubleList `json:"doubleListValue,omitempty"`
	// DoubleValue: For double values.
	DoubleValue float64 `json:"doubleValue,omitempty"`
	// IntListValue: For lists of integer values.
	IntListValue *IntList `json:"intListValue,omitempty"`
	// IntValue: For integer values.
	IntValue int64 `json:"intValue,omitempty,string"`
	// StringListValue: For lists of string values.
	StringListValue *StringList `json:"stringListValue,omitempty"`
	// StringValue: For string values.
	StringValue string `json:"stringValue,omitempty"`
	// ForceSendFields is a list of field names (e.g. "BoolValue") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BoolValue") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s ReportValue) MarshalJSON() ([]byte, error) {
	type NoMethod ReportValue
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

func (s *ReportValue) UnmarshalJSON(data []byte) error {
	type NoMethod ReportValue
	var s1 struct {
		DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
		*NoMethod
	}
	s1.NoMethod = (*NoMethod)(s)
	if err := json.Unmarshal(data, &s1); err != nil {
		return err
	}
	s.DoubleValue = float64(s1.DoubleValue)
	return nil
}

// Row: A row of report data.
type Row struct {
	// DimensionValues: The order of the dimension values is the same as the order
	// of the dimensions specified in the request.
	DimensionValues []*ReportValue `json:"dimensionValues,omitempty"`
	// MetricValueGroups:  The length of the metric_value_groups field will be
	// equal to the length of the date_ranges field in the fetch response. The
	// metric_value_groups field is ordered such that each index corresponds to the
	// date_range at the same index. For example, given date_ranges [x, y],
	// metric_value_groups will have a length of two. The first entry in
	// metric_value_groups represents the metrics for date x and the second entry
	// in metric_value_groups represents the metrics for date y.
	MetricValueGroups []*MetricValueGroup `json:"metricValueGroups,omitempty"`
	// ForceSendFields is a list of field names (e.g. "DimensionValues") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "DimensionValues") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Row) MarshalJSON() ([]byte, error) {
	type NoMethod Row
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// RunReportMetadata: `RunReport` operation metadata.
type RunReportMetadata struct {
	// PercentComplete: An estimate of how close this report is to being completed.
	// Will always be 100 for failed and completed reports.
	PercentComplete int64 `json:"percentComplete,omitempty"`
	// Report: The result's parent report.
	Report string `json:"report,omitempty"`
	// ForceSendFields is a list of field names (e.g. "PercentComplete") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "PercentComplete") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s RunReportMetadata) MarshalJSON() ([]byte, error) {
	type NoMethod RunReportMetadata
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// RunReportRequest: Request message for a running a report.
type RunReportRequest struct {
}

// RunReportResponse: Response message for a completed `RunReport` operation.
type RunReportResponse struct {
	// ReportResult: The unique name of the generated result. Use with
	// `FetchReportResultRows` to retrieve data.
	ReportResult string `json:"reportResult,omitempty"`
	// ForceSendFields is a list of field names (e.g. "ReportResult") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "ReportResult") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s RunReportResponse) MarshalJSON() ([]byte, error) {
	type NoMethod RunReportResponse
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// Sort: Represents a sorting in a report.
type Sort struct {
	// Descending: Optional. The sort order. If true the sort will be descending.
	Descending bool `json:"descending,omitempty"`
	// Field: Required. A field (dimension or metric) to sort by.
	Field *Field `json:"field,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Descending") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Descending") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Sort) MarshalJSON() ([]byte, error) {
	type NoMethod Sort
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// Status: The `Status` type defines a logical error model that is suitable for
// different programming environments, including REST APIs and RPC APIs. It is
// used by gRPC (https://github.com/grpc). Each `Status` message contains three
// pieces of data: error code, error message, and error details. You can find
// out more about this error model and how to work with it in the API Design
// Guide (https://cloud.google.com/apis/design/errors).
type Status struct {
	// Code: The status code, which should be an enum value of google.rpc.Code.
	Code int64 `json:"code,omitempty"`
	// Details: A list of messages that carry the error details. There is a common
	// set of message types for APIs to use.
	Details []googleapi.RawMessage `json:"details,omitempty"`
	// Message: A developer-facing error message, which should be in English. Any
	// user-facing error message should be localized and sent in the
	// google.rpc.Status.details field, or localized by the client.
	Message string `json:"message,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Code") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s Status) MarshalJSON() ([]byte, error) {
	type NoMethod Status
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

// StringList: A list of string values.
type StringList struct {
	// Values: The values
	Values []string `json:"values,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Values") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Values") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

func (s StringList) MarshalJSON() ([]byte, error) {
	type NoMethod StringList
	return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
}

type AgenciesReportsCreateCall struct {
	s          *Service
	parent     string
	report     *Report
	urlParams_ gensupport.URLParams
	ctx_       context.Context
	header_    http.Header
}

// Create: Creates a `Report` object.
//
//   - parent: The parent resource where this `Report` will be created. Format:
//     `agencies/{account_id}`.
func (r *AgenciesReportsService) Create(parent string, report *Report) *AgenciesReportsCreateCall {
	c := &AgenciesReportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.parent = parent
	c.report = report
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsCreateCall) Fields(s ...googleapi.Field) *AgenciesReportsCreateCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsCreateCall) Context(ctx context.Context) *AgenciesReportsCreateCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsCreateCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsCreateCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
	body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report)
	if err != nil {
		return nil, err
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reports")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, body)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"parent": c.parent,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.create", "request", internallog.HTTPRequest(req, body.Bytes()))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.create" call.
// Any non-2xx status code is an error. Response headers are in either
// *Report.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *AgenciesReportsCreateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &Report{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.create", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type AgenciesReportsDeleteCall struct {
	s          *Service
	name       string
	urlParams_ gensupport.URLParams
	ctx_       context.Context
	header_    http.Header
}

// Delete: Deletes a `Report` object.
//
//   - name: Resource name of the report to delete. Format:
//     `agencies/{account_id}/reports/{report_id}`.
func (r *AgenciesReportsService) Delete(name string) *AgenciesReportsDeleteCall {
	c := &AgenciesReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsDeleteCall) Fields(s ...googleapi.Field) *AgenciesReportsDeleteCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsDeleteCall) Context(ctx context.Context) *AgenciesReportsDeleteCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsDeleteCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("DELETE", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.delete", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.delete" call.
// Any non-2xx status code is an error. Response headers are in either
// *Empty.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *AgenciesReportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &Empty{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.delete", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type AgenciesReportsGetCall struct {
	s            *Service
	name         string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Get: Retrieves a `Report` object.
//
//   - name: The resource name of the report. Format:
//     `agencies/{account_id}/reports/{report_id}`.
func (r *AgenciesReportsService) Get(name string) *AgenciesReportsGetCall {
	c := &AgenciesReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsGetCall) Fields(s ...googleapi.Field) *AgenciesReportsGetCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *AgenciesReportsGetCall) IfNoneMatch(entityTag string) *AgenciesReportsGetCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsGetCall) Context(ctx context.Context) *AgenciesReportsGetCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsGetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsGetCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.get", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *Report.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *AgenciesReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &Report{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.get", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type AgenciesReportsListCall struct {
	s            *Service
	parent       string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// List: Lists `Report` objects.
//
//   - parent: The parent, which owns this collection of reports. Format:
//     `agencies/{account_id}`.
func (r *AgenciesReportsService) List(parent string) *AgenciesReportsListCall {
	c := &AgenciesReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.parent = parent
	return c
}

// Filter sets the optional parameter "filter": Expression to filter the
// response. See syntax details at
// https://developers.google.com/ad-manager/api/beta/filters
func (c *AgenciesReportsListCall) Filter(filter string) *AgenciesReportsListCall {
	c.urlParams_.Set("filter", filter)
	return c
}

// OrderBy sets the optional parameter "orderBy": Expression to specify sorting
// order. See syntax details at
// https://developers.google.com/ad-manager/api/beta/filters#order
func (c *AgenciesReportsListCall) OrderBy(orderBy string) *AgenciesReportsListCall {
	c.urlParams_.Set("orderBy", orderBy)
	return c
}

// PageSize sets the optional parameter "pageSize": The maximum number of
// `Reports` to return. The service may return fewer than this value. If
// unspecified, at most 50 `Reports` will be returned. The maximum value is
// 1000; values greater than 1000 will be coerced to 1000.
func (c *AgenciesReportsListCall) PageSize(pageSize int64) *AgenciesReportsListCall {
	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
	return c
}

// PageToken sets the optional parameter "pageToken": A page token, received
// from a previous `ListReports` call. Provide this to retrieve the subsequent
// page. When paginating, all other parameters provided to `ListReports` must
// match the call that provided the page token.
func (c *AgenciesReportsListCall) PageToken(pageToken string) *AgenciesReportsListCall {
	c.urlParams_.Set("pageToken", pageToken)
	return c
}

// Skip sets the optional parameter "skip": Number of individual resources to
// skip while paginating.
func (c *AgenciesReportsListCall) Skip(skip int64) *AgenciesReportsListCall {
	c.urlParams_.Set("skip", fmt.Sprint(skip))
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsListCall) Fields(s ...googleapi.Field) *AgenciesReportsListCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *AgenciesReportsListCall) IfNoneMatch(entityTag string) *AgenciesReportsListCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsListCall) Context(ctx context.Context) *AgenciesReportsListCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsListCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsListCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/reports")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"parent": c.parent,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.list", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.list" call.
// Any non-2xx status code is an error. Response headers are in either
// *ListReportsResponse.ServerResponse.Header or (if a response was returned at
// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
// check whether the returned error was because http.StatusNotModified was
// returned.
func (c *AgenciesReportsListCall) Do(opts ...googleapi.CallOption) (*ListReportsResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &ListReportsResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.list", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *AgenciesReportsListCall) Pages(ctx context.Context, f func(*ListReportsResponse) error) error {
	c.ctx_ = ctx
	defer c.PageToken(c.urlParams_.Get("pageToken"))
	for {
		x, err := c.Do()
		if err != nil {
			return err
		}
		if err := f(x); err != nil {
			return err
		}
		if x.NextPageToken == "" {
			return nil
		}
		c.PageToken(x.NextPageToken)
	}
}

type AgenciesReportsPatchCall struct {
	s          *Service
	name       string
	report     *Report
	urlParams_ gensupport.URLParams
	ctx_       context.Context
	header_    http.Header
}

// Patch: Updates a `Report` object.
//
//   - name: Identifier. The resource name of the report. Report resource name
//     have the form: `agencies/{account_id}/reports/{report_id}`.
func (r *AgenciesReportsService) Patch(name string, report *Report) *AgenciesReportsPatchCall {
	c := &AgenciesReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	c.report = report
	return c
}

// UpdateMask sets the optional parameter "updateMask": The list of fields to
// update.
func (c *AgenciesReportsPatchCall) UpdateMask(updateMask string) *AgenciesReportsPatchCall {
	c.urlParams_.Set("updateMask", updateMask)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsPatchCall) Fields(s ...googleapi.Field) *AgenciesReportsPatchCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsPatchCall) Context(ctx context.Context) *AgenciesReportsPatchCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsPatchCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsPatchCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
	body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.report)
	if err != nil {
		return nil, err
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("PATCH", urls, body)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.patch", "request", internallog.HTTPRequest(req, body.Bytes()))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.patch" call.
// Any non-2xx status code is an error. Response headers are in either
// *Report.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *AgenciesReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &Report{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.patch", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type AgenciesReportsRunCall struct {
	s                *Service
	name             string
	runreportrequest *RunReportRequest
	urlParams_       gensupport.URLParams
	ctx_             context.Context
	header_          http.Header
}

// Run: Initiates the execution of an existing report asynchronously. Users can
// get the report by polling this operation using
// `OperationsService.GetOperation`. Poll every 5 seconds initially, with an
// exponential backoff. Once a report is complete, the operation will contain a
// `RunReportResponse` in its response field containing a report_result that
// can be passed to the `FetchReportResultRows` method to retrieve the report
// data.
//
//   - name: The report to run. Format:
//     `agencies/{account_id}/reports/{report_id}`.
func (r *AgenciesReportsService) Run(name string, runreportrequest *RunReportRequest) *AgenciesReportsRunCall {
	c := &AgenciesReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	c.runreportrequest = runreportrequest
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsRunCall) Fields(s ...googleapi.Field) *AgenciesReportsRunCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsRunCall) Context(ctx context.Context) *AgenciesReportsRunCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsRunCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsRunCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
	body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.runreportrequest)
	if err != nil {
		return nil, err
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:run")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("POST", urls, body)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.run", "request", internallog.HTTPRequest(req, body.Bytes()))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.run" call.
// Any non-2xx status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *AgenciesReportsRunCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &Operation{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.run", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type AgenciesReportsOperationsGetCall struct {
	s            *Service
	name         string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// Get: Gets the latest state of a long-running operation. Clients can use this
// method to poll the operation result at intervals as recommended by the API
// service.
//
// - name: The name of the operation resource.
func (r *AgenciesReportsOperationsService) Get(name string) *AgenciesReportsOperationsGetCall {
	c := &AgenciesReportsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsOperationsGetCall) Fields(s ...googleapi.Field) *AgenciesReportsOperationsGetCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *AgenciesReportsOperationsGetCall) IfNoneMatch(entityTag string) *AgenciesReportsOperationsGetCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsOperationsGetCall) Context(ctx context.Context) *AgenciesReportsOperationsGetCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsOperationsGetCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.operations.get", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.operations.get" call.
// Any non-2xx status code is an error. Response headers are in either
// *Operation.ServerResponse.Header or (if a response was returned at all) in
// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
// whether the returned error was because http.StatusNotModified was returned.
func (c *AgenciesReportsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &Operation{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.operations.get", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

type AgenciesReportsResultsFetchRowsCall struct {
	s            *Service
	name         string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// FetchRows: Returns the result rows from a completed report. The caller must
// have previously called `RunReport` and waited for that operation to
// complete. The rows will be returned according to the order specified by the
// `sorts` member of the report definition.
//
//   - name: The report result being fetched. Format:
//     `agencies/{account_id}/reports/{report_id}/results/{report_result_id}`.
func (r *AgenciesReportsResultsService) FetchRows(name string) *AgenciesReportsResultsFetchRowsCall {
	c := &AgenciesReportsResultsFetchRowsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// PageSize sets the optional parameter "pageSize": The maximum number of rows
// to return. The service may return fewer than this value. If unspecified, at
// most 1,000 rows will be returned. The maximum value is 10,000; values
// greater than 10,000 will be reduced to 10,000.
func (c *AgenciesReportsResultsFetchRowsCall) PageSize(pageSize int64) *AgenciesReportsResultsFetchRowsCall {
	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
	return c
}

// PageToken sets the optional parameter "pageToken": A page token, received
// from a previous `FetchReportResultRows` call. Provide this to retrieve the
// second and subsequent batches of rows.
func (c *AgenciesReportsResultsFetchRowsCall) PageToken(pageToken string) *AgenciesReportsResultsFetchRowsCall {
	c.urlParams_.Set("pageToken", pageToken)
	return c
}

// Fields allows partial responses to be retrieved. See
// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
// details.
func (c *AgenciesReportsResultsFetchRowsCall) Fields(s ...googleapi.Field) *AgenciesReportsResultsFetchRowsCall {
	c.urlParams_.Set("fields", googleapi.CombineFields(s))
	return c
}

// IfNoneMatch sets an optional parameter which makes the operation fail if the
// object's ETag matches the given value. This is useful for getting updates
// only after the object has changed since the last request.
func (c *AgenciesReportsResultsFetchRowsCall) IfNoneMatch(entityTag string) *AgenciesReportsResultsFetchRowsCall {
	c.ifNoneMatch_ = entityTag
	return c
}

// Context sets the context to be used in this call's Do method.
func (c *AgenciesReportsResultsFetchRowsCall) Context(ctx context.Context) *AgenciesReportsResultsFetchRowsCall {
	c.ctx_ = ctx
	return c
}

// Header returns a http.Header that can be modified by the caller to add
// headers to the request.
func (c *AgenciesReportsResultsFetchRowsCall) Header() http.Header {
	if c.header_ == nil {
		c.header_ = make(http.Header)
	}
	return c.header_
}

func (c *AgenciesReportsResultsFetchRowsCall) doRequest(alt string) (*http.Response, error) {
	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
	if c.ifNoneMatch_ != "" {
		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
	}
	c.urlParams_.Set("alt", alt)
	c.urlParams_.Set("prettyPrint", "false")
	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:fetchRows")
	urls += "?" + c.urlParams_.Encode()
	req, err := http.NewRequest("GET", urls, nil)
	if err != nil {
		return nil, err
	}
	req.Header = reqHeaders
	googleapi.Expand(req.URL, map[string]string{
		"name": c.name,
	})
	c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.results.fetchRows", "request", internallog.HTTPRequest(req, nil))
	return gensupport.SendRequest(c.ctx_, c.s.client, req)
}

// Do executes the "agenciesandbrands.agencies.reports.results.fetchRows" call.
// Any non-2xx status code is an error. Response headers are in either
// *FetchReportResultRowsResponse.ServerResponse.Header or (if a response was
// returned at all) in error.(*googleapi.Error).Header. Use
// googleapi.IsNotModified to check whether the returned error was because
// http.StatusNotModified was returned.
func (c *AgenciesReportsResultsFetchRowsCall) Do(opts ...googleapi.CallOption) (*FetchReportResultRowsResponse, error) {
	gensupport.SetOptions(c.urlParams_, opts...)
	res, err := c.doRequest("json")
	if res != nil && res.StatusCode == http.StatusNotModified {
		if res.Body != nil {
			res.Body.Close()
		}
		return nil, gensupport.WrapError(&googleapi.Error{
			Code:   res.StatusCode,
			Header: res.Header,
		})
	}
	if err != nil {
		return nil, err
	}
	defer googleapi.CloseBody(res)
	if err := googleapi.CheckResponse(res); err != nil {
		return nil, gensupport.WrapError(err)
	}
	ret := &FetchReportResultRowsResponse{
		ServerResponse: googleapi.ServerResponse{
			Header:         res.Header,
			HTTPStatusCode: res.StatusCode,
		},
	}
	target := &ret
	b, err := gensupport.DecodeResponseBytes(target, res)
	if err != nil {
		return nil, err
	}
	c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "agenciesandbrands.agencies.reports.results.fetchRows", "response", internallog.HTTPResponse(res, b))
	return ret, nil
}

// Pages invokes f for each page of results.
// A non-nil error returned from f will halt the iteration.
// The provided context supersedes any context provided to the Context method.
func (c *AgenciesReportsResultsFetchRowsCall) Pages(ctx context.Context, f func(*FetchReportResultRowsResponse) error) error {
	c.ctx_ = ctx
	defer c.PageToken(c.urlParams_.Get("pageToken"))
	for {
		x, err := c.Do()
		if err != nil {
			return err
		}
		if err := f(x); err != nil {
			return err
		}
		if x.NextPageToken == "" {
			return nil
		}
		c.PageToken(x.NextPageToken)
	}
}
