Current section

Files

Jump to
google_api_script lib google_api script v1 model operation.ex
Raw

lib/google_api/script/v1/model/operation.ex

# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.
defmodule GoogleApi.Script.V1.Model.Operation do
@moduledoc """
The response will not arrive until the function finishes executing. The maximum runtime is listed in the guide to [limitations in Apps Script](https://developers.google.com/apps-script/guides/services/quotas#current_limitations). <p>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.</p> <p>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.</p> <p>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.</p>
## Attributes
- done (Boolean): This field is only used with asynchronous executions and indicates whether or not the script execution has completed. A completed execution has a populated response field containing the `ExecutionResponse` from function that was executed. Defaults to: `null`.
- error (Status): If a `run` call succeeds but the script function (or Apps Script itself) throws an exception, this 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. Defaults to: `null`.
- metadata (Object): This field is not used. Defaults to: `null`.
- response (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. Defaults to: `null`.
"""
defstruct [
:"done",
:"error",
:"metadata",
:"response"
]
end
defimpl Poison.Decoder, for: GoogleApi.Script.V1.Model.Operation do
import GoogleApi.Script.V1.Deserializer
def decode(value, options) do
value
|> deserialize(:"error", :struct, GoogleApi.Script.V1.Model.Status, options)
|> deserialize(:"metadata", :struct, GoogleApi.Script.V1.Model.Object, options)
|> deserialize(:"response", :struct, GoogleApi.Script.V1.Model.Object, options)
end
end
defimpl Poison.Encoder, for: GoogleApi.Script.V1.Model.Operation do
def encode(value, options) do
GoogleApi.Script.V1.Deserializer.serialize_non_nil(value, options)
end
end