...

Source file src/google.golang.org/api/versionhistory/v1/versionhistory-gen.go

Documentation: google.golang.org/api/versionhistory/v1

     1  // Copyright 2024 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 versionhistory provides access to the versionhistory.googleapis.com API.
     8  //
     9  // For product documentation, see: https://developers.chrome.com/versionhistory
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/versionhistory/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	versionhistoryService, err := versionhistory.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // To use an API key for authentication (note: some APIs do not support API
    38  // keys), use [google.golang.org/api/option.WithAPIKey]:
    39  //
    40  //	versionhistoryService, err := versionhistory.NewService(ctx, option.WithAPIKey("AIza..."))
    41  //
    42  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    43  // flow, use [google.golang.org/api/option.WithTokenSource]:
    44  //
    45  //	config := &oauth2.Config{...}
    46  //	// ...
    47  //	token, err := config.Exchange(ctx, ...)
    48  //	versionhistoryService, err := versionhistory.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    49  //
    50  // See [google.golang.org/api/option.ClientOption] for details on options.
    51  package versionhistory // import "google.golang.org/api/versionhistory/v1"
    52  
    53  import (
    54  	"bytes"
    55  	"context"
    56  	"encoding/json"
    57  	"errors"
    58  	"fmt"
    59  	"io"
    60  	"net/http"
    61  	"net/url"
    62  	"strconv"
    63  	"strings"
    64  
    65  	googleapi "google.golang.org/api/googleapi"
    66  	internal "google.golang.org/api/internal"
    67  	gensupport "google.golang.org/api/internal/gensupport"
    68  	option "google.golang.org/api/option"
    69  	internaloption "google.golang.org/api/option/internaloption"
    70  	htransport "google.golang.org/api/transport/http"
    71  )
    72  
    73  // Always reference these packages, just in case the auto-generated code
    74  // below doesn't.
    75  var _ = bytes.NewBuffer
    76  var _ = strconv.Itoa
    77  var _ = fmt.Sprintf
    78  var _ = json.NewDecoder
    79  var _ = io.Copy
    80  var _ = url.Parse
    81  var _ = gensupport.MarshalJSON
    82  var _ = googleapi.Version
    83  var _ = errors.New
    84  var _ = strings.Replace
    85  var _ = context.Canceled
    86  var _ = internaloption.WithDefaultEndpoint
    87  var _ = internal.Version
    88  
    89  const apiId = "versionhistory:v1"
    90  const apiName = "versionhistory"
    91  const apiVersion = "v1"
    92  const basePath = "https://versionhistory.googleapis.com/"
    93  const basePathTemplate = "https://versionhistory.UNIVERSE_DOMAIN/"
    94  const mtlsBasePath = "https://versionhistory.mtls.googleapis.com/"
    95  
    96  // NewService creates a new Service.
    97  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    98  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
    99  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   100  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   101  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   102  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	s, err := New(client)
   107  	if err != nil {
   108  		return nil, err
   109  	}
   110  	if endpoint != "" {
   111  		s.BasePath = endpoint
   112  	}
   113  	return s, nil
   114  }
   115  
   116  // New creates a new Service. It uses the provided http.Client for requests.
   117  //
   118  // Deprecated: please use NewService instead.
   119  // To provide a custom HTTP client, use option.WithHTTPClient.
   120  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   121  func New(client *http.Client) (*Service, error) {
   122  	if client == nil {
   123  		return nil, errors.New("client is nil")
   124  	}
   125  	s := &Service{client: client, BasePath: basePath}
   126  	s.Platforms = NewPlatformsService(s)
   127  	return s, nil
   128  }
   129  
   130  type Service struct {
   131  	client    *http.Client
   132  	BasePath  string // API endpoint base URL
   133  	UserAgent string // optional additional User-Agent fragment
   134  
   135  	Platforms *PlatformsService
   136  }
   137  
   138  func (s *Service) userAgent() string {
   139  	if s.UserAgent == "" {
   140  		return googleapi.UserAgent
   141  	}
   142  	return googleapi.UserAgent + " " + s.UserAgent
   143  }
   144  
   145  func NewPlatformsService(s *Service) *PlatformsService {
   146  	rs := &PlatformsService{s: s}
   147  	rs.Channels = NewPlatformsChannelsService(s)
   148  	return rs
   149  }
   150  
   151  type PlatformsService struct {
   152  	s *Service
   153  
   154  	Channels *PlatformsChannelsService
   155  }
   156  
   157  func NewPlatformsChannelsService(s *Service) *PlatformsChannelsService {
   158  	rs := &PlatformsChannelsService{s: s}
   159  	rs.Versions = NewPlatformsChannelsVersionsService(s)
   160  	return rs
   161  }
   162  
   163  type PlatformsChannelsService struct {
   164  	s *Service
   165  
   166  	Versions *PlatformsChannelsVersionsService
   167  }
   168  
   169  func NewPlatformsChannelsVersionsService(s *Service) *PlatformsChannelsVersionsService {
   170  	rs := &PlatformsChannelsVersionsService{s: s}
   171  	rs.Releases = NewPlatformsChannelsVersionsReleasesService(s)
   172  	return rs
   173  }
   174  
   175  type PlatformsChannelsVersionsService struct {
   176  	s *Service
   177  
   178  	Releases *PlatformsChannelsVersionsReleasesService
   179  }
   180  
   181  func NewPlatformsChannelsVersionsReleasesService(s *Service) *PlatformsChannelsVersionsReleasesService {
   182  	rs := &PlatformsChannelsVersionsReleasesService{s: s}
   183  	return rs
   184  }
   185  
   186  type PlatformsChannelsVersionsReleasesService struct {
   187  	s *Service
   188  }
   189  
   190  // Channel: Each Channel is owned by a Platform and owns a collection of
   191  // versions. Possible Channels are listed in the Channel enum below. Not all
   192  // Channels are available for every Platform (e.g. CANARY does not exist for
   193  // LINUX).
   194  type Channel struct {
   195  	// ChannelType: Type of channel.
   196  	//
   197  	// Possible values:
   198  	//   "CHANNEL_TYPE_UNSPECIFIED"
   199  	//   "STABLE" - The Stable channel.
   200  	//   "BETA" - The Beta channel.
   201  	//   "DEV" - The Dev channel.
   202  	//   "CANARY" - The Canary channel.
   203  	//   "CANARY_ASAN" - The Canary channel for Chrome, with DCHECK/ASAN enabled.
   204  	//   "ALL"
   205  	//   "EXTENDED" - The Extended Stable channel for Chrome.
   206  	//   "LTS" - The Long-term support channel for ChromeOS.
   207  	//   "LTC" - The Long-term support candidate channel for ChromeOS.
   208  	ChannelType string `json:"channelType,omitempty"`
   209  	// Name: Channel name. Format is
   210  	// "{product}/platforms/{platform}/channels/{channel}"
   211  	Name string `json:"name,omitempty"`
   212  	// ForceSendFields is a list of field names (e.g. "ChannelType") to
   213  	// unconditionally include in API requests. By default, fields with empty or
   214  	// default values are omitted from API requests. See
   215  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   216  	// details.
   217  	ForceSendFields []string `json:"-"`
   218  	// NullFields is a list of field names (e.g. "ChannelType") to include in API
   219  	// requests with the JSON null value. By default, fields with empty values are
   220  	// omitted from API requests. See
   221  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   222  	NullFields []string `json:"-"`
   223  }
   224  
   225  func (s *Channel) MarshalJSON() ([]byte, error) {
   226  	type NoMethod Channel
   227  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   228  }
   229  
   230  // Interval: Represents a time interval, encoded as a Timestamp start
   231  // (inclusive) and a Timestamp end (exclusive). The start must be less than or
   232  // equal to the end. When the start equals the end, the interval is empty
   233  // (matches no time). When both start and end are unspecified, the interval
   234  // matches any time.
   235  type Interval struct {
   236  	// EndTime: Optional. Exclusive end of the interval. If specified, a Timestamp
   237  	// matching this interval will have to be before the end.
   238  	EndTime string `json:"endTime,omitempty"`
   239  	// StartTime: Optional. Inclusive start of the interval. If specified, a
   240  	// Timestamp matching this interval will have to be the same or after the
   241  	// start.
   242  	StartTime string `json:"startTime,omitempty"`
   243  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
   244  	// include in API requests. By default, fields with empty or default values are
   245  	// omitted from API requests. See
   246  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   247  	// details.
   248  	ForceSendFields []string `json:"-"`
   249  	// NullFields is a list of field names (e.g. "EndTime") to include in API
   250  	// requests with the JSON null value. By default, fields with empty values are
   251  	// omitted from API requests. See
   252  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   253  	NullFields []string `json:"-"`
   254  }
   255  
   256  func (s *Interval) MarshalJSON() ([]byte, error) {
   257  	type NoMethod Interval
   258  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   259  }
   260  
   261  // ListChannelsResponse: Response message for ListChannels.
   262  type ListChannelsResponse struct {
   263  	// Channels: The list of channels.
   264  	Channels []*Channel `json:"channels,omitempty"`
   265  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   266  	// next page. If this field is omitted, there are no subsequent pages.
   267  	NextPageToken string `json:"nextPageToken,omitempty"`
   268  
   269  	// ServerResponse contains the HTTP response code and headers from the server.
   270  	googleapi.ServerResponse `json:"-"`
   271  	// ForceSendFields is a list of field names (e.g. "Channels") to
   272  	// unconditionally include in API requests. By default, fields with empty or
   273  	// default values are omitted from API requests. See
   274  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   275  	// details.
   276  	ForceSendFields []string `json:"-"`
   277  	// NullFields is a list of field names (e.g. "Channels") to include in API
   278  	// requests with the JSON null value. By default, fields with empty values are
   279  	// omitted from API requests. See
   280  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   281  	NullFields []string `json:"-"`
   282  }
   283  
   284  func (s *ListChannelsResponse) MarshalJSON() ([]byte, error) {
   285  	type NoMethod ListChannelsResponse
   286  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   287  }
   288  
   289  // ListPlatformsResponse: Response message for ListPlatforms.
   290  type ListPlatformsResponse struct {
   291  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   292  	// next page. If this field is omitted, there are no subsequent pages.
   293  	NextPageToken string `json:"nextPageToken,omitempty"`
   294  	// Platforms: The list of platforms.
   295  	Platforms []*Platform `json:"platforms,omitempty"`
   296  
   297  	// ServerResponse contains the HTTP response code and headers from the server.
   298  	googleapi.ServerResponse `json:"-"`
   299  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   300  	// unconditionally include in API requests. By default, fields with empty or
   301  	// default values are omitted from API requests. See
   302  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   303  	// details.
   304  	ForceSendFields []string `json:"-"`
   305  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   306  	// requests with the JSON null value. By default, fields with empty values are
   307  	// omitted from API requests. See
   308  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   309  	NullFields []string `json:"-"`
   310  }
   311  
   312  func (s *ListPlatformsResponse) MarshalJSON() ([]byte, error) {
   313  	type NoMethod ListPlatformsResponse
   314  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   315  }
   316  
   317  // ListReleasesResponse: Response message for ListReleases.
   318  type ListReleasesResponse struct {
   319  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   320  	// next page. If this field is omitted, there are no subsequent pages.
   321  	NextPageToken string `json:"nextPageToken,omitempty"`
   322  	// Releases: The list of releases.
   323  	Releases []*Release `json:"releases,omitempty"`
   324  
   325  	// ServerResponse contains the HTTP response code and headers from the server.
   326  	googleapi.ServerResponse `json:"-"`
   327  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   328  	// unconditionally include in API requests. By default, fields with empty or
   329  	// default values are omitted from API requests. See
   330  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   331  	// details.
   332  	ForceSendFields []string `json:"-"`
   333  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   334  	// requests with the JSON null value. By default, fields with empty values are
   335  	// omitted from API requests. See
   336  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   337  	NullFields []string `json:"-"`
   338  }
   339  
   340  func (s *ListReleasesResponse) MarshalJSON() ([]byte, error) {
   341  	type NoMethod ListReleasesResponse
   342  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   343  }
   344  
   345  // ListVersionsResponse: Response message for ListVersions.
   346  type ListVersionsResponse struct {
   347  	// NextPageToken: A token, which can be sent as `page_token` to retrieve the
   348  	// next page. If this field is omitted, there are no subsequent pages.
   349  	NextPageToken string `json:"nextPageToken,omitempty"`
   350  	// Versions: The list of versions.
   351  	Versions []*Version `json:"versions,omitempty"`
   352  
   353  	// ServerResponse contains the HTTP response code and headers from the server.
   354  	googleapi.ServerResponse `json:"-"`
   355  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   356  	// unconditionally include in API requests. By default, fields with empty or
   357  	// default values are omitted from API requests. See
   358  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   359  	// details.
   360  	ForceSendFields []string `json:"-"`
   361  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   362  	// requests with the JSON null value. By default, fields with empty values are
   363  	// omitted from API requests. See
   364  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   365  	NullFields []string `json:"-"`
   366  }
   367  
   368  func (s *ListVersionsResponse) MarshalJSON() ([]byte, error) {
   369  	type NoMethod ListVersionsResponse
   370  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   371  }
   372  
   373  // Platform: Each Platform is owned by a Product and owns a collection of
   374  // channels. Available platforms are listed in Platform enum below. Not all
   375  // Channels are available for every Platform (e.g. CANARY does not exist for
   376  // LINUX).
   377  type Platform struct {
   378  	// Name: Platform name. Format is "{product}/platforms/{platform}"
   379  	Name string `json:"name,omitempty"`
   380  	// PlatformType: Type of platform.
   381  	//
   382  	// Possible values:
   383  	//   "PLATFORM_TYPE_UNSPECIFIED"
   384  	//   "WIN" - Chrome Desktop for Windows (32-bit).
   385  	//   "WIN64" - Chrome Desktop for Windows (x86_64).
   386  	//   "MAC" - Chrome Desktop for macOS (x86_64).
   387  	//   "LINUX" - Chrome Desktop for Linux.
   388  	//   "ANDROID" - Chrome for Android.
   389  	//   "WEBVIEW" - WebView for Android.
   390  	//   "IOS" - Chrome for iOS.
   391  	//   "ALL"
   392  	//   "MAC_ARM64" - Chrome for macOS (ARM64).
   393  	//   "LACROS" - ChromeOS Lacros (x86_64).
   394  	//   "LACROS_ARM32" - ChromeOS Lacros (ARM).
   395  	//   "CHROMEOS" - ChromeOS.
   396  	//   "LACROS_ARM64" - ChromeOS Lacros (ARM64).
   397  	//   "FUCHSIA" - Chrome for Fuchsia.
   398  	//   "WIN_ARM64" - Chrome Desktop for Windows (ARM64).
   399  	PlatformType string `json:"platformType,omitempty"`
   400  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   401  	// include in API requests. By default, fields with empty or default values are
   402  	// omitted from API requests. See
   403  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   404  	// details.
   405  	ForceSendFields []string `json:"-"`
   406  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   407  	// with the JSON null value. By default, fields with empty values are omitted
   408  	// from API requests. See
   409  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   410  	NullFields []string `json:"-"`
   411  }
   412  
   413  func (s *Platform) MarshalJSON() ([]byte, error) {
   414  	type NoMethod Platform
   415  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   416  }
   417  
   418  // Release: A Release is owned by a Version. A Release contains information
   419  // about the release(s) of its parent version. This includes when the release
   420  // began and ended, as well as what percentage it was released at. If the
   421  // version is released again, or if the serving percentage changes, it will
   422  // create another release under the version.
   423  type Release struct {
   424  	// Fraction: Rollout fraction. This fraction indicates the fraction of people
   425  	// that should receive this version in this release. If the fraction is not
   426  	// specified in ReleaseManager, the API will assume fraction is 1.
   427  	Fraction float64 `json:"fraction,omitempty"`
   428  	// FractionGroup: Rollout fraction group. Only fractions with the same
   429  	// fraction_group are statistically comparable: there may be non-fractional
   430  	// differences between different fraction groups.
   431  	FractionGroup int64 `json:"fractionGroup,omitempty,string"`
   432  	// Name: Release name. Format is
   433  	// "{product}/platforms/{platform}/channels/{channel}/versions/{version}/release
   434  	// s/{release}"
   435  	Name string `json:"name,omitempty"`
   436  	// Serving: Timestamp interval of when the release was live. If end_time is
   437  	// unspecified, the release is currently live.
   438  	Serving *Interval `json:"serving,omitempty"`
   439  	// Version: String containing just the version number. e.g. "84.0.4147.38"
   440  	Version string `json:"version,omitempty"`
   441  	// ForceSendFields is a list of field names (e.g. "Fraction") to
   442  	// unconditionally include in API requests. By default, fields with empty or
   443  	// default values are omitted from API requests. See
   444  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   445  	// details.
   446  	ForceSendFields []string `json:"-"`
   447  	// NullFields is a list of field names (e.g. "Fraction") to include in API
   448  	// requests with the JSON null value. By default, fields with empty values are
   449  	// omitted from API requests. See
   450  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   451  	NullFields []string `json:"-"`
   452  }
   453  
   454  func (s *Release) MarshalJSON() ([]byte, error) {
   455  	type NoMethod Release
   456  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   457  }
   458  
   459  func (s *Release) UnmarshalJSON(data []byte) error {
   460  	type NoMethod Release
   461  	var s1 struct {
   462  		Fraction gensupport.JSONFloat64 `json:"fraction"`
   463  		*NoMethod
   464  	}
   465  	s1.NoMethod = (*NoMethod)(s)
   466  	if err := json.Unmarshal(data, &s1); err != nil {
   467  		return err
   468  	}
   469  	s.Fraction = float64(s1.Fraction)
   470  	return nil
   471  }
   472  
   473  // Version: Each Version is owned by a Channel. A Version only displays the
   474  // Version number (e.g. 84.0.4147.38). A Version owns a collection of releases.
   475  type Version struct {
   476  	// Name: Version name. Format is
   477  	// "{product}/platforms/{platform}/channels/{channel}/versions/{version}" e.g.
   478  	// "chrome/platforms/win/channels/beta/versions/84.0.4147.38"
   479  	Name string `json:"name,omitempty"`
   480  	// Version: String containing just the version number. e.g. "84.0.4147.38"
   481  	Version string `json:"version,omitempty"`
   482  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   483  	// include in API requests. By default, fields with empty or default values are
   484  	// omitted from API requests. See
   485  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   486  	// details.
   487  	ForceSendFields []string `json:"-"`
   488  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   489  	// with the JSON null value. By default, fields with empty values are omitted
   490  	// from API requests. See
   491  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   492  	NullFields []string `json:"-"`
   493  }
   494  
   495  func (s *Version) MarshalJSON() ([]byte, error) {
   496  	type NoMethod Version
   497  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   498  }
   499  
   500  type PlatformsListCall struct {
   501  	s            *Service
   502  	parent       string
   503  	urlParams_   gensupport.URLParams
   504  	ifNoneMatch_ string
   505  	ctx_         context.Context
   506  	header_      http.Header
   507  }
   508  
   509  // List: Returns list of platforms that are available for a given product. The
   510  // resource "product" has no resource name in its name.
   511  //
   512  //   - parent: The product, which owns this collection of platforms. Format:
   513  //     {product}.
   514  func (r *PlatformsService) List(parent string) *PlatformsListCall {
   515  	c := &PlatformsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   516  	c.parent = parent
   517  	return c
   518  }
   519  
   520  // PageSize sets the optional parameter "pageSize": Optional limit on the
   521  // number of channels to include in the response. If unspecified, the server
   522  // will pick an appropriate default.
   523  func (c *PlatformsListCall) PageSize(pageSize int64) *PlatformsListCall {
   524  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   525  	return c
   526  }
   527  
   528  // PageToken sets the optional parameter "pageToken": A page token, received
   529  // from a previous `ListChannels` call. Provide this to retrieve the subsequent
   530  // page.
   531  func (c *PlatformsListCall) PageToken(pageToken string) *PlatformsListCall {
   532  	c.urlParams_.Set("pageToken", pageToken)
   533  	return c
   534  }
   535  
   536  // Fields allows partial responses to be retrieved. See
   537  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   538  // details.
   539  func (c *PlatformsListCall) Fields(s ...googleapi.Field) *PlatformsListCall {
   540  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   541  	return c
   542  }
   543  
   544  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   545  // object's ETag matches the given value. This is useful for getting updates
   546  // only after the object has changed since the last request.
   547  func (c *PlatformsListCall) IfNoneMatch(entityTag string) *PlatformsListCall {
   548  	c.ifNoneMatch_ = entityTag
   549  	return c
   550  }
   551  
   552  // Context sets the context to be used in this call's Do method.
   553  func (c *PlatformsListCall) Context(ctx context.Context) *PlatformsListCall {
   554  	c.ctx_ = ctx
   555  	return c
   556  }
   557  
   558  // Header returns a http.Header that can be modified by the caller to add
   559  // headers to the request.
   560  func (c *PlatformsListCall) Header() http.Header {
   561  	if c.header_ == nil {
   562  		c.header_ = make(http.Header)
   563  	}
   564  	return c.header_
   565  }
   566  
   567  func (c *PlatformsListCall) doRequest(alt string) (*http.Response, error) {
   568  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   569  	if c.ifNoneMatch_ != "" {
   570  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   571  	}
   572  	var body io.Reader = nil
   573  	c.urlParams_.Set("alt", alt)
   574  	c.urlParams_.Set("prettyPrint", "false")
   575  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/platforms")
   576  	urls += "?" + c.urlParams_.Encode()
   577  	req, err := http.NewRequest("GET", urls, body)
   578  	if err != nil {
   579  		return nil, err
   580  	}
   581  	req.Header = reqHeaders
   582  	googleapi.Expand(req.URL, map[string]string{
   583  		"parent": c.parent,
   584  	})
   585  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   586  }
   587  
   588  // Do executes the "versionhistory.platforms.list" call.
   589  // Any non-2xx status code is an error. Response headers are in either
   590  // *ListPlatformsResponse.ServerResponse.Header or (if a response was returned
   591  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   592  // check whether the returned error was because http.StatusNotModified was
   593  // returned.
   594  func (c *PlatformsListCall) Do(opts ...googleapi.CallOption) (*ListPlatformsResponse, error) {
   595  	gensupport.SetOptions(c.urlParams_, opts...)
   596  	res, err := c.doRequest("json")
   597  	if res != nil && res.StatusCode == http.StatusNotModified {
   598  		if res.Body != nil {
   599  			res.Body.Close()
   600  		}
   601  		return nil, gensupport.WrapError(&googleapi.Error{
   602  			Code:   res.StatusCode,
   603  			Header: res.Header,
   604  		})
   605  	}
   606  	if err != nil {
   607  		return nil, err
   608  	}
   609  	defer googleapi.CloseBody(res)
   610  	if err := googleapi.CheckResponse(res); err != nil {
   611  		return nil, gensupport.WrapError(err)
   612  	}
   613  	ret := &ListPlatformsResponse{
   614  		ServerResponse: googleapi.ServerResponse{
   615  			Header:         res.Header,
   616  			HTTPStatusCode: res.StatusCode,
   617  		},
   618  	}
   619  	target := &ret
   620  	if err := gensupport.DecodeResponse(target, res); err != nil {
   621  		return nil, err
   622  	}
   623  	return ret, nil
   624  }
   625  
   626  // Pages invokes f for each page of results.
   627  // A non-nil error returned from f will halt the iteration.
   628  // The provided context supersedes any context provided to the Context method.
   629  func (c *PlatformsListCall) Pages(ctx context.Context, f func(*ListPlatformsResponse) error) error {
   630  	c.ctx_ = ctx
   631  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   632  	for {
   633  		x, err := c.Do()
   634  		if err != nil {
   635  			return err
   636  		}
   637  		if err := f(x); err != nil {
   638  			return err
   639  		}
   640  		if x.NextPageToken == "" {
   641  			return nil
   642  		}
   643  		c.PageToken(x.NextPageToken)
   644  	}
   645  }
   646  
   647  type PlatformsChannelsListCall struct {
   648  	s            *Service
   649  	parent       string
   650  	urlParams_   gensupport.URLParams
   651  	ifNoneMatch_ string
   652  	ctx_         context.Context
   653  	header_      http.Header
   654  }
   655  
   656  // List: Returns list of channels that are available for a given platform.
   657  //
   658  //   - parent: The platform, which owns this collection of channels. Format:
   659  //     {product}/platforms/{platform}.
   660  func (r *PlatformsChannelsService) List(parent string) *PlatformsChannelsListCall {
   661  	c := &PlatformsChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   662  	c.parent = parent
   663  	return c
   664  }
   665  
   666  // PageSize sets the optional parameter "pageSize": Optional limit on the
   667  // number of channels to include in the response. If unspecified, the server
   668  // will pick an appropriate default.
   669  func (c *PlatformsChannelsListCall) PageSize(pageSize int64) *PlatformsChannelsListCall {
   670  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   671  	return c
   672  }
   673  
   674  // PageToken sets the optional parameter "pageToken": A page token, received
   675  // from a previous `ListChannels` call. Provide this to retrieve the subsequent
   676  // page.
   677  func (c *PlatformsChannelsListCall) PageToken(pageToken string) *PlatformsChannelsListCall {
   678  	c.urlParams_.Set("pageToken", pageToken)
   679  	return c
   680  }
   681  
   682  // Fields allows partial responses to be retrieved. See
   683  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   684  // details.
   685  func (c *PlatformsChannelsListCall) Fields(s ...googleapi.Field) *PlatformsChannelsListCall {
   686  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   687  	return c
   688  }
   689  
   690  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   691  // object's ETag matches the given value. This is useful for getting updates
   692  // only after the object has changed since the last request.
   693  func (c *PlatformsChannelsListCall) IfNoneMatch(entityTag string) *PlatformsChannelsListCall {
   694  	c.ifNoneMatch_ = entityTag
   695  	return c
   696  }
   697  
   698  // Context sets the context to be used in this call's Do method.
   699  func (c *PlatformsChannelsListCall) Context(ctx context.Context) *PlatformsChannelsListCall {
   700  	c.ctx_ = ctx
   701  	return c
   702  }
   703  
   704  // Header returns a http.Header that can be modified by the caller to add
   705  // headers to the request.
   706  func (c *PlatformsChannelsListCall) Header() http.Header {
   707  	if c.header_ == nil {
   708  		c.header_ = make(http.Header)
   709  	}
   710  	return c.header_
   711  }
   712  
   713  func (c *PlatformsChannelsListCall) doRequest(alt string) (*http.Response, error) {
   714  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   715  	if c.ifNoneMatch_ != "" {
   716  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   717  	}
   718  	var body io.Reader = nil
   719  	c.urlParams_.Set("alt", alt)
   720  	c.urlParams_.Set("prettyPrint", "false")
   721  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/channels")
   722  	urls += "?" + c.urlParams_.Encode()
   723  	req, err := http.NewRequest("GET", urls, body)
   724  	if err != nil {
   725  		return nil, err
   726  	}
   727  	req.Header = reqHeaders
   728  	googleapi.Expand(req.URL, map[string]string{
   729  		"parent": c.parent,
   730  	})
   731  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   732  }
   733  
   734  // Do executes the "versionhistory.platforms.channels.list" call.
   735  // Any non-2xx status code is an error. Response headers are in either
   736  // *ListChannelsResponse.ServerResponse.Header or (if a response was returned
   737  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   738  // check whether the returned error was because http.StatusNotModified was
   739  // returned.
   740  func (c *PlatformsChannelsListCall) Do(opts ...googleapi.CallOption) (*ListChannelsResponse, error) {
   741  	gensupport.SetOptions(c.urlParams_, opts...)
   742  	res, err := c.doRequest("json")
   743  	if res != nil && res.StatusCode == http.StatusNotModified {
   744  		if res.Body != nil {
   745  			res.Body.Close()
   746  		}
   747  		return nil, gensupport.WrapError(&googleapi.Error{
   748  			Code:   res.StatusCode,
   749  			Header: res.Header,
   750  		})
   751  	}
   752  	if err != nil {
   753  		return nil, err
   754  	}
   755  	defer googleapi.CloseBody(res)
   756  	if err := googleapi.CheckResponse(res); err != nil {
   757  		return nil, gensupport.WrapError(err)
   758  	}
   759  	ret := &ListChannelsResponse{
   760  		ServerResponse: googleapi.ServerResponse{
   761  			Header:         res.Header,
   762  			HTTPStatusCode: res.StatusCode,
   763  		},
   764  	}
   765  	target := &ret
   766  	if err := gensupport.DecodeResponse(target, res); err != nil {
   767  		return nil, err
   768  	}
   769  	return ret, nil
   770  }
   771  
   772  // Pages invokes f for each page of results.
   773  // A non-nil error returned from f will halt the iteration.
   774  // The provided context supersedes any context provided to the Context method.
   775  func (c *PlatformsChannelsListCall) Pages(ctx context.Context, f func(*ListChannelsResponse) error) error {
   776  	c.ctx_ = ctx
   777  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   778  	for {
   779  		x, err := c.Do()
   780  		if err != nil {
   781  			return err
   782  		}
   783  		if err := f(x); err != nil {
   784  			return err
   785  		}
   786  		if x.NextPageToken == "" {
   787  			return nil
   788  		}
   789  		c.PageToken(x.NextPageToken)
   790  	}
   791  }
   792  
   793  type PlatformsChannelsVersionsListCall struct {
   794  	s            *Service
   795  	parent       string
   796  	urlParams_   gensupport.URLParams
   797  	ifNoneMatch_ string
   798  	ctx_         context.Context
   799  	header_      http.Header
   800  }
   801  
   802  // List: Returns list of version for the given platform/channel.
   803  //
   804  //   - parent: The channel, which owns this collection of versions. Format:
   805  //     {product}/platforms/{platform}/channels/{channel}.
   806  func (r *PlatformsChannelsVersionsService) List(parent string) *PlatformsChannelsVersionsListCall {
   807  	c := &PlatformsChannelsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   808  	c.parent = parent
   809  	return c
   810  }
   811  
   812  // Filter sets the optional parameter "filter": Filter string. Format is a
   813  // comma separated list of All comma separated filter clauses are conjoined
   814  // with a logical "and". Valid field_names are "version", "name", "platform",
   815  // and "channel". Valid operators are "<", "<=", "=", ">=", and ">". Channel
   816  // comparison is done by distance from stable. Ex) stable < beta, beta < dev,
   817  // canary < canary_asan. Version comparison is done numerically. If version is
   818  // not entirely written, the version will be appended with 0 in missing fields.
   819  // Ex) version > 80 becoms version > 80.0.0.0 Name and platform are filtered by
   820  // string comparison. Ex) "...?filter=channel<=beta, version >= 80 Ex)
   821  // "...?filter=version > 80, version < 81
   822  func (c *PlatformsChannelsVersionsListCall) Filter(filter string) *PlatformsChannelsVersionsListCall {
   823  	c.urlParams_.Set("filter", filter)
   824  	return c
   825  }
   826  
   827  // OrderBy sets the optional parameter "orderBy": Ordering string. Valid
   828  // order_by strings are "version", "name", "platform", and "channel".
   829  // Optionally, you can append " desc" or " asc" to specify the sorting order.
   830  // Multiple order_by strings can be used in a comma separated list. Ordering by
   831  // channel will sort by distance from the stable channel (not alphabetically).
   832  // A list of channels sorted in this order is: stable, beta, dev, canary, and
   833  // canary_asan. Sorting by name may cause unexpected behaviour as it is a naive
   834  // string sort. For example, 1.0.0.8 will be before 1.0.0.10 in descending
   835  // order. If order_by is not specified the response will be sorted by version
   836  // in descending order. Ex) "...?order_by=version asc" Ex)
   837  // "...?order_by=platform desc, channel, version"
   838  func (c *PlatformsChannelsVersionsListCall) OrderBy(orderBy string) *PlatformsChannelsVersionsListCall {
   839  	c.urlParams_.Set("orderBy", orderBy)
   840  	return c
   841  }
   842  
   843  // PageSize sets the optional parameter "pageSize": Optional limit on the
   844  // number of versions to include in the response. If unspecified, the server
   845  // will pick an appropriate default.
   846  func (c *PlatformsChannelsVersionsListCall) PageSize(pageSize int64) *PlatformsChannelsVersionsListCall {
   847  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
   848  	return c
   849  }
   850  
   851  // PageToken sets the optional parameter "pageToken": A page token, received
   852  // from a previous `ListVersions` call. Provide this to retrieve the subsequent
   853  // page.
   854  func (c *PlatformsChannelsVersionsListCall) PageToken(pageToken string) *PlatformsChannelsVersionsListCall {
   855  	c.urlParams_.Set("pageToken", pageToken)
   856  	return c
   857  }
   858  
   859  // Fields allows partial responses to be retrieved. See
   860  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
   861  // details.
   862  func (c *PlatformsChannelsVersionsListCall) Fields(s ...googleapi.Field) *PlatformsChannelsVersionsListCall {
   863  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   864  	return c
   865  }
   866  
   867  // IfNoneMatch sets an optional parameter which makes the operation fail if the
   868  // object's ETag matches the given value. This is useful for getting updates
   869  // only after the object has changed since the last request.
   870  func (c *PlatformsChannelsVersionsListCall) IfNoneMatch(entityTag string) *PlatformsChannelsVersionsListCall {
   871  	c.ifNoneMatch_ = entityTag
   872  	return c
   873  }
   874  
   875  // Context sets the context to be used in this call's Do method.
   876  func (c *PlatformsChannelsVersionsListCall) Context(ctx context.Context) *PlatformsChannelsVersionsListCall {
   877  	c.ctx_ = ctx
   878  	return c
   879  }
   880  
   881  // Header returns a http.Header that can be modified by the caller to add
   882  // headers to the request.
   883  func (c *PlatformsChannelsVersionsListCall) Header() http.Header {
   884  	if c.header_ == nil {
   885  		c.header_ = make(http.Header)
   886  	}
   887  	return c.header_
   888  }
   889  
   890  func (c *PlatformsChannelsVersionsListCall) doRequest(alt string) (*http.Response, error) {
   891  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
   892  	if c.ifNoneMatch_ != "" {
   893  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   894  	}
   895  	var body io.Reader = nil
   896  	c.urlParams_.Set("alt", alt)
   897  	c.urlParams_.Set("prettyPrint", "false")
   898  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/versions")
   899  	urls += "?" + c.urlParams_.Encode()
   900  	req, err := http.NewRequest("GET", urls, body)
   901  	if err != nil {
   902  		return nil, err
   903  	}
   904  	req.Header = reqHeaders
   905  	googleapi.Expand(req.URL, map[string]string{
   906  		"parent": c.parent,
   907  	})
   908  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   909  }
   910  
   911  // Do executes the "versionhistory.platforms.channels.versions.list" call.
   912  // Any non-2xx status code is an error. Response headers are in either
   913  // *ListVersionsResponse.ServerResponse.Header or (if a response was returned
   914  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
   915  // check whether the returned error was because http.StatusNotModified was
   916  // returned.
   917  func (c *PlatformsChannelsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListVersionsResponse, error) {
   918  	gensupport.SetOptions(c.urlParams_, opts...)
   919  	res, err := c.doRequest("json")
   920  	if res != nil && res.StatusCode == http.StatusNotModified {
   921  		if res.Body != nil {
   922  			res.Body.Close()
   923  		}
   924  		return nil, gensupport.WrapError(&googleapi.Error{
   925  			Code:   res.StatusCode,
   926  			Header: res.Header,
   927  		})
   928  	}
   929  	if err != nil {
   930  		return nil, err
   931  	}
   932  	defer googleapi.CloseBody(res)
   933  	if err := googleapi.CheckResponse(res); err != nil {
   934  		return nil, gensupport.WrapError(err)
   935  	}
   936  	ret := &ListVersionsResponse{
   937  		ServerResponse: googleapi.ServerResponse{
   938  			Header:         res.Header,
   939  			HTTPStatusCode: res.StatusCode,
   940  		},
   941  	}
   942  	target := &ret
   943  	if err := gensupport.DecodeResponse(target, res); err != nil {
   944  		return nil, err
   945  	}
   946  	return ret, nil
   947  }
   948  
   949  // Pages invokes f for each page of results.
   950  // A non-nil error returned from f will halt the iteration.
   951  // The provided context supersedes any context provided to the Context method.
   952  func (c *PlatformsChannelsVersionsListCall) Pages(ctx context.Context, f func(*ListVersionsResponse) error) error {
   953  	c.ctx_ = ctx
   954  	defer c.PageToken(c.urlParams_.Get("pageToken"))
   955  	for {
   956  		x, err := c.Do()
   957  		if err != nil {
   958  			return err
   959  		}
   960  		if err := f(x); err != nil {
   961  			return err
   962  		}
   963  		if x.NextPageToken == "" {
   964  			return nil
   965  		}
   966  		c.PageToken(x.NextPageToken)
   967  	}
   968  }
   969  
   970  type PlatformsChannelsVersionsReleasesListCall struct {
   971  	s            *Service
   972  	parent       string
   973  	urlParams_   gensupport.URLParams
   974  	ifNoneMatch_ string
   975  	ctx_         context.Context
   976  	header_      http.Header
   977  }
   978  
   979  // List: Returns list of releases of the given version.
   980  //
   981  //   - parent: The version, which owns this collection of releases. Format:
   982  //     {product}/platforms/{platform}/channels/{channel}/versions/{version}.
   983  func (r *PlatformsChannelsVersionsReleasesService) List(parent string) *PlatformsChannelsVersionsReleasesListCall {
   984  	c := &PlatformsChannelsVersionsReleasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
   985  	c.parent = parent
   986  	return c
   987  }
   988  
   989  // Filter sets the optional parameter "filter": Filter string. Format is a
   990  // comma separated list of All comma separated filter clauses are conjoined
   991  // with a logical "and". Valid field_names are "version", "name", "platform",
   992  // "channel", "fraction" "starttime", and "endtime". Valid operators are "<",
   993  // "<=", "=", ">=", and ">". Channel comparison is done by distance from
   994  // stable. must be a valid channel when filtering by channel. Ex) stable <
   995  // beta, beta < dev, canary < canary_asan. Version comparison is done
   996  // numerically. Ex) 1.0.0.8 < 1.0.0.10. If version is not entirely written, the
   997  // version will be appended with 0 for the missing fields. Ex) version > 80
   998  // becoms version > 80.0.0.0 When filtering by starttime or endtime, string
   999  // must be in RFC 3339 date string format. Name and platform are filtered by
  1000  // string comparison. Ex) "...?filter=channel<=beta, version >= 80 Ex)
  1001  // "...?filter=version > 80, version < 81 Ex)
  1002  // "...?filter=starttime>2020-01-01T00:00:00Z
  1003  func (c *PlatformsChannelsVersionsReleasesListCall) Filter(filter string) *PlatformsChannelsVersionsReleasesListCall {
  1004  	c.urlParams_.Set("filter", filter)
  1005  	return c
  1006  }
  1007  
  1008  // OrderBy sets the optional parameter "orderBy": Ordering string. Valid
  1009  // order_by strings are "version", "name", "starttime", "endtime", "platform",
  1010  // "channel", and "fraction". Optionally, you can append "desc" or "asc" to
  1011  // specify the sorting order. Multiple order_by strings can be used in a comma
  1012  // separated list. Ordering by channel will sort by distance from the stable
  1013  // channel (not alphabetically). A list of channels sorted in this order is:
  1014  // stable, beta, dev, canary, and canary_asan. Sorting by name may cause
  1015  // unexpected behaviour as it is a naive string sort. For example, 1.0.0.8 will
  1016  // be before 1.0.0.10 in descending order. If order_by is not specified the
  1017  // response will be sorted by starttime in descending order. Ex)
  1018  // "...?order_by=starttime asc" Ex) "...?order_by=platform desc, channel,
  1019  // startime desc"
  1020  func (c *PlatformsChannelsVersionsReleasesListCall) OrderBy(orderBy string) *PlatformsChannelsVersionsReleasesListCall {
  1021  	c.urlParams_.Set("orderBy", orderBy)
  1022  	return c
  1023  }
  1024  
  1025  // PageSize sets the optional parameter "pageSize": Optional limit on the
  1026  // number of releases to include in the response. If unspecified, the server
  1027  // will pick an appropriate default.
  1028  func (c *PlatformsChannelsVersionsReleasesListCall) PageSize(pageSize int64) *PlatformsChannelsVersionsReleasesListCall {
  1029  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1030  	return c
  1031  }
  1032  
  1033  // PageToken sets the optional parameter "pageToken": A page token, received
  1034  // from a previous `ListReleases` call. Provide this to retrieve the subsequent
  1035  // page.
  1036  func (c *PlatformsChannelsVersionsReleasesListCall) PageToken(pageToken string) *PlatformsChannelsVersionsReleasesListCall {
  1037  	c.urlParams_.Set("pageToken", pageToken)
  1038  	return c
  1039  }
  1040  
  1041  // Fields allows partial responses to be retrieved. See
  1042  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1043  // details.
  1044  func (c *PlatformsChannelsVersionsReleasesListCall) Fields(s ...googleapi.Field) *PlatformsChannelsVersionsReleasesListCall {
  1045  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1046  	return c
  1047  }
  1048  
  1049  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1050  // object's ETag matches the given value. This is useful for getting updates
  1051  // only after the object has changed since the last request.
  1052  func (c *PlatformsChannelsVersionsReleasesListCall) IfNoneMatch(entityTag string) *PlatformsChannelsVersionsReleasesListCall {
  1053  	c.ifNoneMatch_ = entityTag
  1054  	return c
  1055  }
  1056  
  1057  // Context sets the context to be used in this call's Do method.
  1058  func (c *PlatformsChannelsVersionsReleasesListCall) Context(ctx context.Context) *PlatformsChannelsVersionsReleasesListCall {
  1059  	c.ctx_ = ctx
  1060  	return c
  1061  }
  1062  
  1063  // Header returns a http.Header that can be modified by the caller to add
  1064  // headers to the request.
  1065  func (c *PlatformsChannelsVersionsReleasesListCall) Header() http.Header {
  1066  	if c.header_ == nil {
  1067  		c.header_ = make(http.Header)
  1068  	}
  1069  	return c.header_
  1070  }
  1071  
  1072  func (c *PlatformsChannelsVersionsReleasesListCall) doRequest(alt string) (*http.Response, error) {
  1073  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1074  	if c.ifNoneMatch_ != "" {
  1075  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1076  	}
  1077  	var body io.Reader = nil
  1078  	c.urlParams_.Set("alt", alt)
  1079  	c.urlParams_.Set("prettyPrint", "false")
  1080  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/releases")
  1081  	urls += "?" + c.urlParams_.Encode()
  1082  	req, err := http.NewRequest("GET", urls, body)
  1083  	if err != nil {
  1084  		return nil, err
  1085  	}
  1086  	req.Header = reqHeaders
  1087  	googleapi.Expand(req.URL, map[string]string{
  1088  		"parent": c.parent,
  1089  	})
  1090  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1091  }
  1092  
  1093  // Do executes the "versionhistory.platforms.channels.versions.releases.list" call.
  1094  // Any non-2xx status code is an error. Response headers are in either
  1095  // *ListReleasesResponse.ServerResponse.Header or (if a response was returned
  1096  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1097  // check whether the returned error was because http.StatusNotModified was
  1098  // returned.
  1099  func (c *PlatformsChannelsVersionsReleasesListCall) Do(opts ...googleapi.CallOption) (*ListReleasesResponse, error) {
  1100  	gensupport.SetOptions(c.urlParams_, opts...)
  1101  	res, err := c.doRequest("json")
  1102  	if res != nil && res.StatusCode == http.StatusNotModified {
  1103  		if res.Body != nil {
  1104  			res.Body.Close()
  1105  		}
  1106  		return nil, gensupport.WrapError(&googleapi.Error{
  1107  			Code:   res.StatusCode,
  1108  			Header: res.Header,
  1109  		})
  1110  	}
  1111  	if err != nil {
  1112  		return nil, err
  1113  	}
  1114  	defer googleapi.CloseBody(res)
  1115  	if err := googleapi.CheckResponse(res); err != nil {
  1116  		return nil, gensupport.WrapError(err)
  1117  	}
  1118  	ret := &ListReleasesResponse{
  1119  		ServerResponse: googleapi.ServerResponse{
  1120  			Header:         res.Header,
  1121  			HTTPStatusCode: res.StatusCode,
  1122  		},
  1123  	}
  1124  	target := &ret
  1125  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1126  		return nil, err
  1127  	}
  1128  	return ret, nil
  1129  }
  1130  
  1131  // Pages invokes f for each page of results.
  1132  // A non-nil error returned from f will halt the iteration.
  1133  // The provided context supersedes any context provided to the Context method.
  1134  func (c *PlatformsChannelsVersionsReleasesListCall) Pages(ctx context.Context, f func(*ListReleasesResponse) error) error {
  1135  	c.ctx_ = ctx
  1136  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1137  	for {
  1138  		x, err := c.Do()
  1139  		if err != nil {
  1140  			return err
  1141  		}
  1142  		if err := f(x); err != nil {
  1143  			return err
  1144  		}
  1145  		if x.NextPageToken == "" {
  1146  			return nil
  1147  		}
  1148  		c.PageToken(x.NextPageToken)
  1149  	}
  1150  }
  1151  

View as plain text