Class: Google::Apis::ScriptV1::ScriptService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/script_v1/service.rb

Overview

Apps Script API

Manages and executes Google Apps Script projects.

Examples:

require 'google/apis/script_v1'

Script = Google::Apis::ScriptV1 # Alias the module
service = Script::ScriptService.new

See Also:

Constant Summary collapse

DEFAULT_ENDPOINT_TEMPLATE =
"https://script.$UNIVERSE_DOMAIN$/"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScriptService

Returns a new instance of ScriptService.



47
48
49
50
51
52
# File 'lib/google/apis/script_v1/service.rb', line 47

def initialize
  super(DEFAULT_ENDPOINT_TEMPLATE, '',
        client_name: 'google-apis-script_v1',
        client_version: Google::Apis::ScriptV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



40
41
42
# File 'lib/google/apis/script_v1/service.rb', line 40

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



45
46
47
# File 'lib/google/apis/script_v1/service.rb', line 45

def quota_user
  @quota_user
end

Instance Method Details

#create_project(create_project_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Project

Creates a new, empty script project with no script files and a base manifest file.

Parameters:

  • create_project_request_object (Google::Apis::ScriptV1::CreateProjectRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



211
212
213
214
215
216
217
218
219
220
# File 'lib/google/apis/script_v1/service.rb', line 211

def create_project(create_project_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/projects', options)
  command.request_representation = Google::Apis::ScriptV1::CreateProjectRequest::Representation
  command.request_object = create_project_request_object
  command.response_representation = Google::Apis::ScriptV1::Project::Representation
  command.response_class = Google::Apis::ScriptV1::Project
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_deployment(script_id, deployment_config_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Deployment

Creates a deployment of an Apps Script project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • deployment_config_object (Google::Apis::ScriptV1::DeploymentConfig) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



380
381
382
383
384
385
386
387
388
389
390
# File 'lib/google/apis/script_v1/service.rb', line 380

def create_project_deployment(script_id, deployment_config_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/projects/{scriptId}/deployments', options)
  command.request_representation = Google::Apis::ScriptV1::DeploymentConfig::Representation
  command.request_object = deployment_config_object
  command.response_representation = Google::Apis::ScriptV1::Deployment::Representation
  command.response_class = Google::Apis::ScriptV1::Deployment
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_project_version(script_id, version_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Version

Creates a new immutable version using the current code, with a unique version number.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • version_object (Google::Apis::ScriptV1::Version) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



553
554
555
556
557
558
559
560
561
562
563
# File 'lib/google/apis/script_v1/service.rb', line 553

def create_project_version(script_id, version_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/projects/{scriptId}/versions', options)
  command.request_representation = Google::Apis::ScriptV1::Version::Representation
  command.request_object = version_object
  command.response_representation = Google::Apis::ScriptV1::Version::Representation
  command.response_class = Google::Apis::ScriptV1::Version
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_project_deployment(script_id, deployment_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Empty

Deletes a deployment of an Apps Script project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • deployment_id (String)

    The deployment ID to be undeployed.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



414
415
416
417
418
419
420
421
422
423
# File 'lib/google/apis/script_v1/service.rb', line 414

def delete_project_deployment(script_id, deployment_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/projects/{scriptId}/deployments/{deploymentId}', options)
  command.response_representation = Google::Apis::ScriptV1::Empty::Representation
  command.response_class = Google::Apis::ScriptV1::Empty
  command.params['scriptId'] = script_id unless script_id.nil?
  command.params['deploymentId'] = deployment_id unless deployment_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project(script_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Project

Gets a script project's metadata.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



242
243
244
245
246
247
248
249
250
# File 'lib/google/apis/script_v1/service.rb', line 242

def get_project(script_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/projects/{scriptId}', options)
  command.response_representation = Google::Apis::ScriptV1::Project::Representation
  command.response_class = Google::Apis::ScriptV1::Project
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_content(script_id, version_number: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Content

Gets the content of the script project, including the code source and metadata for each script file.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • version_number (Fixnum) (defaults to: nil)

    The version number of the project to retrieve. If not provided, the project's HEAD version is returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



276
277
278
279
280
281
282
283
284
285
# File 'lib/google/apis/script_v1/service.rb', line 276

def get_project_content(script_id, version_number: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/projects/{scriptId}/content', options)
  command.response_representation = Google::Apis::ScriptV1::Content::Representation
  command.response_class = Google::Apis::ScriptV1::Content
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['versionNumber'] = version_number unless version_number.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_deployment(script_id, deployment_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Deployment

Gets a deployment of an Apps Script project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • deployment_id (String)

    The deployment ID.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



447
448
449
450
451
452
453
454
455
456
# File 'lib/google/apis/script_v1/service.rb', line 447

def get_project_deployment(script_id, deployment_id, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/projects/{scriptId}/deployments/{deploymentId}', options)
  command.response_representation = Google::Apis::ScriptV1::Deployment::Representation
  command.response_class = Google::Apis::ScriptV1::Deployment
  command.params['scriptId'] = script_id unless script_id.nil?
  command.params['deploymentId'] = deployment_id unless deployment_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_metrics(script_id, metrics_filter_deployment_id: nil, metrics_granularity: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Metrics

Get metrics data for scripts, such as number of executions and active users.

Parameters:

  • script_id (String)

    Required field indicating the script to get metrics for.

  • metrics_filter_deployment_id (String) (defaults to: nil)

    Optional field indicating a specific deployment to retrieve metrics from.

  • metrics_granularity (String) (defaults to: nil)

    Required field indicating what granularity of metrics are returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



311
312
313
314
315
316
317
318
319
320
321
# File 'lib/google/apis/script_v1/service.rb', line 311

def get_project_metrics(script_id, metrics_filter_deployment_id: nil, metrics_granularity: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/projects/{scriptId}/metrics', options)
  command.response_representation = Google::Apis::ScriptV1::Metrics::Representation
  command.response_class = Google::Apis::ScriptV1::Metrics
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['metricsFilter.deploymentId'] = metrics_filter_deployment_id unless metrics_filter_deployment_id.nil?
  command.query['metricsGranularity'] = metrics_granularity unless metrics_granularity.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_project_version(script_id, version_number, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Version

Gets a version of a script project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • version_number (Fixnum)

    The version number.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



587
588
589
590
591
592
593
594
595
596
# File 'lib/google/apis/script_v1/service.rb', line 587

def get_project_version(script_id, version_number, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/projects/{scriptId}/versions/{versionNumber}', options)
  command.response_representation = Google::Apis::ScriptV1::Version::Representation
  command.response_class = Google::Apis::ScriptV1::Version
  command.params['scriptId'] = script_id unless script_id.nil?
  command.params['versionNumber'] = version_number unless version_number.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_process_script_processes(page_size: nil, page_token: nil, script_id: nil, script_process_filter_deployment_id: nil, script_process_filter_end_time: nil, script_process_filter_function_name: nil, script_process_filter_start_time: nil, script_process_filter_statuses: nil, script_process_filter_types: nil, script_process_filter_user_access_levels: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::ListScriptProcessesResponse

List information about a script's executed processes, such as process type and current status.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of returned processes per page of results. Defaults to 50.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of nextPageToken from a previous response.

  • script_id (String) (defaults to: nil)

    The script ID of the project whose processes are listed.

  • script_process_filter_deployment_id (String) (defaults to: nil)

    Optional field used to limit returned processes to those originating from projects with a specific deployment ID.

  • script_process_filter_end_time (String) (defaults to: nil)

    Optional field used to limit returned processes to those that completed on or before the given timestamp.

  • script_process_filter_function_name (String) (defaults to: nil)

    Optional field used to limit returned processes to those originating from a script function with the given function name.

  • script_process_filter_start_time (String) (defaults to: nil)

    Optional field used to limit returned processes to those that were started on or after the given timestamp.

  • script_process_filter_statuses (Array<String>, String) (defaults to: nil)

    Optional field used to limit returned processes to those having one of the specified process statuses.

  • script_process_filter_types (Array<String>, String) (defaults to: nil)

    Optional field used to limit returned processes to those having one of the specified process types.

  • script_process_filter_user_access_levels (Array<String>, String) (defaults to: nil)

    Optional field used to limit returned processes to those having one of the specified user access levels.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/google/apis/script_v1/service.rb', line 172

def list_process_script_processes(page_size: nil, page_token: nil, script_id: nil, script_process_filter_deployment_id: nil, script_process_filter_end_time: nil, script_process_filter_function_name: nil, script_process_filter_start_time: nil, script_process_filter_statuses: nil, script_process_filter_types: nil, script_process_filter_user_access_levels: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/processes:listScriptProcesses', options)
  command.response_representation = Google::Apis::ScriptV1::ListScriptProcessesResponse::Representation
  command.response_class = Google::Apis::ScriptV1::ListScriptProcessesResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['scriptId'] = script_id unless script_id.nil?
  command.query['scriptProcessFilter.deploymentId'] = script_process_filter_deployment_id unless script_process_filter_deployment_id.nil?
  command.query['scriptProcessFilter.endTime'] = script_process_filter_end_time unless script_process_filter_end_time.nil?
  command.query['scriptProcessFilter.functionName'] = script_process_filter_function_name unless script_process_filter_function_name.nil?
  command.query['scriptProcessFilter.startTime'] = script_process_filter_start_time unless script_process_filter_start_time.nil?
  command.query['scriptProcessFilter.statuses'] = script_process_filter_statuses unless script_process_filter_statuses.nil?
  command.query['scriptProcessFilter.types'] = script_process_filter_types unless script_process_filter_types.nil?
  command.query['scriptProcessFilter.userAccessLevels'] = script_process_filter_user_access_levels unless script_process_filter_user_access_levels.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_processes(page_size: nil, page_token: nil, user_process_filter_deployment_id: nil, user_process_filter_end_time: nil, user_process_filter_function_name: nil, user_process_filter_project_name: nil, user_process_filter_script_id: nil, user_process_filter_start_time: nil, user_process_filter_statuses: nil, user_process_filter_types: nil, user_process_filter_user_access_levels: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::ListUserProcessesResponse

List information about processes made by or on behalf of a user, such as process type and current status.

Parameters:

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of returned processes per page of results. Defaults to 50.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of nextPageToken from a previous response.

  • user_process_filter_deployment_id (String) (defaults to: nil)

    Optional field used to limit returned processes to those originating from projects with a specific deployment ID.

  • user_process_filter_end_time (String) (defaults to: nil)

    Optional field used to limit returned processes to those that completed on or before the given timestamp.

  • user_process_filter_function_name (String) (defaults to: nil)

    Optional field used to limit returned processes to those originating from a script function with the given function name.

  • user_process_filter_project_name (String) (defaults to: nil)

    Optional field used to limit returned processes to those originating from projects with project names containing a specific string.

  • user_process_filter_script_id (String) (defaults to: nil)

    Optional field used to limit returned processes to those originating from projects with a specific script ID.

  • user_process_filter_start_time (String) (defaults to: nil)

    Optional field used to limit returned processes to those that were started on or after the given timestamp.

  • user_process_filter_statuses (Array<String>, String) (defaults to: nil)

    Optional field used to limit returned processes to those having one of the specified process statuses.

  • user_process_filter_types (Array<String>, String) (defaults to: nil)

    Optional field used to limit returned processes to those having one of the specified process types.

  • user_process_filter_user_access_levels (Array<String>, String) (defaults to: nil)

    Optional field used to limit returned processes to those having one of the specified user access levels.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/google/apis/script_v1/service.rb', line 105

def list_processes(page_size: nil, page_token: nil, user_process_filter_deployment_id: nil, user_process_filter_end_time: nil, user_process_filter_function_name: nil, user_process_filter_project_name: nil, user_process_filter_script_id: nil, user_process_filter_start_time: nil, user_process_filter_statuses: nil, user_process_filter_types: nil, user_process_filter_user_access_levels: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/processes', options)
  command.response_representation = Google::Apis::ScriptV1::ListUserProcessesResponse::Representation
  command.response_class = Google::Apis::ScriptV1::ListUserProcessesResponse
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['userProcessFilter.deploymentId'] = user_process_filter_deployment_id unless user_process_filter_deployment_id.nil?
  command.query['userProcessFilter.endTime'] = user_process_filter_end_time unless user_process_filter_end_time.nil?
  command.query['userProcessFilter.functionName'] = user_process_filter_function_name unless user_process_filter_function_name.nil?
  command.query['userProcessFilter.projectName'] = user_process_filter_project_name unless user_process_filter_project_name.nil?
  command.query['userProcessFilter.scriptId'] = user_process_filter_script_id unless user_process_filter_script_id.nil?
  command.query['userProcessFilter.startTime'] = user_process_filter_start_time unless user_process_filter_start_time.nil?
  command.query['userProcessFilter.statuses'] = user_process_filter_statuses unless user_process_filter_statuses.nil?
  command.query['userProcessFilter.types'] = user_process_filter_types unless user_process_filter_types.nil?
  command.query['userProcessFilter.userAccessLevels'] = user_process_filter_user_access_levels unless user_process_filter_user_access_levels.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_deployments(script_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::ListDeploymentsResponse

Lists the deployments of an Apps Script project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of deployments on each returned page. Defaults to 50.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of nextPageToken from a previous response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



483
484
485
486
487
488
489
490
491
492
493
# File 'lib/google/apis/script_v1/service.rb', line 483

def list_project_deployments(script_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/projects/{scriptId}/deployments', options)
  command.response_representation = Google::Apis::ScriptV1::ListDeploymentsResponse::Representation
  command.response_class = Google::Apis::ScriptV1::ListDeploymentsResponse
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_project_versions(script_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::ListVersionsResponse

List the versions of a script project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • page_size (Fixnum) (defaults to: nil)

    The maximum number of versions on each returned page. Defaults to 50.

  • page_token (String) (defaults to: nil)

    The token for continuing a previous list request on the next page. This should be set to the value of nextPageToken from a previous response.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



623
624
625
626
627
628
629
630
631
632
633
# File 'lib/google/apis/script_v1/service.rb', line 623

def list_project_versions(script_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/projects/{scriptId}/versions', options)
  command.response_representation = Google::Apis::ScriptV1::ListVersionsResponse::Representation
  command.response_class = Google::Apis::ScriptV1::ListVersionsResponse
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#run_script(script_id, execution_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Operation

Runs a function in an Apps Script project. The script project must be deployed for use with the Apps Script API and the calling application must share the same Cloud Platform project. This method requires authorization with an OAuth 2.0 token that includes at least one of the scopes listed in the Authorization section; script projects that do not require authorization cannot be executed through this API. To find the correct scopes to include in the authentication token, open the script project ** Overview** page and scroll down to "Project OAuth Scopes." The error 403, PERMISSION_DENIED: The caller does not have permission indicates that the Cloud Platform project used to authorize the request is not the same as the one used by the script.

Parameters:

  • script_id (String)

    The script ID of the script to be executed. Find the script ID on the ** Project settings** page under "IDs." As multiple executable APIs can be deployed in new IDE for same script, this field should be populated with DeploymentID generated while deploying in new IDE instead of script ID.

  • execution_request_object (Google::Apis::ScriptV1::ExecutionRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



669
670
671
672
673
674
675
676
677
678
679
# File 'lib/google/apis/script_v1/service.rb', line 669

def run_script(script_id, execution_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/scripts/{scriptId}:run', options)
  command.request_representation = Google::Apis::ScriptV1::ExecutionRequest::Representation
  command.request_object = execution_request_object
  command.response_representation = Google::Apis::ScriptV1::Operation::Representation
  command.response_class = Google::Apis::ScriptV1::Operation
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_deployment(script_id, deployment_id, update_deployment_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Deployment

Updates a deployment of an Apps Script project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • deployment_id (String)

    The deployment ID for this deployment.

  • update_deployment_request_object (Google::Apis::ScriptV1::UpdateDeploymentRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/google/apis/script_v1/service.rb', line 518

def update_deployment(script_id, deployment_id, update_deployment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'v1/projects/{scriptId}/deployments/{deploymentId}', options)
  command.request_representation = Google::Apis::ScriptV1::UpdateDeploymentRequest::Representation
  command.request_object = update_deployment_request_object
  command.response_representation = Google::Apis::ScriptV1::Deployment::Representation
  command.response_class = Google::Apis::ScriptV1::Deployment
  command.params['scriptId'] = script_id unless script_id.nil?
  command.params['deploymentId'] = deployment_id unless deployment_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_project_content(script_id, content_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ScriptV1::Content

Updates the content of the specified script project. This content is stored as the HEAD version, and is used when the script is executed as a trigger, in the script editor, in add-on preview mode, or as a web app or Apps Script API in development mode. This clears all the existing files in the project.

Parameters:

  • script_id (String)

    The script project's Drive ID.

  • content_object (Google::Apis::ScriptV1::Content) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



347
348
349
350
351
352
353
354
355
356
357
# File 'lib/google/apis/script_v1/service.rb', line 347

def update_project_content(script_id, content_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:put, 'v1/projects/{scriptId}/content', options)
  command.request_representation = Google::Apis::ScriptV1::Content::Representation
  command.request_object = content_object
  command.response_representation = Google::Apis::ScriptV1::Content::Representation
  command.response_class = Google::Apis::ScriptV1::Content
  command.params['scriptId'] = script_id unless script_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end