Class: Google::Apis::ScriptV1::Operation
- Inherits:
- 
      Object
      
        - Object
- Google::Apis::ScriptV1::Operation
 
- 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
A representation of a execution of an Apps Script function that is started using run. The execution response does not arrive until the function finishes executing. The maximum execution runtime is listed in the Apps Script quotas guide.
After the execution is started, it can have one of four outcomes:
-  If the
script function returns successfully, the
response field contains an
ExecutionResponse object
with the function's return value in the object's resultfield.
-  If the script function (or Apps Script itself) throws an exception, the
error field contains a
Status object. The Statusobject'sdetailsfield contains an array with a single ExecutionError object that provides information about the nature of the error.
-  If the execution has not yet completed,
the done field is falseand the neither theresponsenorerrorfields are present.
-  If the runcall itself fails (for example, because of a malformed request or an authorization error), the method returns an HTTP response code in the 4XX range with a different format for the response body. Client libraries automatically convert a 4XX response into an exception class.
Instance Attribute Summary collapse
- 
  
    
      #done  ⇒ Boolean 
    
    
      (also: #done?)
    
  
  
  
  
    
    
  
  
  
  
  
  
    This field indicates whether the script execution has completed. 
- 
  
    
      #error  ⇒ Google::Apis::ScriptV1::Status 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    If a runcall succeeds but the script function (or Apps Script itself) throws an exception, the response body's error field contains thisStatusobject.
- 
  
    
      #response  ⇒ Hash<String,Object> 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    If the script function returns successfully, this field contains an ExecutionResponse object with the function's return value. 
Instance Method Summary collapse
- 
  
    
      #initialize(**args)  ⇒ Operation 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Operation. 
- 
  
    
      #update!(**args)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    Update properties of this object. 
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
Constructor Details
#initialize(**args) ⇒ Operation
Returns a new instance of Operation
| 946 947 948 | # File 'generated/google/apis/script_v1/classes.rb', line 946 def initialize(**args) update!(**args) end | 
Instance Attribute Details
#done ⇒ Boolean Also known as: done?
This field indicates whether the script execution has completed. A completed
execution has a populated response field containing the ExecutionResponse
from function that was executed.
Corresponds to the JSON property done
| 930 931 932 | # File 'generated/google/apis/script_v1/classes.rb', line 930 def done @done end | 
#error ⇒ Google::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 contains this Status
object.
Corresponds to the JSON property error
| 938 939 940 | # File 'generated/google/apis/script_v1/classes.rb', line 938 def error @error end | 
#response ⇒ Hash<String,Object>
If the script function returns successfully, this field contains an
ExecutionResponse object with the function's return value.
Corresponds to the JSON property response
| 944 945 946 | # File 'generated/google/apis/script_v1/classes.rb', line 944 def response @response end | 
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
| 951 952 953 954 955 | # File 'generated/google/apis/script_v1/classes.rb', line 951 def update!(**args) @done = args[:done] if args.key?(:done) @error = args[:error] if args.key?(:error) @response = args[:response] if args.key?(:response) end |