Class: Google::Apis::ScriptV1::Operation

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/script_v1/classes.rb,
generated/google/apis/script_v1/representations.rb,
generated/google/apis/script_v1/representations.rb

Overview

The response will not arrive until the function finishes executing. The maximum runtime is listed in the guide to limitations in Apps Script.

If the script function returns successfully, the `response` field will contain an `ExecutionResponse` object with the function's return value in the object's `result` field.

If the script function (or Apps Script itself) throws an exception, the ` error` field will contain a `Status` object. The `Status` object's `details` field will contain an array with a single `ExecutionError` object that provides information about the nature of the error.

If the `run` call itself fails (for example, because of a malformed request or an authorization error), the method will return an HTTP response code in the 4XX range with a different format for the response body. Client libraries will automatically convert a 4XX response into an exception class.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Operation

Returns a new instance of Operation



227
228
229
# File 'generated/google/apis/script_v1/classes.rb', line 227

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#doneBoolean Also known as: done?

This field is not used. Corresponds to the JSON property done

Returns:

  • (Boolean)


200
201
202
# File 'generated/google/apis/script_v1/classes.rb', line 200

def done
  @done
end

#errorGoogle::Apis::ScriptV1::Status

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. Corresponds to the JSON property error



220
221
222
# File 'generated/google/apis/script_v1/classes.rb', line 220

def error
  @error
end

#metadataHash<String,Object>

This field is not used. Corresponds to the JSON property metadata

Returns:

  • (Hash<String,Object>)


225
226
227
# File 'generated/google/apis/script_v1/classes.rb', line 225

def 
  @metadata
end

#nameString

This field is not used. Corresponds to the JSON property name

Returns:

  • (String)


213
214
215
# File 'generated/google/apis/script_v1/classes.rb', line 213

def name
  @name
end

#responseHash<String,Object>

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. Corresponds to the JSON property response

Returns:

  • (Hash<String,Object>)


208
209
210
# File 'generated/google/apis/script_v1/classes.rb', line 208

def response
  @response
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



232
233
234
235
236
237
238
# File 'generated/google/apis/script_v1/classes.rb', line 232

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)
end