...

Source file src/google.golang.org/api/ideahub/v1alpha/ideahub-gen.go

Documentation: google.golang.org/api/ideahub/v1alpha

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

View as plain text