...

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

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

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

View as plain text