go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/common/api/luci_config/config/v1/config-gen.go (about)

     1  // Copyright 2023 The LUCI Authors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated file. DO NOT EDIT.
    16  
    17  // Package config provides access to the Configuration Service.
    18  //
    19  // # Creating a client
    20  //
    21  // Usage example:
    22  //
    23  //	import "go.chromium.org/luci/common/api/luci_config/config/v1"
    24  //	...
    25  //	ctx := context.Background()
    26  //	configService, err := config.NewService(ctx)
    27  //
    28  // In this example, Google Application Default Credentials are used for authentication.
    29  //
    30  // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    31  //
    32  // # Other authentication options
    33  //
    34  // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
    35  //
    36  //	configService, err := config.NewService(ctx, option.WithAPIKey("AIza..."))
    37  //
    38  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
    39  //
    40  //	config := &oauth2.Config{...}
    41  //	// ...
    42  //	token, err := config.Exchange(ctx, ...)
    43  //	configService, err := config.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    44  //
    45  // See https://godoc.org/google.golang.org/api/option/ for details on options.
    46  package config // import "go.chromium.org/luci/common/api/luci_config/config/v1"
    47  
    48  import (
    49  	"bytes"
    50  	"context"
    51  	"encoding/json"
    52  	"errors"
    53  	"fmt"
    54  	"io"
    55  	"net/http"
    56  	"net/url"
    57  	"strconv"
    58  	"strings"
    59  
    60  	googleapi "google.golang.org/api/googleapi"
    61  	gensupport "go.chromium.org/luci/common/api/internal/gensupport"
    62  	option "google.golang.org/api/option"
    63  	internaloption "google.golang.org/api/option/internaloption"
    64  	htransport "google.golang.org/api/transport/http"
    65  )
    66  
    67  // Always reference these packages, just in case the auto-generated code
    68  // below doesn't.
    69  var _ = bytes.NewBuffer
    70  var _ = strconv.Itoa
    71  var _ = fmt.Sprintf
    72  var _ = json.NewDecoder
    73  var _ = io.Copy
    74  var _ = url.Parse
    75  var _ = gensupport.MarshalJSON
    76  var _ = googleapi.Version
    77  var _ = errors.New
    78  var _ = strings.Replace
    79  var _ = context.Canceled
    80  var _ = internaloption.WithDefaultEndpoint
    81  var _ = "luci-go"
    82  
    83  const apiId = "config:v1"
    84  const apiName = "config"
    85  const apiVersion = "v1"
    86  const basePath = "http://localhost:8080/_ah/api/config/v1"
    87  
    88  // OAuth2 scopes used by this API.
    89  const (
    90  	// https://www.googleapis.com/auth/userinfo.email
    91  	UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
    92  )
    93  
    94  // NewService creates a new Service.
    95  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
    96  	scopesOption := internaloption.WithDefaultScopes(
    97  		"https://www.googleapis.com/auth/userinfo.email",
    98  	)
    99  	// NOTE: prepend, so we don't override user-specified scopes.
   100  	opts = append([]option.ClientOption{scopesOption}, opts...)
   101  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   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  	return s, nil
   127  }
   128  
   129  type Service struct {
   130  	client    *http.Client
   131  	BasePath  string // API endpoint base URL
   132  	UserAgent string // optional additional User-Agent fragment
   133  }
   134  
   135  func (s *Service) userAgent() string {
   136  	if s.UserAgent == "" {
   137  		return googleapi.UserAgent
   138  	}
   139  	return googleapi.UserAgent + " " + s.UserAgent
   140  }
   141  
   142  type ComponentsConfigEndpointValidationMessage struct {
   143  	Path string `json:"path,omitempty"`
   144  
   145  	// Possible values:
   146  	//   "CRITICAL"
   147  	//   "DEBUG"
   148  	//   "ERROR"
   149  	//   "INFO"
   150  	//   "WARNING"
   151  	Severity string `json:"severity,omitempty"`
   152  
   153  	Text string `json:"text,omitempty"`
   154  
   155  	// ForceSendFields is a list of field names (e.g. "Path") to
   156  	// unconditionally include in API requests. By default, fields with
   157  	// empty or default values are omitted from API requests. However, any
   158  	// non-pointer, non-interface field appearing in ForceSendFields will be
   159  	// sent to the server regardless of whether the field is empty or not.
   160  	// This may be used to include empty fields in Patch requests.
   161  	ForceSendFields []string `json:"-"`
   162  
   163  	// NullFields is a list of field names (e.g. "Path") to include in API
   164  	// requests with the JSON null value. By default, fields with empty
   165  	// values are omitted from API requests. However, any field with an
   166  	// empty value appearing in NullFields will be sent to the server as
   167  	// null. It is an error if a field in this list has a non-empty value.
   168  	// This may be used to include null fields in Patch requests.
   169  	NullFields []string `json:"-"`
   170  }
   171  
   172  func (s *ComponentsConfigEndpointValidationMessage) MarshalJSON() ([]byte, error) {
   173  	type NoMethod ComponentsConfigEndpointValidationMessage
   174  	raw := NoMethod(*s)
   175  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   176  }
   177  
   178  // LuciConfigConfigSet: Describes a config set.
   179  type LuciConfigConfigSet struct {
   180  	ConfigSet string `json:"config_set,omitempty"`
   181  
   182  	// Files: Describes a file.
   183  	Files []*LuciConfigFile `json:"files,omitempty"`
   184  
   185  	LastImportAttempt *LuciConfigConfigSetImportAttempt `json:"last_import_attempt,omitempty"`
   186  
   187  	Location string `json:"location,omitempty"`
   188  
   189  	Revision *LuciConfigRevision `json:"revision,omitempty"`
   190  
   191  	// ForceSendFields is a list of field names (e.g. "ConfigSet") to
   192  	// unconditionally include in API requests. By default, fields with
   193  	// empty or default values are omitted from API requests. However, any
   194  	// non-pointer, non-interface field appearing in ForceSendFields will be
   195  	// sent to the server regardless of whether the field is empty or not.
   196  	// This may be used to include empty fields in Patch requests.
   197  	ForceSendFields []string `json:"-"`
   198  
   199  	// NullFields is a list of field names (e.g. "ConfigSet") to include in
   200  	// API requests with the JSON null value. By default, fields with empty
   201  	// values are omitted from API requests. However, any field with an
   202  	// empty value appearing in NullFields will be sent to the server as
   203  	// null. It is an error if a field in this list has a non-empty value.
   204  	// This may be used to include null fields in Patch requests.
   205  	NullFields []string `json:"-"`
   206  }
   207  
   208  func (s *LuciConfigConfigSet) MarshalJSON() ([]byte, error) {
   209  	type NoMethod LuciConfigConfigSet
   210  	raw := NoMethod(*s)
   211  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   212  }
   213  
   214  type LuciConfigConfigSetImportAttempt struct {
   215  	Message string `json:"message,omitempty"`
   216  
   217  	Revision *LuciConfigRevision `json:"revision,omitempty"`
   218  
   219  	Success bool `json:"success,omitempty"`
   220  
   221  	Timestamp int64 `json:"timestamp,omitempty,string"`
   222  
   223  	ValidationMessages []*ComponentsConfigEndpointValidationMessage `json:"validation_messages,omitempty"`
   224  
   225  	// ForceSendFields is a list of field names (e.g. "Message") to
   226  	// unconditionally include in API requests. By default, fields with
   227  	// empty or default values are omitted from API requests. However, any
   228  	// non-pointer, non-interface field appearing in ForceSendFields will be
   229  	// sent to the server regardless of whether the field is empty or not.
   230  	// This may be used to include empty fields in Patch requests.
   231  	ForceSendFields []string `json:"-"`
   232  
   233  	// NullFields is a list of field names (e.g. "Message") to include in
   234  	// API requests with the JSON null value. By default, fields with empty
   235  	// values are omitted from API requests. However, any field with an
   236  	// empty value appearing in NullFields will be sent to the server as
   237  	// null. It is an error if a field in this list has a non-empty value.
   238  	// This may be used to include null fields in Patch requests.
   239  	NullFields []string `json:"-"`
   240  }
   241  
   242  func (s *LuciConfigConfigSetImportAttempt) MarshalJSON() ([]byte, error) {
   243  	type NoMethod LuciConfigConfigSetImportAttempt
   244  	raw := NoMethod(*s)
   245  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   246  }
   247  
   248  // LuciConfigFile: Describes a file.
   249  type LuciConfigFile struct {
   250  	Path string `json:"path,omitempty"`
   251  
   252  	// ForceSendFields is a list of field names (e.g. "Path") to
   253  	// unconditionally include in API requests. By default, fields with
   254  	// empty or default values are omitted from API requests. However, any
   255  	// non-pointer, non-interface field appearing in ForceSendFields will be
   256  	// sent to the server regardless of whether the field is empty or not.
   257  	// This may be used to include empty fields in Patch requests.
   258  	ForceSendFields []string `json:"-"`
   259  
   260  	// NullFields is a list of field names (e.g. "Path") to include in API
   261  	// requests with the JSON null value. By default, fields with empty
   262  	// values are omitted from API requests. However, any field with an
   263  	// empty value appearing in NullFields will be sent to the server as
   264  	// null. It is an error if a field in this list has a non-empty value.
   265  	// This may be used to include null fields in Patch requests.
   266  	NullFields []string `json:"-"`
   267  }
   268  
   269  func (s *LuciConfigFile) MarshalJSON() ([]byte, error) {
   270  	type NoMethod LuciConfigFile
   271  	raw := NoMethod(*s)
   272  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   273  }
   274  
   275  type LuciConfigGetConfigByHashResponseMessage struct {
   276  	Content string `json:"content,omitempty"`
   277  
   278  	// ServerResponse contains the HTTP response code and headers from the
   279  	// server.
   280  	googleapi.ServerResponse `json:"-"`
   281  
   282  	// ForceSendFields is a list of field names (e.g. "Content") to
   283  	// unconditionally include in API requests. By default, fields with
   284  	// empty or default values are omitted from API requests. However, any
   285  	// non-pointer, non-interface field appearing in ForceSendFields will be
   286  	// sent to the server regardless of whether the field is empty or not.
   287  	// This may be used to include empty fields in Patch requests.
   288  	ForceSendFields []string `json:"-"`
   289  
   290  	// NullFields is a list of field names (e.g. "Content") to include in
   291  	// API requests with the JSON null value. By default, fields with empty
   292  	// values are omitted from API requests. However, any field with an
   293  	// empty value appearing in NullFields will be sent to the server as
   294  	// null. It is an error if a field in this list has a non-empty value.
   295  	// This may be used to include null fields in Patch requests.
   296  	NullFields []string `json:"-"`
   297  }
   298  
   299  func (s *LuciConfigGetConfigByHashResponseMessage) MarshalJSON() ([]byte, error) {
   300  	type NoMethod LuciConfigGetConfigByHashResponseMessage
   301  	raw := NoMethod(*s)
   302  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   303  }
   304  
   305  type LuciConfigGetConfigMultiResponseMessage struct {
   306  	Configs []*LuciConfigGetConfigMultiResponseMessageConfigEntry `json:"configs,omitempty"`
   307  
   308  	// ServerResponse contains the HTTP response code and headers from the
   309  	// server.
   310  	googleapi.ServerResponse `json:"-"`
   311  
   312  	// ForceSendFields is a list of field names (e.g. "Configs") to
   313  	// unconditionally include in API requests. By default, fields with
   314  	// empty or default values are omitted from API requests. However, any
   315  	// non-pointer, non-interface field appearing in ForceSendFields will be
   316  	// sent to the server regardless of whether the field is empty or not.
   317  	// This may be used to include empty fields in Patch requests.
   318  	ForceSendFields []string `json:"-"`
   319  
   320  	// NullFields is a list of field names (e.g. "Configs") to include in
   321  	// API requests with the JSON null value. By default, fields with empty
   322  	// values are omitted from API requests. However, any field with an
   323  	// empty value appearing in NullFields will be sent to the server as
   324  	// null. It is an error if a field in this list has a non-empty value.
   325  	// This may be used to include null fields in Patch requests.
   326  	NullFields []string `json:"-"`
   327  }
   328  
   329  func (s *LuciConfigGetConfigMultiResponseMessage) MarshalJSON() ([]byte, error) {
   330  	type NoMethod LuciConfigGetConfigMultiResponseMessage
   331  	raw := NoMethod(*s)
   332  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   333  }
   334  
   335  type LuciConfigGetConfigMultiResponseMessageConfigEntry struct {
   336  	ConfigSet string `json:"config_set,omitempty"`
   337  
   338  	Content string `json:"content,omitempty"`
   339  
   340  	ContentHash string `json:"content_hash,omitempty"`
   341  
   342  	Revision string `json:"revision,omitempty"`
   343  
   344  	Url string `json:"url,omitempty"`
   345  
   346  	// ForceSendFields is a list of field names (e.g. "ConfigSet") to
   347  	// unconditionally include in API requests. By default, fields with
   348  	// empty or default values are omitted from API requests. However, any
   349  	// non-pointer, non-interface field appearing in ForceSendFields will be
   350  	// sent to the server regardless of whether the field is empty or not.
   351  	// This may be used to include empty fields in Patch requests.
   352  	ForceSendFields []string `json:"-"`
   353  
   354  	// NullFields is a list of field names (e.g. "ConfigSet") to include in
   355  	// API requests with the JSON null value. By default, fields with empty
   356  	// values are omitted from API requests. However, any field with an
   357  	// empty value appearing in NullFields will be sent to the server as
   358  	// null. It is an error if a field in this list has a non-empty value.
   359  	// This may be used to include null fields in Patch requests.
   360  	NullFields []string `json:"-"`
   361  }
   362  
   363  func (s *LuciConfigGetConfigMultiResponseMessageConfigEntry) MarshalJSON() ([]byte, error) {
   364  	type NoMethod LuciConfigGetConfigMultiResponseMessageConfigEntry
   365  	raw := NoMethod(*s)
   366  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   367  }
   368  
   369  type LuciConfigGetConfigResponseMessage struct {
   370  	Content string `json:"content,omitempty"`
   371  
   372  	ContentHash string `json:"content_hash,omitempty"`
   373  
   374  	IsZlibCompressed bool `json:"is_zlib_compressed,omitempty"`
   375  
   376  	Revision string `json:"revision,omitempty"`
   377  
   378  	Url string `json:"url,omitempty"`
   379  
   380  	// ServerResponse contains the HTTP response code and headers from the
   381  	// server.
   382  	googleapi.ServerResponse `json:"-"`
   383  
   384  	// ForceSendFields is a list of field names (e.g. "Content") to
   385  	// unconditionally include in API requests. By default, fields with
   386  	// empty or default values are omitted from API requests. However, any
   387  	// non-pointer, non-interface field appearing in ForceSendFields will be
   388  	// sent to the server regardless of whether the field is empty or not.
   389  	// This may be used to include empty fields in Patch requests.
   390  	ForceSendFields []string `json:"-"`
   391  
   392  	// NullFields is a list of field names (e.g. "Content") to include in
   393  	// API requests with the JSON null value. By default, fields with empty
   394  	// values are omitted from API requests. However, any field with an
   395  	// empty value appearing in NullFields will be sent to the server as
   396  	// null. It is an error if a field in this list has a non-empty value.
   397  	// This may be used to include null fields in Patch requests.
   398  	NullFields []string `json:"-"`
   399  }
   400  
   401  func (s *LuciConfigGetConfigResponseMessage) MarshalJSON() ([]byte, error) {
   402  	type NoMethod LuciConfigGetConfigResponseMessage
   403  	raw := NoMethod(*s)
   404  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   405  }
   406  
   407  type LuciConfigGetConfigSetsResponseMessage struct {
   408  	// ConfigSets: Describes a config set.
   409  	ConfigSets []*LuciConfigConfigSet `json:"config_sets,omitempty"`
   410  
   411  	// ServerResponse contains the HTTP response code and headers from the
   412  	// server.
   413  	googleapi.ServerResponse `json:"-"`
   414  
   415  	// ForceSendFields is a list of field names (e.g. "ConfigSets") to
   416  	// unconditionally include in API requests. By default, fields with
   417  	// empty or default values are omitted from API requests. However, any
   418  	// non-pointer, non-interface field appearing in ForceSendFields will be
   419  	// sent to the server regardless of whether the field is empty or not.
   420  	// This may be used to include empty fields in Patch requests.
   421  	ForceSendFields []string `json:"-"`
   422  
   423  	// NullFields is a list of field names (e.g. "ConfigSets") to include in
   424  	// API requests with the JSON null value. By default, fields with empty
   425  	// values are omitted from API requests. However, any field with an
   426  	// empty value appearing in NullFields will be sent to the server as
   427  	// null. It is an error if a field in this list has a non-empty value.
   428  	// This may be used to include null fields in Patch requests.
   429  	NullFields []string `json:"-"`
   430  }
   431  
   432  func (s *LuciConfigGetConfigSetsResponseMessage) MarshalJSON() ([]byte, error) {
   433  	type NoMethod LuciConfigGetConfigSetsResponseMessage
   434  	raw := NoMethod(*s)
   435  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   436  }
   437  
   438  type LuciConfigGetMappingResponseMessage struct {
   439  	Mappings []*LuciConfigGetMappingResponseMessageMapping `json:"mappings,omitempty"`
   440  
   441  	// ServerResponse contains the HTTP response code and headers from the
   442  	// server.
   443  	googleapi.ServerResponse `json:"-"`
   444  
   445  	// ForceSendFields is a list of field names (e.g. "Mappings") to
   446  	// unconditionally include in API requests. By default, fields with
   447  	// empty or default values are omitted from API requests. However, any
   448  	// non-pointer, non-interface field appearing in ForceSendFields will be
   449  	// sent to the server regardless of whether the field is empty or not.
   450  	// This may be used to include empty fields in Patch requests.
   451  	ForceSendFields []string `json:"-"`
   452  
   453  	// NullFields is a list of field names (e.g. "Mappings") to include in
   454  	// API requests with the JSON null value. By default, fields with empty
   455  	// values are omitted from API requests. However, any field with an
   456  	// empty value appearing in NullFields will be sent to the server as
   457  	// null. It is an error if a field in this list has a non-empty value.
   458  	// This may be used to include null fields in Patch requests.
   459  	NullFields []string `json:"-"`
   460  }
   461  
   462  func (s *LuciConfigGetMappingResponseMessage) MarshalJSON() ([]byte, error) {
   463  	type NoMethod LuciConfigGetMappingResponseMessage
   464  	raw := NoMethod(*s)
   465  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   466  }
   467  
   468  type LuciConfigGetMappingResponseMessageMapping struct {
   469  	ConfigSet string `json:"config_set,omitempty"`
   470  
   471  	Location string `json:"location,omitempty"`
   472  
   473  	// ForceSendFields is a list of field names (e.g. "ConfigSet") to
   474  	// unconditionally include in API requests. By default, fields with
   475  	// empty or default values are omitted from API requests. However, any
   476  	// non-pointer, non-interface field appearing in ForceSendFields will be
   477  	// sent to the server regardless of whether the field is empty or not.
   478  	// This may be used to include empty fields in Patch requests.
   479  	ForceSendFields []string `json:"-"`
   480  
   481  	// NullFields is a list of field names (e.g. "ConfigSet") to include in
   482  	// API requests with the JSON null value. By default, fields with empty
   483  	// values are omitted from API requests. However, any field with an
   484  	// empty value appearing in NullFields will be sent to the server as
   485  	// null. It is an error if a field in this list has a non-empty value.
   486  	// This may be used to include null fields in Patch requests.
   487  	NullFields []string `json:"-"`
   488  }
   489  
   490  func (s *LuciConfigGetMappingResponseMessageMapping) MarshalJSON() ([]byte, error) {
   491  	type NoMethod LuciConfigGetMappingResponseMessageMapping
   492  	raw := NoMethod(*s)
   493  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   494  }
   495  
   496  type LuciConfigGetProjectsResponseMessage struct {
   497  	Projects []*LuciConfigProject `json:"projects,omitempty"`
   498  
   499  	// ServerResponse contains the HTTP response code and headers from the
   500  	// server.
   501  	googleapi.ServerResponse `json:"-"`
   502  
   503  	// ForceSendFields is a list of field names (e.g. "Projects") to
   504  	// unconditionally include in API requests. By default, fields with
   505  	// empty or default values are omitted from API requests. However, any
   506  	// non-pointer, non-interface field appearing in ForceSendFields will be
   507  	// sent to the server regardless of whether the field is empty or not.
   508  	// This may be used to include empty fields in Patch requests.
   509  	ForceSendFields []string `json:"-"`
   510  
   511  	// NullFields is a list of field names (e.g. "Projects") to include in
   512  	// API requests with the JSON null value. By default, fields with empty
   513  	// values are omitted from API requests. However, any field with an
   514  	// empty value appearing in NullFields will be sent to the server as
   515  	// null. It is an error if a field in this list has a non-empty value.
   516  	// This may be used to include null fields in Patch requests.
   517  	NullFields []string `json:"-"`
   518  }
   519  
   520  func (s *LuciConfigGetProjectsResponseMessage) MarshalJSON() ([]byte, error) {
   521  	type NoMethod LuciConfigGetProjectsResponseMessage
   522  	raw := NoMethod(*s)
   523  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   524  }
   525  
   526  type LuciConfigGetRefsResponseMessage struct {
   527  	Refs []*LuciConfigGetRefsResponseMessageRef `json:"refs,omitempty"`
   528  
   529  	// ServerResponse contains the HTTP response code and headers from the
   530  	// server.
   531  	googleapi.ServerResponse `json:"-"`
   532  
   533  	// ForceSendFields is a list of field names (e.g. "Refs") to
   534  	// unconditionally include in API requests. By default, fields with
   535  	// empty or default values are omitted from API requests. However, any
   536  	// non-pointer, non-interface field appearing in ForceSendFields will be
   537  	// sent to the server regardless of whether the field is empty or not.
   538  	// This may be used to include empty fields in Patch requests.
   539  	ForceSendFields []string `json:"-"`
   540  
   541  	// NullFields is a list of field names (e.g. "Refs") to include in API
   542  	// requests with the JSON null value. By default, fields with empty
   543  	// values are omitted from API requests. However, any field with an
   544  	// empty value appearing in NullFields will be sent to the server as
   545  	// null. It is an error if a field in this list has a non-empty value.
   546  	// This may be used to include null fields in Patch requests.
   547  	NullFields []string `json:"-"`
   548  }
   549  
   550  func (s *LuciConfigGetRefsResponseMessage) MarshalJSON() ([]byte, error) {
   551  	type NoMethod LuciConfigGetRefsResponseMessage
   552  	raw := NoMethod(*s)
   553  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   554  }
   555  
   556  type LuciConfigGetRefsResponseMessageRef struct {
   557  	Name string `json:"name,omitempty"`
   558  
   559  	// ForceSendFields is a list of field names (e.g. "Name") to
   560  	// unconditionally include in API requests. By default, fields with
   561  	// empty or default values are omitted from API requests. However, any
   562  	// non-pointer, non-interface field appearing in ForceSendFields will be
   563  	// sent to the server regardless of whether the field is empty or not.
   564  	// This may be used to include empty fields in Patch requests.
   565  	ForceSendFields []string `json:"-"`
   566  
   567  	// NullFields is a list of field names (e.g. "Name") to include in API
   568  	// requests with the JSON null value. By default, fields with empty
   569  	// values are omitted from API requests. However, any field with an
   570  	// empty value appearing in NullFields will be sent to the server as
   571  	// null. It is an error if a field in this list has a non-empty value.
   572  	// This may be used to include null fields in Patch requests.
   573  	NullFields []string `json:"-"`
   574  }
   575  
   576  func (s *LuciConfigGetRefsResponseMessageRef) MarshalJSON() ([]byte, error) {
   577  	type NoMethod LuciConfigGetRefsResponseMessageRef
   578  	raw := NoMethod(*s)
   579  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   580  }
   581  
   582  type LuciConfigProject struct {
   583  	Id string `json:"id,omitempty"`
   584  
   585  	Name string `json:"name,omitempty"`
   586  
   587  	// Possible values:
   588  	//   "GITILES"
   589  	RepoType string `json:"repo_type,omitempty"`
   590  
   591  	RepoUrl string `json:"repo_url,omitempty"`
   592  
   593  	// ForceSendFields is a list of field names (e.g. "Id") to
   594  	// unconditionally include in API requests. By default, fields with
   595  	// empty or default values are omitted from API requests. However, any
   596  	// non-pointer, non-interface field appearing in ForceSendFields will be
   597  	// sent to the server regardless of whether the field is empty or not.
   598  	// This may be used to include empty fields in Patch requests.
   599  	ForceSendFields []string `json:"-"`
   600  
   601  	// NullFields is a list of field names (e.g. "Id") to include in API
   602  	// requests with the JSON null value. By default, fields with empty
   603  	// values are omitted from API requests. However, any field with an
   604  	// empty value appearing in NullFields will be sent to the server as
   605  	// null. It is an error if a field in this list has a non-empty value.
   606  	// This may be used to include null fields in Patch requests.
   607  	NullFields []string `json:"-"`
   608  }
   609  
   610  func (s *LuciConfigProject) MarshalJSON() ([]byte, error) {
   611  	type NoMethod LuciConfigProject
   612  	raw := NoMethod(*s)
   613  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   614  }
   615  
   616  type LuciConfigRevision struct {
   617  	CommitterEmail string `json:"committer_email,omitempty"`
   618  
   619  	Id string `json:"id,omitempty"`
   620  
   621  	Timestamp int64 `json:"timestamp,omitempty,string"`
   622  
   623  	Url string `json:"url,omitempty"`
   624  
   625  	// ForceSendFields is a list of field names (e.g. "CommitterEmail") to
   626  	// unconditionally include in API requests. By default, fields with
   627  	// empty or default values are omitted from API requests. However, any
   628  	// non-pointer, non-interface field appearing in ForceSendFields will be
   629  	// sent to the server regardless of whether the field is empty or not.
   630  	// This may be used to include empty fields in Patch requests.
   631  	ForceSendFields []string `json:"-"`
   632  
   633  	// NullFields is a list of field names (e.g. "CommitterEmail") to
   634  	// include in API requests with the JSON null value. By default, fields
   635  	// with empty values are omitted from API requests. However, any field
   636  	// with an empty value appearing in NullFields will be sent to the
   637  	// server as null. It is an error if a field in this list has a
   638  	// non-empty value. This may be used to include null fields in Patch
   639  	// requests.
   640  	NullFields []string `json:"-"`
   641  }
   642  
   643  func (s *LuciConfigRevision) MarshalJSON() ([]byte, error) {
   644  	type NoMethod LuciConfigRevision
   645  	raw := NoMethod(*s)
   646  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   647  }
   648  
   649  type LuciConfigValidateConfigRequestMessage struct {
   650  	ConfigSet string `json:"config_set,omitempty"`
   651  
   652  	Files []*LuciConfigValidateConfigRequestMessageFile `json:"files,omitempty"`
   653  
   654  	// ForceSendFields is a list of field names (e.g. "ConfigSet") to
   655  	// unconditionally include in API requests. By default, fields with
   656  	// empty or default values are omitted from API requests. However, any
   657  	// non-pointer, non-interface field appearing in ForceSendFields will be
   658  	// sent to the server regardless of whether the field is empty or not.
   659  	// This may be used to include empty fields in Patch requests.
   660  	ForceSendFields []string `json:"-"`
   661  
   662  	// NullFields is a list of field names (e.g. "ConfigSet") to include in
   663  	// API requests with the JSON null value. By default, fields with empty
   664  	// values are omitted from API requests. However, any field with an
   665  	// empty value appearing in NullFields will be sent to the server as
   666  	// null. It is an error if a field in this list has a non-empty value.
   667  	// This may be used to include null fields in Patch requests.
   668  	NullFields []string `json:"-"`
   669  }
   670  
   671  func (s *LuciConfigValidateConfigRequestMessage) MarshalJSON() ([]byte, error) {
   672  	type NoMethod LuciConfigValidateConfigRequestMessage
   673  	raw := NoMethod(*s)
   674  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   675  }
   676  
   677  type LuciConfigValidateConfigRequestMessageFile struct {
   678  	Content string `json:"content,omitempty"`
   679  
   680  	Path string `json:"path,omitempty"`
   681  
   682  	// ForceSendFields is a list of field names (e.g. "Content") to
   683  	// unconditionally include in API requests. By default, fields with
   684  	// empty or default values are omitted from API requests. However, any
   685  	// non-pointer, non-interface field appearing in ForceSendFields will be
   686  	// sent to the server regardless of whether the field is empty or not.
   687  	// This may be used to include empty fields in Patch requests.
   688  	ForceSendFields []string `json:"-"`
   689  
   690  	// NullFields is a list of field names (e.g. "Content") to include in
   691  	// API requests with the JSON null value. By default, fields with empty
   692  	// values are omitted from API requests. However, any field with an
   693  	// empty value appearing in NullFields will be sent to the server as
   694  	// null. It is an error if a field in this list has a non-empty value.
   695  	// This may be used to include null fields in Patch requests.
   696  	NullFields []string `json:"-"`
   697  }
   698  
   699  func (s *LuciConfigValidateConfigRequestMessageFile) MarshalJSON() ([]byte, error) {
   700  	type NoMethod LuciConfigValidateConfigRequestMessageFile
   701  	raw := NoMethod(*s)
   702  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   703  }
   704  
   705  type LuciConfigValidateConfigResponseMessage struct {
   706  	Messages []*ComponentsConfigEndpointValidationMessage `json:"messages,omitempty"`
   707  
   708  	// ServerResponse contains the HTTP response code and headers from the
   709  	// server.
   710  	googleapi.ServerResponse `json:"-"`
   711  
   712  	// ForceSendFields is a list of field names (e.g. "Messages") to
   713  	// unconditionally include in API requests. By default, fields with
   714  	// empty or default values are omitted from API requests. However, any
   715  	// non-pointer, non-interface field appearing in ForceSendFields will be
   716  	// sent to the server regardless of whether the field is empty or not.
   717  	// This may be used to include empty fields in Patch requests.
   718  	ForceSendFields []string `json:"-"`
   719  
   720  	// NullFields is a list of field names (e.g. "Messages") to include in
   721  	// API requests with the JSON null value. By default, fields with empty
   722  	// values are omitted from API requests. However, any field with an
   723  	// empty value appearing in NullFields will be sent to the server as
   724  	// null. It is an error if a field in this list has a non-empty value.
   725  	// This may be used to include null fields in Patch requests.
   726  	NullFields []string `json:"-"`
   727  }
   728  
   729  func (s *LuciConfigValidateConfigResponseMessage) MarshalJSON() ([]byte, error) {
   730  	type NoMethod LuciConfigValidateConfigResponseMessage
   731  	raw := NoMethod(*s)
   732  	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
   733  }
   734  
   735  // method id "config.get_config":
   736  
   737  type GetConfigCall struct {
   738  	s            *Service
   739  	configSet    string
   740  	path         string
   741  	urlParams_   gensupport.URLParams
   742  	ifNoneMatch_ string
   743  	ctx_         context.Context
   744  	header_      http.Header
   745  }
   746  
   747  // GetConfig: Gets a config file.
   748  //
   749  // - configSet: .
   750  // - path: .
   751  func (s *Service) GetConfig(configSet string, path string) *GetConfigCall {
   752  	c := &GetConfigCall{s: s, urlParams_: make(gensupport.URLParams)}
   753  	c.configSet = configSet
   754  	c.path = path
   755  	return c
   756  }
   757  
   758  // HashOnly sets the optional parameter "hash_only":
   759  func (c *GetConfigCall) HashOnly(hashOnly bool) *GetConfigCall {
   760  	c.urlParams_.Set("hash_only", fmt.Sprint(hashOnly))
   761  	return c
   762  }
   763  
   764  // Revision sets the optional parameter "revision":
   765  func (c *GetConfigCall) Revision(revision string) *GetConfigCall {
   766  	c.urlParams_.Set("revision", revision)
   767  	return c
   768  }
   769  
   770  // UseZlib sets the optional parameter "use_zlib":
   771  func (c *GetConfigCall) UseZlib(useZlib bool) *GetConfigCall {
   772  	c.urlParams_.Set("use_zlib", fmt.Sprint(useZlib))
   773  	return c
   774  }
   775  
   776  // Fields allows partial responses to be retrieved. See
   777  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   778  // for more information.
   779  func (c *GetConfigCall) Fields(s ...googleapi.Field) *GetConfigCall {
   780  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   781  	return c
   782  }
   783  
   784  // IfNoneMatch sets the optional parameter which makes the operation
   785  // fail if the object's ETag matches the given value. This is useful for
   786  // getting updates only after the object has changed since the last
   787  // request. Use googleapi.IsNotModified to check whether the response
   788  // error from Do is the result of In-None-Match.
   789  func (c *GetConfigCall) IfNoneMatch(entityTag string) *GetConfigCall {
   790  	c.ifNoneMatch_ = entityTag
   791  	return c
   792  }
   793  
   794  // Context sets the context to be used in this call's Do method. Any
   795  // pending HTTP request will be aborted if the provided context is
   796  // canceled.
   797  func (c *GetConfigCall) Context(ctx context.Context) *GetConfigCall {
   798  	c.ctx_ = ctx
   799  	return c
   800  }
   801  
   802  // Header returns an http.Header that can be modified by the caller to
   803  // add HTTP headers to the request.
   804  func (c *GetConfigCall) Header() http.Header {
   805  	if c.header_ == nil {
   806  		c.header_ = make(http.Header)
   807  	}
   808  	return c.header_
   809  }
   810  
   811  func (c *GetConfigCall) doRequest(alt string) (*http.Response, error) {
   812  	reqHeaders := make(http.Header)
   813  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
   814  	for k, v := range c.header_ {
   815  		reqHeaders[k] = v
   816  	}
   817  	reqHeaders.Set("User-Agent", c.s.userAgent())
   818  	if c.ifNoneMatch_ != "" {
   819  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   820  	}
   821  	var body io.Reader = nil
   822  	c.urlParams_.Set("alt", alt)
   823  	c.urlParams_.Set("prettyPrint", "false")
   824  	urls := googleapi.ResolveRelative(c.s.BasePath, "config_sets/{config_set}/config/{path}")
   825  	urls += "?" + c.urlParams_.Encode()
   826  	req, err := http.NewRequest("GET", urls, body)
   827  	if err != nil {
   828  		return nil, err
   829  	}
   830  	req.Header = reqHeaders
   831  	googleapi.Expand(req.URL, map[string]string{
   832  		"config_set": c.configSet,
   833  		"path":       c.path,
   834  	})
   835  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   836  }
   837  
   838  // Do executes the "config.get_config" call.
   839  // Exactly one of *LuciConfigGetConfigResponseMessage or error will be
   840  // non-nil. Any non-2xx status code is an error. Response headers are in
   841  // either *LuciConfigGetConfigResponseMessage.ServerResponse.Header or
   842  // (if a response was returned at all) in
   843  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
   844  // whether the returned error was because http.StatusNotModified was
   845  // returned.
   846  func (c *GetConfigCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetConfigResponseMessage, error) {
   847  	gensupport.SetOptions(c.urlParams_, opts...)
   848  	res, err := c.doRequest("json")
   849  	if res != nil && res.StatusCode == http.StatusNotModified {
   850  		if res.Body != nil {
   851  			res.Body.Close()
   852  		}
   853  		return nil, gensupport.WrapError(&googleapi.Error{
   854  			Code:   res.StatusCode,
   855  			Header: res.Header,
   856  		})
   857  	}
   858  	if err != nil {
   859  		return nil, err
   860  	}
   861  	defer googleapi.CloseBody(res)
   862  	if err := googleapi.CheckResponse(res); err != nil {
   863  		return nil, gensupport.WrapError(err)
   864  	}
   865  	ret := &LuciConfigGetConfigResponseMessage{
   866  		ServerResponse: googleapi.ServerResponse{
   867  			Header:         res.Header,
   868  			HTTPStatusCode: res.StatusCode,
   869  		},
   870  	}
   871  	target := &ret
   872  	if err := gensupport.DecodeResponse(target, res); err != nil {
   873  		return nil, err
   874  	}
   875  	return ret, nil
   876  	// {
   877  	//   "description": "Gets a config file.",
   878  	//   "httpMethod": "GET",
   879  	//   "id": "config.get_config",
   880  	//   "parameterOrder": [
   881  	//     "config_set",
   882  	//     "path"
   883  	//   ],
   884  	//   "parameters": {
   885  	//     "config_set": {
   886  	//       "location": "path",
   887  	//       "required": true,
   888  	//       "type": "string"
   889  	//     },
   890  	//     "hash_only": {
   891  	//       "location": "query",
   892  	//       "type": "boolean"
   893  	//     },
   894  	//     "path": {
   895  	//       "location": "path",
   896  	//       "required": true,
   897  	//       "type": "string"
   898  	//     },
   899  	//     "revision": {
   900  	//       "location": "query",
   901  	//       "type": "string"
   902  	//     },
   903  	//     "use_zlib": {
   904  	//       "location": "query",
   905  	//       "type": "boolean"
   906  	//     }
   907  	//   },
   908  	//   "path": "config_sets/{config_set}/config/{path}",
   909  	//   "response": {
   910  	//     "$ref": "LuciConfigGetConfigResponseMessage"
   911  	//   },
   912  	//   "scopes": [
   913  	//     "https://www.googleapis.com/auth/userinfo.email"
   914  	//   ]
   915  	// }
   916  
   917  }
   918  
   919  // method id "config.get_config_by_hash":
   920  
   921  type GetConfigByHashCall struct {
   922  	s            *Service
   923  	contentHash  string
   924  	urlParams_   gensupport.URLParams
   925  	ifNoneMatch_ string
   926  	ctx_         context.Context
   927  	header_      http.Header
   928  }
   929  
   930  // GetConfigByHash: Gets a config file by its hash.
   931  //
   932  // - contentHash: .
   933  func (s *Service) GetConfigByHash(contentHash string) *GetConfigByHashCall {
   934  	c := &GetConfigByHashCall{s: s, urlParams_: make(gensupport.URLParams)}
   935  	c.contentHash = contentHash
   936  	return c
   937  }
   938  
   939  // Fields allows partial responses to be retrieved. See
   940  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
   941  // for more information.
   942  func (c *GetConfigByHashCall) Fields(s ...googleapi.Field) *GetConfigByHashCall {
   943  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
   944  	return c
   945  }
   946  
   947  // IfNoneMatch sets the optional parameter which makes the operation
   948  // fail if the object's ETag matches the given value. This is useful for
   949  // getting updates only after the object has changed since the last
   950  // request. Use googleapi.IsNotModified to check whether the response
   951  // error from Do is the result of In-None-Match.
   952  func (c *GetConfigByHashCall) IfNoneMatch(entityTag string) *GetConfigByHashCall {
   953  	c.ifNoneMatch_ = entityTag
   954  	return c
   955  }
   956  
   957  // Context sets the context to be used in this call's Do method. Any
   958  // pending HTTP request will be aborted if the provided context is
   959  // canceled.
   960  func (c *GetConfigByHashCall) Context(ctx context.Context) *GetConfigByHashCall {
   961  	c.ctx_ = ctx
   962  	return c
   963  }
   964  
   965  // Header returns an http.Header that can be modified by the caller to
   966  // add HTTP headers to the request.
   967  func (c *GetConfigByHashCall) Header() http.Header {
   968  	if c.header_ == nil {
   969  		c.header_ = make(http.Header)
   970  	}
   971  	return c.header_
   972  }
   973  
   974  func (c *GetConfigByHashCall) doRequest(alt string) (*http.Response, error) {
   975  	reqHeaders := make(http.Header)
   976  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
   977  	for k, v := range c.header_ {
   978  		reqHeaders[k] = v
   979  	}
   980  	reqHeaders.Set("User-Agent", c.s.userAgent())
   981  	if c.ifNoneMatch_ != "" {
   982  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
   983  	}
   984  	var body io.Reader = nil
   985  	c.urlParams_.Set("alt", alt)
   986  	c.urlParams_.Set("prettyPrint", "false")
   987  	urls := googleapi.ResolveRelative(c.s.BasePath, "config/{content_hash}")
   988  	urls += "?" + c.urlParams_.Encode()
   989  	req, err := http.NewRequest("GET", urls, body)
   990  	if err != nil {
   991  		return nil, err
   992  	}
   993  	req.Header = reqHeaders
   994  	googleapi.Expand(req.URL, map[string]string{
   995  		"content_hash": c.contentHash,
   996  	})
   997  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
   998  }
   999  
  1000  // Do executes the "config.get_config_by_hash" call.
  1001  // Exactly one of *LuciConfigGetConfigByHashResponseMessage or error
  1002  // will be non-nil. Any non-2xx status code is an error. Response
  1003  // headers are in either
  1004  // *LuciConfigGetConfigByHashResponseMessage.ServerResponse.Header or
  1005  // (if a response was returned at all) in
  1006  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1007  // whether the returned error was because http.StatusNotModified was
  1008  // returned.
  1009  func (c *GetConfigByHashCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetConfigByHashResponseMessage, error) {
  1010  	gensupport.SetOptions(c.urlParams_, opts...)
  1011  	res, err := c.doRequest("json")
  1012  	if res != nil && res.StatusCode == http.StatusNotModified {
  1013  		if res.Body != nil {
  1014  			res.Body.Close()
  1015  		}
  1016  		return nil, gensupport.WrapError(&googleapi.Error{
  1017  			Code:   res.StatusCode,
  1018  			Header: res.Header,
  1019  		})
  1020  	}
  1021  	if err != nil {
  1022  		return nil, err
  1023  	}
  1024  	defer googleapi.CloseBody(res)
  1025  	if err := googleapi.CheckResponse(res); err != nil {
  1026  		return nil, gensupport.WrapError(err)
  1027  	}
  1028  	ret := &LuciConfigGetConfigByHashResponseMessage{
  1029  		ServerResponse: googleapi.ServerResponse{
  1030  			Header:         res.Header,
  1031  			HTTPStatusCode: res.StatusCode,
  1032  		},
  1033  	}
  1034  	target := &ret
  1035  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1036  		return nil, err
  1037  	}
  1038  	return ret, nil
  1039  	// {
  1040  	//   "description": "Gets a config file by its hash.",
  1041  	//   "httpMethod": "GET",
  1042  	//   "id": "config.get_config_by_hash",
  1043  	//   "parameterOrder": [
  1044  	//     "content_hash"
  1045  	//   ],
  1046  	//   "parameters": {
  1047  	//     "content_hash": {
  1048  	//       "location": "path",
  1049  	//       "required": true,
  1050  	//       "type": "string"
  1051  	//     }
  1052  	//   },
  1053  	//   "path": "config/{content_hash}",
  1054  	//   "response": {
  1055  	//     "$ref": "LuciConfigGetConfigByHashResponseMessage"
  1056  	//   },
  1057  	//   "scopes": [
  1058  	//     "https://www.googleapis.com/auth/userinfo.email"
  1059  	//   ]
  1060  	// }
  1061  
  1062  }
  1063  
  1064  // method id "config.get_config_sets":
  1065  
  1066  type GetConfigSetsCall struct {
  1067  	s            *Service
  1068  	urlParams_   gensupport.URLParams
  1069  	ifNoneMatch_ string
  1070  	ctx_         context.Context
  1071  	header_      http.Header
  1072  }
  1073  
  1074  // GetConfigSets: Returns config sets.
  1075  func (s *Service) GetConfigSets() *GetConfigSetsCall {
  1076  	c := &GetConfigSetsCall{s: s, urlParams_: make(gensupport.URLParams)}
  1077  	return c
  1078  }
  1079  
  1080  // ConfigSet sets the optional parameter "config_set":
  1081  func (c *GetConfigSetsCall) ConfigSet(configSet string) *GetConfigSetsCall {
  1082  	c.urlParams_.Set("config_set", configSet)
  1083  	return c
  1084  }
  1085  
  1086  // IncludeFiles sets the optional parameter "include_files":
  1087  func (c *GetConfigSetsCall) IncludeFiles(includeFiles bool) *GetConfigSetsCall {
  1088  	c.urlParams_.Set("include_files", fmt.Sprint(includeFiles))
  1089  	return c
  1090  }
  1091  
  1092  // IncludeLastImportAttempt sets the optional parameter
  1093  // "include_last_import_attempt":
  1094  func (c *GetConfigSetsCall) IncludeLastImportAttempt(includeLastImportAttempt bool) *GetConfigSetsCall {
  1095  	c.urlParams_.Set("include_last_import_attempt", fmt.Sprint(includeLastImportAttempt))
  1096  	return c
  1097  }
  1098  
  1099  // Fields allows partial responses to be retrieved. See
  1100  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1101  // for more information.
  1102  func (c *GetConfigSetsCall) Fields(s ...googleapi.Field) *GetConfigSetsCall {
  1103  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1104  	return c
  1105  }
  1106  
  1107  // IfNoneMatch sets the optional parameter which makes the operation
  1108  // fail if the object's ETag matches the given value. This is useful for
  1109  // getting updates only after the object has changed since the last
  1110  // request. Use googleapi.IsNotModified to check whether the response
  1111  // error from Do is the result of In-None-Match.
  1112  func (c *GetConfigSetsCall) IfNoneMatch(entityTag string) *GetConfigSetsCall {
  1113  	c.ifNoneMatch_ = entityTag
  1114  	return c
  1115  }
  1116  
  1117  // Context sets the context to be used in this call's Do method. Any
  1118  // pending HTTP request will be aborted if the provided context is
  1119  // canceled.
  1120  func (c *GetConfigSetsCall) Context(ctx context.Context) *GetConfigSetsCall {
  1121  	c.ctx_ = ctx
  1122  	return c
  1123  }
  1124  
  1125  // Header returns an http.Header that can be modified by the caller to
  1126  // add HTTP headers to the request.
  1127  func (c *GetConfigSetsCall) Header() http.Header {
  1128  	if c.header_ == nil {
  1129  		c.header_ = make(http.Header)
  1130  	}
  1131  	return c.header_
  1132  }
  1133  
  1134  func (c *GetConfigSetsCall) doRequest(alt string) (*http.Response, error) {
  1135  	reqHeaders := make(http.Header)
  1136  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  1137  	for k, v := range c.header_ {
  1138  		reqHeaders[k] = v
  1139  	}
  1140  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1141  	if c.ifNoneMatch_ != "" {
  1142  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1143  	}
  1144  	var body io.Reader = nil
  1145  	c.urlParams_.Set("alt", alt)
  1146  	c.urlParams_.Set("prettyPrint", "false")
  1147  	urls := googleapi.ResolveRelative(c.s.BasePath, "config-sets")
  1148  	urls += "?" + c.urlParams_.Encode()
  1149  	req, err := http.NewRequest("GET", urls, body)
  1150  	if err != nil {
  1151  		return nil, err
  1152  	}
  1153  	req.Header = reqHeaders
  1154  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1155  }
  1156  
  1157  // Do executes the "config.get_config_sets" call.
  1158  // Exactly one of *LuciConfigGetConfigSetsResponseMessage or error will
  1159  // be non-nil. Any non-2xx status code is an error. Response headers are
  1160  // in either
  1161  // *LuciConfigGetConfigSetsResponseMessage.ServerResponse.Header or (if
  1162  // a response was returned at all) in error.(*googleapi.Error).Header.
  1163  // Use googleapi.IsNotModified to check whether the returned error was
  1164  // because http.StatusNotModified was returned.
  1165  func (c *GetConfigSetsCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetConfigSetsResponseMessage, error) {
  1166  	gensupport.SetOptions(c.urlParams_, opts...)
  1167  	res, err := c.doRequest("json")
  1168  	if res != nil && res.StatusCode == http.StatusNotModified {
  1169  		if res.Body != nil {
  1170  			res.Body.Close()
  1171  		}
  1172  		return nil, gensupport.WrapError(&googleapi.Error{
  1173  			Code:   res.StatusCode,
  1174  			Header: res.Header,
  1175  		})
  1176  	}
  1177  	if err != nil {
  1178  		return nil, err
  1179  	}
  1180  	defer googleapi.CloseBody(res)
  1181  	if err := googleapi.CheckResponse(res); err != nil {
  1182  		return nil, gensupport.WrapError(err)
  1183  	}
  1184  	ret := &LuciConfigGetConfigSetsResponseMessage{
  1185  		ServerResponse: googleapi.ServerResponse{
  1186  			Header:         res.Header,
  1187  			HTTPStatusCode: res.StatusCode,
  1188  		},
  1189  	}
  1190  	target := &ret
  1191  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1192  		return nil, err
  1193  	}
  1194  	return ret, nil
  1195  	// {
  1196  	//   "description": "Returns config sets.",
  1197  	//   "httpMethod": "GET",
  1198  	//   "id": "config.get_config_sets",
  1199  	//   "parameters": {
  1200  	//     "config_set": {
  1201  	//       "location": "query",
  1202  	//       "type": "string"
  1203  	//     },
  1204  	//     "include_files": {
  1205  	//       "location": "query",
  1206  	//       "type": "boolean"
  1207  	//     },
  1208  	//     "include_last_import_attempt": {
  1209  	//       "location": "query",
  1210  	//       "type": "boolean"
  1211  	//     }
  1212  	//   },
  1213  	//   "path": "config-sets",
  1214  	//   "response": {
  1215  	//     "$ref": "LuciConfigGetConfigSetsResponseMessage"
  1216  	//   },
  1217  	//   "scopes": [
  1218  	//     "https://www.googleapis.com/auth/userinfo.email"
  1219  	//   ]
  1220  	// }
  1221  
  1222  }
  1223  
  1224  // method id "config.get_mapping":
  1225  
  1226  type GetMappingCall struct {
  1227  	s            *Service
  1228  	urlParams_   gensupport.URLParams
  1229  	ifNoneMatch_ string
  1230  	ctx_         context.Context
  1231  	header_      http.Header
  1232  }
  1233  
  1234  // GetMapping: DEPRECATED. Use get_config_sets.
  1235  func (s *Service) GetMapping() *GetMappingCall {
  1236  	c := &GetMappingCall{s: s, urlParams_: make(gensupport.URLParams)}
  1237  	return c
  1238  }
  1239  
  1240  // ConfigSet sets the optional parameter "config_set":
  1241  func (c *GetMappingCall) ConfigSet(configSet string) *GetMappingCall {
  1242  	c.urlParams_.Set("config_set", configSet)
  1243  	return c
  1244  }
  1245  
  1246  // Fields allows partial responses to be retrieved. See
  1247  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1248  // for more information.
  1249  func (c *GetMappingCall) Fields(s ...googleapi.Field) *GetMappingCall {
  1250  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1251  	return c
  1252  }
  1253  
  1254  // IfNoneMatch sets the optional parameter which makes the operation
  1255  // fail if the object's ETag matches the given value. This is useful for
  1256  // getting updates only after the object has changed since the last
  1257  // request. Use googleapi.IsNotModified to check whether the response
  1258  // error from Do is the result of In-None-Match.
  1259  func (c *GetMappingCall) IfNoneMatch(entityTag string) *GetMappingCall {
  1260  	c.ifNoneMatch_ = entityTag
  1261  	return c
  1262  }
  1263  
  1264  // Context sets the context to be used in this call's Do method. Any
  1265  // pending HTTP request will be aborted if the provided context is
  1266  // canceled.
  1267  func (c *GetMappingCall) Context(ctx context.Context) *GetMappingCall {
  1268  	c.ctx_ = ctx
  1269  	return c
  1270  }
  1271  
  1272  // Header returns an http.Header that can be modified by the caller to
  1273  // add HTTP headers to the request.
  1274  func (c *GetMappingCall) Header() http.Header {
  1275  	if c.header_ == nil {
  1276  		c.header_ = make(http.Header)
  1277  	}
  1278  	return c.header_
  1279  }
  1280  
  1281  func (c *GetMappingCall) doRequest(alt string) (*http.Response, error) {
  1282  	reqHeaders := make(http.Header)
  1283  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  1284  	for k, v := range c.header_ {
  1285  		reqHeaders[k] = v
  1286  	}
  1287  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1288  	if c.ifNoneMatch_ != "" {
  1289  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1290  	}
  1291  	var body io.Reader = nil
  1292  	c.urlParams_.Set("alt", alt)
  1293  	c.urlParams_.Set("prettyPrint", "false")
  1294  	urls := googleapi.ResolveRelative(c.s.BasePath, "mapping")
  1295  	urls += "?" + c.urlParams_.Encode()
  1296  	req, err := http.NewRequest("GET", urls, body)
  1297  	if err != nil {
  1298  		return nil, err
  1299  	}
  1300  	req.Header = reqHeaders
  1301  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1302  }
  1303  
  1304  // Do executes the "config.get_mapping" call.
  1305  // Exactly one of *LuciConfigGetMappingResponseMessage or error will be
  1306  // non-nil. Any non-2xx status code is an error. Response headers are in
  1307  // either *LuciConfigGetMappingResponseMessage.ServerResponse.Header or
  1308  // (if a response was returned at all) in
  1309  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1310  // whether the returned error was because http.StatusNotModified was
  1311  // returned.
  1312  func (c *GetMappingCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetMappingResponseMessage, error) {
  1313  	gensupport.SetOptions(c.urlParams_, opts...)
  1314  	res, err := c.doRequest("json")
  1315  	if res != nil && res.StatusCode == http.StatusNotModified {
  1316  		if res.Body != nil {
  1317  			res.Body.Close()
  1318  		}
  1319  		return nil, gensupport.WrapError(&googleapi.Error{
  1320  			Code:   res.StatusCode,
  1321  			Header: res.Header,
  1322  		})
  1323  	}
  1324  	if err != nil {
  1325  		return nil, err
  1326  	}
  1327  	defer googleapi.CloseBody(res)
  1328  	if err := googleapi.CheckResponse(res); err != nil {
  1329  		return nil, gensupport.WrapError(err)
  1330  	}
  1331  	ret := &LuciConfigGetMappingResponseMessage{
  1332  		ServerResponse: googleapi.ServerResponse{
  1333  			Header:         res.Header,
  1334  			HTTPStatusCode: res.StatusCode,
  1335  		},
  1336  	}
  1337  	target := &ret
  1338  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1339  		return nil, err
  1340  	}
  1341  	return ret, nil
  1342  	// {
  1343  	//   "description": "DEPRECATED. Use get_config_sets.",
  1344  	//   "httpMethod": "GET",
  1345  	//   "id": "config.get_mapping",
  1346  	//   "parameters": {
  1347  	//     "config_set": {
  1348  	//       "location": "query",
  1349  	//       "type": "string"
  1350  	//     }
  1351  	//   },
  1352  	//   "path": "mapping",
  1353  	//   "response": {
  1354  	//     "$ref": "LuciConfigGetMappingResponseMessage"
  1355  	//   },
  1356  	//   "scopes": [
  1357  	//     "https://www.googleapis.com/auth/userinfo.email"
  1358  	//   ]
  1359  	// }
  1360  
  1361  }
  1362  
  1363  // method id "config.get_project_configs":
  1364  
  1365  type GetProjectConfigsCall struct {
  1366  	s            *Service
  1367  	path         string
  1368  	urlParams_   gensupport.URLParams
  1369  	ifNoneMatch_ string
  1370  	ctx_         context.Context
  1371  	header_      http.Header
  1372  }
  1373  
  1374  // GetProjectConfigs: Gets configs in all project config sets.
  1375  //
  1376  // - path: .
  1377  func (s *Service) GetProjectConfigs(path string) *GetProjectConfigsCall {
  1378  	c := &GetProjectConfigsCall{s: s, urlParams_: make(gensupport.URLParams)}
  1379  	c.path = path
  1380  	return c
  1381  }
  1382  
  1383  // HashesOnly sets the optional parameter "hashes_only":
  1384  func (c *GetProjectConfigsCall) HashesOnly(hashesOnly bool) *GetProjectConfigsCall {
  1385  	c.urlParams_.Set("hashes_only", fmt.Sprint(hashesOnly))
  1386  	return c
  1387  }
  1388  
  1389  // Fields allows partial responses to be retrieved. See
  1390  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1391  // for more information.
  1392  func (c *GetProjectConfigsCall) Fields(s ...googleapi.Field) *GetProjectConfigsCall {
  1393  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1394  	return c
  1395  }
  1396  
  1397  // IfNoneMatch sets the optional parameter which makes the operation
  1398  // fail if the object's ETag matches the given value. This is useful for
  1399  // getting updates only after the object has changed since the last
  1400  // request. Use googleapi.IsNotModified to check whether the response
  1401  // error from Do is the result of In-None-Match.
  1402  func (c *GetProjectConfigsCall) IfNoneMatch(entityTag string) *GetProjectConfigsCall {
  1403  	c.ifNoneMatch_ = entityTag
  1404  	return c
  1405  }
  1406  
  1407  // Context sets the context to be used in this call's Do method. Any
  1408  // pending HTTP request will be aborted if the provided context is
  1409  // canceled.
  1410  func (c *GetProjectConfigsCall) Context(ctx context.Context) *GetProjectConfigsCall {
  1411  	c.ctx_ = ctx
  1412  	return c
  1413  }
  1414  
  1415  // Header returns an http.Header that can be modified by the caller to
  1416  // add HTTP headers to the request.
  1417  func (c *GetProjectConfigsCall) Header() http.Header {
  1418  	if c.header_ == nil {
  1419  		c.header_ = make(http.Header)
  1420  	}
  1421  	return c.header_
  1422  }
  1423  
  1424  func (c *GetProjectConfigsCall) doRequest(alt string) (*http.Response, error) {
  1425  	reqHeaders := make(http.Header)
  1426  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  1427  	for k, v := range c.header_ {
  1428  		reqHeaders[k] = v
  1429  	}
  1430  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1431  	if c.ifNoneMatch_ != "" {
  1432  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1433  	}
  1434  	var body io.Reader = nil
  1435  	c.urlParams_.Set("alt", alt)
  1436  	c.urlParams_.Set("prettyPrint", "false")
  1437  	urls := googleapi.ResolveRelative(c.s.BasePath, "configs/projects/{path}")
  1438  	urls += "?" + c.urlParams_.Encode()
  1439  	req, err := http.NewRequest("GET", urls, body)
  1440  	if err != nil {
  1441  		return nil, err
  1442  	}
  1443  	req.Header = reqHeaders
  1444  	googleapi.Expand(req.URL, map[string]string{
  1445  		"path": c.path,
  1446  	})
  1447  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1448  }
  1449  
  1450  // Do executes the "config.get_project_configs" call.
  1451  // Exactly one of *LuciConfigGetConfigMultiResponseMessage or error will
  1452  // be non-nil. Any non-2xx status code is an error. Response headers are
  1453  // in either
  1454  // *LuciConfigGetConfigMultiResponseMessage.ServerResponse.Header or (if
  1455  // a response was returned at all) in error.(*googleapi.Error).Header.
  1456  // Use googleapi.IsNotModified to check whether the returned error was
  1457  // because http.StatusNotModified was returned.
  1458  func (c *GetProjectConfigsCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetConfigMultiResponseMessage, error) {
  1459  	gensupport.SetOptions(c.urlParams_, opts...)
  1460  	res, err := c.doRequest("json")
  1461  	if res != nil && res.StatusCode == http.StatusNotModified {
  1462  		if res.Body != nil {
  1463  			res.Body.Close()
  1464  		}
  1465  		return nil, gensupport.WrapError(&googleapi.Error{
  1466  			Code:   res.StatusCode,
  1467  			Header: res.Header,
  1468  		})
  1469  	}
  1470  	if err != nil {
  1471  		return nil, err
  1472  	}
  1473  	defer googleapi.CloseBody(res)
  1474  	if err := googleapi.CheckResponse(res); err != nil {
  1475  		return nil, gensupport.WrapError(err)
  1476  	}
  1477  	ret := &LuciConfigGetConfigMultiResponseMessage{
  1478  		ServerResponse: googleapi.ServerResponse{
  1479  			Header:         res.Header,
  1480  			HTTPStatusCode: res.StatusCode,
  1481  		},
  1482  	}
  1483  	target := &ret
  1484  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1485  		return nil, err
  1486  	}
  1487  	return ret, nil
  1488  	// {
  1489  	//   "description": "Gets configs in all project config sets.",
  1490  	//   "httpMethod": "GET",
  1491  	//   "id": "config.get_project_configs",
  1492  	//   "parameterOrder": [
  1493  	//     "path"
  1494  	//   ],
  1495  	//   "parameters": {
  1496  	//     "hashes_only": {
  1497  	//       "location": "query",
  1498  	//       "type": "boolean"
  1499  	//     },
  1500  	//     "path": {
  1501  	//       "location": "path",
  1502  	//       "required": true,
  1503  	//       "type": "string"
  1504  	//     }
  1505  	//   },
  1506  	//   "path": "configs/projects/{path}",
  1507  	//   "response": {
  1508  	//     "$ref": "LuciConfigGetConfigMultiResponseMessage"
  1509  	//   },
  1510  	//   "scopes": [
  1511  	//     "https://www.googleapis.com/auth/userinfo.email"
  1512  	//   ]
  1513  	// }
  1514  
  1515  }
  1516  
  1517  // method id "config.get_projects":
  1518  
  1519  type GetProjectsCall struct {
  1520  	s            *Service
  1521  	urlParams_   gensupport.URLParams
  1522  	ifNoneMatch_ string
  1523  	ctx_         context.Context
  1524  	header_      http.Header
  1525  }
  1526  
  1527  // GetProjects: Gets list of registered projects. The project list is
  1528  // stored in services/luci-config:projects.cfg.
  1529  func (s *Service) GetProjects() *GetProjectsCall {
  1530  	c := &GetProjectsCall{s: s, urlParams_: make(gensupport.URLParams)}
  1531  	return c
  1532  }
  1533  
  1534  // Fields allows partial responses to be retrieved. See
  1535  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1536  // for more information.
  1537  func (c *GetProjectsCall) Fields(s ...googleapi.Field) *GetProjectsCall {
  1538  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1539  	return c
  1540  }
  1541  
  1542  // IfNoneMatch sets the optional parameter which makes the operation
  1543  // fail if the object's ETag matches the given value. This is useful for
  1544  // getting updates only after the object has changed since the last
  1545  // request. Use googleapi.IsNotModified to check whether the response
  1546  // error from Do is the result of In-None-Match.
  1547  func (c *GetProjectsCall) IfNoneMatch(entityTag string) *GetProjectsCall {
  1548  	c.ifNoneMatch_ = entityTag
  1549  	return c
  1550  }
  1551  
  1552  // Context sets the context to be used in this call's Do method. Any
  1553  // pending HTTP request will be aborted if the provided context is
  1554  // canceled.
  1555  func (c *GetProjectsCall) Context(ctx context.Context) *GetProjectsCall {
  1556  	c.ctx_ = ctx
  1557  	return c
  1558  }
  1559  
  1560  // Header returns an http.Header that can be modified by the caller to
  1561  // add HTTP headers to the request.
  1562  func (c *GetProjectsCall) Header() http.Header {
  1563  	if c.header_ == nil {
  1564  		c.header_ = make(http.Header)
  1565  	}
  1566  	return c.header_
  1567  }
  1568  
  1569  func (c *GetProjectsCall) doRequest(alt string) (*http.Response, error) {
  1570  	reqHeaders := make(http.Header)
  1571  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  1572  	for k, v := range c.header_ {
  1573  		reqHeaders[k] = v
  1574  	}
  1575  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1576  	if c.ifNoneMatch_ != "" {
  1577  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1578  	}
  1579  	var body io.Reader = nil
  1580  	c.urlParams_.Set("alt", alt)
  1581  	c.urlParams_.Set("prettyPrint", "false")
  1582  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects")
  1583  	urls += "?" + c.urlParams_.Encode()
  1584  	req, err := http.NewRequest("GET", urls, body)
  1585  	if err != nil {
  1586  		return nil, err
  1587  	}
  1588  	req.Header = reqHeaders
  1589  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1590  }
  1591  
  1592  // Do executes the "config.get_projects" call.
  1593  // Exactly one of *LuciConfigGetProjectsResponseMessage or error will be
  1594  // non-nil. Any non-2xx status code is an error. Response headers are in
  1595  // either *LuciConfigGetProjectsResponseMessage.ServerResponse.Header or
  1596  // (if a response was returned at all) in
  1597  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1598  // whether the returned error was because http.StatusNotModified was
  1599  // returned.
  1600  func (c *GetProjectsCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetProjectsResponseMessage, error) {
  1601  	gensupport.SetOptions(c.urlParams_, opts...)
  1602  	res, err := c.doRequest("json")
  1603  	if res != nil && res.StatusCode == http.StatusNotModified {
  1604  		if res.Body != nil {
  1605  			res.Body.Close()
  1606  		}
  1607  		return nil, gensupport.WrapError(&googleapi.Error{
  1608  			Code:   res.StatusCode,
  1609  			Header: res.Header,
  1610  		})
  1611  	}
  1612  	if err != nil {
  1613  		return nil, err
  1614  	}
  1615  	defer googleapi.CloseBody(res)
  1616  	if err := googleapi.CheckResponse(res); err != nil {
  1617  		return nil, gensupport.WrapError(err)
  1618  	}
  1619  	ret := &LuciConfigGetProjectsResponseMessage{
  1620  		ServerResponse: googleapi.ServerResponse{
  1621  			Header:         res.Header,
  1622  			HTTPStatusCode: res.StatusCode,
  1623  		},
  1624  	}
  1625  	target := &ret
  1626  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1627  		return nil, err
  1628  	}
  1629  	return ret, nil
  1630  	// {
  1631  	//   "description": "Gets list of registered projects. The project list is stored in services/luci-config:projects.cfg.",
  1632  	//   "httpMethod": "GET",
  1633  	//   "id": "config.get_projects",
  1634  	//   "path": "projects",
  1635  	//   "response": {
  1636  	//     "$ref": "LuciConfigGetProjectsResponseMessage"
  1637  	//   },
  1638  	//   "scopes": [
  1639  	//     "https://www.googleapis.com/auth/userinfo.email"
  1640  	//   ]
  1641  	// }
  1642  
  1643  }
  1644  
  1645  // method id "config.get_ref_configs":
  1646  
  1647  type GetRefConfigsCall struct {
  1648  	s            *Service
  1649  	path         string
  1650  	urlParams_   gensupport.URLParams
  1651  	ifNoneMatch_ string
  1652  	ctx_         context.Context
  1653  	header_      http.Header
  1654  }
  1655  
  1656  // GetRefConfigs: Gets configs in all ref config sets.
  1657  //
  1658  // - path: .
  1659  func (s *Service) GetRefConfigs(path string) *GetRefConfigsCall {
  1660  	c := &GetRefConfigsCall{s: s, urlParams_: make(gensupport.URLParams)}
  1661  	c.path = path
  1662  	return c
  1663  }
  1664  
  1665  // HashesOnly sets the optional parameter "hashes_only":
  1666  func (c *GetRefConfigsCall) HashesOnly(hashesOnly bool) *GetRefConfigsCall {
  1667  	c.urlParams_.Set("hashes_only", fmt.Sprint(hashesOnly))
  1668  	return c
  1669  }
  1670  
  1671  // Fields allows partial responses to be retrieved. See
  1672  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1673  // for more information.
  1674  func (c *GetRefConfigsCall) Fields(s ...googleapi.Field) *GetRefConfigsCall {
  1675  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1676  	return c
  1677  }
  1678  
  1679  // IfNoneMatch sets the optional parameter which makes the operation
  1680  // fail if the object's ETag matches the given value. This is useful for
  1681  // getting updates only after the object has changed since the last
  1682  // request. Use googleapi.IsNotModified to check whether the response
  1683  // error from Do is the result of In-None-Match.
  1684  func (c *GetRefConfigsCall) IfNoneMatch(entityTag string) *GetRefConfigsCall {
  1685  	c.ifNoneMatch_ = entityTag
  1686  	return c
  1687  }
  1688  
  1689  // Context sets the context to be used in this call's Do method. Any
  1690  // pending HTTP request will be aborted if the provided context is
  1691  // canceled.
  1692  func (c *GetRefConfigsCall) Context(ctx context.Context) *GetRefConfigsCall {
  1693  	c.ctx_ = ctx
  1694  	return c
  1695  }
  1696  
  1697  // Header returns an http.Header that can be modified by the caller to
  1698  // add HTTP headers to the request.
  1699  func (c *GetRefConfigsCall) Header() http.Header {
  1700  	if c.header_ == nil {
  1701  		c.header_ = make(http.Header)
  1702  	}
  1703  	return c.header_
  1704  }
  1705  
  1706  func (c *GetRefConfigsCall) doRequest(alt string) (*http.Response, error) {
  1707  	reqHeaders := make(http.Header)
  1708  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  1709  	for k, v := range c.header_ {
  1710  		reqHeaders[k] = v
  1711  	}
  1712  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1713  	if c.ifNoneMatch_ != "" {
  1714  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1715  	}
  1716  	var body io.Reader = nil
  1717  	c.urlParams_.Set("alt", alt)
  1718  	c.urlParams_.Set("prettyPrint", "false")
  1719  	urls := googleapi.ResolveRelative(c.s.BasePath, "configs/refs/{path}")
  1720  	urls += "?" + c.urlParams_.Encode()
  1721  	req, err := http.NewRequest("GET", urls, body)
  1722  	if err != nil {
  1723  		return nil, err
  1724  	}
  1725  	req.Header = reqHeaders
  1726  	googleapi.Expand(req.URL, map[string]string{
  1727  		"path": c.path,
  1728  	})
  1729  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1730  }
  1731  
  1732  // Do executes the "config.get_ref_configs" call.
  1733  // Exactly one of *LuciConfigGetConfigMultiResponseMessage or error will
  1734  // be non-nil. Any non-2xx status code is an error. Response headers are
  1735  // in either
  1736  // *LuciConfigGetConfigMultiResponseMessage.ServerResponse.Header or (if
  1737  // a response was returned at all) in error.(*googleapi.Error).Header.
  1738  // Use googleapi.IsNotModified to check whether the returned error was
  1739  // because http.StatusNotModified was returned.
  1740  func (c *GetRefConfigsCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetConfigMultiResponseMessage, error) {
  1741  	gensupport.SetOptions(c.urlParams_, opts...)
  1742  	res, err := c.doRequest("json")
  1743  	if res != nil && res.StatusCode == http.StatusNotModified {
  1744  		if res.Body != nil {
  1745  			res.Body.Close()
  1746  		}
  1747  		return nil, gensupport.WrapError(&googleapi.Error{
  1748  			Code:   res.StatusCode,
  1749  			Header: res.Header,
  1750  		})
  1751  	}
  1752  	if err != nil {
  1753  		return nil, err
  1754  	}
  1755  	defer googleapi.CloseBody(res)
  1756  	if err := googleapi.CheckResponse(res); err != nil {
  1757  		return nil, gensupport.WrapError(err)
  1758  	}
  1759  	ret := &LuciConfigGetConfigMultiResponseMessage{
  1760  		ServerResponse: googleapi.ServerResponse{
  1761  			Header:         res.Header,
  1762  			HTTPStatusCode: res.StatusCode,
  1763  		},
  1764  	}
  1765  	target := &ret
  1766  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1767  		return nil, err
  1768  	}
  1769  	return ret, nil
  1770  	// {
  1771  	//   "description": "Gets configs in all ref config sets.",
  1772  	//   "httpMethod": "GET",
  1773  	//   "id": "config.get_ref_configs",
  1774  	//   "parameterOrder": [
  1775  	//     "path"
  1776  	//   ],
  1777  	//   "parameters": {
  1778  	//     "hashes_only": {
  1779  	//       "location": "query",
  1780  	//       "type": "boolean"
  1781  	//     },
  1782  	//     "path": {
  1783  	//       "location": "path",
  1784  	//       "required": true,
  1785  	//       "type": "string"
  1786  	//     }
  1787  	//   },
  1788  	//   "path": "configs/refs/{path}",
  1789  	//   "response": {
  1790  	//     "$ref": "LuciConfigGetConfigMultiResponseMessage"
  1791  	//   },
  1792  	//   "scopes": [
  1793  	//     "https://www.googleapis.com/auth/userinfo.email"
  1794  	//   ]
  1795  	// }
  1796  
  1797  }
  1798  
  1799  // method id "config.get_refs":
  1800  
  1801  type GetRefsCall struct {
  1802  	s            *Service
  1803  	projectId    string
  1804  	urlParams_   gensupport.URLParams
  1805  	ifNoneMatch_ string
  1806  	ctx_         context.Context
  1807  	header_      http.Header
  1808  }
  1809  
  1810  // GetRefs: Gets list of refs of a project.
  1811  //
  1812  // - projectId: .
  1813  func (s *Service) GetRefs(projectId string) *GetRefsCall {
  1814  	c := &GetRefsCall{s: s, urlParams_: make(gensupport.URLParams)}
  1815  	c.projectId = projectId
  1816  	return c
  1817  }
  1818  
  1819  // Fields allows partial responses to be retrieved. See
  1820  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1821  // for more information.
  1822  func (c *GetRefsCall) Fields(s ...googleapi.Field) *GetRefsCall {
  1823  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1824  	return c
  1825  }
  1826  
  1827  // IfNoneMatch sets the optional parameter which makes the operation
  1828  // fail if the object's ETag matches the given value. This is useful for
  1829  // getting updates only after the object has changed since the last
  1830  // request. Use googleapi.IsNotModified to check whether the response
  1831  // error from Do is the result of In-None-Match.
  1832  func (c *GetRefsCall) IfNoneMatch(entityTag string) *GetRefsCall {
  1833  	c.ifNoneMatch_ = entityTag
  1834  	return c
  1835  }
  1836  
  1837  // Context sets the context to be used in this call's Do method. Any
  1838  // pending HTTP request will be aborted if the provided context is
  1839  // canceled.
  1840  func (c *GetRefsCall) Context(ctx context.Context) *GetRefsCall {
  1841  	c.ctx_ = ctx
  1842  	return c
  1843  }
  1844  
  1845  // Header returns an http.Header that can be modified by the caller to
  1846  // add HTTP headers to the request.
  1847  func (c *GetRefsCall) Header() http.Header {
  1848  	if c.header_ == nil {
  1849  		c.header_ = make(http.Header)
  1850  	}
  1851  	return c.header_
  1852  }
  1853  
  1854  func (c *GetRefsCall) doRequest(alt string) (*http.Response, error) {
  1855  	reqHeaders := make(http.Header)
  1856  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  1857  	for k, v := range c.header_ {
  1858  		reqHeaders[k] = v
  1859  	}
  1860  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1861  	if c.ifNoneMatch_ != "" {
  1862  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1863  	}
  1864  	var body io.Reader = nil
  1865  	c.urlParams_.Set("alt", alt)
  1866  	c.urlParams_.Set("prettyPrint", "false")
  1867  	urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{project_id}/refs")
  1868  	urls += "?" + c.urlParams_.Encode()
  1869  	req, err := http.NewRequest("GET", urls, body)
  1870  	if err != nil {
  1871  		return nil, err
  1872  	}
  1873  	req.Header = reqHeaders
  1874  	googleapi.Expand(req.URL, map[string]string{
  1875  		"project_id": c.projectId,
  1876  	})
  1877  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1878  }
  1879  
  1880  // Do executes the "config.get_refs" call.
  1881  // Exactly one of *LuciConfigGetRefsResponseMessage or error will be
  1882  // non-nil. Any non-2xx status code is an error. Response headers are in
  1883  // either *LuciConfigGetRefsResponseMessage.ServerResponse.Header or (if
  1884  // a response was returned at all) in error.(*googleapi.Error).Header.
  1885  // Use googleapi.IsNotModified to check whether the returned error was
  1886  // because http.StatusNotModified was returned.
  1887  func (c *GetRefsCall) Do(opts ...googleapi.CallOption) (*LuciConfigGetRefsResponseMessage, error) {
  1888  	gensupport.SetOptions(c.urlParams_, opts...)
  1889  	res, err := c.doRequest("json")
  1890  	if res != nil && res.StatusCode == http.StatusNotModified {
  1891  		if res.Body != nil {
  1892  			res.Body.Close()
  1893  		}
  1894  		return nil, gensupport.WrapError(&googleapi.Error{
  1895  			Code:   res.StatusCode,
  1896  			Header: res.Header,
  1897  		})
  1898  	}
  1899  	if err != nil {
  1900  		return nil, err
  1901  	}
  1902  	defer googleapi.CloseBody(res)
  1903  	if err := googleapi.CheckResponse(res); err != nil {
  1904  		return nil, gensupport.WrapError(err)
  1905  	}
  1906  	ret := &LuciConfigGetRefsResponseMessage{
  1907  		ServerResponse: googleapi.ServerResponse{
  1908  			Header:         res.Header,
  1909  			HTTPStatusCode: res.StatusCode,
  1910  		},
  1911  	}
  1912  	target := &ret
  1913  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1914  		return nil, err
  1915  	}
  1916  	return ret, nil
  1917  	// {
  1918  	//   "description": "Gets list of refs of a project.",
  1919  	//   "httpMethod": "GET",
  1920  	//   "id": "config.get_refs",
  1921  	//   "parameterOrder": [
  1922  	//     "project_id"
  1923  	//   ],
  1924  	//   "parameters": {
  1925  	//     "project_id": {
  1926  	//       "location": "path",
  1927  	//       "required": true,
  1928  	//       "type": "string"
  1929  	//     }
  1930  	//   },
  1931  	//   "path": "projects/{project_id}/refs",
  1932  	//   "response": {
  1933  	//     "$ref": "LuciConfigGetRefsResponseMessage"
  1934  	//   },
  1935  	//   "scopes": [
  1936  	//     "https://www.googleapis.com/auth/userinfo.email"
  1937  	//   ]
  1938  	// }
  1939  
  1940  }
  1941  
  1942  // method id "config.reimport":
  1943  
  1944  type ReimportCall struct {
  1945  	s          *Service
  1946  	urlParams_ gensupport.URLParams
  1947  	ctx_       context.Context
  1948  	header_    http.Header
  1949  }
  1950  
  1951  // Reimport: Reimports a config set.
  1952  //
  1953  // - configSet: .
  1954  func (s *Service) Reimport(configSet string) *ReimportCall {
  1955  	c := &ReimportCall{s: s, urlParams_: make(gensupport.URLParams)}
  1956  	c.urlParams_.Set("config_set", configSet)
  1957  	return c
  1958  }
  1959  
  1960  // Fields allows partial responses to be retrieved. See
  1961  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1962  // for more information.
  1963  func (c *ReimportCall) Fields(s ...googleapi.Field) *ReimportCall {
  1964  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1965  	return c
  1966  }
  1967  
  1968  // Context sets the context to be used in this call's Do method. Any
  1969  // pending HTTP request will be aborted if the provided context is
  1970  // canceled.
  1971  func (c *ReimportCall) Context(ctx context.Context) *ReimportCall {
  1972  	c.ctx_ = ctx
  1973  	return c
  1974  }
  1975  
  1976  // Header returns an http.Header that can be modified by the caller to
  1977  // add HTTP headers to the request.
  1978  func (c *ReimportCall) Header() http.Header {
  1979  	if c.header_ == nil {
  1980  		c.header_ = make(http.Header)
  1981  	}
  1982  	return c.header_
  1983  }
  1984  
  1985  func (c *ReimportCall) doRequest(alt string) (*http.Response, error) {
  1986  	reqHeaders := make(http.Header)
  1987  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  1988  	for k, v := range c.header_ {
  1989  		reqHeaders[k] = v
  1990  	}
  1991  	reqHeaders.Set("User-Agent", c.s.userAgent())
  1992  	var body io.Reader = nil
  1993  	c.urlParams_.Set("alt", alt)
  1994  	c.urlParams_.Set("prettyPrint", "false")
  1995  	urls := googleapi.ResolveRelative(c.s.BasePath, "reimport")
  1996  	urls += "?" + c.urlParams_.Encode()
  1997  	req, err := http.NewRequest("POST", urls, body)
  1998  	if err != nil {
  1999  		return nil, err
  2000  	}
  2001  	req.Header = reqHeaders
  2002  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2003  }
  2004  
  2005  // Do executes the "config.reimport" call.
  2006  func (c *ReimportCall) Do(opts ...googleapi.CallOption) error {
  2007  	gensupport.SetOptions(c.urlParams_, opts...)
  2008  	res, err := c.doRequest("json")
  2009  	if err != nil {
  2010  		return err
  2011  	}
  2012  	defer googleapi.CloseBody(res)
  2013  	if err := googleapi.CheckResponse(res); err != nil {
  2014  		return gensupport.WrapError(err)
  2015  	}
  2016  	return nil
  2017  	// {
  2018  	//   "description": "Reimports a config set.",
  2019  	//   "httpMethod": "POST",
  2020  	//   "id": "config.reimport",
  2021  	//   "parameterOrder": [
  2022  	//     "config_set"
  2023  	//   ],
  2024  	//   "parameters": {
  2025  	//     "config_set": {
  2026  	//       "location": "query",
  2027  	//       "required": true,
  2028  	//       "type": "string"
  2029  	//     }
  2030  	//   },
  2031  	//   "path": "reimport",
  2032  	//   "scopes": [
  2033  	//     "https://www.googleapis.com/auth/userinfo.email"
  2034  	//   ]
  2035  	// }
  2036  
  2037  }
  2038  
  2039  // method id "config.validate_config":
  2040  
  2041  type ValidateConfigCall struct {
  2042  	s                                      *Service
  2043  	luciconfigvalidateconfigrequestmessage *LuciConfigValidateConfigRequestMessage
  2044  	urlParams_                             gensupport.URLParams
  2045  	ctx_                                   context.Context
  2046  	header_                                http.Header
  2047  }
  2048  
  2049  // ValidateConfig:
  2050  func (s *Service) ValidateConfig(luciconfigvalidateconfigrequestmessage *LuciConfigValidateConfigRequestMessage) *ValidateConfigCall {
  2051  	c := &ValidateConfigCall{s: s, urlParams_: make(gensupport.URLParams)}
  2052  	c.luciconfigvalidateconfigrequestmessage = luciconfigvalidateconfigrequestmessage
  2053  	return c
  2054  }
  2055  
  2056  // Fields allows partial responses to be retrieved. See
  2057  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2058  // for more information.
  2059  func (c *ValidateConfigCall) Fields(s ...googleapi.Field) *ValidateConfigCall {
  2060  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2061  	return c
  2062  }
  2063  
  2064  // Context sets the context to be used in this call's Do method. Any
  2065  // pending HTTP request will be aborted if the provided context is
  2066  // canceled.
  2067  func (c *ValidateConfigCall) Context(ctx context.Context) *ValidateConfigCall {
  2068  	c.ctx_ = ctx
  2069  	return c
  2070  }
  2071  
  2072  // Header returns an http.Header that can be modified by the caller to
  2073  // add HTTP headers to the request.
  2074  func (c *ValidateConfigCall) Header() http.Header {
  2075  	if c.header_ == nil {
  2076  		c.header_ = make(http.Header)
  2077  	}
  2078  	return c.header_
  2079  }
  2080  
  2081  func (c *ValidateConfigCall) doRequest(alt string) (*http.Response, error) {
  2082  	reqHeaders := make(http.Header)
  2083  	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/"+"luci-go")
  2084  	for k, v := range c.header_ {
  2085  		reqHeaders[k] = v
  2086  	}
  2087  	reqHeaders.Set("User-Agent", c.s.userAgent())
  2088  	var body io.Reader = nil
  2089  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.luciconfigvalidateconfigrequestmessage)
  2090  	if err != nil {
  2091  		return nil, err
  2092  	}
  2093  	reqHeaders.Set("Content-Type", "application/json")
  2094  	c.urlParams_.Set("alt", alt)
  2095  	c.urlParams_.Set("prettyPrint", "false")
  2096  	urls := googleapi.ResolveRelative(c.s.BasePath, "validate-config")
  2097  	urls += "?" + c.urlParams_.Encode()
  2098  	req, err := http.NewRequest("POST", urls, body)
  2099  	if err != nil {
  2100  		return nil, err
  2101  	}
  2102  	req.Header = reqHeaders
  2103  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2104  }
  2105  
  2106  // Do executes the "config.validate_config" call.
  2107  // Exactly one of *LuciConfigValidateConfigResponseMessage or error will
  2108  // be non-nil. Any non-2xx status code is an error. Response headers are
  2109  // in either
  2110  // *LuciConfigValidateConfigResponseMessage.ServerResponse.Header or (if
  2111  // a response was returned at all) in error.(*googleapi.Error).Header.
  2112  // Use googleapi.IsNotModified to check whether the returned error was
  2113  // because http.StatusNotModified was returned.
  2114  func (c *ValidateConfigCall) Do(opts ...googleapi.CallOption) (*LuciConfigValidateConfigResponseMessage, error) {
  2115  	gensupport.SetOptions(c.urlParams_, opts...)
  2116  	res, err := c.doRequest("json")
  2117  	if res != nil && res.StatusCode == http.StatusNotModified {
  2118  		if res.Body != nil {
  2119  			res.Body.Close()
  2120  		}
  2121  		return nil, gensupport.WrapError(&googleapi.Error{
  2122  			Code:   res.StatusCode,
  2123  			Header: res.Header,
  2124  		})
  2125  	}
  2126  	if err != nil {
  2127  		return nil, err
  2128  	}
  2129  	defer googleapi.CloseBody(res)
  2130  	if err := googleapi.CheckResponse(res); err != nil {
  2131  		return nil, gensupport.WrapError(err)
  2132  	}
  2133  	ret := &LuciConfigValidateConfigResponseMessage{
  2134  		ServerResponse: googleapi.ServerResponse{
  2135  			Header:         res.Header,
  2136  			HTTPStatusCode: res.StatusCode,
  2137  		},
  2138  	}
  2139  	target := &ret
  2140  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2141  		return nil, err
  2142  	}
  2143  	return ret, nil
  2144  	// {
  2145  	//   "httpMethod": "POST",
  2146  	//   "id": "config.validate_config",
  2147  	//   "path": "validate-config",
  2148  	//   "request": {
  2149  	//     "$ref": "LuciConfigValidateConfigRequestMessage",
  2150  	//     "parameterName": "resource"
  2151  	//   },
  2152  	//   "response": {
  2153  	//     "$ref": "LuciConfigValidateConfigResponseMessage"
  2154  	//   },
  2155  	//   "scopes": [
  2156  	//     "https://www.googleapis.com/auth/userinfo.email"
  2157  	//   ]
  2158  	// }
  2159  
  2160  }