1// Package dfareporting provides access to the DFA Reporting API.
2//
3// See https://developers.google.com/doubleclick-advertisers/reporting/
4//
5// Usage example:
6//
7//   import "google.golang.org/api/dfareporting/v1.2"
8//   ...
9//   dfareportingService, err := dfareporting.New(oauthHttpClient)
10package dfareporting // import "google.golang.org/api/dfareporting/v1.2"
11
12import (
13	"bytes"
14	"encoding/json"
15	"errors"
16	"fmt"
17	context "golang.org/x/net/context"
18	ctxhttp "golang.org/x/net/context/ctxhttp"
19	gensupport "google.golang.org/api/gensupport"
20	googleapi "google.golang.org/api/googleapi"
21	"io"
22	"net/http"
23	"net/url"
24	"strconv"
25	"strings"
26)
27
28// Always reference these packages, just in case the auto-generated code
29// below doesn't.
30var _ = bytes.NewBuffer
31var _ = strconv.Itoa
32var _ = fmt.Sprintf
33var _ = json.NewDecoder
34var _ = io.Copy
35var _ = url.Parse
36var _ = gensupport.MarshalJSON
37var _ = googleapi.Version
38var _ = errors.New
39var _ = strings.Replace
40var _ = context.Canceled
41var _ = ctxhttp.Do
42
43const apiId = "dfareporting:v1.2"
44const apiName = "dfareporting"
45const apiVersion = "v1.2"
46const basePath = "https://www.googleapis.com/dfareporting/v1.2/"
47
48// OAuth2 scopes used by this API.
49const (
50	// View and manage DoubleClick for Advertisers reports
51	DfareportingScope = "https://www.googleapis.com/auth/dfareporting"
52)
53
54func New(client *http.Client) (*Service, error) {
55	if client == nil {
56		return nil, errors.New("client is nil")
57	}
58	s := &Service{client: client, BasePath: basePath}
59	s.DimensionValues = NewDimensionValuesService(s)
60	s.Files = NewFilesService(s)
61	s.Reports = NewReportsService(s)
62	s.UserProfiles = NewUserProfilesService(s)
63	return s, nil
64}
65
66type Service struct {
67	client    *http.Client
68	BasePath  string // API endpoint base URL
69	UserAgent string // optional additional User-Agent fragment
70
71	DimensionValues *DimensionValuesService
72
73	Files *FilesService
74
75	Reports *ReportsService
76
77	UserProfiles *UserProfilesService
78}
79
80func (s *Service) userAgent() string {
81	if s.UserAgent == "" {
82		return googleapi.UserAgent
83	}
84	return googleapi.UserAgent + " " + s.UserAgent
85}
86
87func NewDimensionValuesService(s *Service) *DimensionValuesService {
88	rs := &DimensionValuesService{s: s}
89	return rs
90}
91
92type DimensionValuesService struct {
93	s *Service
94}
95
96func NewFilesService(s *Service) *FilesService {
97	rs := &FilesService{s: s}
98	return rs
99}
100
101type FilesService struct {
102	s *Service
103}
104
105func NewReportsService(s *Service) *ReportsService {
106	rs := &ReportsService{s: s}
107	rs.Files = NewReportsFilesService(s)
108	return rs
109}
110
111type ReportsService struct {
112	s *Service
113
114	Files *ReportsFilesService
115}
116
117func NewReportsFilesService(s *Service) *ReportsFilesService {
118	rs := &ReportsFilesService{s: s}
119	return rs
120}
121
122type ReportsFilesService struct {
123	s *Service
124}
125
126func NewUserProfilesService(s *Service) *UserProfilesService {
127	rs := &UserProfilesService{s: s}
128	return rs
129}
130
131type UserProfilesService struct {
132	s *Service
133}
134
135// Activities: Represents an activity group.
136type Activities struct {
137	// Filters: List of activity filters. The dimension values need to be
138	// all either of type "dfa:activity" or "dfa:activityGroup".
139	Filters []*DimensionValue `json:"filters,omitempty"`
140
141	// Kind: The kind of resource this is, in this case
142	// dfareporting#activities.
143	Kind string `json:"kind,omitempty"`
144
145	// MetricNames: List of names of floodlight activity metrics.
146	MetricNames []string `json:"metricNames,omitempty"`
147
148	// ForceSendFields is a list of field names (e.g. "Filters") to
149	// unconditionally include in API requests. By default, fields with
150	// empty values are omitted from API requests. However, any non-pointer,
151	// non-interface field appearing in ForceSendFields will be sent to the
152	// server regardless of whether the field is empty or not. This may be
153	// used to include empty fields in Patch requests.
154	ForceSendFields []string `json:"-"`
155}
156
157func (s *Activities) MarshalJSON() ([]byte, error) {
158	type noMethod Activities
159	raw := noMethod(*s)
160	return gensupport.MarshalJSON(raw, s.ForceSendFields)
161}
162
163// CustomRichMediaEvents: Represents a Custom Rich Media Events group.
164type CustomRichMediaEvents struct {
165	// FilteredEventIds: List of custom rich media event IDs. Dimension
166	// values must be all of type dfa:richMediaEventTypeIdAndName.
167	FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
168
169	// Kind: The kind of resource this is, in this case
170	// dfareporting#customRichMediaEvents.
171	Kind string `json:"kind,omitempty"`
172
173	// ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
174	// unconditionally include in API requests. By default, fields with
175	// empty values are omitted from API requests. However, any non-pointer,
176	// non-interface field appearing in ForceSendFields will be sent to the
177	// server regardless of whether the field is empty or not. This may be
178	// used to include empty fields in Patch requests.
179	ForceSendFields []string `json:"-"`
180}
181
182func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
183	type noMethod CustomRichMediaEvents
184	raw := noMethod(*s)
185	return gensupport.MarshalJSON(raw, s.ForceSendFields)
186}
187
188// DateRange: Represents a date range.
189type DateRange struct {
190	// EndDate: The end date of the date range, inclusive. A string of the
191	// format: "yyyy-MM-dd".
192	EndDate string `json:"endDate,omitempty"`
193
194	// Kind: The kind of resource this is, in this case
195	// dfareporting#dateRange.
196	Kind string `json:"kind,omitempty"`
197
198	// RelativeDateRange: The date range relative to the date of when the
199	// report is run, one of:
200	// - "TODAY"
201	// - "YESTERDAY"
202	// - "WEEK_TO_DATE"
203	// - "MONTH_TO_DATE"
204	// - "QUARTER_TO_DATE"
205	// - "YEAR_TO_DATE"
206	// - "PREVIOUS_WEEK"
207	// - "PREVIOUS_MONTH"
208	// - "PREVIOUS_QUARTER"
209	// - "PREVIOUS_YEAR"
210	// - "LAST_7_DAYS"
211	// - "LAST_30_DAYS"
212	// - "LAST_90_DAYS"
213	// - "LAST_365_DAYS"
214	// - "LAST_24_MONTHS"
215	RelativeDateRange string `json:"relativeDateRange,omitempty"`
216
217	// StartDate: The start date of the date range, inclusive. A string of
218	// the format: "yyyy-MM-dd".
219	StartDate string `json:"startDate,omitempty"`
220
221	// ForceSendFields is a list of field names (e.g. "EndDate") to
222	// unconditionally include in API requests. By default, fields with
223	// empty values are omitted from API requests. However, any non-pointer,
224	// non-interface field appearing in ForceSendFields will be sent to the
225	// server regardless of whether the field is empty or not. This may be
226	// used to include empty fields in Patch requests.
227	ForceSendFields []string `json:"-"`
228}
229
230func (s *DateRange) MarshalJSON() ([]byte, error) {
231	type noMethod DateRange
232	raw := noMethod(*s)
233	return gensupport.MarshalJSON(raw, s.ForceSendFields)
234}
235
236// DimensionFilter: Represents a dimension filter.
237type DimensionFilter struct {
238	// DimensionName: The name of the dimension to filter.
239	DimensionName string `json:"dimensionName,omitempty"`
240
241	// Kind: The kind of resource this is, in this case
242	// dfareporting#dimensionFilter.
243	Kind string `json:"kind,omitempty"`
244
245	// Value: The value of the dimension to filter.
246	Value string `json:"value,omitempty"`
247
248	// ForceSendFields is a list of field names (e.g. "DimensionName") to
249	// unconditionally include in API requests. By default, fields with
250	// empty values are omitted from API requests. However, any non-pointer,
251	// non-interface field appearing in ForceSendFields will be sent to the
252	// server regardless of whether the field is empty or not. This may be
253	// used to include empty fields in Patch requests.
254	ForceSendFields []string `json:"-"`
255}
256
257func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
258	type noMethod DimensionFilter
259	raw := noMethod(*s)
260	return gensupport.MarshalJSON(raw, s.ForceSendFields)
261}
262
263// DimensionValue: Represents a DimensionValue resource.
264type DimensionValue struct {
265	// DimensionName: The name of the dimension.
266	DimensionName string `json:"dimensionName,omitempty"`
267
268	// Etag: The eTag of this response for caching purposes.
269	Etag string `json:"etag,omitempty"`
270
271	// Id: The ID associated with the value if available.
272	Id string `json:"id,omitempty"`
273
274	// Kind: The kind of resource this is, in this case
275	// dfareporting#dimensionValue.
276	Kind string `json:"kind,omitempty"`
277
278	// MatchType: Determines how the 'value' field is matched when
279	// filtering. One of:
280	// - EXACT (default if not specified)
281	// - CONTAINS
282	// - BEGINS_WITH
283	// - WILDCARD_EXPRESSION (allowing '*' as a placeholder for variable
284	// length character sequences, it can be escaped with a backslash.)
285	// Note, only paid search dimensions ('dfa:paidSearch*') allow a
286	// matchType other than EXACT.
287	MatchType string `json:"matchType,omitempty"`
288
289	// Value: The value of the dimension.
290	Value string `json:"value,omitempty"`
291
292	// ForceSendFields is a list of field names (e.g. "DimensionName") to
293	// unconditionally include in API requests. By default, fields with
294	// empty values are omitted from API requests. However, any non-pointer,
295	// non-interface field appearing in ForceSendFields will be sent to the
296	// server regardless of whether the field is empty or not. This may be
297	// used to include empty fields in Patch requests.
298	ForceSendFields []string `json:"-"`
299}
300
301func (s *DimensionValue) MarshalJSON() ([]byte, error) {
302	type noMethod DimensionValue
303	raw := noMethod(*s)
304	return gensupport.MarshalJSON(raw, s.ForceSendFields)
305}
306
307// DimensionValueList: Represents the list of DimensionValue resources.
308type DimensionValueList struct {
309	// Etag: The eTag of this response for caching purposes.
310	Etag string `json:"etag,omitempty"`
311
312	// Items: The dimension values returned in this response.
313	Items []*DimensionValue `json:"items,omitempty"`
314
315	// Kind: The kind of list this is, in this case
316	// dfareporting#dimensionValueList.
317	Kind string `json:"kind,omitempty"`
318
319	// NextPageToken: Continuation token used to page through dimension
320	// values. To retrieve the next page of results, set the next request's
321	// "pageToken" to the value of this field. The page token is only valid
322	// for a limited amount of time and should not be persisted.
323	NextPageToken string `json:"nextPageToken,omitempty"`
324
325	// ServerResponse contains the HTTP response code and headers from the
326	// server.
327	googleapi.ServerResponse `json:"-"`
328
329	// ForceSendFields is a list of field names (e.g. "Etag") to
330	// unconditionally include in API requests. By default, fields with
331	// empty values are omitted from API requests. However, any non-pointer,
332	// non-interface field appearing in ForceSendFields will be sent to the
333	// server regardless of whether the field is empty or not. This may be
334	// used to include empty fields in Patch requests.
335	ForceSendFields []string `json:"-"`
336}
337
338func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
339	type noMethod DimensionValueList
340	raw := noMethod(*s)
341	return gensupport.MarshalJSON(raw, s.ForceSendFields)
342}
343
344// DimensionValueRequest: Represents a DimensionValuesRequest.
345type DimensionValueRequest struct {
346	// DimensionName: The name of the dimension for which values should be
347	// requested.
348	DimensionName string `json:"dimensionName,omitempty"`
349
350	// EndDate: The end date of the date range for which to retrieve
351	// dimension values. A string of the format: "yyyy-MM-dd".
352	EndDate string `json:"endDate,omitempty"`
353
354	// Filters: The list of filters by which to filter values. The filters
355	// are ANDed.
356	Filters []*DimensionFilter `json:"filters,omitempty"`
357
358	// Kind: The kind of request this is, in this case
359	// dfareporting#dimensionValueRequest.
360	Kind string `json:"kind,omitempty"`
361
362	// StartDate: The start date of the date range for which to retrieve
363	// dimension values. A string of the format: "yyyy-MM-dd".
364	StartDate string `json:"startDate,omitempty"`
365
366	// ForceSendFields is a list of field names (e.g. "DimensionName") to
367	// unconditionally include in API requests. By default, fields with
368	// empty values are omitted from API requests. However, any non-pointer,
369	// non-interface field appearing in ForceSendFields will be sent to the
370	// server regardless of whether the field is empty or not. This may be
371	// used to include empty fields in Patch requests.
372	ForceSendFields []string `json:"-"`
373}
374
375func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
376	type noMethod DimensionValueRequest
377	raw := noMethod(*s)
378	return gensupport.MarshalJSON(raw, s.ForceSendFields)
379}
380
381// File: Represents a File resource. A File contains the meta-data for a
382// report run. It shows the status of the run and holds the urls to the
383// generated report data if the run is finished and the status is
384// "REPORT_AVAILABLE".
385type File struct {
386	// DateRange: The date range for which the file has report data. The
387	// date range will always be the absolute date range for which the
388	// report is run.
389	DateRange *DateRange `json:"dateRange,omitempty"`
390
391	// Etag: The eTag of this response for caching purposes.
392	Etag string `json:"etag,omitempty"`
393
394	// FileName: The file name of the file.
395	FileName string `json:"fileName,omitempty"`
396
397	// Format: The output format of the report. Only available once the file
398	// is available.
399	Format string `json:"format,omitempty"`
400
401	// Id: The unique ID of this report file.
402	Id int64 `json:"id,omitempty,string"`
403
404	// Kind: The kind of resource this is, in this case dfareporting#file.
405	Kind string `json:"kind,omitempty"`
406
407	// LastModifiedTime: The timestamp in milliseconds since epoch when this
408	// file was last modified.
409	LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
410
411	// ReportId: The ID of the report this file was generated from.
412	ReportId int64 `json:"reportId,omitempty,string"`
413
414	// Status: The status of the report file, one of:
415	// - "PROCESSING"
416	// - "REPORT_AVAILABLE"
417	// - "FAILED"
418	// - "CANCELLED"
419	Status string `json:"status,omitempty"`
420
421	// Urls: The urls where the completed report file can be downloaded.
422	Urls *FileUrls `json:"urls,omitempty"`
423
424	// ServerResponse contains the HTTP response code and headers from the
425	// server.
426	googleapi.ServerResponse `json:"-"`
427
428	// ForceSendFields is a list of field names (e.g. "DateRange") to
429	// unconditionally include in API requests. By default, fields with
430	// empty values are omitted from API requests. However, any non-pointer,
431	// non-interface field appearing in ForceSendFields will be sent to the
432	// server regardless of whether the field is empty or not. This may be
433	// used to include empty fields in Patch requests.
434	ForceSendFields []string `json:"-"`
435}
436
437func (s *File) MarshalJSON() ([]byte, error) {
438	type noMethod File
439	raw := noMethod(*s)
440	return gensupport.MarshalJSON(raw, s.ForceSendFields)
441}
442
443// FileUrls: The urls where the completed report file can be downloaded.
444type FileUrls struct {
445	// ApiUrl: The url for downloading the report data through the API.
446	ApiUrl string `json:"apiUrl,omitempty"`
447
448	// BrowserUrl: The url for downloading the report data through a
449	// browser.
450	BrowserUrl string `json:"browserUrl,omitempty"`
451
452	// ForceSendFields is a list of field names (e.g. "ApiUrl") to
453	// unconditionally include in API requests. By default, fields with
454	// empty values are omitted from API requests. However, any non-pointer,
455	// non-interface field appearing in ForceSendFields will be sent to the
456	// server regardless of whether the field is empty or not. This may be
457	// used to include empty fields in Patch requests.
458	ForceSendFields []string `json:"-"`
459}
460
461func (s *FileUrls) MarshalJSON() ([]byte, error) {
462	type noMethod FileUrls
463	raw := noMethod(*s)
464	return gensupport.MarshalJSON(raw, s.ForceSendFields)
465}
466
467// FileList: Represents the list of File resources.
468type FileList struct {
469	// Etag: The eTag of this response for caching purposes.
470	Etag string `json:"etag,omitempty"`
471
472	// Items: The files returned in this response.
473	Items []*File `json:"items,omitempty"`
474
475	// Kind: The kind of list this is, in this case dfareporting#fileList.
476	Kind string `json:"kind,omitempty"`
477
478	// NextPageToken: Continuation token used to page through files. To
479	// retrieve the next page of results, set the next request's "pageToken"
480	// to the value of this field. The page token is only valid for a
481	// limited amount of time and should not be persisted.
482	NextPageToken string `json:"nextPageToken,omitempty"`
483
484	// ServerResponse contains the HTTP response code and headers from the
485	// server.
486	googleapi.ServerResponse `json:"-"`
487
488	// ForceSendFields is a list of field names (e.g. "Etag") to
489	// unconditionally include in API requests. By default, fields with
490	// empty values are omitted from API requests. However, any non-pointer,
491	// non-interface field appearing in ForceSendFields will be sent to the
492	// server regardless of whether the field is empty or not. This may be
493	// used to include empty fields in Patch requests.
494	ForceSendFields []string `json:"-"`
495}
496
497func (s *FileList) MarshalJSON() ([]byte, error) {
498	type noMethod FileList
499	raw := noMethod(*s)
500	return gensupport.MarshalJSON(raw, s.ForceSendFields)
501}
502
503// Recipient: Represents a recipient.
504type Recipient struct {
505	// DeliveryType: The delivery type for the recipient, one of:
506	// - "ATTACHMENT"
507	// - "LINK"
508	DeliveryType string `json:"deliveryType,omitempty"`
509
510	// Email: The email address of the recipient.
511	Email string `json:"email,omitempty"`
512
513	// Kind: The kind of resource this is, in this case
514	// dfareporting#recipient.
515	Kind string `json:"kind,omitempty"`
516
517	// ForceSendFields is a list of field names (e.g. "DeliveryType") to
518	// unconditionally include in API requests. By default, fields with
519	// empty values are omitted from API requests. However, any non-pointer,
520	// non-interface field appearing in ForceSendFields will be sent to the
521	// server regardless of whether the field is empty or not. This may be
522	// used to include empty fields in Patch requests.
523	ForceSendFields []string `json:"-"`
524}
525
526func (s *Recipient) MarshalJSON() ([]byte, error) {
527	type noMethod Recipient
528	raw := noMethod(*s)
529	return gensupport.MarshalJSON(raw, s.ForceSendFields)
530}
531
532// Report: Represents a Report resource.
533type Report struct {
534	// AccountId: The account ID to which this report belongs.
535	AccountId int64 `json:"accountId,omitempty,string"`
536
537	// ActiveGrpCriteria: The report criteria for a report of type
538	// "ACTIVE_GRP".
539	ActiveGrpCriteria *ReportActiveGrpCriteria `json:"activeGrpCriteria,omitempty"`
540
541	// Criteria: The report criteria for a report of type "STANDARD".
542	Criteria *ReportCriteria `json:"criteria,omitempty"`
543
544	// CrossDimensionReachCriteria: The report criteria for a report of type
545	// "CROSS_DIMENSION_REACH".
546	CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
547
548	// Delivery: The report's email delivery settings.
549	Delivery *ReportDelivery `json:"delivery,omitempty"`
550
551	// Etag: The eTag of this response for caching purposes.
552	Etag string `json:"etag,omitempty"`
553
554	// FileName: The file name used when generating report files for this
555	// report.
556	FileName string `json:"fileName,omitempty"`
557
558	// FloodlightCriteria: The report criteria for a report of type
559	// "FLOODLIGHT".
560	FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
561
562	// Format: The output format of the report, one of:
563	// - "CSV"
564	// - "EXCEL"  If not specified, default format is "CSV". Note that the
565	// actual format in the completed report file might differ if for
566	// instance the report's size exceeds the format's capabilities. "CSV"
567	// will then be the fallback format.
568	Format string `json:"format,omitempty"`
569
570	// Id: The unique ID identifying this report resource.
571	Id int64 `json:"id,omitempty,string"`
572
573	// Kind: The kind of resource this is, in this case dfareporting#report.
574	Kind string `json:"kind,omitempty"`
575
576	// LastModifiedTime: The timestamp (in milliseconds since epoch) of when
577	// this report was last modified.
578	LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
579
580	// Name: The name of the report.
581	Name string `json:"name,omitempty"`
582
583	// OwnerProfileId: The user profile id of the owner of this report.
584	OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
585
586	// PathToConversionCriteria: The report criteria for a report of type
587	// "PATH_TO_CONVERSION".
588	PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
589
590	// ReachCriteria: The report criteria for a report of type "REACH".
591	ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
592
593	// Schedule: The report's schedule. Can only be set if the report's
594	// 'dateRange' is a relative date range and the relative date range is
595	// not "TODAY".
596	Schedule *ReportSchedule `json:"schedule,omitempty"`
597
598	// SubAccountId: The subbaccount ID to which this report belongs if
599	// applicable.
600	SubAccountId int64 `json:"subAccountId,omitempty,string"`
601
602	// Type: The type of the report, one of:
603	// - STANDARD
604	// - REACH
605	// - ACTIVE_GRP
606	// - PATH_TO_CONVERSION
607	// - FLOODLIGHT
608	// - CROSS_DIMENSION_REACH
609	Type string `json:"type,omitempty"`
610
611	// ServerResponse contains the HTTP response code and headers from the
612	// server.
613	googleapi.ServerResponse `json:"-"`
614
615	// ForceSendFields is a list of field names (e.g. "AccountId") to
616	// unconditionally include in API requests. By default, fields with
617	// empty values are omitted from API requests. However, any non-pointer,
618	// non-interface field appearing in ForceSendFields will be sent to the
619	// server regardless of whether the field is empty or not. This may be
620	// used to include empty fields in Patch requests.
621	ForceSendFields []string `json:"-"`
622}
623
624func (s *Report) MarshalJSON() ([]byte, error) {
625	type noMethod Report
626	raw := noMethod(*s)
627	return gensupport.MarshalJSON(raw, s.ForceSendFields)
628}
629
630// ReportActiveGrpCriteria: The report criteria for a report of type
631// "ACTIVE_GRP".
632type ReportActiveGrpCriteria struct {
633	// DateRange: The date range this report should be run for.
634	DateRange *DateRange `json:"dateRange,omitempty"`
635
636	// DimensionFilters: The list of filters on which dimensions are
637	// filtered.
638	// Filters for different dimensions are ANDed, filters for the same
639	// dimension are grouped together and ORed.
640	// A valid active GRP report needs to have exactly one DimensionValue
641	// for the United States in addition to any advertiser or campaign
642	// dimension values.
643	DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
644
645	// Dimensions: The list of dimensions the report should include.
646	Dimensions []*SortedDimension `json:"dimensions,omitempty"`
647
648	// MetricNames: The list of names of metrics the report should include.
649	MetricNames []string `json:"metricNames,omitempty"`
650
651	// ForceSendFields is a list of field names (e.g. "DateRange") to
652	// unconditionally include in API requests. By default, fields with
653	// empty values are omitted from API requests. However, any non-pointer,
654	// non-interface field appearing in ForceSendFields will be sent to the
655	// server regardless of whether the field is empty or not. This may be
656	// used to include empty fields in Patch requests.
657	ForceSendFields []string `json:"-"`
658}
659
660func (s *ReportActiveGrpCriteria) MarshalJSON() ([]byte, error) {
661	type noMethod ReportActiveGrpCriteria
662	raw := noMethod(*s)
663	return gensupport.MarshalJSON(raw, s.ForceSendFields)
664}
665
666// ReportCriteria: The report criteria for a report of type "STANDARD".
667type ReportCriteria struct {
668	// Activities: Activity group.
669	Activities *Activities `json:"activities,omitempty"`
670
671	// CustomRichMediaEvents: Custom Rich Media Events group.
672	CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
673
674	// DateRange: The date range for which this report should be run.
675	DateRange *DateRange `json:"dateRange,omitempty"`
676
677	// DimensionFilters: The list of filters on which dimensions are
678	// filtered.
679	// Filters for different dimensions are ANDed, filters for the same
680	// dimension are grouped together and ORed.
681	DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
682
683	// Dimensions: The list of standard dimensions the report should
684	// include.
685	Dimensions []*SortedDimension `json:"dimensions,omitempty"`
686
687	// MetricNames: The list of names of metrics the report should include.
688	MetricNames []string `json:"metricNames,omitempty"`
689
690	// ForceSendFields is a list of field names (e.g. "Activities") to
691	// unconditionally include in API requests. By default, fields with
692	// empty values are omitted from API requests. However, any non-pointer,
693	// non-interface field appearing in ForceSendFields will be sent to the
694	// server regardless of whether the field is empty or not. This may be
695	// used to include empty fields in Patch requests.
696	ForceSendFields []string `json:"-"`
697}
698
699func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
700	type noMethod ReportCriteria
701	raw := noMethod(*s)
702	return gensupport.MarshalJSON(raw, s.ForceSendFields)
703}
704
705// ReportCrossDimensionReachCriteria: The report criteria for a report
706// of type "CROSS_DIMENSION_REACH".
707type ReportCrossDimensionReachCriteria struct {
708	// Breakdown: The list of dimensions the report should include.
709	Breakdown []*SortedDimension `json:"breakdown,omitempty"`
710
711	// DateRange: The date range this report should be run for.
712	DateRange *DateRange `json:"dateRange,omitempty"`
713
714	// Dimension: The dimension option, one of:
715	// - "ADVERTISER"
716	// - "CAMPAIGN"
717	// - "SITE_BY_ADVERTISER"
718	// - "SITE_BY_CAMPAIGN"
719	Dimension string `json:"dimension,omitempty"`
720
721	// DimensionFilters: The list of filters on which dimensions are
722	// filtered.
723	DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
724
725	// MetricNames: The list of names of metrics the report should include.
726	MetricNames []string `json:"metricNames,omitempty"`
727
728	// OverlapMetricNames: The list of names of overlap metrics the report
729	// should include.
730	OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
731
732	// Pivoted: Whether the report is pivoted or not. Defaults to true.
733	Pivoted bool `json:"pivoted,omitempty"`
734
735	// ForceSendFields is a list of field names (e.g. "Breakdown") to
736	// unconditionally include in API requests. By default, fields with
737	// empty values are omitted from API requests. However, any non-pointer,
738	// non-interface field appearing in ForceSendFields will be sent to the
739	// server regardless of whether the field is empty or not. This may be
740	// used to include empty fields in Patch requests.
741	ForceSendFields []string `json:"-"`
742}
743
744func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
745	type noMethod ReportCrossDimensionReachCriteria
746	raw := noMethod(*s)
747	return gensupport.MarshalJSON(raw, s.ForceSendFields)
748}
749
750// ReportDelivery: The report's email delivery settings.
751type ReportDelivery struct {
752	// EmailOwner: Whether the report should be emailed to the report owner.
753	EmailOwner bool `json:"emailOwner,omitempty"`
754
755	// EmailOwnerDeliveryType: The type of delivery for the owner to
756	// receive, if enabled. One of:
757	// - "ATTACHMENT"
758	// - "LINK"
759	EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
760
761	// Message: The message to be sent with each email.
762	Message string `json:"message,omitempty"`
763
764	// Recipients: The list of recipients to which to email the report.
765	Recipients []*Recipient `json:"recipients,omitempty"`
766
767	// ForceSendFields is a list of field names (e.g. "EmailOwner") to
768	// unconditionally include in API requests. By default, fields with
769	// empty values are omitted from API requests. However, any non-pointer,
770	// non-interface field appearing in ForceSendFields will be sent to the
771	// server regardless of whether the field is empty or not. This may be
772	// used to include empty fields in Patch requests.
773	ForceSendFields []string `json:"-"`
774}
775
776func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
777	type noMethod ReportDelivery
778	raw := noMethod(*s)
779	return gensupport.MarshalJSON(raw, s.ForceSendFields)
780}
781
782// ReportFloodlightCriteria: The report criteria for a report of type
783// "FLOODLIGHT".
784type ReportFloodlightCriteria struct {
785	// DateRange: The date range this report should be run for.
786	DateRange *DateRange `json:"dateRange,omitempty"`
787
788	// DimensionFilters: The list of filters on which dimensions are
789	// filtered.
790	// Filters for different dimensions are ANDed, filters for the same
791	// dimension are grouped together and ORed.
792	DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
793
794	// Dimensions: The list of dimensions the report should include.
795	Dimensions []*SortedDimension `json:"dimensions,omitempty"`
796
797	// FloodlightConfigId: The floodlight ID for which to show data in this
798	// report. All advertisers associated with that ID will automatically be
799	// added. The dimension of the value needs to be
800	// 'dfa:floodlightConfigId'.
801	FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
802
803	// MetricNames: The list of names of metrics the report should include.
804	MetricNames []string `json:"metricNames,omitempty"`
805
806	// ReportProperties: The properties of the report.
807	ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
808
809	// ForceSendFields is a list of field names (e.g. "DateRange") to
810	// unconditionally include in API requests. By default, fields with
811	// empty values are omitted from API requests. However, any non-pointer,
812	// non-interface field appearing in ForceSendFields will be sent to the
813	// server regardless of whether the field is empty or not. This may be
814	// used to include empty fields in Patch requests.
815	ForceSendFields []string `json:"-"`
816}
817
818func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
819	type noMethod ReportFloodlightCriteria
820	raw := noMethod(*s)
821	return gensupport.MarshalJSON(raw, s.ForceSendFields)
822}
823
824// ReportFloodlightCriteriaReportProperties: The properties of the
825// report.
826type ReportFloodlightCriteriaReportProperties struct {
827	// IncludeAttributedIPConversions: Include conversions that have no
828	// cookie, but do have an exposure path.
829	IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
830
831	// IncludeUnattributedCookieConversions: Include conversions of users
832	// with a DoubleClick cookie but without an exposure. That means the
833	// user did not click or see an ad from the advertiser within the
834	// Floodlight group, or that the interaction happened outside the
835	// lookback window.
836	IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
837
838	// IncludeUnattributedIPConversions: Include conversions that have no
839	// associated cookies and no exposures. It’s therefore impossible to
840	// know how the user was exposed to your ads during the lookback window
841	// prior to a conversion.
842	IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
843
844	// ForceSendFields is a list of field names (e.g.
845	// "IncludeAttributedIPConversions") to unconditionally include in API
846	// requests. By default, fields with empty values are omitted from API
847	// requests. However, any non-pointer, non-interface field appearing in
848	// ForceSendFields will be sent to the server regardless of whether the
849	// field is empty or not. This may be used to include empty fields in
850	// Patch requests.
851	ForceSendFields []string `json:"-"`
852}
853
854func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
855	type noMethod ReportFloodlightCriteriaReportProperties
856	raw := noMethod(*s)
857	return gensupport.MarshalJSON(raw, s.ForceSendFields)
858}
859
860// ReportPathToConversionCriteria: The report criteria for a report of
861// type "PATH_TO_CONVERSION".
862type ReportPathToConversionCriteria struct {
863	// ActivityFilters: The list of 'dfa:activity' values to filter on.
864	ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
865
866	// ConversionDimensions: The list of conversion dimensions the report
867	// should include.
868	ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
869
870	// CustomFloodlightVariables: The list of custom floodlight variables
871	// the report should include.
872	CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
873
874	// DateRange: The date range this report should be run for.
875	DateRange *DateRange `json:"dateRange,omitempty"`
876
877	// FloodlightConfigId: The floodlight ID for which to show data in this
878	// report. All advertisers associated with that ID will automatically be
879	// added. The dimension of the value needs to be
880	// 'dfa:floodlightConfigId'.
881	FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
882
883	// MetricNames: The list of names of metrics the report should include.
884	MetricNames []string `json:"metricNames,omitempty"`
885
886	// PerInteractionDimensions: The list of per interaction dimensions the
887	// report should include.
888	PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
889
890	// ReportProperties: The properties of the report.
891	ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
892
893	// ForceSendFields is a list of field names (e.g. "ActivityFilters") to
894	// unconditionally include in API requests. By default, fields with
895	// empty values are omitted from API requests. However, any non-pointer,
896	// non-interface field appearing in ForceSendFields will be sent to the
897	// server regardless of whether the field is empty or not. This may be
898	// used to include empty fields in Patch requests.
899	ForceSendFields []string `json:"-"`
900}
901
902func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
903	type noMethod ReportPathToConversionCriteria
904	raw := noMethod(*s)
905	return gensupport.MarshalJSON(raw, s.ForceSendFields)
906}
907
908// ReportPathToConversionCriteriaReportProperties: The properties of the
909// report.
910type ReportPathToConversionCriteriaReportProperties struct {
911	// ClicksLookbackWindow: DFA checks to see if a click interaction
912	// occurred within the specified period of time before a conversion. By
913	// default the value is pulled from Floodlight or you can manually enter
914	// a custom value. Valid values: 1-90.
915	ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
916
917	// ImpressionsLookbackWindow: DFA checks to see if an impression
918	// interaction occurred within the specified period of time before a
919	// conversion. By default the value is pulled from Floodlight or you can
920	// manually enter a custom value. Valid values: 1-90.
921	ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
922
923	// IncludeAttributedIPConversions: Include conversions that have no
924	// cookie, but do have an exposure path.
925	IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
926
927	// IncludeUnattributedCookieConversions: Include conversions of users
928	// with a DoubleClick cookie but without an exposure. That means the
929	// user did not click or see an ad from the advertiser within the
930	// Floodlight group, or that the interaction happened outside the
931	// lookback window.
932	IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
933
934	// IncludeUnattributedIPConversions: Include conversions that have no
935	// associated cookies and no exposures. It’s therefore impossible to
936	// know how the user was exposed to your ads during the lookback window
937	// prior to a conversion.
938	IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
939
940	// MaximumClickInteractions: The maximum number of click interactions to
941	// include in the report. Advertisers currently paying for E2C reports
942	// get up to 200 (100 clicks, 100 impressions). If another advertiser in
943	// your network is paying for E2C, you can have up to 5 total exposures
944	// per report.
945	MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
946
947	// MaximumImpressionInteractions: The maximum number of click
948	// interactions to include in the report. Advertisers currently paying
949	// for E2C reports get up to 200 (100 clicks, 100 impressions). If
950	// another advertiser in your network is paying for E2C, you can have up
951	// to 5 total exposures per report.
952	MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
953
954	// MaximumInteractionGap: The maximum amount of time that can take place
955	// between interactions (clicks or impressions) by the same user. Valid
956	// values: 1-90.
957	MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
958
959	// PivotOnInteractionPath: Enable pivoting on interaction path.
960	PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
961
962	// ForceSendFields is a list of field names (e.g.
963	// "ClicksLookbackWindow") to unconditionally include in API requests.
964	// By default, fields with empty values are omitted from API requests.
965	// However, any non-pointer, non-interface field appearing in
966	// ForceSendFields will be sent to the server regardless of whether the
967	// field is empty or not. This may be used to include empty fields in
968	// Patch requests.
969	ForceSendFields []string `json:"-"`
970}
971
972func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
973	type noMethod ReportPathToConversionCriteriaReportProperties
974	raw := noMethod(*s)
975	return gensupport.MarshalJSON(raw, s.ForceSendFields)
976}
977
978// ReportReachCriteria: The report criteria for a report of type
979// "REACH".
980type ReportReachCriteria struct {
981	// Activities: Activity group.
982	Activities *Activities `json:"activities,omitempty"`
983
984	// CustomRichMediaEvents: Custom Rich Media Events group.
985	CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
986
987	// DateRange: The date range this report should be run for.
988	DateRange *DateRange `json:"dateRange,omitempty"`
989
990	// DimensionFilters: The list of filters on which dimensions are
991	// filtered.
992	// Filters for different dimensions are ANDed, filters for the same
993	// dimension are grouped together and ORed.
994	DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
995
996	// Dimensions: The list of dimensions the report should include.
997	Dimensions []*SortedDimension `json:"dimensions,omitempty"`
998
999	// MetricNames: The list of names of metrics the report should include.
1000	MetricNames []string `json:"metricNames,omitempty"`
1001
1002	// ReachByFrequencyMetricNames: The list of names of  Reach By Frequency
1003	// metrics the report should include.
1004	ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
1005
1006	// ForceSendFields is a list of field names (e.g. "Activities") to
1007	// unconditionally include in API requests. By default, fields with
1008	// empty values are omitted from API requests. However, any non-pointer,
1009	// non-interface field appearing in ForceSendFields will be sent to the
1010	// server regardless of whether the field is empty or not. This may be
1011	// used to include empty fields in Patch requests.
1012	ForceSendFields []string `json:"-"`
1013}
1014
1015func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
1016	type noMethod ReportReachCriteria
1017	raw := noMethod(*s)
1018	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1019}
1020
1021// ReportSchedule: The report's schedule. Can only be set if the
1022// report's 'dateRange' is a relative date range and the relative date
1023// range is not "TODAY".
1024type ReportSchedule struct {
1025	// Active: Whether the schedule is active or not. Must be set to either
1026	// true or false.
1027	Active bool `json:"active,omitempty"`
1028
1029	// Every: Defines every how many days, weeks or months the report should
1030	// be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
1031	// "MONTHLY".
1032	Every int64 `json:"every,omitempty"`
1033
1034	// ExpirationDate: The expiration date when the scheduled report stops
1035	// running.
1036	ExpirationDate string `json:"expirationDate,omitempty"`
1037
1038	// Repeats: The interval for which the report is repeated, one of:
1039	// - "DAILY", also requires field "every" to be set.
1040	// - "WEEKLY", also requires fields "every" and "repeatsOnWeekDays" to
1041	// be set.
1042	// - "TWICE_A_MONTH"
1043	// - "MONTHLY", also requires fields "every" and "runsOnDayOfMonth" to
1044	// be set.
1045	// - "QUARTERLY"
1046	// - "YEARLY"
1047	Repeats string `json:"repeats,omitempty"`
1048
1049	// RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
1050	// reports should run.
1051	RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
1052
1053	// RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
1054	// whether reports should be repeated on the same day of the month as
1055	// "startDate" or the same day of the week of the month. Possible values
1056	// are:
1057	// - DAY_OF_MONTH
1058	// - WEEK_OF_MONTH
1059	// Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
1060	// "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
1061	// Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
1062	// Monday of the month.
1063	RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
1064
1065	// StartDate: Start date of date range for which scheduled reports
1066	// should be run.
1067	StartDate string `json:"startDate,omitempty"`
1068
1069	// ForceSendFields is a list of field names (e.g. "Active") to
1070	// unconditionally include in API requests. By default, fields with
1071	// empty values are omitted from API requests. However, any non-pointer,
1072	// non-interface field appearing in ForceSendFields will be sent to the
1073	// server regardless of whether the field is empty or not. This may be
1074	// used to include empty fields in Patch requests.
1075	ForceSendFields []string `json:"-"`
1076}
1077
1078func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
1079	type noMethod ReportSchedule
1080	raw := noMethod(*s)
1081	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1082}
1083
1084// ReportList: Represents the list of reports.
1085type ReportList struct {
1086	// Etag: The eTag of this response for caching purposes.
1087	Etag string `json:"etag,omitempty"`
1088
1089	// Items: The reports returned in this response.
1090	Items []*Report `json:"items,omitempty"`
1091
1092	// Kind: The kind of list this is, in this case dfareporting#reportList.
1093	Kind string `json:"kind,omitempty"`
1094
1095	// NextPageToken: Continuation token used to page through reports. To
1096	// retrieve the next page of results, set the next request's "pageToken"
1097	// to the value of this field. The page token is only valid for a
1098	// limited amount of time and should not be persisted.
1099	NextPageToken string `json:"nextPageToken,omitempty"`
1100
1101	// ServerResponse contains the HTTP response code and headers from the
1102	// server.
1103	googleapi.ServerResponse `json:"-"`
1104
1105	// ForceSendFields is a list of field names (e.g. "Etag") to
1106	// unconditionally include in API requests. By default, fields with
1107	// empty values are omitted from API requests. However, any non-pointer,
1108	// non-interface field appearing in ForceSendFields will be sent to the
1109	// server regardless of whether the field is empty or not. This may be
1110	// used to include empty fields in Patch requests.
1111	ForceSendFields []string `json:"-"`
1112}
1113
1114func (s *ReportList) MarshalJSON() ([]byte, error) {
1115	type noMethod ReportList
1116	raw := noMethod(*s)
1117	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1118}
1119
1120// SortedDimension: Represents a sorted dimension.
1121type SortedDimension struct {
1122	// Kind: The kind of resource this is, in this case
1123	// dfareporting#sortedDimension.
1124	Kind string `json:"kind,omitempty"`
1125
1126	// Name: The name of the dimension.
1127	Name string `json:"name,omitempty"`
1128
1129	// SortOrder: An optional sort order for the dimension column, one of:
1130	//
1131	// - "ASCENDING"
1132	// - "DESCENDING"
1133	SortOrder string `json:"sortOrder,omitempty"`
1134
1135	// ForceSendFields is a list of field names (e.g. "Kind") to
1136	// unconditionally include in API requests. By default, fields with
1137	// empty values are omitted from API requests. However, any non-pointer,
1138	// non-interface field appearing in ForceSendFields will be sent to the
1139	// server regardless of whether the field is empty or not. This may be
1140	// used to include empty fields in Patch requests.
1141	ForceSendFields []string `json:"-"`
1142}
1143
1144func (s *SortedDimension) MarshalJSON() ([]byte, error) {
1145	type noMethod SortedDimension
1146	raw := noMethod(*s)
1147	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1148}
1149
1150// UserProfile: Represents a UserProfile resource.
1151type UserProfile struct {
1152	// AccountId: The account ID to which this profile belongs.
1153	AccountId int64 `json:"accountId,omitempty,string"`
1154
1155	// AccountName: The account name this profile belongs to.
1156	AccountName string `json:"accountName,omitempty"`
1157
1158	// Etag: The eTag of this response for caching purposes.
1159	Etag string `json:"etag,omitempty"`
1160
1161	// Kind: The kind of resource this is, in this case
1162	// dfareporting#userProfile.
1163	Kind string `json:"kind,omitempty"`
1164
1165	// ProfileId: The unique ID of the user profile.
1166	ProfileId int64 `json:"profileId,omitempty,string"`
1167
1168	// SubAccountId: The sub account ID this profile belongs to if
1169	// applicable.
1170	SubAccountId int64 `json:"subAccountId,omitempty,string"`
1171
1172	// SubAccountName: The sub account name this profile belongs to if
1173	// applicable.
1174	SubAccountName string `json:"subAccountName,omitempty"`
1175
1176	// UserName: The user name.
1177	UserName string `json:"userName,omitempty"`
1178
1179	// ServerResponse contains the HTTP response code and headers from the
1180	// server.
1181	googleapi.ServerResponse `json:"-"`
1182
1183	// ForceSendFields is a list of field names (e.g. "AccountId") to
1184	// unconditionally include in API requests. By default, fields with
1185	// empty values are omitted from API requests. However, any non-pointer,
1186	// non-interface field appearing in ForceSendFields will be sent to the
1187	// server regardless of whether the field is empty or not. This may be
1188	// used to include empty fields in Patch requests.
1189	ForceSendFields []string `json:"-"`
1190}
1191
1192func (s *UserProfile) MarshalJSON() ([]byte, error) {
1193	type noMethod UserProfile
1194	raw := noMethod(*s)
1195	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1196}
1197
1198// UserProfileList: Represents the list of user profiles.
1199type UserProfileList struct {
1200	// Etag: The eTag of this response for caching purposes.
1201	Etag string `json:"etag,omitempty"`
1202
1203	// Items: The user profiles returned in this response.
1204	Items []*UserProfile `json:"items,omitempty"`
1205
1206	// Kind: The kind of list this is, in this case
1207	// dfareporting#userProfileList.
1208	Kind string `json:"kind,omitempty"`
1209
1210	// ServerResponse contains the HTTP response code and headers from the
1211	// server.
1212	googleapi.ServerResponse `json:"-"`
1213
1214	// ForceSendFields is a list of field names (e.g. "Etag") to
1215	// unconditionally include in API requests. By default, fields with
1216	// empty values are omitted from API requests. However, any non-pointer,
1217	// non-interface field appearing in ForceSendFields will be sent to the
1218	// server regardless of whether the field is empty or not. This may be
1219	// used to include empty fields in Patch requests.
1220	ForceSendFields []string `json:"-"`
1221}
1222
1223func (s *UserProfileList) MarshalJSON() ([]byte, error) {
1224	type noMethod UserProfileList
1225	raw := noMethod(*s)
1226	return gensupport.MarshalJSON(raw, s.ForceSendFields)
1227}
1228
1229// method id "dfareporting.dimensionValues.query":
1230
1231type DimensionValuesQueryCall struct {
1232	s                     *Service
1233	profileId             int64
1234	dimensionvaluerequest *DimensionValueRequest
1235	urlParams_            gensupport.URLParams
1236	ctx_                  context.Context
1237}
1238
1239// Query: Retrieves list of report dimension values for a list of
1240// filters.
1241func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
1242	c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1243	c.profileId = profileId
1244	c.dimensionvaluerequest = dimensionvaluerequest
1245	return c
1246}
1247
1248// MaxResults sets the optional parameter "maxResults": Maximum number
1249// of results to return.
1250func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
1251	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1252	return c
1253}
1254
1255// PageToken sets the optional parameter "pageToken": The value of the
1256// nextToken from the previous result page.
1257func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
1258	c.urlParams_.Set("pageToken", pageToken)
1259	return c
1260}
1261
1262// Fields allows partial responses to be retrieved. See
1263// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1264// for more information.
1265func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
1266	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1267	return c
1268}
1269
1270// Context sets the context to be used in this call's Do method. Any
1271// pending HTTP request will be aborted if the provided context is
1272// canceled.
1273func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
1274	c.ctx_ = ctx
1275	return c
1276}
1277
1278func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
1279	var body io.Reader = nil
1280	body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
1281	if err != nil {
1282		return nil, err
1283	}
1284	ctype := "application/json"
1285	c.urlParams_.Set("alt", alt)
1286	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
1287	urls += "?" + c.urlParams_.Encode()
1288	req, _ := http.NewRequest("POST", urls, body)
1289	googleapi.Expand(req.URL, map[string]string{
1290		"profileId": strconv.FormatInt(c.profileId, 10),
1291	})
1292	req.Header.Set("Content-Type", ctype)
1293	req.Header.Set("User-Agent", c.s.userAgent())
1294	if c.ctx_ != nil {
1295		return ctxhttp.Do(c.ctx_, c.s.client, req)
1296	}
1297	return c.s.client.Do(req)
1298}
1299
1300// Do executes the "dfareporting.dimensionValues.query" call.
1301// Exactly one of *DimensionValueList or error will be non-nil. Any
1302// non-2xx status code is an error. Response headers are in either
1303// *DimensionValueList.ServerResponse.Header or (if a response was
1304// returned at all) in error.(*googleapi.Error).Header. Use
1305// googleapi.IsNotModified to check whether the returned error was
1306// because http.StatusNotModified was returned.
1307func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
1308	gensupport.SetOptions(c.urlParams_, opts...)
1309	res, err := c.doRequest("json")
1310	if res != nil && res.StatusCode == http.StatusNotModified {
1311		if res.Body != nil {
1312			res.Body.Close()
1313		}
1314		return nil, &googleapi.Error{
1315			Code:   res.StatusCode,
1316			Header: res.Header,
1317		}
1318	}
1319	if err != nil {
1320		return nil, err
1321	}
1322	defer googleapi.CloseBody(res)
1323	if err := googleapi.CheckResponse(res); err != nil {
1324		return nil, err
1325	}
1326	ret := &DimensionValueList{
1327		ServerResponse: googleapi.ServerResponse{
1328			Header:         res.Header,
1329			HTTPStatusCode: res.StatusCode,
1330		},
1331	}
1332	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1333		return nil, err
1334	}
1335	return ret, nil
1336	// {
1337	//   "description": "Retrieves list of report dimension values for a list of filters.",
1338	//   "httpMethod": "POST",
1339	//   "id": "dfareporting.dimensionValues.query",
1340	//   "parameterOrder": [
1341	//     "profileId"
1342	//   ],
1343	//   "parameters": {
1344	//     "maxResults": {
1345	//       "description": "Maximum number of results to return.",
1346	//       "format": "int32",
1347	//       "location": "query",
1348	//       "maximum": "100",
1349	//       "minimum": "0",
1350	//       "type": "integer"
1351	//     },
1352	//     "pageToken": {
1353	//       "description": "The value of the nextToken from the previous result page.",
1354	//       "location": "query",
1355	//       "type": "string"
1356	//     },
1357	//     "profileId": {
1358	//       "description": "The DFA user profile ID.",
1359	//       "format": "int64",
1360	//       "location": "path",
1361	//       "required": true,
1362	//       "type": "string"
1363	//     }
1364	//   },
1365	//   "path": "userprofiles/{profileId}/dimensionvalues/query",
1366	//   "request": {
1367	//     "$ref": "DimensionValueRequest"
1368	//   },
1369	//   "response": {
1370	//     "$ref": "DimensionValueList"
1371	//   },
1372	//   "scopes": [
1373	//     "https://www.googleapis.com/auth/dfareporting"
1374	//   ]
1375	// }
1376
1377}
1378
1379// method id "dfareporting.files.get":
1380
1381type FilesGetCall struct {
1382	s            *Service
1383	reportId     int64
1384	fileId       int64
1385	urlParams_   gensupport.URLParams
1386	ifNoneMatch_ string
1387	ctx_         context.Context
1388}
1389
1390// Get: Retrieves a report file by its report ID and file ID.
1391func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
1392	c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1393	c.reportId = reportId
1394	c.fileId = fileId
1395	return c
1396}
1397
1398// Fields allows partial responses to be retrieved. See
1399// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1400// for more information.
1401func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
1402	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1403	return c
1404}
1405
1406// IfNoneMatch sets the optional parameter which makes the operation
1407// fail if the object's ETag matches the given value. This is useful for
1408// getting updates only after the object has changed since the last
1409// request. Use googleapi.IsNotModified to check whether the response
1410// error from Do is the result of In-None-Match.
1411func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
1412	c.ifNoneMatch_ = entityTag
1413	return c
1414}
1415
1416// Context sets the context to be used in this call's Do and Download
1417// methods. Any pending HTTP request will be aborted if the provided
1418// context is canceled.
1419func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
1420	c.ctx_ = ctx
1421	return c
1422}
1423
1424func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
1425	var body io.Reader = nil
1426	c.urlParams_.Set("alt", alt)
1427	urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
1428	urls += "?" + c.urlParams_.Encode()
1429	req, _ := http.NewRequest("GET", urls, body)
1430	googleapi.Expand(req.URL, map[string]string{
1431		"reportId": strconv.FormatInt(c.reportId, 10),
1432		"fileId":   strconv.FormatInt(c.fileId, 10),
1433	})
1434	req.Header.Set("User-Agent", c.s.userAgent())
1435	if c.ifNoneMatch_ != "" {
1436		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1437	}
1438	if c.ctx_ != nil {
1439		return ctxhttp.Do(c.ctx_, c.s.client, req)
1440	}
1441	return c.s.client.Do(req)
1442}
1443
1444// Download fetches the API endpoint's "media" value, instead of the normal
1445// API response value. If the returned error is nil, the Response is guaranteed to
1446// have a 2xx status code. Callers must close the Response.Body as usual.
1447func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
1448	gensupport.SetOptions(c.urlParams_, opts...)
1449	res, err := c.doRequest("media")
1450	if err != nil {
1451		return nil, err
1452	}
1453	if err := googleapi.CheckMediaResponse(res); err != nil {
1454		res.Body.Close()
1455		return nil, err
1456	}
1457	return res, nil
1458}
1459
1460// Do executes the "dfareporting.files.get" call.
1461// Exactly one of *File or error will be non-nil. Any non-2xx status
1462// code is an error. Response headers are in either
1463// *File.ServerResponse.Header or (if a response was returned at all) in
1464// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1465// whether the returned error was because http.StatusNotModified was
1466// returned.
1467func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
1468	gensupport.SetOptions(c.urlParams_, opts...)
1469	res, err := c.doRequest("json")
1470	if res != nil && res.StatusCode == http.StatusNotModified {
1471		if res.Body != nil {
1472			res.Body.Close()
1473		}
1474		return nil, &googleapi.Error{
1475			Code:   res.StatusCode,
1476			Header: res.Header,
1477		}
1478	}
1479	if err != nil {
1480		return nil, err
1481	}
1482	defer googleapi.CloseBody(res)
1483	if err := googleapi.CheckResponse(res); err != nil {
1484		return nil, err
1485	}
1486	ret := &File{
1487		ServerResponse: googleapi.ServerResponse{
1488			Header:         res.Header,
1489			HTTPStatusCode: res.StatusCode,
1490		},
1491	}
1492	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1493		return nil, err
1494	}
1495	return ret, nil
1496	// {
1497	//   "description": "Retrieves a report file by its report ID and file ID.",
1498	//   "httpMethod": "GET",
1499	//   "id": "dfareporting.files.get",
1500	//   "parameterOrder": [
1501	//     "reportId",
1502	//     "fileId"
1503	//   ],
1504	//   "parameters": {
1505	//     "fileId": {
1506	//       "description": "The ID of the report file.",
1507	//       "format": "int64",
1508	//       "location": "path",
1509	//       "required": true,
1510	//       "type": "string"
1511	//     },
1512	//     "reportId": {
1513	//       "description": "The ID of the report.",
1514	//       "format": "int64",
1515	//       "location": "path",
1516	//       "required": true,
1517	//       "type": "string"
1518	//     }
1519	//   },
1520	//   "path": "reports/{reportId}/files/{fileId}",
1521	//   "response": {
1522	//     "$ref": "File"
1523	//   },
1524	//   "scopes": [
1525	//     "https://www.googleapis.com/auth/dfareporting"
1526	//   ],
1527	//   "supportsMediaDownload": true
1528	// }
1529
1530}
1531
1532// method id "dfareporting.files.list":
1533
1534type FilesListCall struct {
1535	s            *Service
1536	profileId    int64
1537	urlParams_   gensupport.URLParams
1538	ifNoneMatch_ string
1539	ctx_         context.Context
1540}
1541
1542// List: Lists files for a user profile.
1543func (r *FilesService) List(profileId int64) *FilesListCall {
1544	c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1545	c.profileId = profileId
1546	return c
1547}
1548
1549// MaxResults sets the optional parameter "maxResults": Maximum number
1550// of results to return.
1551func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
1552	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
1553	return c
1554}
1555
1556// PageToken sets the optional parameter "pageToken": The value of the
1557// nextToken from the previous result page.
1558func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
1559	c.urlParams_.Set("pageToken", pageToken)
1560	return c
1561}
1562
1563// Scope sets the optional parameter "scope": The scope that defines
1564// which results are returned, default is 'MINE'.
1565//
1566// Possible values:
1567//   "ALL" - All files in account.
1568//   "MINE" (default) - My files.
1569//   "SHARED_WITH_ME" - Files shared with me.
1570func (c *FilesListCall) Scope(scope string) *FilesListCall {
1571	c.urlParams_.Set("scope", scope)
1572	return c
1573}
1574
1575// SortField sets the optional parameter "sortField": The field by which
1576// to sort the list.
1577//
1578// Possible values:
1579//   "ID" - Sort by file ID.
1580//   "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
1581func (c *FilesListCall) SortField(sortField string) *FilesListCall {
1582	c.urlParams_.Set("sortField", sortField)
1583	return c
1584}
1585
1586// SortOrder sets the optional parameter "sortOrder": Order of sorted
1587// results, default is 'DESCENDING'.
1588//
1589// Possible values:
1590//   "ASCENDING" - Ascending order.
1591//   "DESCENDING" (default) - Descending order.
1592func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
1593	c.urlParams_.Set("sortOrder", sortOrder)
1594	return c
1595}
1596
1597// Fields allows partial responses to be retrieved. See
1598// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1599// for more information.
1600func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
1601	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1602	return c
1603}
1604
1605// IfNoneMatch sets the optional parameter which makes the operation
1606// fail if the object's ETag matches the given value. This is useful for
1607// getting updates only after the object has changed since the last
1608// request. Use googleapi.IsNotModified to check whether the response
1609// error from Do is the result of In-None-Match.
1610func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
1611	c.ifNoneMatch_ = entityTag
1612	return c
1613}
1614
1615// Context sets the context to be used in this call's Do method. Any
1616// pending HTTP request will be aborted if the provided context is
1617// canceled.
1618func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
1619	c.ctx_ = ctx
1620	return c
1621}
1622
1623func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
1624	var body io.Reader = nil
1625	c.urlParams_.Set("alt", alt)
1626	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
1627	urls += "?" + c.urlParams_.Encode()
1628	req, _ := http.NewRequest("GET", urls, body)
1629	googleapi.Expand(req.URL, map[string]string{
1630		"profileId": strconv.FormatInt(c.profileId, 10),
1631	})
1632	req.Header.Set("User-Agent", c.s.userAgent())
1633	if c.ifNoneMatch_ != "" {
1634		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1635	}
1636	if c.ctx_ != nil {
1637		return ctxhttp.Do(c.ctx_, c.s.client, req)
1638	}
1639	return c.s.client.Do(req)
1640}
1641
1642// Do executes the "dfareporting.files.list" call.
1643// Exactly one of *FileList or error will be non-nil. Any non-2xx status
1644// code is an error. Response headers are in either
1645// *FileList.ServerResponse.Header or (if a response was returned at
1646// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
1647// to check whether the returned error was because
1648// http.StatusNotModified was returned.
1649func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
1650	gensupport.SetOptions(c.urlParams_, opts...)
1651	res, err := c.doRequest("json")
1652	if res != nil && res.StatusCode == http.StatusNotModified {
1653		if res.Body != nil {
1654			res.Body.Close()
1655		}
1656		return nil, &googleapi.Error{
1657			Code:   res.StatusCode,
1658			Header: res.Header,
1659		}
1660	}
1661	if err != nil {
1662		return nil, err
1663	}
1664	defer googleapi.CloseBody(res)
1665	if err := googleapi.CheckResponse(res); err != nil {
1666		return nil, err
1667	}
1668	ret := &FileList{
1669		ServerResponse: googleapi.ServerResponse{
1670			Header:         res.Header,
1671			HTTPStatusCode: res.StatusCode,
1672		},
1673	}
1674	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1675		return nil, err
1676	}
1677	return ret, nil
1678	// {
1679	//   "description": "Lists files for a user profile.",
1680	//   "httpMethod": "GET",
1681	//   "id": "dfareporting.files.list",
1682	//   "parameterOrder": [
1683	//     "profileId"
1684	//   ],
1685	//   "parameters": {
1686	//     "maxResults": {
1687	//       "description": "Maximum number of results to return.",
1688	//       "format": "int32",
1689	//       "location": "query",
1690	//       "maximum": "10",
1691	//       "minimum": "0",
1692	//       "type": "integer"
1693	//     },
1694	//     "pageToken": {
1695	//       "description": "The value of the nextToken from the previous result page.",
1696	//       "location": "query",
1697	//       "type": "string"
1698	//     },
1699	//     "profileId": {
1700	//       "description": "The DFA profile ID.",
1701	//       "format": "int64",
1702	//       "location": "path",
1703	//       "required": true,
1704	//       "type": "string"
1705	//     },
1706	//     "scope": {
1707	//       "default": "MINE",
1708	//       "description": "The scope that defines which results are returned, default is 'MINE'.",
1709	//       "enum": [
1710	//         "ALL",
1711	//         "MINE",
1712	//         "SHARED_WITH_ME"
1713	//       ],
1714	//       "enumDescriptions": [
1715	//         "All files in account.",
1716	//         "My files.",
1717	//         "Files shared with me."
1718	//       ],
1719	//       "location": "query",
1720	//       "type": "string"
1721	//     },
1722	//     "sortField": {
1723	//       "default": "LAST_MODIFIED_TIME",
1724	//       "description": "The field by which to sort the list.",
1725	//       "enum": [
1726	//         "ID",
1727	//         "LAST_MODIFIED_TIME"
1728	//       ],
1729	//       "enumDescriptions": [
1730	//         "Sort by file ID.",
1731	//         "Sort by 'lastmodifiedAt' field."
1732	//       ],
1733	//       "location": "query",
1734	//       "type": "string"
1735	//     },
1736	//     "sortOrder": {
1737	//       "default": "DESCENDING",
1738	//       "description": "Order of sorted results, default is 'DESCENDING'.",
1739	//       "enum": [
1740	//         "ASCENDING",
1741	//         "DESCENDING"
1742	//       ],
1743	//       "enumDescriptions": [
1744	//         "Ascending order.",
1745	//         "Descending order."
1746	//       ],
1747	//       "location": "query",
1748	//       "type": "string"
1749	//     }
1750	//   },
1751	//   "path": "userprofiles/{profileId}/files",
1752	//   "response": {
1753	//     "$ref": "FileList"
1754	//   },
1755	//   "scopes": [
1756	//     "https://www.googleapis.com/auth/dfareporting"
1757	//   ]
1758	// }
1759
1760}
1761
1762// Pages invokes f for each page of results.
1763// A non-nil error returned from f will halt the iteration.
1764// The provided context supersedes any context provided to the Context method.
1765func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
1766	c.ctx_ = ctx
1767	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1768	for {
1769		x, err := c.Do()
1770		if err != nil {
1771			return err
1772		}
1773		if err := f(x); err != nil {
1774			return err
1775		}
1776		if x.NextPageToken == "" {
1777			return nil
1778		}
1779		c.PageToken(x.NextPageToken)
1780	}
1781}
1782
1783// method id "dfareporting.reports.delete":
1784
1785type ReportsDeleteCall struct {
1786	s          *Service
1787	profileId  int64
1788	reportId   int64
1789	urlParams_ gensupport.URLParams
1790	ctx_       context.Context
1791}
1792
1793// Delete: Deletes a report by its ID.
1794func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
1795	c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1796	c.profileId = profileId
1797	c.reportId = reportId
1798	return c
1799}
1800
1801// Fields allows partial responses to be retrieved. See
1802// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1803// for more information.
1804func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
1805	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1806	return c
1807}
1808
1809// Context sets the context to be used in this call's Do method. Any
1810// pending HTTP request will be aborted if the provided context is
1811// canceled.
1812func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
1813	c.ctx_ = ctx
1814	return c
1815}
1816
1817func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
1818	var body io.Reader = nil
1819	c.urlParams_.Set("alt", alt)
1820	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
1821	urls += "?" + c.urlParams_.Encode()
1822	req, _ := http.NewRequest("DELETE", urls, body)
1823	googleapi.Expand(req.URL, map[string]string{
1824		"profileId": strconv.FormatInt(c.profileId, 10),
1825		"reportId":  strconv.FormatInt(c.reportId, 10),
1826	})
1827	req.Header.Set("User-Agent", c.s.userAgent())
1828	if c.ctx_ != nil {
1829		return ctxhttp.Do(c.ctx_, c.s.client, req)
1830	}
1831	return c.s.client.Do(req)
1832}
1833
1834// Do executes the "dfareporting.reports.delete" call.
1835func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
1836	gensupport.SetOptions(c.urlParams_, opts...)
1837	res, err := c.doRequest("json")
1838	if err != nil {
1839		return err
1840	}
1841	defer googleapi.CloseBody(res)
1842	if err := googleapi.CheckResponse(res); err != nil {
1843		return err
1844	}
1845	return nil
1846	// {
1847	//   "description": "Deletes a report by its ID.",
1848	//   "httpMethod": "DELETE",
1849	//   "id": "dfareporting.reports.delete",
1850	//   "parameterOrder": [
1851	//     "profileId",
1852	//     "reportId"
1853	//   ],
1854	//   "parameters": {
1855	//     "profileId": {
1856	//       "description": "The DFA user profile ID.",
1857	//       "format": "int64",
1858	//       "location": "path",
1859	//       "required": true,
1860	//       "type": "string"
1861	//     },
1862	//     "reportId": {
1863	//       "description": "The ID of the report.",
1864	//       "format": "int64",
1865	//       "location": "path",
1866	//       "required": true,
1867	//       "type": "string"
1868	//     }
1869	//   },
1870	//   "path": "userprofiles/{profileId}/reports/{reportId}",
1871	//   "scopes": [
1872	//     "https://www.googleapis.com/auth/dfareporting"
1873	//   ]
1874	// }
1875
1876}
1877
1878// method id "dfareporting.reports.get":
1879
1880type ReportsGetCall struct {
1881	s            *Service
1882	profileId    int64
1883	reportId     int64
1884	urlParams_   gensupport.URLParams
1885	ifNoneMatch_ string
1886	ctx_         context.Context
1887}
1888
1889// Get: Retrieves a report by its ID.
1890func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
1891	c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1892	c.profileId = profileId
1893	c.reportId = reportId
1894	return c
1895}
1896
1897// Fields allows partial responses to be retrieved. See
1898// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1899// for more information.
1900func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
1901	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1902	return c
1903}
1904
1905// IfNoneMatch sets the optional parameter which makes the operation
1906// fail if the object's ETag matches the given value. This is useful for
1907// getting updates only after the object has changed since the last
1908// request. Use googleapi.IsNotModified to check whether the response
1909// error from Do is the result of In-None-Match.
1910func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
1911	c.ifNoneMatch_ = entityTag
1912	return c
1913}
1914
1915// Context sets the context to be used in this call's Do method. Any
1916// pending HTTP request will be aborted if the provided context is
1917// canceled.
1918func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
1919	c.ctx_ = ctx
1920	return c
1921}
1922
1923func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
1924	var body io.Reader = nil
1925	c.urlParams_.Set("alt", alt)
1926	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
1927	urls += "?" + c.urlParams_.Encode()
1928	req, _ := http.NewRequest("GET", urls, body)
1929	googleapi.Expand(req.URL, map[string]string{
1930		"profileId": strconv.FormatInt(c.profileId, 10),
1931		"reportId":  strconv.FormatInt(c.reportId, 10),
1932	})
1933	req.Header.Set("User-Agent", c.s.userAgent())
1934	if c.ifNoneMatch_ != "" {
1935		req.Header.Set("If-None-Match", c.ifNoneMatch_)
1936	}
1937	if c.ctx_ != nil {
1938		return ctxhttp.Do(c.ctx_, c.s.client, req)
1939	}
1940	return c.s.client.Do(req)
1941}
1942
1943// Do executes the "dfareporting.reports.get" call.
1944// Exactly one of *Report or error will be non-nil. Any non-2xx status
1945// code is an error. Response headers are in either
1946// *Report.ServerResponse.Header or (if a response was returned at all)
1947// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1948// check whether the returned error was because http.StatusNotModified
1949// was returned.
1950func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
1951	gensupport.SetOptions(c.urlParams_, opts...)
1952	res, err := c.doRequest("json")
1953	if res != nil && res.StatusCode == http.StatusNotModified {
1954		if res.Body != nil {
1955			res.Body.Close()
1956		}
1957		return nil, &googleapi.Error{
1958			Code:   res.StatusCode,
1959			Header: res.Header,
1960		}
1961	}
1962	if err != nil {
1963		return nil, err
1964	}
1965	defer googleapi.CloseBody(res)
1966	if err := googleapi.CheckResponse(res); err != nil {
1967		return nil, err
1968	}
1969	ret := &Report{
1970		ServerResponse: googleapi.ServerResponse{
1971			Header:         res.Header,
1972			HTTPStatusCode: res.StatusCode,
1973		},
1974	}
1975	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1976		return nil, err
1977	}
1978	return ret, nil
1979	// {
1980	//   "description": "Retrieves a report by its ID.",
1981	//   "httpMethod": "GET",
1982	//   "id": "dfareporting.reports.get",
1983	//   "parameterOrder": [
1984	//     "profileId",
1985	//     "reportId"
1986	//   ],
1987	//   "parameters": {
1988	//     "profileId": {
1989	//       "description": "The DFA user profile ID.",
1990	//       "format": "int64",
1991	//       "location": "path",
1992	//       "required": true,
1993	//       "type": "string"
1994	//     },
1995	//     "reportId": {
1996	//       "description": "The ID of the report.",
1997	//       "format": "int64",
1998	//       "location": "path",
1999	//       "required": true,
2000	//       "type": "string"
2001	//     }
2002	//   },
2003	//   "path": "userprofiles/{profileId}/reports/{reportId}",
2004	//   "response": {
2005	//     "$ref": "Report"
2006	//   },
2007	//   "scopes": [
2008	//     "https://www.googleapis.com/auth/dfareporting"
2009	//   ]
2010	// }
2011
2012}
2013
2014// method id "dfareporting.reports.insert":
2015
2016type ReportsInsertCall struct {
2017	s          *Service
2018	profileId  int64
2019	report     *Report
2020	urlParams_ gensupport.URLParams
2021	ctx_       context.Context
2022}
2023
2024// Insert: Creates a report.
2025func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
2026	c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2027	c.profileId = profileId
2028	c.report = report
2029	return c
2030}
2031
2032// Fields allows partial responses to be retrieved. See
2033// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2034// for more information.
2035func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
2036	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2037	return c
2038}
2039
2040// Context sets the context to be used in this call's Do method. Any
2041// pending HTTP request will be aborted if the provided context is
2042// canceled.
2043func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
2044	c.ctx_ = ctx
2045	return c
2046}
2047
2048func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
2049	var body io.Reader = nil
2050	body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
2051	if err != nil {
2052		return nil, err
2053	}
2054	ctype := "application/json"
2055	c.urlParams_.Set("alt", alt)
2056	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
2057	urls += "?" + c.urlParams_.Encode()
2058	req, _ := http.NewRequest("POST", urls, body)
2059	googleapi.Expand(req.URL, map[string]string{
2060		"profileId": strconv.FormatInt(c.profileId, 10),
2061	})
2062	req.Header.Set("Content-Type", ctype)
2063	req.Header.Set("User-Agent", c.s.userAgent())
2064	if c.ctx_ != nil {
2065		return ctxhttp.Do(c.ctx_, c.s.client, req)
2066	}
2067	return c.s.client.Do(req)
2068}
2069
2070// Do executes the "dfareporting.reports.insert" call.
2071// Exactly one of *Report or error will be non-nil. Any non-2xx status
2072// code is an error. Response headers are in either
2073// *Report.ServerResponse.Header or (if a response was returned at all)
2074// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2075// check whether the returned error was because http.StatusNotModified
2076// was returned.
2077func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2078	gensupport.SetOptions(c.urlParams_, opts...)
2079	res, err := c.doRequest("json")
2080	if res != nil && res.StatusCode == http.StatusNotModified {
2081		if res.Body != nil {
2082			res.Body.Close()
2083		}
2084		return nil, &googleapi.Error{
2085			Code:   res.StatusCode,
2086			Header: res.Header,
2087		}
2088	}
2089	if err != nil {
2090		return nil, err
2091	}
2092	defer googleapi.CloseBody(res)
2093	if err := googleapi.CheckResponse(res); err != nil {
2094		return nil, err
2095	}
2096	ret := &Report{
2097		ServerResponse: googleapi.ServerResponse{
2098			Header:         res.Header,
2099			HTTPStatusCode: res.StatusCode,
2100		},
2101	}
2102	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2103		return nil, err
2104	}
2105	return ret, nil
2106	// {
2107	//   "description": "Creates a report.",
2108	//   "httpMethod": "POST",
2109	//   "id": "dfareporting.reports.insert",
2110	//   "parameterOrder": [
2111	//     "profileId"
2112	//   ],
2113	//   "parameters": {
2114	//     "profileId": {
2115	//       "description": "The DFA user profile ID.",
2116	//       "format": "int64",
2117	//       "location": "path",
2118	//       "required": true,
2119	//       "type": "string"
2120	//     }
2121	//   },
2122	//   "path": "userprofiles/{profileId}/reports",
2123	//   "request": {
2124	//     "$ref": "Report"
2125	//   },
2126	//   "response": {
2127	//     "$ref": "Report"
2128	//   },
2129	//   "scopes": [
2130	//     "https://www.googleapis.com/auth/dfareporting"
2131	//   ]
2132	// }
2133
2134}
2135
2136// method id "dfareporting.reports.list":
2137
2138type ReportsListCall struct {
2139	s            *Service
2140	profileId    int64
2141	urlParams_   gensupport.URLParams
2142	ifNoneMatch_ string
2143	ctx_         context.Context
2144}
2145
2146// List: Retrieves list of reports.
2147func (r *ReportsService) List(profileId int64) *ReportsListCall {
2148	c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2149	c.profileId = profileId
2150	return c
2151}
2152
2153// MaxResults sets the optional parameter "maxResults": Maximum number
2154// of results to return.
2155func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
2156	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2157	return c
2158}
2159
2160// PageToken sets the optional parameter "pageToken": The value of the
2161// nextToken from the previous result page.
2162func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
2163	c.urlParams_.Set("pageToken", pageToken)
2164	return c
2165}
2166
2167// Scope sets the optional parameter "scope": The scope that defines
2168// which results are returned, default is 'MINE'.
2169//
2170// Possible values:
2171//   "ALL" - All reports in account.
2172//   "MINE" (default) - My reports.
2173func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
2174	c.urlParams_.Set("scope", scope)
2175	return c
2176}
2177
2178// SortField sets the optional parameter "sortField": The field by which
2179// to sort the list.
2180//
2181// Possible values:
2182//   "ID" - Sort by report ID.
2183//   "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
2184//   "NAME" - Sort by name of reports.
2185func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
2186	c.urlParams_.Set("sortField", sortField)
2187	return c
2188}
2189
2190// SortOrder sets the optional parameter "sortOrder": Order of sorted
2191// results, default is 'DESCENDING'.
2192//
2193// Possible values:
2194//   "ASCENDING" - Ascending order.
2195//   "DESCENDING" (default) - Descending order.
2196func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
2197	c.urlParams_.Set("sortOrder", sortOrder)
2198	return c
2199}
2200
2201// Fields allows partial responses to be retrieved. See
2202// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2203// for more information.
2204func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
2205	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2206	return c
2207}
2208
2209// IfNoneMatch sets the optional parameter which makes the operation
2210// fail if the object's ETag matches the given value. This is useful for
2211// getting updates only after the object has changed since the last
2212// request. Use googleapi.IsNotModified to check whether the response
2213// error from Do is the result of In-None-Match.
2214func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
2215	c.ifNoneMatch_ = entityTag
2216	return c
2217}
2218
2219// Context sets the context to be used in this call's Do method. Any
2220// pending HTTP request will be aborted if the provided context is
2221// canceled.
2222func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
2223	c.ctx_ = ctx
2224	return c
2225}
2226
2227func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
2228	var body io.Reader = nil
2229	c.urlParams_.Set("alt", alt)
2230	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
2231	urls += "?" + c.urlParams_.Encode()
2232	req, _ := http.NewRequest("GET", urls, body)
2233	googleapi.Expand(req.URL, map[string]string{
2234		"profileId": strconv.FormatInt(c.profileId, 10),
2235	})
2236	req.Header.Set("User-Agent", c.s.userAgent())
2237	if c.ifNoneMatch_ != "" {
2238		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2239	}
2240	if c.ctx_ != nil {
2241		return ctxhttp.Do(c.ctx_, c.s.client, req)
2242	}
2243	return c.s.client.Do(req)
2244}
2245
2246// Do executes the "dfareporting.reports.list" call.
2247// Exactly one of *ReportList or error will be non-nil. Any non-2xx
2248// status code is an error. Response headers are in either
2249// *ReportList.ServerResponse.Header or (if a response was returned at
2250// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
2251// to check whether the returned error was because
2252// http.StatusNotModified was returned.
2253func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
2254	gensupport.SetOptions(c.urlParams_, opts...)
2255	res, err := c.doRequest("json")
2256	if res != nil && res.StatusCode == http.StatusNotModified {
2257		if res.Body != nil {
2258			res.Body.Close()
2259		}
2260		return nil, &googleapi.Error{
2261			Code:   res.StatusCode,
2262			Header: res.Header,
2263		}
2264	}
2265	if err != nil {
2266		return nil, err
2267	}
2268	defer googleapi.CloseBody(res)
2269	if err := googleapi.CheckResponse(res); err != nil {
2270		return nil, err
2271	}
2272	ret := &ReportList{
2273		ServerResponse: googleapi.ServerResponse{
2274			Header:         res.Header,
2275			HTTPStatusCode: res.StatusCode,
2276		},
2277	}
2278	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2279		return nil, err
2280	}
2281	return ret, nil
2282	// {
2283	//   "description": "Retrieves list of reports.",
2284	//   "httpMethod": "GET",
2285	//   "id": "dfareporting.reports.list",
2286	//   "parameterOrder": [
2287	//     "profileId"
2288	//   ],
2289	//   "parameters": {
2290	//     "maxResults": {
2291	//       "description": "Maximum number of results to return.",
2292	//       "format": "int32",
2293	//       "location": "query",
2294	//       "maximum": "10",
2295	//       "minimum": "0",
2296	//       "type": "integer"
2297	//     },
2298	//     "pageToken": {
2299	//       "description": "The value of the nextToken from the previous result page.",
2300	//       "location": "query",
2301	//       "type": "string"
2302	//     },
2303	//     "profileId": {
2304	//       "description": "The DFA user profile ID.",
2305	//       "format": "int64",
2306	//       "location": "path",
2307	//       "required": true,
2308	//       "type": "string"
2309	//     },
2310	//     "scope": {
2311	//       "default": "MINE",
2312	//       "description": "The scope that defines which results are returned, default is 'MINE'.",
2313	//       "enum": [
2314	//         "ALL",
2315	//         "MINE"
2316	//       ],
2317	//       "enumDescriptions": [
2318	//         "All reports in account.",
2319	//         "My reports."
2320	//       ],
2321	//       "location": "query",
2322	//       "type": "string"
2323	//     },
2324	//     "sortField": {
2325	//       "default": "LAST_MODIFIED_TIME",
2326	//       "description": "The field by which to sort the list.",
2327	//       "enum": [
2328	//         "ID",
2329	//         "LAST_MODIFIED_TIME",
2330	//         "NAME"
2331	//       ],
2332	//       "enumDescriptions": [
2333	//         "Sort by report ID.",
2334	//         "Sort by 'lastModifiedTime' field.",
2335	//         "Sort by name of reports."
2336	//       ],
2337	//       "location": "query",
2338	//       "type": "string"
2339	//     },
2340	//     "sortOrder": {
2341	//       "default": "DESCENDING",
2342	//       "description": "Order of sorted results, default is 'DESCENDING'.",
2343	//       "enum": [
2344	//         "ASCENDING",
2345	//         "DESCENDING"
2346	//       ],
2347	//       "enumDescriptions": [
2348	//         "Ascending order.",
2349	//         "Descending order."
2350	//       ],
2351	//       "location": "query",
2352	//       "type": "string"
2353	//     }
2354	//   },
2355	//   "path": "userprofiles/{profileId}/reports",
2356	//   "response": {
2357	//     "$ref": "ReportList"
2358	//   },
2359	//   "scopes": [
2360	//     "https://www.googleapis.com/auth/dfareporting"
2361	//   ]
2362	// }
2363
2364}
2365
2366// Pages invokes f for each page of results.
2367// A non-nil error returned from f will halt the iteration.
2368// The provided context supersedes any context provided to the Context method.
2369func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
2370	c.ctx_ = ctx
2371	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2372	for {
2373		x, err := c.Do()
2374		if err != nil {
2375			return err
2376		}
2377		if err := f(x); err != nil {
2378			return err
2379		}
2380		if x.NextPageToken == "" {
2381			return nil
2382		}
2383		c.PageToken(x.NextPageToken)
2384	}
2385}
2386
2387// method id "dfareporting.reports.patch":
2388
2389type ReportsPatchCall struct {
2390	s          *Service
2391	profileId  int64
2392	reportId   int64
2393	report     *Report
2394	urlParams_ gensupport.URLParams
2395	ctx_       context.Context
2396}
2397
2398// Patch: Updates a report. This method supports patch semantics.
2399func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
2400	c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2401	c.profileId = profileId
2402	c.reportId = reportId
2403	c.report = report
2404	return c
2405}
2406
2407// Fields allows partial responses to be retrieved. See
2408// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2409// for more information.
2410func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
2411	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2412	return c
2413}
2414
2415// Context sets the context to be used in this call's Do method. Any
2416// pending HTTP request will be aborted if the provided context is
2417// canceled.
2418func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
2419	c.ctx_ = ctx
2420	return c
2421}
2422
2423func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
2424	var body io.Reader = nil
2425	body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
2426	if err != nil {
2427		return nil, err
2428	}
2429	ctype := "application/json"
2430	c.urlParams_.Set("alt", alt)
2431	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
2432	urls += "?" + c.urlParams_.Encode()
2433	req, _ := http.NewRequest("PATCH", urls, body)
2434	googleapi.Expand(req.URL, map[string]string{
2435		"profileId": strconv.FormatInt(c.profileId, 10),
2436		"reportId":  strconv.FormatInt(c.reportId, 10),
2437	})
2438	req.Header.Set("Content-Type", ctype)
2439	req.Header.Set("User-Agent", c.s.userAgent())
2440	if c.ctx_ != nil {
2441		return ctxhttp.Do(c.ctx_, c.s.client, req)
2442	}
2443	return c.s.client.Do(req)
2444}
2445
2446// Do executes the "dfareporting.reports.patch" call.
2447// Exactly one of *Report or error will be non-nil. Any non-2xx status
2448// code is an error. Response headers are in either
2449// *Report.ServerResponse.Header or (if a response was returned at all)
2450// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2451// check whether the returned error was because http.StatusNotModified
2452// was returned.
2453func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2454	gensupport.SetOptions(c.urlParams_, opts...)
2455	res, err := c.doRequest("json")
2456	if res != nil && res.StatusCode == http.StatusNotModified {
2457		if res.Body != nil {
2458			res.Body.Close()
2459		}
2460		return nil, &googleapi.Error{
2461			Code:   res.StatusCode,
2462			Header: res.Header,
2463		}
2464	}
2465	if err != nil {
2466		return nil, err
2467	}
2468	defer googleapi.CloseBody(res)
2469	if err := googleapi.CheckResponse(res); err != nil {
2470		return nil, err
2471	}
2472	ret := &Report{
2473		ServerResponse: googleapi.ServerResponse{
2474			Header:         res.Header,
2475			HTTPStatusCode: res.StatusCode,
2476		},
2477	}
2478	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2479		return nil, err
2480	}
2481	return ret, nil
2482	// {
2483	//   "description": "Updates a report. This method supports patch semantics.",
2484	//   "httpMethod": "PATCH",
2485	//   "id": "dfareporting.reports.patch",
2486	//   "parameterOrder": [
2487	//     "profileId",
2488	//     "reportId"
2489	//   ],
2490	//   "parameters": {
2491	//     "profileId": {
2492	//       "description": "The DFA user profile ID.",
2493	//       "format": "int64",
2494	//       "location": "path",
2495	//       "required": true,
2496	//       "type": "string"
2497	//     },
2498	//     "reportId": {
2499	//       "description": "The ID of the report.",
2500	//       "format": "int64",
2501	//       "location": "path",
2502	//       "required": true,
2503	//       "type": "string"
2504	//     }
2505	//   },
2506	//   "path": "userprofiles/{profileId}/reports/{reportId}",
2507	//   "request": {
2508	//     "$ref": "Report"
2509	//   },
2510	//   "response": {
2511	//     "$ref": "Report"
2512	//   },
2513	//   "scopes": [
2514	//     "https://www.googleapis.com/auth/dfareporting"
2515	//   ]
2516	// }
2517
2518}
2519
2520// method id "dfareporting.reports.run":
2521
2522type ReportsRunCall struct {
2523	s          *Service
2524	profileId  int64
2525	reportId   int64
2526	urlParams_ gensupport.URLParams
2527	ctx_       context.Context
2528}
2529
2530// Run: Runs a report.
2531func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
2532	c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2533	c.profileId = profileId
2534	c.reportId = reportId
2535	return c
2536}
2537
2538// Synchronous sets the optional parameter "synchronous": If set and
2539// true, tries to run the report synchronously.
2540func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
2541	c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
2542	return c
2543}
2544
2545// Fields allows partial responses to be retrieved. See
2546// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2547// for more information.
2548func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
2549	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2550	return c
2551}
2552
2553// Context sets the context to be used in this call's Do method. Any
2554// pending HTTP request will be aborted if the provided context is
2555// canceled.
2556func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
2557	c.ctx_ = ctx
2558	return c
2559}
2560
2561func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
2562	var body io.Reader = nil
2563	c.urlParams_.Set("alt", alt)
2564	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
2565	urls += "?" + c.urlParams_.Encode()
2566	req, _ := http.NewRequest("POST", urls, body)
2567	googleapi.Expand(req.URL, map[string]string{
2568		"profileId": strconv.FormatInt(c.profileId, 10),
2569		"reportId":  strconv.FormatInt(c.reportId, 10),
2570	})
2571	req.Header.Set("User-Agent", c.s.userAgent())
2572	if c.ctx_ != nil {
2573		return ctxhttp.Do(c.ctx_, c.s.client, req)
2574	}
2575	return c.s.client.Do(req)
2576}
2577
2578// Do executes the "dfareporting.reports.run" call.
2579// Exactly one of *File or error will be non-nil. Any non-2xx status
2580// code is an error. Response headers are in either
2581// *File.ServerResponse.Header or (if a response was returned at all) in
2582// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2583// whether the returned error was because http.StatusNotModified was
2584// returned.
2585func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
2586	gensupport.SetOptions(c.urlParams_, opts...)
2587	res, err := c.doRequest("json")
2588	if res != nil && res.StatusCode == http.StatusNotModified {
2589		if res.Body != nil {
2590			res.Body.Close()
2591		}
2592		return nil, &googleapi.Error{
2593			Code:   res.StatusCode,
2594			Header: res.Header,
2595		}
2596	}
2597	if err != nil {
2598		return nil, err
2599	}
2600	defer googleapi.CloseBody(res)
2601	if err := googleapi.CheckResponse(res); err != nil {
2602		return nil, err
2603	}
2604	ret := &File{
2605		ServerResponse: googleapi.ServerResponse{
2606			Header:         res.Header,
2607			HTTPStatusCode: res.StatusCode,
2608		},
2609	}
2610	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2611		return nil, err
2612	}
2613	return ret, nil
2614	// {
2615	//   "description": "Runs a report.",
2616	//   "httpMethod": "POST",
2617	//   "id": "dfareporting.reports.run",
2618	//   "parameterOrder": [
2619	//     "profileId",
2620	//     "reportId"
2621	//   ],
2622	//   "parameters": {
2623	//     "profileId": {
2624	//       "description": "The DFA profile ID.",
2625	//       "format": "int64",
2626	//       "location": "path",
2627	//       "required": true,
2628	//       "type": "string"
2629	//     },
2630	//     "reportId": {
2631	//       "description": "The ID of the report.",
2632	//       "format": "int64",
2633	//       "location": "path",
2634	//       "required": true,
2635	//       "type": "string"
2636	//     },
2637	//     "synchronous": {
2638	//       "description": "If set and true, tries to run the report synchronously.",
2639	//       "location": "query",
2640	//       "type": "boolean"
2641	//     }
2642	//   },
2643	//   "path": "userprofiles/{profileId}/reports/{reportId}/run",
2644	//   "response": {
2645	//     "$ref": "File"
2646	//   },
2647	//   "scopes": [
2648	//     "https://www.googleapis.com/auth/dfareporting"
2649	//   ]
2650	// }
2651
2652}
2653
2654// method id "dfareporting.reports.update":
2655
2656type ReportsUpdateCall struct {
2657	s          *Service
2658	profileId  int64
2659	reportId   int64
2660	report     *Report
2661	urlParams_ gensupport.URLParams
2662	ctx_       context.Context
2663}
2664
2665// Update: Updates a report.
2666func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
2667	c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2668	c.profileId = profileId
2669	c.reportId = reportId
2670	c.report = report
2671	return c
2672}
2673
2674// Fields allows partial responses to be retrieved. See
2675// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2676// for more information.
2677func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
2678	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2679	return c
2680}
2681
2682// Context sets the context to be used in this call's Do method. Any
2683// pending HTTP request will be aborted if the provided context is
2684// canceled.
2685func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
2686	c.ctx_ = ctx
2687	return c
2688}
2689
2690func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
2691	var body io.Reader = nil
2692	body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
2693	if err != nil {
2694		return nil, err
2695	}
2696	ctype := "application/json"
2697	c.urlParams_.Set("alt", alt)
2698	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
2699	urls += "?" + c.urlParams_.Encode()
2700	req, _ := http.NewRequest("PUT", urls, body)
2701	googleapi.Expand(req.URL, map[string]string{
2702		"profileId": strconv.FormatInt(c.profileId, 10),
2703		"reportId":  strconv.FormatInt(c.reportId, 10),
2704	})
2705	req.Header.Set("Content-Type", ctype)
2706	req.Header.Set("User-Agent", c.s.userAgent())
2707	if c.ctx_ != nil {
2708		return ctxhttp.Do(c.ctx_, c.s.client, req)
2709	}
2710	return c.s.client.Do(req)
2711}
2712
2713// Do executes the "dfareporting.reports.update" call.
2714// Exactly one of *Report or error will be non-nil. Any non-2xx status
2715// code is an error. Response headers are in either
2716// *Report.ServerResponse.Header or (if a response was returned at all)
2717// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2718// check whether the returned error was because http.StatusNotModified
2719// was returned.
2720func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
2721	gensupport.SetOptions(c.urlParams_, opts...)
2722	res, err := c.doRequest("json")
2723	if res != nil && res.StatusCode == http.StatusNotModified {
2724		if res.Body != nil {
2725			res.Body.Close()
2726		}
2727		return nil, &googleapi.Error{
2728			Code:   res.StatusCode,
2729			Header: res.Header,
2730		}
2731	}
2732	if err != nil {
2733		return nil, err
2734	}
2735	defer googleapi.CloseBody(res)
2736	if err := googleapi.CheckResponse(res); err != nil {
2737		return nil, err
2738	}
2739	ret := &Report{
2740		ServerResponse: googleapi.ServerResponse{
2741			Header:         res.Header,
2742			HTTPStatusCode: res.StatusCode,
2743		},
2744	}
2745	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2746		return nil, err
2747	}
2748	return ret, nil
2749	// {
2750	//   "description": "Updates a report.",
2751	//   "httpMethod": "PUT",
2752	//   "id": "dfareporting.reports.update",
2753	//   "parameterOrder": [
2754	//     "profileId",
2755	//     "reportId"
2756	//   ],
2757	//   "parameters": {
2758	//     "profileId": {
2759	//       "description": "The DFA user profile ID.",
2760	//       "format": "int64",
2761	//       "location": "path",
2762	//       "required": true,
2763	//       "type": "string"
2764	//     },
2765	//     "reportId": {
2766	//       "description": "The ID of the report.",
2767	//       "format": "int64",
2768	//       "location": "path",
2769	//       "required": true,
2770	//       "type": "string"
2771	//     }
2772	//   },
2773	//   "path": "userprofiles/{profileId}/reports/{reportId}",
2774	//   "request": {
2775	//     "$ref": "Report"
2776	//   },
2777	//   "response": {
2778	//     "$ref": "Report"
2779	//   },
2780	//   "scopes": [
2781	//     "https://www.googleapis.com/auth/dfareporting"
2782	//   ]
2783	// }
2784
2785}
2786
2787// method id "dfareporting.reports.files.get":
2788
2789type ReportsFilesGetCall struct {
2790	s            *Service
2791	profileId    int64
2792	reportId     int64
2793	fileId       int64
2794	urlParams_   gensupport.URLParams
2795	ifNoneMatch_ string
2796	ctx_         context.Context
2797}
2798
2799// Get: Retrieves a report file.
2800func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
2801	c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2802	c.profileId = profileId
2803	c.reportId = reportId
2804	c.fileId = fileId
2805	return c
2806}
2807
2808// Fields allows partial responses to be retrieved. See
2809// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2810// for more information.
2811func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
2812	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2813	return c
2814}
2815
2816// IfNoneMatch sets the optional parameter which makes the operation
2817// fail if the object's ETag matches the given value. This is useful for
2818// getting updates only after the object has changed since the last
2819// request. Use googleapi.IsNotModified to check whether the response
2820// error from Do is the result of In-None-Match.
2821func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
2822	c.ifNoneMatch_ = entityTag
2823	return c
2824}
2825
2826// Context sets the context to be used in this call's Do and Download
2827// methods. Any pending HTTP request will be aborted if the provided
2828// context is canceled.
2829func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
2830	c.ctx_ = ctx
2831	return c
2832}
2833
2834func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
2835	var body io.Reader = nil
2836	c.urlParams_.Set("alt", alt)
2837	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
2838	urls += "?" + c.urlParams_.Encode()
2839	req, _ := http.NewRequest("GET", urls, body)
2840	googleapi.Expand(req.URL, map[string]string{
2841		"profileId": strconv.FormatInt(c.profileId, 10),
2842		"reportId":  strconv.FormatInt(c.reportId, 10),
2843		"fileId":    strconv.FormatInt(c.fileId, 10),
2844	})
2845	req.Header.Set("User-Agent", c.s.userAgent())
2846	if c.ifNoneMatch_ != "" {
2847		req.Header.Set("If-None-Match", c.ifNoneMatch_)
2848	}
2849	if c.ctx_ != nil {
2850		return ctxhttp.Do(c.ctx_, c.s.client, req)
2851	}
2852	return c.s.client.Do(req)
2853}
2854
2855// Download fetches the API endpoint's "media" value, instead of the normal
2856// API response value. If the returned error is nil, the Response is guaranteed to
2857// have a 2xx status code. Callers must close the Response.Body as usual.
2858func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
2859	gensupport.SetOptions(c.urlParams_, opts...)
2860	res, err := c.doRequest("media")
2861	if err != nil {
2862		return nil, err
2863	}
2864	if err := googleapi.CheckMediaResponse(res); err != nil {
2865		res.Body.Close()
2866		return nil, err
2867	}
2868	return res, nil
2869}
2870
2871// Do executes the "dfareporting.reports.files.get" call.
2872// Exactly one of *File or error will be non-nil. Any non-2xx status
2873// code is an error. Response headers are in either
2874// *File.ServerResponse.Header or (if a response was returned at all) in
2875// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
2876// whether the returned error was because http.StatusNotModified was
2877// returned.
2878func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
2879	gensupport.SetOptions(c.urlParams_, opts...)
2880	res, err := c.doRequest("json")
2881	if res != nil && res.StatusCode == http.StatusNotModified {
2882		if res.Body != nil {
2883			res.Body.Close()
2884		}
2885		return nil, &googleapi.Error{
2886			Code:   res.StatusCode,
2887			Header: res.Header,
2888		}
2889	}
2890	if err != nil {
2891		return nil, err
2892	}
2893	defer googleapi.CloseBody(res)
2894	if err := googleapi.CheckResponse(res); err != nil {
2895		return nil, err
2896	}
2897	ret := &File{
2898		ServerResponse: googleapi.ServerResponse{
2899			Header:         res.Header,
2900			HTTPStatusCode: res.StatusCode,
2901		},
2902	}
2903	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
2904		return nil, err
2905	}
2906	return ret, nil
2907	// {
2908	//   "description": "Retrieves a report file.",
2909	//   "httpMethod": "GET",
2910	//   "id": "dfareporting.reports.files.get",
2911	//   "parameterOrder": [
2912	//     "profileId",
2913	//     "reportId",
2914	//     "fileId"
2915	//   ],
2916	//   "parameters": {
2917	//     "fileId": {
2918	//       "description": "The ID of the report file.",
2919	//       "format": "int64",
2920	//       "location": "path",
2921	//       "required": true,
2922	//       "type": "string"
2923	//     },
2924	//     "profileId": {
2925	//       "description": "The DFA profile ID.",
2926	//       "format": "int64",
2927	//       "location": "path",
2928	//       "required": true,
2929	//       "type": "string"
2930	//     },
2931	//     "reportId": {
2932	//       "description": "The ID of the report.",
2933	//       "format": "int64",
2934	//       "location": "path",
2935	//       "required": true,
2936	//       "type": "string"
2937	//     }
2938	//   },
2939	//   "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
2940	//   "response": {
2941	//     "$ref": "File"
2942	//   },
2943	//   "scopes": [
2944	//     "https://www.googleapis.com/auth/dfareporting"
2945	//   ],
2946	//   "supportsMediaDownload": true
2947	// }
2948
2949}
2950
2951// method id "dfareporting.reports.files.list":
2952
2953type ReportsFilesListCall struct {
2954	s            *Service
2955	profileId    int64
2956	reportId     int64
2957	urlParams_   gensupport.URLParams
2958	ifNoneMatch_ string
2959	ctx_         context.Context
2960}
2961
2962// List: Lists files for a report.
2963func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
2964	c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2965	c.profileId = profileId
2966	c.reportId = reportId
2967	return c
2968}
2969
2970// MaxResults sets the optional parameter "maxResults": Maximum number
2971// of results to return.
2972func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
2973	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
2974	return c
2975}
2976
2977// PageToken sets the optional parameter "pageToken": The value of the
2978// nextToken from the previous result page.
2979func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
2980	c.urlParams_.Set("pageToken", pageToken)
2981	return c
2982}
2983
2984// SortField sets the optional parameter "sortField": The field by which
2985// to sort the list.
2986//
2987// Possible values:
2988//   "ID" - Sort by file ID.
2989//   "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
2990func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
2991	c.urlParams_.Set("sortField", sortField)
2992	return c
2993}
2994
2995// SortOrder sets the optional parameter "sortOrder": Order of sorted
2996// results, default is 'DESCENDING'.
2997//
2998// Possible values:
2999//   "ASCENDING" - Ascending order.
3000//   "DESCENDING" (default) - Descending order.
3001func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
3002	c.urlParams_.Set("sortOrder", sortOrder)
3003	return c
3004}
3005
3006// Fields allows partial responses to be retrieved. See
3007// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3008// for more information.
3009func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
3010	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3011	return c
3012}
3013
3014// IfNoneMatch sets the optional parameter which makes the operation
3015// fail if the object's ETag matches the given value. This is useful for
3016// getting updates only after the object has changed since the last
3017// request. Use googleapi.IsNotModified to check whether the response
3018// error from Do is the result of In-None-Match.
3019func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
3020	c.ifNoneMatch_ = entityTag
3021	return c
3022}
3023
3024// Context sets the context to be used in this call's Do method. Any
3025// pending HTTP request will be aborted if the provided context is
3026// canceled.
3027func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
3028	c.ctx_ = ctx
3029	return c
3030}
3031
3032func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
3033	var body io.Reader = nil
3034	c.urlParams_.Set("alt", alt)
3035	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
3036	urls += "?" + c.urlParams_.Encode()
3037	req, _ := http.NewRequest("GET", urls, body)
3038	googleapi.Expand(req.URL, map[string]string{
3039		"profileId": strconv.FormatInt(c.profileId, 10),
3040		"reportId":  strconv.FormatInt(c.reportId, 10),
3041	})
3042	req.Header.Set("User-Agent", c.s.userAgent())
3043	if c.ifNoneMatch_ != "" {
3044		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3045	}
3046	if c.ctx_ != nil {
3047		return ctxhttp.Do(c.ctx_, c.s.client, req)
3048	}
3049	return c.s.client.Do(req)
3050}
3051
3052// Do executes the "dfareporting.reports.files.list" call.
3053// Exactly one of *FileList or error will be non-nil. Any non-2xx status
3054// code is an error. Response headers are in either
3055// *FileList.ServerResponse.Header or (if a response was returned at
3056// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3057// to check whether the returned error was because
3058// http.StatusNotModified was returned.
3059func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
3060	gensupport.SetOptions(c.urlParams_, opts...)
3061	res, err := c.doRequest("json")
3062	if res != nil && res.StatusCode == http.StatusNotModified {
3063		if res.Body != nil {
3064			res.Body.Close()
3065		}
3066		return nil, &googleapi.Error{
3067			Code:   res.StatusCode,
3068			Header: res.Header,
3069		}
3070	}
3071	if err != nil {
3072		return nil, err
3073	}
3074	defer googleapi.CloseBody(res)
3075	if err := googleapi.CheckResponse(res); err != nil {
3076		return nil, err
3077	}
3078	ret := &FileList{
3079		ServerResponse: googleapi.ServerResponse{
3080			Header:         res.Header,
3081			HTTPStatusCode: res.StatusCode,
3082		},
3083	}
3084	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3085		return nil, err
3086	}
3087	return ret, nil
3088	// {
3089	//   "description": "Lists files for a report.",
3090	//   "httpMethod": "GET",
3091	//   "id": "dfareporting.reports.files.list",
3092	//   "parameterOrder": [
3093	//     "profileId",
3094	//     "reportId"
3095	//   ],
3096	//   "parameters": {
3097	//     "maxResults": {
3098	//       "description": "Maximum number of results to return.",
3099	//       "format": "int32",
3100	//       "location": "query",
3101	//       "maximum": "10",
3102	//       "minimum": "0",
3103	//       "type": "integer"
3104	//     },
3105	//     "pageToken": {
3106	//       "description": "The value of the nextToken from the previous result page.",
3107	//       "location": "query",
3108	//       "type": "string"
3109	//     },
3110	//     "profileId": {
3111	//       "description": "The DFA profile ID.",
3112	//       "format": "int64",
3113	//       "location": "path",
3114	//       "required": true,
3115	//       "type": "string"
3116	//     },
3117	//     "reportId": {
3118	//       "description": "The ID of the parent report.",
3119	//       "format": "int64",
3120	//       "location": "path",
3121	//       "required": true,
3122	//       "type": "string"
3123	//     },
3124	//     "sortField": {
3125	//       "default": "LAST_MODIFIED_TIME",
3126	//       "description": "The field by which to sort the list.",
3127	//       "enum": [
3128	//         "ID",
3129	//         "LAST_MODIFIED_TIME"
3130	//       ],
3131	//       "enumDescriptions": [
3132	//         "Sort by file ID.",
3133	//         "Sort by 'lastmodifiedAt' field."
3134	//       ],
3135	//       "location": "query",
3136	//       "type": "string"
3137	//     },
3138	//     "sortOrder": {
3139	//       "default": "DESCENDING",
3140	//       "description": "Order of sorted results, default is 'DESCENDING'.",
3141	//       "enum": [
3142	//         "ASCENDING",
3143	//         "DESCENDING"
3144	//       ],
3145	//       "enumDescriptions": [
3146	//         "Ascending order.",
3147	//         "Descending order."
3148	//       ],
3149	//       "location": "query",
3150	//       "type": "string"
3151	//     }
3152	//   },
3153	//   "path": "userprofiles/{profileId}/reports/{reportId}/files",
3154	//   "response": {
3155	//     "$ref": "FileList"
3156	//   },
3157	//   "scopes": [
3158	//     "https://www.googleapis.com/auth/dfareporting"
3159	//   ]
3160	// }
3161
3162}
3163
3164// Pages invokes f for each page of results.
3165// A non-nil error returned from f will halt the iteration.
3166// The provided context supersedes any context provided to the Context method.
3167func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
3168	c.ctx_ = ctx
3169	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
3170	for {
3171		x, err := c.Do()
3172		if err != nil {
3173			return err
3174		}
3175		if err := f(x); err != nil {
3176			return err
3177		}
3178		if x.NextPageToken == "" {
3179			return nil
3180		}
3181		c.PageToken(x.NextPageToken)
3182	}
3183}
3184
3185// method id "dfareporting.userProfiles.get":
3186
3187type UserProfilesGetCall struct {
3188	s            *Service
3189	profileId    int64
3190	urlParams_   gensupport.URLParams
3191	ifNoneMatch_ string
3192	ctx_         context.Context
3193}
3194
3195// Get: Gets one user profile by ID.
3196func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
3197	c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3198	c.profileId = profileId
3199	return c
3200}
3201
3202// Fields allows partial responses to be retrieved. See
3203// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3204// for more information.
3205func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
3206	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3207	return c
3208}
3209
3210// IfNoneMatch sets the optional parameter which makes the operation
3211// fail if the object's ETag matches the given value. This is useful for
3212// getting updates only after the object has changed since the last
3213// request. Use googleapi.IsNotModified to check whether the response
3214// error from Do is the result of In-None-Match.
3215func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
3216	c.ifNoneMatch_ = entityTag
3217	return c
3218}
3219
3220// Context sets the context to be used in this call's Do method. Any
3221// pending HTTP request will be aborted if the provided context is
3222// canceled.
3223func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
3224	c.ctx_ = ctx
3225	return c
3226}
3227
3228func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
3229	var body io.Reader = nil
3230	c.urlParams_.Set("alt", alt)
3231	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
3232	urls += "?" + c.urlParams_.Encode()
3233	req, _ := http.NewRequest("GET", urls, body)
3234	googleapi.Expand(req.URL, map[string]string{
3235		"profileId": strconv.FormatInt(c.profileId, 10),
3236	})
3237	req.Header.Set("User-Agent", c.s.userAgent())
3238	if c.ifNoneMatch_ != "" {
3239		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3240	}
3241	if c.ctx_ != nil {
3242		return ctxhttp.Do(c.ctx_, c.s.client, req)
3243	}
3244	return c.s.client.Do(req)
3245}
3246
3247// Do executes the "dfareporting.userProfiles.get" call.
3248// Exactly one of *UserProfile or error will be non-nil. Any non-2xx
3249// status code is an error. Response headers are in either
3250// *UserProfile.ServerResponse.Header or (if a response was returned at
3251// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3252// to check whether the returned error was because
3253// http.StatusNotModified was returned.
3254func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
3255	gensupport.SetOptions(c.urlParams_, opts...)
3256	res, err := c.doRequest("json")
3257	if res != nil && res.StatusCode == http.StatusNotModified {
3258		if res.Body != nil {
3259			res.Body.Close()
3260		}
3261		return nil, &googleapi.Error{
3262			Code:   res.StatusCode,
3263			Header: res.Header,
3264		}
3265	}
3266	if err != nil {
3267		return nil, err
3268	}
3269	defer googleapi.CloseBody(res)
3270	if err := googleapi.CheckResponse(res); err != nil {
3271		return nil, err
3272	}
3273	ret := &UserProfile{
3274		ServerResponse: googleapi.ServerResponse{
3275			Header:         res.Header,
3276			HTTPStatusCode: res.StatusCode,
3277		},
3278	}
3279	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3280		return nil, err
3281	}
3282	return ret, nil
3283	// {
3284	//   "description": "Gets one user profile by ID.",
3285	//   "httpMethod": "GET",
3286	//   "id": "dfareporting.userProfiles.get",
3287	//   "parameterOrder": [
3288	//     "profileId"
3289	//   ],
3290	//   "parameters": {
3291	//     "profileId": {
3292	//       "description": "The user profile ID.",
3293	//       "format": "int64",
3294	//       "location": "path",
3295	//       "required": true,
3296	//       "type": "string"
3297	//     }
3298	//   },
3299	//   "path": "userprofiles/{profileId}",
3300	//   "response": {
3301	//     "$ref": "UserProfile"
3302	//   },
3303	//   "scopes": [
3304	//     "https://www.googleapis.com/auth/dfareporting"
3305	//   ]
3306	// }
3307
3308}
3309
3310// method id "dfareporting.userProfiles.list":
3311
3312type UserProfilesListCall struct {
3313	s            *Service
3314	urlParams_   gensupport.URLParams
3315	ifNoneMatch_ string
3316	ctx_         context.Context
3317}
3318
3319// List: Retrieves list of user profiles for a user.
3320func (r *UserProfilesService) List() *UserProfilesListCall {
3321	c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3322	return c
3323}
3324
3325// Fields allows partial responses to be retrieved. See
3326// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3327// for more information.
3328func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
3329	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3330	return c
3331}
3332
3333// IfNoneMatch sets the optional parameter which makes the operation
3334// fail if the object's ETag matches the given value. This is useful for
3335// getting updates only after the object has changed since the last
3336// request. Use googleapi.IsNotModified to check whether the response
3337// error from Do is the result of In-None-Match.
3338func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
3339	c.ifNoneMatch_ = entityTag
3340	return c
3341}
3342
3343// Context sets the context to be used in this call's Do method. Any
3344// pending HTTP request will be aborted if the provided context is
3345// canceled.
3346func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
3347	c.ctx_ = ctx
3348	return c
3349}
3350
3351func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
3352	var body io.Reader = nil
3353	c.urlParams_.Set("alt", alt)
3354	urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
3355	urls += "?" + c.urlParams_.Encode()
3356	req, _ := http.NewRequest("GET", urls, body)
3357	googleapi.SetOpaque(req.URL)
3358	req.Header.Set("User-Agent", c.s.userAgent())
3359	if c.ifNoneMatch_ != "" {
3360		req.Header.Set("If-None-Match", c.ifNoneMatch_)
3361	}
3362	if c.ctx_ != nil {
3363		return ctxhttp.Do(c.ctx_, c.s.client, req)
3364	}
3365	return c.s.client.Do(req)
3366}
3367
3368// Do executes the "dfareporting.userProfiles.list" call.
3369// Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
3370// status code is an error. Response headers are in either
3371// *UserProfileList.ServerResponse.Header or (if a response was returned
3372// at all) in error.(*googleapi.Error).Header. Use
3373// googleapi.IsNotModified to check whether the returned error was
3374// because http.StatusNotModified was returned.
3375func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
3376	gensupport.SetOptions(c.urlParams_, opts...)
3377	res, err := c.doRequest("json")
3378	if res != nil && res.StatusCode == http.StatusNotModified {
3379		if res.Body != nil {
3380			res.Body.Close()
3381		}
3382		return nil, &googleapi.Error{
3383			Code:   res.StatusCode,
3384			Header: res.Header,
3385		}
3386	}
3387	if err != nil {
3388		return nil, err
3389	}
3390	defer googleapi.CloseBody(res)
3391	if err := googleapi.CheckResponse(res); err != nil {
3392		return nil, err
3393	}
3394	ret := &UserProfileList{
3395		ServerResponse: googleapi.ServerResponse{
3396			Header:         res.Header,
3397			HTTPStatusCode: res.StatusCode,
3398		},
3399	}
3400	if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
3401		return nil, err
3402	}
3403	return ret, nil
3404	// {
3405	//   "description": "Retrieves list of user profiles for a user.",
3406	//   "httpMethod": "GET",
3407	//   "id": "dfareporting.userProfiles.list",
3408	//   "path": "userprofiles",
3409	//   "response": {
3410	//     "$ref": "UserProfileList"
3411	//   },
3412	//   "scopes": [
3413	//     "https://www.googleapis.com/auth/dfareporting"
3414	//   ]
3415	// }
3416
3417}
3418