Bump version, regen APIs

This commit is contained in:
Steve Bazyl committed 2017-05-26 10:44:32 -06:00
1 parent b8f6f7c2fe
commit 9237ba59cb
241 files changed
+53894 -50212

No files matched your search

+113 -113
View File
@@ -22,11 +22,109 @@ module Google
module Apis
module ScriptV1
# If a `run` call succeeds but the script function (or Apps Script itself)
# throws an exception, the response body's `error` field will contain this `
# Status` object.
class Status
include Google::Apis::Core::Hashable
# An array that contains a single `ExecutionError` object that provides
# information about the nature of the error.
# Corresponds to the JSON property `details`
# @return [Array<Hash<String,Object>>]
attr_accessor :details
# The status code. For this API, this value will always be 3, corresponding to
# an INVALID_ARGUMENT error.
# Corresponds to the JSON property `code`
# @return [Fixnum]
attr_accessor :code
# A developer-facing error message, which is in English. Any user-facing error
# message is localized and sent in the [`google.rpc.Status.details`](google.rpc.
# Status.details) field, or localized by the client.
# Corresponds to the JSON property `message`
# @return [String]
attr_accessor :message
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@details = args[:details] if args.key?(:details)
@code = args[:code] if args.key?(:code)
@message = args[:message] if args.key?(:message)
end
end
# A request to run the function in a script. The script is identified by the
# specified `script_id`. Executing a function on a script returns results
# based on the implementation of the script.
class ExecutionRequest
include Google::Apis::Core::Hashable
# For Android add-ons only. An ID that represents the user's current session
# in the Android app for Google Docs or Sheets, included as extra data in the
# [`Intent`](https://developer.android.com/guide/components/intents-filters.html)
# that launches the add-on. When an Android add-on is run with a session
# state, it gains the privileges of a
# [bound](https://developers.google.com/apps-script/guides/bound) script &mdash;
# that is, it can access information like the user's current cursor position
# (in Docs) or selected cell (in Sheets). To retrieve the state, call
# `Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState")`.
# Optional.
# Corresponds to the JSON property `sessionState`
# @return [String]
attr_accessor :session_state
# The name of the function to execute in the given script. The name does not
# include parentheses or parameters.
# Corresponds to the JSON property `function`
# @return [String]
attr_accessor :function
# If `true` and the user is an owner of the script, the script runs at the
# most recently saved version rather than the version deployed for use with
# the Execution API. Optional; default is `false`.
# Corresponds to the JSON property `devMode`
# @return [Boolean]
attr_accessor :dev_mode
alias_method :dev_mode?, :dev_mode
# The parameters to be passed to the function being executed. The object type
# for each parameter should match the expected type in Apps Script.
# Parameters cannot be Apps Script-specific object types (such as a
# `Document` or a `Calendar`); they can only be primitive types such as
# `string`, `number`, `array`, `object`, or `boolean`. Optional.
# Corresponds to the JSON property `parameters`
# @return [Array<Object>]
attr_accessor :parameters
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@session_state = args[:session_state] if args.key?(:session_state)
@function = args[:function] if args.key?(:function)
@dev_mode = args[:dev_mode] if args.key?(:dev_mode)
@parameters = args[:parameters] if args.key?(:parameters)
end
end
# A request to retrieve the results from a collection of requests,
# specified by the operation resource names.
class JoinAsyncRequest
include Google::Apis::Core::Hashable
# Timeout for information retrieval in milliseconds.
# Corresponds to the JSON property `timeout`
# @return [String]
attr_accessor :timeout
# The script id which specifies the script which all processes in the names
# field must be from.
# Corresponds to the JSON property `scriptId`
@@ -39,20 +137,15 @@ module Google
# @return [Array<String>]
attr_accessor :names
# Timeout for information retrieval in milliseconds.
# Corresponds to the JSON property `timeout`
# @return [String]
attr_accessor :timeout
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@timeout = args[:timeout] if args.key?(:timeout)
@script_id = args[:script_id] if args.key?(:script_id)
@names = args[:names] if args.key?(:names)
@timeout = args[:timeout] if args.key?(:timeout)
end
end
@@ -101,6 +194,12 @@ module Google
class Operation
include Google::Apis::Core::Hashable
# This field is not used.
# Corresponds to the JSON property `done`
# @return [Boolean]
attr_accessor :done
alias_method :done?, :done
# If the script function returns successfully, this field will contain an `
# ExecutionResponse` object with the function's return value as the object's `
# result` field.
@@ -125,23 +224,17 @@ module Google
# @return [Hash<String,Object>]
attr_accessor :metadata
# This field is not used.
# Corresponds to the JSON property `done`
# @return [Boolean]
attr_accessor :done
alias_method :done?, :done
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@done = args[:done] if args.key?(:done)
@response = args[:response] if args.key?(:response)
@name = args[:name] if args.key?(:name)
@error = args[:error] if args.key?(:error)
@metadata = args[:metadata] if args.key?(:metadata)
@done = args[:done] if args.key?(:done)
end
end
@@ -201,12 +294,6 @@ module Google
class ExecutionError
include Google::Apis::Core::Hashable
# An array of objects that provide a stack trace through the script to show
# where the execution failed, with the deepest call first.
# Corresponds to the JSON property `scriptStackTraceElements`
# @return [Array<Google::Apis::ScriptV1::ScriptStackTraceElement>]
attr_accessor :script_stack_trace_elements
# The error type, for example `TypeError` or `ReferenceError`. If the error
# type is unavailable, this field is not included.
# Corresponds to the JSON property `errorType`
@@ -219,108 +306,21 @@ module Google
# @return [String]
attr_accessor :error_message
# An array of objects that provide a stack trace through the script to show
# where the execution failed, with the deepest call first.
# Corresponds to the JSON property `scriptStackTraceElements`
# @return [Array<Google::Apis::ScriptV1::ScriptStackTraceElement>]
attr_accessor :script_stack_trace_elements
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@script_stack_trace_elements = args[:script_stack_trace_elements] if args.key?(:script_stack_trace_elements)
@error_type = args[:error_type] if args.key?(:error_type)
@error_message = args[:error_message] if args.key?(:error_message)
end
end
# If a `run` call succeeds but the script function (or Apps Script itself)
# throws an exception, the response body's `error` field will contain this `
# Status` object.
class Status
include Google::Apis::Core::Hashable
# A developer-facing error message, which is in English. Any user-facing error
# message is localized and sent in the [`google.rpc.Status.details`](google.rpc.
# Status.details) field, or localized by the client.
# Corresponds to the JSON property `message`
# @return [String]
attr_accessor :message
# An array that contains a single `ExecutionError` object that provides
# information about the nature of the error.
# Corresponds to the JSON property `details`
# @return [Array<Hash<String,Object>>]
attr_accessor :details
# The status code. For this API, this value will always be 3, corresponding to
# an INVALID_ARGUMENT error.
# Corresponds to the JSON property `code`
# @return [Fixnum]
attr_accessor :code
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@message = args[:message] if args.key?(:message)
@details = args[:details] if args.key?(:details)
@code = args[:code] if args.key?(:code)
end
end
# A request to run the function in a script. The script is identified by the
# specified `script_id`. Executing a function on a script returns results
# based on the implementation of the script.
class ExecutionRequest
include Google::Apis::Core::Hashable
# The name of the function to execute in the given script. The name does not
# include parentheses or parameters.
# Corresponds to the JSON property `function`
# @return [String]
attr_accessor :function
# If `true` and the user is an owner of the script, the script runs at the
# most recently saved version rather than the version deployed for use with
# the Execution API. Optional; default is `false`.
# Corresponds to the JSON property `devMode`
# @return [Boolean]
attr_accessor :dev_mode
alias_method :dev_mode?, :dev_mode
# The parameters to be passed to the function being executed. The object type
# for each parameter should match the expected type in Apps Script.
# Parameters cannot be Apps Script-specific object types (such as a
# `Document` or a `Calendar`); they can only be primitive types such as
# `string`, `number`, `array`, `object`, or `boolean`. Optional.
# Corresponds to the JSON property `parameters`
# @return [Array<Object>]
attr_accessor :parameters
# For Android add-ons only. An ID that represents the user's current session
# in the Android app for Google Docs or Sheets, included as extra data in the
# [`Intent`](https://developer.android.com/guide/components/intents-filters.html)
# that launches the add-on. When an Android add-on is run with a session
# state, it gains the privileges of a
# [bound](https://developers.google.com/apps-script/guides/bound) script &mdash;
# that is, it can access information like the user's current cursor position
# (in Docs) or selected cell (in Sheets). To retrieve the state, call
# `Intent.getStringExtra("com.google.android.apps.docs.addons.SessionState")`.
# Optional.
# Corresponds to the JSON property `sessionState`
# @return [String]
attr_accessor :session_state
def initialize(**args)
update!(**args)
end
# Update properties of this object
def update!(**args)
@function = args[:function] if args.key?(:function)
@dev_mode = args[:dev_mode] if args.key?(:dev_mode)
@parameters = args[:parameters] if args.key?(:parameters)
@session_state = args[:session_state] if args.key?(:session_state)
@script_stack_trace_elements = args[:script_stack_trace_elements] if args.key?(:script_stack_trace_elements)
end
end
end
@@ -22,6 +22,18 @@ module Google
module Apis
module ScriptV1
class Status
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class ExecutionRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end
class JoinAsyncRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
@@ -59,23 +71,30 @@ module Google
end
class Status
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :details, as: 'details'
property :code, as: 'code'
property :message, as: 'message'
end
end
class ExecutionRequest
class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :session_state, as: 'sessionState'
property :function, as: 'function'
property :dev_mode, as: 'devMode'
collection :parameters, as: 'parameters'
end
end
class JoinAsyncRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :timeout, as: 'timeout'
property :script_id, as: 'scriptId'
collection :names, as: 'names'
property :timeout, as: 'timeout'
end
end
@@ -89,12 +108,12 @@ module Google
class Operation
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :done, as: 'done'
hash :response, as: 'response'
property :name, as: 'name'
property :error, as: 'error', class: Google::Apis::ScriptV1::Status, decorator: Google::Apis::ScriptV1::Status::Representation
hash :metadata, as: 'metadata'
property :done, as: 'done'
end
end
@@ -117,29 +136,10 @@ module Google
class ExecutionError
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :script_stack_trace_elements, as: 'scriptStackTraceElements', class: Google::Apis::ScriptV1::ScriptStackTraceElement, decorator: Google::Apis::ScriptV1::ScriptStackTraceElement::Representation
property :error_type, as: 'errorType'
property :error_message, as: 'errorMessage'
end
end
collection :script_stack_trace_elements, as: 'scriptStackTraceElements', class: Google::Apis::ScriptV1::ScriptStackTraceElement, decorator: Google::Apis::ScriptV1::ScriptStackTraceElement::Representation
class Status
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :message, as: 'message'
collection :details, as: 'details'
property :code, as: 'code'
end
end
class ExecutionRequest
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :function, as: 'function'
property :dev_mode, as: 'devMode'
collection :parameters, as: 'parameters'
property :session_state, as: 'sessionState'
end
end
end
+4 -4
View File
@@ -59,11 +59,11 @@ module Google
# The project key of the script to be executed. To find the project key, open
# the project in the script editor and select **File > Project properties**.
# @param [Google::Apis::ScriptV1::ExecutionRequest] execution_request_object
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# 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.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
@@ -76,15 +76,15 @@ module Google
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def run_script(script_id, execution_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
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['quotaUser'] = quota_user unless quota_user.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end