@@ -0,0 +1,1520 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
6+
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
9+
10+-- |
11+-- Module : Network.Google.ContainerBuilder.Types.Product
12+-- Copyright : (c) 2015-2016 Brendan Hay
13+-- License : Mozilla Public License, v. 2.0.
14+-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>
15+-- Stability : auto-generated
16+-- Portability : non-portable (GHC extensions)
17+--
18+module Network.Google.ContainerBuilder.Types.Product where
19+
20+import Network.Google.ContainerBuilder.Types.Sum
21+import Network.Google.Prelude
22+
23+-- | BuildStep describes a step to perform in the build pipeline.
24+--
25+-- /See:/ 'buildStep' smart constructor.
26+data 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)
33+ } deriving (Eq,Show,Data,Typeable,Generic)
34+
35+-- | Creates a value of 'BuildStep' with the minimum fields required to make a request.
36+--
37+-- Use one of the following lenses to modify other fields as desired:
38+--
39+-- * 'bsDir'
40+--
41+-- * 'bsArgs'
42+--
43+-- * 'bsEnv'
44+--
45+-- * 'bsWaitFor'
46+--
47+-- * 'bsName'
48+--
49+-- * 'bsId'
50+buildStep
51+ :: BuildStep
52+buildStep =
53+ BuildStep'
54+ { _bsDir = Nothing
55+ , _bsArgs = Nothing
56+ , _bsEnv = Nothing
57+ , _bsWaitFor = Nothing
58+ , _bsName = Nothing
59+ , _bsId = Nothing
60+ }
61+
62+-- | Working directory (relative to project source root) to use when running
63+-- this operation\'s container.
64+bsDir :: Lens' BuildStep (Maybe Text)
65+bsDir = lens _bsDir (\ s a -> s{_bsDir = a})
66+
67+-- | A list of arguments that will be presented to the step when it is
68+-- started. If the image used to run the step\'s container has an
69+-- entrypoint, these args will be used as arguments to that entrypoint. If
70+-- the image does not define an entrypoint, the first element in args will
71+-- be used as the entrypoint, and the remainder will be used as arguments.
72+bsArgs :: Lens' BuildStep [Text]
73+bsArgs
74+ = lens _bsArgs (\ s a -> s{_bsArgs = a}) . _Default .
75+ _Coerce
76+
77+-- | A list of environment variable definitions to be used when running a
78+-- step. The elements are of the form \"KEY=VALUE\" for the environment
79+-- variable \"KEY\" being given the value \"VALUE\".
80+bsEnv :: Lens' BuildStep [Text]
81+bsEnv
82+ = lens _bsEnv (\ s a -> s{_bsEnv = a}) . _Default .
83+ _Coerce
84+
85+-- | The ID(s) of the step(s) that this build step depends on. This build
86+-- step will not start until all the build steps in wait_for have completed
87+-- successfully. If wait_for is empty, this build step will start when all
88+-- previous build steps in the Build.Steps list have completed
89+-- successfully.
90+bsWaitFor :: Lens' BuildStep [Text]
91+bsWaitFor
92+ = lens _bsWaitFor (\ s a -> s{_bsWaitFor = a}) .
93+ _Default
94+ . _Coerce
95+
96+-- | The name of the container image that will run this particular build
97+-- step. If the image is already available in the host\'s Docker daemon\'s
98+-- cache, it will be run directly. If not, the host will attempt to pull
99+-- the image first, using the builder service account\'s credentials if
100+-- necessary. The Docker daemon\'s cache will already have the latest
101+-- versions of all of the officially supported build steps
102+-- (https:\/\/github.com\/GoogleCloudPlatform\/cloud-builders). The Docker
103+-- daemon will also have cached many of the layers for some popular images,
104+-- like \"ubuntu\", \"debian\", but they will be refreshed at the time you
105+-- attempt to use them. If you built an image in a previous build step, it
106+-- will be stored in the host\'s Docker daemon\'s cache and is available to
107+-- use as the name for a later build step.
108+bsName :: Lens' BuildStep (Maybe Text)
109+bsName = lens _bsName (\ s a -> s{_bsName = a})
110+
111+-- | Optional unique identifier for this build step, used in wait_for to
112+-- reference this build step as a dependency.
113+bsId :: Lens' BuildStep (Maybe Text)
114+bsId = lens _bsId (\ s a -> s{_bsId = a})
115+
116+instance FromJSON BuildStep where
117+ parseJSON
118+ = withObject "BuildStep"
119+ (\ o ->
120+ BuildStep' <$>
121+ (o .:? "dir") <*> (o .:? "args" .!= mempty) <*>
122+ (o .:? "env" .!= mempty)
123+ <*> (o .:? "waitFor" .!= mempty)
124+ <*> (o .:? "name")
125+ <*> (o .:? "id"))
126+
127+instance ToJSON BuildStep where
128+ toJSON BuildStep'{..}
129+ = object
130+ (catMaybes
131+ [("dir" .=) <$> _bsDir, ("args" .=) <$> _bsArgs,
132+ ("env" .=) <$> _bsEnv, ("waitFor" .=) <$> _bsWaitFor,
133+ ("name" .=) <$> _bsName, ("id" .=) <$> _bsId])
134+
135+-- | Provenance of the source. Ways to find the original source, or verify
136+-- that some source was used for this build.
137+--
138+-- /See:/ 'sourceProvenance' smart constructor.
139+data SourceProvenance = SourceProvenance'
140+ { _spResolvedRepoSource :: !(Maybe RepoSource)
141+ , _spResolvedStorageSource :: !(Maybe StorageSource)
142+ , _spFileHashes :: !(Maybe SourceProvenanceFileHashes)
143+ } deriving (Eq,Show,Data,Typeable,Generic)
144+
145+-- | Creates a value of 'SourceProvenance' with the minimum fields required to make a request.
146+--
147+-- Use one of the following lenses to modify other fields as desired:
148+--
149+-- * 'spResolvedRepoSource'
150+--
151+-- * 'spResolvedStorageSource'
152+--
153+-- * 'spFileHashes'
154+sourceProvenance
155+ :: SourceProvenance
156+sourceProvenance =
157+ SourceProvenance'
158+ { _spResolvedRepoSource = Nothing
159+ , _spResolvedStorageSource = Nothing
160+ , _spFileHashes = Nothing
161+ }
162+
163+-- | A copy of the build\'s source.repo_source, if exists, with any revisions
164+-- resolved.
165+spResolvedRepoSource :: Lens' SourceProvenance (Maybe RepoSource)
166+spResolvedRepoSource
167+ = lens _spResolvedRepoSource
168+ (\ s a -> s{_spResolvedRepoSource = a})
169+
170+-- | A copy of the build\'s source.storage_source, if exists, with any
171+-- generations resolved.
172+spResolvedStorageSource :: Lens' SourceProvenance (Maybe StorageSource)
173+spResolvedStorageSource
174+ = lens _spResolvedStorageSource
175+ (\ s a -> s{_spResolvedStorageSource = a})
176+
177+-- | Hash(es) of the build source, which can be used to verify that the
178+-- original source integrity was maintained in the build. Note that
179+-- FileHashes will only be populated if BuildOptions has requested a
180+-- SourceProvenanceHash. The keys to this map are file paths used as build
181+-- source and the values contain the hash values for those files. If the
182+-- build source came in a single package such as a gzipped tarfile
183+-- (.tar.gz), the FileHash will be for the single path to that file.
184+-- \'OutputOnly
185+spFileHashes :: Lens' SourceProvenance (Maybe SourceProvenanceFileHashes)
186+spFileHashes
187+ = lens _spFileHashes (\ s a -> s{_spFileHashes = a})
188+
189+instance FromJSON SourceProvenance where
190+ parseJSON
191+ = withObject "SourceProvenance"
192+ (\ o ->
193+ SourceProvenance' <$>
194+ (o .:? "resolvedRepoSource") <*>
195+ (o .:? "resolvedStorageSource")
196+ <*> (o .:? "fileHashes"))
197+
198+instance ToJSON SourceProvenance where
199+ toJSON SourceProvenance'{..}
200+ = object
201+ (catMaybes
202+ [("resolvedRepoSource" .=) <$> _spResolvedRepoSource,
203+ ("resolvedStorageSource" .=) <$>
204+ _spResolvedStorageSource,
205+ ("fileHashes" .=) <$> _spFileHashes])
206+
207+-- | Response including listed builds.
208+--
209+-- /See:/ 'listBuildsResponse' smart constructor.
210+data ListBuildsResponse = ListBuildsResponse'
211+ { _lbrNextPageToken :: !(Maybe Text)
212+ , _lbrBuilds :: !(Maybe [Build])
213+ } deriving (Eq,Show,Data,Typeable,Generic)
214+
215+-- | Creates a value of 'ListBuildsResponse' with the minimum fields required to make a request.
216+--
217+-- Use one of the following lenses to modify other fields as desired:
218+--
219+-- * 'lbrNextPageToken'
220+--
221+-- * 'lbrBuilds'
222+listBuildsResponse
223+ :: ListBuildsResponse
224+listBuildsResponse =
225+ ListBuildsResponse'
226+ { _lbrNextPageToken = Nothing
227+ , _lbrBuilds = Nothing
228+ }
229+
230+-- | Token to receive the next page of results.
231+lbrNextPageToken :: Lens' ListBuildsResponse (Maybe Text)
232+lbrNextPageToken
233+ = lens _lbrNextPageToken
234+ (\ s a -> s{_lbrNextPageToken = a})
235+
236+-- | Builds will be sorted by create_time, descending.
237+lbrBuilds :: Lens' ListBuildsResponse [Build]
238+lbrBuilds
239+ = lens _lbrBuilds (\ s a -> s{_lbrBuilds = a}) .
240+ _Default
241+ . _Coerce
242+
243+instance FromJSON ListBuildsResponse where
244+ parseJSON
245+ = withObject "ListBuildsResponse"
246+ (\ o ->
247+ ListBuildsResponse' <$>
248+ (o .:? "nextPageToken") <*>
249+ (o .:? "builds" .!= mempty))
250+
251+instance ToJSON ListBuildsResponse where
252+ toJSON ListBuildsResponse'{..}
253+ = object
254+ (catMaybes
255+ [("nextPageToken" .=) <$> _lbrNextPageToken,
256+ ("builds" .=) <$> _lbrBuilds])
257+
258+-- | The \`Status\` type defines a logical error model that is suitable for
259+-- different programming environments, including REST APIs and RPC APIs. It
260+-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
261+-- designed to be: - Simple to use and understand for most users - Flexible
262+-- enough to meet unexpected needs # Overview The \`Status\` message
263+-- contains three pieces of data: error code, error message, and error
264+-- details. The error code should be an enum value of google.rpc.Code, but
265+-- it may accept additional error codes if needed. The error message should
266+-- be a developer-facing English message that helps developers *understand*
267+-- and *resolve* the error. If a localized user-facing error message is
268+-- needed, put the localized message in the error details or localize it in
269+-- the client. The optional error details may contain arbitrary information
270+-- about the error. There is a predefined set of error detail types in the
271+-- package \`google.rpc\` which can be used for common error conditions. #
272+-- Language mapping The \`Status\` message is the logical representation of
273+-- the error model, but it is not necessarily the actual wire format. When
274+-- the \`Status\` message is exposed in different client libraries and
275+-- different wire protocols, it can be mapped differently. For example, it
276+-- will likely be mapped to some exceptions in Java, but more likely mapped
277+-- to some error codes in C. # Other uses The error model and the
278+-- \`Status\` message can be used in a variety of environments, either with
279+-- or without APIs, to provide a consistent developer experience across
280+-- different environments. Example uses of this error model include: -
281+-- Partial errors. If a service needs to return partial errors to the
282+-- client, it may embed the \`Status\` in the normal response to indicate
283+-- the partial errors. - Workflow errors. A typical workflow has multiple
284+-- steps. Each step may have a \`Status\` message for error reporting
285+-- purpose. - Batch operations. If a client uses batch request and batch
286+-- response, the \`Status\` message should be used directly inside batch
287+-- response, one for each error sub-response. - Asynchronous operations. If
288+-- an API call embeds asynchronous operation results in its response, the
289+-- status of those operations should be represented directly using the
290+-- \`Status\` message. - Logging. If some API errors are stored in logs,
291+-- the message \`Status\` could be used directly after any stripping needed
292+-- for security\/privacy reasons.
293+--
294+-- /See:/ 'status' smart constructor.
295+data Status = Status'
296+ { _sDetails :: !(Maybe [StatusDetailsItem])
297+ , _sCode :: !(Maybe (Textual Int32))
298+ , _sMessage :: !(Maybe Text)
299+ } deriving (Eq,Show,Data,Typeable,Generic)
300+
301+-- | Creates a value of 'Status' with the minimum fields required to make a request.
302+--
303+-- Use one of the following lenses to modify other fields as desired:
304+--
305+-- * 'sDetails'
306+--
307+-- * 'sCode'
308+--
309+-- * 'sMessage'
310+status
311+ :: Status
312+status =
313+ Status'
314+ { _sDetails = Nothing
315+ , _sCode = Nothing
316+ , _sMessage = Nothing
317+ }
318+
319+-- | A list of messages that carry the error details. There will be a common
320+-- set of message types for APIs to use.
321+sDetails :: Lens' Status [StatusDetailsItem]
322+sDetails
323+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
324+ _Default
325+ . _Coerce
326+
327+-- | The status code, which should be an enum value of google.rpc.Code.
328+sCode :: Lens' Status (Maybe Int32)
329+sCode
330+ = lens _sCode (\ s a -> s{_sCode = a}) .
331+ mapping _Coerce
332+
333+-- | A developer-facing error message, which should be in English. Any
334+-- user-facing error message should be localized and sent in the
335+-- google.rpc.Status.details field, or localized by the client.
336+sMessage :: Lens' Status (Maybe Text)
337+sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
338+
339+instance FromJSON Status where
340+ parseJSON
341+ = withObject "Status"
342+ (\ o ->
343+ Status' <$>
344+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
345+ (o .:? "message"))
346+
347+instance ToJSON Status where
348+ toJSON Status'{..}
349+ = object
350+ (catMaybes
351+ [("details" .=) <$> _sDetails,
352+ ("code" .=) <$> _sCode,
353+ ("message" .=) <$> _sMessage])
354+
355+-- | The response message for Operations.ListOperations.
356+--
357+-- /See:/ 'listOperationsResponse' smart constructor.
358+data ListOperationsResponse = ListOperationsResponse'
359+ { _lorNextPageToken :: !(Maybe Text)
360+ , _lorOperations :: !(Maybe [Operation])
361+ } deriving (Eq,Show,Data,Typeable,Generic)
362+
363+-- | Creates a value of 'ListOperationsResponse' with the minimum fields required to make a request.
364+--
365+-- Use one of the following lenses to modify other fields as desired:
366+--
367+-- * 'lorNextPageToken'
368+--
369+-- * 'lorOperations'
370+listOperationsResponse
371+ :: ListOperationsResponse
372+listOperationsResponse =
373+ ListOperationsResponse'
374+ { _lorNextPageToken = Nothing
375+ , _lorOperations = Nothing
376+ }
377+
378+-- | The standard List next-page token.
379+lorNextPageToken :: Lens' ListOperationsResponse (Maybe Text)
380+lorNextPageToken
381+ = lens _lorNextPageToken
382+ (\ s a -> s{_lorNextPageToken = a})
383+
384+-- | A list of operations that matches the specified filter in the request.
385+lorOperations :: Lens' ListOperationsResponse [Operation]
386+lorOperations
387+ = lens _lorOperations
388+ (\ s a -> s{_lorOperations = a})
389+ . _Default
390+ . _Coerce
391+
392+instance FromJSON ListOperationsResponse where
393+ parseJSON
394+ = withObject "ListOperationsResponse"
395+ (\ o ->
396+ ListOperationsResponse' <$>
397+ (o .:? "nextPageToken") <*>
398+ (o .:? "operations" .!= mempty))
399+
400+instance ToJSON ListOperationsResponse where
401+ toJSON ListOperationsResponse'{..}
402+ = object
403+ (catMaybes
404+ [("nextPageToken" .=) <$> _lorNextPageToken,
405+ ("operations" .=) <$> _lorOperations])
406+
407+-- | Container message for hash values.
408+--
409+-- /See:/ 'hash' smart constructor.
410+data Hash = Hash'
411+ { _hValue :: !(Maybe Base64)
412+ , _hType :: !(Maybe HashType)
413+ } deriving (Eq,Show,Data,Typeable,Generic)
414+
415+-- | Creates a value of 'Hash' with the minimum fields required to make a request.
416+--
417+-- Use one of the following lenses to modify other fields as desired:
418+--
419+-- * 'hValue'
420+--
421+-- * 'hType'
422+hash
423+ :: Hash
424+hash =
425+ Hash'
426+ { _hValue = Nothing
427+ , _hType = Nothing
428+ }
429+
430+-- | The hash value.
431+hValue :: Lens' Hash (Maybe ByteString)
432+hValue
433+ = lens _hValue (\ s a -> s{_hValue = a}) .
434+ mapping _Base64
435+
436+-- | The type of hash that was performed.
437+hType :: Lens' Hash (Maybe HashType)
438+hType = lens _hType (\ s a -> s{_hType = a})
439+
440+instance FromJSON Hash where
441+ parseJSON
442+ = withObject "Hash"
443+ (\ o -> Hash' <$> (o .:? "value") <*> (o .:? "type"))
444+
445+instance ToJSON Hash where
446+ toJSON Hash'{..}
447+ = object
448+ (catMaybes
449+ [("value" .=) <$> _hValue, ("type" .=) <$> _hType])
450+
451+-- | Results describes the artifacts created by the build pipeline.
452+--
453+-- /See:/ 'results' smart constructor.
454+data Results = Results'
455+ { _rImages :: !(Maybe [BuiltImage])
456+ , _rBuildStepImages :: !(Maybe [Text])
457+ } deriving (Eq,Show,Data,Typeable,Generic)
458+
459+-- | Creates a value of 'Results' with the minimum fields required to make a request.
460+--
461+-- Use one of the following lenses to modify other fields as desired:
462+--
463+-- * 'rImages'
464+--
465+-- * 'rBuildStepImages'
466+results
467+ :: Results
468+results =
469+ Results'
470+ { _rImages = Nothing
471+ , _rBuildStepImages = Nothing
472+ }
473+
474+-- | Images that were built as a part of the build.
475+rImages :: Lens' Results [BuiltImage]
476+rImages
477+ = lens _rImages (\ s a -> s{_rImages = a}) . _Default
478+ . _Coerce
479+
480+-- | List of build step digests, in order corresponding to build step
481+-- indices.
482+rBuildStepImages :: Lens' Results [Text]
483+rBuildStepImages
484+ = lens _rBuildStepImages
485+ (\ s a -> s{_rBuildStepImages = a})
486+ . _Default
487+ . _Coerce
488+
489+instance FromJSON Results where
490+ parseJSON
491+ = withObject "Results"
492+ (\ o ->
493+ Results' <$>
494+ (o .:? "images" .!= mempty) <*>
495+ (o .:? "buildStepImages" .!= mempty))
496+
497+instance ToJSON Results where
498+ toJSON Results'{..}
499+ = object
500+ (catMaybes
501+ [("images" .=) <$> _rImages,
502+ ("buildStepImages" .=) <$> _rBuildStepImages])
503+
504+-- | RepoSource describes the location of the source in a Google Cloud Source
505+-- Repository.
506+--
507+-- /See:/ 'repoSource' smart constructor.
508+data RepoSource = RepoSource'
509+ { _rsRepoName :: !(Maybe Text)
510+ , _rsCommitSha :: !(Maybe Text)
511+ , _rsBranchName :: !(Maybe Text)
512+ , _rsTagName :: !(Maybe Text)
513+ , _rsProjectId :: !(Maybe Text)
514+ } deriving (Eq,Show,Data,Typeable,Generic)
515+
516+-- | Creates a value of 'RepoSource' with the minimum fields required to make a request.
517+--
518+-- Use one of the following lenses to modify other fields as desired:
519+--
520+-- * 'rsRepoName'
521+--
522+-- * 'rsCommitSha'
523+--
524+-- * 'rsBranchName'
525+--
526+-- * 'rsTagName'
527+--
528+-- * 'rsProjectId'
529+repoSource
530+ :: RepoSource
531+repoSource =
532+ RepoSource'
533+ { _rsRepoName = Nothing
534+ , _rsCommitSha = Nothing
535+ , _rsBranchName = Nothing
536+ , _rsTagName = Nothing
537+ , _rsProjectId = Nothing
538+ }
539+
540+-- | Name of the repo. If omitted, the name \"default\" is assumed.
541+rsRepoName :: Lens' RepoSource (Maybe Text)
542+rsRepoName
543+ = lens _rsRepoName (\ s a -> s{_rsRepoName = a})
544+
545+-- | Explicit commit SHA to build.
546+rsCommitSha :: Lens' RepoSource (Maybe Text)
547+rsCommitSha
548+ = lens _rsCommitSha (\ s a -> s{_rsCommitSha = a})
549+
550+-- | Name of the branch to build.
551+rsBranchName :: Lens' RepoSource (Maybe Text)
552+rsBranchName
553+ = lens _rsBranchName (\ s a -> s{_rsBranchName = a})
554+
555+-- | Name of the tag to build.
556+rsTagName :: Lens' RepoSource (Maybe Text)
557+rsTagName
558+ = lens _rsTagName (\ s a -> s{_rsTagName = a})
559+
560+-- | ID of the project that owns the repo. If omitted, the project ID
561+-- requesting the build is assumed.
562+rsProjectId :: Lens' RepoSource (Maybe Text)
563+rsProjectId
564+ = lens _rsProjectId (\ s a -> s{_rsProjectId = a})
565+
566+instance FromJSON RepoSource where
567+ parseJSON
568+ = withObject "RepoSource"
569+ (\ o ->
570+ RepoSource' <$>
571+ (o .:? "repoName") <*> (o .:? "commitSha") <*>
572+ (o .:? "branchName")
573+ <*> (o .:? "tagName")
574+ <*> (o .:? "projectId"))
575+
576+instance ToJSON RepoSource where
577+ toJSON RepoSource'{..}
578+ = object
579+ (catMaybes
580+ [("repoName" .=) <$> _rsRepoName,
581+ ("commitSha" .=) <$> _rsCommitSha,
582+ ("branchName" .=) <$> _rsBranchName,
583+ ("tagName" .=) <$> _rsTagName,
584+ ("projectId" .=) <$> _rsProjectId])
585+
586+-- | This resource represents a long-running operation that is the result of
587+-- a network API call.
588+--
589+-- /See:/ 'operation' smart constructor.
590+data Operation = Operation'
591+ { _oDone :: !(Maybe Bool)
592+ , _oError :: !(Maybe Status)
593+ , _oResponse :: !(Maybe OperationResponse)
594+ , _oName :: !(Maybe Text)
595+ , _oMetadata :: !(Maybe OperationMetadata)
596+ } deriving (Eq,Show,Data,Typeable,Generic)
597+
598+-- | Creates a value of 'Operation' with the minimum fields required to make a request.
599+--
600+-- Use one of the following lenses to modify other fields as desired:
601+--
602+-- * 'oDone'
603+--
604+-- * 'oError'
605+--
606+-- * 'oResponse'
607+--
608+-- * 'oName'
609+--
610+-- * 'oMetadata'
611+operation
612+ :: Operation
613+operation =
614+ Operation'
615+ { _oDone = Nothing
616+ , _oError = Nothing
617+ , _oResponse = Nothing
618+ , _oName = Nothing
619+ , _oMetadata = Nothing
620+ }
621+
622+-- | If the value is \`false\`, it means the operation is still in progress.
623+-- If true, the operation is completed, and either \`error\` or
624+-- \`response\` is available.
625+oDone :: Lens' Operation (Maybe Bool)
626+oDone = lens _oDone (\ s a -> s{_oDone = a})
627+
628+-- | The error result of the operation in case of failure or cancellation.
629+oError :: Lens' Operation (Maybe Status)
630+oError = lens _oError (\ s a -> s{_oError = a})
631+
632+-- | The normal response of the operation in case of success. If the original
633+-- method returns no data on success, such as \`Delete\`, the response is
634+-- \`google.protobuf.Empty\`. If the original method is standard
635+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
636+-- For other methods, the response should have the type \`XxxResponse\`,
637+-- where \`Xxx\` is the original method name. For example, if the original
638+-- method name is \`TakeSnapshot()\`, the inferred response type is
639+-- \`TakeSnapshotResponse\`.
640+oResponse :: Lens' Operation (Maybe OperationResponse)
641+oResponse
642+ = lens _oResponse (\ s a -> s{_oResponse = a})
643+
644+-- | The server-assigned name, which is only unique within the same service
645+-- that originally returns it. If you use the default HTTP mapping, the
646+-- \`name\` should have the format of \`operations\/some\/unique\/name\`.
647+oName :: Lens' Operation (Maybe Text)
648+oName = lens _oName (\ s a -> s{_oName = a})
649+
650+-- | Service-specific metadata associated with the operation. It typically
651+-- contains progress information and common metadata such as create time.
652+-- Some services might not provide such metadata. Any method that returns a
653+-- long-running operation should document the metadata type, if any.
654+oMetadata :: Lens' Operation (Maybe OperationMetadata)
655+oMetadata
656+ = lens _oMetadata (\ s a -> s{_oMetadata = a})
657+
658+instance FromJSON Operation where
659+ parseJSON
660+ = withObject "Operation"
661+ (\ o ->
662+ Operation' <$>
663+ (o .:? "done") <*> (o .:? "error") <*>
664+ (o .:? "response")
665+ <*> (o .:? "name")
666+ <*> (o .:? "metadata"))
667+
668+instance ToJSON Operation where
669+ toJSON Operation'{..}
670+ = object
671+ (catMaybes
672+ [("done" .=) <$> _oDone, ("error" .=) <$> _oError,
673+ ("response" .=) <$> _oResponse,
674+ ("name" .=) <$> _oName,
675+ ("metadata" .=) <$> _oMetadata])
676+
677+-- | A generic empty message that you can re-use to avoid defining duplicated
678+-- empty messages in your APIs. A typical example is to use it as the
679+-- request or the response type of an API method. For instance: service Foo
680+-- { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
681+-- JSON representation for \`Empty\` is empty JSON object \`{}\`.
682+--
683+-- /See:/ 'empty' smart constructor.
684+data Empty =
685+ Empty'
686+ deriving (Eq,Show,Data,Typeable,Generic)
687+
688+-- | Creates a value of 'Empty' with the minimum fields required to make a request.
689+--
690+empty
691+ :: Empty
692+empty = Empty'
693+
694+instance FromJSON Empty where
695+ parseJSON = withObject "Empty" (\ o -> pure Empty')
696+
697+instance ToJSON Empty where
698+ toJSON = const emptyObject
699+
700+--
701+-- /See:/ 'statusDetailsItem' smart constructor.
702+newtype StatusDetailsItem = StatusDetailsItem'
703+ { _sdiAddtional :: HashMap Text JSONValue
704+ } deriving (Eq,Show,Data,Typeable,Generic)
705+
706+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
707+--
708+-- Use one of the following lenses to modify other fields as desired:
709+--
710+-- * 'sdiAddtional'
711+statusDetailsItem
712+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
713+ -> StatusDetailsItem
714+statusDetailsItem pSdiAddtional_ =
715+ StatusDetailsItem'
716+ { _sdiAddtional = _Coerce # pSdiAddtional_
717+ }
718+
719+-- | Properties of the object. Contains field \'type with type URL.
720+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
721+sdiAddtional
722+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
723+ . _Coerce
724+
725+instance FromJSON StatusDetailsItem where
726+ parseJSON
727+ = withObject "StatusDetailsItem"
728+ (\ o -> StatusDetailsItem' <$> (parseJSONObject o))
729+
730+instance ToJSON StatusDetailsItem where
731+ toJSON = toJSON . _sdiAddtional
732+
733+-- | A build resource in the Container Builder API. At a high level, a Build
734+-- describes where to find source code, how to build it (for example, the
735+-- builder image to run on the source), and what tag to apply to the built
736+-- image when it is pushed to Google Container Registry. Fields can include
737+-- the following variables which will be expanded when the build is
738+-- created: - $PROJECT_ID: the project ID of the build. - $BUILD_ID: the
739+-- autogenerated ID of the build. - $REPO_NAME: the source repository name
740+-- specified by RepoSource. - $BRANCH_NAME: the branch name specified by
741+-- RepoSource. - $TAG_NAME: the tag name specified by RepoSource. -
742+-- $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or
743+-- resolved from the specified branch or tag.
744+--
745+-- /See:/ 'build' smart constructor.
746+data Build = Build'
747+ { _bImages :: !(Maybe [Text])
748+ , _bStatus :: !(Maybe BuildStatus)
749+ , _bSourceProvenance :: !(Maybe SourceProvenance)
750+ , _bLogURL :: !(Maybe Text)
751+ , _bResults :: !(Maybe Results)
752+ , _bStartTime :: !(Maybe DateTime')
753+ , _bLogsBucket :: !(Maybe Text)
754+ , _bSteps :: !(Maybe [BuildStep])
755+ , _bStatusDetail :: !(Maybe Text)
756+ , _bSource :: !(Maybe Source)
757+ , _bId :: !(Maybe Text)
758+ , _bOptions :: !(Maybe BuildOptions)
759+ , _bProjectId :: !(Maybe Text)
760+ , _bTimeout :: !(Maybe Duration)
761+ , _bFinishTime :: !(Maybe DateTime')
762+ , _bCreateTime :: !(Maybe DateTime')
763+ } deriving (Eq,Show,Data,Typeable,Generic)
764+
765+-- | Creates a value of 'Build' with the minimum fields required to make a request.
766+--
767+-- Use one of the following lenses to modify other fields as desired:
768+--
769+-- * 'bImages'
770+--
771+-- * 'bStatus'
772+--
773+-- * 'bSourceProvenance'
774+--
775+-- * 'bLogURL'
776+--
777+-- * 'bResults'
778+--
779+-- * 'bStartTime'
780+--
781+-- * 'bLogsBucket'
782+--
783+-- * 'bSteps'
784+--
785+-- * 'bStatusDetail'
786+--
787+-- * 'bSource'
788+--
789+-- * 'bId'
790+--
791+-- * 'bOptions'
792+--
793+-- * 'bProjectId'
794+--
795+-- * 'bTimeout'
796+--
797+-- * 'bFinishTime'
798+--
799+-- * 'bCreateTime'
800+build
801+ :: Build
802+build =
803+ Build'
804+ { _bImages = Nothing
805+ , _bStatus = Nothing
806+ , _bSourceProvenance = Nothing
807+ , _bLogURL = Nothing
808+ , _bResults = Nothing
809+ , _bStartTime = Nothing
810+ , _bLogsBucket = Nothing
811+ , _bSteps = Nothing
812+ , _bStatusDetail = Nothing
813+ , _bSource = Nothing
814+ , _bId = Nothing
815+ , _bOptions = Nothing
816+ , _bProjectId = Nothing
817+ , _bTimeout = Nothing
818+ , _bFinishTime = Nothing
819+ , _bCreateTime = Nothing
820+ }
821+
822+-- | A list of images to be pushed upon the successful completion of all
823+-- build steps. The images will be pushed using the builder service
824+-- account\'s credentials. The digests of the pushed images will be stored
825+-- in the Build resource\'s results field. If any of the images fail to be
826+-- pushed, the build is marked FAILURE.
827+bImages :: Lens' Build [Text]
828+bImages
829+ = lens _bImages (\ s a -> s{_bImages = a}) . _Default
830+ . _Coerce
831+
832+-- | Status of the build. \'OutputOnly
833+bStatus :: Lens' Build (Maybe BuildStatus)
834+bStatus = lens _bStatus (\ s a -> s{_bStatus = a})
835+
836+-- | A permanent fixed identifier for source. \'OutputOnly
837+bSourceProvenance :: Lens' Build (Maybe SourceProvenance)
838+bSourceProvenance
839+ = lens _bSourceProvenance
840+ (\ s a -> s{_bSourceProvenance = a})
841+
842+-- | URL to logs for this build in Google Cloud Logging. \'OutputOnly
843+bLogURL :: Lens' Build (Maybe Text)
844+bLogURL = lens _bLogURL (\ s a -> s{_bLogURL = a})
845+
846+-- | Results of the build. \'OutputOnly
847+bResults :: Lens' Build (Maybe Results)
848+bResults = lens _bResults (\ s a -> s{_bResults = a})
849+
850+-- | Time at which execution of the build was started. \'OutputOnly
851+bStartTime :: Lens' Build (Maybe UTCTime)
852+bStartTime
853+ = lens _bStartTime (\ s a -> s{_bStartTime = a}) .
854+ mapping _DateTime
855+
856+-- | Google Cloud Storage bucket where logs should be written (see [Bucket
857+-- Name
858+-- Requirements](https:\/\/cloud.google.com\/storage\/docs\/bucket-naming#requirements)).
859+-- Logs file names will be of the format
860+-- \`/l//o//g//s//b//u//c//k//e//t/\//l//o//g/−{build_id}.txt\`.
861+bLogsBucket :: Lens' Build (Maybe Text)
862+bLogsBucket
863+ = lens _bLogsBucket (\ s a -> s{_bLogsBucket = a})
864+
865+-- | Describes the operations to be performed on the workspace.
866+bSteps :: Lens' Build [BuildStep]
867+bSteps
868+ = lens _bSteps (\ s a -> s{_bSteps = a}) . _Default .
869+ _Coerce
870+
871+-- | Customer-readable message about the current status. \'OutputOnly
872+bStatusDetail :: Lens' Build (Maybe Text)
873+bStatusDetail
874+ = lens _bStatusDetail
875+ (\ s a -> s{_bStatusDetail = a})
876+
877+-- | Describes where to find the source files to build.
878+bSource :: Lens' Build (Maybe Source)
879+bSource = lens _bSource (\ s a -> s{_bSource = a})
880+
881+-- | Unique identifier of the build. \'OutputOnly
882+bId :: Lens' Build (Maybe Text)
883+bId = lens _bId (\ s a -> s{_bId = a})
884+
885+-- | Special options for this build.
886+bOptions :: Lens' Build (Maybe BuildOptions)
887+bOptions = lens _bOptions (\ s a -> s{_bOptions = a})
888+
889+-- | ID of the project. \'OutputOnly.
890+bProjectId :: Lens' Build (Maybe Text)
891+bProjectId
892+ = lens _bProjectId (\ s a -> s{_bProjectId = a})
893+
894+-- | Amount of time that this build should be allowed to run, to second
895+-- granularity. If this amount of time elapses, work on the build will
896+-- cease and the build status will be TIMEOUT. Default time is ten minutes.
897+bTimeout :: Lens' Build (Maybe Scientific)
898+bTimeout
899+ = lens _bTimeout (\ s a -> s{_bTimeout = a}) .
900+ mapping _Duration
901+
902+-- | Time at which execution of the build was finished. \'OutputOnly
903+bFinishTime :: Lens' Build (Maybe UTCTime)
904+bFinishTime
905+ = lens _bFinishTime (\ s a -> s{_bFinishTime = a}) .
906+ mapping _DateTime
907+
908+-- | Time at which the build was created. \'OutputOnly
909+bCreateTime :: Lens' Build (Maybe UTCTime)
910+bCreateTime
911+ = lens _bCreateTime (\ s a -> s{_bCreateTime = a}) .
912+ mapping _DateTime
913+
914+instance FromJSON Build where
915+ parseJSON
916+ = withObject "Build"
917+ (\ o ->
918+ Build' <$>
919+ (o .:? "images" .!= mempty) <*> (o .:? "status") <*>
920+ (o .:? "sourceProvenance")
921+ <*> (o .:? "logUrl")
922+ <*> (o .:? "results")
923+ <*> (o .:? "startTime")
924+ <*> (o .:? "logsBucket")
925+ <*> (o .:? "steps" .!= mempty)
926+ <*> (o .:? "statusDetail")
927+ <*> (o .:? "source")
928+ <*> (o .:? "id")
929+ <*> (o .:? "options")
930+ <*> (o .:? "projectId")
931+ <*> (o .:? "timeout")
932+ <*> (o .:? "finishTime")
933+ <*> (o .:? "createTime"))
934+
935+instance ToJSON Build where
936+ toJSON Build'{..}
937+ = object
938+ (catMaybes
939+ [("images" .=) <$> _bImages,
940+ ("status" .=) <$> _bStatus,
941+ ("sourceProvenance" .=) <$> _bSourceProvenance,
942+ ("logUrl" .=) <$> _bLogURL,
943+ ("results" .=) <$> _bResults,
944+ ("startTime" .=) <$> _bStartTime,
945+ ("logsBucket" .=) <$> _bLogsBucket,
946+ ("steps" .=) <$> _bSteps,
947+ ("statusDetail" .=) <$> _bStatusDetail,
948+ ("source" .=) <$> _bSource, ("id" .=) <$> _bId,
949+ ("options" .=) <$> _bOptions,
950+ ("projectId" .=) <$> _bProjectId,
951+ ("timeout" .=) <$> _bTimeout,
952+ ("finishTime" .=) <$> _bFinishTime,
953+ ("createTime" .=) <$> _bCreateTime])
954+
955+-- | Hash(es) of the build source, which can be used to verify that the
956+-- original source integrity was maintained in the build. Note that
957+-- FileHashes will only be populated if BuildOptions has requested a
958+-- SourceProvenanceHash. The keys to this map are file paths used as build
959+-- source and the values contain the hash values for those files. If the
960+-- build source came in a single package such as a gzipped tarfile
961+-- (.tar.gz), the FileHash will be for the single path to that file.
962+-- \'OutputOnly
963+--
964+-- /See:/ 'sourceProvenanceFileHashes' smart constructor.
965+newtype SourceProvenanceFileHashes = SourceProvenanceFileHashes'
966+ { _spfhAddtional :: HashMap Text FileHashes
967+ } deriving (Eq,Show,Data,Typeable,Generic)
968+
969+-- | Creates a value of 'SourceProvenanceFileHashes' with the minimum fields required to make a request.
970+--
971+-- Use one of the following lenses to modify other fields as desired:
972+--
973+-- * 'spfhAddtional'
974+sourceProvenanceFileHashes
975+ :: HashMap Text FileHashes -- ^ 'spfhAddtional'
976+ -> SourceProvenanceFileHashes
977+sourceProvenanceFileHashes pSpfhAddtional_ =
978+ SourceProvenanceFileHashes'
979+ { _spfhAddtional = _Coerce # pSpfhAddtional_
980+ }
981+
982+spfhAddtional :: Lens' SourceProvenanceFileHashes (HashMap Text FileHashes)
983+spfhAddtional
984+ = lens _spfhAddtional
985+ (\ s a -> s{_spfhAddtional = a})
986+ . _Coerce
987+
988+instance FromJSON SourceProvenanceFileHashes where
989+ parseJSON
990+ = withObject "SourceProvenanceFileHashes"
991+ (\ o ->
992+ SourceProvenanceFileHashes' <$> (parseJSONObject o))
993+
994+instance ToJSON SourceProvenanceFileHashes where
995+ toJSON = toJSON . _spfhAddtional
996+
997+-- | Request to cancel an ongoing build.
998+--
999+-- /See:/ 'cancelBuildRequest' smart constructor.
1000+data CancelBuildRequest =
1001+ CancelBuildRequest'
1002+ deriving (Eq,Show,Data,Typeable,Generic)
1003+
1004+-- | Creates a value of 'CancelBuildRequest' with the minimum fields required to make a request.
1005+--
1006+cancelBuildRequest
1007+ :: CancelBuildRequest
1008+cancelBuildRequest = CancelBuildRequest'
1009+
1010+instance FromJSON CancelBuildRequest where
1011+ parseJSON
1012+ = withObject "CancelBuildRequest"
1013+ (\ o -> pure CancelBuildRequest')
1014+
1015+instance ToJSON CancelBuildRequest where
1016+ toJSON = const emptyObject
1017+
1018+-- | StorageSource describes the location of the source in an archive file in
1019+-- Google Cloud Storage.
1020+--
1021+-- /See:/ 'storageSource' smart constructor.
1022+data StorageSource = StorageSource'
1023+ { _ssBucket :: !(Maybe Text)
1024+ , _ssObject :: !(Maybe Text)
1025+ , _ssGeneration :: !(Maybe (Textual Int64))
1026+ } deriving (Eq,Show,Data,Typeable,Generic)
1027+
1028+-- | Creates a value of 'StorageSource' with the minimum fields required to make a request.
1029+--
1030+-- Use one of the following lenses to modify other fields as desired:
1031+--
1032+-- * 'ssBucket'
1033+--
1034+-- * 'ssObject'
1035+--
1036+-- * 'ssGeneration'
1037+storageSource
1038+ :: StorageSource
1039+storageSource =
1040+ StorageSource'
1041+ { _ssBucket = Nothing
1042+ , _ssObject = Nothing
1043+ , _ssGeneration = Nothing
1044+ }
1045+
1046+-- | Google Cloud Storage bucket containing source (see [Bucket Name
1047+-- Requirements](https:\/\/cloud.google.com\/storage\/docs\/bucket-naming#requirements)).
1048+ssBucket :: Lens' StorageSource (Maybe Text)
1049+ssBucket = lens _ssBucket (\ s a -> s{_ssBucket = a})
1050+
1051+-- | Google Cloud Storage object containing source. This object must be a
1052+-- gzipped archive file (.tar.gz) containing source to build.
1053+ssObject :: Lens' StorageSource (Maybe Text)
1054+ssObject = lens _ssObject (\ s a -> s{_ssObject = a})
1055+
1056+-- | Google Cloud Storage generation for the object. If the generation is
1057+-- omitted, the latest generation will be used.
1058+ssGeneration :: Lens' StorageSource (Maybe Int64)
1059+ssGeneration
1060+ = lens _ssGeneration (\ s a -> s{_ssGeneration = a})
1061+ . mapping _Coerce
1062+
1063+instance FromJSON StorageSource where
1064+ parseJSON
1065+ = withObject "StorageSource"
1066+ (\ o ->
1067+ StorageSource' <$>
1068+ (o .:? "bucket") <*> (o .:? "object") <*>
1069+ (o .:? "generation"))
1070+
1071+instance ToJSON StorageSource where
1072+ toJSON StorageSource'{..}
1073+ = object
1074+ (catMaybes
1075+ [("bucket" .=) <$> _ssBucket,
1076+ ("object" .=) <$> _ssObject,
1077+ ("generation" .=) <$> _ssGeneration])
1078+
1079+-- | Response containing existing BuildTriggers.
1080+--
1081+-- /See:/ 'listBuildTriggersResponse' smart constructor.
1082+newtype ListBuildTriggersResponse = ListBuildTriggersResponse'
1083+ { _lbtrTriggers :: Maybe [BuildTrigger]
1084+ } deriving (Eq,Show,Data,Typeable,Generic)
1085+
1086+-- | Creates a value of 'ListBuildTriggersResponse' with the minimum fields required to make a request.
1087+--
1088+-- Use one of the following lenses to modify other fields as desired:
1089+--
1090+-- * 'lbtrTriggers'
1091+listBuildTriggersResponse
1092+ :: ListBuildTriggersResponse
1093+listBuildTriggersResponse =
1094+ ListBuildTriggersResponse'
1095+ { _lbtrTriggers = Nothing
1096+ }
1097+
1098+-- | BuildTriggers for the project, sorted by create_time descending.
1099+lbtrTriggers :: Lens' ListBuildTriggersResponse [BuildTrigger]
1100+lbtrTriggers
1101+ = lens _lbtrTriggers (\ s a -> s{_lbtrTriggers = a})
1102+ . _Default
1103+ . _Coerce
1104+
1105+instance FromJSON ListBuildTriggersResponse where
1106+ parseJSON
1107+ = withObject "ListBuildTriggersResponse"
1108+ (\ o ->
1109+ ListBuildTriggersResponse' <$>
1110+ (o .:? "triggers" .!= mempty))
1111+
1112+instance ToJSON ListBuildTriggersResponse where
1113+ toJSON ListBuildTriggersResponse'{..}
1114+ = object
1115+ (catMaybes [("triggers" .=) <$> _lbtrTriggers])
1116+
1117+-- | Container message for hashes of byte content of files, used in
1118+-- SourceProvenance messages to verify integrity of source input to the
1119+-- build.
1120+--
1121+-- /See:/ 'fileHashes' smart constructor.
1122+newtype FileHashes = FileHashes'
1123+ { _fhFileHash :: Maybe [Hash]
1124+ } deriving (Eq,Show,Data,Typeable,Generic)
1125+
1126+-- | Creates a value of 'FileHashes' with the minimum fields required to make a request.
1127+--
1128+-- Use one of the following lenses to modify other fields as desired:
1129+--
1130+-- * 'fhFileHash'
1131+fileHashes
1132+ :: FileHashes
1133+fileHashes =
1134+ FileHashes'
1135+ { _fhFileHash = Nothing
1136+ }
1137+
1138+-- | Collection of file hashes.
1139+fhFileHash :: Lens' FileHashes [Hash]
1140+fhFileHash
1141+ = lens _fhFileHash (\ s a -> s{_fhFileHash = a}) .
1142+ _Default
1143+ . _Coerce
1144+
1145+instance FromJSON FileHashes where
1146+ parseJSON
1147+ = withObject "FileHashes"
1148+ (\ o ->
1149+ FileHashes' <$> (o .:? "fileHash" .!= mempty))
1150+
1151+instance ToJSON FileHashes where
1152+ toJSON FileHashes'{..}
1153+ = object
1154+ (catMaybes [("fileHash" .=) <$> _fhFileHash])
1155+
1156+-- | Source describes the location of the source in a supported storage
1157+-- service.
1158+--
1159+-- /See:/ 'source' smart constructor.
1160+data Source = Source'
1161+ { _sRepoSource :: !(Maybe RepoSource)
1162+ , _sStorageSource :: !(Maybe StorageSource)
1163+ } deriving (Eq,Show,Data,Typeable,Generic)
1164+
1165+-- | Creates a value of 'Source' with the minimum fields required to make a request.
1166+--
1167+-- Use one of the following lenses to modify other fields as desired:
1168+--
1169+-- * 'sRepoSource'
1170+--
1171+-- * 'sStorageSource'
1172+source
1173+ :: Source
1174+source =
1175+ Source'
1176+ { _sRepoSource = Nothing
1177+ , _sStorageSource = Nothing
1178+ }
1179+
1180+-- | If provided, get source from this location in a Cloud Repo.
1181+sRepoSource :: Lens' Source (Maybe RepoSource)
1182+sRepoSource
1183+ = lens _sRepoSource (\ s a -> s{_sRepoSource = a})
1184+
1185+-- | If provided, get the source from this location in in Google Cloud
1186+-- Storage.
1187+sStorageSource :: Lens' Source (Maybe StorageSource)
1188+sStorageSource
1189+ = lens _sStorageSource
1190+ (\ s a -> s{_sStorageSource = a})
1191+
1192+instance FromJSON Source where
1193+ parseJSON
1194+ = withObject "Source"
1195+ (\ o ->
1196+ Source' <$>
1197+ (o .:? "repoSource") <*> (o .:? "storageSource"))
1198+
1199+instance ToJSON Source where
1200+ toJSON Source'{..}
1201+ = object
1202+ (catMaybes
1203+ [("repoSource" .=) <$> _sRepoSource,
1204+ ("storageSource" .=) <$> _sStorageSource])
1205+
1206+-- | Service-specific metadata associated with the operation. It typically
1207+-- contains progress information and common metadata such as create time.
1208+-- Some services might not provide such metadata. Any method that returns a
1209+-- long-running operation should document the metadata type, if any.
1210+--
1211+-- /See:/ 'operationMetadata' smart constructor.
1212+newtype OperationMetadata = OperationMetadata'
1213+ { _omAddtional :: HashMap Text JSONValue
1214+ } deriving (Eq,Show,Data,Typeable,Generic)
1215+
1216+-- | Creates a value of 'OperationMetadata' with the minimum fields required to make a request.
1217+--
1218+-- Use one of the following lenses to modify other fields as desired:
1219+--
1220+-- * 'omAddtional'
1221+operationMetadata
1222+ :: HashMap Text JSONValue -- ^ 'omAddtional'
1223+ -> OperationMetadata
1224+operationMetadata pOmAddtional_ =
1225+ OperationMetadata'
1226+ { _omAddtional = _Coerce # pOmAddtional_
1227+ }
1228+
1229+-- | Properties of the object. Contains field \'type with type URL.
1230+omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue)
1231+omAddtional
1232+ = lens _omAddtional (\ s a -> s{_omAddtional = a}) .
1233+ _Coerce
1234+
1235+instance FromJSON OperationMetadata where
1236+ parseJSON
1237+ = withObject "OperationMetadata"
1238+ (\ o -> OperationMetadata' <$> (parseJSONObject o))
1239+
1240+instance ToJSON OperationMetadata where
1241+ toJSON = toJSON . _omAddtional
1242+
1243+-- | Metadata for build operations.
1244+--
1245+-- /See:/ 'buildOperationMetadata' smart constructor.
1246+newtype BuildOperationMetadata = BuildOperationMetadata'
1247+ { _bomBuild :: Maybe Build
1248+ } deriving (Eq,Show,Data,Typeable,Generic)
1249+
1250+-- | Creates a value of 'BuildOperationMetadata' with the minimum fields required to make a request.
1251+--
1252+-- Use one of the following lenses to modify other fields as desired:
1253+--
1254+-- * 'bomBuild'
1255+buildOperationMetadata
1256+ :: BuildOperationMetadata
1257+buildOperationMetadata =
1258+ BuildOperationMetadata'
1259+ { _bomBuild = Nothing
1260+ }
1261+
1262+-- | The build that the operation is tracking.
1263+bomBuild :: Lens' BuildOperationMetadata (Maybe Build)
1264+bomBuild = lens _bomBuild (\ s a -> s{_bomBuild = a})
1265+
1266+instance FromJSON BuildOperationMetadata where
1267+ parseJSON
1268+ = withObject "BuildOperationMetadata"
1269+ (\ o -> BuildOperationMetadata' <$> (o .:? "build"))
1270+
1271+instance ToJSON BuildOperationMetadata where
1272+ toJSON BuildOperationMetadata'{..}
1273+ = object (catMaybes [("build" .=) <$> _bomBuild])
1274+
1275+-- | Optional arguments to enable specific features of builds.
1276+--
1277+-- /See:/ 'buildOptions' smart constructor.
1278+data BuildOptions = BuildOptions'
1279+ { _boRequestedVerifyOption :: !(Maybe BuildOptionsRequestedVerifyOption)
1280+ , _boSourceProvenanceHash :: !(Maybe [Text])
1281+ } deriving (Eq,Show,Data,Typeable,Generic)
1282+
1283+-- | Creates a value of 'BuildOptions' with the minimum fields required to make a request.
1284+--
1285+-- Use one of the following lenses to modify other fields as desired:
1286+--
1287+-- * 'boRequestedVerifyOption'
1288+--
1289+-- * 'boSourceProvenanceHash'
1290+buildOptions
1291+ :: BuildOptions
1292+buildOptions =
1293+ BuildOptions'
1294+ { _boRequestedVerifyOption = Nothing
1295+ , _boSourceProvenanceHash = Nothing
1296+ }
1297+
1298+-- | Requested verifiability options.
1299+boRequestedVerifyOption :: Lens' BuildOptions (Maybe BuildOptionsRequestedVerifyOption)
1300+boRequestedVerifyOption
1301+ = lens _boRequestedVerifyOption
1302+ (\ s a -> s{_boRequestedVerifyOption = a})
1303+
1304+-- | Requested hash for SourceProvenance.
1305+boSourceProvenanceHash :: Lens' BuildOptions [Text]
1306+boSourceProvenanceHash
1307+ = lens _boSourceProvenanceHash
1308+ (\ s a -> s{_boSourceProvenanceHash = a})
1309+ . _Default
1310+ . _Coerce
1311+
1312+instance FromJSON BuildOptions where
1313+ parseJSON
1314+ = withObject "BuildOptions"
1315+ (\ o ->
1316+ BuildOptions' <$>
1317+ (o .:? "requestedVerifyOption") <*>
1318+ (o .:? "sourceProvenanceHash" .!= mempty))
1319+
1320+instance ToJSON BuildOptions where
1321+ toJSON BuildOptions'{..}
1322+ = object
1323+ (catMaybes
1324+ [("requestedVerifyOption" .=) <$>
1325+ _boRequestedVerifyOption,
1326+ ("sourceProvenanceHash" .=) <$>
1327+ _boSourceProvenanceHash])
1328+
1329+-- | The normal response of the operation in case of success. If the original
1330+-- method returns no data on success, such as \`Delete\`, the response is
1331+-- \`google.protobuf.Empty\`. If the original method is standard
1332+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
1333+-- For other methods, the response should have the type \`XxxResponse\`,
1334+-- where \`Xxx\` is the original method name. For example, if the original
1335+-- method name is \`TakeSnapshot()\`, the inferred response type is
1336+-- \`TakeSnapshotResponse\`.
1337+--
1338+-- /See:/ 'operationResponse' smart constructor.
1339+newtype OperationResponse = OperationResponse'
1340+ { _orAddtional :: HashMap Text JSONValue
1341+ } deriving (Eq,Show,Data,Typeable,Generic)
1342+
1343+-- | Creates a value of 'OperationResponse' with the minimum fields required to make a request.
1344+--
1345+-- Use one of the following lenses to modify other fields as desired:
1346+--
1347+-- * 'orAddtional'
1348+operationResponse
1349+ :: HashMap Text JSONValue -- ^ 'orAddtional'
1350+ -> OperationResponse
1351+operationResponse pOrAddtional_ =
1352+ OperationResponse'
1353+ { _orAddtional = _Coerce # pOrAddtional_
1354+ }
1355+
1356+-- | Properties of the object. Contains field \'type with type URL.
1357+orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
1358+orAddtional
1359+ = lens _orAddtional (\ s a -> s{_orAddtional = a}) .
1360+ _Coerce
1361+
1362+instance FromJSON OperationResponse where
1363+ parseJSON
1364+ = withObject "OperationResponse"
1365+ (\ o -> OperationResponse' <$> (parseJSONObject o))
1366+
1367+instance ToJSON OperationResponse where
1368+ toJSON = toJSON . _orAddtional
1369+
1370+-- | Configuration for an automated build in response to source repository
1371+-- changes.
1372+--
1373+-- /See:/ 'buildTrigger' smart constructor.
1374+data BuildTrigger = BuildTrigger'
1375+ { _btDisabled :: !(Maybe Bool)
1376+ , _btTriggerTemplate :: !(Maybe RepoSource)
1377+ , _btBuild :: !(Maybe Build)
1378+ , _btId :: !(Maybe Text)
1379+ , _btDescription :: !(Maybe Text)
1380+ , _btFilename :: !(Maybe Text)
1381+ , _btCreateTime :: !(Maybe DateTime')
1382+ } deriving (Eq,Show,Data,Typeable,Generic)
1383+
1384+-- | Creates a value of 'BuildTrigger' with the minimum fields required to make a request.
1385+--
1386+-- Use one of the following lenses to modify other fields as desired:
1387+--
1388+-- * 'btDisabled'
1389+--
1390+-- * 'btTriggerTemplate'
1391+--
1392+-- * 'btBuild'
1393+--
1394+-- * 'btId'
1395+--
1396+-- * 'btDescription'
1397+--
1398+-- * 'btFilename'
1399+--
1400+-- * 'btCreateTime'
1401+buildTrigger
1402+ :: BuildTrigger
1403+buildTrigger =
1404+ BuildTrigger'
1405+ { _btDisabled = Nothing
1406+ , _btTriggerTemplate = Nothing
1407+ , _btBuild = Nothing
1408+ , _btId = Nothing
1409+ , _btDescription = Nothing
1410+ , _btFilename = Nothing
1411+ , _btCreateTime = Nothing
1412+ }
1413+
1414+-- | If true, the trigger will never result in a build.
1415+btDisabled :: Lens' BuildTrigger (Maybe Bool)
1416+btDisabled
1417+ = lens _btDisabled (\ s a -> s{_btDisabled = a})
1418+
1419+-- | Template describing the types of source changes to trigger a build.
1420+-- Branch and tag names in trigger templates are interpreted as regular
1421+-- expressions. Any branch or tag change that matches that regular
1422+-- expression will trigger a build.
1423+btTriggerTemplate :: Lens' BuildTrigger (Maybe RepoSource)
1424+btTriggerTemplate
1425+ = lens _btTriggerTemplate
1426+ (\ s a -> s{_btTriggerTemplate = a})
1427+
1428+-- | Contents of the build template.
1429+btBuild :: Lens' BuildTrigger (Maybe Build)
1430+btBuild = lens _btBuild (\ s a -> s{_btBuild = a})
1431+
1432+-- | Unique identifier of the trigger. \'OutputOnly
1433+btId :: Lens' BuildTrigger (Maybe Text)
1434+btId = lens _btId (\ s a -> s{_btId = a})
1435+
1436+-- | Human-readable description of this trigger.
1437+btDescription :: Lens' BuildTrigger (Maybe Text)
1438+btDescription
1439+ = lens _btDescription
1440+ (\ s a -> s{_btDescription = a})
1441+
1442+-- | Path, from the source root, to a file whose contents is used for the
1443+-- template.
1444+btFilename :: Lens' BuildTrigger (Maybe Text)
1445+btFilename
1446+ = lens _btFilename (\ s a -> s{_btFilename = a})
1447+
1448+-- | Time when the trigger was created. \'OutputOnly
1449+btCreateTime :: Lens' BuildTrigger (Maybe UTCTime)
1450+btCreateTime
1451+ = lens _btCreateTime (\ s a -> s{_btCreateTime = a})
1452+ . mapping _DateTime
1453+
1454+instance FromJSON BuildTrigger where
1455+ parseJSON
1456+ = withObject "BuildTrigger"
1457+ (\ o ->
1458+ BuildTrigger' <$>
1459+ (o .:? "disabled") <*> (o .:? "triggerTemplate") <*>
1460+ (o .:? "build")
1461+ <*> (o .:? "id")
1462+ <*> (o .:? "description")
1463+ <*> (o .:? "filename")
1464+ <*> (o .:? "createTime"))
1465+
1466+instance ToJSON BuildTrigger where
1467+ toJSON BuildTrigger'{..}
1468+ = object
1469+ (catMaybes
1470+ [("disabled" .=) <$> _btDisabled,
1471+ ("triggerTemplate" .=) <$> _btTriggerTemplate,
1472+ ("build" .=) <$> _btBuild, ("id" .=) <$> _btId,
1473+ ("description" .=) <$> _btDescription,
1474+ ("filename" .=) <$> _btFilename,
1475+ ("createTime" .=) <$> _btCreateTime])
1476+
1477+-- | BuiltImage describes an image built by the pipeline.
1478+--
1479+-- /See:/ 'builtImage' smart constructor.
1480+data BuiltImage = BuiltImage'
1481+ { _biName :: !(Maybe Text)
1482+ , _biDigest :: !(Maybe Text)
1483+ } deriving (Eq,Show,Data,Typeable,Generic)
1484+
1485+-- | Creates a value of 'BuiltImage' with the minimum fields required to make a request.
1486+--
1487+-- Use one of the following lenses to modify other fields as desired:
1488+--
1489+-- * 'biName'
1490+--
1491+-- * 'biDigest'
1492+builtImage
1493+ :: BuiltImage
1494+builtImage =
1495+ BuiltImage'
1496+ { _biName = Nothing
1497+ , _biDigest = Nothing
1498+ }
1499+
1500+-- | Name used to push the container image to Google Container Registry, as
1501+-- presented to \`docker push\`.
1502+biName :: Lens' BuiltImage (Maybe Text)
1503+biName = lens _biName (\ s a -> s{_biName = a})
1504+
1505+-- | Docker Registry 2.0 digest.
1506+biDigest :: Lens' BuiltImage (Maybe Text)
1507+biDigest = lens _biDigest (\ s a -> s{_biDigest = a})
1508+
1509+instance FromJSON BuiltImage where
1510+ parseJSON
1511+ = withObject "BuiltImage"
1512+ (\ o ->
1513+ BuiltImage' <$> (o .:? "name") <*> (o .:? "digest"))
1514+
1515+instance ToJSON BuiltImage where
1516+ toJSON BuiltImage'{..}
1517+ = object
1518+ (catMaybes
1519+ [("name" .=) <$> _biName,
1520+ ("digest" .=) <$> _biDigest])