on develop help sign in
Regenerating gogol-containerbuilder from updated service defintions
commit3abe22628bc1fb5dbae2910ba366fd4573459205 authorBrendan Hay <brendan.g.hay@gmail.com> dateSat 11 Feb 2017, 11:36 (10 years ago) parent92d3fe9
6 files changed+274−16
gogol-containerbuilder/gen/Network/Google/ContainerBuilder.hs+11 gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types.hs+6 gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Product.hs+60−11 gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Sum.hs−5 gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Operations/Cancel.hs+196 gogol-containerbuilder/gogol-containerbuilder.cabal+1
gogol-containerbuilder/gen/Network/Google/ContainerBuilder.hs+11
@@ -29,6 +29,9 @@ module Network.Google.ContainerBuilder
2929
3030 -- * Resources
3131
32+ -- ** cloudbuild.operations.cancel
33+ , module Network.Google.Resource.Cloudbuild.Operations.Cancel
34+
3235 -- ** cloudbuild.operations.get
3336 , module Network.Google.Resource.Cloudbuild.Operations.Get
3437
@@ -70,6 +73,7 @@ module Network.Google.ContainerBuilder
7073 , bsDir
7174 , bsArgs
7275 , bsEnv
76+ , bsEntrypoint
7377 , bsWaitFor
7478 , bsName
7579 , bsId
@@ -100,6 +104,10 @@ module Network.Google.ContainerBuilder
100104 , lorNextPageToken
101105 , lorOperations
102106
107+ -- ** CancelOperationRequest
108+ , CancelOperationRequest
109+ , cancelOperationRequest
110+
103111 -- ** Hash
104112 , Hash
105113 , hash
@@ -155,6 +163,7 @@ module Network.Google.ContainerBuilder
155163 , bId
156164 , bOptions
157165 , bProjectId
166+ , bBuildTriggerId
158167 , bTimeout
159168 , bFinishTime
160169 , bCreateTime
@@ -244,6 +253,7 @@ module Network.Google.ContainerBuilder
244253
245254import Network.Google.ContainerBuilder.Types
246255import Network.Google.Prelude
256+import Network.Google.Resource.Cloudbuild.Operations.Cancel
247257import Network.Google.Resource.Cloudbuild.Operations.Get
248258import Network.Google.Resource.Cloudbuild.Operations.List
249259import Network.Google.Resource.Cloudbuild.Projects.Builds.Cancel
@@ -263,6 +273,7 @@ TODO
263273-- | Represents the entirety of the methods and resources available for the Google Cloud Container Builder API service.
264274type ContainerBuilderAPI =
265275 OperationsListResource :<|> OperationsGetResource
276+ :<|> OperationsCancelResource
266277 :<|> ProjectsBuildsListResource
267278 :<|> ProjectsBuildsGetResource
268279 :<|> ProjectsBuildsCreateResource
gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types.hs+6
@@ -28,6 +28,7 @@ module Network.Google.ContainerBuilder.Types
2828 , bsDir
2929 , bsArgs
3030 , bsEnv
31+ , bsEntrypoint
3132 , bsWaitFor
3233 , bsName
3334 , bsId
@@ -58,6 +59,10 @@ module Network.Google.ContainerBuilder.Types
5859 , lorNextPageToken
5960 , lorOperations
6061
62+ -- * CancelOperationRequest
63+ , CancelOperationRequest
64+ , cancelOperationRequest
65+
6166 -- * Hash
6267 , Hash
6368 , hash
@@ -113,6 +118,7 @@ module Network.Google.ContainerBuilder.Types
113118 , bId
114119 , bOptions
115120 , bProjectId
121+ , bBuildTriggerId
116122 , bTimeout
117123 , bFinishTime
118124 , bCreateTime
gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Product.hs+60−11
@@ -24,12 +24,13 @@ import Network.Google.Prelude
2424--
2525-- /See:/ 'buildStep' smart constructor.
2626data BuildStep = BuildStep'
27− { _bsDir :: !(Maybe Text)
28− , _bsArgs :: !(Maybe [Text])
29− , _bsEnv :: !(Maybe [Text])
30− , _bsWaitFor :: !(Maybe [Text])
31− , _bsName :: !(Maybe Text)
32− , _bsId :: !(Maybe Text)
27+ { _bsDir :: !(Maybe Text)
28+ , _bsArgs :: !(Maybe [Text])
29+ , _bsEnv :: !(Maybe [Text])
30+ , _bsEntrypoint :: !(Maybe Text)
31+ , _bsWaitFor :: !(Maybe [Text])
32+ , _bsName :: !(Maybe Text)
33+ , _bsId :: !(Maybe Text)
3334 } deriving (Eq,Show,Data,Typeable,Generic)
3435
3536-- | Creates a value of 'BuildStep' with the minimum fields required to make a request.
@@ -42,6 +43,8 @@ data BuildStep = BuildStep'
4243--
4344-- * 'bsEnv'
4445--
46+-- * 'bsEntrypoint'
47+--
4548-- * 'bsWaitFor'
4649--
4750-- * 'bsName'
@@ -54,6 +57,7 @@ buildStep =
5457 { _bsDir = Nothing
5558 , _bsArgs = Nothing
5659 , _bsEnv = Nothing
60+ , _bsEntrypoint = Nothing
5761 , _bsWaitFor = Nothing
5862 , _bsName = Nothing
5963 , _bsId = Nothing
@@ -82,6 +86,12 @@ bsEnv
8286 = lens _bsEnv (\ s a -> s{_bsEnv = a}) . _Default .
8387 _Coerce
8488
89+-- | Optional entrypoint to be used instead of the build step image\'s
90+-- default If unset, the image\'s default will be used.
91+bsEntrypoint :: Lens' BuildStep (Maybe Text)
92+bsEntrypoint
93+ = lens _bsEntrypoint (\ s a -> s{_bsEntrypoint = a})
94+
8595-- | The ID(s) of the step(s) that this build step depends on. This build
8696-- step will not start until all the build steps in wait_for have completed
8797-- successfully. If wait_for is empty, this build step will start when all
@@ -120,6 +130,7 @@ instance FromJSON BuildStep where
120130 BuildStep' <$>
121131 (o .:? "dir") <*> (o .:? "args" .!= mempty) <*>
122132 (o .:? "env" .!= mempty)
133+ <*> (o .:? "entrypoint")
123134 <*> (o .:? "waitFor" .!= mempty)
124135 <*> (o .:? "name")
125136 <*> (o .:? "id"))
@@ -129,7 +140,9 @@ instance ToJSON BuildStep where
129140 = object
130141 (catMaybes
131142 [("dir" .=) <$> _bsDir, ("args" .=) <$> _bsArgs,
132− ("env" .=) <$> _bsEnv, ("waitFor" .=) <$> _bsWaitFor,
143+ ("env" .=) <$> _bsEnv,
144+ ("entrypoint" .=) <$> _bsEntrypoint,
145+ ("waitFor" .=) <$> _bsWaitFor,
133146 ("name" .=) <$> _bsName, ("id" .=) <$> _bsId])
134147
135148-- | Provenance of the source. Ways to find the original source, or verify
@@ -404,11 +417,32 @@ instance ToJSON ListOperationsResponse where
404417 [("nextPageToken" .=) <$> _lorNextPageToken,
405418 ("operations" .=) <$> _lorOperations])
406419
420+-- | The request message for Operations.CancelOperation.
421+--
422+-- /See:/ 'cancelOperationRequest' smart constructor.
423+data CancelOperationRequest =
424+ CancelOperationRequest'
425+ deriving (Eq,Show,Data,Typeable,Generic)
426+
427+-- | Creates a value of 'CancelOperationRequest' with the minimum fields required to make a request.
428+--
429+cancelOperationRequest
430+ :: CancelOperationRequest
431+cancelOperationRequest = CancelOperationRequest'
432+
433+instance FromJSON CancelOperationRequest where
434+ parseJSON
435+ = withObject "CancelOperationRequest"
436+ (\ o -> pure CancelOperationRequest')
437+
438+instance ToJSON CancelOperationRequest where
439+ toJSON = const emptyObject
440+
407441-- | Container message for hash values.
408442--
409443-- /See:/ 'hash' smart constructor.
410444data Hash = Hash'
411− { _hValue :: !(Maybe Base64)
445+ { _hValue :: !(Maybe Bytes)
412446 , _hType :: !(Maybe HashType)
413447 } deriving (Eq,Show,Data,Typeable,Generic)
414448
@@ -431,7 +465,7 @@ hash =
431465hValue :: Lens' Hash (Maybe ByteString)
432466hValue
433467 = lens _hValue (\ s a -> s{_hValue = a}) .
434− mapping _Base64
468+ mapping _Bytes
435469
436470-- | The type of hash that was performed.
437471hType :: Lens' Hash (Maybe HashType)
@@ -757,6 +791,7 @@ data Build = Build'
757791 , _bId :: !(Maybe Text)
758792 , _bOptions :: !(Maybe BuildOptions)
759793 , _bProjectId :: !(Maybe Text)
794+ , _bBuildTriggerId :: !(Maybe Text)
760795 , _bTimeout :: !(Maybe Duration)
761796 , _bFinishTime :: !(Maybe DateTime')
762797 , _bCreateTime :: !(Maybe DateTime')
@@ -792,6 +827,8 @@ data Build = Build'
792827--
793828-- * 'bProjectId'
794829--
830+-- * 'bBuildTriggerId'
831+--
795832-- * 'bTimeout'
796833--
797834-- * 'bFinishTime'
@@ -814,6 +851,7 @@ build =
814851 , _bId = Nothing
815852 , _bOptions = Nothing
816853 , _bProjectId = Nothing
854+ , _bBuildTriggerId = Nothing
817855 , _bTimeout = Nothing
818856 , _bFinishTime = Nothing
819857 , _bCreateTime = Nothing
@@ -891,6 +929,13 @@ bProjectId :: Lens' Build (Maybe Text)
891929bProjectId
892930 = lens _bProjectId (\ s a -> s{_bProjectId = a})
893931
932+-- | The ID of the BuildTrigger that triggered this build, if it was
933+-- triggered automatically. \'OutputOnly
934+bBuildTriggerId :: Lens' Build (Maybe Text)
935+bBuildTriggerId
936+ = lens _bBuildTriggerId
937+ (\ s a -> s{_bBuildTriggerId = a})
938+
894939-- | Amount of time that this build should be allowed to run, to second
895940-- granularity. If this amount of time elapses, work on the build will
896941-- cease and the build status will be TIMEOUT. Default time is ten minutes.
@@ -899,13 +944,15 @@ bTimeout
899944 = lens _bTimeout (\ s a -> s{_bTimeout = a}) .
900945 mapping _Duration
901946
902−-- | Time at which execution of the build was finished. \'OutputOnly
947+-- | Time at which execution of the build was finished. The difference
948+-- between finish_time and start_time is the duration of the build\'s
949+-- execution. \'OutputOnly
903950bFinishTime :: Lens' Build (Maybe UTCTime)
904951bFinishTime
905952 = lens _bFinishTime (\ s a -> s{_bFinishTime = a}) .
906953 mapping _DateTime
907954
908−-- | Time at which the build was created. \'OutputOnly
955+-- | Time at which the request to create the build was received. \'OutputOnly
909956bCreateTime :: Lens' Build (Maybe UTCTime)
910957bCreateTime
911958 = lens _bCreateTime (\ s a -> s{_bCreateTime = a}) .
@@ -928,6 +975,7 @@ instance FromJSON Build where
928975 <*> (o .:? "id")
929976 <*> (o .:? "options")
930977 <*> (o .:? "projectId")
978+ <*> (o .:? "buildTriggerId")
931979 <*> (o .:? "timeout")
932980 <*> (o .:? "finishTime")
933981 <*> (o .:? "createTime"))
@@ -948,6 +996,7 @@ instance ToJSON Build where
948996 ("source" .=) <$> _bSource, ("id" .=) <$> _bId,
949997 ("options" .=) <$> _bOptions,
950998 ("projectId" .=) <$> _bProjectId,
999+ ("buildTriggerId" .=) <$> _bBuildTriggerId,
9511000 ("timeout" .=) <$> _bTimeout,
9521001 ("finishTime" .=) <$> _bFinishTime,
9531002 ("createTime" .=) <$> _bCreateTime])
gogol-containerbuilder/gen/Network/Google/ContainerBuilder/Types/Sum.hs−5
@@ -81,9 +81,6 @@ data BuildStatus
8181 = StatusUnknown
8282 -- ^ @STATUS_UNKNOWN@
8383 -- Status of the build is unknown.
84− | Queuing
85− -- ^ @QUEUING@
86− -- Build has been received and is being queued.
8784 | Queued
8885 -- ^ @QUEUED@
8986 -- Build is queued; work has not yet begun.
@@ -112,7 +109,6 @@ instance Hashable BuildStatus
112109instance FromHttpApiData BuildStatus where
113110 parseQueryParam = \case
114111 "STATUS_UNKNOWN" -> Right StatusUnknown
115− "QUEUING" -> Right Queuing
116112 "QUEUED" -> Right Queued
117113 "WORKING" -> Right Working
118114 "SUCCESS" -> Right Success
@@ -125,7 +121,6 @@ instance FromHttpApiData BuildStatus where
125121instance ToHttpApiData BuildStatus where
126122 toQueryParam = \case
127123 StatusUnknown -> "STATUS_UNKNOWN"
128− Queuing -> "QUEUING"
129124 Queued -> "QUEUED"
130125 Working -> "WORKING"
131126 Success -> "SUCCESS"
gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Operations/Cancel.hsnew file+196
@@ -0,0 +1,196 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+{-# LANGUAGE FlexibleInstances #-}
5+{-# LANGUAGE NoImplicitPrelude #-}
6+{-# LANGUAGE OverloadedStrings #-}
7+{-# LANGUAGE RecordWildCards #-}
8+{-# LANGUAGE TypeFamilies #-}
9+{-# LANGUAGE TypeOperators #-}
10+
11+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
12+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
13+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
14+
15+-- |
16+-- Module : Network.Google.Resource.Cloudbuild.Operations.Cancel
17+-- Copyright : (c) 2015-2016 Brendan Hay
18+-- License : Mozilla Public License, v. 2.0.
19+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
20+-- Stability : auto-generated
21+-- Portability : non-portable (GHC extensions)
22+--
23+-- Starts asynchronous cancellation on a long-running operation. The server
24+-- makes a best effort to cancel the operation, but success is not
25+-- guaranteed. If the server doesn\'t support this method, it returns
26+-- \`google.rpc.Code.UNIMPLEMENTED\`. Clients can use
27+-- Operations.GetOperation or other methods to check whether the
28+-- cancellation succeeded or whether the operation completed despite
29+-- cancellation. On successful cancellation, the operation is not deleted;
30+-- instead, it becomes an operation with an Operation.error value with a
31+-- google.rpc.Status.code of 1, corresponding to \`Code.CANCELLED\`.
32+--
33+-- /See:/ <https://cloud.google.com/container-builder/docs/ Google Cloud Container Builder API Reference> for @cloudbuild.operations.cancel@.
34+module Network.Google.Resource.Cloudbuild.Operations.Cancel
35+ (
36+ -- * REST Resource
37+ OperationsCancelResource
38+
39+ -- * Creating a Request
40+ , operationsCancel
41+ , OperationsCancel
42+
43+ -- * Request Lenses
44+ , ocXgafv
45+ , ocUploadProtocol
46+ , ocPp
47+ , ocAccessToken
48+ , ocUploadType
49+ , ocPayload
50+ , ocBearerToken
51+ , ocName
52+ , ocCallback
53+ ) where
54+
55+import Network.Google.ContainerBuilder.Types
56+import Network.Google.Prelude
57+
58+-- | A resource alias for @cloudbuild.operations.cancel@ method which the
59+-- 'OperationsCancel' request conforms to.
60+type OperationsCancelResource =
61+ "v1" :>
62+ CaptureMode "name" "cancel" Text :>
63+ QueryParam "$.xgafv" Xgafv :>
64+ QueryParam "upload_protocol" Text :>
65+ QueryParam "pp" Bool :>
66+ QueryParam "access_token" Text :>
67+ QueryParam "uploadType" Text :>
68+ QueryParam "bearer_token" Text :>
69+ QueryParam "callback" Text :>
70+ QueryParam "alt" AltJSON :>
71+ ReqBody '[JSON] CancelOperationRequest :>
72+ Post '[JSON] Empty
73+
74+-- | Starts asynchronous cancellation on a long-running operation. The server
75+-- makes a best effort to cancel the operation, but success is not
76+-- guaranteed. If the server doesn\'t support this method, it returns
77+-- \`google.rpc.Code.UNIMPLEMENTED\`. Clients can use
78+-- Operations.GetOperation or other methods to check whether the
79+-- cancellation succeeded or whether the operation completed despite
80+-- cancellation. On successful cancellation, the operation is not deleted;
81+-- instead, it becomes an operation with an Operation.error value with a
82+-- google.rpc.Status.code of 1, corresponding to \`Code.CANCELLED\`.
83+--
84+-- /See:/ 'operationsCancel' smart constructor.
85+data OperationsCancel = OperationsCancel'
86+ { _ocXgafv :: !(Maybe Xgafv)
87+ , _ocUploadProtocol :: !(Maybe Text)
88+ , _ocPp :: !Bool
89+ , _ocAccessToken :: !(Maybe Text)
90+ , _ocUploadType :: !(Maybe Text)
91+ , _ocPayload :: !CancelOperationRequest
92+ , _ocBearerToken :: !(Maybe Text)
93+ , _ocName :: !Text
94+ , _ocCallback :: !(Maybe Text)
95+ } deriving (Eq,Show,Data,Typeable,Generic)
96+
97+-- | Creates a value of 'OperationsCancel' with the minimum fields required to make a request.
98+--
99+-- Use one of the following lenses to modify other fields as desired:
100+--
101+-- * 'ocXgafv'
102+--
103+-- * 'ocUploadProtocol'
104+--
105+-- * 'ocPp'
106+--
107+-- * 'ocAccessToken'
108+--
109+-- * 'ocUploadType'
110+--
111+-- * 'ocPayload'
112+--
113+-- * 'ocBearerToken'
114+--
115+-- * 'ocName'
116+--
117+-- * 'ocCallback'
118+operationsCancel
119+ :: CancelOperationRequest -- ^ 'ocPayload'
120+ -> Text -- ^ 'ocName'
121+ -> OperationsCancel
122+operationsCancel pOcPayload_ pOcName_ =
123+ OperationsCancel'
124+ { _ocXgafv = Nothing
125+ , _ocUploadProtocol = Nothing
126+ , _ocPp = True
127+ , _ocAccessToken = Nothing
128+ , _ocUploadType = Nothing
129+ , _ocPayload = pOcPayload_
130+ , _ocBearerToken = Nothing
131+ , _ocName = pOcName_
132+ , _ocCallback = Nothing
133+ }
134+
135+-- | V1 error format.
136+ocXgafv :: Lens' OperationsCancel (Maybe Xgafv)
137+ocXgafv = lens _ocXgafv (\ s a -> s{_ocXgafv = a})
138+
139+-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
140+ocUploadProtocol :: Lens' OperationsCancel (Maybe Text)
141+ocUploadProtocol
142+ = lens _ocUploadProtocol
143+ (\ s a -> s{_ocUploadProtocol = a})
144+
145+-- | Pretty-print response.
146+ocPp :: Lens' OperationsCancel Bool
147+ocPp = lens _ocPp (\ s a -> s{_ocPp = a})
148+
149+-- | OAuth access token.
150+ocAccessToken :: Lens' OperationsCancel (Maybe Text)
151+ocAccessToken
152+ = lens _ocAccessToken
153+ (\ s a -> s{_ocAccessToken = a})
154+
155+-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
156+ocUploadType :: Lens' OperationsCancel (Maybe Text)
157+ocUploadType
158+ = lens _ocUploadType (\ s a -> s{_ocUploadType = a})
159+
160+-- | Multipart request metadata.
161+ocPayload :: Lens' OperationsCancel CancelOperationRequest
162+ocPayload
163+ = lens _ocPayload (\ s a -> s{_ocPayload = a})
164+
165+-- | OAuth bearer token.
166+ocBearerToken :: Lens' OperationsCancel (Maybe Text)
167+ocBearerToken
168+ = lens _ocBearerToken
169+ (\ s a -> s{_ocBearerToken = a})
170+
171+-- | The name of the operation resource to be cancelled.
172+ocName :: Lens' OperationsCancel Text
173+ocName = lens _ocName (\ s a -> s{_ocName = a})
174+
175+-- | JSONP
176+ocCallback :: Lens' OperationsCancel (Maybe Text)
177+ocCallback
178+ = lens _ocCallback (\ s a -> s{_ocCallback = a})
179+
180+instance GoogleRequest OperationsCancel where
181+ type Rs OperationsCancel = Empty
182+ type Scopes OperationsCancel =
183+ '["https://www.googleapis.com/auth/cloud-platform"]
184+ requestClient OperationsCancel'{..}
185+ = go _ocName _ocXgafv _ocUploadProtocol (Just _ocPp)
186+ _ocAccessToken
187+ _ocUploadType
188+ _ocBearerToken
189+ _ocCallback
190+ (Just AltJSON)
191+ _ocPayload
192+ containerBuilderService
193+ where go
194+ = buildClient
195+ (Proxy :: Proxy OperationsCancelResource)
196+ mempty
gogol-containerbuilder/gogol-containerbuilder.cabal+1
@@ -35,6 +35,7 @@ library
3535 exposed-modules:
3636 Network.Google.ContainerBuilder
3737 , Network.Google.ContainerBuilder.Types
38+ , Network.Google.Resource.Cloudbuild.Operations.Cancel
3839 , Network.Google.Resource.Cloudbuild.Operations.Get
3940 , Network.Google.Resource.Cloudbuild.Operations.List
4041 , Network.Google.Resource.Cloudbuild.Projects.Builds.Cancel