on develop help sign in
Regenerating gogol-script from latest service definition
commite2053d243b01fd2a54ba364c7171936384d05996 authorBrendan Hay <brendan.g.hay@gmail.com> dateTue 25 Oct 2016, 11:37 (10 years ago) parent86733b7
4 files changed+34−13
gen/model/script/v1/script-api.json+12−5 gogol-script/gen/Network/Google/Script.hs+1 gogol-script/gen/Network/Google/Script/Types.hs+1 gogol-script/gen/Network/Google/Script/Types/Product.hs+20−8
gen/model/script/v1/script-api.json+12−5
@@ -1,11 +1,11 @@
11{
22 "kind": "discovery#restDescription",
3− "etag": "\"jQLIOHBVnDZie4rQHGH1WJF-INE/cvYaayVw4IdFoA5o3qV9XjLT9HI\"",
3+ "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/FcNWZezE05ypidUunx03uCyJR70\"",
44 "discoveryVersion": "v1",
55 "id": "script:v1",
66 "name": "script",
77 "version": "v1",
8− "revision": "20160426",
8+ "revision": "20160801",
99 "title": "Google Apps Script Execution API",
1010 "description": "Executes Google Apps Script projects.",
1111 "ownerDomain": "google.com",
@@ -180,7 +180,7 @@
180180 "description": "This field is not used.",
181181 "additionalProperties": {
182182 "type": "any",
183− "description": "Properties of the object. Contains field @ype with type URL."
183+ "description": "Properties of the object. Contains field @type with type URL."
184184 }
185185 },
186186 "done": {
@@ -196,7 +196,7 @@
196196 "description": "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.",
197197 "additionalProperties": {
198198 "type": "any",
199− "description": "Properties of the object. Contains field @ype with type URL."
199+ "description": "Properties of the object. Contains field @type with type URL."
200200 }
201201 }
202202 }
@@ -222,7 +222,7 @@
222222 "type": "object",
223223 "additionalProperties": {
224224 "type": "any",
225− "description": "Properties of the object. Contains field @ype with type URL."
225+ "description": "Properties of the object. Contains field @type with type URL."
226226 }
227227 }
228228 }
@@ -274,6 +274,13 @@
274274 "result": {
275275 "type": "any",
276276 "description": "The return value of the script function. The type will match the type returned in Apps Script. Functions called through the Execution API cannot return Apps Script-specific objects (such as a `Document` or `Calendar`); they can only return primitive types such as a `string`, `number`, `array`, `object`, or `boolean`."
277+ },
278+ "status": {
279+ "type": "string",
280+ "enum": [
281+ "SUCCESS",
282+ "CANCELED"
283+ ]
277284 }
278285 }
279286 }
gogol-script/gen/Network/Google/Script.hs+1
@@ -99,6 +99,7 @@ module Network.Google.Script
9999 -- ** ExecutionResponse
100100 , ExecutionResponse
101101 , executionResponse
102+ , erStatus
102103 , erResult
103104 ) where
104105
gogol-script/gen/Network/Google/Script/Types.hs+1
@@ -87,6 +87,7 @@ module Network.Google.Script.Types
8787 -- * ExecutionResponse
8888 , ExecutionResponse
8989 , executionResponse
90+ , erStatus
9091 , erResult
9192 ) where
9293
gogol-script/gen/Network/Google/Script/Types/Product.hs+20−8
@@ -280,7 +280,7 @@ statusDetailsItem pSdiAddtional_ =
280280 { _sdiAddtional = _Coerce # pSdiAddtional_
281281 }
282282
283−-- | Properties of the object. Contains field \'ype with type URL.
283+-- | Properties of the object. Contains field \'type with type URL.
284284sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
285285sdiAddtional
286286 = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
@@ -435,7 +435,7 @@ operationMetadata pOmAddtional_ =
435435 { _omAddtional = _Coerce # pOmAddtional_
436436 }
437437
438−-- | Properties of the object. Contains field \'ype with type URL.
438+-- | Properties of the object. Contains field \'type with type URL.
439439omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue)
440440omAddtional
441441 = lens _omAddtional (\ s a -> s{_omAddtional = a}) .
@@ -471,7 +471,7 @@ operationResponse pOrAddtional_ =
471471 { _orAddtional = _Coerce # pOrAddtional_
472472 }
473473
474−-- | Properties of the object. Contains field \'ype with type URL.
474+-- | Properties of the object. Contains field \'type with type URL.
475475orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
476476orAddtional
477477 = lens _orAddtional (\ s a -> s{_orAddtional = a}) .
@@ -491,22 +491,29 @@ instance ToJSON OperationResponse where
491491-- field will contain this \`ExecutionResponse\` object.
492492--
493493-- /See:/ 'executionResponse' smart constructor.
494−newtype ExecutionResponse = ExecutionResponse'
495− { _erResult :: Maybe JSONValue
494+data ExecutionResponse = ExecutionResponse'
495+ { _erStatus :: !(Maybe Text)
496+ , _erResult :: !(Maybe JSONValue)
496497 } deriving (Eq,Show,Data,Typeable,Generic)
497498
498499-- | Creates a value of 'ExecutionResponse' with the minimum fields required to make a request.
499500--
500501-- Use one of the following lenses to modify other fields as desired:
501502--
503+-- * 'erStatus'
504+--
502505-- * 'erResult'
503506executionResponse
504507 :: ExecutionResponse
505508executionResponse =
506509 ExecutionResponse'
507− { _erResult = Nothing
510+ { _erStatus = Nothing
511+ , _erResult = Nothing
508512 }
509513
514+erStatus :: Lens' ExecutionResponse (Maybe Text)
515+erStatus = lens _erStatus (\ s a -> s{_erStatus = a})
516+
510517-- | The return value of the script function. The type will match the type
511518-- returned in Apps Script. Functions called through the Execution API
512519-- cannot return Apps Script-specific objects (such as a \`Document\` or
@@ -518,8 +525,13 @@ erResult = lens _erResult (\ s a -> s{_erResult = a})
518525instance FromJSON ExecutionResponse where
519526 parseJSON
520527 = withObject "ExecutionResponse"
521− (\ o -> ExecutionResponse' <$> (o .:? "result"))
528+ (\ o ->
529+ ExecutionResponse' <$>
530+ (o .:? "status") <*> (o .:? "result"))
522531
523532instance ToJSON ExecutionResponse where
524533 toJSON ExecutionResponse'{..}
525− = object (catMaybes [("result" .=) <$> _erResult])
534+ = object
535+ (catMaybes
536+ [("status" .=) <$> _erStatus,
537+ ("result" .=) <$> _erResult])