...

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

Documentation: google.golang.org/api/script/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 script provides access to the Apps Script API.
     8  //
     9  // For product documentation, see: https://developers.google.com/apps-script/api/
    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/script/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	scriptService, err := script.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  // By default, all available scopes (see "Constants") are used to authenticate.
    38  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    39  //
    40  //	scriptService, err := script.NewService(ctx, option.WithScopes(script.UserinfoEmailScope))
    41  //
    42  // To use an API key for authentication (note: some APIs do not support API
    43  // keys), use [google.golang.org/api/option.WithAPIKey]:
    44  //
    45  //	scriptService, err := script.NewService(ctx, option.WithAPIKey("AIza..."))
    46  //
    47  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    48  // flow, use [google.golang.org/api/option.WithTokenSource]:
    49  //
    50  //	config := &oauth2.Config{...}
    51  //	// ...
    52  //	token, err := config.Exchange(ctx, ...)
    53  //	scriptService, err := script.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    54  //
    55  // See [google.golang.org/api/option.ClientOption] for details on options.
    56  package script // import "google.golang.org/api/script/v1"
    57  
    58  import (
    59  	"bytes"
    60  	"context"
    61  	"encoding/json"
    62  	"errors"
    63  	"fmt"
    64  	"io"
    65  	"net/http"
    66  	"net/url"
    67  	"strconv"
    68  	"strings"
    69  
    70  	googleapi "google.golang.org/api/googleapi"
    71  	internal "google.golang.org/api/internal"
    72  	gensupport "google.golang.org/api/internal/gensupport"
    73  	option "google.golang.org/api/option"
    74  	internaloption "google.golang.org/api/option/internaloption"
    75  	htransport "google.golang.org/api/transport/http"
    76  )
    77  
    78  // Always reference these packages, just in case the auto-generated code
    79  // below doesn't.
    80  var _ = bytes.NewBuffer
    81  var _ = strconv.Itoa
    82  var _ = fmt.Sprintf
    83  var _ = json.NewDecoder
    84  var _ = io.Copy
    85  var _ = url.Parse
    86  var _ = gensupport.MarshalJSON
    87  var _ = googleapi.Version
    88  var _ = errors.New
    89  var _ = strings.Replace
    90  var _ = context.Canceled
    91  var _ = internaloption.WithDefaultEndpoint
    92  var _ = internal.Version
    93  
    94  const apiId = "script:v1"
    95  const apiName = "script"
    96  const apiVersion = "v1"
    97  const basePath = "https://script.googleapis.com/"
    98  const basePathTemplate = "https://script.UNIVERSE_DOMAIN/"
    99  const mtlsBasePath = "https://script.mtls.googleapis.com/"
   100  
   101  // OAuth2 scopes used by this API.
   102  const (
   103  	// Read, compose, send, and permanently delete all your email from Gmail
   104  	MailGoogleComScope = "https://mail.google.com/"
   105  
   106  	// See, edit, share, and permanently delete all the calendars you can access
   107  	// using Google Calendar
   108  	WwwGoogleComCalendarFeedsScope = "https://www.google.com/calendar/feeds"
   109  
   110  	// See, edit, download, and permanently delete your contacts
   111  	WwwGoogleComM8FeedsScope = "https://www.google.com/m8/feeds"
   112  
   113  	// View and manage the provisioning of groups on your domain
   114  	AdminDirectoryGroupScope = "https://www.googleapis.com/auth/admin.directory.group"
   115  
   116  	// View and manage the provisioning of users on your domain
   117  	AdminDirectoryUserScope = "https://www.googleapis.com/auth/admin.directory.user"
   118  
   119  	// See, edit, create, and delete all your Google Docs documents
   120  	DocumentsScope = "https://www.googleapis.com/auth/documents"
   121  
   122  	// See, edit, create, and delete all of your Google Drive files
   123  	DriveScope = "https://www.googleapis.com/auth/drive"
   124  
   125  	// View and manage your forms in Google Drive
   126  	FormsScope = "https://www.googleapis.com/auth/forms"
   127  
   128  	// View and manage forms that this application has been installed in
   129  	FormsCurrentonlyScope = "https://www.googleapis.com/auth/forms.currentonly"
   130  
   131  	// View and manage your Google Groups
   132  	GroupsScope = "https://www.googleapis.com/auth/groups"
   133  
   134  	// Create and update Google Apps Script deployments
   135  	ScriptDeploymentsScope = "https://www.googleapis.com/auth/script.deployments"
   136  
   137  	// View Google Apps Script deployments
   138  	ScriptDeploymentsReadonlyScope = "https://www.googleapis.com/auth/script.deployments.readonly"
   139  
   140  	// View Google Apps Script project's metrics
   141  	ScriptMetricsScope = "https://www.googleapis.com/auth/script.metrics"
   142  
   143  	// View Google Apps Script processes
   144  	ScriptProcessesScope = "https://www.googleapis.com/auth/script.processes"
   145  
   146  	// Create and update Google Apps Script projects
   147  	ScriptProjectsScope = "https://www.googleapis.com/auth/script.projects"
   148  
   149  	// View Google Apps Script projects
   150  	ScriptProjectsReadonlyScope = "https://www.googleapis.com/auth/script.projects.readonly"
   151  
   152  	// See, edit, create, and delete all your Google Sheets spreadsheets
   153  	SpreadsheetsScope = "https://www.googleapis.com/auth/spreadsheets"
   154  
   155  	// See your primary Google Account email address
   156  	UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
   157  )
   158  
   159  // NewService creates a new Service.
   160  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   161  	scopesOption := internaloption.WithDefaultScopes(
   162  		"https://mail.google.com/",
   163  		"https://www.google.com/calendar/feeds",
   164  		"https://www.google.com/m8/feeds",
   165  		"https://www.googleapis.com/auth/admin.directory.group",
   166  		"https://www.googleapis.com/auth/admin.directory.user",
   167  		"https://www.googleapis.com/auth/documents",
   168  		"https://www.googleapis.com/auth/drive",
   169  		"https://www.googleapis.com/auth/forms",
   170  		"https://www.googleapis.com/auth/forms.currentonly",
   171  		"https://www.googleapis.com/auth/groups",
   172  		"https://www.googleapis.com/auth/script.deployments",
   173  		"https://www.googleapis.com/auth/script.deployments.readonly",
   174  		"https://www.googleapis.com/auth/script.metrics",
   175  		"https://www.googleapis.com/auth/script.processes",
   176  		"https://www.googleapis.com/auth/script.projects",
   177  		"https://www.googleapis.com/auth/script.projects.readonly",
   178  		"https://www.googleapis.com/auth/spreadsheets",
   179  		"https://www.googleapis.com/auth/userinfo.email",
   180  	)
   181  	// NOTE: prepend, so we don't override user-specified scopes.
   182  	opts = append([]option.ClientOption{scopesOption}, opts...)
   183  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   184  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   185  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   186  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   187  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   188  	if err != nil {
   189  		return nil, err
   190  	}
   191  	s, err := New(client)
   192  	if err != nil {
   193  		return nil, err
   194  	}
   195  	if endpoint != "" {
   196  		s.BasePath = endpoint
   197  	}
   198  	return s, nil
   199  }
   200  
   201  // New creates a new Service. It uses the provided http.Client for requests.
   202  //
   203  // Deprecated: please use NewService instead.
   204  // To provide a custom HTTP client, use option.WithHTTPClient.
   205  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   206  func New(client *http.Client) (*Service, error) {
   207  	if client == nil {
   208  		return nil, errors.New("client is nil")
   209  	}
   210  	s := &Service{client: client, BasePath: basePath}
   211  	s.Processes = NewProcessesService(s)
   212  	s.Projects = NewProjectsService(s)
   213  	s.Scripts = NewScriptsService(s)
   214  	return s, nil
   215  }
   216  
   217  type Service struct {
   218  	client    *http.Client
   219  	BasePath  string // API endpoint base URL
   220  	UserAgent string // optional additional User-Agent fragment
   221  
   222  	Processes *ProcessesService
   223  
   224  	Projects *ProjectsService
   225  
   226  	Scripts *ScriptsService
   227  }
   228  
   229  func (s *Service) userAgent() string {
   230  	if s.UserAgent == "" {
   231  		return googleapi.UserAgent
   232  	}
   233  	return googleapi.UserAgent + " " + s.UserAgent
   234  }
   235  
   236  func NewProcessesService(s *Service) *ProcessesService {
   237  	rs := &ProcessesService{s: s}
   238  	return rs
   239  }
   240  
   241  type ProcessesService struct {
   242  	s *Service
   243  }
   244  
   245  func NewProjectsService(s *Service) *ProjectsService {
   246  	rs := &ProjectsService{s: s}
   247  	rs.Deployments = NewProjectsDeploymentsService(s)
   248  	rs.Versions = NewProjectsVersionsService(s)
   249  	return rs
   250  }
   251  
   252  type ProjectsService struct {
   253  	s *Service
   254  
   255  	Deployments *ProjectsDeploymentsService
   256  
   257  	Versions *ProjectsVersionsService
   258  }
   259  
   260  func NewProjectsDeploymentsService(s *Service) *ProjectsDeploymentsService {
   261  	rs := &ProjectsDeploymentsService{s: s}
   262  	return rs
   263  }
   264  
   265  type ProjectsDeploymentsService struct {
   266  	s *Service
   267  }
   268  
   269  func NewProjectsVersionsService(s *Service) *ProjectsVersionsService {
   270  	rs := &ProjectsVersionsService{s: s}
   271  	return rs
   272  }
   273  
   274  type ProjectsVersionsService struct {
   275  	s *Service
   276  }
   277  
   278  func NewScriptsService(s *Service) *ScriptsService {
   279  	rs := &ScriptsService{s: s}
   280  	return rs
   281  }
   282  
   283  type ScriptsService struct {
   284  	s *Service
   285  }
   286  
   287  // Content: The Content resource.
   288  type Content struct {
   289  	// Files: The list of script project files. One of the files is a script
   290  	// manifest; it must be named "appsscript", must have type of JSON, and include
   291  	// the manifest configurations for the project.
   292  	Files []*File `json:"files,omitempty"`
   293  	// ScriptId: The script project's Drive ID.
   294  	ScriptId string `json:"scriptId,omitempty"`
   295  
   296  	// ServerResponse contains the HTTP response code and headers from the server.
   297  	googleapi.ServerResponse `json:"-"`
   298  	// ForceSendFields is a list of field names (e.g. "Files") to unconditionally
   299  	// include in API requests. By default, fields with empty or default values are
   300  	// omitted from API requests. See
   301  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   302  	// details.
   303  	ForceSendFields []string `json:"-"`
   304  	// NullFields is a list of field names (e.g. "Files") to include in API
   305  	// requests with the JSON null value. By default, fields with empty values are
   306  	// omitted from API requests. See
   307  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   308  	NullFields []string `json:"-"`
   309  }
   310  
   311  func (s *Content) MarshalJSON() ([]byte, error) {
   312  	type NoMethod Content
   313  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   314  }
   315  
   316  // CreateProjectRequest: Request to create a script project. Request to create
   317  // a script project.
   318  type CreateProjectRequest struct {
   319  	// ParentId: The Drive ID of a parent file that the created script project is
   320  	// bound to. This is usually the ID of a Google Doc, Google Sheet, Google Form,
   321  	// or Google Slides file. If not set, a standalone script project is created.
   322  	ParentId string `json:"parentId,omitempty"`
   323  	// Title: The title for the project.
   324  	Title string `json:"title,omitempty"`
   325  	// ForceSendFields is a list of field names (e.g. "ParentId") to
   326  	// unconditionally include in API requests. By default, fields with empty or
   327  	// default values are omitted from API requests. See
   328  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   329  	// details.
   330  	ForceSendFields []string `json:"-"`
   331  	// NullFields is a list of field names (e.g. "ParentId") to include in API
   332  	// requests with the JSON null value. By default, fields with empty values are
   333  	// omitted from API requests. See
   334  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   335  	NullFields []string `json:"-"`
   336  }
   337  
   338  func (s *CreateProjectRequest) MarshalJSON() ([]byte, error) {
   339  	type NoMethod CreateProjectRequest
   340  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   341  }
   342  
   343  // Deployment: Representation of a single script deployment.
   344  type Deployment struct {
   345  	// DeploymentConfig: The deployment configuration.
   346  	DeploymentConfig *DeploymentConfig `json:"deploymentConfig,omitempty"`
   347  	// DeploymentId: The deployment ID for this deployment.
   348  	DeploymentId string `json:"deploymentId,omitempty"`
   349  	// EntryPoints: The deployment's entry points.
   350  	EntryPoints []*EntryPoint `json:"entryPoints,omitempty"`
   351  	// UpdateTime: Last modified date time stamp.
   352  	UpdateTime string `json:"updateTime,omitempty"`
   353  
   354  	// ServerResponse contains the HTTP response code and headers from the server.
   355  	googleapi.ServerResponse `json:"-"`
   356  	// ForceSendFields is a list of field names (e.g. "DeploymentConfig") to
   357  	// unconditionally include in API requests. By default, fields with empty or
   358  	// default values are omitted from API requests. See
   359  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   360  	// details.
   361  	ForceSendFields []string `json:"-"`
   362  	// NullFields is a list of field names (e.g. "DeploymentConfig") to include in
   363  	// API requests with the JSON null value. By default, fields with empty values
   364  	// are omitted from API requests. See
   365  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   366  	NullFields []string `json:"-"`
   367  }
   368  
   369  func (s *Deployment) MarshalJSON() ([]byte, error) {
   370  	type NoMethod Deployment
   371  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   372  }
   373  
   374  // DeploymentConfig: Metadata the defines how a deployment is configured.
   375  type DeploymentConfig struct {
   376  	// Description: The description for this deployment.
   377  	Description string `json:"description,omitempty"`
   378  	// ManifestFileName: The manifest file name for this deployment.
   379  	ManifestFileName string `json:"manifestFileName,omitempty"`
   380  	// ScriptId: The script project's Drive ID.
   381  	ScriptId string `json:"scriptId,omitempty"`
   382  	// VersionNumber: The version number on which this deployment is based.
   383  	VersionNumber int64 `json:"versionNumber,omitempty"`
   384  	// ForceSendFields is a list of field names (e.g. "Description") to
   385  	// unconditionally include in API requests. By default, fields with empty or
   386  	// default values are omitted from API requests. See
   387  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   388  	// details.
   389  	ForceSendFields []string `json:"-"`
   390  	// NullFields is a list of field names (e.g. "Description") to include in API
   391  	// requests with the JSON null value. By default, fields with empty values are
   392  	// omitted from API requests. See
   393  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   394  	NullFields []string `json:"-"`
   395  }
   396  
   397  func (s *DeploymentConfig) MarshalJSON() ([]byte, error) {
   398  	type NoMethod DeploymentConfig
   399  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   400  }
   401  
   402  // Empty: A generic empty message that you can re-use to avoid defining
   403  // duplicated empty messages in your APIs. A typical example is to use it as
   404  // the request or the response type of an API method. For instance: service Foo
   405  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
   406  type Empty struct {
   407  	// ServerResponse contains the HTTP response code and headers from the server.
   408  	googleapi.ServerResponse `json:"-"`
   409  }
   410  
   411  // EntryPoint: A configuration that defines how a deployment is accessed
   412  // externally.
   413  type EntryPoint struct {
   414  	// AddOn: Add-on properties.
   415  	AddOn *GoogleAppsScriptTypeAddOnEntryPoint `json:"addOn,omitempty"`
   416  	// EntryPointType: The type of the entry point.
   417  	//
   418  	// Possible values:
   419  	//   "ENTRY_POINT_TYPE_UNSPECIFIED" - An unspecified entry point.
   420  	//   "WEB_APP" - A web application entry point.
   421  	//   "EXECUTION_API" - An API executable entry point.
   422  	//   "ADD_ON" - An Add-On entry point.
   423  	EntryPointType string `json:"entryPointType,omitempty"`
   424  	// ExecutionApi: An entry point specification for Apps Script API execution
   425  	// calls.
   426  	ExecutionApi *GoogleAppsScriptTypeExecutionApiEntryPoint `json:"executionApi,omitempty"`
   427  	// WebApp: An entry point specification for web apps.
   428  	WebApp *GoogleAppsScriptTypeWebAppEntryPoint `json:"webApp,omitempty"`
   429  	// ForceSendFields is a list of field names (e.g. "AddOn") to unconditionally
   430  	// include in API requests. By default, fields with empty or default values are
   431  	// omitted from API requests. See
   432  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   433  	// details.
   434  	ForceSendFields []string `json:"-"`
   435  	// NullFields is a list of field names (e.g. "AddOn") to include in API
   436  	// requests with the JSON null value. By default, fields with empty values are
   437  	// omitted from API requests. See
   438  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   439  	NullFields []string `json:"-"`
   440  }
   441  
   442  func (s *EntryPoint) MarshalJSON() ([]byte, error) {
   443  	type NoMethod EntryPoint
   444  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   445  }
   446  
   447  // ExecuteStreamResponse: The response for executing or debugging a function in
   448  // an Apps Script project.
   449  type ExecuteStreamResponse struct {
   450  	// Result: The result of the execution.
   451  	Result *ScriptExecutionResult `json:"result,omitempty"`
   452  	// ForceSendFields is a list of field names (e.g. "Result") to unconditionally
   453  	// include in API requests. By default, fields with empty or default values are
   454  	// omitted from API requests. See
   455  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   456  	// details.
   457  	ForceSendFields []string `json:"-"`
   458  	// NullFields is a list of field names (e.g. "Result") to include in API
   459  	// requests with the JSON null value. By default, fields with empty values are
   460  	// omitted from API requests. See
   461  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   462  	NullFields []string `json:"-"`
   463  }
   464  
   465  func (s *ExecuteStreamResponse) MarshalJSON() ([]byte, error) {
   466  	type NoMethod ExecuteStreamResponse
   467  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   468  }
   469  
   470  // ExecutionError: An object that provides information about the nature of an
   471  // error resulting from an attempted execution of a script function using the
   472  // Apps Script API. If a run call succeeds but the script function (or Apps
   473  // Script itself) throws an exception, the response body's error field contains
   474  // a Status object. The `Status` object's `details` field contains an array
   475  // with a single one of these `ExecutionError` objects.
   476  type ExecutionError struct {
   477  	// ErrorMessage: The error message thrown by Apps Script, usually localized
   478  	// into the user's language.
   479  	ErrorMessage string `json:"errorMessage,omitempty"`
   480  	// ErrorType: The error type, for example `TypeError` or `ReferenceError`. If
   481  	// the error type is unavailable, this field is not included.
   482  	ErrorType string `json:"errorType,omitempty"`
   483  	// ScriptStackTraceElements: An array of objects that provide a stack trace
   484  	// through the script to show where the execution failed, with the deepest call
   485  	// first.
   486  	ScriptStackTraceElements []*ScriptStackTraceElement `json:"scriptStackTraceElements,omitempty"`
   487  	// ForceSendFields is a list of field names (e.g. "ErrorMessage") to
   488  	// unconditionally include in API requests. By default, fields with empty or
   489  	// default values are omitted from API requests. See
   490  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   491  	// details.
   492  	ForceSendFields []string `json:"-"`
   493  	// NullFields is a list of field names (e.g. "ErrorMessage") to include in API
   494  	// requests with the JSON null value. By default, fields with empty values are
   495  	// omitted from API requests. See
   496  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   497  	NullFields []string `json:"-"`
   498  }
   499  
   500  func (s *ExecutionError) MarshalJSON() ([]byte, error) {
   501  	type NoMethod ExecutionError
   502  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   503  }
   504  
   505  // ExecutionRequest: A request to run the function in a script. The script is
   506  // identified by the specified `script_id`. Executing a function on a script
   507  // returns results based on the implementation of the script.
   508  type ExecutionRequest struct {
   509  	// DevMode: If `true` and the user is an owner of the script, the script runs
   510  	// at the most recently saved version rather than the version deployed for use
   511  	// with the Apps Script API. Optional; default is `false`.
   512  	DevMode bool `json:"devMode,omitempty"`
   513  	// Function: The name of the function to execute in the given script. The name
   514  	// does not include parentheses or parameters. It can reference a function in
   515  	// an included library such as `Library.libFunction1`.
   516  	Function string `json:"function,omitempty"`
   517  	// Parameters: The parameters to be passed to the function being executed. The
   518  	// object type for each parameter should match the expected type in Apps
   519  	// Script. Parameters cannot be Apps Script-specific object types (such as a
   520  	// `Document` or a `Calendar`); they can only be primitive types such as
   521  	// `string`, `number`, `array`, `object`, or `boolean`. Optional.
   522  	Parameters []interface{} `json:"parameters,omitempty"`
   523  	// SessionState: *Deprecated*. For use with Android add-ons only. An ID that
   524  	// represents the user's current session in the Android app for Google Docs or
   525  	// Sheets, included as extra data in the Intent
   526  	// (https://developer.android.com/guide/components/intents-filters.html) that
   527  	// launches the add-on. When an Android add-on is run with a session state, it
   528  	// gains the privileges of a bound
   529  	// (https://developers.google.com/apps-script/guides/bound) script—that is,
   530  	// it can access information like the user's current cursor position (in Docs)
   531  	// or selected cell (in Sheets). To retrieve the state, call
   532  	// `Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState")`.
   533  	// Optional.
   534  	SessionState string `json:"sessionState,omitempty"`
   535  	// ForceSendFields is a list of field names (e.g. "DevMode") to unconditionally
   536  	// include in API requests. By default, fields with empty or default values are
   537  	// omitted from API requests. See
   538  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   539  	// details.
   540  	ForceSendFields []string `json:"-"`
   541  	// NullFields is a list of field names (e.g. "DevMode") to include in API
   542  	// requests with the JSON null value. By default, fields with empty values are
   543  	// omitted from API requests. See
   544  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   545  	NullFields []string `json:"-"`
   546  }
   547  
   548  func (s *ExecutionRequest) MarshalJSON() ([]byte, error) {
   549  	type NoMethod ExecutionRequest
   550  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   551  }
   552  
   553  // ExecutionResponse: An object that provides the return value of a function
   554  // executed using the Apps Script API. If the script function returns
   555  // successfully, the response body's response field contains this
   556  // `ExecutionResponse` object.
   557  type ExecutionResponse struct {
   558  	// Result: The return value of the script function. The type matches the object
   559  	// type returned in Apps Script. Functions called using the Apps Script API
   560  	// cannot return Apps Script-specific objects (such as a `Document` or a
   561  	// `Calendar`); they can only return primitive types such as a `string`,
   562  	// `number`, `array`, `object`, or `boolean`.
   563  	Result interface{} `json:"result,omitempty"`
   564  	// ForceSendFields is a list of field names (e.g. "Result") to unconditionally
   565  	// include in API requests. By default, fields with empty or default values are
   566  	// omitted from API requests. See
   567  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   568  	// details.
   569  	ForceSendFields []string `json:"-"`
   570  	// NullFields is a list of field names (e.g. "Result") to include in API
   571  	// requests with the JSON null value. By default, fields with empty values are
   572  	// omitted from API requests. See
   573  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   574  	NullFields []string `json:"-"`
   575  }
   576  
   577  func (s *ExecutionResponse) MarshalJSON() ([]byte, error) {
   578  	type NoMethod ExecutionResponse
   579  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   580  }
   581  
   582  // File: An individual file within a script project. A file is a third-party
   583  // source code created by one or more developers. It can be a server-side JS
   584  // code, HTML, or a configuration file. Each script project can contain
   585  // multiple files.
   586  type File struct {
   587  	// CreateTime: Creation date timestamp. This read-only field is only visible to
   588  	// users who have WRITER permission for the script project.
   589  	CreateTime string `json:"createTime,omitempty"`
   590  	// FunctionSet: The defined set of functions in the script file, if any.
   591  	FunctionSet *GoogleAppsScriptTypeFunctionSet `json:"functionSet,omitempty"`
   592  	// LastModifyUser: The user who modified the file most recently. This read-only
   593  	// field is only visible to users who have WRITER permission for the script
   594  	// project.
   595  	LastModifyUser *GoogleAppsScriptTypeUser `json:"lastModifyUser,omitempty"`
   596  	// Name: The name of the file. The file extension is not part of the file name,
   597  	// which can be identified from the type field.
   598  	Name string `json:"name,omitempty"`
   599  	// Source: The file content.
   600  	Source string `json:"source,omitempty"`
   601  	// Type: The type of the file.
   602  	//
   603  	// Possible values:
   604  	//   "ENUM_TYPE_UNSPECIFIED" - Undetermined file type; never actually used.
   605  	//   "SERVER_JS" - An Apps Script server-side code file.
   606  	//   "HTML" - A file containing client-side HTML.
   607  	//   "JSON" - A file in JSON format. This type is only used for the script
   608  	// project's manifest. The manifest file content must match the structure of a
   609  	// valid [ScriptManifest](/apps-script/concepts/manifests)
   610  	Type string `json:"type,omitempty"`
   611  	// UpdateTime: Last modified date timestamp. This read-only field is only
   612  	// visible to users who have WRITER permission for the script project.
   613  	UpdateTime string `json:"updateTime,omitempty"`
   614  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
   615  	// unconditionally include in API requests. By default, fields with empty or
   616  	// default values are omitted from API requests. See
   617  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   618  	// details.
   619  	ForceSendFields []string `json:"-"`
   620  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
   621  	// requests with the JSON null value. By default, fields with empty values are
   622  	// omitted from API requests. See
   623  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   624  	NullFields []string `json:"-"`
   625  }
   626  
   627  func (s *File) MarshalJSON() ([]byte, error) {
   628  	type NoMethod File
   629  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   630  }
   631  
   632  // GoogleAppsScriptTypeAddOnEntryPoint: An add-on entry point.
   633  type GoogleAppsScriptTypeAddOnEntryPoint struct {
   634  	// AddOnType: The add-on's required list of supported container types.
   635  	//
   636  	// Possible values:
   637  	//   "UNKNOWN_ADDON_TYPE" - Default value, unknown add-on type.
   638  	//   "GMAIL" - Add-on type for Gmail.
   639  	//   "DATA_STUDIO" - Add-on type for Data Studio.
   640  	AddOnType string `json:"addOnType,omitempty"`
   641  	// Description: The add-on's optional description.
   642  	Description string `json:"description,omitempty"`
   643  	// HelpUrl: The add-on's optional help URL.
   644  	HelpUrl string `json:"helpUrl,omitempty"`
   645  	// PostInstallTipUrl: The add-on's required post install tip URL.
   646  	PostInstallTipUrl string `json:"postInstallTipUrl,omitempty"`
   647  	// ReportIssueUrl: The add-on's optional report issue URL.
   648  	ReportIssueUrl string `json:"reportIssueUrl,omitempty"`
   649  	// Title: The add-on's required title.
   650  	Title string `json:"title,omitempty"`
   651  	// ForceSendFields is a list of field names (e.g. "AddOnType") to
   652  	// unconditionally include in API requests. By default, fields with empty or
   653  	// default values are omitted from API requests. See
   654  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   655  	// details.
   656  	ForceSendFields []string `json:"-"`
   657  	// NullFields is a list of field names (e.g. "AddOnType") to include in API
   658  	// requests with the JSON null value. By default, fields with empty values are
   659  	// omitted from API requests. See
   660  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   661  	NullFields []string `json:"-"`
   662  }
   663  
   664  func (s *GoogleAppsScriptTypeAddOnEntryPoint) MarshalJSON() ([]byte, error) {
   665  	type NoMethod GoogleAppsScriptTypeAddOnEntryPoint
   666  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   667  }
   668  
   669  // GoogleAppsScriptTypeExecutionApiConfig: API executable entry point
   670  // configuration.
   671  type GoogleAppsScriptTypeExecutionApiConfig struct {
   672  	// Access: Who has permission to run the API executable.
   673  	//
   674  	// Possible values:
   675  	//   "UNKNOWN_ACCESS" - Default value, should not be used.
   676  	//   "MYSELF" - Only the user who deployed the web app or executable can access
   677  	// it. Note that this is not necessarily the owner of the script project.
   678  	//   "DOMAIN" - Only users in the same domain as the user who deployed the web
   679  	// app or executable can access it.
   680  	//   "ANYONE" - Any logged in user can access the web app or executable.
   681  	//   "ANYONE_ANONYMOUS" - Any user, logged in or not, can access the web app or
   682  	// executable.
   683  	Access string `json:"access,omitempty"`
   684  	// ForceSendFields is a list of field names (e.g. "Access") to unconditionally
   685  	// include in API requests. By default, fields with empty or default values are
   686  	// omitted from API requests. See
   687  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   688  	// details.
   689  	ForceSendFields []string `json:"-"`
   690  	// NullFields is a list of field names (e.g. "Access") to include in API
   691  	// requests with the JSON null value. By default, fields with empty values are
   692  	// omitted from API requests. See
   693  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   694  	NullFields []string `json:"-"`
   695  }
   696  
   697  func (s *GoogleAppsScriptTypeExecutionApiConfig) MarshalJSON() ([]byte, error) {
   698  	type NoMethod GoogleAppsScriptTypeExecutionApiConfig
   699  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   700  }
   701  
   702  // GoogleAppsScriptTypeExecutionApiEntryPoint: An API executable entry point.
   703  type GoogleAppsScriptTypeExecutionApiEntryPoint struct {
   704  	// EntryPointConfig: The entry point's configuration.
   705  	EntryPointConfig *GoogleAppsScriptTypeExecutionApiConfig `json:"entryPointConfig,omitempty"`
   706  	// ForceSendFields is a list of field names (e.g. "EntryPointConfig") to
   707  	// unconditionally include in API requests. By default, fields with empty or
   708  	// default values are omitted from API requests. See
   709  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   710  	// details.
   711  	ForceSendFields []string `json:"-"`
   712  	// NullFields is a list of field names (e.g. "EntryPointConfig") to include in
   713  	// API requests with the JSON null value. By default, fields with empty values
   714  	// are omitted from API requests. See
   715  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   716  	NullFields []string `json:"-"`
   717  }
   718  
   719  func (s *GoogleAppsScriptTypeExecutionApiEntryPoint) MarshalJSON() ([]byte, error) {
   720  	type NoMethod GoogleAppsScriptTypeExecutionApiEntryPoint
   721  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   722  }
   723  
   724  // GoogleAppsScriptTypeFunction: Represents a function in a script project.
   725  type GoogleAppsScriptTypeFunction struct {
   726  	// Name: The function name in the script project.
   727  	Name string `json:"name,omitempty"`
   728  	// Parameters: The ordered list of parameter names of the function in the
   729  	// script project.
   730  	Parameters []string `json:"parameters,omitempty"`
   731  	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
   732  	// include in API requests. By default, fields with empty or default values are
   733  	// omitted from API requests. See
   734  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   735  	// details.
   736  	ForceSendFields []string `json:"-"`
   737  	// NullFields is a list of field names (e.g. "Name") to include in API requests
   738  	// with the JSON null value. By default, fields with empty values are omitted
   739  	// from API requests. See
   740  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   741  	NullFields []string `json:"-"`
   742  }
   743  
   744  func (s *GoogleAppsScriptTypeFunction) MarshalJSON() ([]byte, error) {
   745  	type NoMethod GoogleAppsScriptTypeFunction
   746  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   747  }
   748  
   749  // GoogleAppsScriptTypeFunctionSet: A set of functions. No duplicates are
   750  // permitted.
   751  type GoogleAppsScriptTypeFunctionSet struct {
   752  	// Values: A list of functions composing the set.
   753  	Values []*GoogleAppsScriptTypeFunction `json:"values,omitempty"`
   754  	// ForceSendFields is a list of field names (e.g. "Values") to unconditionally
   755  	// include in API requests. By default, fields with empty or default values are
   756  	// omitted from API requests. See
   757  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   758  	// details.
   759  	ForceSendFields []string `json:"-"`
   760  	// NullFields is a list of field names (e.g. "Values") to include in API
   761  	// requests with the JSON null value. By default, fields with empty values are
   762  	// omitted from API requests. See
   763  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   764  	NullFields []string `json:"-"`
   765  }
   766  
   767  func (s *GoogleAppsScriptTypeFunctionSet) MarshalJSON() ([]byte, error) {
   768  	type NoMethod GoogleAppsScriptTypeFunctionSet
   769  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   770  }
   771  
   772  // GoogleAppsScriptTypeProcess: Representation of a single script process
   773  // execution that was started from the script editor, a trigger, an
   774  // application, or using the Apps Script API. This is distinct from the
   775  // `Operation` resource, which only represents executions started via the Apps
   776  // Script API.
   777  type GoogleAppsScriptTypeProcess struct {
   778  	// Duration: Duration the execution spent executing.
   779  	Duration string `json:"duration,omitempty"`
   780  	// FunctionName: Name of the function the started the execution.
   781  	FunctionName string `json:"functionName,omitempty"`
   782  	// ProcessStatus: The executions status.
   783  	//
   784  	// Possible values:
   785  	//   "PROCESS_STATUS_UNSPECIFIED" - Unspecified status.
   786  	//   "RUNNING" - The process is currently running.
   787  	//   "PAUSED" - The process has paused.
   788  	//   "COMPLETED" - The process has completed.
   789  	//   "CANCELED" - The process was cancelled.
   790  	//   "FAILED" - The process failed.
   791  	//   "TIMED_OUT" - The process timed out.
   792  	//   "UNKNOWN" - Process status unknown.
   793  	//   "DELAYED" - The process is delayed, waiting for quota.
   794  	//   "EXECUTION_DISABLED" - AppsScript executions are disabled by Admin.
   795  	ProcessStatus string `json:"processStatus,omitempty"`
   796  	// ProcessType: The executions type.
   797  	//
   798  	// Possible values:
   799  	//   "PROCESS_TYPE_UNSPECIFIED" - Unspecified type.
   800  	//   "ADD_ON" - The process was started from an add-on entry point.
   801  	//   "EXECUTION_API" - The process was started using the Apps Script API.
   802  	//   "TIME_DRIVEN" - The process was started from a time-based trigger.
   803  	//   "TRIGGER" - The process was started from an event-based trigger.
   804  	//   "WEBAPP" - The process was started from a web app entry point.
   805  	//   "EDITOR" - The process was started using the Apps Script IDE.
   806  	//   "SIMPLE_TRIGGER" - The process was started from a G Suite simple trigger.
   807  	//   "MENU" - The process was started from a G Suite menu item.
   808  	//   "BATCH_TASK" - The process was started as a task in a batch job.
   809  	ProcessType string `json:"processType,omitempty"`
   810  	// ProjectName: Name of the script being executed.
   811  	ProjectName string `json:"projectName,omitempty"`
   812  	// RuntimeVersion: Which version of maestro to use to execute the script.
   813  	//
   814  	// Possible values:
   815  	//   "RUNTIME_VERSION_UNSPECIFIED" - Runtime version unset / unknown.
   816  	//   "DEPRECATED_ES5" - Legacy rhino version of the Apps script runtime
   817  	//   "V8" - Current default V8 version of the apps script runtime.
   818  	RuntimeVersion string `json:"runtimeVersion,omitempty"`
   819  	// StartTime: Time the execution started.
   820  	StartTime string `json:"startTime,omitempty"`
   821  	// UserAccessLevel: The executing users access level to the script.
   822  	//
   823  	// Possible values:
   824  	//   "USER_ACCESS_LEVEL_UNSPECIFIED" - User access level unspecified
   825  	//   "NONE" - The user has no access.
   826  	//   "READ" - The user has read-only access.
   827  	//   "WRITE" - The user has write access.
   828  	//   "OWNER" - The user is an owner.
   829  	UserAccessLevel string `json:"userAccessLevel,omitempty"`
   830  	// ForceSendFields is a list of field names (e.g. "Duration") to
   831  	// unconditionally include in API requests. By default, fields with empty or
   832  	// default values are omitted from API requests. See
   833  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   834  	// details.
   835  	ForceSendFields []string `json:"-"`
   836  	// NullFields is a list of field names (e.g. "Duration") to include in API
   837  	// requests with the JSON null value. By default, fields with empty values are
   838  	// omitted from API requests. See
   839  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   840  	NullFields []string `json:"-"`
   841  }
   842  
   843  func (s *GoogleAppsScriptTypeProcess) MarshalJSON() ([]byte, error) {
   844  	type NoMethod GoogleAppsScriptTypeProcess
   845  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   846  }
   847  
   848  // GoogleAppsScriptTypeUser: A simple user profile resource.
   849  type GoogleAppsScriptTypeUser struct {
   850  	// Domain: The user's domain.
   851  	Domain string `json:"domain,omitempty"`
   852  	// Email: The user's identifying email address.
   853  	Email string `json:"email,omitempty"`
   854  	// Name: The user's display name.
   855  	Name string `json:"name,omitempty"`
   856  	// PhotoUrl: The user's photo.
   857  	PhotoUrl string `json:"photoUrl,omitempty"`
   858  	// ForceSendFields is a list of field names (e.g. "Domain") to unconditionally
   859  	// include in API requests. By default, fields with empty or default values are
   860  	// omitted from API requests. See
   861  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   862  	// details.
   863  	ForceSendFields []string `json:"-"`
   864  	// NullFields is a list of field names (e.g. "Domain") to include in API
   865  	// requests with the JSON null value. By default, fields with empty values are
   866  	// omitted from API requests. See
   867  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   868  	NullFields []string `json:"-"`
   869  }
   870  
   871  func (s *GoogleAppsScriptTypeUser) MarshalJSON() ([]byte, error) {
   872  	type NoMethod GoogleAppsScriptTypeUser
   873  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   874  }
   875  
   876  // GoogleAppsScriptTypeWebAppConfig: Web app entry point configuration.
   877  type GoogleAppsScriptTypeWebAppConfig struct {
   878  	// Access: Who has permission to run the web app.
   879  	//
   880  	// Possible values:
   881  	//   "UNKNOWN_ACCESS" - Default value, should not be used.
   882  	//   "MYSELF" - Only the user who deployed the web app or executable can access
   883  	// it. Note that this is not necessarily the owner of the script project.
   884  	//   "DOMAIN" - Only users in the same domain as the user who deployed the web
   885  	// app or executable can access it.
   886  	//   "ANYONE" - Any logged in user can access the web app or executable.
   887  	//   "ANYONE_ANONYMOUS" - Any user, logged in or not, can access the web app or
   888  	// executable.
   889  	Access string `json:"access,omitempty"`
   890  	// ExecuteAs: Who to execute the web app as.
   891  	//
   892  	// Possible values:
   893  	//   "UNKNOWN_EXECUTE_AS" - Default value, should not be used.
   894  	//   "USER_ACCESSING" - The script runs as the user accessing the web app.
   895  	//   "USER_DEPLOYING" - The script runs as the user who deployed the web app.
   896  	// Note that this is not necessarily the owner of the script project.
   897  	ExecuteAs string `json:"executeAs,omitempty"`
   898  	// ForceSendFields is a list of field names (e.g. "Access") to unconditionally
   899  	// include in API requests. By default, fields with empty or default values are
   900  	// omitted from API requests. See
   901  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   902  	// details.
   903  	ForceSendFields []string `json:"-"`
   904  	// NullFields is a list of field names (e.g. "Access") to include in API
   905  	// requests with the JSON null value. By default, fields with empty values are
   906  	// omitted from API requests. See
   907  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   908  	NullFields []string `json:"-"`
   909  }
   910  
   911  func (s *GoogleAppsScriptTypeWebAppConfig) MarshalJSON() ([]byte, error) {
   912  	type NoMethod GoogleAppsScriptTypeWebAppConfig
   913  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   914  }
   915  
   916  // GoogleAppsScriptTypeWebAppEntryPoint: A web application entry point.
   917  type GoogleAppsScriptTypeWebAppEntryPoint struct {
   918  	// EntryPointConfig: The entry point's configuration.
   919  	EntryPointConfig *GoogleAppsScriptTypeWebAppConfig `json:"entryPointConfig,omitempty"`
   920  	// Url: The URL for the web application.
   921  	Url string `json:"url,omitempty"`
   922  	// ForceSendFields is a list of field names (e.g. "EntryPointConfig") to
   923  	// unconditionally include in API requests. By default, fields with empty or
   924  	// default values are omitted from API requests. See
   925  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   926  	// details.
   927  	ForceSendFields []string `json:"-"`
   928  	// NullFields is a list of field names (e.g. "EntryPointConfig") to include in
   929  	// API requests with the JSON null value. By default, fields with empty values
   930  	// are omitted from API requests. See
   931  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   932  	NullFields []string `json:"-"`
   933  }
   934  
   935  func (s *GoogleAppsScriptTypeWebAppEntryPoint) MarshalJSON() ([]byte, error) {
   936  	type NoMethod GoogleAppsScriptTypeWebAppEntryPoint
   937  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   938  }
   939  
   940  // ListDeploymentsResponse: Response with the list of deployments for the
   941  // specified Apps Script project.
   942  type ListDeploymentsResponse struct {
   943  	// Deployments: The list of deployments.
   944  	Deployments []*Deployment `json:"deployments,omitempty"`
   945  	// NextPageToken: The token that can be used in the next call to get the next
   946  	// page of results.
   947  	NextPageToken string `json:"nextPageToken,omitempty"`
   948  
   949  	// ServerResponse contains the HTTP response code and headers from the server.
   950  	googleapi.ServerResponse `json:"-"`
   951  	// ForceSendFields is a list of field names (e.g. "Deployments") to
   952  	// unconditionally include in API requests. By default, fields with empty or
   953  	// default values are omitted from API requests. See
   954  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   955  	// details.
   956  	ForceSendFields []string `json:"-"`
   957  	// NullFields is a list of field names (e.g. "Deployments") to include in API
   958  	// requests with the JSON null value. By default, fields with empty values are
   959  	// omitted from API requests. See
   960  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   961  	NullFields []string `json:"-"`
   962  }
   963  
   964  func (s *ListDeploymentsResponse) MarshalJSON() ([]byte, error) {
   965  	type NoMethod ListDeploymentsResponse
   966  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   967  }
   968  
   969  // ListScriptProcessesResponse: Response with the list of Process resources.
   970  type ListScriptProcessesResponse struct {
   971  	// NextPageToken: Token for the next page of results. If empty, there are no
   972  	// more pages remaining.
   973  	NextPageToken string `json:"nextPageToken,omitempty"`
   974  	// Processes: List of processes matching request parameters.
   975  	Processes []*GoogleAppsScriptTypeProcess `json:"processes,omitempty"`
   976  
   977  	// ServerResponse contains the HTTP response code and headers from the server.
   978  	googleapi.ServerResponse `json:"-"`
   979  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
   980  	// unconditionally include in API requests. By default, fields with empty or
   981  	// default values are omitted from API requests. See
   982  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   983  	// details.
   984  	ForceSendFields []string `json:"-"`
   985  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
   986  	// requests with the JSON null value. By default, fields with empty values are
   987  	// omitted from API requests. See
   988  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   989  	NullFields []string `json:"-"`
   990  }
   991  
   992  func (s *ListScriptProcessesResponse) MarshalJSON() ([]byte, error) {
   993  	type NoMethod ListScriptProcessesResponse
   994  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   995  }
   996  
   997  // ListUserProcessesResponse: Response with the list of Process resources.
   998  type ListUserProcessesResponse struct {
   999  	// NextPageToken: Token for the next page of results. If empty, there are no
  1000  	// more pages remaining.
  1001  	NextPageToken string `json:"nextPageToken,omitempty"`
  1002  	// Processes: List of processes matching request parameters.
  1003  	Processes []*GoogleAppsScriptTypeProcess `json:"processes,omitempty"`
  1004  
  1005  	// ServerResponse contains the HTTP response code and headers from the server.
  1006  	googleapi.ServerResponse `json:"-"`
  1007  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1008  	// unconditionally include in API requests. By default, fields with empty or
  1009  	// default values are omitted from API requests. See
  1010  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1011  	// details.
  1012  	ForceSendFields []string `json:"-"`
  1013  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1014  	// requests with the JSON null value. By default, fields with empty values are
  1015  	// omitted from API requests. See
  1016  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1017  	NullFields []string `json:"-"`
  1018  }
  1019  
  1020  func (s *ListUserProcessesResponse) MarshalJSON() ([]byte, error) {
  1021  	type NoMethod ListUserProcessesResponse
  1022  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1023  }
  1024  
  1025  // ListValue: `ListValue` is a wrapper around a repeated field of values.
  1026  type ListValue struct {
  1027  	// Values: Repeated field of dynamically typed values.
  1028  	Values []*Value `json:"values,omitempty"`
  1029  	// ForceSendFields is a list of field names (e.g. "Values") to unconditionally
  1030  	// include in API requests. By default, fields with empty or default values are
  1031  	// omitted from API requests. See
  1032  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1033  	// details.
  1034  	ForceSendFields []string `json:"-"`
  1035  	// NullFields is a list of field names (e.g. "Values") to include in API
  1036  	// requests with the JSON null value. By default, fields with empty values are
  1037  	// omitted from API requests. See
  1038  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1039  	NullFields []string `json:"-"`
  1040  }
  1041  
  1042  func (s *ListValue) MarshalJSON() ([]byte, error) {
  1043  	type NoMethod ListValue
  1044  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1045  }
  1046  
  1047  // ListVersionsResponse: Response with the list of the versions for the
  1048  // specified script project.
  1049  type ListVersionsResponse struct {
  1050  	// NextPageToken: The token use to fetch the next page of records. if not exist
  1051  	// in the response, that means no more versions to list.
  1052  	NextPageToken string `json:"nextPageToken,omitempty"`
  1053  	// Versions: The list of versions.
  1054  	Versions []*Version `json:"versions,omitempty"`
  1055  
  1056  	// ServerResponse contains the HTTP response code and headers from the server.
  1057  	googleapi.ServerResponse `json:"-"`
  1058  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1059  	// unconditionally include in API requests. By default, fields with empty or
  1060  	// default values are omitted from API requests. See
  1061  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1062  	// details.
  1063  	ForceSendFields []string `json:"-"`
  1064  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1065  	// requests with the JSON null value. By default, fields with empty values are
  1066  	// omitted from API requests. See
  1067  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1068  	NullFields []string `json:"-"`
  1069  }
  1070  
  1071  func (s *ListVersionsResponse) MarshalJSON() ([]byte, error) {
  1072  	type NoMethod ListVersionsResponse
  1073  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1074  }
  1075  
  1076  // Metrics: Resource containing usage stats for a given script, based on the
  1077  // supplied filter and mask present in the request.
  1078  type Metrics struct {
  1079  	// ActiveUsers: Number of active users.
  1080  	ActiveUsers []*MetricsValue `json:"activeUsers,omitempty"`
  1081  	// FailedExecutions: Number of failed executions.
  1082  	FailedExecutions []*MetricsValue `json:"failedExecutions,omitempty"`
  1083  	// TotalExecutions: Number of total executions.
  1084  	TotalExecutions []*MetricsValue `json:"totalExecutions,omitempty"`
  1085  
  1086  	// ServerResponse contains the HTTP response code and headers from the server.
  1087  	googleapi.ServerResponse `json:"-"`
  1088  	// ForceSendFields is a list of field names (e.g. "ActiveUsers") to
  1089  	// unconditionally include in API requests. By default, fields with empty or
  1090  	// default values are omitted from API requests. See
  1091  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1092  	// details.
  1093  	ForceSendFields []string `json:"-"`
  1094  	// NullFields is a list of field names (e.g. "ActiveUsers") to include in API
  1095  	// requests with the JSON null value. By default, fields with empty values are
  1096  	// omitted from API requests. See
  1097  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1098  	NullFields []string `json:"-"`
  1099  }
  1100  
  1101  func (s *Metrics) MarshalJSON() ([]byte, error) {
  1102  	type NoMethod Metrics
  1103  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1104  }
  1105  
  1106  // MetricsValue: Metrics value that holds number of executions counted.
  1107  type MetricsValue struct {
  1108  	// EndTime: Required field indicating the end time of the interval.
  1109  	EndTime string `json:"endTime,omitempty"`
  1110  	// StartTime: Required field indicating the start time of the interval.
  1111  	StartTime string `json:"startTime,omitempty"`
  1112  	// Value: Indicates the number of executions counted.
  1113  	Value uint64 `json:"value,omitempty,string"`
  1114  	// ForceSendFields is a list of field names (e.g. "EndTime") to unconditionally
  1115  	// include in API requests. By default, fields with empty or default values are
  1116  	// omitted from API requests. See
  1117  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1118  	// details.
  1119  	ForceSendFields []string `json:"-"`
  1120  	// NullFields is a list of field names (e.g. "EndTime") to include in API
  1121  	// requests with the JSON null value. By default, fields with empty values are
  1122  	// omitted from API requests. See
  1123  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1124  	NullFields []string `json:"-"`
  1125  }
  1126  
  1127  func (s *MetricsValue) MarshalJSON() ([]byte, error) {
  1128  	type NoMethod MetricsValue
  1129  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1130  }
  1131  
  1132  // Operation: A representation of an execution of an Apps Script function
  1133  // started with run. The execution response does not arrive until the function
  1134  // finishes executing. The maximum execution runtime is listed in the Apps
  1135  // Script quotas guide
  1136  // (/apps-script/guides/services/quotas#current_limitations). After execution
  1137  // has started, it can have one of four outcomes: - If the script function
  1138  // returns successfully, the response field contains an ExecutionResponse
  1139  // object with the function's return value in the object's `result` field. - If
  1140  // the script function (or Apps Script itself) throws an exception, the error
  1141  // field contains a Status object. The `Status` object's `details` field
  1142  // contains an array with a single ExecutionError object that provides
  1143  // information about the nature of the error. - If the execution has not yet
  1144  // completed, the done field is `false` and the neither the `response` nor
  1145  // `error` fields are present. - If the `run` call itself fails (for example,
  1146  // because of a malformed request or an authorization error), the method
  1147  // returns an HTTP response code in the 4XX range with a different format for
  1148  // the response body. Client libraries automatically convert a 4XX response
  1149  // into an exception class.
  1150  type Operation struct {
  1151  	// Done: This field indicates whether the script execution has completed. A
  1152  	// completed execution has a populated `response` field containing the
  1153  	// ExecutionResponse from function that was executed.
  1154  	Done bool `json:"done,omitempty"`
  1155  	// Error: If a `run` call succeeds but the script function (or Apps Script
  1156  	// itself) throws an exception, this field contains a Status object. The
  1157  	// `Status` object's `details` field contains an array with a single
  1158  	// ExecutionError object that provides information about the nature of the
  1159  	// error.
  1160  	Error *Status `json:"error,omitempty"`
  1161  	// Response: If the script function returns successfully, this field contains
  1162  	// an ExecutionResponse object with the function's return value.
  1163  	Response googleapi.RawMessage `json:"response,omitempty"`
  1164  
  1165  	// ServerResponse contains the HTTP response code and headers from the server.
  1166  	googleapi.ServerResponse `json:"-"`
  1167  	// ForceSendFields is a list of field names (e.g. "Done") to unconditionally
  1168  	// include in API requests. By default, fields with empty or default values are
  1169  	// omitted from API requests. See
  1170  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1171  	// details.
  1172  	ForceSendFields []string `json:"-"`
  1173  	// NullFields is a list of field names (e.g. "Done") to include in API requests
  1174  	// with the JSON null value. By default, fields with empty values are omitted
  1175  	// from API requests. See
  1176  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1177  	NullFields []string `json:"-"`
  1178  }
  1179  
  1180  func (s *Operation) MarshalJSON() ([]byte, error) {
  1181  	type NoMethod Operation
  1182  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1183  }
  1184  
  1185  // Project: The script project resource.
  1186  type Project struct {
  1187  	// CreateTime: When the script was created.
  1188  	CreateTime string `json:"createTime,omitempty"`
  1189  	// Creator: User who originally created the script.
  1190  	Creator *GoogleAppsScriptTypeUser `json:"creator,omitempty"`
  1191  	// LastModifyUser: User who last modified the script.
  1192  	LastModifyUser *GoogleAppsScriptTypeUser `json:"lastModifyUser,omitempty"`
  1193  	// ParentId: The parent's Drive ID that the script will be attached to. This is
  1194  	// usually the ID of a Google Document or Google Sheet. This filed is optional,
  1195  	// and if not set, a stand-alone script will be created.
  1196  	ParentId string `json:"parentId,omitempty"`
  1197  	// ScriptId: The script project's Drive ID.
  1198  	ScriptId string `json:"scriptId,omitempty"`
  1199  	// Title: The title for the project.
  1200  	Title string `json:"title,omitempty"`
  1201  	// UpdateTime: When the script was last updated.
  1202  	UpdateTime string `json:"updateTime,omitempty"`
  1203  
  1204  	// ServerResponse contains the HTTP response code and headers from the server.
  1205  	googleapi.ServerResponse `json:"-"`
  1206  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1207  	// unconditionally include in API requests. By default, fields with empty or
  1208  	// default values are omitted from API requests. See
  1209  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1210  	// details.
  1211  	ForceSendFields []string `json:"-"`
  1212  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1213  	// requests with the JSON null value. By default, fields with empty values are
  1214  	// omitted from API requests. See
  1215  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1216  	NullFields []string `json:"-"`
  1217  }
  1218  
  1219  func (s *Project) MarshalJSON() ([]byte, error) {
  1220  	type NoMethod Project
  1221  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1222  }
  1223  
  1224  // ScriptExecutionResult: The result of an execution.
  1225  type ScriptExecutionResult struct {
  1226  	// ReturnValue: The returned value of the execution.
  1227  	ReturnValue *Value `json:"returnValue,omitempty"`
  1228  	// ForceSendFields is a list of field names (e.g. "ReturnValue") to
  1229  	// unconditionally include in API requests. By default, fields with empty or
  1230  	// default values are omitted from API requests. See
  1231  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1232  	// details.
  1233  	ForceSendFields []string `json:"-"`
  1234  	// NullFields is a list of field names (e.g. "ReturnValue") to include in API
  1235  	// requests with the JSON null value. By default, fields with empty values are
  1236  	// omitted from API requests. See
  1237  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1238  	NullFields []string `json:"-"`
  1239  }
  1240  
  1241  func (s *ScriptExecutionResult) MarshalJSON() ([]byte, error) {
  1242  	type NoMethod ScriptExecutionResult
  1243  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1244  }
  1245  
  1246  // ScriptStackTraceElement: A stack trace through the script that shows where
  1247  // the execution failed.
  1248  type ScriptStackTraceElement struct {
  1249  	// Function: The name of the function that failed.
  1250  	Function string `json:"function,omitempty"`
  1251  	// LineNumber: The line number where the script failed.
  1252  	LineNumber int64 `json:"lineNumber,omitempty"`
  1253  	// ForceSendFields is a list of field names (e.g. "Function") to
  1254  	// unconditionally include in API requests. By default, fields with empty or
  1255  	// default values are omitted from API requests. See
  1256  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1257  	// details.
  1258  	ForceSendFields []string `json:"-"`
  1259  	// NullFields is a list of field names (e.g. "Function") to include in API
  1260  	// requests with the JSON null value. By default, fields with empty values are
  1261  	// omitted from API requests. See
  1262  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1263  	NullFields []string `json:"-"`
  1264  }
  1265  
  1266  func (s *ScriptStackTraceElement) MarshalJSON() ([]byte, error) {
  1267  	type NoMethod ScriptStackTraceElement
  1268  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1269  }
  1270  
  1271  // Status: If a `run` call succeeds but the script function (or Apps Script
  1272  // itself) throws an exception, the response body's error field contains this
  1273  // `Status` object.
  1274  type Status struct {
  1275  	// Code: The status code. For this API, this value either: - 10, indicating a
  1276  	// `SCRIPT_TIMEOUT` error, - 3, indicating an `INVALID_ARGUMENT` error, or - 1,
  1277  	// indicating a `CANCELLED` execution.
  1278  	Code int64 `json:"code,omitempty"`
  1279  	// Details: An array that contains a single ExecutionError object that provides
  1280  	// information about the nature of the error.
  1281  	Details []googleapi.RawMessage `json:"details,omitempty"`
  1282  	// Message: A developer-facing error message, which is in English. Any
  1283  	// user-facing error message is localized and sent in the details field, or
  1284  	// localized by the client.
  1285  	Message string `json:"message,omitempty"`
  1286  	// ForceSendFields is a list of field names (e.g. "Code") to unconditionally
  1287  	// include in API requests. By default, fields with empty or default values are
  1288  	// omitted from API requests. See
  1289  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1290  	// details.
  1291  	ForceSendFields []string `json:"-"`
  1292  	// NullFields is a list of field names (e.g. "Code") to include in API requests
  1293  	// with the JSON null value. By default, fields with empty values are omitted
  1294  	// from API requests. See
  1295  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1296  	NullFields []string `json:"-"`
  1297  }
  1298  
  1299  func (s *Status) MarshalJSON() ([]byte, error) {
  1300  	type NoMethod Status
  1301  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1302  }
  1303  
  1304  // Struct: `Struct` represents a structured data value, consisting of fields
  1305  // which map to dynamically typed values.
  1306  type Struct struct {
  1307  	// Fields: Unordered map of dynamically typed values.
  1308  	Fields map[string]Value `json:"fields,omitempty"`
  1309  	// ForceSendFields is a list of field names (e.g. "Fields") to unconditionally
  1310  	// include in API requests. By default, fields with empty or default values are
  1311  	// omitted from API requests. See
  1312  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1313  	// details.
  1314  	ForceSendFields []string `json:"-"`
  1315  	// NullFields is a list of field names (e.g. "Fields") to include in API
  1316  	// requests with the JSON null value. By default, fields with empty values are
  1317  	// omitted from API requests. See
  1318  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1319  	NullFields []string `json:"-"`
  1320  }
  1321  
  1322  func (s *Struct) MarshalJSON() ([]byte, error) {
  1323  	type NoMethod Struct
  1324  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1325  }
  1326  
  1327  // UpdateDeploymentRequest: Request with deployment information to update an
  1328  // existing deployment.
  1329  type UpdateDeploymentRequest struct {
  1330  	// DeploymentConfig: The deployment configuration.
  1331  	DeploymentConfig *DeploymentConfig `json:"deploymentConfig,omitempty"`
  1332  	// ForceSendFields is a list of field names (e.g. "DeploymentConfig") to
  1333  	// unconditionally include in API requests. By default, fields with empty or
  1334  	// default values are omitted from API requests. See
  1335  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1336  	// details.
  1337  	ForceSendFields []string `json:"-"`
  1338  	// NullFields is a list of field names (e.g. "DeploymentConfig") to include in
  1339  	// API requests with the JSON null value. By default, fields with empty values
  1340  	// are omitted from API requests. See
  1341  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1342  	NullFields []string `json:"-"`
  1343  }
  1344  
  1345  func (s *UpdateDeploymentRequest) MarshalJSON() ([]byte, error) {
  1346  	type NoMethod UpdateDeploymentRequest
  1347  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1348  }
  1349  
  1350  // Value: `Value` represents a dynamically typed value which is the outcome of
  1351  // an executed script.
  1352  type Value struct {
  1353  	// BoolValue: Represents a boolean value.
  1354  	BoolValue bool `json:"boolValue,omitempty"`
  1355  	// BytesValue: Represents raw byte values.
  1356  	BytesValue string `json:"bytesValue,omitempty"`
  1357  	// DateValue: Represents a date in ms since the epoch.
  1358  	DateValue int64 `json:"dateValue,omitempty,string"`
  1359  	// ListValue: Represents a repeated `Value`.
  1360  	ListValue *ListValue `json:"listValue,omitempty"`
  1361  	// NullValue: Represents a null value.
  1362  	//
  1363  	// Possible values:
  1364  	//   "NULL_VALUE" - Null value.
  1365  	NullValue string `json:"nullValue,omitempty"`
  1366  	// NumberValue: Represents a double value.
  1367  	NumberValue float64 `json:"numberValue,omitempty"`
  1368  	// ProtoValue: Represents a structured proto value.
  1369  	ProtoValue googleapi.RawMessage `json:"protoValue,omitempty"`
  1370  	// StringValue: Represents a string value.
  1371  	StringValue string `json:"stringValue,omitempty"`
  1372  	// StructValue: Represents a structured value.
  1373  	StructValue *Struct `json:"structValue,omitempty"`
  1374  	// ForceSendFields is a list of field names (e.g. "BoolValue") to
  1375  	// unconditionally include in API requests. By default, fields with empty or
  1376  	// default values are omitted from API requests. See
  1377  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1378  	// details.
  1379  	ForceSendFields []string `json:"-"`
  1380  	// NullFields is a list of field names (e.g. "BoolValue") to include in API
  1381  	// requests with the JSON null value. By default, fields with empty values are
  1382  	// omitted from API requests. See
  1383  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1384  	NullFields []string `json:"-"`
  1385  }
  1386  
  1387  func (s *Value) MarshalJSON() ([]byte, error) {
  1388  	type NoMethod Value
  1389  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1390  }
  1391  
  1392  func (s *Value) UnmarshalJSON(data []byte) error {
  1393  	type NoMethod Value
  1394  	var s1 struct {
  1395  		NumberValue gensupport.JSONFloat64 `json:"numberValue"`
  1396  		*NoMethod
  1397  	}
  1398  	s1.NoMethod = (*NoMethod)(s)
  1399  	if err := json.Unmarshal(data, &s1); err != nil {
  1400  		return err
  1401  	}
  1402  	s.NumberValue = float64(s1.NumberValue)
  1403  	return nil
  1404  }
  1405  
  1406  // Version: A resource representing a script project version. A version is a
  1407  // "snapshot" of a script project and is similar to a read-only branched
  1408  // release. When creating deployments, the version to use must be specified.
  1409  type Version struct {
  1410  	// CreateTime: When the version was created.
  1411  	CreateTime string `json:"createTime,omitempty"`
  1412  	// Description: The description for this version.
  1413  	Description string `json:"description,omitempty"`
  1414  	// ScriptId: The script project's Drive ID.
  1415  	ScriptId string `json:"scriptId,omitempty"`
  1416  	// VersionNumber: The incremental ID that is created by Apps Script when a
  1417  	// version is created. This is system assigned number and is immutable once
  1418  	// created.
  1419  	VersionNumber int64 `json:"versionNumber,omitempty"`
  1420  
  1421  	// ServerResponse contains the HTTP response code and headers from the server.
  1422  	googleapi.ServerResponse `json:"-"`
  1423  	// ForceSendFields is a list of field names (e.g. "CreateTime") to
  1424  	// unconditionally include in API requests. By default, fields with empty or
  1425  	// default values are omitted from API requests. See
  1426  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1427  	// details.
  1428  	ForceSendFields []string `json:"-"`
  1429  	// NullFields is a list of field names (e.g. "CreateTime") to include in API
  1430  	// requests with the JSON null value. By default, fields with empty values are
  1431  	// omitted from API requests. See
  1432  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1433  	NullFields []string `json:"-"`
  1434  }
  1435  
  1436  func (s *Version) MarshalJSON() ([]byte, error) {
  1437  	type NoMethod Version
  1438  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1439  }
  1440  
  1441  type ProcessesListCall struct {
  1442  	s            *Service
  1443  	urlParams_   gensupport.URLParams
  1444  	ifNoneMatch_ string
  1445  	ctx_         context.Context
  1446  	header_      http.Header
  1447  }
  1448  
  1449  // List: List information about processes made by or on behalf of a user, such
  1450  // as process type and current status.
  1451  func (r *ProcessesService) List() *ProcessesListCall {
  1452  	c := &ProcessesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1453  	return c
  1454  }
  1455  
  1456  // PageSize sets the optional parameter "pageSize": The maximum number of
  1457  // returned processes per page of results. Defaults to 50.
  1458  func (c *ProcessesListCall) PageSize(pageSize int64) *ProcessesListCall {
  1459  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1460  	return c
  1461  }
  1462  
  1463  // PageToken sets the optional parameter "pageToken": The token for continuing
  1464  // a previous list request on the next page. This should be set to the value of
  1465  // `nextPageToken` from a previous response.
  1466  func (c *ProcessesListCall) PageToken(pageToken string) *ProcessesListCall {
  1467  	c.urlParams_.Set("pageToken", pageToken)
  1468  	return c
  1469  }
  1470  
  1471  // UserProcessFilterDeploymentId sets the optional parameter
  1472  // "userProcessFilter.deploymentId": Optional field used to limit returned
  1473  // processes to those originating from projects with a specific deployment ID.
  1474  func (c *ProcessesListCall) UserProcessFilterDeploymentId(userProcessFilterDeploymentId string) *ProcessesListCall {
  1475  	c.urlParams_.Set("userProcessFilter.deploymentId", userProcessFilterDeploymentId)
  1476  	return c
  1477  }
  1478  
  1479  // UserProcessFilterEndTime sets the optional parameter
  1480  // "userProcessFilter.endTime": Optional field used to limit returned processes
  1481  // to those that completed on or before the given timestamp.
  1482  func (c *ProcessesListCall) UserProcessFilterEndTime(userProcessFilterEndTime string) *ProcessesListCall {
  1483  	c.urlParams_.Set("userProcessFilter.endTime", userProcessFilterEndTime)
  1484  	return c
  1485  }
  1486  
  1487  // UserProcessFilterFunctionName sets the optional parameter
  1488  // "userProcessFilter.functionName": Optional field used to limit returned
  1489  // processes to those originating from a script function with the given
  1490  // function name.
  1491  func (c *ProcessesListCall) UserProcessFilterFunctionName(userProcessFilterFunctionName string) *ProcessesListCall {
  1492  	c.urlParams_.Set("userProcessFilter.functionName", userProcessFilterFunctionName)
  1493  	return c
  1494  }
  1495  
  1496  // UserProcessFilterProjectName sets the optional parameter
  1497  // "userProcessFilter.projectName": Optional field used to limit returned
  1498  // processes to those originating from projects with project names containing a
  1499  // specific string.
  1500  func (c *ProcessesListCall) UserProcessFilterProjectName(userProcessFilterProjectName string) *ProcessesListCall {
  1501  	c.urlParams_.Set("userProcessFilter.projectName", userProcessFilterProjectName)
  1502  	return c
  1503  }
  1504  
  1505  // UserProcessFilterScriptId sets the optional parameter
  1506  // "userProcessFilter.scriptId": Optional field used to limit returned
  1507  // processes to those originating from projects with a specific script ID.
  1508  func (c *ProcessesListCall) UserProcessFilterScriptId(userProcessFilterScriptId string) *ProcessesListCall {
  1509  	c.urlParams_.Set("userProcessFilter.scriptId", userProcessFilterScriptId)
  1510  	return c
  1511  }
  1512  
  1513  // UserProcessFilterStartTime sets the optional parameter
  1514  // "userProcessFilter.startTime": Optional field used to limit returned
  1515  // processes to those that were started on or after the given timestamp.
  1516  func (c *ProcessesListCall) UserProcessFilterStartTime(userProcessFilterStartTime string) *ProcessesListCall {
  1517  	c.urlParams_.Set("userProcessFilter.startTime", userProcessFilterStartTime)
  1518  	return c
  1519  }
  1520  
  1521  // UserProcessFilterStatuses sets the optional parameter
  1522  // "userProcessFilter.statuses": Optional field used to limit returned
  1523  // processes to those having one of the specified process statuses.
  1524  //
  1525  // Possible values:
  1526  //
  1527  //	"PROCESS_STATUS_UNSPECIFIED" - Unspecified status.
  1528  //	"RUNNING" - The process is currently running.
  1529  //	"PAUSED" - The process has paused.
  1530  //	"COMPLETED" - The process has completed.
  1531  //	"CANCELED" - The process was cancelled.
  1532  //	"FAILED" - The process failed.
  1533  //	"TIMED_OUT" - The process timed out.
  1534  //	"UNKNOWN" - Process status unknown.
  1535  //	"DELAYED" - The process is delayed, waiting for quota.
  1536  //	"EXECUTION_DISABLED" - AppsScript executions are disabled by Admin.
  1537  func (c *ProcessesListCall) UserProcessFilterStatuses(userProcessFilterStatuses ...string) *ProcessesListCall {
  1538  	c.urlParams_.SetMulti("userProcessFilter.statuses", append([]string{}, userProcessFilterStatuses...))
  1539  	return c
  1540  }
  1541  
  1542  // UserProcessFilterTypes sets the optional parameter
  1543  // "userProcessFilter.types": Optional field used to limit returned processes
  1544  // to those having one of the specified process types.
  1545  //
  1546  // Possible values:
  1547  //
  1548  //	"PROCESS_TYPE_UNSPECIFIED" - Unspecified type.
  1549  //	"ADD_ON" - The process was started from an add-on entry point.
  1550  //	"EXECUTION_API" - The process was started using the Apps Script API.
  1551  //	"TIME_DRIVEN" - The process was started from a time-based trigger.
  1552  //	"TRIGGER" - The process was started from an event-based trigger.
  1553  //	"WEBAPP" - The process was started from a web app entry point.
  1554  //	"EDITOR" - The process was started using the Apps Script IDE.
  1555  //	"SIMPLE_TRIGGER" - The process was started from a G Suite simple trigger.
  1556  //	"MENU" - The process was started from a G Suite menu item.
  1557  //	"BATCH_TASK" - The process was started as a task in a batch job.
  1558  func (c *ProcessesListCall) UserProcessFilterTypes(userProcessFilterTypes ...string) *ProcessesListCall {
  1559  	c.urlParams_.SetMulti("userProcessFilter.types", append([]string{}, userProcessFilterTypes...))
  1560  	return c
  1561  }
  1562  
  1563  // UserProcessFilterUserAccessLevels sets the optional parameter
  1564  // "userProcessFilter.userAccessLevels": Optional field used to limit returned
  1565  // processes to those having one of the specified user access levels.
  1566  //
  1567  // Possible values:
  1568  //
  1569  //	"USER_ACCESS_LEVEL_UNSPECIFIED" - User access level unspecified
  1570  //	"NONE" - The user has no access.
  1571  //	"READ" - The user has read-only access.
  1572  //	"WRITE" - The user has write access.
  1573  //	"OWNER" - The user is an owner.
  1574  func (c *ProcessesListCall) UserProcessFilterUserAccessLevels(userProcessFilterUserAccessLevels ...string) *ProcessesListCall {
  1575  	c.urlParams_.SetMulti("userProcessFilter.userAccessLevels", append([]string{}, userProcessFilterUserAccessLevels...))
  1576  	return c
  1577  }
  1578  
  1579  // Fields allows partial responses to be retrieved. See
  1580  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1581  // details.
  1582  func (c *ProcessesListCall) Fields(s ...googleapi.Field) *ProcessesListCall {
  1583  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1584  	return c
  1585  }
  1586  
  1587  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1588  // object's ETag matches the given value. This is useful for getting updates
  1589  // only after the object has changed since the last request.
  1590  func (c *ProcessesListCall) IfNoneMatch(entityTag string) *ProcessesListCall {
  1591  	c.ifNoneMatch_ = entityTag
  1592  	return c
  1593  }
  1594  
  1595  // Context sets the context to be used in this call's Do method.
  1596  func (c *ProcessesListCall) Context(ctx context.Context) *ProcessesListCall {
  1597  	c.ctx_ = ctx
  1598  	return c
  1599  }
  1600  
  1601  // Header returns a http.Header that can be modified by the caller to add
  1602  // headers to the request.
  1603  func (c *ProcessesListCall) Header() http.Header {
  1604  	if c.header_ == nil {
  1605  		c.header_ = make(http.Header)
  1606  	}
  1607  	return c.header_
  1608  }
  1609  
  1610  func (c *ProcessesListCall) doRequest(alt string) (*http.Response, error) {
  1611  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1612  	if c.ifNoneMatch_ != "" {
  1613  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1614  	}
  1615  	var body io.Reader = nil
  1616  	c.urlParams_.Set("alt", alt)
  1617  	c.urlParams_.Set("prettyPrint", "false")
  1618  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/processes")
  1619  	urls += "?" + c.urlParams_.Encode()
  1620  	req, err := http.NewRequest("GET", urls, body)
  1621  	if err != nil {
  1622  		return nil, err
  1623  	}
  1624  	req.Header = reqHeaders
  1625  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1626  }
  1627  
  1628  // Do executes the "script.processes.list" call.
  1629  // Any non-2xx status code is an error. Response headers are in either
  1630  // *ListUserProcessesResponse.ServerResponse.Header or (if a response was
  1631  // returned at all) in error.(*googleapi.Error).Header. Use
  1632  // googleapi.IsNotModified to check whether the returned error was because
  1633  // http.StatusNotModified was returned.
  1634  func (c *ProcessesListCall) Do(opts ...googleapi.CallOption) (*ListUserProcessesResponse, error) {
  1635  	gensupport.SetOptions(c.urlParams_, opts...)
  1636  	res, err := c.doRequest("json")
  1637  	if res != nil && res.StatusCode == http.StatusNotModified {
  1638  		if res.Body != nil {
  1639  			res.Body.Close()
  1640  		}
  1641  		return nil, gensupport.WrapError(&googleapi.Error{
  1642  			Code:   res.StatusCode,
  1643  			Header: res.Header,
  1644  		})
  1645  	}
  1646  	if err != nil {
  1647  		return nil, err
  1648  	}
  1649  	defer googleapi.CloseBody(res)
  1650  	if err := googleapi.CheckResponse(res); err != nil {
  1651  		return nil, gensupport.WrapError(err)
  1652  	}
  1653  	ret := &ListUserProcessesResponse{
  1654  		ServerResponse: googleapi.ServerResponse{
  1655  			Header:         res.Header,
  1656  			HTTPStatusCode: res.StatusCode,
  1657  		},
  1658  	}
  1659  	target := &ret
  1660  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1661  		return nil, err
  1662  	}
  1663  	return ret, nil
  1664  }
  1665  
  1666  // Pages invokes f for each page of results.
  1667  // A non-nil error returned from f will halt the iteration.
  1668  // The provided context supersedes any context provided to the Context method.
  1669  func (c *ProcessesListCall) Pages(ctx context.Context, f func(*ListUserProcessesResponse) error) error {
  1670  	c.ctx_ = ctx
  1671  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1672  	for {
  1673  		x, err := c.Do()
  1674  		if err != nil {
  1675  			return err
  1676  		}
  1677  		if err := f(x); err != nil {
  1678  			return err
  1679  		}
  1680  		if x.NextPageToken == "" {
  1681  			return nil
  1682  		}
  1683  		c.PageToken(x.NextPageToken)
  1684  	}
  1685  }
  1686  
  1687  type ProcessesListScriptProcessesCall struct {
  1688  	s            *Service
  1689  	urlParams_   gensupport.URLParams
  1690  	ifNoneMatch_ string
  1691  	ctx_         context.Context
  1692  	header_      http.Header
  1693  }
  1694  
  1695  // ListScriptProcesses: List information about a script's executed processes,
  1696  // such as process type and current status.
  1697  func (r *ProcessesService) ListScriptProcesses() *ProcessesListScriptProcessesCall {
  1698  	c := &ProcessesListScriptProcessesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1699  	return c
  1700  }
  1701  
  1702  // PageSize sets the optional parameter "pageSize": The maximum number of
  1703  // returned processes per page of results. Defaults to 50.
  1704  func (c *ProcessesListScriptProcessesCall) PageSize(pageSize int64) *ProcessesListScriptProcessesCall {
  1705  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1706  	return c
  1707  }
  1708  
  1709  // PageToken sets the optional parameter "pageToken": The token for continuing
  1710  // a previous list request on the next page. This should be set to the value of
  1711  // `nextPageToken` from a previous response.
  1712  func (c *ProcessesListScriptProcessesCall) PageToken(pageToken string) *ProcessesListScriptProcessesCall {
  1713  	c.urlParams_.Set("pageToken", pageToken)
  1714  	return c
  1715  }
  1716  
  1717  // ScriptId sets the optional parameter "scriptId": The script ID of the
  1718  // project whose processes are listed.
  1719  func (c *ProcessesListScriptProcessesCall) ScriptId(scriptId string) *ProcessesListScriptProcessesCall {
  1720  	c.urlParams_.Set("scriptId", scriptId)
  1721  	return c
  1722  }
  1723  
  1724  // ScriptProcessFilterDeploymentId sets the optional parameter
  1725  // "scriptProcessFilter.deploymentId": Optional field used to limit returned
  1726  // processes to those originating from projects with a specific deployment ID.
  1727  func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterDeploymentId(scriptProcessFilterDeploymentId string) *ProcessesListScriptProcessesCall {
  1728  	c.urlParams_.Set("scriptProcessFilter.deploymentId", scriptProcessFilterDeploymentId)
  1729  	return c
  1730  }
  1731  
  1732  // ScriptProcessFilterEndTime sets the optional parameter
  1733  // "scriptProcessFilter.endTime": Optional field used to limit returned
  1734  // processes to those that completed on or before the given timestamp.
  1735  func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterEndTime(scriptProcessFilterEndTime string) *ProcessesListScriptProcessesCall {
  1736  	c.urlParams_.Set("scriptProcessFilter.endTime", scriptProcessFilterEndTime)
  1737  	return c
  1738  }
  1739  
  1740  // ScriptProcessFilterFunctionName sets the optional parameter
  1741  // "scriptProcessFilter.functionName": Optional field used to limit returned
  1742  // processes to those originating from a script function with the given
  1743  // function name.
  1744  func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterFunctionName(scriptProcessFilterFunctionName string) *ProcessesListScriptProcessesCall {
  1745  	c.urlParams_.Set("scriptProcessFilter.functionName", scriptProcessFilterFunctionName)
  1746  	return c
  1747  }
  1748  
  1749  // ScriptProcessFilterStartTime sets the optional parameter
  1750  // "scriptProcessFilter.startTime": Optional field used to limit returned
  1751  // processes to those that were started on or after the given timestamp.
  1752  func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterStartTime(scriptProcessFilterStartTime string) *ProcessesListScriptProcessesCall {
  1753  	c.urlParams_.Set("scriptProcessFilter.startTime", scriptProcessFilterStartTime)
  1754  	return c
  1755  }
  1756  
  1757  // ScriptProcessFilterStatuses sets the optional parameter
  1758  // "scriptProcessFilter.statuses": Optional field used to limit returned
  1759  // processes to those having one of the specified process statuses.
  1760  //
  1761  // Possible values:
  1762  //
  1763  //	"PROCESS_STATUS_UNSPECIFIED" - Unspecified status.
  1764  //	"RUNNING" - The process is currently running.
  1765  //	"PAUSED" - The process has paused.
  1766  //	"COMPLETED" - The process has completed.
  1767  //	"CANCELED" - The process was cancelled.
  1768  //	"FAILED" - The process failed.
  1769  //	"TIMED_OUT" - The process timed out.
  1770  //	"UNKNOWN" - Process status unknown.
  1771  //	"DELAYED" - The process is delayed, waiting for quota.
  1772  //	"EXECUTION_DISABLED" - AppsScript executions are disabled by Admin.
  1773  func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterStatuses(scriptProcessFilterStatuses ...string) *ProcessesListScriptProcessesCall {
  1774  	c.urlParams_.SetMulti("scriptProcessFilter.statuses", append([]string{}, scriptProcessFilterStatuses...))
  1775  	return c
  1776  }
  1777  
  1778  // ScriptProcessFilterTypes sets the optional parameter
  1779  // "scriptProcessFilter.types": Optional field used to limit returned processes
  1780  // to those having one of the specified process types.
  1781  //
  1782  // Possible values:
  1783  //
  1784  //	"PROCESS_TYPE_UNSPECIFIED" - Unspecified type.
  1785  //	"ADD_ON" - The process was started from an add-on entry point.
  1786  //	"EXECUTION_API" - The process was started using the Apps Script API.
  1787  //	"TIME_DRIVEN" - The process was started from a time-based trigger.
  1788  //	"TRIGGER" - The process was started from an event-based trigger.
  1789  //	"WEBAPP" - The process was started from a web app entry point.
  1790  //	"EDITOR" - The process was started using the Apps Script IDE.
  1791  //	"SIMPLE_TRIGGER" - The process was started from a G Suite simple trigger.
  1792  //	"MENU" - The process was started from a G Suite menu item.
  1793  //	"BATCH_TASK" - The process was started as a task in a batch job.
  1794  func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterTypes(scriptProcessFilterTypes ...string) *ProcessesListScriptProcessesCall {
  1795  	c.urlParams_.SetMulti("scriptProcessFilter.types", append([]string{}, scriptProcessFilterTypes...))
  1796  	return c
  1797  }
  1798  
  1799  // ScriptProcessFilterUserAccessLevels sets the optional parameter
  1800  // "scriptProcessFilter.userAccessLevels": Optional field used to limit
  1801  // returned processes to those having one of the specified user access levels.
  1802  //
  1803  // Possible values:
  1804  //
  1805  //	"USER_ACCESS_LEVEL_UNSPECIFIED" - User access level unspecified
  1806  //	"NONE" - The user has no access.
  1807  //	"READ" - The user has read-only access.
  1808  //	"WRITE" - The user has write access.
  1809  //	"OWNER" - The user is an owner.
  1810  func (c *ProcessesListScriptProcessesCall) ScriptProcessFilterUserAccessLevels(scriptProcessFilterUserAccessLevels ...string) *ProcessesListScriptProcessesCall {
  1811  	c.urlParams_.SetMulti("scriptProcessFilter.userAccessLevels", append([]string{}, scriptProcessFilterUserAccessLevels...))
  1812  	return c
  1813  }
  1814  
  1815  // Fields allows partial responses to be retrieved. See
  1816  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1817  // details.
  1818  func (c *ProcessesListScriptProcessesCall) Fields(s ...googleapi.Field) *ProcessesListScriptProcessesCall {
  1819  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1820  	return c
  1821  }
  1822  
  1823  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  1824  // object's ETag matches the given value. This is useful for getting updates
  1825  // only after the object has changed since the last request.
  1826  func (c *ProcessesListScriptProcessesCall) IfNoneMatch(entityTag string) *ProcessesListScriptProcessesCall {
  1827  	c.ifNoneMatch_ = entityTag
  1828  	return c
  1829  }
  1830  
  1831  // Context sets the context to be used in this call's Do method.
  1832  func (c *ProcessesListScriptProcessesCall) Context(ctx context.Context) *ProcessesListScriptProcessesCall {
  1833  	c.ctx_ = ctx
  1834  	return c
  1835  }
  1836  
  1837  // Header returns a http.Header that can be modified by the caller to add
  1838  // headers to the request.
  1839  func (c *ProcessesListScriptProcessesCall) Header() http.Header {
  1840  	if c.header_ == nil {
  1841  		c.header_ = make(http.Header)
  1842  	}
  1843  	return c.header_
  1844  }
  1845  
  1846  func (c *ProcessesListScriptProcessesCall) doRequest(alt string) (*http.Response, error) {
  1847  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  1848  	if c.ifNoneMatch_ != "" {
  1849  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1850  	}
  1851  	var body io.Reader = nil
  1852  	c.urlParams_.Set("alt", alt)
  1853  	c.urlParams_.Set("prettyPrint", "false")
  1854  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/processes:listScriptProcesses")
  1855  	urls += "?" + c.urlParams_.Encode()
  1856  	req, err := http.NewRequest("GET", urls, body)
  1857  	if err != nil {
  1858  		return nil, err
  1859  	}
  1860  	req.Header = reqHeaders
  1861  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1862  }
  1863  
  1864  // Do executes the "script.processes.listScriptProcesses" call.
  1865  // Any non-2xx status code is an error. Response headers are in either
  1866  // *ListScriptProcessesResponse.ServerResponse.Header or (if a response was
  1867  // returned at all) in error.(*googleapi.Error).Header. Use
  1868  // googleapi.IsNotModified to check whether the returned error was because
  1869  // http.StatusNotModified was returned.
  1870  func (c *ProcessesListScriptProcessesCall) Do(opts ...googleapi.CallOption) (*ListScriptProcessesResponse, error) {
  1871  	gensupport.SetOptions(c.urlParams_, opts...)
  1872  	res, err := c.doRequest("json")
  1873  	if res != nil && res.StatusCode == http.StatusNotModified {
  1874  		if res.Body != nil {
  1875  			res.Body.Close()
  1876  		}
  1877  		return nil, gensupport.WrapError(&googleapi.Error{
  1878  			Code:   res.StatusCode,
  1879  			Header: res.Header,
  1880  		})
  1881  	}
  1882  	if err != nil {
  1883  		return nil, err
  1884  	}
  1885  	defer googleapi.CloseBody(res)
  1886  	if err := googleapi.CheckResponse(res); err != nil {
  1887  		return nil, gensupport.WrapError(err)
  1888  	}
  1889  	ret := &ListScriptProcessesResponse{
  1890  		ServerResponse: googleapi.ServerResponse{
  1891  			Header:         res.Header,
  1892  			HTTPStatusCode: res.StatusCode,
  1893  		},
  1894  	}
  1895  	target := &ret
  1896  	if err := gensupport.DecodeResponse(target, res); err != nil {
  1897  		return nil, err
  1898  	}
  1899  	return ret, nil
  1900  }
  1901  
  1902  // Pages invokes f for each page of results.
  1903  // A non-nil error returned from f will halt the iteration.
  1904  // The provided context supersedes any context provided to the Context method.
  1905  func (c *ProcessesListScriptProcessesCall) Pages(ctx context.Context, f func(*ListScriptProcessesResponse) error) error {
  1906  	c.ctx_ = ctx
  1907  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  1908  	for {
  1909  		x, err := c.Do()
  1910  		if err != nil {
  1911  			return err
  1912  		}
  1913  		if err := f(x); err != nil {
  1914  			return err
  1915  		}
  1916  		if x.NextPageToken == "" {
  1917  			return nil
  1918  		}
  1919  		c.PageToken(x.NextPageToken)
  1920  	}
  1921  }
  1922  
  1923  type ProjectsCreateCall struct {
  1924  	s                    *Service
  1925  	createprojectrequest *CreateProjectRequest
  1926  	urlParams_           gensupport.URLParams
  1927  	ctx_                 context.Context
  1928  	header_              http.Header
  1929  }
  1930  
  1931  // Create: Creates a new, empty script project with no script files and a base
  1932  // manifest file.
  1933  func (r *ProjectsService) Create(createprojectrequest *CreateProjectRequest) *ProjectsCreateCall {
  1934  	c := &ProjectsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1935  	c.createprojectrequest = createprojectrequest
  1936  	return c
  1937  }
  1938  
  1939  // Fields allows partial responses to be retrieved. See
  1940  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  1941  // details.
  1942  func (c *ProjectsCreateCall) Fields(s ...googleapi.Field) *ProjectsCreateCall {
  1943  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1944  	return c
  1945  }
  1946  
  1947  // Context sets the context to be used in this call's Do method.
  1948  func (c *ProjectsCreateCall) Context(ctx context.Context) *ProjectsCreateCall {
  1949  	c.ctx_ = ctx
  1950  	return c
  1951  }
  1952  
  1953  // Header returns a http.Header that can be modified by the caller to add
  1954  // headers to the request.
  1955  func (c *ProjectsCreateCall) Header() http.Header {
  1956  	if c.header_ == nil {
  1957  		c.header_ = make(http.Header)
  1958  	}
  1959  	return c.header_
  1960  }
  1961  
  1962  func (c *ProjectsCreateCall) doRequest(alt string) (*http.Response, error) {
  1963  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  1964  	var body io.Reader = nil
  1965  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.createprojectrequest)
  1966  	if err != nil {
  1967  		return nil, err
  1968  	}
  1969  	c.urlParams_.Set("alt", alt)
  1970  	c.urlParams_.Set("prettyPrint", "false")
  1971  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects")
  1972  	urls += "?" + c.urlParams_.Encode()
  1973  	req, err := http.NewRequest("POST", urls, body)
  1974  	if err != nil {
  1975  		return nil, err
  1976  	}
  1977  	req.Header = reqHeaders
  1978  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1979  }
  1980  
  1981  // Do executes the "script.projects.create" call.
  1982  // Any non-2xx status code is an error. Response headers are in either
  1983  // *Project.ServerResponse.Header or (if a response was returned at all) in
  1984  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1985  // whether the returned error was because http.StatusNotModified was returned.
  1986  func (c *ProjectsCreateCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  1987  	gensupport.SetOptions(c.urlParams_, opts...)
  1988  	res, err := c.doRequest("json")
  1989  	if res != nil && res.StatusCode == http.StatusNotModified {
  1990  		if res.Body != nil {
  1991  			res.Body.Close()
  1992  		}
  1993  		return nil, gensupport.WrapError(&googleapi.Error{
  1994  			Code:   res.StatusCode,
  1995  			Header: res.Header,
  1996  		})
  1997  	}
  1998  	if err != nil {
  1999  		return nil, err
  2000  	}
  2001  	defer googleapi.CloseBody(res)
  2002  	if err := googleapi.CheckResponse(res); err != nil {
  2003  		return nil, gensupport.WrapError(err)
  2004  	}
  2005  	ret := &Project{
  2006  		ServerResponse: googleapi.ServerResponse{
  2007  			Header:         res.Header,
  2008  			HTTPStatusCode: res.StatusCode,
  2009  		},
  2010  	}
  2011  	target := &ret
  2012  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2013  		return nil, err
  2014  	}
  2015  	return ret, nil
  2016  }
  2017  
  2018  type ProjectsGetCall struct {
  2019  	s            *Service
  2020  	scriptId     string
  2021  	urlParams_   gensupport.URLParams
  2022  	ifNoneMatch_ string
  2023  	ctx_         context.Context
  2024  	header_      http.Header
  2025  }
  2026  
  2027  // Get: Gets a script project's metadata.
  2028  //
  2029  // - scriptId: The script project's Drive ID.
  2030  func (r *ProjectsService) Get(scriptId string) *ProjectsGetCall {
  2031  	c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2032  	c.scriptId = scriptId
  2033  	return c
  2034  }
  2035  
  2036  // Fields allows partial responses to be retrieved. See
  2037  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2038  // details.
  2039  func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  2040  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2041  	return c
  2042  }
  2043  
  2044  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2045  // object's ETag matches the given value. This is useful for getting updates
  2046  // only after the object has changed since the last request.
  2047  func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  2048  	c.ifNoneMatch_ = entityTag
  2049  	return c
  2050  }
  2051  
  2052  // Context sets the context to be used in this call's Do method.
  2053  func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  2054  	c.ctx_ = ctx
  2055  	return c
  2056  }
  2057  
  2058  // Header returns a http.Header that can be modified by the caller to add
  2059  // headers to the request.
  2060  func (c *ProjectsGetCall) Header() http.Header {
  2061  	if c.header_ == nil {
  2062  		c.header_ = make(http.Header)
  2063  	}
  2064  	return c.header_
  2065  }
  2066  
  2067  func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  2068  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2069  	if c.ifNoneMatch_ != "" {
  2070  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2071  	}
  2072  	var body io.Reader = nil
  2073  	c.urlParams_.Set("alt", alt)
  2074  	c.urlParams_.Set("prettyPrint", "false")
  2075  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}")
  2076  	urls += "?" + c.urlParams_.Encode()
  2077  	req, err := http.NewRequest("GET", urls, body)
  2078  	if err != nil {
  2079  		return nil, err
  2080  	}
  2081  	req.Header = reqHeaders
  2082  	googleapi.Expand(req.URL, map[string]string{
  2083  		"scriptId": c.scriptId,
  2084  	})
  2085  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2086  }
  2087  
  2088  // Do executes the "script.projects.get" call.
  2089  // Any non-2xx status code is an error. Response headers are in either
  2090  // *Project.ServerResponse.Header or (if a response was returned at all) in
  2091  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2092  // whether the returned error was because http.StatusNotModified was returned.
  2093  func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  2094  	gensupport.SetOptions(c.urlParams_, opts...)
  2095  	res, err := c.doRequest("json")
  2096  	if res != nil && res.StatusCode == http.StatusNotModified {
  2097  		if res.Body != nil {
  2098  			res.Body.Close()
  2099  		}
  2100  		return nil, gensupport.WrapError(&googleapi.Error{
  2101  			Code:   res.StatusCode,
  2102  			Header: res.Header,
  2103  		})
  2104  	}
  2105  	if err != nil {
  2106  		return nil, err
  2107  	}
  2108  	defer googleapi.CloseBody(res)
  2109  	if err := googleapi.CheckResponse(res); err != nil {
  2110  		return nil, gensupport.WrapError(err)
  2111  	}
  2112  	ret := &Project{
  2113  		ServerResponse: googleapi.ServerResponse{
  2114  			Header:         res.Header,
  2115  			HTTPStatusCode: res.StatusCode,
  2116  		},
  2117  	}
  2118  	target := &ret
  2119  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2120  		return nil, err
  2121  	}
  2122  	return ret, nil
  2123  }
  2124  
  2125  type ProjectsGetContentCall struct {
  2126  	s            *Service
  2127  	scriptId     string
  2128  	urlParams_   gensupport.URLParams
  2129  	ifNoneMatch_ string
  2130  	ctx_         context.Context
  2131  	header_      http.Header
  2132  }
  2133  
  2134  // GetContent: Gets the content of the script project, including the code
  2135  // source and metadata for each script file.
  2136  //
  2137  // - scriptId: The script project's Drive ID.
  2138  func (r *ProjectsService) GetContent(scriptId string) *ProjectsGetContentCall {
  2139  	c := &ProjectsGetContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2140  	c.scriptId = scriptId
  2141  	return c
  2142  }
  2143  
  2144  // VersionNumber sets the optional parameter "versionNumber": The version
  2145  // number of the project to retrieve. If not provided, the project's HEAD
  2146  // version is returned.
  2147  func (c *ProjectsGetContentCall) VersionNumber(versionNumber int64) *ProjectsGetContentCall {
  2148  	c.urlParams_.Set("versionNumber", fmt.Sprint(versionNumber))
  2149  	return c
  2150  }
  2151  
  2152  // Fields allows partial responses to be retrieved. See
  2153  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2154  // details.
  2155  func (c *ProjectsGetContentCall) Fields(s ...googleapi.Field) *ProjectsGetContentCall {
  2156  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2157  	return c
  2158  }
  2159  
  2160  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2161  // object's ETag matches the given value. This is useful for getting updates
  2162  // only after the object has changed since the last request.
  2163  func (c *ProjectsGetContentCall) IfNoneMatch(entityTag string) *ProjectsGetContentCall {
  2164  	c.ifNoneMatch_ = entityTag
  2165  	return c
  2166  }
  2167  
  2168  // Context sets the context to be used in this call's Do method.
  2169  func (c *ProjectsGetContentCall) Context(ctx context.Context) *ProjectsGetContentCall {
  2170  	c.ctx_ = ctx
  2171  	return c
  2172  }
  2173  
  2174  // Header returns a http.Header that can be modified by the caller to add
  2175  // headers to the request.
  2176  func (c *ProjectsGetContentCall) Header() http.Header {
  2177  	if c.header_ == nil {
  2178  		c.header_ = make(http.Header)
  2179  	}
  2180  	return c.header_
  2181  }
  2182  
  2183  func (c *ProjectsGetContentCall) doRequest(alt string) (*http.Response, error) {
  2184  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2185  	if c.ifNoneMatch_ != "" {
  2186  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2187  	}
  2188  	var body io.Reader = nil
  2189  	c.urlParams_.Set("alt", alt)
  2190  	c.urlParams_.Set("prettyPrint", "false")
  2191  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/content")
  2192  	urls += "?" + c.urlParams_.Encode()
  2193  	req, err := http.NewRequest("GET", urls, body)
  2194  	if err != nil {
  2195  		return nil, err
  2196  	}
  2197  	req.Header = reqHeaders
  2198  	googleapi.Expand(req.URL, map[string]string{
  2199  		"scriptId": c.scriptId,
  2200  	})
  2201  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2202  }
  2203  
  2204  // Do executes the "script.projects.getContent" call.
  2205  // Any non-2xx status code is an error. Response headers are in either
  2206  // *Content.ServerResponse.Header or (if a response was returned at all) in
  2207  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2208  // whether the returned error was because http.StatusNotModified was returned.
  2209  func (c *ProjectsGetContentCall) Do(opts ...googleapi.CallOption) (*Content, error) {
  2210  	gensupport.SetOptions(c.urlParams_, opts...)
  2211  	res, err := c.doRequest("json")
  2212  	if res != nil && res.StatusCode == http.StatusNotModified {
  2213  		if res.Body != nil {
  2214  			res.Body.Close()
  2215  		}
  2216  		return nil, gensupport.WrapError(&googleapi.Error{
  2217  			Code:   res.StatusCode,
  2218  			Header: res.Header,
  2219  		})
  2220  	}
  2221  	if err != nil {
  2222  		return nil, err
  2223  	}
  2224  	defer googleapi.CloseBody(res)
  2225  	if err := googleapi.CheckResponse(res); err != nil {
  2226  		return nil, gensupport.WrapError(err)
  2227  	}
  2228  	ret := &Content{
  2229  		ServerResponse: googleapi.ServerResponse{
  2230  			Header:         res.Header,
  2231  			HTTPStatusCode: res.StatusCode,
  2232  		},
  2233  	}
  2234  	target := &ret
  2235  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2236  		return nil, err
  2237  	}
  2238  	return ret, nil
  2239  }
  2240  
  2241  type ProjectsGetMetricsCall struct {
  2242  	s            *Service
  2243  	scriptId     string
  2244  	urlParams_   gensupport.URLParams
  2245  	ifNoneMatch_ string
  2246  	ctx_         context.Context
  2247  	header_      http.Header
  2248  }
  2249  
  2250  // GetMetrics: Get metrics data for scripts, such as number of executions and
  2251  // active users.
  2252  //
  2253  // - scriptId: Required field indicating the script to get metrics for.
  2254  func (r *ProjectsService) GetMetrics(scriptId string) *ProjectsGetMetricsCall {
  2255  	c := &ProjectsGetMetricsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2256  	c.scriptId = scriptId
  2257  	return c
  2258  }
  2259  
  2260  // MetricsFilterDeploymentId sets the optional parameter
  2261  // "metricsFilter.deploymentId": Optional field indicating a specific
  2262  // deployment to retrieve metrics from.
  2263  func (c *ProjectsGetMetricsCall) MetricsFilterDeploymentId(metricsFilterDeploymentId string) *ProjectsGetMetricsCall {
  2264  	c.urlParams_.Set("metricsFilter.deploymentId", metricsFilterDeploymentId)
  2265  	return c
  2266  }
  2267  
  2268  // MetricsGranularity sets the optional parameter "metricsGranularity":
  2269  // Required field indicating what granularity of metrics are returned.
  2270  //
  2271  // Possible values:
  2272  //
  2273  //	"UNSPECIFIED_GRANULARITY" - Default metric granularity used to query no
  2274  //
  2275  // metrics.
  2276  //
  2277  //	"WEEKLY" - Represents weekly metrics.
  2278  //	"DAILY" - Represents daily metrics over a period of 7 days.
  2279  func (c *ProjectsGetMetricsCall) MetricsGranularity(metricsGranularity string) *ProjectsGetMetricsCall {
  2280  	c.urlParams_.Set("metricsGranularity", metricsGranularity)
  2281  	return c
  2282  }
  2283  
  2284  // Fields allows partial responses to be retrieved. See
  2285  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2286  // details.
  2287  func (c *ProjectsGetMetricsCall) Fields(s ...googleapi.Field) *ProjectsGetMetricsCall {
  2288  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2289  	return c
  2290  }
  2291  
  2292  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2293  // object's ETag matches the given value. This is useful for getting updates
  2294  // only after the object has changed since the last request.
  2295  func (c *ProjectsGetMetricsCall) IfNoneMatch(entityTag string) *ProjectsGetMetricsCall {
  2296  	c.ifNoneMatch_ = entityTag
  2297  	return c
  2298  }
  2299  
  2300  // Context sets the context to be used in this call's Do method.
  2301  func (c *ProjectsGetMetricsCall) Context(ctx context.Context) *ProjectsGetMetricsCall {
  2302  	c.ctx_ = ctx
  2303  	return c
  2304  }
  2305  
  2306  // Header returns a http.Header that can be modified by the caller to add
  2307  // headers to the request.
  2308  func (c *ProjectsGetMetricsCall) Header() http.Header {
  2309  	if c.header_ == nil {
  2310  		c.header_ = make(http.Header)
  2311  	}
  2312  	return c.header_
  2313  }
  2314  
  2315  func (c *ProjectsGetMetricsCall) doRequest(alt string) (*http.Response, error) {
  2316  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2317  	if c.ifNoneMatch_ != "" {
  2318  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2319  	}
  2320  	var body io.Reader = nil
  2321  	c.urlParams_.Set("alt", alt)
  2322  	c.urlParams_.Set("prettyPrint", "false")
  2323  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/metrics")
  2324  	urls += "?" + c.urlParams_.Encode()
  2325  	req, err := http.NewRequest("GET", urls, body)
  2326  	if err != nil {
  2327  		return nil, err
  2328  	}
  2329  	req.Header = reqHeaders
  2330  	googleapi.Expand(req.URL, map[string]string{
  2331  		"scriptId": c.scriptId,
  2332  	})
  2333  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2334  }
  2335  
  2336  // Do executes the "script.projects.getMetrics" call.
  2337  // Any non-2xx status code is an error. Response headers are in either
  2338  // *Metrics.ServerResponse.Header or (if a response was returned at all) in
  2339  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2340  // whether the returned error was because http.StatusNotModified was returned.
  2341  func (c *ProjectsGetMetricsCall) Do(opts ...googleapi.CallOption) (*Metrics, error) {
  2342  	gensupport.SetOptions(c.urlParams_, opts...)
  2343  	res, err := c.doRequest("json")
  2344  	if res != nil && res.StatusCode == http.StatusNotModified {
  2345  		if res.Body != nil {
  2346  			res.Body.Close()
  2347  		}
  2348  		return nil, gensupport.WrapError(&googleapi.Error{
  2349  			Code:   res.StatusCode,
  2350  			Header: res.Header,
  2351  		})
  2352  	}
  2353  	if err != nil {
  2354  		return nil, err
  2355  	}
  2356  	defer googleapi.CloseBody(res)
  2357  	if err := googleapi.CheckResponse(res); err != nil {
  2358  		return nil, gensupport.WrapError(err)
  2359  	}
  2360  	ret := &Metrics{
  2361  		ServerResponse: googleapi.ServerResponse{
  2362  			Header:         res.Header,
  2363  			HTTPStatusCode: res.StatusCode,
  2364  		},
  2365  	}
  2366  	target := &ret
  2367  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2368  		return nil, err
  2369  	}
  2370  	return ret, nil
  2371  }
  2372  
  2373  type ProjectsUpdateContentCall struct {
  2374  	s          *Service
  2375  	scriptId   string
  2376  	content    *Content
  2377  	urlParams_ gensupport.URLParams
  2378  	ctx_       context.Context
  2379  	header_    http.Header
  2380  }
  2381  
  2382  // UpdateContent: Updates the content of the specified script project. This
  2383  // content is stored as the HEAD version, and is used when the script is
  2384  // executed as a trigger, in the script editor, in add-on preview mode, or as a
  2385  // web app or Apps Script API in development mode. This clears all the existing
  2386  // files in the project.
  2387  //
  2388  // - scriptId: The script project's Drive ID.
  2389  func (r *ProjectsService) UpdateContent(scriptId string, content *Content) *ProjectsUpdateContentCall {
  2390  	c := &ProjectsUpdateContentCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2391  	c.scriptId = scriptId
  2392  	c.content = content
  2393  	return c
  2394  }
  2395  
  2396  // Fields allows partial responses to be retrieved. See
  2397  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2398  // details.
  2399  func (c *ProjectsUpdateContentCall) Fields(s ...googleapi.Field) *ProjectsUpdateContentCall {
  2400  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2401  	return c
  2402  }
  2403  
  2404  // Context sets the context to be used in this call's Do method.
  2405  func (c *ProjectsUpdateContentCall) Context(ctx context.Context) *ProjectsUpdateContentCall {
  2406  	c.ctx_ = ctx
  2407  	return c
  2408  }
  2409  
  2410  // Header returns a http.Header that can be modified by the caller to add
  2411  // headers to the request.
  2412  func (c *ProjectsUpdateContentCall) Header() http.Header {
  2413  	if c.header_ == nil {
  2414  		c.header_ = make(http.Header)
  2415  	}
  2416  	return c.header_
  2417  }
  2418  
  2419  func (c *ProjectsUpdateContentCall) doRequest(alt string) (*http.Response, error) {
  2420  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2421  	var body io.Reader = nil
  2422  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.content)
  2423  	if err != nil {
  2424  		return nil, err
  2425  	}
  2426  	c.urlParams_.Set("alt", alt)
  2427  	c.urlParams_.Set("prettyPrint", "false")
  2428  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/content")
  2429  	urls += "?" + c.urlParams_.Encode()
  2430  	req, err := http.NewRequest("PUT", urls, body)
  2431  	if err != nil {
  2432  		return nil, err
  2433  	}
  2434  	req.Header = reqHeaders
  2435  	googleapi.Expand(req.URL, map[string]string{
  2436  		"scriptId": c.scriptId,
  2437  	})
  2438  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2439  }
  2440  
  2441  // Do executes the "script.projects.updateContent" call.
  2442  // Any non-2xx status code is an error. Response headers are in either
  2443  // *Content.ServerResponse.Header or (if a response was returned at all) in
  2444  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2445  // whether the returned error was because http.StatusNotModified was returned.
  2446  func (c *ProjectsUpdateContentCall) Do(opts ...googleapi.CallOption) (*Content, error) {
  2447  	gensupport.SetOptions(c.urlParams_, opts...)
  2448  	res, err := c.doRequest("json")
  2449  	if res != nil && res.StatusCode == http.StatusNotModified {
  2450  		if res.Body != nil {
  2451  			res.Body.Close()
  2452  		}
  2453  		return nil, gensupport.WrapError(&googleapi.Error{
  2454  			Code:   res.StatusCode,
  2455  			Header: res.Header,
  2456  		})
  2457  	}
  2458  	if err != nil {
  2459  		return nil, err
  2460  	}
  2461  	defer googleapi.CloseBody(res)
  2462  	if err := googleapi.CheckResponse(res); err != nil {
  2463  		return nil, gensupport.WrapError(err)
  2464  	}
  2465  	ret := &Content{
  2466  		ServerResponse: googleapi.ServerResponse{
  2467  			Header:         res.Header,
  2468  			HTTPStatusCode: res.StatusCode,
  2469  		},
  2470  	}
  2471  	target := &ret
  2472  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2473  		return nil, err
  2474  	}
  2475  	return ret, nil
  2476  }
  2477  
  2478  type ProjectsDeploymentsCreateCall struct {
  2479  	s                *Service
  2480  	scriptId         string
  2481  	deploymentconfig *DeploymentConfig
  2482  	urlParams_       gensupport.URLParams
  2483  	ctx_             context.Context
  2484  	header_          http.Header
  2485  }
  2486  
  2487  // Create: Creates a deployment of an Apps Script project.
  2488  //
  2489  // - scriptId: The script project's Drive ID.
  2490  func (r *ProjectsDeploymentsService) Create(scriptId string, deploymentconfig *DeploymentConfig) *ProjectsDeploymentsCreateCall {
  2491  	c := &ProjectsDeploymentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2492  	c.scriptId = scriptId
  2493  	c.deploymentconfig = deploymentconfig
  2494  	return c
  2495  }
  2496  
  2497  // Fields allows partial responses to be retrieved. See
  2498  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2499  // details.
  2500  func (c *ProjectsDeploymentsCreateCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsCreateCall {
  2501  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2502  	return c
  2503  }
  2504  
  2505  // Context sets the context to be used in this call's Do method.
  2506  func (c *ProjectsDeploymentsCreateCall) Context(ctx context.Context) *ProjectsDeploymentsCreateCall {
  2507  	c.ctx_ = ctx
  2508  	return c
  2509  }
  2510  
  2511  // Header returns a http.Header that can be modified by the caller to add
  2512  // headers to the request.
  2513  func (c *ProjectsDeploymentsCreateCall) Header() http.Header {
  2514  	if c.header_ == nil {
  2515  		c.header_ = make(http.Header)
  2516  	}
  2517  	return c.header_
  2518  }
  2519  
  2520  func (c *ProjectsDeploymentsCreateCall) doRequest(alt string) (*http.Response, error) {
  2521  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2522  	var body io.Reader = nil
  2523  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.deploymentconfig)
  2524  	if err != nil {
  2525  		return nil, err
  2526  	}
  2527  	c.urlParams_.Set("alt", alt)
  2528  	c.urlParams_.Set("prettyPrint", "false")
  2529  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments")
  2530  	urls += "?" + c.urlParams_.Encode()
  2531  	req, err := http.NewRequest("POST", urls, body)
  2532  	if err != nil {
  2533  		return nil, err
  2534  	}
  2535  	req.Header = reqHeaders
  2536  	googleapi.Expand(req.URL, map[string]string{
  2537  		"scriptId": c.scriptId,
  2538  	})
  2539  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2540  }
  2541  
  2542  // Do executes the "script.projects.deployments.create" call.
  2543  // Any non-2xx status code is an error. Response headers are in either
  2544  // *Deployment.ServerResponse.Header or (if a response was returned at all) in
  2545  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2546  // whether the returned error was because http.StatusNotModified was returned.
  2547  func (c *ProjectsDeploymentsCreateCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
  2548  	gensupport.SetOptions(c.urlParams_, opts...)
  2549  	res, err := c.doRequest("json")
  2550  	if res != nil && res.StatusCode == http.StatusNotModified {
  2551  		if res.Body != nil {
  2552  			res.Body.Close()
  2553  		}
  2554  		return nil, gensupport.WrapError(&googleapi.Error{
  2555  			Code:   res.StatusCode,
  2556  			Header: res.Header,
  2557  		})
  2558  	}
  2559  	if err != nil {
  2560  		return nil, err
  2561  	}
  2562  	defer googleapi.CloseBody(res)
  2563  	if err := googleapi.CheckResponse(res); err != nil {
  2564  		return nil, gensupport.WrapError(err)
  2565  	}
  2566  	ret := &Deployment{
  2567  		ServerResponse: googleapi.ServerResponse{
  2568  			Header:         res.Header,
  2569  			HTTPStatusCode: res.StatusCode,
  2570  		},
  2571  	}
  2572  	target := &ret
  2573  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2574  		return nil, err
  2575  	}
  2576  	return ret, nil
  2577  }
  2578  
  2579  type ProjectsDeploymentsDeleteCall struct {
  2580  	s            *Service
  2581  	scriptId     string
  2582  	deploymentId string
  2583  	urlParams_   gensupport.URLParams
  2584  	ctx_         context.Context
  2585  	header_      http.Header
  2586  }
  2587  
  2588  // Delete: Deletes a deployment of an Apps Script project.
  2589  //
  2590  // - deploymentId: The deployment ID to be undeployed.
  2591  // - scriptId: The script project's Drive ID.
  2592  func (r *ProjectsDeploymentsService) Delete(scriptId string, deploymentId string) *ProjectsDeploymentsDeleteCall {
  2593  	c := &ProjectsDeploymentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2594  	c.scriptId = scriptId
  2595  	c.deploymentId = deploymentId
  2596  	return c
  2597  }
  2598  
  2599  // Fields allows partial responses to be retrieved. See
  2600  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2601  // details.
  2602  func (c *ProjectsDeploymentsDeleteCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsDeleteCall {
  2603  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2604  	return c
  2605  }
  2606  
  2607  // Context sets the context to be used in this call's Do method.
  2608  func (c *ProjectsDeploymentsDeleteCall) Context(ctx context.Context) *ProjectsDeploymentsDeleteCall {
  2609  	c.ctx_ = ctx
  2610  	return c
  2611  }
  2612  
  2613  // Header returns a http.Header that can be modified by the caller to add
  2614  // headers to the request.
  2615  func (c *ProjectsDeploymentsDeleteCall) Header() http.Header {
  2616  	if c.header_ == nil {
  2617  		c.header_ = make(http.Header)
  2618  	}
  2619  	return c.header_
  2620  }
  2621  
  2622  func (c *ProjectsDeploymentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2623  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2624  	var body io.Reader = nil
  2625  	c.urlParams_.Set("alt", alt)
  2626  	c.urlParams_.Set("prettyPrint", "false")
  2627  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}")
  2628  	urls += "?" + c.urlParams_.Encode()
  2629  	req, err := http.NewRequest("DELETE", urls, body)
  2630  	if err != nil {
  2631  		return nil, err
  2632  	}
  2633  	req.Header = reqHeaders
  2634  	googleapi.Expand(req.URL, map[string]string{
  2635  		"scriptId":     c.scriptId,
  2636  		"deploymentId": c.deploymentId,
  2637  	})
  2638  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2639  }
  2640  
  2641  // Do executes the "script.projects.deployments.delete" call.
  2642  // Any non-2xx status code is an error. Response headers are in either
  2643  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2644  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2645  // whether the returned error was because http.StatusNotModified was returned.
  2646  func (c *ProjectsDeploymentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2647  	gensupport.SetOptions(c.urlParams_, opts...)
  2648  	res, err := c.doRequest("json")
  2649  	if res != nil && res.StatusCode == http.StatusNotModified {
  2650  		if res.Body != nil {
  2651  			res.Body.Close()
  2652  		}
  2653  		return nil, gensupport.WrapError(&googleapi.Error{
  2654  			Code:   res.StatusCode,
  2655  			Header: res.Header,
  2656  		})
  2657  	}
  2658  	if err != nil {
  2659  		return nil, err
  2660  	}
  2661  	defer googleapi.CloseBody(res)
  2662  	if err := googleapi.CheckResponse(res); err != nil {
  2663  		return nil, gensupport.WrapError(err)
  2664  	}
  2665  	ret := &Empty{
  2666  		ServerResponse: googleapi.ServerResponse{
  2667  			Header:         res.Header,
  2668  			HTTPStatusCode: res.StatusCode,
  2669  		},
  2670  	}
  2671  	target := &ret
  2672  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2673  		return nil, err
  2674  	}
  2675  	return ret, nil
  2676  }
  2677  
  2678  type ProjectsDeploymentsGetCall struct {
  2679  	s            *Service
  2680  	scriptId     string
  2681  	deploymentId string
  2682  	urlParams_   gensupport.URLParams
  2683  	ifNoneMatch_ string
  2684  	ctx_         context.Context
  2685  	header_      http.Header
  2686  }
  2687  
  2688  // Get: Gets a deployment of an Apps Script project.
  2689  //
  2690  // - deploymentId: The deployment ID.
  2691  // - scriptId: The script project's Drive ID.
  2692  func (r *ProjectsDeploymentsService) Get(scriptId string, deploymentId string) *ProjectsDeploymentsGetCall {
  2693  	c := &ProjectsDeploymentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2694  	c.scriptId = scriptId
  2695  	c.deploymentId = deploymentId
  2696  	return c
  2697  }
  2698  
  2699  // Fields allows partial responses to be retrieved. See
  2700  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2701  // details.
  2702  func (c *ProjectsDeploymentsGetCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsGetCall {
  2703  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2704  	return c
  2705  }
  2706  
  2707  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2708  // object's ETag matches the given value. This is useful for getting updates
  2709  // only after the object has changed since the last request.
  2710  func (c *ProjectsDeploymentsGetCall) IfNoneMatch(entityTag string) *ProjectsDeploymentsGetCall {
  2711  	c.ifNoneMatch_ = entityTag
  2712  	return c
  2713  }
  2714  
  2715  // Context sets the context to be used in this call's Do method.
  2716  func (c *ProjectsDeploymentsGetCall) Context(ctx context.Context) *ProjectsDeploymentsGetCall {
  2717  	c.ctx_ = ctx
  2718  	return c
  2719  }
  2720  
  2721  // Header returns a http.Header that can be modified by the caller to add
  2722  // headers to the request.
  2723  func (c *ProjectsDeploymentsGetCall) Header() http.Header {
  2724  	if c.header_ == nil {
  2725  		c.header_ = make(http.Header)
  2726  	}
  2727  	return c.header_
  2728  }
  2729  
  2730  func (c *ProjectsDeploymentsGetCall) doRequest(alt string) (*http.Response, error) {
  2731  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2732  	if c.ifNoneMatch_ != "" {
  2733  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2734  	}
  2735  	var body io.Reader = nil
  2736  	c.urlParams_.Set("alt", alt)
  2737  	c.urlParams_.Set("prettyPrint", "false")
  2738  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}")
  2739  	urls += "?" + c.urlParams_.Encode()
  2740  	req, err := http.NewRequest("GET", urls, body)
  2741  	if err != nil {
  2742  		return nil, err
  2743  	}
  2744  	req.Header = reqHeaders
  2745  	googleapi.Expand(req.URL, map[string]string{
  2746  		"scriptId":     c.scriptId,
  2747  		"deploymentId": c.deploymentId,
  2748  	})
  2749  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2750  }
  2751  
  2752  // Do executes the "script.projects.deployments.get" call.
  2753  // Any non-2xx status code is an error. Response headers are in either
  2754  // *Deployment.ServerResponse.Header or (if a response was returned at all) in
  2755  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2756  // whether the returned error was because http.StatusNotModified was returned.
  2757  func (c *ProjectsDeploymentsGetCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
  2758  	gensupport.SetOptions(c.urlParams_, opts...)
  2759  	res, err := c.doRequest("json")
  2760  	if res != nil && res.StatusCode == http.StatusNotModified {
  2761  		if res.Body != nil {
  2762  			res.Body.Close()
  2763  		}
  2764  		return nil, gensupport.WrapError(&googleapi.Error{
  2765  			Code:   res.StatusCode,
  2766  			Header: res.Header,
  2767  		})
  2768  	}
  2769  	if err != nil {
  2770  		return nil, err
  2771  	}
  2772  	defer googleapi.CloseBody(res)
  2773  	if err := googleapi.CheckResponse(res); err != nil {
  2774  		return nil, gensupport.WrapError(err)
  2775  	}
  2776  	ret := &Deployment{
  2777  		ServerResponse: googleapi.ServerResponse{
  2778  			Header:         res.Header,
  2779  			HTTPStatusCode: res.StatusCode,
  2780  		},
  2781  	}
  2782  	target := &ret
  2783  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2784  		return nil, err
  2785  	}
  2786  	return ret, nil
  2787  }
  2788  
  2789  type ProjectsDeploymentsListCall struct {
  2790  	s            *Service
  2791  	scriptId     string
  2792  	urlParams_   gensupport.URLParams
  2793  	ifNoneMatch_ string
  2794  	ctx_         context.Context
  2795  	header_      http.Header
  2796  }
  2797  
  2798  // List: Lists the deployments of an Apps Script project.
  2799  //
  2800  // - scriptId: The script project's Drive ID.
  2801  func (r *ProjectsDeploymentsService) List(scriptId string) *ProjectsDeploymentsListCall {
  2802  	c := &ProjectsDeploymentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2803  	c.scriptId = scriptId
  2804  	return c
  2805  }
  2806  
  2807  // PageSize sets the optional parameter "pageSize": The maximum number of
  2808  // deployments on each returned page. Defaults to 50.
  2809  func (c *ProjectsDeploymentsListCall) PageSize(pageSize int64) *ProjectsDeploymentsListCall {
  2810  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2811  	return c
  2812  }
  2813  
  2814  // PageToken sets the optional parameter "pageToken": The token for continuing
  2815  // a previous list request on the next page. This should be set to the value of
  2816  // `nextPageToken` from a previous response.
  2817  func (c *ProjectsDeploymentsListCall) PageToken(pageToken string) *ProjectsDeploymentsListCall {
  2818  	c.urlParams_.Set("pageToken", pageToken)
  2819  	return c
  2820  }
  2821  
  2822  // Fields allows partial responses to be retrieved. See
  2823  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2824  // details.
  2825  func (c *ProjectsDeploymentsListCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsListCall {
  2826  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2827  	return c
  2828  }
  2829  
  2830  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2831  // object's ETag matches the given value. This is useful for getting updates
  2832  // only after the object has changed since the last request.
  2833  func (c *ProjectsDeploymentsListCall) IfNoneMatch(entityTag string) *ProjectsDeploymentsListCall {
  2834  	c.ifNoneMatch_ = entityTag
  2835  	return c
  2836  }
  2837  
  2838  // Context sets the context to be used in this call's Do method.
  2839  func (c *ProjectsDeploymentsListCall) Context(ctx context.Context) *ProjectsDeploymentsListCall {
  2840  	c.ctx_ = ctx
  2841  	return c
  2842  }
  2843  
  2844  // Header returns a http.Header that can be modified by the caller to add
  2845  // headers to the request.
  2846  func (c *ProjectsDeploymentsListCall) Header() http.Header {
  2847  	if c.header_ == nil {
  2848  		c.header_ = make(http.Header)
  2849  	}
  2850  	return c.header_
  2851  }
  2852  
  2853  func (c *ProjectsDeploymentsListCall) doRequest(alt string) (*http.Response, error) {
  2854  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2855  	if c.ifNoneMatch_ != "" {
  2856  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2857  	}
  2858  	var body io.Reader = nil
  2859  	c.urlParams_.Set("alt", alt)
  2860  	c.urlParams_.Set("prettyPrint", "false")
  2861  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments")
  2862  	urls += "?" + c.urlParams_.Encode()
  2863  	req, err := http.NewRequest("GET", urls, body)
  2864  	if err != nil {
  2865  		return nil, err
  2866  	}
  2867  	req.Header = reqHeaders
  2868  	googleapi.Expand(req.URL, map[string]string{
  2869  		"scriptId": c.scriptId,
  2870  	})
  2871  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2872  }
  2873  
  2874  // Do executes the "script.projects.deployments.list" call.
  2875  // Any non-2xx status code is an error. Response headers are in either
  2876  // *ListDeploymentsResponse.ServerResponse.Header or (if a response was
  2877  // returned at all) in error.(*googleapi.Error).Header. Use
  2878  // googleapi.IsNotModified to check whether the returned error was because
  2879  // http.StatusNotModified was returned.
  2880  func (c *ProjectsDeploymentsListCall) Do(opts ...googleapi.CallOption) (*ListDeploymentsResponse, error) {
  2881  	gensupport.SetOptions(c.urlParams_, opts...)
  2882  	res, err := c.doRequest("json")
  2883  	if res != nil && res.StatusCode == http.StatusNotModified {
  2884  		if res.Body != nil {
  2885  			res.Body.Close()
  2886  		}
  2887  		return nil, gensupport.WrapError(&googleapi.Error{
  2888  			Code:   res.StatusCode,
  2889  			Header: res.Header,
  2890  		})
  2891  	}
  2892  	if err != nil {
  2893  		return nil, err
  2894  	}
  2895  	defer googleapi.CloseBody(res)
  2896  	if err := googleapi.CheckResponse(res); err != nil {
  2897  		return nil, gensupport.WrapError(err)
  2898  	}
  2899  	ret := &ListDeploymentsResponse{
  2900  		ServerResponse: googleapi.ServerResponse{
  2901  			Header:         res.Header,
  2902  			HTTPStatusCode: res.StatusCode,
  2903  		},
  2904  	}
  2905  	target := &ret
  2906  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2907  		return nil, err
  2908  	}
  2909  	return ret, nil
  2910  }
  2911  
  2912  // Pages invokes f for each page of results.
  2913  // A non-nil error returned from f will halt the iteration.
  2914  // The provided context supersedes any context provided to the Context method.
  2915  func (c *ProjectsDeploymentsListCall) Pages(ctx context.Context, f func(*ListDeploymentsResponse) error) error {
  2916  	c.ctx_ = ctx
  2917  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  2918  	for {
  2919  		x, err := c.Do()
  2920  		if err != nil {
  2921  			return err
  2922  		}
  2923  		if err := f(x); err != nil {
  2924  			return err
  2925  		}
  2926  		if x.NextPageToken == "" {
  2927  			return nil
  2928  		}
  2929  		c.PageToken(x.NextPageToken)
  2930  	}
  2931  }
  2932  
  2933  type ProjectsDeploymentsUpdateCall struct {
  2934  	s                       *Service
  2935  	scriptId                string
  2936  	deploymentId            string
  2937  	updatedeploymentrequest *UpdateDeploymentRequest
  2938  	urlParams_              gensupport.URLParams
  2939  	ctx_                    context.Context
  2940  	header_                 http.Header
  2941  }
  2942  
  2943  // Update: Updates a deployment of an Apps Script project.
  2944  //
  2945  // - deploymentId: The deployment ID for this deployment.
  2946  // - scriptId: The script project's Drive ID.
  2947  func (r *ProjectsDeploymentsService) Update(scriptId string, deploymentId string, updatedeploymentrequest *UpdateDeploymentRequest) *ProjectsDeploymentsUpdateCall {
  2948  	c := &ProjectsDeploymentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2949  	c.scriptId = scriptId
  2950  	c.deploymentId = deploymentId
  2951  	c.updatedeploymentrequest = updatedeploymentrequest
  2952  	return c
  2953  }
  2954  
  2955  // Fields allows partial responses to be retrieved. See
  2956  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2957  // details.
  2958  func (c *ProjectsDeploymentsUpdateCall) Fields(s ...googleapi.Field) *ProjectsDeploymentsUpdateCall {
  2959  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2960  	return c
  2961  }
  2962  
  2963  // Context sets the context to be used in this call's Do method.
  2964  func (c *ProjectsDeploymentsUpdateCall) Context(ctx context.Context) *ProjectsDeploymentsUpdateCall {
  2965  	c.ctx_ = ctx
  2966  	return c
  2967  }
  2968  
  2969  // Header returns a http.Header that can be modified by the caller to add
  2970  // headers to the request.
  2971  func (c *ProjectsDeploymentsUpdateCall) Header() http.Header {
  2972  	if c.header_ == nil {
  2973  		c.header_ = make(http.Header)
  2974  	}
  2975  	return c.header_
  2976  }
  2977  
  2978  func (c *ProjectsDeploymentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2979  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2980  	var body io.Reader = nil
  2981  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedeploymentrequest)
  2982  	if err != nil {
  2983  		return nil, err
  2984  	}
  2985  	c.urlParams_.Set("alt", alt)
  2986  	c.urlParams_.Set("prettyPrint", "false")
  2987  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/deployments/{deploymentId}")
  2988  	urls += "?" + c.urlParams_.Encode()
  2989  	req, err := http.NewRequest("PUT", urls, body)
  2990  	if err != nil {
  2991  		return nil, err
  2992  	}
  2993  	req.Header = reqHeaders
  2994  	googleapi.Expand(req.URL, map[string]string{
  2995  		"scriptId":     c.scriptId,
  2996  		"deploymentId": c.deploymentId,
  2997  	})
  2998  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2999  }
  3000  
  3001  // Do executes the "script.projects.deployments.update" call.
  3002  // Any non-2xx status code is an error. Response headers are in either
  3003  // *Deployment.ServerResponse.Header or (if a response was returned at all) in
  3004  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3005  // whether the returned error was because http.StatusNotModified was returned.
  3006  func (c *ProjectsDeploymentsUpdateCall) Do(opts ...googleapi.CallOption) (*Deployment, error) {
  3007  	gensupport.SetOptions(c.urlParams_, opts...)
  3008  	res, err := c.doRequest("json")
  3009  	if res != nil && res.StatusCode == http.StatusNotModified {
  3010  		if res.Body != nil {
  3011  			res.Body.Close()
  3012  		}
  3013  		return nil, gensupport.WrapError(&googleapi.Error{
  3014  			Code:   res.StatusCode,
  3015  			Header: res.Header,
  3016  		})
  3017  	}
  3018  	if err != nil {
  3019  		return nil, err
  3020  	}
  3021  	defer googleapi.CloseBody(res)
  3022  	if err := googleapi.CheckResponse(res); err != nil {
  3023  		return nil, gensupport.WrapError(err)
  3024  	}
  3025  	ret := &Deployment{
  3026  		ServerResponse: googleapi.ServerResponse{
  3027  			Header:         res.Header,
  3028  			HTTPStatusCode: res.StatusCode,
  3029  		},
  3030  	}
  3031  	target := &ret
  3032  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3033  		return nil, err
  3034  	}
  3035  	return ret, nil
  3036  }
  3037  
  3038  type ProjectsVersionsCreateCall struct {
  3039  	s          *Service
  3040  	scriptId   string
  3041  	version    *Version
  3042  	urlParams_ gensupport.URLParams
  3043  	ctx_       context.Context
  3044  	header_    http.Header
  3045  }
  3046  
  3047  // Create: Creates a new immutable version using the current code, with a
  3048  // unique version number.
  3049  //
  3050  // - scriptId: The script project's Drive ID.
  3051  func (r *ProjectsVersionsService) Create(scriptId string, version *Version) *ProjectsVersionsCreateCall {
  3052  	c := &ProjectsVersionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3053  	c.scriptId = scriptId
  3054  	c.version = version
  3055  	return c
  3056  }
  3057  
  3058  // Fields allows partial responses to be retrieved. See
  3059  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3060  // details.
  3061  func (c *ProjectsVersionsCreateCall) Fields(s ...googleapi.Field) *ProjectsVersionsCreateCall {
  3062  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3063  	return c
  3064  }
  3065  
  3066  // Context sets the context to be used in this call's Do method.
  3067  func (c *ProjectsVersionsCreateCall) Context(ctx context.Context) *ProjectsVersionsCreateCall {
  3068  	c.ctx_ = ctx
  3069  	return c
  3070  }
  3071  
  3072  // Header returns a http.Header that can be modified by the caller to add
  3073  // headers to the request.
  3074  func (c *ProjectsVersionsCreateCall) Header() http.Header {
  3075  	if c.header_ == nil {
  3076  		c.header_ = make(http.Header)
  3077  	}
  3078  	return c.header_
  3079  }
  3080  
  3081  func (c *ProjectsVersionsCreateCall) doRequest(alt string) (*http.Response, error) {
  3082  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3083  	var body io.Reader = nil
  3084  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.version)
  3085  	if err != nil {
  3086  		return nil, err
  3087  	}
  3088  	c.urlParams_.Set("alt", alt)
  3089  	c.urlParams_.Set("prettyPrint", "false")
  3090  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions")
  3091  	urls += "?" + c.urlParams_.Encode()
  3092  	req, err := http.NewRequest("POST", urls, body)
  3093  	if err != nil {
  3094  		return nil, err
  3095  	}
  3096  	req.Header = reqHeaders
  3097  	googleapi.Expand(req.URL, map[string]string{
  3098  		"scriptId": c.scriptId,
  3099  	})
  3100  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3101  }
  3102  
  3103  // Do executes the "script.projects.versions.create" call.
  3104  // Any non-2xx status code is an error. Response headers are in either
  3105  // *Version.ServerResponse.Header or (if a response was returned at all) in
  3106  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3107  // whether the returned error was because http.StatusNotModified was returned.
  3108  func (c *ProjectsVersionsCreateCall) Do(opts ...googleapi.CallOption) (*Version, error) {
  3109  	gensupport.SetOptions(c.urlParams_, opts...)
  3110  	res, err := c.doRequest("json")
  3111  	if res != nil && res.StatusCode == http.StatusNotModified {
  3112  		if res.Body != nil {
  3113  			res.Body.Close()
  3114  		}
  3115  		return nil, gensupport.WrapError(&googleapi.Error{
  3116  			Code:   res.StatusCode,
  3117  			Header: res.Header,
  3118  		})
  3119  	}
  3120  	if err != nil {
  3121  		return nil, err
  3122  	}
  3123  	defer googleapi.CloseBody(res)
  3124  	if err := googleapi.CheckResponse(res); err != nil {
  3125  		return nil, gensupport.WrapError(err)
  3126  	}
  3127  	ret := &Version{
  3128  		ServerResponse: googleapi.ServerResponse{
  3129  			Header:         res.Header,
  3130  			HTTPStatusCode: res.StatusCode,
  3131  		},
  3132  	}
  3133  	target := &ret
  3134  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3135  		return nil, err
  3136  	}
  3137  	return ret, nil
  3138  }
  3139  
  3140  type ProjectsVersionsGetCall struct {
  3141  	s             *Service
  3142  	scriptId      string
  3143  	versionNumber int64
  3144  	urlParams_    gensupport.URLParams
  3145  	ifNoneMatch_  string
  3146  	ctx_          context.Context
  3147  	header_       http.Header
  3148  }
  3149  
  3150  // Get: Gets a version of a script project.
  3151  //
  3152  // - scriptId: The script project's Drive ID.
  3153  // - versionNumber: The version number.
  3154  func (r *ProjectsVersionsService) Get(scriptId string, versionNumber int64) *ProjectsVersionsGetCall {
  3155  	c := &ProjectsVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3156  	c.scriptId = scriptId
  3157  	c.versionNumber = versionNumber
  3158  	return c
  3159  }
  3160  
  3161  // Fields allows partial responses to be retrieved. See
  3162  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3163  // details.
  3164  func (c *ProjectsVersionsGetCall) Fields(s ...googleapi.Field) *ProjectsVersionsGetCall {
  3165  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3166  	return c
  3167  }
  3168  
  3169  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3170  // object's ETag matches the given value. This is useful for getting updates
  3171  // only after the object has changed since the last request.
  3172  func (c *ProjectsVersionsGetCall) IfNoneMatch(entityTag string) *ProjectsVersionsGetCall {
  3173  	c.ifNoneMatch_ = entityTag
  3174  	return c
  3175  }
  3176  
  3177  // Context sets the context to be used in this call's Do method.
  3178  func (c *ProjectsVersionsGetCall) Context(ctx context.Context) *ProjectsVersionsGetCall {
  3179  	c.ctx_ = ctx
  3180  	return c
  3181  }
  3182  
  3183  // Header returns a http.Header that can be modified by the caller to add
  3184  // headers to the request.
  3185  func (c *ProjectsVersionsGetCall) Header() http.Header {
  3186  	if c.header_ == nil {
  3187  		c.header_ = make(http.Header)
  3188  	}
  3189  	return c.header_
  3190  }
  3191  
  3192  func (c *ProjectsVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  3193  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3194  	if c.ifNoneMatch_ != "" {
  3195  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3196  	}
  3197  	var body io.Reader = nil
  3198  	c.urlParams_.Set("alt", alt)
  3199  	c.urlParams_.Set("prettyPrint", "false")
  3200  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions/{versionNumber}")
  3201  	urls += "?" + c.urlParams_.Encode()
  3202  	req, err := http.NewRequest("GET", urls, body)
  3203  	if err != nil {
  3204  		return nil, err
  3205  	}
  3206  	req.Header = reqHeaders
  3207  	googleapi.Expand(req.URL, map[string]string{
  3208  		"scriptId":      c.scriptId,
  3209  		"versionNumber": strconv.FormatInt(c.versionNumber, 10),
  3210  	})
  3211  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3212  }
  3213  
  3214  // Do executes the "script.projects.versions.get" call.
  3215  // Any non-2xx status code is an error. Response headers are in either
  3216  // *Version.ServerResponse.Header or (if a response was returned at all) in
  3217  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3218  // whether the returned error was because http.StatusNotModified was returned.
  3219  func (c *ProjectsVersionsGetCall) Do(opts ...googleapi.CallOption) (*Version, error) {
  3220  	gensupport.SetOptions(c.urlParams_, opts...)
  3221  	res, err := c.doRequest("json")
  3222  	if res != nil && res.StatusCode == http.StatusNotModified {
  3223  		if res.Body != nil {
  3224  			res.Body.Close()
  3225  		}
  3226  		return nil, gensupport.WrapError(&googleapi.Error{
  3227  			Code:   res.StatusCode,
  3228  			Header: res.Header,
  3229  		})
  3230  	}
  3231  	if err != nil {
  3232  		return nil, err
  3233  	}
  3234  	defer googleapi.CloseBody(res)
  3235  	if err := googleapi.CheckResponse(res); err != nil {
  3236  		return nil, gensupport.WrapError(err)
  3237  	}
  3238  	ret := &Version{
  3239  		ServerResponse: googleapi.ServerResponse{
  3240  			Header:         res.Header,
  3241  			HTTPStatusCode: res.StatusCode,
  3242  		},
  3243  	}
  3244  	target := &ret
  3245  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3246  		return nil, err
  3247  	}
  3248  	return ret, nil
  3249  }
  3250  
  3251  type ProjectsVersionsListCall struct {
  3252  	s            *Service
  3253  	scriptId     string
  3254  	urlParams_   gensupport.URLParams
  3255  	ifNoneMatch_ string
  3256  	ctx_         context.Context
  3257  	header_      http.Header
  3258  }
  3259  
  3260  // List: List the versions of a script project.
  3261  //
  3262  // - scriptId: The script project's Drive ID.
  3263  func (r *ProjectsVersionsService) List(scriptId string) *ProjectsVersionsListCall {
  3264  	c := &ProjectsVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3265  	c.scriptId = scriptId
  3266  	return c
  3267  }
  3268  
  3269  // PageSize sets the optional parameter "pageSize": The maximum number of
  3270  // versions on each returned page. Defaults to 50.
  3271  func (c *ProjectsVersionsListCall) PageSize(pageSize int64) *ProjectsVersionsListCall {
  3272  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3273  	return c
  3274  }
  3275  
  3276  // PageToken sets the optional parameter "pageToken": The token for continuing
  3277  // a previous list request on the next page. This should be set to the value of
  3278  // `nextPageToken` from a previous response.
  3279  func (c *ProjectsVersionsListCall) PageToken(pageToken string) *ProjectsVersionsListCall {
  3280  	c.urlParams_.Set("pageToken", pageToken)
  3281  	return c
  3282  }
  3283  
  3284  // Fields allows partial responses to be retrieved. See
  3285  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3286  // details.
  3287  func (c *ProjectsVersionsListCall) Fields(s ...googleapi.Field) *ProjectsVersionsListCall {
  3288  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3289  	return c
  3290  }
  3291  
  3292  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3293  // object's ETag matches the given value. This is useful for getting updates
  3294  // only after the object has changed since the last request.
  3295  func (c *ProjectsVersionsListCall) IfNoneMatch(entityTag string) *ProjectsVersionsListCall {
  3296  	c.ifNoneMatch_ = entityTag
  3297  	return c
  3298  }
  3299  
  3300  // Context sets the context to be used in this call's Do method.
  3301  func (c *ProjectsVersionsListCall) Context(ctx context.Context) *ProjectsVersionsListCall {
  3302  	c.ctx_ = ctx
  3303  	return c
  3304  }
  3305  
  3306  // Header returns a http.Header that can be modified by the caller to add
  3307  // headers to the request.
  3308  func (c *ProjectsVersionsListCall) Header() http.Header {
  3309  	if c.header_ == nil {
  3310  		c.header_ = make(http.Header)
  3311  	}
  3312  	return c.header_
  3313  }
  3314  
  3315  func (c *ProjectsVersionsListCall) doRequest(alt string) (*http.Response, error) {
  3316  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3317  	if c.ifNoneMatch_ != "" {
  3318  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3319  	}
  3320  	var body io.Reader = nil
  3321  	c.urlParams_.Set("alt", alt)
  3322  	c.urlParams_.Set("prettyPrint", "false")
  3323  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{scriptId}/versions")
  3324  	urls += "?" + c.urlParams_.Encode()
  3325  	req, err := http.NewRequest("GET", urls, body)
  3326  	if err != nil {
  3327  		return nil, err
  3328  	}
  3329  	req.Header = reqHeaders
  3330  	googleapi.Expand(req.URL, map[string]string{
  3331  		"scriptId": c.scriptId,
  3332  	})
  3333  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3334  }
  3335  
  3336  // Do executes the "script.projects.versions.list" call.
  3337  // Any non-2xx status code is an error. Response headers are in either
  3338  // *ListVersionsResponse.ServerResponse.Header or (if a response was returned
  3339  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3340  // check whether the returned error was because http.StatusNotModified was
  3341  // returned.
  3342  func (c *ProjectsVersionsListCall) Do(opts ...googleapi.CallOption) (*ListVersionsResponse, error) {
  3343  	gensupport.SetOptions(c.urlParams_, opts...)
  3344  	res, err := c.doRequest("json")
  3345  	if res != nil && res.StatusCode == http.StatusNotModified {
  3346  		if res.Body != nil {
  3347  			res.Body.Close()
  3348  		}
  3349  		return nil, gensupport.WrapError(&googleapi.Error{
  3350  			Code:   res.StatusCode,
  3351  			Header: res.Header,
  3352  		})
  3353  	}
  3354  	if err != nil {
  3355  		return nil, err
  3356  	}
  3357  	defer googleapi.CloseBody(res)
  3358  	if err := googleapi.CheckResponse(res); err != nil {
  3359  		return nil, gensupport.WrapError(err)
  3360  	}
  3361  	ret := &ListVersionsResponse{
  3362  		ServerResponse: googleapi.ServerResponse{
  3363  			Header:         res.Header,
  3364  			HTTPStatusCode: res.StatusCode,
  3365  		},
  3366  	}
  3367  	target := &ret
  3368  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3369  		return nil, err
  3370  	}
  3371  	return ret, nil
  3372  }
  3373  
  3374  // Pages invokes f for each page of results.
  3375  // A non-nil error returned from f will halt the iteration.
  3376  // The provided context supersedes any context provided to the Context method.
  3377  func (c *ProjectsVersionsListCall) Pages(ctx context.Context, f func(*ListVersionsResponse) error) error {
  3378  	c.ctx_ = ctx
  3379  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3380  	for {
  3381  		x, err := c.Do()
  3382  		if err != nil {
  3383  			return err
  3384  		}
  3385  		if err := f(x); err != nil {
  3386  			return err
  3387  		}
  3388  		if x.NextPageToken == "" {
  3389  			return nil
  3390  		}
  3391  		c.PageToken(x.NextPageToken)
  3392  	}
  3393  }
  3394  
  3395  type ScriptsRunCall struct {
  3396  	s                *Service
  3397  	scriptId         string
  3398  	executionrequest *ExecutionRequest
  3399  	urlParams_       gensupport.URLParams
  3400  	ctx_             context.Context
  3401  	header_          http.Header
  3402  }
  3403  
  3404  // Run: Runs a function in an Apps Script project. The script project must be
  3405  // deployed for use with the Apps Script API and the calling application must
  3406  // share the same Cloud Platform project. This method requires authorization
  3407  // with an OAuth 2.0 token that includes at least one of the scopes listed in
  3408  // the Authorization (#authorization-scopes) section; script projects that do
  3409  // not require authorization cannot be executed through this API. To find the
  3410  // correct scopes to include in the authentication token, open the script
  3411  // project **Overview** page and scroll down to "Project OAuth Scopes." The
  3412  // error `403, PERMISSION_DENIED: The caller does not have permission`
  3413  // indicates that the Cloud Platform project used to authorize the request is
  3414  // not the same as the one used by the script.
  3415  //
  3416  //   - scriptId: The script ID of the script to be executed. Find the script ID
  3417  //     on the **Project settings** page under "IDs." As multiple executable APIs
  3418  //     can be deployed in new IDE for same script, this field should be populated
  3419  //     with DeploymentID generated while deploying in new IDE instead of script
  3420  //     ID.
  3421  func (r *ScriptsService) Run(scriptId string, executionrequest *ExecutionRequest) *ScriptsRunCall {
  3422  	c := &ScriptsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3423  	c.scriptId = scriptId
  3424  	c.executionrequest = executionrequest
  3425  	return c
  3426  }
  3427  
  3428  // Fields allows partial responses to be retrieved. See
  3429  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3430  // details.
  3431  func (c *ScriptsRunCall) Fields(s ...googleapi.Field) *ScriptsRunCall {
  3432  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3433  	return c
  3434  }
  3435  
  3436  // Context sets the context to be used in this call's Do method.
  3437  func (c *ScriptsRunCall) Context(ctx context.Context) *ScriptsRunCall {
  3438  	c.ctx_ = ctx
  3439  	return c
  3440  }
  3441  
  3442  // Header returns a http.Header that can be modified by the caller to add
  3443  // headers to the request.
  3444  func (c *ScriptsRunCall) Header() http.Header {
  3445  	if c.header_ == nil {
  3446  		c.header_ = make(http.Header)
  3447  	}
  3448  	return c.header_
  3449  }
  3450  
  3451  func (c *ScriptsRunCall) doRequest(alt string) (*http.Response, error) {
  3452  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3453  	var body io.Reader = nil
  3454  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.executionrequest)
  3455  	if err != nil {
  3456  		return nil, err
  3457  	}
  3458  	c.urlParams_.Set("alt", alt)
  3459  	c.urlParams_.Set("prettyPrint", "false")
  3460  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/scripts/{scriptId}:run")
  3461  	urls += "?" + c.urlParams_.Encode()
  3462  	req, err := http.NewRequest("POST", urls, body)
  3463  	if err != nil {
  3464  		return nil, err
  3465  	}
  3466  	req.Header = reqHeaders
  3467  	googleapi.Expand(req.URL, map[string]string{
  3468  		"scriptId": c.scriptId,
  3469  	})
  3470  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3471  }
  3472  
  3473  // Do executes the "script.scripts.run" call.
  3474  // Any non-2xx status code is an error. Response headers are in either
  3475  // *Operation.ServerResponse.Header or (if a response was returned at all) in
  3476  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3477  // whether the returned error was because http.StatusNotModified was returned.
  3478  func (c *ScriptsRunCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3479  	gensupport.SetOptions(c.urlParams_, opts...)
  3480  	res, err := c.doRequest("json")
  3481  	if res != nil && res.StatusCode == http.StatusNotModified {
  3482  		if res.Body != nil {
  3483  			res.Body.Close()
  3484  		}
  3485  		return nil, gensupport.WrapError(&googleapi.Error{
  3486  			Code:   res.StatusCode,
  3487  			Header: res.Header,
  3488  		})
  3489  	}
  3490  	if err != nil {
  3491  		return nil, err
  3492  	}
  3493  	defer googleapi.CloseBody(res)
  3494  	if err := googleapi.CheckResponse(res); err != nil {
  3495  		return nil, gensupport.WrapError(err)
  3496  	}
  3497  	ret := &Operation{
  3498  		ServerResponse: googleapi.ServerResponse{
  3499  			Header:         res.Header,
  3500  			HTTPStatusCode: res.StatusCode,
  3501  		},
  3502  	}
  3503  	target := &ret
  3504  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3505  		return nil, err
  3506  	}
  3507  	return ret, nil
  3508  }
  3509  

View as plain text