1// Copyright 2021 Google LLC.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Code generated file. DO NOT EDIT.
6
7// Package ideahub provides access to the Idea Hub API.
8//
9// For product documentation, see: https://console.cloud.google.com/apis/library/ideahub.googleapis.com
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/ideahub/v1alpha"
16//   ...
17//   ctx := context.Background()
18//   ideahubService, err := ideahub.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
27//
28//   ideahubService, err := ideahub.NewService(ctx, option.WithAPIKey("AIza..."))
29//
30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
31//
32//   config := &oauth2.Config{...}
33//   // ...
34//   token, err := config.Exchange(ctx, ...)
35//   ideahubService, err := ideahub.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
36//
37// See https://godoc.org/google.golang.org/api/option/ for details on options.
38package ideahub // import "google.golang.org/api/ideahub/v1alpha"
39
40import (
41	"bytes"
42	"context"
43	"encoding/json"
44	"errors"
45	"fmt"
46	"io"
47	"net/http"
48	"net/url"
49	"strconv"
50	"strings"
51
52	googleapi "google.golang.org/api/googleapi"
53	gensupport "google.golang.org/api/internal/gensupport"
54	option "google.golang.org/api/option"
55	internaloption "google.golang.org/api/option/internaloption"
56	htransport "google.golang.org/api/transport/http"
57)
58
59// Always reference these packages, just in case the auto-generated code
60// below doesn't.
61var _ = bytes.NewBuffer
62var _ = strconv.Itoa
63var _ = fmt.Sprintf
64var _ = json.NewDecoder
65var _ = io.Copy
66var _ = url.Parse
67var _ = gensupport.MarshalJSON
68var _ = googleapi.Version
69var _ = errors.New
70var _ = strings.Replace
71var _ = context.Canceled
72var _ = internaloption.WithDefaultEndpoint
73
74const apiId = "ideahub:v1alpha"
75const apiName = "ideahub"
76const apiVersion = "v1alpha"
77const basePath = "https://ideahub.googleapis.com/"
78const mtlsBasePath = "https://ideahub.mtls.googleapis.com/"
79
80// NewService creates a new Service.
81func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
82	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
83	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
84	client, endpoint, err := htransport.NewClient(ctx, opts...)
85	if err != nil {
86		return nil, err
87	}
88	s, err := New(client)
89	if err != nil {
90		return nil, err
91	}
92	if endpoint != "" {
93		s.BasePath = endpoint
94	}
95	return s, nil
96}
97
98// New creates a new Service. It uses the provided http.Client for requests.
99//
100// Deprecated: please use NewService instead.
101// To provide a custom HTTP client, use option.WithHTTPClient.
102// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
103func New(client *http.Client) (*Service, error) {
104	if client == nil {
105		return nil, errors.New("client is nil")
106	}
107	s := &Service{client: client, BasePath: basePath}
108	s.Ideas = NewIdeasService(s)
109	s.Platforms = NewPlatformsService(s)
110	return s, nil
111}
112
113type Service struct {
114	client    *http.Client
115	BasePath  string // API endpoint base URL
116	UserAgent string // optional additional User-Agent fragment
117
118	Ideas *IdeasService
119
120	Platforms *PlatformsService
121}
122
123func (s *Service) userAgent() string {
124	if s.UserAgent == "" {
125		return googleapi.UserAgent
126	}
127	return googleapi.UserAgent + " " + s.UserAgent
128}
129
130func NewIdeasService(s *Service) *IdeasService {
131	rs := &IdeasService{s: s}
132	return rs
133}
134
135type IdeasService struct {
136	s *Service
137}
138
139func NewPlatformsService(s *Service) *PlatformsService {
140	rs := &PlatformsService{s: s}
141	rs.Properties = NewPlatformsPropertiesService(s)
142	return rs
143}
144
145type PlatformsService struct {
146	s *Service
147
148	Properties *PlatformsPropertiesService
149}
150
151func NewPlatformsPropertiesService(s *Service) *PlatformsPropertiesService {
152	rs := &PlatformsPropertiesService{s: s}
153	rs.IdeaActivities = NewPlatformsPropertiesIdeaActivitiesService(s)
154	rs.IdeaStates = NewPlatformsPropertiesIdeaStatesService(s)
155	rs.Ideas = NewPlatformsPropertiesIdeasService(s)
156	rs.Locales = NewPlatformsPropertiesLocalesService(s)
157	rs.TopicStates = NewPlatformsPropertiesTopicStatesService(s)
158	return rs
159}
160
161type PlatformsPropertiesService struct {
162	s *Service
163
164	IdeaActivities *PlatformsPropertiesIdeaActivitiesService
165
166	IdeaStates *PlatformsPropertiesIdeaStatesService
167
168	Ideas *PlatformsPropertiesIdeasService
169
170	Locales *PlatformsPropertiesLocalesService
171
172	TopicStates *PlatformsPropertiesTopicStatesService
173}
174
175func NewPlatformsPropertiesIdeaActivitiesService(s *Service) *PlatformsPropertiesIdeaActivitiesService {
176	rs := &PlatformsPropertiesIdeaActivitiesService{s: s}
177	return rs
178}
179
180type PlatformsPropertiesIdeaActivitiesService struct {
181	s *Service
182}
183
184func NewPlatformsPropertiesIdeaStatesService(s *Service) *PlatformsPropertiesIdeaStatesService {
185	rs := &PlatformsPropertiesIdeaStatesService{s: s}
186	return rs
187}
188
189type PlatformsPropertiesIdeaStatesService struct {
190	s *Service
191}
192
193func NewPlatformsPropertiesIdeasService(s *Service) *PlatformsPropertiesIdeasService {
194	rs := &PlatformsPropertiesIdeasService{s: s}
195	return rs
196}
197
198type PlatformsPropertiesIdeasService struct {
199	s *Service
200}
201
202func NewPlatformsPropertiesLocalesService(s *Service) *PlatformsPropertiesLocalesService {
203	rs := &PlatformsPropertiesLocalesService{s: s}
204	return rs
205}
206
207type PlatformsPropertiesLocalesService struct {
208	s *Service
209}
210
211func NewPlatformsPropertiesTopicStatesService(s *Service) *PlatformsPropertiesTopicStatesService {
212	rs := &PlatformsPropertiesTopicStatesService{s: s}
213	return rs
214}
215
216type PlatformsPropertiesTopicStatesService struct {
217	s *Service
218}
219
220// GoogleSearchIdeahubV1alphaAvailableLocale: Represents locales that
221// are available for a web property.
222type GoogleSearchIdeahubV1alphaAvailableLocale struct {
223	// Locale: A string in BCP 47 format, without a resource prefix.
224	Locale string `json:"locale,omitempty"`
225
226	// Name: A string in BCP 47 format, prefixed with the platform and
227	// property name, and "locales/". Format:
228	// platforms/{platform}/properties/{property}/locales/{locale}
229	Name string `json:"name,omitempty"`
230
231	// ForceSendFields is a list of field names (e.g. "Locale") to
232	// unconditionally include in API requests. By default, fields with
233	// empty or default values are omitted from API requests. However, any
234	// non-pointer, non-interface field appearing in ForceSendFields will be
235	// sent to the server regardless of whether the field is empty or not.
236	// This may be used to include empty fields in Patch requests.
237	ForceSendFields []string `json:"-"`
238
239	// NullFields is a list of field names (e.g. "Locale") to include in API
240	// requests with the JSON null value. By default, fields with empty
241	// values are omitted from API requests. However, any field with an
242	// empty value appearing in NullFields will be sent to the server as
243	// null. It is an error if a field in this list has a non-empty value.
244	// This may be used to include null fields in Patch requests.
245	NullFields []string `json:"-"`
246}
247
248func (s *GoogleSearchIdeahubV1alphaAvailableLocale) MarshalJSON() ([]byte, error) {
249	type NoMethod GoogleSearchIdeahubV1alphaAvailableLocale
250	raw := NoMethod(*s)
251	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
252}
253
254// GoogleSearchIdeahubV1alphaIdea: A single Idea that we want to show
255// the end user.
256type GoogleSearchIdeahubV1alphaIdea struct {
257	// Name: Unique identifier for the idea. Format: ideas/{ideaId}
258	Name string `json:"name,omitempty"`
259
260	// Text: The idea’s text.
261	Text string `json:"text,omitempty"`
262
263	// Topics: The Topics that match the idea.
264	Topics []*GoogleSearchIdeahubV1alphaTopic `json:"topics,omitempty"`
265
266	// ForceSendFields is a list of field names (e.g. "Name") to
267	// unconditionally include in API requests. By default, fields with
268	// empty or default values are omitted from API requests. However, any
269	// non-pointer, non-interface field appearing in ForceSendFields will be
270	// sent to the server regardless of whether the field is empty or not.
271	// This may be used to include empty fields in Patch requests.
272	ForceSendFields []string `json:"-"`
273
274	// NullFields is a list of field names (e.g. "Name") to include in API
275	// requests with the JSON null value. By default, fields with empty
276	// values are omitted from API requests. However, any field with an
277	// empty value appearing in NullFields will be sent to the server as
278	// null. It is an error if a field in this list has a non-empty value.
279	// This may be used to include null fields in Patch requests.
280	NullFields []string `json:"-"`
281}
282
283func (s *GoogleSearchIdeahubV1alphaIdea) MarshalJSON() ([]byte, error) {
284	type NoMethod GoogleSearchIdeahubV1alphaIdea
285	raw := NoMethod(*s)
286	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
287}
288
289// GoogleSearchIdeahubV1alphaIdeaActivity: An idea activity entry.
290type GoogleSearchIdeahubV1alphaIdeaActivity struct {
291	// Ideas: The Idea IDs for this entry. If empty, topics should be set.
292	Ideas []string `json:"ideas,omitempty"`
293
294	// Name: Unique identifier for the idea activity. The name is ignored
295	// when creating an idea activity. Format:
296	// platforms/{platform}/properties/{property}/ideaActivities/{idea_activi
297	// ty}
298	Name string `json:"name,omitempty"`
299
300	// Topics: The Topic IDs for this entry. If empty, ideas should be set.
301	Topics []string `json:"topics,omitempty"`
302
303	// Type: The type of activity performed.
304	//
305	// Possible values:
306	//   "TYPE_UNSPECIFIED" - An unspecified, unknown type of idea activity.
307	//   "POST_DRAFTED" - An idea activity type indicating a post has been
308	// drafted.
309	//   "POST_PUBLISHED" - An idea activity type indicating a post has been
310	// published.
311	//   "POST_DELETED" - An idea activity type indicating a post has been
312	// deleted.
313	//   "POST_UNPUBLISHED" - An idea activity type indicating a post has
314	// been unpublished.
315	Type string `json:"type,omitempty"`
316
317	// Uri: The uri the activity relates to.
318	Uri string `json:"uri,omitempty"`
319
320	// ServerResponse contains the HTTP response code and headers from the
321	// server.
322	googleapi.ServerResponse `json:"-"`
323
324	// ForceSendFields is a list of field names (e.g. "Ideas") to
325	// unconditionally include in API requests. By default, fields with
326	// empty or default values are omitted from API requests. However, any
327	// non-pointer, non-interface field appearing in ForceSendFields will be
328	// sent to the server regardless of whether the field is empty or not.
329	// This may be used to include empty fields in Patch requests.
330	ForceSendFields []string `json:"-"`
331
332	// NullFields is a list of field names (e.g. "Ideas") to include in API
333	// requests with the JSON null value. By default, fields with empty
334	// values are omitted from API requests. However, any field with an
335	// empty value appearing in NullFields will be sent to the server as
336	// null. It is an error if a field in this list has a non-empty value.
337	// This may be used to include null fields in Patch requests.
338	NullFields []string `json:"-"`
339}
340
341func (s *GoogleSearchIdeahubV1alphaIdeaActivity) MarshalJSON() ([]byte, error) {
342	type NoMethod GoogleSearchIdeahubV1alphaIdeaActivity
343	raw := NoMethod(*s)
344	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
345}
346
347// GoogleSearchIdeahubV1alphaIdeaState: Represents idea state specific
348// to a web property.
349type GoogleSearchIdeahubV1alphaIdeaState struct {
350	// Dismissed: Whether the idea is dismissed.
351	Dismissed bool `json:"dismissed,omitempty"`
352
353	// Name: Unique identifier for the idea state. Format:
354	// platforms/{platform}/properties/{property}/ideaStates/{idea_state}
355	Name string `json:"name,omitempty"`
356
357	// Saved: Whether the idea is saved.
358	Saved bool `json:"saved,omitempty"`
359
360	// ServerResponse contains the HTTP response code and headers from the
361	// server.
362	googleapi.ServerResponse `json:"-"`
363
364	// ForceSendFields is a list of field names (e.g. "Dismissed") to
365	// unconditionally include in API requests. By default, fields with
366	// empty or default values are omitted from API requests. However, any
367	// non-pointer, non-interface field appearing in ForceSendFields will be
368	// sent to the server regardless of whether the field is empty or not.
369	// This may be used to include empty fields in Patch requests.
370	ForceSendFields []string `json:"-"`
371
372	// NullFields is a list of field names (e.g. "Dismissed") to include in
373	// API requests with the JSON null value. By default, fields with empty
374	// values are omitted from API requests. However, any field with an
375	// empty value appearing in NullFields will be sent to the server as
376	// null. It is an error if a field in this list has a non-empty value.
377	// This may be used to include null fields in Patch requests.
378	NullFields []string `json:"-"`
379}
380
381func (s *GoogleSearchIdeahubV1alphaIdeaState) MarshalJSON() ([]byte, error) {
382	type NoMethod GoogleSearchIdeahubV1alphaIdeaState
383	raw := NoMethod(*s)
384	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
385}
386
387// GoogleSearchIdeahubV1alphaListAvailableLocalesResponse: Response for
388// whether ideas are available for a given web property on a platform,
389// for the currently logged-in user.
390type GoogleSearchIdeahubV1alphaListAvailableLocalesResponse struct {
391	// AvailableLocales: Locales for which ideas are available for the given
392	// Creator.
393	AvailableLocales []*GoogleSearchIdeahubV1alphaAvailableLocale `json:"availableLocales,omitempty"`
394
395	// NextPageToken: A token that can be sent as `page_token` to retrieve
396	// the next page. If this field is omitted, there are no subsequent
397	// pages.
398	NextPageToken string `json:"nextPageToken,omitempty"`
399
400	// ServerResponse contains the HTTP response code and headers from the
401	// server.
402	googleapi.ServerResponse `json:"-"`
403
404	// ForceSendFields is a list of field names (e.g. "AvailableLocales") to
405	// unconditionally include in API requests. By default, fields with
406	// empty or default values are omitted from API requests. However, any
407	// non-pointer, non-interface field appearing in ForceSendFields will be
408	// sent to the server regardless of whether the field is empty or not.
409	// This may be used to include empty fields in Patch requests.
410	ForceSendFields []string `json:"-"`
411
412	// NullFields is a list of field names (e.g. "AvailableLocales") to
413	// include in API requests with the JSON null value. By default, fields
414	// with empty values are omitted from API requests. However, any field
415	// with an empty value appearing in NullFields will be sent to the
416	// server as null. It is an error if a field in this list has a
417	// non-empty value. This may be used to include null fields in Patch
418	// requests.
419	NullFields []string `json:"-"`
420}
421
422func (s *GoogleSearchIdeahubV1alphaListAvailableLocalesResponse) MarshalJSON() ([]byte, error) {
423	type NoMethod GoogleSearchIdeahubV1alphaListAvailableLocalesResponse
424	raw := NoMethod(*s)
425	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
426}
427
428type GoogleSearchIdeahubV1alphaListIdeasResponse struct {
429	// Ideas: Results for the ListIdeasRequest.
430	Ideas []*GoogleSearchIdeahubV1alphaIdea `json:"ideas,omitempty"`
431
432	// NextPageToken: Used to fetch the next page in a subsequent request.
433	NextPageToken string `json:"nextPageToken,omitempty"`
434
435	// ServerResponse contains the HTTP response code and headers from the
436	// server.
437	googleapi.ServerResponse `json:"-"`
438
439	// ForceSendFields is a list of field names (e.g. "Ideas") to
440	// unconditionally include in API requests. By default, fields with
441	// empty or default values are omitted from API requests. However, any
442	// non-pointer, non-interface field appearing in ForceSendFields will be
443	// sent to the server regardless of whether the field is empty or not.
444	// This may be used to include empty fields in Patch requests.
445	ForceSendFields []string `json:"-"`
446
447	// NullFields is a list of field names (e.g. "Ideas") to include in API
448	// requests with the JSON null value. By default, fields with empty
449	// values are omitted from API requests. However, any field with an
450	// empty value appearing in NullFields will be sent to the server as
451	// null. It is an error if a field in this list has a non-empty value.
452	// This may be used to include null fields in Patch requests.
453	NullFields []string `json:"-"`
454}
455
456func (s *GoogleSearchIdeahubV1alphaListIdeasResponse) MarshalJSON() ([]byte, error) {
457	type NoMethod GoogleSearchIdeahubV1alphaListIdeasResponse
458	raw := NoMethod(*s)
459	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
460}
461
462// GoogleSearchIdeahubV1alphaTopic: Represents a Topic umbrella for a
463// list of questions that a Creator may want to respond to.
464type GoogleSearchIdeahubV1alphaTopic struct {
465	// DisplayName: String displayed to the creator indicating the name of
466	// the Topic.
467	DisplayName string `json:"displayName,omitempty"`
468
469	// Mid: The mID of the topic.
470	Mid string `json:"mid,omitempty"`
471
472	// Name: Unique identifier for the topic. Format: topics/{topic}
473	Name string `json:"name,omitempty"`
474
475	// ForceSendFields is a list of field names (e.g. "DisplayName") to
476	// unconditionally include in API requests. By default, fields with
477	// empty or default values are omitted from API requests. However, any
478	// non-pointer, non-interface field appearing in ForceSendFields will be
479	// sent to the server regardless of whether the field is empty or not.
480	// This may be used to include empty fields in Patch requests.
481	ForceSendFields []string `json:"-"`
482
483	// NullFields is a list of field names (e.g. "DisplayName") to include
484	// in API requests with the JSON null value. By default, fields with
485	// empty values are omitted from API requests. However, any field with
486	// an empty value appearing in NullFields will be sent to the server as
487	// null. It is an error if a field in this list has a non-empty value.
488	// This may be used to include null fields in Patch requests.
489	NullFields []string `json:"-"`
490}
491
492func (s *GoogleSearchIdeahubV1alphaTopic) MarshalJSON() ([]byte, error) {
493	type NoMethod GoogleSearchIdeahubV1alphaTopic
494	raw := NoMethod(*s)
495	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
496}
497
498// GoogleSearchIdeahubV1alphaTopicState: Represents topic state specific
499// to a web property.
500type GoogleSearchIdeahubV1alphaTopicState struct {
501	// Dismissed: Whether the topic is dismissed.
502	Dismissed bool `json:"dismissed,omitempty"`
503
504	// Name: Unique identifier for the topic state. Format:
505	// platforms/{platform}/properties/{property}/topicStates/{topic_state}
506	Name string `json:"name,omitempty"`
507
508	// Saved: Whether the topic is saved.
509	Saved bool `json:"saved,omitempty"`
510
511	// ServerResponse contains the HTTP response code and headers from the
512	// server.
513	googleapi.ServerResponse `json:"-"`
514
515	// ForceSendFields is a list of field names (e.g. "Dismissed") to
516	// unconditionally include in API requests. By default, fields with
517	// empty or default values are omitted from API requests. However, any
518	// non-pointer, non-interface field appearing in ForceSendFields will be
519	// sent to the server regardless of whether the field is empty or not.
520	// This may be used to include empty fields in Patch requests.
521	ForceSendFields []string `json:"-"`
522
523	// NullFields is a list of field names (e.g. "Dismissed") to include in
524	// API requests with the JSON null value. By default, fields with empty
525	// values are omitted from API requests. However, any field with an
526	// empty value appearing in NullFields will be sent to the server as
527	// null. It is an error if a field in this list has a non-empty value.
528	// This may be used to include null fields in Patch requests.
529	NullFields []string `json:"-"`
530}
531
532func (s *GoogleSearchIdeahubV1alphaTopicState) MarshalJSON() ([]byte, error) {
533	type NoMethod GoogleSearchIdeahubV1alphaTopicState
534	raw := NoMethod(*s)
535	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
536}
537
538// method id "ideahub.ideas.list":
539
540type IdeasListCall struct {
541	s            *Service
542	urlParams_   gensupport.URLParams
543	ifNoneMatch_ string
544	ctx_         context.Context
545	header_      http.Header
546}
547
548// List: List ideas for a given Creator and filter and sort options.
549func (r *IdeasService) List() *IdeasListCall {
550	c := &IdeasListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
551	return c
552}
553
554// Filter sets the optional parameter "filter": Allows filtering.
555// Supported syntax: * Filter expressions are made up of one or more
556// restrictions. * Restrictions are implicitly combined, as if the `AND`
557// operator was always used. The `OR` operator is currently unsupported.
558// * Supported functions: - `saved(bool)`: If set to true, fetches only
559// saved ideas. If set to false, fetches all except saved ideas. Can't
560// be simultaneously used with `dismissed(bool)`. - `dismissed(bool)`:
561// If set to true, fetches only dismissed ideas. Can't be simultaneously
562// used with `saved(bool)`. The `false` value is currently unsupported.
563// Examples: * `saved(true)` * `saved(false)` * `dismissed(true)` The
564// length of this field should be no more than 500 characters.
565func (c *IdeasListCall) Filter(filter string) *IdeasListCall {
566	c.urlParams_.Set("filter", filter)
567	return c
568}
569
570// OrderBy sets the optional parameter "orderBy": Order semantics
571// described below.
572func (c *IdeasListCall) OrderBy(orderBy string) *IdeasListCall {
573	c.urlParams_.Set("orderBy", orderBy)
574	return c
575}
576
577// PageSize sets the optional parameter "pageSize": The maximum number
578// of ideas per page. If unspecified, at most 10 ideas will be returned.
579// The maximum value is 2000; values above 2000 will be coerced to 2000.
580func (c *IdeasListCall) PageSize(pageSize int64) *IdeasListCall {
581	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
582	return c
583}
584
585// PageToken sets the optional parameter "pageToken": Used to fetch next
586// page.
587func (c *IdeasListCall) PageToken(pageToken string) *IdeasListCall {
588	c.urlParams_.Set("pageToken", pageToken)
589	return c
590}
591
592// Parent sets the optional parameter "parent": If defined, specifies
593// the creator for which to filter by. Format:
594// publishers/{publisher}/properties/{property}
595func (c *IdeasListCall) Parent(parent string) *IdeasListCall {
596	c.urlParams_.Set("parent", parent)
597	return c
598}
599
600// Fields allows partial responses to be retrieved. See
601// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
602// for more information.
603func (c *IdeasListCall) Fields(s ...googleapi.Field) *IdeasListCall {
604	c.urlParams_.Set("fields", googleapi.CombineFields(s))
605	return c
606}
607
608// IfNoneMatch sets the optional parameter which makes the operation
609// fail if the object's ETag matches the given value. This is useful for
610// getting updates only after the object has changed since the last
611// request. Use googleapi.IsNotModified to check whether the response
612// error from Do is the result of In-None-Match.
613func (c *IdeasListCall) IfNoneMatch(entityTag string) *IdeasListCall {
614	c.ifNoneMatch_ = entityTag
615	return c
616}
617
618// Context sets the context to be used in this call's Do method. Any
619// pending HTTP request will be aborted if the provided context is
620// canceled.
621func (c *IdeasListCall) Context(ctx context.Context) *IdeasListCall {
622	c.ctx_ = ctx
623	return c
624}
625
626// Header returns an http.Header that can be modified by the caller to
627// add HTTP headers to the request.
628func (c *IdeasListCall) Header() http.Header {
629	if c.header_ == nil {
630		c.header_ = make(http.Header)
631	}
632	return c.header_
633}
634
635func (c *IdeasListCall) doRequest(alt string) (*http.Response, error) {
636	reqHeaders := make(http.Header)
637	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
638	for k, v := range c.header_ {
639		reqHeaders[k] = v
640	}
641	reqHeaders.Set("User-Agent", c.s.userAgent())
642	if c.ifNoneMatch_ != "" {
643		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
644	}
645	var body io.Reader = nil
646	c.urlParams_.Set("alt", alt)
647	c.urlParams_.Set("prettyPrint", "false")
648	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/ideas")
649	urls += "?" + c.urlParams_.Encode()
650	req, err := http.NewRequest("GET", urls, body)
651	if err != nil {
652		return nil, err
653	}
654	req.Header = reqHeaders
655	return gensupport.SendRequest(c.ctx_, c.s.client, req)
656}
657
658// Do executes the "ideahub.ideas.list" call.
659// Exactly one of *GoogleSearchIdeahubV1alphaListIdeasResponse or error
660// will be non-nil. Any non-2xx status code is an error. Response
661// headers are in either
662// *GoogleSearchIdeahubV1alphaListIdeasResponse.ServerResponse.Header or
663// (if a response was returned at all) in
664// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
665// whether the returned error was because http.StatusNotModified was
666// returned.
667func (c *IdeasListCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1alphaListIdeasResponse, error) {
668	gensupport.SetOptions(c.urlParams_, opts...)
669	res, err := c.doRequest("json")
670	if res != nil && res.StatusCode == http.StatusNotModified {
671		if res.Body != nil {
672			res.Body.Close()
673		}
674		return nil, &googleapi.Error{
675			Code:   res.StatusCode,
676			Header: res.Header,
677		}
678	}
679	if err != nil {
680		return nil, err
681	}
682	defer googleapi.CloseBody(res)
683	if err := googleapi.CheckResponse(res); err != nil {
684		return nil, err
685	}
686	ret := &GoogleSearchIdeahubV1alphaListIdeasResponse{
687		ServerResponse: googleapi.ServerResponse{
688			Header:         res.Header,
689			HTTPStatusCode: res.StatusCode,
690		},
691	}
692	target := &ret
693	if err := gensupport.DecodeResponse(target, res); err != nil {
694		return nil, err
695	}
696	return ret, nil
697	// {
698	//   "description": "List ideas for a given Creator and filter and sort options.",
699	//   "flatPath": "v1alpha/ideas",
700	//   "httpMethod": "GET",
701	//   "id": "ideahub.ideas.list",
702	//   "parameterOrder": [],
703	//   "parameters": {
704	//     "filter": {
705	//       "description": "Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions are implicitly combined, as if the `AND` operator was always used. The `OR` operator is currently unsupported. * Supported functions: - `saved(bool)`: If set to true, fetches only saved ideas. If set to false, fetches all except saved ideas. Can't be simultaneously used with `dismissed(bool)`. - `dismissed(bool)`: If set to true, fetches only dismissed ideas. Can't be simultaneously used with `saved(bool)`. The `false` value is currently unsupported. Examples: * `saved(true)` * `saved(false)` * `dismissed(true)` The length of this field should be no more than 500 characters.",
706	//       "location": "query",
707	//       "type": "string"
708	//     },
709	//     "orderBy": {
710	//       "description": "Order semantics described below.",
711	//       "location": "query",
712	//       "type": "string"
713	//     },
714	//     "pageSize": {
715	//       "description": "The maximum number of ideas per page. If unspecified, at most 10 ideas will be returned. The maximum value is 2000; values above 2000 will be coerced to 2000.",
716	//       "format": "int32",
717	//       "location": "query",
718	//       "type": "integer"
719	//     },
720	//     "pageToken": {
721	//       "description": "Used to fetch next page.",
722	//       "location": "query",
723	//       "type": "string"
724	//     },
725	//     "parent": {
726	//       "description": "If defined, specifies the creator for which to filter by. Format: publishers/{publisher}/properties/{property}",
727	//       "location": "query",
728	//       "type": "string"
729	//     }
730	//   },
731	//   "path": "v1alpha/ideas",
732	//   "response": {
733	//     "$ref": "GoogleSearchIdeahubV1alphaListIdeasResponse"
734	//   }
735	// }
736
737}
738
739// Pages invokes f for each page of results.
740// A non-nil error returned from f will halt the iteration.
741// The provided context supersedes any context provided to the Context method.
742func (c *IdeasListCall) Pages(ctx context.Context, f func(*GoogleSearchIdeahubV1alphaListIdeasResponse) error) error {
743	c.ctx_ = ctx
744	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
745	for {
746		x, err := c.Do()
747		if err != nil {
748			return err
749		}
750		if err := f(x); err != nil {
751			return err
752		}
753		if x.NextPageToken == "" {
754			return nil
755		}
756		c.PageToken(x.NextPageToken)
757	}
758}
759
760// method id "ideahub.platforms.properties.ideaActivities.create":
761
762type PlatformsPropertiesIdeaActivitiesCreateCall struct {
763	s                                      *Service
764	parent                                 string
765	googlesearchideahubv1alphaideaactivity *GoogleSearchIdeahubV1alphaIdeaActivity
766	urlParams_                             gensupport.URLParams
767	ctx_                                   context.Context
768	header_                                http.Header
769}
770
771// Create: Creates an idea activity entry.
772//
773// - parent: The parent resource where this idea activity will be
774//   created. Format: platforms/{platform}/property/{property}.
775func (r *PlatformsPropertiesIdeaActivitiesService) Create(parent string, googlesearchideahubv1alphaideaactivity *GoogleSearchIdeahubV1alphaIdeaActivity) *PlatformsPropertiesIdeaActivitiesCreateCall {
776	c := &PlatformsPropertiesIdeaActivitiesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
777	c.parent = parent
778	c.googlesearchideahubv1alphaideaactivity = googlesearchideahubv1alphaideaactivity
779	return c
780}
781
782// Fields allows partial responses to be retrieved. See
783// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
784// for more information.
785func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Fields(s ...googleapi.Field) *PlatformsPropertiesIdeaActivitiesCreateCall {
786	c.urlParams_.Set("fields", googleapi.CombineFields(s))
787	return c
788}
789
790// Context sets the context to be used in this call's Do method. Any
791// pending HTTP request will be aborted if the provided context is
792// canceled.
793func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Context(ctx context.Context) *PlatformsPropertiesIdeaActivitiesCreateCall {
794	c.ctx_ = ctx
795	return c
796}
797
798// Header returns an http.Header that can be modified by the caller to
799// add HTTP headers to the request.
800func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Header() http.Header {
801	if c.header_ == nil {
802		c.header_ = make(http.Header)
803	}
804	return c.header_
805}
806
807func (c *PlatformsPropertiesIdeaActivitiesCreateCall) doRequest(alt string) (*http.Response, error) {
808	reqHeaders := make(http.Header)
809	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
810	for k, v := range c.header_ {
811		reqHeaders[k] = v
812	}
813	reqHeaders.Set("User-Agent", c.s.userAgent())
814	var body io.Reader = nil
815	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesearchideahubv1alphaideaactivity)
816	if err != nil {
817		return nil, err
818	}
819	reqHeaders.Set("Content-Type", "application/json")
820	c.urlParams_.Set("alt", alt)
821	c.urlParams_.Set("prettyPrint", "false")
822	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/ideaActivities")
823	urls += "?" + c.urlParams_.Encode()
824	req, err := http.NewRequest("POST", urls, body)
825	if err != nil {
826		return nil, err
827	}
828	req.Header = reqHeaders
829	googleapi.Expand(req.URL, map[string]string{
830		"parent": c.parent,
831	})
832	return gensupport.SendRequest(c.ctx_, c.s.client, req)
833}
834
835// Do executes the "ideahub.platforms.properties.ideaActivities.create" call.
836// Exactly one of *GoogleSearchIdeahubV1alphaIdeaActivity or error will
837// be non-nil. Any non-2xx status code is an error. Response headers are
838// in either
839// *GoogleSearchIdeahubV1alphaIdeaActivity.ServerResponse.Header or (if
840// a response was returned at all) in error.(*googleapi.Error).Header.
841// Use googleapi.IsNotModified to check whether the returned error was
842// because http.StatusNotModified was returned.
843func (c *PlatformsPropertiesIdeaActivitiesCreateCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1alphaIdeaActivity, error) {
844	gensupport.SetOptions(c.urlParams_, opts...)
845	res, err := c.doRequest("json")
846	if res != nil && res.StatusCode == http.StatusNotModified {
847		if res.Body != nil {
848			res.Body.Close()
849		}
850		return nil, &googleapi.Error{
851			Code:   res.StatusCode,
852			Header: res.Header,
853		}
854	}
855	if err != nil {
856		return nil, err
857	}
858	defer googleapi.CloseBody(res)
859	if err := googleapi.CheckResponse(res); err != nil {
860		return nil, err
861	}
862	ret := &GoogleSearchIdeahubV1alphaIdeaActivity{
863		ServerResponse: googleapi.ServerResponse{
864			Header:         res.Header,
865			HTTPStatusCode: res.StatusCode,
866		},
867	}
868	target := &ret
869	if err := gensupport.DecodeResponse(target, res); err != nil {
870		return nil, err
871	}
872	return ret, nil
873	// {
874	//   "description": "Creates an idea activity entry.",
875	//   "flatPath": "v1alpha/platforms/{platformsId}/properties/{propertiesId}/ideaActivities",
876	//   "httpMethod": "POST",
877	//   "id": "ideahub.platforms.properties.ideaActivities.create",
878	//   "parameterOrder": [
879	//     "parent"
880	//   ],
881	//   "parameters": {
882	//     "parent": {
883	//       "description": "Required. The parent resource where this idea activity will be created. Format: platforms/{platform}/property/{property}",
884	//       "location": "path",
885	//       "pattern": "^platforms/[^/]+/properties/[^/]+$",
886	//       "required": true,
887	//       "type": "string"
888	//     }
889	//   },
890	//   "path": "v1alpha/{+parent}/ideaActivities",
891	//   "request": {
892	//     "$ref": "GoogleSearchIdeahubV1alphaIdeaActivity"
893	//   },
894	//   "response": {
895	//     "$ref": "GoogleSearchIdeahubV1alphaIdeaActivity"
896	//   }
897	// }
898
899}
900
901// method id "ideahub.platforms.properties.ideaStates.patch":
902
903type PlatformsPropertiesIdeaStatesPatchCall struct {
904	s                                   *Service
905	nameid                              string
906	googlesearchideahubv1alphaideastate *GoogleSearchIdeahubV1alphaIdeaState
907	urlParams_                          gensupport.URLParams
908	ctx_                                context.Context
909	header_                             http.Header
910}
911
912// Patch: Update an idea state resource.
913//
914// - name: Unique identifier for the idea state. Format:
915//   platforms/{platform}/properties/{property}/ideaStates/{idea_state}.
916func (r *PlatformsPropertiesIdeaStatesService) Patch(nameid string, googlesearchideahubv1alphaideastate *GoogleSearchIdeahubV1alphaIdeaState) *PlatformsPropertiesIdeaStatesPatchCall {
917	c := &PlatformsPropertiesIdeaStatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
918	c.nameid = nameid
919	c.googlesearchideahubv1alphaideastate = googlesearchideahubv1alphaideastate
920	return c
921}
922
923// UpdateMask sets the optional parameter "updateMask": The list of
924// fields to be updated.
925func (c *PlatformsPropertiesIdeaStatesPatchCall) UpdateMask(updateMask string) *PlatformsPropertiesIdeaStatesPatchCall {
926	c.urlParams_.Set("updateMask", updateMask)
927	return c
928}
929
930// Fields allows partial responses to be retrieved. See
931// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
932// for more information.
933func (c *PlatformsPropertiesIdeaStatesPatchCall) Fields(s ...googleapi.Field) *PlatformsPropertiesIdeaStatesPatchCall {
934	c.urlParams_.Set("fields", googleapi.CombineFields(s))
935	return c
936}
937
938// Context sets the context to be used in this call's Do method. Any
939// pending HTTP request will be aborted if the provided context is
940// canceled.
941func (c *PlatformsPropertiesIdeaStatesPatchCall) Context(ctx context.Context) *PlatformsPropertiesIdeaStatesPatchCall {
942	c.ctx_ = ctx
943	return c
944}
945
946// Header returns an http.Header that can be modified by the caller to
947// add HTTP headers to the request.
948func (c *PlatformsPropertiesIdeaStatesPatchCall) Header() http.Header {
949	if c.header_ == nil {
950		c.header_ = make(http.Header)
951	}
952	return c.header_
953}
954
955func (c *PlatformsPropertiesIdeaStatesPatchCall) doRequest(alt string) (*http.Response, error) {
956	reqHeaders := make(http.Header)
957	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
958	for k, v := range c.header_ {
959		reqHeaders[k] = v
960	}
961	reqHeaders.Set("User-Agent", c.s.userAgent())
962	var body io.Reader = nil
963	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesearchideahubv1alphaideastate)
964	if err != nil {
965		return nil, err
966	}
967	reqHeaders.Set("Content-Type", "application/json")
968	c.urlParams_.Set("alt", alt)
969	c.urlParams_.Set("prettyPrint", "false")
970	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
971	urls += "?" + c.urlParams_.Encode()
972	req, err := http.NewRequest("PATCH", urls, body)
973	if err != nil {
974		return nil, err
975	}
976	req.Header = reqHeaders
977	googleapi.Expand(req.URL, map[string]string{
978		"name": c.nameid,
979	})
980	return gensupport.SendRequest(c.ctx_, c.s.client, req)
981}
982
983// Do executes the "ideahub.platforms.properties.ideaStates.patch" call.
984// Exactly one of *GoogleSearchIdeahubV1alphaIdeaState or error will be
985// non-nil. Any non-2xx status code is an error. Response headers are in
986// either *GoogleSearchIdeahubV1alphaIdeaState.ServerResponse.Header or
987// (if a response was returned at all) in
988// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
989// whether the returned error was because http.StatusNotModified was
990// returned.
991func (c *PlatformsPropertiesIdeaStatesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1alphaIdeaState, error) {
992	gensupport.SetOptions(c.urlParams_, opts...)
993	res, err := c.doRequest("json")
994	if res != nil && res.StatusCode == http.StatusNotModified {
995		if res.Body != nil {
996			res.Body.Close()
997		}
998		return nil, &googleapi.Error{
999			Code:   res.StatusCode,
1000			Header: res.Header,
1001		}
1002	}
1003	if err != nil {
1004		return nil, err
1005	}
1006	defer googleapi.CloseBody(res)
1007	if err := googleapi.CheckResponse(res); err != nil {
1008		return nil, err
1009	}
1010	ret := &GoogleSearchIdeahubV1alphaIdeaState{
1011		ServerResponse: googleapi.ServerResponse{
1012			Header:         res.Header,
1013			HTTPStatusCode: res.StatusCode,
1014		},
1015	}
1016	target := &ret
1017	if err := gensupport.DecodeResponse(target, res); err != nil {
1018		return nil, err
1019	}
1020	return ret, nil
1021	// {
1022	//   "description": "Update an idea state resource.",
1023	//   "flatPath": "v1alpha/platforms/{platformsId}/properties/{propertiesId}/ideaStates/{ideaStatesId}",
1024	//   "httpMethod": "PATCH",
1025	//   "id": "ideahub.platforms.properties.ideaStates.patch",
1026	//   "parameterOrder": [
1027	//     "name"
1028	//   ],
1029	//   "parameters": {
1030	//     "name": {
1031	//       "description": "Unique identifier for the idea state. Format: platforms/{platform}/properties/{property}/ideaStates/{idea_state}",
1032	//       "location": "path",
1033	//       "pattern": "^platforms/[^/]+/properties/[^/]+/ideaStates/[^/]+$",
1034	//       "required": true,
1035	//       "type": "string"
1036	//     },
1037	//     "updateMask": {
1038	//       "description": "The list of fields to be updated.",
1039	//       "format": "google-fieldmask",
1040	//       "location": "query",
1041	//       "type": "string"
1042	//     }
1043	//   },
1044	//   "path": "v1alpha/{+name}",
1045	//   "request": {
1046	//     "$ref": "GoogleSearchIdeahubV1alphaIdeaState"
1047	//   },
1048	//   "response": {
1049	//     "$ref": "GoogleSearchIdeahubV1alphaIdeaState"
1050	//   }
1051	// }
1052
1053}
1054
1055// method id "ideahub.platforms.properties.ideas.list":
1056
1057type PlatformsPropertiesIdeasListCall struct {
1058	s            *Service
1059	parent       string
1060	urlParams_   gensupport.URLParams
1061	ifNoneMatch_ string
1062	ctx_         context.Context
1063	header_      http.Header
1064}
1065
1066// List: List ideas for a given Creator and filter and sort options.
1067//
1068// - parent: If defined, specifies the creator for which to filter by.
1069//   Format: publishers/{publisher}/properties/{property}.
1070func (r *PlatformsPropertiesIdeasService) List(parent string) *PlatformsPropertiesIdeasListCall {
1071	c := &PlatformsPropertiesIdeasListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1072	c.parent = parent
1073	return c
1074}
1075
1076// Filter sets the optional parameter "filter": Allows filtering.
1077// Supported syntax: * Filter expressions are made up of one or more
1078// restrictions. * Restrictions are implicitly combined, as if the `AND`
1079// operator was always used. The `OR` operator is currently unsupported.
1080// * Supported functions: - `saved(bool)`: If set to true, fetches only
1081// saved ideas. If set to false, fetches all except saved ideas. Can't
1082// be simultaneously used with `dismissed(bool)`. - `dismissed(bool)`:
1083// If set to true, fetches only dismissed ideas. Can't be simultaneously
1084// used with `saved(bool)`. The `false` value is currently unsupported.
1085// Examples: * `saved(true)` * `saved(false)` * `dismissed(true)` The
1086// length of this field should be no more than 500 characters.
1087func (c *PlatformsPropertiesIdeasListCall) Filter(filter string) *PlatformsPropertiesIdeasListCall {
1088	c.urlParams_.Set("filter", filter)
1089	return c
1090}
1091
1092// OrderBy sets the optional parameter "orderBy": Order semantics
1093// described below.
1094func (c *PlatformsPropertiesIdeasListCall) OrderBy(orderBy string) *PlatformsPropertiesIdeasListCall {
1095	c.urlParams_.Set("orderBy", orderBy)
1096	return c
1097}
1098
1099// PageSize sets the optional parameter "pageSize": The maximum number
1100// of ideas per page. If unspecified, at most 10 ideas will be returned.
1101// The maximum value is 2000; values above 2000 will be coerced to 2000.
1102func (c *PlatformsPropertiesIdeasListCall) PageSize(pageSize int64) *PlatformsPropertiesIdeasListCall {
1103	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1104	return c
1105}
1106
1107// PageToken sets the optional parameter "pageToken": Used to fetch next
1108// page.
1109func (c *PlatformsPropertiesIdeasListCall) PageToken(pageToken string) *PlatformsPropertiesIdeasListCall {
1110	c.urlParams_.Set("pageToken", pageToken)
1111	return c
1112}
1113
1114// Fields allows partial responses to be retrieved. See
1115// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1116// for more information.
1117func (c *PlatformsPropertiesIdeasListCall) Fields(s ...googleapi.Field) *PlatformsPropertiesIdeasListCall {
1118	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1119	return c
1120}
1121
1122// IfNoneMatch sets the optional parameter which makes the operation
1123// fail if the object's ETag matches the given value. This is useful for
1124// getting updates only after the object has changed since the last
1125// request. Use googleapi.IsNotModified to check whether the response
1126// error from Do is the result of In-None-Match.
1127func (c *PlatformsPropertiesIdeasListCall) IfNoneMatch(entityTag string) *PlatformsPropertiesIdeasListCall {
1128	c.ifNoneMatch_ = entityTag
1129	return c
1130}
1131
1132// Context sets the context to be used in this call's Do method. Any
1133// pending HTTP request will be aborted if the provided context is
1134// canceled.
1135func (c *PlatformsPropertiesIdeasListCall) Context(ctx context.Context) *PlatformsPropertiesIdeasListCall {
1136	c.ctx_ = ctx
1137	return c
1138}
1139
1140// Header returns an http.Header that can be modified by the caller to
1141// add HTTP headers to the request.
1142func (c *PlatformsPropertiesIdeasListCall) Header() http.Header {
1143	if c.header_ == nil {
1144		c.header_ = make(http.Header)
1145	}
1146	return c.header_
1147}
1148
1149func (c *PlatformsPropertiesIdeasListCall) doRequest(alt string) (*http.Response, error) {
1150	reqHeaders := make(http.Header)
1151	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
1152	for k, v := range c.header_ {
1153		reqHeaders[k] = v
1154	}
1155	reqHeaders.Set("User-Agent", c.s.userAgent())
1156	if c.ifNoneMatch_ != "" {
1157		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1158	}
1159	var body io.Reader = nil
1160	c.urlParams_.Set("alt", alt)
1161	c.urlParams_.Set("prettyPrint", "false")
1162	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/ideas")
1163	urls += "?" + c.urlParams_.Encode()
1164	req, err := http.NewRequest("GET", urls, body)
1165	if err != nil {
1166		return nil, err
1167	}
1168	req.Header = reqHeaders
1169	googleapi.Expand(req.URL, map[string]string{
1170		"parent": c.parent,
1171	})
1172	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1173}
1174
1175// Do executes the "ideahub.platforms.properties.ideas.list" call.
1176// Exactly one of *GoogleSearchIdeahubV1alphaListIdeasResponse or error
1177// will be non-nil. Any non-2xx status code is an error. Response
1178// headers are in either
1179// *GoogleSearchIdeahubV1alphaListIdeasResponse.ServerResponse.Header or
1180// (if a response was returned at all) in
1181// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1182// whether the returned error was because http.StatusNotModified was
1183// returned.
1184func (c *PlatformsPropertiesIdeasListCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1alphaListIdeasResponse, error) {
1185	gensupport.SetOptions(c.urlParams_, opts...)
1186	res, err := c.doRequest("json")
1187	if res != nil && res.StatusCode == http.StatusNotModified {
1188		if res.Body != nil {
1189			res.Body.Close()
1190		}
1191		return nil, &googleapi.Error{
1192			Code:   res.StatusCode,
1193			Header: res.Header,
1194		}
1195	}
1196	if err != nil {
1197		return nil, err
1198	}
1199	defer googleapi.CloseBody(res)
1200	if err := googleapi.CheckResponse(res); err != nil {
1201		return nil, err
1202	}
1203	ret := &GoogleSearchIdeahubV1alphaListIdeasResponse{
1204		ServerResponse: googleapi.ServerResponse{
1205			Header:         res.Header,
1206			HTTPStatusCode: res.StatusCode,
1207		},
1208	}
1209	target := &ret
1210	if err := gensupport.DecodeResponse(target, res); err != nil {
1211		return nil, err
1212	}
1213	return ret, nil
1214	// {
1215	//   "description": "List ideas for a given Creator and filter and sort options.",
1216	//   "flatPath": "v1alpha/platforms/{platformsId}/properties/{propertiesId}/ideas",
1217	//   "httpMethod": "GET",
1218	//   "id": "ideahub.platforms.properties.ideas.list",
1219	//   "parameterOrder": [
1220	//     "parent"
1221	//   ],
1222	//   "parameters": {
1223	//     "filter": {
1224	//       "description": "Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions are implicitly combined, as if the `AND` operator was always used. The `OR` operator is currently unsupported. * Supported functions: - `saved(bool)`: If set to true, fetches only saved ideas. If set to false, fetches all except saved ideas. Can't be simultaneously used with `dismissed(bool)`. - `dismissed(bool)`: If set to true, fetches only dismissed ideas. Can't be simultaneously used with `saved(bool)`. The `false` value is currently unsupported. Examples: * `saved(true)` * `saved(false)` * `dismissed(true)` The length of this field should be no more than 500 characters.",
1225	//       "location": "query",
1226	//       "type": "string"
1227	//     },
1228	//     "orderBy": {
1229	//       "description": "Order semantics described below.",
1230	//       "location": "query",
1231	//       "type": "string"
1232	//     },
1233	//     "pageSize": {
1234	//       "description": "The maximum number of ideas per page. If unspecified, at most 10 ideas will be returned. The maximum value is 2000; values above 2000 will be coerced to 2000.",
1235	//       "format": "int32",
1236	//       "location": "query",
1237	//       "type": "integer"
1238	//     },
1239	//     "pageToken": {
1240	//       "description": "Used to fetch next page.",
1241	//       "location": "query",
1242	//       "type": "string"
1243	//     },
1244	//     "parent": {
1245	//       "description": "If defined, specifies the creator for which to filter by. Format: publishers/{publisher}/properties/{property}",
1246	//       "location": "path",
1247	//       "pattern": "^platforms/[^/]+/properties/[^/]+$",
1248	//       "required": true,
1249	//       "type": "string"
1250	//     }
1251	//   },
1252	//   "path": "v1alpha/{+parent}/ideas",
1253	//   "response": {
1254	//     "$ref": "GoogleSearchIdeahubV1alphaListIdeasResponse"
1255	//   }
1256	// }
1257
1258}
1259
1260// Pages invokes f for each page of results.
1261// A non-nil error returned from f will halt the iteration.
1262// The provided context supersedes any context provided to the Context method.
1263func (c *PlatformsPropertiesIdeasListCall) Pages(ctx context.Context, f func(*GoogleSearchIdeahubV1alphaListIdeasResponse) error) error {
1264	c.ctx_ = ctx
1265	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1266	for {
1267		x, err := c.Do()
1268		if err != nil {
1269			return err
1270		}
1271		if err := f(x); err != nil {
1272			return err
1273		}
1274		if x.NextPageToken == "" {
1275			return nil
1276		}
1277		c.PageToken(x.NextPageToken)
1278	}
1279}
1280
1281// method id "ideahub.platforms.properties.locales.list":
1282
1283type PlatformsPropertiesLocalesListCall struct {
1284	s            *Service
1285	parent       string
1286	urlParams_   gensupport.URLParams
1287	ifNoneMatch_ string
1288	ctx_         context.Context
1289	header_      http.Header
1290}
1291
1292// List: Returns which locales ideas are available in for a given
1293// Creator.
1294//
1295// - parent: The web property to check idea availability for Format:
1296//   platforms/{platform}/property/{property}.
1297func (r *PlatformsPropertiesLocalesService) List(parent string) *PlatformsPropertiesLocalesListCall {
1298	c := &PlatformsPropertiesLocalesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1299	c.parent = parent
1300	return c
1301}
1302
1303// PageSize sets the optional parameter "pageSize": The maximum number
1304// of locales to return. The service may return fewer than this value.
1305// If unspecified, at most 100 locales will be returned. The maximum
1306// value is 100; values above 100 will be coerced to 100.
1307func (c *PlatformsPropertiesLocalesListCall) PageSize(pageSize int64) *PlatformsPropertiesLocalesListCall {
1308	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1309	return c
1310}
1311
1312// PageToken sets the optional parameter "pageToken": A page token,
1313// received from a previous `ListAvailableLocales` call. Provide this to
1314// retrieve the subsequent page. When paginating, all other parameters
1315// provided to `ListAvailableLocales` must match the call that provided
1316// the page token.
1317func (c *PlatformsPropertiesLocalesListCall) PageToken(pageToken string) *PlatformsPropertiesLocalesListCall {
1318	c.urlParams_.Set("pageToken", pageToken)
1319	return c
1320}
1321
1322// Fields allows partial responses to be retrieved. See
1323// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1324// for more information.
1325func (c *PlatformsPropertiesLocalesListCall) Fields(s ...googleapi.Field) *PlatformsPropertiesLocalesListCall {
1326	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1327	return c
1328}
1329
1330// IfNoneMatch sets the optional parameter which makes the operation
1331// fail if the object's ETag matches the given value. This is useful for
1332// getting updates only after the object has changed since the last
1333// request. Use googleapi.IsNotModified to check whether the response
1334// error from Do is the result of In-None-Match.
1335func (c *PlatformsPropertiesLocalesListCall) IfNoneMatch(entityTag string) *PlatformsPropertiesLocalesListCall {
1336	c.ifNoneMatch_ = entityTag
1337	return c
1338}
1339
1340// Context sets the context to be used in this call's Do method. Any
1341// pending HTTP request will be aborted if the provided context is
1342// canceled.
1343func (c *PlatformsPropertiesLocalesListCall) Context(ctx context.Context) *PlatformsPropertiesLocalesListCall {
1344	c.ctx_ = ctx
1345	return c
1346}
1347
1348// Header returns an http.Header that can be modified by the caller to
1349// add HTTP headers to the request.
1350func (c *PlatformsPropertiesLocalesListCall) Header() http.Header {
1351	if c.header_ == nil {
1352		c.header_ = make(http.Header)
1353	}
1354	return c.header_
1355}
1356
1357func (c *PlatformsPropertiesLocalesListCall) doRequest(alt string) (*http.Response, error) {
1358	reqHeaders := make(http.Header)
1359	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
1360	for k, v := range c.header_ {
1361		reqHeaders[k] = v
1362	}
1363	reqHeaders.Set("User-Agent", c.s.userAgent())
1364	if c.ifNoneMatch_ != "" {
1365		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1366	}
1367	var body io.Reader = nil
1368	c.urlParams_.Set("alt", alt)
1369	c.urlParams_.Set("prettyPrint", "false")
1370	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+parent}/locales")
1371	urls += "?" + c.urlParams_.Encode()
1372	req, err := http.NewRequest("GET", urls, body)
1373	if err != nil {
1374		return nil, err
1375	}
1376	req.Header = reqHeaders
1377	googleapi.Expand(req.URL, map[string]string{
1378		"parent": c.parent,
1379	})
1380	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1381}
1382
1383// Do executes the "ideahub.platforms.properties.locales.list" call.
1384// Exactly one of
1385// *GoogleSearchIdeahubV1alphaListAvailableLocalesResponse or error will
1386// be non-nil. Any non-2xx status code is an error. Response headers are
1387// in either
1388// *GoogleSearchIdeahubV1alphaListAvailableLocalesResponse.ServerResponse
1389// .Header or (if a response was returned at all) in
1390// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1391// whether the returned error was because http.StatusNotModified was
1392// returned.
1393func (c *PlatformsPropertiesLocalesListCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1alphaListAvailableLocalesResponse, error) {
1394	gensupport.SetOptions(c.urlParams_, opts...)
1395	res, err := c.doRequest("json")
1396	if res != nil && res.StatusCode == http.StatusNotModified {
1397		if res.Body != nil {
1398			res.Body.Close()
1399		}
1400		return nil, &googleapi.Error{
1401			Code:   res.StatusCode,
1402			Header: res.Header,
1403		}
1404	}
1405	if err != nil {
1406		return nil, err
1407	}
1408	defer googleapi.CloseBody(res)
1409	if err := googleapi.CheckResponse(res); err != nil {
1410		return nil, err
1411	}
1412	ret := &GoogleSearchIdeahubV1alphaListAvailableLocalesResponse{
1413		ServerResponse: googleapi.ServerResponse{
1414			Header:         res.Header,
1415			HTTPStatusCode: res.StatusCode,
1416		},
1417	}
1418	target := &ret
1419	if err := gensupport.DecodeResponse(target, res); err != nil {
1420		return nil, err
1421	}
1422	return ret, nil
1423	// {
1424	//   "description": "Returns which locales ideas are available in for a given Creator.",
1425	//   "flatPath": "v1alpha/platforms/{platformsId}/properties/{propertiesId}/locales",
1426	//   "httpMethod": "GET",
1427	//   "id": "ideahub.platforms.properties.locales.list",
1428	//   "parameterOrder": [
1429	//     "parent"
1430	//   ],
1431	//   "parameters": {
1432	//     "pageSize": {
1433	//       "description": "The maximum number of locales to return. The service may return fewer than this value. If unspecified, at most 100 locales will be returned. The maximum value is 100; values above 100 will be coerced to 100.",
1434	//       "format": "int32",
1435	//       "location": "query",
1436	//       "type": "integer"
1437	//     },
1438	//     "pageToken": {
1439	//       "description": "A page token, received from a previous `ListAvailableLocales` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAvailableLocales` must match the call that provided the page token.",
1440	//       "location": "query",
1441	//       "type": "string"
1442	//     },
1443	//     "parent": {
1444	//       "description": "Required. The web property to check idea availability for Format: platforms/{platform}/property/{property}",
1445	//       "location": "path",
1446	//       "pattern": "^platforms/[^/]+/properties/[^/]+$",
1447	//       "required": true,
1448	//       "type": "string"
1449	//     }
1450	//   },
1451	//   "path": "v1alpha/{+parent}/locales",
1452	//   "response": {
1453	//     "$ref": "GoogleSearchIdeahubV1alphaListAvailableLocalesResponse"
1454	//   }
1455	// }
1456
1457}
1458
1459// Pages invokes f for each page of results.
1460// A non-nil error returned from f will halt the iteration.
1461// The provided context supersedes any context provided to the Context method.
1462func (c *PlatformsPropertiesLocalesListCall) Pages(ctx context.Context, f func(*GoogleSearchIdeahubV1alphaListAvailableLocalesResponse) error) error {
1463	c.ctx_ = ctx
1464	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1465	for {
1466		x, err := c.Do()
1467		if err != nil {
1468			return err
1469		}
1470		if err := f(x); err != nil {
1471			return err
1472		}
1473		if x.NextPageToken == "" {
1474			return nil
1475		}
1476		c.PageToken(x.NextPageToken)
1477	}
1478}
1479
1480// method id "ideahub.platforms.properties.topicStates.patch":
1481
1482type PlatformsPropertiesTopicStatesPatchCall struct {
1483	s                                    *Service
1484	nameid                               string
1485	googlesearchideahubv1alphatopicstate *GoogleSearchIdeahubV1alphaTopicState
1486	urlParams_                           gensupport.URLParams
1487	ctx_                                 context.Context
1488	header_                              http.Header
1489}
1490
1491// Patch: Update a topic state resource.
1492//
1493// - name: Unique identifier for the topic state. Format:
1494//   platforms/{platform}/properties/{property}/topicStates/{topic_state}.
1495func (r *PlatformsPropertiesTopicStatesService) Patch(nameid string, googlesearchideahubv1alphatopicstate *GoogleSearchIdeahubV1alphaTopicState) *PlatformsPropertiesTopicStatesPatchCall {
1496	c := &PlatformsPropertiesTopicStatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1497	c.nameid = nameid
1498	c.googlesearchideahubv1alphatopicstate = googlesearchideahubv1alphatopicstate
1499	return c
1500}
1501
1502// UpdateMask sets the optional parameter "updateMask": The list of
1503// fields to be updated.
1504func (c *PlatformsPropertiesTopicStatesPatchCall) UpdateMask(updateMask string) *PlatformsPropertiesTopicStatesPatchCall {
1505	c.urlParams_.Set("updateMask", updateMask)
1506	return c
1507}
1508
1509// Fields allows partial responses to be retrieved. See
1510// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1511// for more information.
1512func (c *PlatformsPropertiesTopicStatesPatchCall) Fields(s ...googleapi.Field) *PlatformsPropertiesTopicStatesPatchCall {
1513	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1514	return c
1515}
1516
1517// Context sets the context to be used in this call's Do method. Any
1518// pending HTTP request will be aborted if the provided context is
1519// canceled.
1520func (c *PlatformsPropertiesTopicStatesPatchCall) Context(ctx context.Context) *PlatformsPropertiesTopicStatesPatchCall {
1521	c.ctx_ = ctx
1522	return c
1523}
1524
1525// Header returns an http.Header that can be modified by the caller to
1526// add HTTP headers to the request.
1527func (c *PlatformsPropertiesTopicStatesPatchCall) Header() http.Header {
1528	if c.header_ == nil {
1529		c.header_ = make(http.Header)
1530	}
1531	return c.header_
1532}
1533
1534func (c *PlatformsPropertiesTopicStatesPatchCall) doRequest(alt string) (*http.Response, error) {
1535	reqHeaders := make(http.Header)
1536	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
1537	for k, v := range c.header_ {
1538		reqHeaders[k] = v
1539	}
1540	reqHeaders.Set("User-Agent", c.s.userAgent())
1541	var body io.Reader = nil
1542	body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlesearchideahubv1alphatopicstate)
1543	if err != nil {
1544		return nil, err
1545	}
1546	reqHeaders.Set("Content-Type", "application/json")
1547	c.urlParams_.Set("alt", alt)
1548	c.urlParams_.Set("prettyPrint", "false")
1549	urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha/{+name}")
1550	urls += "?" + c.urlParams_.Encode()
1551	req, err := http.NewRequest("PATCH", urls, body)
1552	if err != nil {
1553		return nil, err
1554	}
1555	req.Header = reqHeaders
1556	googleapi.Expand(req.URL, map[string]string{
1557		"name": c.nameid,
1558	})
1559	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1560}
1561
1562// Do executes the "ideahub.platforms.properties.topicStates.patch" call.
1563// Exactly one of *GoogleSearchIdeahubV1alphaTopicState or error will be
1564// non-nil. Any non-2xx status code is an error. Response headers are in
1565// either *GoogleSearchIdeahubV1alphaTopicState.ServerResponse.Header or
1566// (if a response was returned at all) in
1567// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
1568// whether the returned error was because http.StatusNotModified was
1569// returned.
1570func (c *PlatformsPropertiesTopicStatesPatchCall) Do(opts ...googleapi.CallOption) (*GoogleSearchIdeahubV1alphaTopicState, error) {
1571	gensupport.SetOptions(c.urlParams_, opts...)
1572	res, err := c.doRequest("json")
1573	if res != nil && res.StatusCode == http.StatusNotModified {
1574		if res.Body != nil {
1575			res.Body.Close()
1576		}
1577		return nil, &googleapi.Error{
1578			Code:   res.StatusCode,
1579			Header: res.Header,
1580		}
1581	}
1582	if err != nil {
1583		return nil, err
1584	}
1585	defer googleapi.CloseBody(res)
1586	if err := googleapi.CheckResponse(res); err != nil {
1587		return nil, err
1588	}
1589	ret := &GoogleSearchIdeahubV1alphaTopicState{
1590		ServerResponse: googleapi.ServerResponse{
1591			Header:         res.Header,
1592			HTTPStatusCode: res.StatusCode,
1593		},
1594	}
1595	target := &ret
1596	if err := gensupport.DecodeResponse(target, res); err != nil {
1597		return nil, err
1598	}
1599	return ret, nil
1600	// {
1601	//   "description": "Update a topic state resource.",
1602	//   "flatPath": "v1alpha/platforms/{platformsId}/properties/{propertiesId}/topicStates/{topicStatesId}",
1603	//   "httpMethod": "PATCH",
1604	//   "id": "ideahub.platforms.properties.topicStates.patch",
1605	//   "parameterOrder": [
1606	//     "name"
1607	//   ],
1608	//   "parameters": {
1609	//     "name": {
1610	//       "description": "Unique identifier for the topic state. Format: platforms/{platform}/properties/{property}/topicStates/{topic_state}",
1611	//       "location": "path",
1612	//       "pattern": "^platforms/[^/]+/properties/[^/]+/topicStates/[^/]+$",
1613	//       "required": true,
1614	//       "type": "string"
1615	//     },
1616	//     "updateMask": {
1617	//       "description": "The list of fields to be updated.",
1618	//       "format": "google-fieldmask",
1619	//       "location": "query",
1620	//       "type": "string"
1621	//     }
1622	//   },
1623	//   "path": "v1alpha/{+name}",
1624	//   "request": {
1625	//     "$ref": "GoogleSearchIdeahubV1alphaTopicState"
1626	//   },
1627	//   "response": {
1628	//     "$ref": "GoogleSearchIdeahubV1alphaTopicState"
1629	//   }
1630	// }
1631
1632}
1633