@@ -0,0 +1,3409 @@
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.Dataproc.Types.Product
12+-- Copyright : (c) 2015 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.Dataproc.Types.Product where
19+
20+import Network.Google.Dataproc.Types.Sum
21+import Network.Google.Prelude
22+
23+-- | Encapsulates the full scoping used to reference a job.
24+--
25+-- /See:/ 'jobReference' smart constructor.
26+data JobReference = JobReference
27+ { _jrJobId :: !(Maybe Text)
28+ , _jrProjectId :: !(Maybe Text)
29+ } deriving (Eq,Show,Data,Typeable,Generic)
30+
31+-- | Creates a value of 'JobReference' with the minimum fields required to make a request.
32+--
33+-- Use one of the following lenses to modify other fields as desired:
34+--
35+-- * 'jrJobId'
36+--
37+-- * 'jrProjectId'
38+jobReference
39+ :: JobReference
40+jobReference =
41+ JobReference
42+ { _jrJobId = Nothing
43+ , _jrProjectId = Nothing
44+ }
45+
46+-- | [Required] The job ID, which must be unique within the project. The job
47+-- ID is generated by the server upon job submission or provided by the
48+-- user as a means to perform retries without creating duplicate jobs. The
49+-- ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
50+-- or hyphens (-). The maximum length is 512 characters.
51+jrJobId :: Lens' JobReference (Maybe Text)
52+jrJobId = lens _jrJobId (\ s a -> s{_jrJobId = a})
53+
54+-- | [Required] The ID of the Google Cloud Platform project that the job
55+-- belongs to.
56+jrProjectId :: Lens' JobReference (Maybe Text)
57+jrProjectId
58+ = lens _jrProjectId (\ s a -> s{_jrProjectId = a})
59+
60+instance FromJSON JobReference where
61+ parseJSON
62+ = withObject "JobReference"
63+ (\ o ->
64+ JobReference <$>
65+ (o .:? "jobId") <*> (o .:? "projectId"))
66+
67+instance ToJSON JobReference where
68+ toJSON JobReference{..}
69+ = object
70+ (catMaybes
71+ [("jobId" .=) <$> _jrJobId,
72+ ("projectId" .=) <$> _jrProjectId])
73+
74+-- | The \`Status\` type defines a logical error model that is suitable for
75+-- different programming environments, including REST APIs and RPC APIs. It
76+-- is used by [gRPC](https:\/\/github.com\/grpc). The error model is
77+-- designed to be: - Simple to use and understand for most users - Flexible
78+-- enough to meet unexpected needs # Overview The \`Status\` message
79+-- contains three pieces of data: error code, error message, and error
80+-- details. The error code should be an enum value of google.rpc.Code, but
81+-- it may accept additional error codes if needed. The error message should
82+-- be a developer-facing English message that helps developers *understand*
83+-- and *resolve* the error. If a localized user-facing error message is
84+-- needed, put the localized message in the error details or localize it in
85+-- the client. The optional error details may contain arbitrary information
86+-- about the error. There is a predefined set of error detail types in the
87+-- package \`google.rpc\` which can be used for common error conditions. #
88+-- Language mapping The \`Status\` message is the logical representation of
89+-- the error model, but it is not necessarily the actual wire format. When
90+-- the \`Status\` message is exposed in different client libraries and
91+-- different wire protocols, it can be mapped differently. For example, it
92+-- will likely be mapped to some exceptions in Java, but more likely mapped
93+-- to some error codes in C. # Other uses The error model and the
94+-- \`Status\` message can be used in a variety of environments, either with
95+-- or without APIs, to provide a consistent developer experience across
96+-- different environments. Example uses of this error model include: -
97+-- Partial errors. If a service needs to return partial errors to the
98+-- client, it may embed the \`Status\` in the normal response to indicate
99+-- the partial errors. - Workflow errors. A typical workflow has multiple
100+-- steps. Each step may have a \`Status\` message for error reporting
101+-- purpose. - Batch operations. If a client uses batch request and batch
102+-- response, the \`Status\` message should be used directly inside batch
103+-- response, one for each error sub-response. - Asynchronous operations. If
104+-- an API call embeds asynchronous operation results in its response, the
105+-- status of those operations should be represented directly using the
106+-- \`Status\` message. - Logging. If some API errors are stored in logs,
107+-- the message \`Status\` could be used directly after any stripping needed
108+-- for security\/privacy reasons.
109+--
110+-- /See:/ 'status' smart constructor.
111+data Status = Status
112+ { _sDetails :: !(Maybe [StatusDetailsItem])
113+ , _sCode :: !(Maybe (Textual Int32))
114+ , _sMessage :: !(Maybe Text)
115+ } deriving (Eq,Show,Data,Typeable,Generic)
116+
117+-- | Creates a value of 'Status' with the minimum fields required to make a request.
118+--
119+-- Use one of the following lenses to modify other fields as desired:
120+--
121+-- * 'sDetails'
122+--
123+-- * 'sCode'
124+--
125+-- * 'sMessage'
126+status
127+ :: Status
128+status =
129+ Status
130+ { _sDetails = Nothing
131+ , _sCode = Nothing
132+ , _sMessage = Nothing
133+ }
134+
135+-- | A list of messages that carry the error details. There will be a common
136+-- set of message types for APIs to use.
137+sDetails :: Lens' Status [StatusDetailsItem]
138+sDetails
139+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
140+ _Default
141+ . _Coerce
142+
143+-- | The status code, which should be an enum value of google.rpc.Code.
144+sCode :: Lens' Status (Maybe Int32)
145+sCode
146+ = lens _sCode (\ s a -> s{_sCode = a}) .
147+ mapping _Coerce
148+
149+-- | A developer-facing error message, which should be in English. Any
150+-- user-facing error message should be localized and sent in the
151+-- google.rpc.Status.details field, or localized by the client.
152+sMessage :: Lens' Status (Maybe Text)
153+sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
154+
155+instance FromJSON Status where
156+ parseJSON
157+ = withObject "Status"
158+ (\ o ->
159+ Status <$>
160+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
161+ (o .:? "message"))
162+
163+instance ToJSON Status where
164+ toJSON Status{..}
165+ = object
166+ (catMaybes
167+ [("details" .=) <$> _sDetails,
168+ ("code" .=) <$> _sCode,
169+ ("message" .=) <$> _sMessage])
170+
171+-- | Service-specific metadata associated with the operation. It typically
172+-- contains progress information and common metadata such as create time.
173+-- Some services might not provide such metadata. Any method that returns a
174+-- long-running operation should document the metadata type, if any.
175+--
176+-- /See:/ 'operationSchema' smart constructor.
177+newtype OperationSchema = OperationSchema
178+ { _osAddtional :: HashMap Text JSONValue
179+ } deriving (Eq,Show,Data,Typeable,Generic)
180+
181+-- | Creates a value of 'OperationSchema' with the minimum fields required to make a request.
182+--
183+-- Use one of the following lenses to modify other fields as desired:
184+--
185+-- * 'osAddtional'
186+operationSchema
187+ :: HashMap Text JSONValue -- ^ 'osAddtional'
188+ -> OperationSchema
189+operationSchema pOsAddtional_ =
190+ OperationSchema
191+ { _osAddtional = _Coerce # pOsAddtional_
192+ }
193+
194+-- | Properties of the object. Contains field \'ype with type URL.
195+osAddtional :: Lens' OperationSchema (HashMap Text JSONValue)
196+osAddtional
197+ = lens _osAddtional (\ s a -> s{_osAddtional = a}) .
198+ _Coerce
199+
200+instance FromJSON OperationSchema where
201+ parseJSON
202+ = withObject "OperationSchema"
203+ (\ o -> OperationSchema <$> (parseJSONObject o))
204+
205+instance ToJSON OperationSchema where
206+ toJSON = toJSON . _osAddtional
207+
208+-- | [Optional] A mapping of property names to values, used to configure
209+-- PySpark. Properties that conflict with values set by the Cloud Dataproc
210+-- API may be overwritten. Can include properties set in
211+-- \/etc\/spark\/conf\/spark-defaults.conf and classes in user code.
212+--
213+-- /See:/ 'pySparkJobProperties' smart constructor.
214+newtype PySparkJobProperties = PySparkJobProperties
215+ { _psjpAddtional :: HashMap Text Text
216+ } deriving (Eq,Show,Data,Typeable,Generic)
217+
218+-- | Creates a value of 'PySparkJobProperties' with the minimum fields required to make a request.
219+--
220+-- Use one of the following lenses to modify other fields as desired:
221+--
222+-- * 'psjpAddtional'
223+pySparkJobProperties
224+ :: HashMap Text Text -- ^ 'psjpAddtional'
225+ -> PySparkJobProperties
226+pySparkJobProperties pPsjpAddtional_ =
227+ PySparkJobProperties
228+ { _psjpAddtional = _Coerce # pPsjpAddtional_
229+ }
230+
231+psjpAddtional :: Lens' PySparkJobProperties (HashMap Text Text)
232+psjpAddtional
233+ = lens _psjpAddtional
234+ (\ s a -> s{_psjpAddtional = a})
235+ . _Coerce
236+
237+instance FromJSON PySparkJobProperties where
238+ parseJSON
239+ = withObject "PySparkJobProperties"
240+ (\ o -> PySparkJobProperties <$> (parseJSONObject o))
241+
242+instance ToJSON PySparkJobProperties where
243+ toJSON = toJSON . _psjpAddtional
244+
245+-- | The location of diagnostic output.
246+--
247+-- /See:/ 'diagnoseClusterResults' smart constructor.
248+newtype DiagnoseClusterResults = DiagnoseClusterResults
249+ { _dcrOutputURI :: Maybe Text
250+ } deriving (Eq,Show,Data,Typeable,Generic)
251+
252+-- | Creates a value of 'DiagnoseClusterResults' with the minimum fields required to make a request.
253+--
254+-- Use one of the following lenses to modify other fields as desired:
255+--
256+-- * 'dcrOutputURI'
257+diagnoseClusterResults
258+ :: DiagnoseClusterResults
259+diagnoseClusterResults =
260+ DiagnoseClusterResults
261+ { _dcrOutputURI = Nothing
262+ }
263+
264+-- | [Output-only] The Google Cloud Storage URI of the diagnostic output.
265+-- This is a plain text file with a summary of collected diagnostics.
266+dcrOutputURI :: Lens' DiagnoseClusterResults (Maybe Text)
267+dcrOutputURI
268+ = lens _dcrOutputURI (\ s a -> s{_dcrOutputURI = a})
269+
270+instance FromJSON DiagnoseClusterResults where
271+ parseJSON
272+ = withObject "DiagnoseClusterResults"
273+ (\ o ->
274+ DiagnoseClusterResults <$> (o .:? "outputUri"))
275+
276+instance ToJSON DiagnoseClusterResults where
277+ toJSON DiagnoseClusterResults{..}
278+ = object
279+ (catMaybes [("outputUri" .=) <$> _dcrOutputURI])
280+
281+-- | The config settings for Google Compute Engine resources in an instance
282+-- group, such as a master or worker group.
283+--
284+-- /See:/ 'instanceGroupConfig' smart constructor.
285+data InstanceGroupConfig = InstanceGroupConfig
286+ { _igcNumInstances :: !(Maybe (Textual Int32))
287+ , _igcDiskConfig :: !(Maybe DiskConfig)
288+ , _igcIsPreemptible :: !(Maybe Bool)
289+ , _igcImageURI :: !(Maybe Text)
290+ , _igcInstanceNames :: !(Maybe [Text])
291+ , _igcManagedGroupConfig :: !(Maybe ManagedGroupConfig)
292+ , _igcMachineTypeURI :: !(Maybe Text)
293+ } deriving (Eq,Show,Data,Typeable,Generic)
294+
295+-- | Creates a value of 'InstanceGroupConfig' with the minimum fields required to make a request.
296+--
297+-- Use one of the following lenses to modify other fields as desired:
298+--
299+-- * 'igcNumInstances'
300+--
301+-- * 'igcDiskConfig'
302+--
303+-- * 'igcIsPreemptible'
304+--
305+-- * 'igcImageURI'
306+--
307+-- * 'igcInstanceNames'
308+--
309+-- * 'igcManagedGroupConfig'
310+--
311+-- * 'igcMachineTypeURI'
312+instanceGroupConfig
313+ :: InstanceGroupConfig
314+instanceGroupConfig =
315+ InstanceGroupConfig
316+ { _igcNumInstances = Nothing
317+ , _igcDiskConfig = Nothing
318+ , _igcIsPreemptible = Nothing
319+ , _igcImageURI = Nothing
320+ , _igcInstanceNames = Nothing
321+ , _igcManagedGroupConfig = Nothing
322+ , _igcMachineTypeURI = Nothing
323+ }
324+
325+-- | The number of VM instances in the instance group. For master instance
326+-- groups, must be set to 1.
327+igcNumInstances :: Lens' InstanceGroupConfig (Maybe Int32)
328+igcNumInstances
329+ = lens _igcNumInstances
330+ (\ s a -> s{_igcNumInstances = a})
331+ . mapping _Coerce
332+
333+-- | Disk option config settings.
334+igcDiskConfig :: Lens' InstanceGroupConfig (Maybe DiskConfig)
335+igcDiskConfig
336+ = lens _igcDiskConfig
337+ (\ s a -> s{_igcDiskConfig = a})
338+
339+-- | Specifies that this instance group contains Preemptible Instances.
340+igcIsPreemptible :: Lens' InstanceGroupConfig (Maybe Bool)
341+igcIsPreemptible
342+ = lens _igcIsPreemptible
343+ (\ s a -> s{_igcIsPreemptible = a})
344+
345+-- | [Output-only] The Google Compute Engine image resource used for cluster
346+-- instances. Inferred from \`SoftwareConfig.image_version\`.
347+igcImageURI :: Lens' InstanceGroupConfig (Maybe Text)
348+igcImageURI
349+ = lens _igcImageURI (\ s a -> s{_igcImageURI = a})
350+
351+-- | The list of instance names. Cloud Dataproc derives the names from
352+-- \`cluster_name\`, \`num_instances\`, and the instance group if not set
353+-- by user (recommended practice is to let Cloud Dataproc derive the name).
354+igcInstanceNames :: Lens' InstanceGroupConfig [Text]
355+igcInstanceNames
356+ = lens _igcInstanceNames
357+ (\ s a -> s{_igcInstanceNames = a})
358+ . _Default
359+ . _Coerce
360+
361+-- | [Output-only] The config for Google Compute Engine Instance Group
362+-- Manager that manages this group. This is only used for preemptible
363+-- instance groups.
364+igcManagedGroupConfig :: Lens' InstanceGroupConfig (Maybe ManagedGroupConfig)
365+igcManagedGroupConfig
366+ = lens _igcManagedGroupConfig
367+ (\ s a -> s{_igcManagedGroupConfig = a})
368+
369+-- | The Google Compute Engine machine type used for cluster instances.
370+-- Example:
371+-- \`https:\/\/www.googleapis.com\/compute\/v1\/projects\/[project_id]\/zones\/us-east1-a\/machineTypes\/n1-standard-2\`.
372+igcMachineTypeURI :: Lens' InstanceGroupConfig (Maybe Text)
373+igcMachineTypeURI
374+ = lens _igcMachineTypeURI
375+ (\ s a -> s{_igcMachineTypeURI = a})
376+
377+instance FromJSON InstanceGroupConfig where
378+ parseJSON
379+ = withObject "InstanceGroupConfig"
380+ (\ o ->
381+ InstanceGroupConfig <$>
382+ (o .:? "numInstances") <*> (o .:? "diskConfig") <*>
383+ (o .:? "isPreemptible")
384+ <*> (o .:? "imageUri")
385+ <*> (o .:? "instanceNames" .!= mempty)
386+ <*> (o .:? "managedGroupConfig")
387+ <*> (o .:? "machineTypeUri"))
388+
389+instance ToJSON InstanceGroupConfig where
390+ toJSON InstanceGroupConfig{..}
391+ = object
392+ (catMaybes
393+ [("numInstances" .=) <$> _igcNumInstances,
394+ ("diskConfig" .=) <$> _igcDiskConfig,
395+ ("isPreemptible" .=) <$> _igcIsPreemptible,
396+ ("imageUri" .=) <$> _igcImageURI,
397+ ("instanceNames" .=) <$> _igcInstanceNames,
398+ ("managedGroupConfig" .=) <$> _igcManagedGroupConfig,
399+ ("machineTypeUri" .=) <$> _igcMachineTypeURI])
400+
401+-- | A Cloud Dataproc job for running Spark applications on YARN.
402+--
403+-- /See:/ 'sparkJob' smart constructor.
404+data SparkJob = SparkJob
405+ { _sjArgs :: !(Maybe [Text])
406+ , _sjMainJarFileURI :: !(Maybe Text)
407+ , _sjJarFileURIs :: !(Maybe [Text])
408+ , _sjFileURIs :: !(Maybe [Text])
409+ , _sjArchiveURIs :: !(Maybe [Text])
410+ , _sjMainClass :: !(Maybe Text)
411+ , _sjLoggingConfig :: !(Maybe LoggingConfig)
412+ , _sjProperties :: !(Maybe SparkJobProperties)
413+ } deriving (Eq,Show,Data,Typeable,Generic)
414+
415+-- | Creates a value of 'SparkJob' 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+-- * 'sjArgs'
420+--
421+-- * 'sjMainJarFileURI'
422+--
423+-- * 'sjJarFileURIs'
424+--
425+-- * 'sjFileURIs'
426+--
427+-- * 'sjArchiveURIs'
428+--
429+-- * 'sjMainClass'
430+--
431+-- * 'sjLoggingConfig'
432+--
433+-- * 'sjProperties'
434+sparkJob
435+ :: SparkJob
436+sparkJob =
437+ SparkJob
438+ { _sjArgs = Nothing
439+ , _sjMainJarFileURI = Nothing
440+ , _sjJarFileURIs = Nothing
441+ , _sjFileURIs = Nothing
442+ , _sjArchiveURIs = Nothing
443+ , _sjMainClass = Nothing
444+ , _sjLoggingConfig = Nothing
445+ , _sjProperties = Nothing
446+ }
447+
448+-- | [Optional] The arguments to pass to the driver. Do not include
449+-- arguments, such as \`--conf\`, that can be set as job properties, since
450+-- a collision may occur that causes an incorrect job submission.
451+sjArgs :: Lens' SparkJob [Text]
452+sjArgs
453+ = lens _sjArgs (\ s a -> s{_sjArgs = a}) . _Default .
454+ _Coerce
455+
456+-- | The HCFS URI of the jar file that contains the main class.
457+sjMainJarFileURI :: Lens' SparkJob (Maybe Text)
458+sjMainJarFileURI
459+ = lens _sjMainJarFileURI
460+ (\ s a -> s{_sjMainJarFileURI = a})
461+
462+-- | [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the Spark
463+-- driver and tasks.
464+sjJarFileURIs :: Lens' SparkJob [Text]
465+sjJarFileURIs
466+ = lens _sjJarFileURIs
467+ (\ s a -> s{_sjJarFileURIs = a})
468+ . _Default
469+ . _Coerce
470+
471+-- | [Optional] HCFS URIs of files to be copied to the working directory of
472+-- Spark drivers and distributed tasks. Useful for naively parallel tasks.
473+sjFileURIs :: Lens' SparkJob [Text]
474+sjFileURIs
475+ = lens _sjFileURIs (\ s a -> s{_sjFileURIs = a}) .
476+ _Default
477+ . _Coerce
478+
479+-- | [Optional] HCFS URIs of archives to be extracted in the working
480+-- directory of Spark drivers and tasks. Supported file types: .jar, .tar,
481+-- .tar.gz, .tgz, and .zip.
482+sjArchiveURIs :: Lens' SparkJob [Text]
483+sjArchiveURIs
484+ = lens _sjArchiveURIs
485+ (\ s a -> s{_sjArchiveURIs = a})
486+ . _Default
487+ . _Coerce
488+
489+-- | The name of the driver\'s main class. The jar file that contains the
490+-- class must be in the default CLASSPATH or specified in
491+-- \`jar_file_uris\`.
492+sjMainClass :: Lens' SparkJob (Maybe Text)
493+sjMainClass
494+ = lens _sjMainClass (\ s a -> s{_sjMainClass = a})
495+
496+-- | [Optional] The runtime log config for job execution.
497+sjLoggingConfig :: Lens' SparkJob (Maybe LoggingConfig)
498+sjLoggingConfig
499+ = lens _sjLoggingConfig
500+ (\ s a -> s{_sjLoggingConfig = a})
501+
502+-- | [Optional] A mapping of property names to values, used to configure
503+-- Spark. Properties that conflict with values set by the Cloud Dataproc
504+-- API may be overwritten. Can include properties set in
505+-- \/etc\/spark\/conf\/spark-defaults.conf and classes in user code.
506+sjProperties :: Lens' SparkJob (Maybe SparkJobProperties)
507+sjProperties
508+ = lens _sjProperties (\ s a -> s{_sjProperties = a})
509+
510+instance FromJSON SparkJob where
511+ parseJSON
512+ = withObject "SparkJob"
513+ (\ o ->
514+ SparkJob <$>
515+ (o .:? "args" .!= mempty) <*>
516+ (o .:? "mainJarFileUri")
517+ <*> (o .:? "jarFileUris" .!= mempty)
518+ <*> (o .:? "fileUris" .!= mempty)
519+ <*> (o .:? "archiveUris" .!= mempty)
520+ <*> (o .:? "mainClass")
521+ <*> (o .:? "loggingConfig")
522+ <*> (o .:? "properties"))
523+
524+instance ToJSON SparkJob where
525+ toJSON SparkJob{..}
526+ = object
527+ (catMaybes
528+ [("args" .=) <$> _sjArgs,
529+ ("mainJarFileUri" .=) <$> _sjMainJarFileURI,
530+ ("jarFileUris" .=) <$> _sjJarFileURIs,
531+ ("fileUris" .=) <$> _sjFileURIs,
532+ ("archiveUris" .=) <$> _sjArchiveURIs,
533+ ("mainClass" .=) <$> _sjMainClass,
534+ ("loggingConfig" .=) <$> _sjLoggingConfig,
535+ ("properties" .=) <$> _sjProperties])
536+
537+-- | [Optional] The properties to set on daemon config files. Property keys
538+-- are specified in \`prefix:property\` format, such as
539+-- \`core:fs.defaultFS\`. The following are supported prefixes and their
540+-- mappings: * core: \`core-site.xml\` * hdfs: \`hdfs-site.xml\` * mapred:
541+-- \`mapred-site.xml\` * yarn: \`yarn-site.xml\` * hive: \`hive-site.xml\`
542+-- * pig: \`pig.properties\` * spark: \`spark-defaults.conf\`
543+--
544+-- /See:/ 'softwareConfigProperties' smart constructor.
545+newtype SoftwareConfigProperties = SoftwareConfigProperties
546+ { _scpAddtional :: HashMap Text Text
547+ } deriving (Eq,Show,Data,Typeable,Generic)
548+
549+-- | Creates a value of 'SoftwareConfigProperties' with the minimum fields required to make a request.
550+--
551+-- Use one of the following lenses to modify other fields as desired:
552+--
553+-- * 'scpAddtional'
554+softwareConfigProperties
555+ :: HashMap Text Text -- ^ 'scpAddtional'
556+ -> SoftwareConfigProperties
557+softwareConfigProperties pScpAddtional_ =
558+ SoftwareConfigProperties
559+ { _scpAddtional = _Coerce # pScpAddtional_
560+ }
561+
562+scpAddtional :: Lens' SoftwareConfigProperties (HashMap Text Text)
563+scpAddtional
564+ = lens _scpAddtional (\ s a -> s{_scpAddtional = a})
565+ . _Coerce
566+
567+instance FromJSON SoftwareConfigProperties where
568+ parseJSON
569+ = withObject "SoftwareConfigProperties"
570+ (\ o ->
571+ SoftwareConfigProperties <$> (parseJSONObject o))
572+
573+instance ToJSON SoftwareConfigProperties where
574+ toJSON = toJSON . _scpAddtional
575+
576+-- | Specifies the config of disk options for a group of VM instances.
577+--
578+-- /See:/ 'diskConfig' smart constructor.
579+data DiskConfig = DiskConfig
580+ { _dcNumLocalSsds :: !(Maybe (Textual Int32))
581+ , _dcBootDiskSizeGb :: !(Maybe (Textual Int32))
582+ } deriving (Eq,Show,Data,Typeable,Generic)
583+
584+-- | Creates a value of 'DiskConfig' with the minimum fields required to make a request.
585+--
586+-- Use one of the following lenses to modify other fields as desired:
587+--
588+-- * 'dcNumLocalSsds'
589+--
590+-- * 'dcBootDiskSizeGb'
591+diskConfig
592+ :: DiskConfig
593+diskConfig =
594+ DiskConfig
595+ { _dcNumLocalSsds = Nothing
596+ , _dcBootDiskSizeGb = Nothing
597+ }
598+
599+-- | [Optional] Number of attached SSDs, from 0 to 4 (default is 0). If SSDs
600+-- are not attached, the boot disk is used to store runtime logs and HDFS
601+-- data. If one or more SSDs are attached, this runtime bulk data is spread
602+-- across them, and the boot disk contains only basic config and installed
603+-- binaries.
604+dcNumLocalSsds :: Lens' DiskConfig (Maybe Int32)
605+dcNumLocalSsds
606+ = lens _dcNumLocalSsds
607+ (\ s a -> s{_dcNumLocalSsds = a})
608+ . mapping _Coerce
609+
610+-- | [Optional] Size in GB of the boot disk (default is 500GB).
611+dcBootDiskSizeGb :: Lens' DiskConfig (Maybe Int32)
612+dcBootDiskSizeGb
613+ = lens _dcBootDiskSizeGb
614+ (\ s a -> s{_dcBootDiskSizeGb = a})
615+ . mapping _Coerce
616+
617+instance FromJSON DiskConfig where
618+ parseJSON
619+ = withObject "DiskConfig"
620+ (\ o ->
621+ DiskConfig <$>
622+ (o .:? "numLocalSsds") <*> (o .:? "bootDiskSizeGb"))
623+
624+instance ToJSON DiskConfig where
625+ toJSON DiskConfig{..}
626+ = object
627+ (catMaybes
628+ [("numLocalSsds" .=) <$> _dcNumLocalSsds,
629+ ("bootDiskSizeGb" .=) <$> _dcBootDiskSizeGb])
630+
631+-- | The response message for Operations.ListOperations.
632+--
633+-- /See:/ 'listOperationsResponse' smart constructor.
634+data ListOperationsResponse = ListOperationsResponse
635+ { _lorNextPageToken :: !(Maybe Text)
636+ , _lorOperations :: !(Maybe [Operation])
637+ } deriving (Eq,Show,Data,Typeable,Generic)
638+
639+-- | Creates a value of 'ListOperationsResponse' with the minimum fields required to make a request.
640+--
641+-- Use one of the following lenses to modify other fields as desired:
642+--
643+-- * 'lorNextPageToken'
644+--
645+-- * 'lorOperations'
646+listOperationsResponse
647+ :: ListOperationsResponse
648+listOperationsResponse =
649+ ListOperationsResponse
650+ { _lorNextPageToken = Nothing
651+ , _lorOperations = Nothing
652+ }
653+
654+-- | The standard List next-page token.
655+lorNextPageToken :: Lens' ListOperationsResponse (Maybe Text)
656+lorNextPageToken
657+ = lens _lorNextPageToken
658+ (\ s a -> s{_lorNextPageToken = a})
659+
660+-- | A list of operations that matches the specified filter in the request.
661+lorOperations :: Lens' ListOperationsResponse [Operation]
662+lorOperations
663+ = lens _lorOperations
664+ (\ s a -> s{_lorOperations = a})
665+ . _Default
666+ . _Coerce
667+
668+instance FromJSON ListOperationsResponse where
669+ parseJSON
670+ = withObject "ListOperationsResponse"
671+ (\ o ->
672+ ListOperationsResponse <$>
673+ (o .:? "nextPageToken") <*>
674+ (o .:? "operations" .!= mempty))
675+
676+instance ToJSON ListOperationsResponse where
677+ toJSON ListOperationsResponse{..}
678+ = object
679+ (catMaybes
680+ [("nextPageToken" .=) <$> _lorNextPageToken,
681+ ("operations" .=) <$> _lorOperations])
682+
683+-- | [Optional] Mapping of query variable names to values (equivalent to the
684+-- Hive command: \`SET name=\"value\";\`).
685+--
686+-- /See:/ 'hiveJobScriptVariables' smart constructor.
687+newtype HiveJobScriptVariables = HiveJobScriptVariables
688+ { _hjsvAddtional :: HashMap Text Text
689+ } deriving (Eq,Show,Data,Typeable,Generic)
690+
691+-- | Creates a value of 'HiveJobScriptVariables' with the minimum fields required to make a request.
692+--
693+-- Use one of the following lenses to modify other fields as desired:
694+--
695+-- * 'hjsvAddtional'
696+hiveJobScriptVariables
697+ :: HashMap Text Text -- ^ 'hjsvAddtional'
698+ -> HiveJobScriptVariables
699+hiveJobScriptVariables pHjsvAddtional_ =
700+ HiveJobScriptVariables
701+ { _hjsvAddtional = _Coerce # pHjsvAddtional_
702+ }
703+
704+hjsvAddtional :: Lens' HiveJobScriptVariables (HashMap Text Text)
705+hjsvAddtional
706+ = lens _hjsvAddtional
707+ (\ s a -> s{_hjsvAddtional = a})
708+ . _Coerce
709+
710+instance FromJSON HiveJobScriptVariables where
711+ parseJSON
712+ = withObject "HiveJobScriptVariables"
713+ (\ o ->
714+ HiveJobScriptVariables <$> (parseJSONObject o))
715+
716+instance ToJSON HiveJobScriptVariables where
717+ toJSON = toJSON . _hjsvAddtional
718+
719+-- | Describes the identifying information, config, and status of a cluster
720+-- of Google Compute Engine instances.
721+--
722+-- /See:/ 'cluster' smart constructor.
723+data Cluster = Cluster
724+ { _cStatus :: !(Maybe ClusterStatus)
725+ , _cClusterUuid :: !(Maybe Text)
726+ , _cConfig :: !(Maybe ClusterConfig)
727+ , _cClusterName :: !(Maybe Text)
728+ , _cProjectId :: !(Maybe Text)
729+ , _cStatusHistory :: !(Maybe [ClusterStatus])
730+ } deriving (Eq,Show,Data,Typeable,Generic)
731+
732+-- | Creates a value of 'Cluster' with the minimum fields required to make a request.
733+--
734+-- Use one of the following lenses to modify other fields as desired:
735+--
736+-- * 'cStatus'
737+--
738+-- * 'cClusterUuid'
739+--
740+-- * 'cConfig'
741+--
742+-- * 'cClusterName'
743+--
744+-- * 'cProjectId'
745+--
746+-- * 'cStatusHistory'
747+cluster
748+ :: Cluster
749+cluster =
750+ Cluster
751+ { _cStatus = Nothing
752+ , _cClusterUuid = Nothing
753+ , _cConfig = Nothing
754+ , _cClusterName = Nothing
755+ , _cProjectId = Nothing
756+ , _cStatusHistory = Nothing
757+ }
758+
759+-- | [Output-only] Cluster status.
760+cStatus :: Lens' Cluster (Maybe ClusterStatus)
761+cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
762+
763+-- | [Output-only] A cluster UUID (Unique Universal Identifier). Cloud
764+-- Dataproc generates this value when it creates the cluster.
765+cClusterUuid :: Lens' Cluster (Maybe Text)
766+cClusterUuid
767+ = lens _cClusterUuid (\ s a -> s{_cClusterUuid = a})
768+
769+-- | [Required] The cluster config. Note that Cloud Dataproc may set default
770+-- values, and values may change when clusters are updated.
771+cConfig :: Lens' Cluster (Maybe ClusterConfig)
772+cConfig = lens _cConfig (\ s a -> s{_cConfig = a})
773+
774+-- | [Required] The cluster name. Cluster names within a project must be
775+-- unique. Names of deleted clusters can be reused.
776+cClusterName :: Lens' Cluster (Maybe Text)
777+cClusterName
778+ = lens _cClusterName (\ s a -> s{_cClusterName = a})
779+
780+-- | [Required] The Google Cloud Platform project ID that the cluster belongs
781+-- to.
782+cProjectId :: Lens' Cluster (Maybe Text)
783+cProjectId
784+ = lens _cProjectId (\ s a -> s{_cProjectId = a})
785+
786+-- | [Output-only] The previous cluster status.
787+cStatusHistory :: Lens' Cluster [ClusterStatus]
788+cStatusHistory
789+ = lens _cStatusHistory
790+ (\ s a -> s{_cStatusHistory = a})
791+ . _Default
792+ . _Coerce
793+
794+instance FromJSON Cluster where
795+ parseJSON
796+ = withObject "Cluster"
797+ (\ o ->
798+ Cluster <$>
799+ (o .:? "status") <*> (o .:? "clusterUuid") <*>
800+ (o .:? "config")
801+ <*> (o .:? "clusterName")
802+ <*> (o .:? "projectId")
803+ <*> (o .:? "statusHistory" .!= mempty))
804+
805+instance ToJSON Cluster where
806+ toJSON Cluster{..}
807+ = object
808+ (catMaybes
809+ [("status" .=) <$> _cStatus,
810+ ("clusterUuid" .=) <$> _cClusterUuid,
811+ ("config" .=) <$> _cConfig,
812+ ("clusterName" .=) <$> _cClusterName,
813+ ("projectId" .=) <$> _cProjectId,
814+ ("statusHistory" .=) <$> _cStatusHistory])
815+
816+-- | A request to submit a job.
817+--
818+-- /See:/ 'submitJobRequest' smart constructor.
819+newtype SubmitJobRequest = SubmitJobRequest
820+ { _sjrJob :: Maybe Job
821+ } deriving (Eq,Show,Data,Typeable,Generic)
822+
823+-- | Creates a value of 'SubmitJobRequest' with the minimum fields required to make a request.
824+--
825+-- Use one of the following lenses to modify other fields as desired:
826+--
827+-- * 'sjrJob'
828+submitJobRequest
829+ :: SubmitJobRequest
830+submitJobRequest =
831+ SubmitJobRequest
832+ { _sjrJob = Nothing
833+ }
834+
835+-- | [Required] The job resource.
836+sjrJob :: Lens' SubmitJobRequest (Maybe Job)
837+sjrJob = lens _sjrJob (\ s a -> s{_sjrJob = a})
838+
839+instance FromJSON SubmitJobRequest where
840+ parseJSON
841+ = withObject "SubmitJobRequest"
842+ (\ o -> SubmitJobRequest <$> (o .:? "job"))
843+
844+instance ToJSON SubmitJobRequest where
845+ toJSON SubmitJobRequest{..}
846+ = object (catMaybes [("job" .=) <$> _sjrJob])
847+
848+-- | This resource represents a long-running operation that is the result of
849+-- a network API call.
850+--
851+-- /See:/ 'operation' smart constructor.
852+data Operation = Operation
853+ { _oDone :: !(Maybe Bool)
854+ , _oError :: !(Maybe Status)
855+ , _oResponse :: !(Maybe OperationResponse)
856+ , _oName :: !(Maybe Text)
857+ , _oMetadata :: !(Maybe OperationSchema)
858+ } deriving (Eq,Show,Data,Typeable,Generic)
859+
860+-- | Creates a value of 'Operation' with the minimum fields required to make a request.
861+--
862+-- Use one of the following lenses to modify other fields as desired:
863+--
864+-- * 'oDone'
865+--
866+-- * 'oError'
867+--
868+-- * 'oResponse'
869+--
870+-- * 'oName'
871+--
872+-- * 'oMetadata'
873+operation
874+ :: Operation
875+operation =
876+ Operation
877+ { _oDone = Nothing
878+ , _oError = Nothing
879+ , _oResponse = Nothing
880+ , _oName = Nothing
881+ , _oMetadata = Nothing
882+ }
883+
884+-- | If the value is \`false\`, it means the operation is still in progress.
885+-- If true, the operation is completed, and either \`error\` or
886+-- \`response\` is available.
887+oDone :: Lens' Operation (Maybe Bool)
888+oDone = lens _oDone (\ s a -> s{_oDone = a})
889+
890+-- | The error result of the operation in case of failure.
891+oError :: Lens' Operation (Maybe Status)
892+oError = lens _oError (\ s a -> s{_oError = a})
893+
894+-- | The normal response of the operation in case of success. If the original
895+-- method returns no data on success, such as \`Delete\`, the response is
896+-- \`google.protobuf.Empty\`. If the original method is standard
897+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
898+-- For other methods, the response should have the type \`XxxResponse\`,
899+-- where \`Xxx\` is the original method name. For example, if the original
900+-- method name is \`TakeSnapshot()\`, the inferred response type is
901+-- \`TakeSnapshotResponse\`.
902+oResponse :: Lens' Operation (Maybe OperationResponse)
903+oResponse
904+ = lens _oResponse (\ s a -> s{_oResponse = a})
905+
906+-- | The server-assigned name, which is only unique within the same service
907+-- that originally returns it. If you use the default HTTP mapping, the
908+-- \`name\` should have the format of \`operations\/some\/unique\/name\`.
909+oName :: Lens' Operation (Maybe Text)
910+oName = lens _oName (\ s a -> s{_oName = a})
911+
912+-- | Service-specific metadata associated with the operation. It typically
913+-- contains progress information and common metadata such as create time.
914+-- Some services might not provide such metadata. Any method that returns a
915+-- long-running operation should document the metadata type, if any.
916+oMetadata :: Lens' Operation (Maybe OperationSchema)
917+oMetadata
918+ = lens _oMetadata (\ s a -> s{_oMetadata = a})
919+
920+instance FromJSON Operation where
921+ parseJSON
922+ = withObject "Operation"
923+ (\ o ->
924+ Operation <$>
925+ (o .:? "done") <*> (o .:? "error") <*>
926+ (o .:? "response")
927+ <*> (o .:? "name")
928+ <*> (o .:? "metadata"))
929+
930+instance ToJSON Operation where
931+ toJSON Operation{..}
932+ = object
933+ (catMaybes
934+ [("done" .=) <$> _oDone, ("error" .=) <$> _oError,
935+ ("response" .=) <$> _oResponse,
936+ ("name" .=) <$> _oName,
937+ ("metadata" .=) <$> _oMetadata])
938+
939+-- | A generic empty message that you can re-use to avoid defining duplicated
940+-- empty messages in your APIs. A typical example is to use it as the
941+-- request or the response type of an API method. For instance: service Foo
942+-- { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The
943+-- JSON representation for \`Empty\` is empty JSON object \`{}\`.
944+--
945+-- /See:/ 'empty' smart constructor.
946+data Empty =
947+ Empty
948+ deriving (Eq,Show,Data,Typeable,Generic)
949+
950+-- | Creates a value of 'Empty' with the minimum fields required to make a request.
951+--
952+empty
953+ :: Empty
954+empty = Empty
955+
956+instance FromJSON Empty where
957+ parseJSON = withObject "Empty" (\ o -> pure Empty)
958+
959+instance ToJSON Empty where
960+ toJSON = const emptyObject
961+
962+-- | A Cloud Dataproc job for running Hive queries on YARN.
963+--
964+-- /See:/ 'hiveJob' smart constructor.
965+data HiveJob = HiveJob
966+ { _hjQueryFileURI :: !(Maybe Text)
967+ , _hjJarFileURIs :: !(Maybe [Text])
968+ , _hjScriptVariables :: !(Maybe HiveJobScriptVariables)
969+ , _hjQueryList :: !(Maybe QueryList)
970+ , _hjContinueOnFailure :: !(Maybe Bool)
971+ , _hjProperties :: !(Maybe HiveJobProperties)
972+ } deriving (Eq,Show,Data,Typeable,Generic)
973+
974+-- | Creates a value of 'HiveJob' with the minimum fields required to make a request.
975+--
976+-- Use one of the following lenses to modify other fields as desired:
977+--
978+-- * 'hjQueryFileURI'
979+--
980+-- * 'hjJarFileURIs'
981+--
982+-- * 'hjScriptVariables'
983+--
984+-- * 'hjQueryList'
985+--
986+-- * 'hjContinueOnFailure'
987+--
988+-- * 'hjProperties'
989+hiveJob
990+ :: HiveJob
991+hiveJob =
992+ HiveJob
993+ { _hjQueryFileURI = Nothing
994+ , _hjJarFileURIs = Nothing
995+ , _hjScriptVariables = Nothing
996+ , _hjQueryList = Nothing
997+ , _hjContinueOnFailure = Nothing
998+ , _hjProperties = Nothing
999+ }
1000+
1001+-- | The HCFS URI of the script that contains Hive queries.
1002+hjQueryFileURI :: Lens' HiveJob (Maybe Text)
1003+hjQueryFileURI
1004+ = lens _hjQueryFileURI
1005+ (\ s a -> s{_hjQueryFileURI = a})
1006+
1007+-- | [Optional] HCFS URIs of jar files to add to the CLASSPATH of the Hive
1008+-- server and Hadoop MapReduce (MR) tasks. Can contain Hive SerDes and
1009+-- UDFs.
1010+hjJarFileURIs :: Lens' HiveJob [Text]
1011+hjJarFileURIs
1012+ = lens _hjJarFileURIs
1013+ (\ s a -> s{_hjJarFileURIs = a})
1014+ . _Default
1015+ . _Coerce
1016+
1017+-- | [Optional] Mapping of query variable names to values (equivalent to the
1018+-- Hive command: \`SET name=\"value\";\`).
1019+hjScriptVariables :: Lens' HiveJob (Maybe HiveJobScriptVariables)
1020+hjScriptVariables
1021+ = lens _hjScriptVariables
1022+ (\ s a -> s{_hjScriptVariables = a})
1023+
1024+-- | A list of queries.
1025+hjQueryList :: Lens' HiveJob (Maybe QueryList)
1026+hjQueryList
1027+ = lens _hjQueryList (\ s a -> s{_hjQueryList = a})
1028+
1029+-- | [Optional] Whether to continue executing queries if a query fails. The
1030+-- default value is \`false\`. Setting to \`true\` can be useful when
1031+-- executing independent parallel queries.
1032+hjContinueOnFailure :: Lens' HiveJob (Maybe Bool)
1033+hjContinueOnFailure
1034+ = lens _hjContinueOnFailure
1035+ (\ s a -> s{_hjContinueOnFailure = a})
1036+
1037+-- | [Optional] A mapping of property names and values, used to configure
1038+-- Hive. Properties that conflict with values set by the Cloud Dataproc API
1039+-- may be overwritten. Can include properties set in
1040+-- \/etc\/hadoop\/conf\/*-site.xml, \/etc\/hive\/conf\/hive-site.xml, and
1041+-- classes in user code.
1042+hjProperties :: Lens' HiveJob (Maybe HiveJobProperties)
1043+hjProperties
1044+ = lens _hjProperties (\ s a -> s{_hjProperties = a})
1045+
1046+instance FromJSON HiveJob where
1047+ parseJSON
1048+ = withObject "HiveJob"
1049+ (\ o ->
1050+ HiveJob <$>
1051+ (o .:? "queryFileUri") <*>
1052+ (o .:? "jarFileUris" .!= mempty)
1053+ <*> (o .:? "scriptVariables")
1054+ <*> (o .:? "queryList")
1055+ <*> (o .:? "continueOnFailure")
1056+ <*> (o .:? "properties"))
1057+
1058+instance ToJSON HiveJob where
1059+ toJSON HiveJob{..}
1060+ = object
1061+ (catMaybes
1062+ [("queryFileUri" .=) <$> _hjQueryFileURI,
1063+ ("jarFileUris" .=) <$> _hjJarFileURIs,
1064+ ("scriptVariables" .=) <$> _hjScriptVariables,
1065+ ("queryList" .=) <$> _hjQueryList,
1066+ ("continueOnFailure" .=) <$> _hjContinueOnFailure,
1067+ ("properties" .=) <$> _hjProperties])
1068+
1069+-- | [Optional] Mapping of query variable names to values (equivalent to the
1070+-- Spark SQL command: SET \`name=\"value\";\`).
1071+--
1072+-- /See:/ 'sparkSQLJobScriptVariables' smart constructor.
1073+newtype SparkSQLJobScriptVariables = SparkSQLJobScriptVariables
1074+ { _ssqljsvAddtional :: HashMap Text Text
1075+ } deriving (Eq,Show,Data,Typeable,Generic)
1076+
1077+-- | Creates a value of 'SparkSQLJobScriptVariables' with the minimum fields required to make a request.
1078+--
1079+-- Use one of the following lenses to modify other fields as desired:
1080+--
1081+-- * 'ssqljsvAddtional'
1082+sparkSQLJobScriptVariables
1083+ :: HashMap Text Text -- ^ 'ssqljsvAddtional'
1084+ -> SparkSQLJobScriptVariables
1085+sparkSQLJobScriptVariables pSsqljsvAddtional_ =
1086+ SparkSQLJobScriptVariables
1087+ { _ssqljsvAddtional = _Coerce # pSsqljsvAddtional_
1088+ }
1089+
1090+ssqljsvAddtional :: Lens' SparkSQLJobScriptVariables (HashMap Text Text)
1091+ssqljsvAddtional
1092+ = lens _ssqljsvAddtional
1093+ (\ s a -> s{_ssqljsvAddtional = a})
1094+ . _Coerce
1095+
1096+instance FromJSON SparkSQLJobScriptVariables where
1097+ parseJSON
1098+ = withObject "SparkSQLJobScriptVariables"
1099+ (\ o ->
1100+ SparkSQLJobScriptVariables <$> (parseJSONObject o))
1101+
1102+instance ToJSON SparkSQLJobScriptVariables where
1103+ toJSON = toJSON . _ssqljsvAddtional
1104+
1105+-- | [Optional] A mapping of property names to values, used to configure Pig.
1106+-- Properties that conflict with values set by the Cloud Dataproc API may
1107+-- be overwritten. Can include properties set in
1108+-- \/etc\/hadoop\/conf\/*-site.xml, \/etc\/pig\/conf\/pig.properties, and
1109+-- classes in user code.
1110+--
1111+-- /See:/ 'pigJobProperties' smart constructor.
1112+newtype PigJobProperties = PigJobProperties
1113+ { _pjpAddtional :: HashMap Text Text
1114+ } deriving (Eq,Show,Data,Typeable,Generic)
1115+
1116+-- | Creates a value of 'PigJobProperties' with the minimum fields required to make a request.
1117+--
1118+-- Use one of the following lenses to modify other fields as desired:
1119+--
1120+-- * 'pjpAddtional'
1121+pigJobProperties
1122+ :: HashMap Text Text -- ^ 'pjpAddtional'
1123+ -> PigJobProperties
1124+pigJobProperties pPjpAddtional_ =
1125+ PigJobProperties
1126+ { _pjpAddtional = _Coerce # pPjpAddtional_
1127+ }
1128+
1129+pjpAddtional :: Lens' PigJobProperties (HashMap Text Text)
1130+pjpAddtional
1131+ = lens _pjpAddtional (\ s a -> s{_pjpAddtional = a})
1132+ . _Coerce
1133+
1134+instance FromJSON PigJobProperties where
1135+ parseJSON
1136+ = withObject "PigJobProperties"
1137+ (\ o -> PigJobProperties <$> (parseJSONObject o))
1138+
1139+instance ToJSON PigJobProperties where
1140+ toJSON = toJSON . _pjpAddtional
1141+
1142+-- | The cluster config.
1143+--
1144+-- /See:/ 'clusterConfig' smart constructor.
1145+data ClusterConfig = ClusterConfig
1146+ { _ccWorkerConfig :: !(Maybe InstanceGroupConfig)
1147+ , _ccInitializationActions :: !(Maybe [NodeInitializationAction])
1148+ , _ccMasterConfig :: !(Maybe InstanceGroupConfig)
1149+ , _ccGceClusterConfig :: !(Maybe GceClusterConfig)
1150+ , _ccConfigBucket :: !(Maybe Text)
1151+ , _ccSoftwareConfig :: !(Maybe SoftwareConfig)
1152+ , _ccSecondaryWorkerConfig :: !(Maybe InstanceGroupConfig)
1153+ } deriving (Eq,Show,Data,Typeable,Generic)
1154+
1155+-- | Creates a value of 'ClusterConfig' with the minimum fields required to make a request.
1156+--
1157+-- Use one of the following lenses to modify other fields as desired:
1158+--
1159+-- * 'ccWorkerConfig'
1160+--
1161+-- * 'ccInitializationActions'
1162+--
1163+-- * 'ccMasterConfig'
1164+--
1165+-- * 'ccGceClusterConfig'
1166+--
1167+-- * 'ccConfigBucket'
1168+--
1169+-- * 'ccSoftwareConfig'
1170+--
1171+-- * 'ccSecondaryWorkerConfig'
1172+clusterConfig
1173+ :: ClusterConfig
1174+clusterConfig =
1175+ ClusterConfig
1176+ { _ccWorkerConfig = Nothing
1177+ , _ccInitializationActions = Nothing
1178+ , _ccMasterConfig = Nothing
1179+ , _ccGceClusterConfig = Nothing
1180+ , _ccConfigBucket = Nothing
1181+ , _ccSoftwareConfig = Nothing
1182+ , _ccSecondaryWorkerConfig = Nothing
1183+ }
1184+
1185+-- | [Optional] The Google Compute Engine config settings for worker
1186+-- instances in a cluster.
1187+ccWorkerConfig :: Lens' ClusterConfig (Maybe InstanceGroupConfig)
1188+ccWorkerConfig
1189+ = lens _ccWorkerConfig
1190+ (\ s a -> s{_ccWorkerConfig = a})
1191+
1192+-- | [Optional] Commands to execute on each node after config is completed.
1193+-- By default, executables are run on master and all worker nodes. You can
1194+-- test a node\'s role metadata to run an executable on a master or worker
1195+-- node, as shown below:
1196+-- ROLE=$(\/usr\/share\/google\/get_metadata_value attributes\/role) if [[ \"${ROLE}\"
1197+-- == \'Master\' ]]; then ... master specific actions ... else ... worker
1198+-- specific actions ... fi
1199+ccInitializationActions :: Lens' ClusterConfig [NodeInitializationAction]
1200+ccInitializationActions
1201+ = lens _ccInitializationActions
1202+ (\ s a -> s{_ccInitializationActions = a})
1203+ . _Default
1204+ . _Coerce
1205+
1206+-- | [Optional] The Google Compute Engine config settings for the master
1207+-- instance in a cluster.
1208+ccMasterConfig :: Lens' ClusterConfig (Maybe InstanceGroupConfig)
1209+ccMasterConfig
1210+ = lens _ccMasterConfig
1211+ (\ s a -> s{_ccMasterConfig = a})
1212+
1213+-- | [Optional] The shared Google Compute Engine config settings for all
1214+-- instances in a cluster.
1215+ccGceClusterConfig :: Lens' ClusterConfig (Maybe GceClusterConfig)
1216+ccGceClusterConfig
1217+ = lens _ccGceClusterConfig
1218+ (\ s a -> s{_ccGceClusterConfig = a})
1219+
1220+-- | [Optional] A Google Cloud Storage staging bucket used for sharing
1221+-- generated SSH keys and config. If you do not specify a staging bucket,
1222+-- Cloud Dataproc will determine an appropriate Cloud Storage location (US,
1223+-- ASIA, or EU) for your cluster\'s staging bucket according to the Google
1224+-- Compute Engine zone where your cluster is deployed, and then it will
1225+-- create and manage this project-level, per-location bucket for you.
1226+ccConfigBucket :: Lens' ClusterConfig (Maybe Text)
1227+ccConfigBucket
1228+ = lens _ccConfigBucket
1229+ (\ s a -> s{_ccConfigBucket = a})
1230+
1231+-- | [Optional] The config settings for software inside the cluster.
1232+ccSoftwareConfig :: Lens' ClusterConfig (Maybe SoftwareConfig)
1233+ccSoftwareConfig
1234+ = lens _ccSoftwareConfig
1235+ (\ s a -> s{_ccSoftwareConfig = a})
1236+
1237+-- | [Optional] The Google Compute Engine config settings for additional
1238+-- worker instances in a cluster.
1239+ccSecondaryWorkerConfig :: Lens' ClusterConfig (Maybe InstanceGroupConfig)
1240+ccSecondaryWorkerConfig
1241+ = lens _ccSecondaryWorkerConfig
1242+ (\ s a -> s{_ccSecondaryWorkerConfig = a})
1243+
1244+instance FromJSON ClusterConfig where
1245+ parseJSON
1246+ = withObject "ClusterConfig"
1247+ (\ o ->
1248+ ClusterConfig <$>
1249+ (o .:? "workerConfig") <*>
1250+ (o .:? "initializationActions" .!= mempty)
1251+ <*> (o .:? "masterConfig")
1252+ <*> (o .:? "gceClusterConfig")
1253+ <*> (o .:? "configBucket")
1254+ <*> (o .:? "softwareConfig")
1255+ <*> (o .:? "secondaryWorkerConfig"))
1256+
1257+instance ToJSON ClusterConfig where
1258+ toJSON ClusterConfig{..}
1259+ = object
1260+ (catMaybes
1261+ [("workerConfig" .=) <$> _ccWorkerConfig,
1262+ ("initializationActions" .=) <$>
1263+ _ccInitializationActions,
1264+ ("masterConfig" .=) <$> _ccMasterConfig,
1265+ ("gceClusterConfig" .=) <$> _ccGceClusterConfig,
1266+ ("configBucket" .=) <$> _ccConfigBucket,
1267+ ("softwareConfig" .=) <$> _ccSoftwareConfig,
1268+ ("secondaryWorkerConfig" .=) <$>
1269+ _ccSecondaryWorkerConfig])
1270+
1271+-- | [Optional] A mapping of property names to values, used to configure
1272+-- Hadoop. Properties that conflict with values set by the Cloud Dataproc
1273+-- API may be overwritten. Can include properties set in
1274+-- \/etc\/hadoop\/conf\/*-site and classes in user code.
1275+--
1276+-- /See:/ 'hadoopJobProperties' smart constructor.
1277+newtype HadoopJobProperties = HadoopJobProperties
1278+ { _hjpAddtional :: HashMap Text Text
1279+ } deriving (Eq,Show,Data,Typeable,Generic)
1280+
1281+-- | Creates a value of 'HadoopJobProperties' with the minimum fields required to make a request.
1282+--
1283+-- Use one of the following lenses to modify other fields as desired:
1284+--
1285+-- * 'hjpAddtional'
1286+hadoopJobProperties
1287+ :: HashMap Text Text -- ^ 'hjpAddtional'
1288+ -> HadoopJobProperties
1289+hadoopJobProperties pHjpAddtional_ =
1290+ HadoopJobProperties
1291+ { _hjpAddtional = _Coerce # pHjpAddtional_
1292+ }
1293+
1294+hjpAddtional :: Lens' HadoopJobProperties (HashMap Text Text)
1295+hjpAddtional
1296+ = lens _hjpAddtional (\ s a -> s{_hjpAddtional = a})
1297+ . _Coerce
1298+
1299+instance FromJSON HadoopJobProperties where
1300+ parseJSON
1301+ = withObject "HadoopJobProperties"
1302+ (\ o -> HadoopJobProperties <$> (parseJSONObject o))
1303+
1304+instance ToJSON HadoopJobProperties where
1305+ toJSON = toJSON . _hjpAddtional
1306+
1307+-- | The status of the operation.
1308+--
1309+-- /See:/ 'clusterOperationStatus' smart constructor.
1310+data ClusterOperationStatus = ClusterOperationStatus
1311+ { _cosState :: !(Maybe Text)
1312+ , _cosInnerState :: !(Maybe Text)
1313+ , _cosStateStartTime :: !(Maybe Text)
1314+ , _cosDetails :: !(Maybe Text)
1315+ } deriving (Eq,Show,Data,Typeable,Generic)
1316+
1317+-- | Creates a value of 'ClusterOperationStatus' with the minimum fields required to make a request.
1318+--
1319+-- Use one of the following lenses to modify other fields as desired:
1320+--
1321+-- * 'cosState'
1322+--
1323+-- * 'cosInnerState'
1324+--
1325+-- * 'cosStateStartTime'
1326+--
1327+-- * 'cosDetails'
1328+clusterOperationStatus
1329+ :: ClusterOperationStatus
1330+clusterOperationStatus =
1331+ ClusterOperationStatus
1332+ { _cosState = Nothing
1333+ , _cosInnerState = Nothing
1334+ , _cosStateStartTime = Nothing
1335+ , _cosDetails = Nothing
1336+ }
1337+
1338+-- | A message containing the operation state.
1339+cosState :: Lens' ClusterOperationStatus (Maybe Text)
1340+cosState = lens _cosState (\ s a -> s{_cosState = a})
1341+
1342+-- | A message containing the detailed operation state.
1343+cosInnerState :: Lens' ClusterOperationStatus (Maybe Text)
1344+cosInnerState
1345+ = lens _cosInnerState
1346+ (\ s a -> s{_cosInnerState = a})
1347+
1348+-- | The time this state was entered.
1349+cosStateStartTime :: Lens' ClusterOperationStatus (Maybe Text)
1350+cosStateStartTime
1351+ = lens _cosStateStartTime
1352+ (\ s a -> s{_cosStateStartTime = a})
1353+
1354+-- | A message containing any operation metadata details.
1355+cosDetails :: Lens' ClusterOperationStatus (Maybe Text)
1356+cosDetails
1357+ = lens _cosDetails (\ s a -> s{_cosDetails = a})
1358+
1359+instance FromJSON ClusterOperationStatus where
1360+ parseJSON
1361+ = withObject "ClusterOperationStatus"
1362+ (\ o ->
1363+ ClusterOperationStatus <$>
1364+ (o .:? "state") <*> (o .:? "innerState") <*>
1365+ (o .:? "stateStartTime")
1366+ <*> (o .:? "details"))
1367+
1368+instance ToJSON ClusterOperationStatus where
1369+ toJSON ClusterOperationStatus{..}
1370+ = object
1371+ (catMaybes
1372+ [("state" .=) <$> _cosState,
1373+ ("innerState" .=) <$> _cosInnerState,
1374+ ("stateStartTime" .=) <$> _cosStateStartTime,
1375+ ("details" .=) <$> _cosDetails])
1376+
1377+--
1378+-- /See:/ 'statusDetailsItem' smart constructor.
1379+newtype StatusDetailsItem = StatusDetailsItem
1380+ { _sdiAddtional :: HashMap Text JSONValue
1381+ } deriving (Eq,Show,Data,Typeable,Generic)
1382+
1383+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
1384+--
1385+-- Use one of the following lenses to modify other fields as desired:
1386+--
1387+-- * 'sdiAddtional'
1388+statusDetailsItem
1389+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
1390+ -> StatusDetailsItem
1391+statusDetailsItem pSdiAddtional_ =
1392+ StatusDetailsItem
1393+ { _sdiAddtional = _Coerce # pSdiAddtional_
1394+ }
1395+
1396+-- | Properties of the object. Contains field \'ype with type URL.
1397+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
1398+sdiAddtional
1399+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
1400+ . _Coerce
1401+
1402+instance FromJSON StatusDetailsItem where
1403+ parseJSON
1404+ = withObject "StatusDetailsItem"
1405+ (\ o -> StatusDetailsItem <$> (parseJSONObject o))
1406+
1407+instance ToJSON StatusDetailsItem where
1408+ toJSON = toJSON . _sdiAddtional
1409+
1410+-- | [Optional] A mapping of property names to values, used to configure
1411+-- Spark SQL\'s SparkConf. Properties that conflict with values set by the
1412+-- Cloud Dataproc API may be overwritten.
1413+--
1414+-- /See:/ 'sparkSQLJobProperties' smart constructor.
1415+newtype SparkSQLJobProperties = SparkSQLJobProperties
1416+ { _ssqljpAddtional :: HashMap Text Text
1417+ } deriving (Eq,Show,Data,Typeable,Generic)
1418+
1419+-- | Creates a value of 'SparkSQLJobProperties' with the minimum fields required to make a request.
1420+--
1421+-- Use one of the following lenses to modify other fields as desired:
1422+--
1423+-- * 'ssqljpAddtional'
1424+sparkSQLJobProperties
1425+ :: HashMap Text Text -- ^ 'ssqljpAddtional'
1426+ -> SparkSQLJobProperties
1427+sparkSQLJobProperties pSsqljpAddtional_ =
1428+ SparkSQLJobProperties
1429+ { _ssqljpAddtional = _Coerce # pSsqljpAddtional_
1430+ }
1431+
1432+ssqljpAddtional :: Lens' SparkSQLJobProperties (HashMap Text Text)
1433+ssqljpAddtional
1434+ = lens _ssqljpAddtional
1435+ (\ s a -> s{_ssqljpAddtional = a})
1436+ . _Coerce
1437+
1438+instance FromJSON SparkSQLJobProperties where
1439+ parseJSON
1440+ = withObject "SparkSQLJobProperties"
1441+ (\ o ->
1442+ SparkSQLJobProperties <$> (parseJSONObject o))
1443+
1444+instance ToJSON SparkSQLJobProperties where
1445+ toJSON = toJSON . _ssqljpAddtional
1446+
1447+-- | Specifies an executable to run on a fully configured node and a timeout
1448+-- period for executable completion.
1449+--
1450+-- /See:/ 'nodeInitializationAction' smart constructor.
1451+data NodeInitializationAction = NodeInitializationAction
1452+ { _niaExecutionTimeout :: !(Maybe Text)
1453+ , _niaExecutableFile :: !(Maybe Text)
1454+ } deriving (Eq,Show,Data,Typeable,Generic)
1455+
1456+-- | Creates a value of 'NodeInitializationAction' with the minimum fields required to make a request.
1457+--
1458+-- Use one of the following lenses to modify other fields as desired:
1459+--
1460+-- * 'niaExecutionTimeout'
1461+--
1462+-- * 'niaExecutableFile'
1463+nodeInitializationAction
1464+ :: NodeInitializationAction
1465+nodeInitializationAction =
1466+ NodeInitializationAction
1467+ { _niaExecutionTimeout = Nothing
1468+ , _niaExecutableFile = Nothing
1469+ }
1470+
1471+-- | [Optional] Amount of time executable has to complete. Default is 10
1472+-- minutes. Cluster creation fails with an explanatory error message (the
1473+-- name of the executable that caused the error and the exceeded timeout
1474+-- period) if the executable is not completed at end of the timeout period.
1475+niaExecutionTimeout :: Lens' NodeInitializationAction (Maybe Text)
1476+niaExecutionTimeout
1477+ = lens _niaExecutionTimeout
1478+ (\ s a -> s{_niaExecutionTimeout = a})
1479+
1480+-- | [Required] Google Cloud Storage URI of executable file.
1481+niaExecutableFile :: Lens' NodeInitializationAction (Maybe Text)
1482+niaExecutableFile
1483+ = lens _niaExecutableFile
1484+ (\ s a -> s{_niaExecutableFile = a})
1485+
1486+instance FromJSON NodeInitializationAction where
1487+ parseJSON
1488+ = withObject "NodeInitializationAction"
1489+ (\ o ->
1490+ NodeInitializationAction <$>
1491+ (o .:? "executionTimeout") <*>
1492+ (o .:? "executableFile"))
1493+
1494+instance ToJSON NodeInitializationAction where
1495+ toJSON NodeInitializationAction{..}
1496+ = object
1497+ (catMaybes
1498+ [("executionTimeout" .=) <$> _niaExecutionTimeout,
1499+ ("executableFile" .=) <$> _niaExecutableFile])
1500+
1501+-- | Cloud Dataproc job config.
1502+--
1503+-- /See:/ 'jobPlacement' smart constructor.
1504+data JobPlacement = JobPlacement
1505+ { _jpClusterUuid :: !(Maybe Text)
1506+ , _jpClusterName :: !(Maybe Text)
1507+ } deriving (Eq,Show,Data,Typeable,Generic)
1508+
1509+-- | Creates a value of 'JobPlacement' with the minimum fields required to make a request.
1510+--
1511+-- Use one of the following lenses to modify other fields as desired:
1512+--
1513+-- * 'jpClusterUuid'
1514+--
1515+-- * 'jpClusterName'
1516+jobPlacement
1517+ :: JobPlacement
1518+jobPlacement =
1519+ JobPlacement
1520+ { _jpClusterUuid = Nothing
1521+ , _jpClusterName = Nothing
1522+ }
1523+
1524+-- | [Output-only] A cluster UUID generated by the Cloud Dataproc service
1525+-- when the job is submitted.
1526+jpClusterUuid :: Lens' JobPlacement (Maybe Text)
1527+jpClusterUuid
1528+ = lens _jpClusterUuid
1529+ (\ s a -> s{_jpClusterUuid = a})
1530+
1531+-- | [Required] The name of the cluster where the job will be submitted.
1532+jpClusterName :: Lens' JobPlacement (Maybe Text)
1533+jpClusterName
1534+ = lens _jpClusterName
1535+ (\ s a -> s{_jpClusterName = a})
1536+
1537+instance FromJSON JobPlacement where
1538+ parseJSON
1539+ = withObject "JobPlacement"
1540+ (\ o ->
1541+ JobPlacement <$>
1542+ (o .:? "clusterUuid") <*> (o .:? "clusterName"))
1543+
1544+instance ToJSON JobPlacement where
1545+ toJSON JobPlacement{..}
1546+ = object
1547+ (catMaybes
1548+ [("clusterUuid" .=) <$> _jpClusterUuid,
1549+ ("clusterName" .=) <$> _jpClusterName])
1550+
1551+-- | Common config settings for resources of Google Compute Engine cluster
1552+-- instances, applicable to all instances in the cluster.
1553+--
1554+-- /See:/ 'gceClusterConfig' smart constructor.
1555+data GceClusterConfig = GceClusterConfig
1556+ { _gccSubnetworkURI :: !(Maybe Text)
1557+ , _gccNetworkURI :: !(Maybe Text)
1558+ , _gccZoneURI :: !(Maybe Text)
1559+ , _gccMetadata :: !(Maybe GceClusterConfigMetadata)
1560+ , _gccServiceAccountScopes :: !(Maybe [Text])
1561+ , _gccTags :: !(Maybe [Text])
1562+ } deriving (Eq,Show,Data,Typeable,Generic)
1563+
1564+-- | Creates a value of 'GceClusterConfig' with the minimum fields required to make a request.
1565+--
1566+-- Use one of the following lenses to modify other fields as desired:
1567+--
1568+-- * 'gccSubnetworkURI'
1569+--
1570+-- * 'gccNetworkURI'
1571+--
1572+-- * 'gccZoneURI'
1573+--
1574+-- * 'gccMetadata'
1575+--
1576+-- * 'gccServiceAccountScopes'
1577+--
1578+-- * 'gccTags'
1579+gceClusterConfig
1580+ :: GceClusterConfig
1581+gceClusterConfig =
1582+ GceClusterConfig
1583+ { _gccSubnetworkURI = Nothing
1584+ , _gccNetworkURI = Nothing
1585+ , _gccZoneURI = Nothing
1586+ , _gccMetadata = Nothing
1587+ , _gccServiceAccountScopes = Nothing
1588+ , _gccTags = Nothing
1589+ }
1590+
1591+-- | The Google Compute Engine subnetwork to be used for machine
1592+-- communications. Cannot be specified with network_uri. Example:
1593+-- \`https:\/\/www.googleapis.com\/compute\/v1\/projects\/[project_id]\/regions\/us-east1\/sub0\`.
1594+gccSubnetworkURI :: Lens' GceClusterConfig (Maybe Text)
1595+gccSubnetworkURI
1596+ = lens _gccSubnetworkURI
1597+ (\ s a -> s{_gccSubnetworkURI = a})
1598+
1599+-- | The Google Compute Engine network to be used for machine communications.
1600+-- Cannot be specified with subnetwork_uri. If neither network_uri nor
1601+-- subnetwork_uri is specified, the \"default\" network of the project is
1602+-- used, if it exists. Cannot be a \"Custom Subnet Network\" (see
1603+-- https:\/\/cloud.google.com\/compute\/docs\/subnetworks for more
1604+-- information). Example:
1605+-- \`https:\/\/www.googleapis.com\/compute\/v1\/projects\/[project_id]\/regions\/global\/default\`.
1606+gccNetworkURI :: Lens' GceClusterConfig (Maybe Text)
1607+gccNetworkURI
1608+ = lens _gccNetworkURI
1609+ (\ s a -> s{_gccNetworkURI = a})
1610+
1611+-- | [Required] The zone where the Google Compute Engine cluster will be
1612+-- located. Example:
1613+-- \`https:\/\/www.googleapis.com\/compute\/v1\/projects\/[project_id]\/zones\/[zone]\`.
1614+gccZoneURI :: Lens' GceClusterConfig (Maybe Text)
1615+gccZoneURI
1616+ = lens _gccZoneURI (\ s a -> s{_gccZoneURI = a})
1617+
1618+-- | The Google Compute Engine metadata entries to add to all instances.
1619+gccMetadata :: Lens' GceClusterConfig (Maybe GceClusterConfigMetadata)
1620+gccMetadata
1621+ = lens _gccMetadata (\ s a -> s{_gccMetadata = a})
1622+
1623+-- | The URIs of service account scopes to be included in Google Compute
1624+-- Engine instances. The following base set of scopes is always included: *
1625+-- https:\/\/www.googleapis.com\/auth\/cloud.useraccounts.readonly *
1626+-- https:\/\/www.googleapis.com\/auth\/devstorage.read_write *
1627+-- https:\/\/www.googleapis.com\/auth\/logging.write If no scopes are
1628+-- specfied, the following defaults are also provided: *
1629+-- https:\/\/www.googleapis.com\/auth\/bigquery *
1630+-- https:\/\/www.googleapis.com\/auth\/bigtable.admin.table *
1631+-- https:\/\/www.googleapis.com\/auth\/bigtable.data *
1632+-- https:\/\/www.googleapis.com\/auth\/devstorage.full_control
1633+gccServiceAccountScopes :: Lens' GceClusterConfig [Text]
1634+gccServiceAccountScopes
1635+ = lens _gccServiceAccountScopes
1636+ (\ s a -> s{_gccServiceAccountScopes = a})
1637+ . _Default
1638+ . _Coerce
1639+
1640+-- | The Google Compute Engine tags to add to all instances.
1641+gccTags :: Lens' GceClusterConfig [Text]
1642+gccTags
1643+ = lens _gccTags (\ s a -> s{_gccTags = a}) . _Default
1644+ . _Coerce
1645+
1646+instance FromJSON GceClusterConfig where
1647+ parseJSON
1648+ = withObject "GceClusterConfig"
1649+ (\ o ->
1650+ GceClusterConfig <$>
1651+ (o .:? "subnetworkUri") <*> (o .:? "networkUri") <*>
1652+ (o .:? "zoneUri")
1653+ <*> (o .:? "metadata")
1654+ <*> (o .:? "serviceAccountScopes" .!= mempty)
1655+ <*> (o .:? "tags" .!= mempty))
1656+
1657+instance ToJSON GceClusterConfig where
1658+ toJSON GceClusterConfig{..}
1659+ = object
1660+ (catMaybes
1661+ [("subnetworkUri" .=) <$> _gccSubnetworkURI,
1662+ ("networkUri" .=) <$> _gccNetworkURI,
1663+ ("zoneUri" .=) <$> _gccZoneURI,
1664+ ("metadata" .=) <$> _gccMetadata,
1665+ ("serviceAccountScopes" .=) <$>
1666+ _gccServiceAccountScopes,
1667+ ("tags" .=) <$> _gccTags])
1668+
1669+-- | The status of the operation.
1670+--
1671+-- /See:/ 'operationStatus' smart constructor.
1672+data OperationStatus = OperationStatus
1673+ { _osState :: !(Maybe Text)
1674+ , _osInnerState :: !(Maybe Text)
1675+ , _osStateStartTime :: !(Maybe Text)
1676+ , _osDetails :: !(Maybe Text)
1677+ } deriving (Eq,Show,Data,Typeable,Generic)
1678+
1679+-- | Creates a value of 'OperationStatus' with the minimum fields required to make a request.
1680+--
1681+-- Use one of the following lenses to modify other fields as desired:
1682+--
1683+-- * 'osState'
1684+--
1685+-- * 'osInnerState'
1686+--
1687+-- * 'osStateStartTime'
1688+--
1689+-- * 'osDetails'
1690+operationStatus
1691+ :: OperationStatus
1692+operationStatus =
1693+ OperationStatus
1694+ { _osState = Nothing
1695+ , _osInnerState = Nothing
1696+ , _osStateStartTime = Nothing
1697+ , _osDetails = Nothing
1698+ }
1699+
1700+-- | A message containing the operation state.
1701+osState :: Lens' OperationStatus (Maybe Text)
1702+osState = lens _osState (\ s a -> s{_osState = a})
1703+
1704+-- | A message containing the detailed operation state.
1705+osInnerState :: Lens' OperationStatus (Maybe Text)
1706+osInnerState
1707+ = lens _osInnerState (\ s a -> s{_osInnerState = a})
1708+
1709+-- | The time this state was entered.
1710+osStateStartTime :: Lens' OperationStatus (Maybe Text)
1711+osStateStartTime
1712+ = lens _osStateStartTime
1713+ (\ s a -> s{_osStateStartTime = a})
1714+
1715+-- | A message containing any operation metadata details.
1716+osDetails :: Lens' OperationStatus (Maybe Text)
1717+osDetails
1718+ = lens _osDetails (\ s a -> s{_osDetails = a})
1719+
1720+instance FromJSON OperationStatus where
1721+ parseJSON
1722+ = withObject "OperationStatus"
1723+ (\ o ->
1724+ OperationStatus <$>
1725+ (o .:? "state") <*> (o .:? "innerState") <*>
1726+ (o .:? "stateStartTime")
1727+ <*> (o .:? "details"))
1728+
1729+instance ToJSON OperationStatus where
1730+ toJSON OperationStatus{..}
1731+ = object
1732+ (catMaybes
1733+ [("state" .=) <$> _osState,
1734+ ("innerState" .=) <$> _osInnerState,
1735+ ("stateStartTime" .=) <$> _osStateStartTime,
1736+ ("details" .=) <$> _osDetails])
1737+
1738+-- | The Google Compute Engine metadata entries to add to all instances.
1739+--
1740+-- /See:/ 'gceClusterConfigMetadata' smart constructor.
1741+newtype GceClusterConfigMetadata = GceClusterConfigMetadata
1742+ { _gccmAddtional :: HashMap Text Text
1743+ } deriving (Eq,Show,Data,Typeable,Generic)
1744+
1745+-- | Creates a value of 'GceClusterConfigMetadata' with the minimum fields required to make a request.
1746+--
1747+-- Use one of the following lenses to modify other fields as desired:
1748+--
1749+-- * 'gccmAddtional'
1750+gceClusterConfigMetadata
1751+ :: HashMap Text Text -- ^ 'gccmAddtional'
1752+ -> GceClusterConfigMetadata
1753+gceClusterConfigMetadata pGccmAddtional_ =
1754+ GceClusterConfigMetadata
1755+ { _gccmAddtional = _Coerce # pGccmAddtional_
1756+ }
1757+
1758+gccmAddtional :: Lens' GceClusterConfigMetadata (HashMap Text Text)
1759+gccmAddtional
1760+ = lens _gccmAddtional
1761+ (\ s a -> s{_gccmAddtional = a})
1762+ . _Coerce
1763+
1764+instance FromJSON GceClusterConfigMetadata where
1765+ parseJSON
1766+ = withObject "GceClusterConfigMetadata"
1767+ (\ o ->
1768+ GceClusterConfigMetadata <$> (parseJSONObject o))
1769+
1770+instance ToJSON GceClusterConfigMetadata where
1771+ toJSON = toJSON . _gccmAddtional
1772+
1773+-- | [Optional] A mapping of property names and values, used to configure
1774+-- Hive. Properties that conflict with values set by the Cloud Dataproc API
1775+-- may be overwritten. Can include properties set in
1776+-- \/etc\/hadoop\/conf\/*-site.xml, \/etc\/hive\/conf\/hive-site.xml, and
1777+-- classes in user code.
1778+--
1779+-- /See:/ 'hiveJobProperties' smart constructor.
1780+newtype HiveJobProperties = HiveJobProperties
1781+ { _hAddtional :: HashMap Text Text
1782+ } deriving (Eq,Show,Data,Typeable,Generic)
1783+
1784+-- | Creates a value of 'HiveJobProperties' with the minimum fields required to make a request.
1785+--
1786+-- Use one of the following lenses to modify other fields as desired:
1787+--
1788+-- * 'hAddtional'
1789+hiveJobProperties
1790+ :: HashMap Text Text -- ^ 'hAddtional'
1791+ -> HiveJobProperties
1792+hiveJobProperties pHAddtional_ =
1793+ HiveJobProperties
1794+ { _hAddtional = _Coerce # pHAddtional_
1795+ }
1796+
1797+hAddtional :: Lens' HiveJobProperties (HashMap Text Text)
1798+hAddtional
1799+ = lens _hAddtional (\ s a -> s{_hAddtional = a}) .
1800+ _Coerce
1801+
1802+instance FromJSON HiveJobProperties where
1803+ parseJSON
1804+ = withObject "HiveJobProperties"
1805+ (\ o -> HiveJobProperties <$> (parseJSONObject o))
1806+
1807+instance ToJSON HiveJobProperties where
1808+ toJSON = toJSON . _hAddtional
1809+
1810+-- | Media resource.
1811+--
1812+-- /See:/ 'media' smart constructor.
1813+newtype Media = Media
1814+ { _mResourceName :: Maybe Text
1815+ } deriving (Eq,Show,Data,Typeable,Generic)
1816+
1817+-- | Creates a value of 'Media' with the minimum fields required to make a request.
1818+--
1819+-- Use one of the following lenses to modify other fields as desired:
1820+--
1821+-- * 'mResourceName'
1822+media
1823+ :: Media
1824+media =
1825+ Media
1826+ { _mResourceName = Nothing
1827+ }
1828+
1829+-- | Name of the media resource.
1830+mResourceName :: Lens' Media (Maybe Text)
1831+mResourceName
1832+ = lens _mResourceName
1833+ (\ s a -> s{_mResourceName = a})
1834+
1835+instance FromJSON Media where
1836+ parseJSON
1837+ = withObject "Media"
1838+ (\ o -> Media <$> (o .:? "resourceName"))
1839+
1840+instance ToJSON Media where
1841+ toJSON Media{..}
1842+ = object
1843+ (catMaybes [("resourceName" .=) <$> _mResourceName])
1844+
1845+-- | The location where output from diagnostic command can be found.
1846+--
1847+-- /See:/ 'diagnoseClusterOutputLocation' smart constructor.
1848+newtype DiagnoseClusterOutputLocation = DiagnoseClusterOutputLocation
1849+ { _dcolOutputURI :: Maybe Text
1850+ } deriving (Eq,Show,Data,Typeable,Generic)
1851+
1852+-- | Creates a value of 'DiagnoseClusterOutputLocation' with the minimum fields required to make a request.
1853+--
1854+-- Use one of the following lenses to modify other fields as desired:
1855+--
1856+-- * 'dcolOutputURI'
1857+diagnoseClusterOutputLocation
1858+ :: DiagnoseClusterOutputLocation
1859+diagnoseClusterOutputLocation =
1860+ DiagnoseClusterOutputLocation
1861+ { _dcolOutputURI = Nothing
1862+ }
1863+
1864+-- | [Output-only] The Google Cloud Storage URI of the diagnostic output.
1865+-- This will be a plain text file with summary of collected diagnostics.
1866+dcolOutputURI :: Lens' DiagnoseClusterOutputLocation (Maybe Text)
1867+dcolOutputURI
1868+ = lens _dcolOutputURI
1869+ (\ s a -> s{_dcolOutputURI = a})
1870+
1871+instance FromJSON DiagnoseClusterOutputLocation where
1872+ parseJSON
1873+ = withObject "DiagnoseClusterOutputLocation"
1874+ (\ o ->
1875+ DiagnoseClusterOutputLocation <$>
1876+ (o .:? "outputUri"))
1877+
1878+instance ToJSON DiagnoseClusterOutputLocation where
1879+ toJSON DiagnoseClusterOutputLocation{..}
1880+ = object
1881+ (catMaybes [("outputUri" .=) <$> _dcolOutputURI])
1882+
1883+-- | A Cloud Dataproc job resource.
1884+--
1885+-- /See:/ 'job' smart constructor.
1886+data Job = Job
1887+ { _jSparkJob :: !(Maybe SparkJob)
1888+ , _jStatus :: !(Maybe JobStatus)
1889+ , _jDriverControlFilesURI :: !(Maybe Text)
1890+ , _jHiveJob :: !(Maybe HiveJob)
1891+ , _jReference :: !(Maybe JobReference)
1892+ , _jSparkSQLJob :: !(Maybe SparkSQLJob)
1893+ , _jHadoopJob :: !(Maybe HadoopJob)
1894+ , _jPysparkJob :: !(Maybe PySparkJob)
1895+ , _jDriverOutputResourceURI :: !(Maybe Text)
1896+ , _jStatusHistory :: !(Maybe [JobStatus])
1897+ , _jPlacement :: !(Maybe JobPlacement)
1898+ , _jPigJob :: !(Maybe PigJob)
1899+ } deriving (Eq,Show,Data,Typeable,Generic)
1900+
1901+-- | Creates a value of 'Job' with the minimum fields required to make a request.
1902+--
1903+-- Use one of the following lenses to modify other fields as desired:
1904+--
1905+-- * 'jSparkJob'
1906+--
1907+-- * 'jStatus'
1908+--
1909+-- * 'jDriverControlFilesURI'
1910+--
1911+-- * 'jHiveJob'
1912+--
1913+-- * 'jReference'
1914+--
1915+-- * 'jSparkSQLJob'
1916+--
1917+-- * 'jHadoopJob'
1918+--
1919+-- * 'jPysparkJob'
1920+--
1921+-- * 'jDriverOutputResourceURI'
1922+--
1923+-- * 'jStatusHistory'
1924+--
1925+-- * 'jPlacement'
1926+--
1927+-- * 'jPigJob'
1928+job
1929+ :: Job
1930+job =
1931+ Job
1932+ { _jSparkJob = Nothing
1933+ , _jStatus = Nothing
1934+ , _jDriverControlFilesURI = Nothing
1935+ , _jHiveJob = Nothing
1936+ , _jReference = Nothing
1937+ , _jSparkSQLJob = Nothing
1938+ , _jHadoopJob = Nothing
1939+ , _jPysparkJob = Nothing
1940+ , _jDriverOutputResourceURI = Nothing
1941+ , _jStatusHistory = Nothing
1942+ , _jPlacement = Nothing
1943+ , _jPigJob = Nothing
1944+ }
1945+
1946+-- | Job is a Spark job.
1947+jSparkJob :: Lens' Job (Maybe SparkJob)
1948+jSparkJob
1949+ = lens _jSparkJob (\ s a -> s{_jSparkJob = a})
1950+
1951+-- | [Output-only] The job status. Additional application-specific status
1952+-- information may be contained in the type_job and yarn_applications
1953+-- fields.
1954+jStatus :: Lens' Job (Maybe JobStatus)
1955+jStatus = lens _jStatus (\ s a -> s{_jStatus = a})
1956+
1957+-- | [Output-only] If present, the location of miscellaneous control files
1958+-- which may be used as part of job setup and handling. If not present,
1959+-- control files may be placed in the same location as
1960+-- \`driver_output_uri\`.
1961+jDriverControlFilesURI :: Lens' Job (Maybe Text)
1962+jDriverControlFilesURI
1963+ = lens _jDriverControlFilesURI
1964+ (\ s a -> s{_jDriverControlFilesURI = a})
1965+
1966+-- | Job is a Hive job.
1967+jHiveJob :: Lens' Job (Maybe HiveJob)
1968+jHiveJob = lens _jHiveJob (\ s a -> s{_jHiveJob = a})
1969+
1970+-- | [Optional] The fully qualified reference to the job, which can be used
1971+-- to obtain the equivalent REST path of the job resource. If this property
1972+-- is not specified when a job is created, the server generates a job_id.
1973+jReference :: Lens' Job (Maybe JobReference)
1974+jReference
1975+ = lens _jReference (\ s a -> s{_jReference = a})
1976+
1977+-- | Job is a SparkSql job.
1978+jSparkSQLJob :: Lens' Job (Maybe SparkSQLJob)
1979+jSparkSQLJob
1980+ = lens _jSparkSQLJob (\ s a -> s{_jSparkSQLJob = a})
1981+
1982+-- | Job is a Hadoop job.
1983+jHadoopJob :: Lens' Job (Maybe HadoopJob)
1984+jHadoopJob
1985+ = lens _jHadoopJob (\ s a -> s{_jHadoopJob = a})
1986+
1987+-- | Job is a Pyspark job.
1988+jPysparkJob :: Lens' Job (Maybe PySparkJob)
1989+jPysparkJob
1990+ = lens _jPysparkJob (\ s a -> s{_jPysparkJob = a})
1991+
1992+-- | [Output-only] A URI pointing to the location of the stdout of the job\'s
1993+-- driver program.
1994+jDriverOutputResourceURI :: Lens' Job (Maybe Text)
1995+jDriverOutputResourceURI
1996+ = lens _jDriverOutputResourceURI
1997+ (\ s a -> s{_jDriverOutputResourceURI = a})
1998+
1999+-- | [Output-only] The previous job status.
2000+jStatusHistory :: Lens' Job [JobStatus]
2001+jStatusHistory
2002+ = lens _jStatusHistory
2003+ (\ s a -> s{_jStatusHistory = a})
2004+ . _Default
2005+ . _Coerce
2006+
2007+-- | [Required] Job information, including how, when, and where to run the
2008+-- job.
2009+jPlacement :: Lens' Job (Maybe JobPlacement)
2010+jPlacement
2011+ = lens _jPlacement (\ s a -> s{_jPlacement = a})
2012+
2013+-- | Job is a Pig job.
2014+jPigJob :: Lens' Job (Maybe PigJob)
2015+jPigJob = lens _jPigJob (\ s a -> s{_jPigJob = a})
2016+
2017+instance FromJSON Job where
2018+ parseJSON
2019+ = withObject "Job"
2020+ (\ o ->
2021+ Job <$>
2022+ (o .:? "sparkJob") <*> (o .:? "status") <*>
2023+ (o .:? "driverControlFilesUri")
2024+ <*> (o .:? "hiveJob")
2025+ <*> (o .:? "reference")
2026+ <*> (o .:? "sparkSqlJob")
2027+ <*> (o .:? "hadoopJob")
2028+ <*> (o .:? "pysparkJob")
2029+ <*> (o .:? "driverOutputResourceUri")
2030+ <*> (o .:? "statusHistory" .!= mempty)
2031+ <*> (o .:? "placement")
2032+ <*> (o .:? "pigJob"))
2033+
2034+instance ToJSON Job where
2035+ toJSON Job{..}
2036+ = object
2037+ (catMaybes
2038+ [("sparkJob" .=) <$> _jSparkJob,
2039+ ("status" .=) <$> _jStatus,
2040+ ("driverControlFilesUri" .=) <$>
2041+ _jDriverControlFilesURI,
2042+ ("hiveJob" .=) <$> _jHiveJob,
2043+ ("reference" .=) <$> _jReference,
2044+ ("sparkSqlJob" .=) <$> _jSparkSQLJob,
2045+ ("hadoopJob" .=) <$> _jHadoopJob,
2046+ ("pysparkJob" .=) <$> _jPysparkJob,
2047+ ("driverOutputResourceUri" .=) <$>
2048+ _jDriverOutputResourceURI,
2049+ ("statusHistory" .=) <$> _jStatusHistory,
2050+ ("placement" .=) <$> _jPlacement,
2051+ ("pigJob" .=) <$> _jPigJob])
2052+
2053+-- | A request to collect cluster diagnostic information.
2054+--
2055+-- /See:/ 'diagnoseClusterRequest' smart constructor.
2056+data DiagnoseClusterRequest =
2057+ DiagnoseClusterRequest
2058+ deriving (Eq,Show,Data,Typeable,Generic)
2059+
2060+-- | Creates a value of 'DiagnoseClusterRequest' with the minimum fields required to make a request.
2061+--
2062+diagnoseClusterRequest
2063+ :: DiagnoseClusterRequest
2064+diagnoseClusterRequest = DiagnoseClusterRequest
2065+
2066+instance FromJSON DiagnoseClusterRequest where
2067+ parseJSON
2068+ = withObject "DiagnoseClusterRequest"
2069+ (\ o -> pure DiagnoseClusterRequest)
2070+
2071+instance ToJSON DiagnoseClusterRequest where
2072+ toJSON = const emptyObject
2073+
2074+-- | A Cloud Dataproc job for running Hadoop MapReduce jobs on YARN.
2075+--
2076+-- /See:/ 'hadoopJob' smart constructor.
2077+data HadoopJob = HadoopJob
2078+ { _hArgs :: !(Maybe [Text])
2079+ , _hMainJarFileURI :: !(Maybe Text)
2080+ , _hJarFileURIs :: !(Maybe [Text])
2081+ , _hFileURIs :: !(Maybe [Text])
2082+ , _hArchiveURIs :: !(Maybe [Text])
2083+ , _hMainClass :: !(Maybe Text)
2084+ , _hLoggingConfig :: !(Maybe LoggingConfig)
2085+ , _hProperties :: !(Maybe HadoopJobProperties)
2086+ } deriving (Eq,Show,Data,Typeable,Generic)
2087+
2088+-- | Creates a value of 'HadoopJob' with the minimum fields required to make a request.
2089+--
2090+-- Use one of the following lenses to modify other fields as desired:
2091+--
2092+-- * 'hArgs'
2093+--
2094+-- * 'hMainJarFileURI'
2095+--
2096+-- * 'hJarFileURIs'
2097+--
2098+-- * 'hFileURIs'
2099+--
2100+-- * 'hArchiveURIs'
2101+--
2102+-- * 'hMainClass'
2103+--
2104+-- * 'hLoggingConfig'
2105+--
2106+-- * 'hProperties'
2107+hadoopJob
2108+ :: HadoopJob
2109+hadoopJob =
2110+ HadoopJob
2111+ { _hArgs = Nothing
2112+ , _hMainJarFileURI = Nothing
2113+ , _hJarFileURIs = Nothing
2114+ , _hFileURIs = Nothing
2115+ , _hArchiveURIs = Nothing
2116+ , _hMainClass = Nothing
2117+ , _hLoggingConfig = Nothing
2118+ , _hProperties = Nothing
2119+ }
2120+
2121+-- | [Optional] The arguments to pass to the driver. Do not include
2122+-- arguments, such as \`-libjars\` or \`-Dfoo=bar\`, that can be set as job
2123+-- properties, since a collision may occur that causes an incorrect job
2124+-- submission.
2125+hArgs :: Lens' HadoopJob [Text]
2126+hArgs
2127+ = lens _hArgs (\ s a -> s{_hArgs = a}) . _Default .
2128+ _Coerce
2129+
2130+-- | The HCFS URI of the jar file containing the main class. Examples:
2131+-- \'gs:\/\/foo-bucket\/analytics-binaries\/extract-useful-metrics-mr.jar\'
2132+-- \'hdfs:\/tmp\/test-samples\/custom-wordcount.jar\'
2133+-- \'file:\/\/\/home\/usr\/lib\/hadoop-mapreduce\/hadoop-mapreduce-examples.jar\'
2134+hMainJarFileURI :: Lens' HadoopJob (Maybe Text)
2135+hMainJarFileURI
2136+ = lens _hMainJarFileURI
2137+ (\ s a -> s{_hMainJarFileURI = a})
2138+
2139+-- | [Optional] Jar file URIs to add to the CLASSPATHs of the Hadoop driver
2140+-- and tasks.
2141+hJarFileURIs :: Lens' HadoopJob [Text]
2142+hJarFileURIs
2143+ = lens _hJarFileURIs (\ s a -> s{_hJarFileURIs = a})
2144+ . _Default
2145+ . _Coerce
2146+
2147+-- | [Optional] HCFS (Hadoop Compatible Filesystem) URIs of files to be
2148+-- copied to the working directory of Hadoop drivers and distributed tasks.
2149+-- Useful for naively parallel tasks.
2150+hFileURIs :: Lens' HadoopJob [Text]
2151+hFileURIs
2152+ = lens _hFileURIs (\ s a -> s{_hFileURIs = a}) .
2153+ _Default
2154+ . _Coerce
2155+
2156+-- | [Optional] HCFS URIs of archives to be extracted in the working
2157+-- directory of Hadoop drivers and tasks. Supported file types: .jar, .tar,
2158+-- .tar.gz, .tgz, or .zip.
2159+hArchiveURIs :: Lens' HadoopJob [Text]
2160+hArchiveURIs
2161+ = lens _hArchiveURIs (\ s a -> s{_hArchiveURIs = a})
2162+ . _Default
2163+ . _Coerce
2164+
2165+-- | The name of the driver\'s main class. The jar file containing the class
2166+-- must be in the default CLASSPATH or specified in \`jar_file_uris\`.
2167+hMainClass :: Lens' HadoopJob (Maybe Text)
2168+hMainClass
2169+ = lens _hMainClass (\ s a -> s{_hMainClass = a})
2170+
2171+-- | [Optional] The runtime log config for job execution.
2172+hLoggingConfig :: Lens' HadoopJob (Maybe LoggingConfig)
2173+hLoggingConfig
2174+ = lens _hLoggingConfig
2175+ (\ s a -> s{_hLoggingConfig = a})
2176+
2177+-- | [Optional] A mapping of property names to values, used to configure
2178+-- Hadoop. Properties that conflict with values set by the Cloud Dataproc
2179+-- API may be overwritten. Can include properties set in
2180+-- \/etc\/hadoop\/conf\/*-site and classes in user code.
2181+hProperties :: Lens' HadoopJob (Maybe HadoopJobProperties)
2182+hProperties
2183+ = lens _hProperties (\ s a -> s{_hProperties = a})
2184+
2185+instance FromJSON HadoopJob where
2186+ parseJSON
2187+ = withObject "HadoopJob"
2188+ (\ o ->
2189+ HadoopJob <$>
2190+ (o .:? "args" .!= mempty) <*>
2191+ (o .:? "mainJarFileUri")
2192+ <*> (o .:? "jarFileUris" .!= mempty)
2193+ <*> (o .:? "fileUris" .!= mempty)
2194+ <*> (o .:? "archiveUris" .!= mempty)
2195+ <*> (o .:? "mainClass")
2196+ <*> (o .:? "loggingConfig")
2197+ <*> (o .:? "properties"))
2198+
2199+instance ToJSON HadoopJob where
2200+ toJSON HadoopJob{..}
2201+ = object
2202+ (catMaybes
2203+ [("args" .=) <$> _hArgs,
2204+ ("mainJarFileUri" .=) <$> _hMainJarFileURI,
2205+ ("jarFileUris" .=) <$> _hJarFileURIs,
2206+ ("fileUris" .=) <$> _hFileURIs,
2207+ ("archiveUris" .=) <$> _hArchiveURIs,
2208+ ("mainClass" .=) <$> _hMainClass,
2209+ ("loggingConfig" .=) <$> _hLoggingConfig,
2210+ ("properties" .=) <$> _hProperties])
2211+
2212+-- | Metadata describing the operation.
2213+--
2214+-- /See:/ 'clusterOperationMetadata' smart constructor.
2215+data ClusterOperationMetadata = ClusterOperationMetadata
2216+ { _comStatus :: !(Maybe ClusterOperationStatus)
2217+ , _comClusterUuid :: !(Maybe Text)
2218+ , _comClusterName :: !(Maybe Text)
2219+ , _comOperationType :: !(Maybe Text)
2220+ , _comStatusHistory :: !(Maybe [ClusterOperationStatus])
2221+ , _comDescription :: !(Maybe Text)
2222+ } deriving (Eq,Show,Data,Typeable,Generic)
2223+
2224+-- | Creates a value of 'ClusterOperationMetadata' with the minimum fields required to make a request.
2225+--
2226+-- Use one of the following lenses to modify other fields as desired:
2227+--
2228+-- * 'comStatus'
2229+--
2230+-- * 'comClusterUuid'
2231+--
2232+-- * 'comClusterName'
2233+--
2234+-- * 'comOperationType'
2235+--
2236+-- * 'comStatusHistory'
2237+--
2238+-- * 'comDescription'
2239+clusterOperationMetadata
2240+ :: ClusterOperationMetadata
2241+clusterOperationMetadata =
2242+ ClusterOperationMetadata
2243+ { _comStatus = Nothing
2244+ , _comClusterUuid = Nothing
2245+ , _comClusterName = Nothing
2246+ , _comOperationType = Nothing
2247+ , _comStatusHistory = Nothing
2248+ , _comDescription = Nothing
2249+ }
2250+
2251+-- | [Output-only] Current operation status.
2252+comStatus :: Lens' ClusterOperationMetadata (Maybe ClusterOperationStatus)
2253+comStatus
2254+ = lens _comStatus (\ s a -> s{_comStatus = a})
2255+
2256+-- | Cluster UUId for the operation.
2257+comClusterUuid :: Lens' ClusterOperationMetadata (Maybe Text)
2258+comClusterUuid
2259+ = lens _comClusterUuid
2260+ (\ s a -> s{_comClusterUuid = a})
2261+
2262+-- | Name of the cluster for the operation.
2263+comClusterName :: Lens' ClusterOperationMetadata (Maybe Text)
2264+comClusterName
2265+ = lens _comClusterName
2266+ (\ s a -> s{_comClusterName = a})
2267+
2268+-- | [Output-only] The operation type.
2269+comOperationType :: Lens' ClusterOperationMetadata (Maybe Text)
2270+comOperationType
2271+ = lens _comOperationType
2272+ (\ s a -> s{_comOperationType = a})
2273+
2274+-- | [Output-only] The previous operation status.
2275+comStatusHistory :: Lens' ClusterOperationMetadata [ClusterOperationStatus]
2276+comStatusHistory
2277+ = lens _comStatusHistory
2278+ (\ s a -> s{_comStatusHistory = a})
2279+ . _Default
2280+ . _Coerce
2281+
2282+-- | [Output-only] Short description of operation.
2283+comDescription :: Lens' ClusterOperationMetadata (Maybe Text)
2284+comDescription
2285+ = lens _comDescription
2286+ (\ s a -> s{_comDescription = a})
2287+
2288+instance FromJSON ClusterOperationMetadata where
2289+ parseJSON
2290+ = withObject "ClusterOperationMetadata"
2291+ (\ o ->
2292+ ClusterOperationMetadata <$>
2293+ (o .:? "status") <*> (o .:? "clusterUuid") <*>
2294+ (o .:? "clusterName")
2295+ <*> (o .:? "operationType")
2296+ <*> (o .:? "statusHistory" .!= mempty)
2297+ <*> (o .:? "description"))
2298+
2299+instance ToJSON ClusterOperationMetadata where
2300+ toJSON ClusterOperationMetadata{..}
2301+ = object
2302+ (catMaybes
2303+ [("status" .=) <$> _comStatus,
2304+ ("clusterUuid" .=) <$> _comClusterUuid,
2305+ ("clusterName" .=) <$> _comClusterName,
2306+ ("operationType" .=) <$> _comOperationType,
2307+ ("statusHistory" .=) <$> _comStatusHistory,
2308+ ("description" .=) <$> _comDescription])
2309+
2310+-- | A Cloud Dataproc job for running Spark SQL queries.
2311+--
2312+-- /See:/ 'sparkSQLJob' smart constructor.
2313+data SparkSQLJob = SparkSQLJob
2314+ { _ssqljQueryFileURI :: !(Maybe Text)
2315+ , _ssqljJarFileURIs :: !(Maybe [Text])
2316+ , _ssqljScriptVariables :: !(Maybe SparkSQLJobScriptVariables)
2317+ , _ssqljQueryList :: !(Maybe QueryList)
2318+ , _ssqljLoggingConfig :: !(Maybe LoggingConfig)
2319+ , _ssqljProperties :: !(Maybe SparkSQLJobProperties)
2320+ } deriving (Eq,Show,Data,Typeable,Generic)
2321+
2322+-- | Creates a value of 'SparkSQLJob' with the minimum fields required to make a request.
2323+--
2324+-- Use one of the following lenses to modify other fields as desired:
2325+--
2326+-- * 'ssqljQueryFileURI'
2327+--
2328+-- * 'ssqljJarFileURIs'
2329+--
2330+-- * 'ssqljScriptVariables'
2331+--
2332+-- * 'ssqljQueryList'
2333+--
2334+-- * 'ssqljLoggingConfig'
2335+--
2336+-- * 'ssqljProperties'
2337+sparkSQLJob
2338+ :: SparkSQLJob
2339+sparkSQLJob =
2340+ SparkSQLJob
2341+ { _ssqljQueryFileURI = Nothing
2342+ , _ssqljJarFileURIs = Nothing
2343+ , _ssqljScriptVariables = Nothing
2344+ , _ssqljQueryList = Nothing
2345+ , _ssqljLoggingConfig = Nothing
2346+ , _ssqljProperties = Nothing
2347+ }
2348+
2349+-- | The HCFS URI of the script that contains SQL queries.
2350+ssqljQueryFileURI :: Lens' SparkSQLJob (Maybe Text)
2351+ssqljQueryFileURI
2352+ = lens _ssqljQueryFileURI
2353+ (\ s a -> s{_ssqljQueryFileURI = a})
2354+
2355+-- | [Optional] HCFS URIs of jar files to be added to the Spark CLASSPATH.
2356+ssqljJarFileURIs :: Lens' SparkSQLJob [Text]
2357+ssqljJarFileURIs
2358+ = lens _ssqljJarFileURIs
2359+ (\ s a -> s{_ssqljJarFileURIs = a})
2360+ . _Default
2361+ . _Coerce
2362+
2363+-- | [Optional] Mapping of query variable names to values (equivalent to the
2364+-- Spark SQL command: SET \`name=\"value\";\`).
2365+ssqljScriptVariables :: Lens' SparkSQLJob (Maybe SparkSQLJobScriptVariables)
2366+ssqljScriptVariables
2367+ = lens _ssqljScriptVariables
2368+ (\ s a -> s{_ssqljScriptVariables = a})
2369+
2370+-- | A list of queries.
2371+ssqljQueryList :: Lens' SparkSQLJob (Maybe QueryList)
2372+ssqljQueryList
2373+ = lens _ssqljQueryList
2374+ (\ s a -> s{_ssqljQueryList = a})
2375+
2376+-- | [Optional] The runtime log config for job execution.
2377+ssqljLoggingConfig :: Lens' SparkSQLJob (Maybe LoggingConfig)
2378+ssqljLoggingConfig
2379+ = lens _ssqljLoggingConfig
2380+ (\ s a -> s{_ssqljLoggingConfig = a})
2381+
2382+-- | [Optional] A mapping of property names to values, used to configure
2383+-- Spark SQL\'s SparkConf. Properties that conflict with values set by the
2384+-- Cloud Dataproc API may be overwritten.
2385+ssqljProperties :: Lens' SparkSQLJob (Maybe SparkSQLJobProperties)
2386+ssqljProperties
2387+ = lens _ssqljProperties
2388+ (\ s a -> s{_ssqljProperties = a})
2389+
2390+instance FromJSON SparkSQLJob where
2391+ parseJSON
2392+ = withObject "SparkSQLJob"
2393+ (\ o ->
2394+ SparkSQLJob <$>
2395+ (o .:? "queryFileUri") <*>
2396+ (o .:? "jarFileUris" .!= mempty)
2397+ <*> (o .:? "scriptVariables")
2398+ <*> (o .:? "queryList")
2399+ <*> (o .:? "loggingConfig")
2400+ <*> (o .:? "properties"))
2401+
2402+instance ToJSON SparkSQLJob where
2403+ toJSON SparkSQLJob{..}
2404+ = object
2405+ (catMaybes
2406+ [("queryFileUri" .=) <$> _ssqljQueryFileURI,
2407+ ("jarFileUris" .=) <$> _ssqljJarFileURIs,
2408+ ("scriptVariables" .=) <$> _ssqljScriptVariables,
2409+ ("queryList" .=) <$> _ssqljQueryList,
2410+ ("loggingConfig" .=) <$> _ssqljLoggingConfig,
2411+ ("properties" .=) <$> _ssqljProperties])
2412+
2413+-- | Specifies the selection and config of software inside the cluster.
2414+--
2415+-- /See:/ 'softwareConfig' smart constructor.
2416+data SoftwareConfig = SoftwareConfig
2417+ { _scImageVersion :: !(Maybe Text)
2418+ , _scProperties :: !(Maybe SoftwareConfigProperties)
2419+ } deriving (Eq,Show,Data,Typeable,Generic)
2420+
2421+-- | Creates a value of 'SoftwareConfig' with the minimum fields required to make a request.
2422+--
2423+-- Use one of the following lenses to modify other fields as desired:
2424+--
2425+-- * 'scImageVersion'
2426+--
2427+-- * 'scProperties'
2428+softwareConfig
2429+ :: SoftwareConfig
2430+softwareConfig =
2431+ SoftwareConfig
2432+ { _scImageVersion = Nothing
2433+ , _scProperties = Nothing
2434+ }
2435+
2436+-- | [Optional] The version of software inside the cluster. It must match the
2437+-- regular expression \`[0-9]+\\.[0-9]+\`. If unspecified, it defaults to
2438+-- the latest version (see [Cloud Dataproc
2439+-- Versioning](\/dataproc\/versioning)).
2440+scImageVersion :: Lens' SoftwareConfig (Maybe Text)
2441+scImageVersion
2442+ = lens _scImageVersion
2443+ (\ s a -> s{_scImageVersion = a})
2444+
2445+-- | [Optional] The properties to set on daemon config files. Property keys
2446+-- are specified in \`prefix:property\` format, such as
2447+-- \`core:fs.defaultFS\`. The following are supported prefixes and their
2448+-- mappings: * core: \`core-site.xml\` * hdfs: \`hdfs-site.xml\` * mapred:
2449+-- \`mapred-site.xml\` * yarn: \`yarn-site.xml\` * hive: \`hive-site.xml\`
2450+-- * pig: \`pig.properties\` * spark: \`spark-defaults.conf\`
2451+scProperties :: Lens' SoftwareConfig (Maybe SoftwareConfigProperties)
2452+scProperties
2453+ = lens _scProperties (\ s a -> s{_scProperties = a})
2454+
2455+instance FromJSON SoftwareConfig where
2456+ parseJSON
2457+ = withObject "SoftwareConfig"
2458+ (\ o ->
2459+ SoftwareConfig <$>
2460+ (o .:? "imageVersion") <*> (o .:? "properties"))
2461+
2462+instance ToJSON SoftwareConfig where
2463+ toJSON SoftwareConfig{..}
2464+ = object
2465+ (catMaybes
2466+ [("imageVersion" .=) <$> _scImageVersion,
2467+ ("properties" .=) <$> _scProperties])
2468+
2469+-- | A list of jobs in a project.
2470+--
2471+-- /See:/ 'listJobsResponse' smart constructor.
2472+data ListJobsResponse = ListJobsResponse
2473+ { _ljrNextPageToken :: !(Maybe Text)
2474+ , _ljrJobs :: !(Maybe [Job])
2475+ } deriving (Eq,Show,Data,Typeable,Generic)
2476+
2477+-- | Creates a value of 'ListJobsResponse' with the minimum fields required to make a request.
2478+--
2479+-- Use one of the following lenses to modify other fields as desired:
2480+--
2481+-- * 'ljrNextPageToken'
2482+--
2483+-- * 'ljrJobs'
2484+listJobsResponse
2485+ :: ListJobsResponse
2486+listJobsResponse =
2487+ ListJobsResponse
2488+ { _ljrNextPageToken = Nothing
2489+ , _ljrJobs = Nothing
2490+ }
2491+
2492+-- | [Optional] This token is included in the response if there are more
2493+-- results to fetch. To fetch additional results, provide this value as the
2494+-- \`page_token\` in a subsequent ListJobsRequest.
2495+ljrNextPageToken :: Lens' ListJobsResponse (Maybe Text)
2496+ljrNextPageToken
2497+ = lens _ljrNextPageToken
2498+ (\ s a -> s{_ljrNextPageToken = a})
2499+
2500+-- | [Output-only] Jobs list.
2501+ljrJobs :: Lens' ListJobsResponse [Job]
2502+ljrJobs
2503+ = lens _ljrJobs (\ s a -> s{_ljrJobs = a}) . _Default
2504+ . _Coerce
2505+
2506+instance FromJSON ListJobsResponse where
2507+ parseJSON
2508+ = withObject "ListJobsResponse"
2509+ (\ o ->
2510+ ListJobsResponse <$>
2511+ (o .:? "nextPageToken") <*>
2512+ (o .:? "jobs" .!= mempty))
2513+
2514+instance ToJSON ListJobsResponse where
2515+ toJSON ListJobsResponse{..}
2516+ = object
2517+ (catMaybes
2518+ [("nextPageToken" .=) <$> _ljrNextPageToken,
2519+ ("jobs" .=) <$> _ljrJobs])
2520+
2521+-- | [Optional] A mapping of property names to values, used to configure
2522+-- Spark. Properties that conflict with values set by the Cloud Dataproc
2523+-- API may be overwritten. Can include properties set in
2524+-- \/etc\/spark\/conf\/spark-defaults.conf and classes in user code.
2525+--
2526+-- /See:/ 'sparkJobProperties' smart constructor.
2527+newtype SparkJobProperties = SparkJobProperties
2528+ { _sjpAddtional :: HashMap Text Text
2529+ } deriving (Eq,Show,Data,Typeable,Generic)
2530+
2531+-- | Creates a value of 'SparkJobProperties' with the minimum fields required to make a request.
2532+--
2533+-- Use one of the following lenses to modify other fields as desired:
2534+--
2535+-- * 'sjpAddtional'
2536+sparkJobProperties
2537+ :: HashMap Text Text -- ^ 'sjpAddtional'
2538+ -> SparkJobProperties
2539+sparkJobProperties pSjpAddtional_ =
2540+ SparkJobProperties
2541+ { _sjpAddtional = _Coerce # pSjpAddtional_
2542+ }
2543+
2544+sjpAddtional :: Lens' SparkJobProperties (HashMap Text Text)
2545+sjpAddtional
2546+ = lens _sjpAddtional (\ s a -> s{_sjpAddtional = a})
2547+ . _Coerce
2548+
2549+instance FromJSON SparkJobProperties where
2550+ parseJSON
2551+ = withObject "SparkJobProperties"
2552+ (\ o -> SparkJobProperties <$> (parseJSONObject o))
2553+
2554+instance ToJSON SparkJobProperties where
2555+ toJSON = toJSON . _sjpAddtional
2556+
2557+-- | A Cloud Dataproc job for running PySpark applications on YARN.
2558+--
2559+-- /See:/ 'pySparkJob' smart constructor.
2560+data PySparkJob = PySparkJob
2561+ { _psjPythonFileURIs :: !(Maybe [Text])
2562+ , _psjMainPythonFileURI :: !(Maybe Text)
2563+ , _psjArgs :: !(Maybe [Text])
2564+ , _psjJarFileURIs :: !(Maybe [Text])
2565+ , _psjFileURIs :: !(Maybe [Text])
2566+ , _psjArchiveURIs :: !(Maybe [Text])
2567+ , _psjLoggingConfig :: !(Maybe LoggingConfig)
2568+ , _psjProperties :: !(Maybe PySparkJobProperties)
2569+ } deriving (Eq,Show,Data,Typeable,Generic)
2570+
2571+-- | Creates a value of 'PySparkJob' with the minimum fields required to make a request.
2572+--
2573+-- Use one of the following lenses to modify other fields as desired:
2574+--
2575+-- * 'psjPythonFileURIs'
2576+--
2577+-- * 'psjMainPythonFileURI'
2578+--
2579+-- * 'psjArgs'
2580+--
2581+-- * 'psjJarFileURIs'
2582+--
2583+-- * 'psjFileURIs'
2584+--
2585+-- * 'psjArchiveURIs'
2586+--
2587+-- * 'psjLoggingConfig'
2588+--
2589+-- * 'psjProperties'
2590+pySparkJob
2591+ :: PySparkJob
2592+pySparkJob =
2593+ PySparkJob
2594+ { _psjPythonFileURIs = Nothing
2595+ , _psjMainPythonFileURI = Nothing
2596+ , _psjArgs = Nothing
2597+ , _psjJarFileURIs = Nothing
2598+ , _psjFileURIs = Nothing
2599+ , _psjArchiveURIs = Nothing
2600+ , _psjLoggingConfig = Nothing
2601+ , _psjProperties = Nothing
2602+ }
2603+
2604+-- | [Optional] HCFS file URIs of Python files to pass to the PySpark
2605+-- framework. Supported file types: .py, .egg, and .zip.
2606+psjPythonFileURIs :: Lens' PySparkJob [Text]
2607+psjPythonFileURIs
2608+ = lens _psjPythonFileURIs
2609+ (\ s a -> s{_psjPythonFileURIs = a})
2610+ . _Default
2611+ . _Coerce
2612+
2613+-- | [Required] The HCFS URI of the main Python file to use as the driver.
2614+-- Must be a .py file.
2615+psjMainPythonFileURI :: Lens' PySparkJob (Maybe Text)
2616+psjMainPythonFileURI
2617+ = lens _psjMainPythonFileURI
2618+ (\ s a -> s{_psjMainPythonFileURI = a})
2619+
2620+-- | [Optional] The arguments to pass to the driver. Do not include
2621+-- arguments, such as \`--conf\`, that can be set as job properties, since
2622+-- a collision may occur that causes an incorrect job submission.
2623+psjArgs :: Lens' PySparkJob [Text]
2624+psjArgs
2625+ = lens _psjArgs (\ s a -> s{_psjArgs = a}) . _Default
2626+ . _Coerce
2627+
2628+-- | [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the Python
2629+-- driver and tasks.
2630+psjJarFileURIs :: Lens' PySparkJob [Text]
2631+psjJarFileURIs
2632+ = lens _psjJarFileURIs
2633+ (\ s a -> s{_psjJarFileURIs = a})
2634+ . _Default
2635+ . _Coerce
2636+
2637+-- | [Optional] HCFS URIs of files to be copied to the working directory of
2638+-- Python drivers and distributed tasks. Useful for naively parallel tasks.
2639+psjFileURIs :: Lens' PySparkJob [Text]
2640+psjFileURIs
2641+ = lens _psjFileURIs (\ s a -> s{_psjFileURIs = a}) .
2642+ _Default
2643+ . _Coerce
2644+
2645+-- | [Optional] HCFS URIs of archives to be extracted in the working
2646+-- directory of .jar, .tar, .tar.gz, .tgz, and .zip.
2647+psjArchiveURIs :: Lens' PySparkJob [Text]
2648+psjArchiveURIs
2649+ = lens _psjArchiveURIs
2650+ (\ s a -> s{_psjArchiveURIs = a})
2651+ . _Default
2652+ . _Coerce
2653+
2654+-- | [Optional] The runtime log config for job execution.
2655+psjLoggingConfig :: Lens' PySparkJob (Maybe LoggingConfig)
2656+psjLoggingConfig
2657+ = lens _psjLoggingConfig
2658+ (\ s a -> s{_psjLoggingConfig = a})
2659+
2660+-- | [Optional] A mapping of property names to values, used to configure
2661+-- PySpark. Properties that conflict with values set by the Cloud Dataproc
2662+-- API may be overwritten. Can include properties set in
2663+-- \/etc\/spark\/conf\/spark-defaults.conf and classes in user code.
2664+psjProperties :: Lens' PySparkJob (Maybe PySparkJobProperties)
2665+psjProperties
2666+ = lens _psjProperties
2667+ (\ s a -> s{_psjProperties = a})
2668+
2669+instance FromJSON PySparkJob where
2670+ parseJSON
2671+ = withObject "PySparkJob"
2672+ (\ o ->
2673+ PySparkJob <$>
2674+ (o .:? "pythonFileUris" .!= mempty) <*>
2675+ (o .:? "mainPythonFileUri")
2676+ <*> (o .:? "args" .!= mempty)
2677+ <*> (o .:? "jarFileUris" .!= mempty)
2678+ <*> (o .:? "fileUris" .!= mempty)
2679+ <*> (o .:? "archiveUris" .!= mempty)
2680+ <*> (o .:? "loggingConfig")
2681+ <*> (o .:? "properties"))
2682+
2683+instance ToJSON PySparkJob where
2684+ toJSON PySparkJob{..}
2685+ = object
2686+ (catMaybes
2687+ [("pythonFileUris" .=) <$> _psjPythonFileURIs,
2688+ ("mainPythonFileUri" .=) <$> _psjMainPythonFileURI,
2689+ ("args" .=) <$> _psjArgs,
2690+ ("jarFileUris" .=) <$> _psjJarFileURIs,
2691+ ("fileUris" .=) <$> _psjFileURIs,
2692+ ("archiveUris" .=) <$> _psjArchiveURIs,
2693+ ("loggingConfig" .=) <$> _psjLoggingConfig,
2694+ ("properties" .=) <$> _psjProperties])
2695+
2696+-- | Specifies the resources used to actively manage an instance group.
2697+--
2698+-- /See:/ 'managedGroupConfig' smart constructor.
2699+data ManagedGroupConfig = ManagedGroupConfig
2700+ { _mgcInstanceTemplateName :: !(Maybe Text)
2701+ , _mgcInstanceGroupManagerName :: !(Maybe Text)
2702+ } deriving (Eq,Show,Data,Typeable,Generic)
2703+
2704+-- | Creates a value of 'ManagedGroupConfig' with the minimum fields required to make a request.
2705+--
2706+-- Use one of the following lenses to modify other fields as desired:
2707+--
2708+-- * 'mgcInstanceTemplateName'
2709+--
2710+-- * 'mgcInstanceGroupManagerName'
2711+managedGroupConfig
2712+ :: ManagedGroupConfig
2713+managedGroupConfig =
2714+ ManagedGroupConfig
2715+ { _mgcInstanceTemplateName = Nothing
2716+ , _mgcInstanceGroupManagerName = Nothing
2717+ }
2718+
2719+-- | [Output-only] The name of the Instance Template used for the Managed
2720+-- Instance Group.
2721+mgcInstanceTemplateName :: Lens' ManagedGroupConfig (Maybe Text)
2722+mgcInstanceTemplateName
2723+ = lens _mgcInstanceTemplateName
2724+ (\ s a -> s{_mgcInstanceTemplateName = a})
2725+
2726+-- | [Output-only] The name of the Instance Group Manager for this group.
2727+mgcInstanceGroupManagerName :: Lens' ManagedGroupConfig (Maybe Text)
2728+mgcInstanceGroupManagerName
2729+ = lens _mgcInstanceGroupManagerName
2730+ (\ s a -> s{_mgcInstanceGroupManagerName = a})
2731+
2732+instance FromJSON ManagedGroupConfig where
2733+ parseJSON
2734+ = withObject "ManagedGroupConfig"
2735+ (\ o ->
2736+ ManagedGroupConfig <$>
2737+ (o .:? "instanceTemplateName") <*>
2738+ (o .:? "instanceGroupManagerName"))
2739+
2740+instance ToJSON ManagedGroupConfig where
2741+ toJSON ManagedGroupConfig{..}
2742+ = object
2743+ (catMaybes
2744+ [("instanceTemplateName" .=) <$>
2745+ _mgcInstanceTemplateName,
2746+ ("instanceGroupManagerName" .=) <$>
2747+ _mgcInstanceGroupManagerName])
2748+
2749+-- | The list of all clusters in a project.
2750+--
2751+-- /See:/ 'listClustersResponse' smart constructor.
2752+data ListClustersResponse = ListClustersResponse
2753+ { _lcrNextPageToken :: !(Maybe Text)
2754+ , _lcrClusters :: !(Maybe [Cluster])
2755+ } deriving (Eq,Show,Data,Typeable,Generic)
2756+
2757+-- | Creates a value of 'ListClustersResponse' with the minimum fields required to make a request.
2758+--
2759+-- Use one of the following lenses to modify other fields as desired:
2760+--
2761+-- * 'lcrNextPageToken'
2762+--
2763+-- * 'lcrClusters'
2764+listClustersResponse
2765+ :: ListClustersResponse
2766+listClustersResponse =
2767+ ListClustersResponse
2768+ { _lcrNextPageToken = Nothing
2769+ , _lcrClusters = Nothing
2770+ }
2771+
2772+-- | [Optional] This token is included in the response if there are more
2773+-- results to fetch. To fetch additional results, provide this value as the
2774+-- \`page_token\` in a subsequent ListClustersRequest.
2775+lcrNextPageToken :: Lens' ListClustersResponse (Maybe Text)
2776+lcrNextPageToken
2777+ = lens _lcrNextPageToken
2778+ (\ s a -> s{_lcrNextPageToken = a})
2779+
2780+-- | [Output-only] The clusters in the project.
2781+lcrClusters :: Lens' ListClustersResponse [Cluster]
2782+lcrClusters
2783+ = lens _lcrClusters (\ s a -> s{_lcrClusters = a}) .
2784+ _Default
2785+ . _Coerce
2786+
2787+instance FromJSON ListClustersResponse where
2788+ parseJSON
2789+ = withObject "ListClustersResponse"
2790+ (\ o ->
2791+ ListClustersResponse <$>
2792+ (o .:? "nextPageToken") <*>
2793+ (o .:? "clusters" .!= mempty))
2794+
2795+instance ToJSON ListClustersResponse where
2796+ toJSON ListClustersResponse{..}
2797+ = object
2798+ (catMaybes
2799+ [("nextPageToken" .=) <$> _lcrNextPageToken,
2800+ ("clusters" .=) <$> _lcrClusters])
2801+
2802+-- | A request to cancel a job.
2803+--
2804+-- /See:/ 'cancelJobRequest' smart constructor.
2805+data CancelJobRequest =
2806+ CancelJobRequest
2807+ deriving (Eq,Show,Data,Typeable,Generic)
2808+
2809+-- | Creates a value of 'CancelJobRequest' with the minimum fields required to make a request.
2810+--
2811+cancelJobRequest
2812+ :: CancelJobRequest
2813+cancelJobRequest = CancelJobRequest
2814+
2815+instance FromJSON CancelJobRequest where
2816+ parseJSON
2817+ = withObject "CancelJobRequest"
2818+ (\ o -> pure CancelJobRequest)
2819+
2820+instance ToJSON CancelJobRequest where
2821+ toJSON = const emptyObject
2822+
2823+-- | A list of queries to run on a cluster.
2824+--
2825+-- /See:/ 'queryList' smart constructor.
2826+newtype QueryList = QueryList
2827+ { _qlQueries :: Maybe [Text]
2828+ } deriving (Eq,Show,Data,Typeable,Generic)
2829+
2830+-- | Creates a value of 'QueryList' with the minimum fields required to make a request.
2831+--
2832+-- Use one of the following lenses to modify other fields as desired:
2833+--
2834+-- * 'qlQueries'
2835+queryList
2836+ :: QueryList
2837+queryList =
2838+ QueryList
2839+ { _qlQueries = Nothing
2840+ }
2841+
2842+-- | [Required] The queries to execute. You do not need to terminate a query
2843+-- with a semicolon. Multiple queries can be specified in one string by
2844+-- separating each with a semicolon. Here is an example of an Cloud
2845+-- Dataproc API snippet that uses a QueryList to specify a HiveJob:
2846+-- \"hiveJob\": { \"queryList\": { \"queries\": [ \"query1\", \"query2\",
2847+-- \"query3;query4\", ] } }
2848+qlQueries :: Lens' QueryList [Text]
2849+qlQueries
2850+ = lens _qlQueries (\ s a -> s{_qlQueries = a}) .
2851+ _Default
2852+ . _Coerce
2853+
2854+instance FromJSON QueryList where
2855+ parseJSON
2856+ = withObject "QueryList"
2857+ (\ o -> QueryList <$> (o .:? "queries" .!= mempty))
2858+
2859+instance ToJSON QueryList where
2860+ toJSON QueryList{..}
2861+ = object (catMaybes [("queries" .=) <$> _qlQueries])
2862+
2863+-- | Metadata describing the operation.
2864+--
2865+-- /See:/ 'operationMetadata' smart constructor.
2866+data OperationMetadata = OperationMetadata
2867+ { _omStatus :: !(Maybe OperationStatus)
2868+ , _omState :: !(Maybe Text)
2869+ , _omClusterUuid :: !(Maybe Text)
2870+ , _omInsertTime :: !(Maybe Text)
2871+ , _omStartTime :: !(Maybe Text)
2872+ , _omInnerState :: !(Maybe Text)
2873+ , _omEndTime :: !(Maybe Text)
2874+ , _omDetails :: !(Maybe Text)
2875+ , _omClusterName :: !(Maybe Text)
2876+ , _omOperationType :: !(Maybe Text)
2877+ , _omStatusHistory :: !(Maybe [OperationStatus])
2878+ , _omDescription :: !(Maybe Text)
2879+ } deriving (Eq,Show,Data,Typeable,Generic)
2880+
2881+-- | Creates a value of 'OperationMetadata' with the minimum fields required to make a request.
2882+--
2883+-- Use one of the following lenses to modify other fields as desired:
2884+--
2885+-- * 'omStatus'
2886+--
2887+-- * 'omState'
2888+--
2889+-- * 'omClusterUuid'
2890+--
2891+-- * 'omInsertTime'
2892+--
2893+-- * 'omStartTime'
2894+--
2895+-- * 'omInnerState'
2896+--
2897+-- * 'omEndTime'
2898+--
2899+-- * 'omDetails'
2900+--
2901+-- * 'omClusterName'
2902+--
2903+-- * 'omOperationType'
2904+--
2905+-- * 'omStatusHistory'
2906+--
2907+-- * 'omDescription'
2908+operationMetadata
2909+ :: OperationMetadata
2910+operationMetadata =
2911+ OperationMetadata
2912+ { _omStatus = Nothing
2913+ , _omState = Nothing
2914+ , _omClusterUuid = Nothing
2915+ , _omInsertTime = Nothing
2916+ , _omStartTime = Nothing
2917+ , _omInnerState = Nothing
2918+ , _omEndTime = Nothing
2919+ , _omDetails = Nothing
2920+ , _omClusterName = Nothing
2921+ , _omOperationType = Nothing
2922+ , _omStatusHistory = Nothing
2923+ , _omDescription = Nothing
2924+ }
2925+
2926+-- | [Output-only] Current operation status.
2927+omStatus :: Lens' OperationMetadata (Maybe OperationStatus)
2928+omStatus = lens _omStatus (\ s a -> s{_omStatus = a})
2929+
2930+-- | A message containing the operation state.
2931+omState :: Lens' OperationMetadata (Maybe Text)
2932+omState = lens _omState (\ s a -> s{_omState = a})
2933+
2934+-- | Cluster UUId for the operation.
2935+omClusterUuid :: Lens' OperationMetadata (Maybe Text)
2936+omClusterUuid
2937+ = lens _omClusterUuid
2938+ (\ s a -> s{_omClusterUuid = a})
2939+
2940+-- | The time that the operation was requested.
2941+omInsertTime :: Lens' OperationMetadata (Maybe Text)
2942+omInsertTime
2943+ = lens _omInsertTime (\ s a -> s{_omInsertTime = a})
2944+
2945+-- | The time that the operation was started by the server.
2946+omStartTime :: Lens' OperationMetadata (Maybe Text)
2947+omStartTime
2948+ = lens _omStartTime (\ s a -> s{_omStartTime = a})
2949+
2950+-- | A message containing the detailed operation state.
2951+omInnerState :: Lens' OperationMetadata (Maybe Text)
2952+omInnerState
2953+ = lens _omInnerState (\ s a -> s{_omInnerState = a})
2954+
2955+-- | The time that the operation completed.
2956+omEndTime :: Lens' OperationMetadata (Maybe Text)
2957+omEndTime
2958+ = lens _omEndTime (\ s a -> s{_omEndTime = a})
2959+
2960+-- | A message containing any operation metadata details.
2961+omDetails :: Lens' OperationMetadata (Maybe Text)
2962+omDetails
2963+ = lens _omDetails (\ s a -> s{_omDetails = a})
2964+
2965+-- | Name of the cluster for the operation.
2966+omClusterName :: Lens' OperationMetadata (Maybe Text)
2967+omClusterName
2968+ = lens _omClusterName
2969+ (\ s a -> s{_omClusterName = a})
2970+
2971+-- | [Output-only] The operation type.
2972+omOperationType :: Lens' OperationMetadata (Maybe Text)
2973+omOperationType
2974+ = lens _omOperationType
2975+ (\ s a -> s{_omOperationType = a})
2976+
2977+-- | [Output-only] Previous operation status.
2978+omStatusHistory :: Lens' OperationMetadata [OperationStatus]
2979+omStatusHistory
2980+ = lens _omStatusHistory
2981+ (\ s a -> s{_omStatusHistory = a})
2982+ . _Default
2983+ . _Coerce
2984+
2985+-- | [Output-only] Short description of operation.
2986+omDescription :: Lens' OperationMetadata (Maybe Text)
2987+omDescription
2988+ = lens _omDescription
2989+ (\ s a -> s{_omDescription = a})
2990+
2991+instance FromJSON OperationMetadata where
2992+ parseJSON
2993+ = withObject "OperationMetadata"
2994+ (\ o ->
2995+ OperationMetadata <$>
2996+ (o .:? "status") <*> (o .:? "state") <*>
2997+ (o .:? "clusterUuid")
2998+ <*> (o .:? "insertTime")
2999+ <*> (o .:? "startTime")
3000+ <*> (o .:? "innerState")
3001+ <*> (o .:? "endTime")
3002+ <*> (o .:? "details")
3003+ <*> (o .:? "clusterName")
3004+ <*> (o .:? "operationType")
3005+ <*> (o .:? "statusHistory" .!= mempty)
3006+ <*> (o .:? "description"))
3007+
3008+instance ToJSON OperationMetadata where
3009+ toJSON OperationMetadata{..}
3010+ = object
3011+ (catMaybes
3012+ [("status" .=) <$> _omStatus,
3013+ ("state" .=) <$> _omState,
3014+ ("clusterUuid" .=) <$> _omClusterUuid,
3015+ ("insertTime" .=) <$> _omInsertTime,
3016+ ("startTime" .=) <$> _omStartTime,
3017+ ("innerState" .=) <$> _omInnerState,
3018+ ("endTime" .=) <$> _omEndTime,
3019+ ("details" .=) <$> _omDetails,
3020+ ("clusterName" .=) <$> _omClusterName,
3021+ ("operationType" .=) <$> _omOperationType,
3022+ ("statusHistory" .=) <$> _omStatusHistory,
3023+ ("description" .=) <$> _omDescription])
3024+
3025+-- | Cloud Dataproc job status.
3026+--
3027+-- /See:/ 'jobStatus' smart constructor.
3028+data JobStatus = JobStatus
3029+ { _jsState :: !(Maybe Text)
3030+ , _jsStateStartTime :: !(Maybe Text)
3031+ , _jsDetails :: !(Maybe Text)
3032+ } deriving (Eq,Show,Data,Typeable,Generic)
3033+
3034+-- | Creates a value of 'JobStatus' with the minimum fields required to make a request.
3035+--
3036+-- Use one of the following lenses to modify other fields as desired:
3037+--
3038+-- * 'jsState'
3039+--
3040+-- * 'jsStateStartTime'
3041+--
3042+-- * 'jsDetails'
3043+jobStatus
3044+ :: JobStatus
3045+jobStatus =
3046+ JobStatus
3047+ { _jsState = Nothing
3048+ , _jsStateStartTime = Nothing
3049+ , _jsDetails = Nothing
3050+ }
3051+
3052+-- | [Required] A state message specifying the overall job state.
3053+jsState :: Lens' JobStatus (Maybe Text)
3054+jsState = lens _jsState (\ s a -> s{_jsState = a})
3055+
3056+-- | [Output-only] The time when this state was entered.
3057+jsStateStartTime :: Lens' JobStatus (Maybe Text)
3058+jsStateStartTime
3059+ = lens _jsStateStartTime
3060+ (\ s a -> s{_jsStateStartTime = a})
3061+
3062+-- | [Optional] Job state details, such as an error description if the state
3063+-- is ERROR.
3064+jsDetails :: Lens' JobStatus (Maybe Text)
3065+jsDetails
3066+ = lens _jsDetails (\ s a -> s{_jsDetails = a})
3067+
3068+instance FromJSON JobStatus where
3069+ parseJSON
3070+ = withObject "JobStatus"
3071+ (\ o ->
3072+ JobStatus <$>
3073+ (o .:? "state") <*> (o .:? "stateStartTime") <*>
3074+ (o .:? "details"))
3075+
3076+instance ToJSON JobStatus where
3077+ toJSON JobStatus{..}
3078+ = object
3079+ (catMaybes
3080+ [("state" .=) <$> _jsState,
3081+ ("stateStartTime" .=) <$> _jsStateStartTime,
3082+ ("details" .=) <$> _jsDetails])
3083+
3084+-- | [Optional] Mapping of query variable names to values (equivalent to the
3085+-- Pig command: \`name=[value]\`).
3086+--
3087+-- /See:/ 'pigJobScriptVariables' smart constructor.
3088+newtype PigJobScriptVariables = PigJobScriptVariables
3089+ { _pjsvAddtional :: HashMap Text Text
3090+ } deriving (Eq,Show,Data,Typeable,Generic)
3091+
3092+-- | Creates a value of 'PigJobScriptVariables' with the minimum fields required to make a request.
3093+--
3094+-- Use one of the following lenses to modify other fields as desired:
3095+--
3096+-- * 'pjsvAddtional'
3097+pigJobScriptVariables
3098+ :: HashMap Text Text -- ^ 'pjsvAddtional'
3099+ -> PigJobScriptVariables
3100+pigJobScriptVariables pPjsvAddtional_ =
3101+ PigJobScriptVariables
3102+ { _pjsvAddtional = _Coerce # pPjsvAddtional_
3103+ }
3104+
3105+pjsvAddtional :: Lens' PigJobScriptVariables (HashMap Text Text)
3106+pjsvAddtional
3107+ = lens _pjsvAddtional
3108+ (\ s a -> s{_pjsvAddtional = a})
3109+ . _Coerce
3110+
3111+instance FromJSON PigJobScriptVariables where
3112+ parseJSON
3113+ = withObject "PigJobScriptVariables"
3114+ (\ o ->
3115+ PigJobScriptVariables <$> (parseJSONObject o))
3116+
3117+instance ToJSON PigJobScriptVariables where
3118+ toJSON = toJSON . _pjsvAddtional
3119+
3120+-- | The normal response of the operation in case of success. If the original
3121+-- method returns no data on success, such as \`Delete\`, the response is
3122+-- \`google.protobuf.Empty\`. If the original method is standard
3123+-- \`Get\`\/\`Create\`\/\`Update\`, the response should be the resource.
3124+-- For other methods, the response should have the type \`XxxResponse\`,
3125+-- where \`Xxx\` is the original method name. For example, if the original
3126+-- method name is \`TakeSnapshot()\`, the inferred response type is
3127+-- \`TakeSnapshotResponse\`.
3128+--
3129+-- /See:/ 'operationResponse' smart constructor.
3130+newtype OperationResponse = OperationResponse
3131+ { _orAddtional :: HashMap Text JSONValue
3132+ } deriving (Eq,Show,Data,Typeable,Generic)
3133+
3134+-- | Creates a value of 'OperationResponse' with the minimum fields required to make a request.
3135+--
3136+-- Use one of the following lenses to modify other fields as desired:
3137+--
3138+-- * 'orAddtional'
3139+operationResponse
3140+ :: HashMap Text JSONValue -- ^ 'orAddtional'
3141+ -> OperationResponse
3142+operationResponse pOrAddtional_ =
3143+ OperationResponse
3144+ { _orAddtional = _Coerce # pOrAddtional_
3145+ }
3146+
3147+-- | Properties of the object. Contains field \'ype with type URL.
3148+orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
3149+orAddtional
3150+ = lens _orAddtional (\ s a -> s{_orAddtional = a}) .
3151+ _Coerce
3152+
3153+instance FromJSON OperationResponse where
3154+ parseJSON
3155+ = withObject "OperationResponse"
3156+ (\ o -> OperationResponse <$> (parseJSONObject o))
3157+
3158+instance ToJSON OperationResponse where
3159+ toJSON = toJSON . _orAddtional
3160+
3161+-- | The per-package log levels for the driver. This may include \"root\"
3162+-- package name to configure rootLogger. Examples: \'com.google = FATAL\',
3163+-- \'root = INFO\', \'org.apache = DEBUG\'
3164+--
3165+-- /See:/ 'loggingConfigDriverLogLevels' smart constructor.
3166+newtype LoggingConfigDriverLogLevels = LoggingConfigDriverLogLevels
3167+ { _lcdllAddtional :: HashMap Text Text
3168+ } deriving (Eq,Show,Data,Typeable,Generic)
3169+
3170+-- | Creates a value of 'LoggingConfigDriverLogLevels' with the minimum fields required to make a request.
3171+--
3172+-- Use one of the following lenses to modify other fields as desired:
3173+--
3174+-- * 'lcdllAddtional'
3175+loggingConfigDriverLogLevels
3176+ :: HashMap Text Text -- ^ 'lcdllAddtional'
3177+ -> LoggingConfigDriverLogLevels
3178+loggingConfigDriverLogLevels pLcdllAddtional_ =
3179+ LoggingConfigDriverLogLevels
3180+ { _lcdllAddtional = _Coerce # pLcdllAddtional_
3181+ }
3182+
3183+lcdllAddtional :: Lens' LoggingConfigDriverLogLevels (HashMap Text Text)
3184+lcdllAddtional
3185+ = lens _lcdllAddtional
3186+ (\ s a -> s{_lcdllAddtional = a})
3187+ . _Coerce
3188+
3189+instance FromJSON LoggingConfigDriverLogLevels where
3190+ parseJSON
3191+ = withObject "LoggingConfigDriverLogLevels"
3192+ (\ o ->
3193+ LoggingConfigDriverLogLevels <$> (parseJSONObject o))
3194+
3195+instance ToJSON LoggingConfigDriverLogLevels where
3196+ toJSON = toJSON . _lcdllAddtional
3197+
3198+-- | The status of a cluster and its instances.
3199+--
3200+-- /See:/ 'clusterStatus' smart constructor.
3201+data ClusterStatus = ClusterStatus
3202+ { _csState :: !(Maybe Text)
3203+ , _csStateStartTime :: !(Maybe Text)
3204+ , _csDetail :: !(Maybe Text)
3205+ } deriving (Eq,Show,Data,Typeable,Generic)
3206+
3207+-- | Creates a value of 'ClusterStatus' with the minimum fields required to make a request.
3208+--
3209+-- Use one of the following lenses to modify other fields as desired:
3210+--
3211+-- * 'csState'
3212+--
3213+-- * 'csStateStartTime'
3214+--
3215+-- * 'csDetail'
3216+clusterStatus
3217+ :: ClusterStatus
3218+clusterStatus =
3219+ ClusterStatus
3220+ { _csState = Nothing
3221+ , _csStateStartTime = Nothing
3222+ , _csDetail = Nothing
3223+ }
3224+
3225+-- | The cluster\'s state.
3226+csState :: Lens' ClusterStatus (Maybe Text)
3227+csState = lens _csState (\ s a -> s{_csState = a})
3228+
3229+-- | Time when this state was entered.
3230+csStateStartTime :: Lens' ClusterStatus (Maybe Text)
3231+csStateStartTime
3232+ = lens _csStateStartTime
3233+ (\ s a -> s{_csStateStartTime = a})
3234+
3235+-- | Optional details of cluster\'s state.
3236+csDetail :: Lens' ClusterStatus (Maybe Text)
3237+csDetail = lens _csDetail (\ s a -> s{_csDetail = a})
3238+
3239+instance FromJSON ClusterStatus where
3240+ parseJSON
3241+ = withObject "ClusterStatus"
3242+ (\ o ->
3243+ ClusterStatus <$>
3244+ (o .:? "state") <*> (o .:? "stateStartTime") <*>
3245+ (o .:? "detail"))
3246+
3247+instance ToJSON ClusterStatus where
3248+ toJSON ClusterStatus{..}
3249+ = object
3250+ (catMaybes
3251+ [("state" .=) <$> _csState,
3252+ ("stateStartTime" .=) <$> _csStateStartTime,
3253+ ("detail" .=) <$> _csDetail])
3254+
3255+-- | A Cloud Dataproc job for running Pig queries on YARN.
3256+--
3257+-- /See:/ 'pigJob' smart constructor.
3258+data PigJob = PigJob
3259+ { _pjQueryFileURI :: !(Maybe Text)
3260+ , _pjJarFileURIs :: !(Maybe [Text])
3261+ , _pjScriptVariables :: !(Maybe PigJobScriptVariables)
3262+ , _pjQueryList :: !(Maybe QueryList)
3263+ , _pjContinueOnFailure :: !(Maybe Bool)
3264+ , _pjLoggingConfig :: !(Maybe LoggingConfig)
3265+ , _pjProperties :: !(Maybe PigJobProperties)
3266+ } deriving (Eq,Show,Data,Typeable,Generic)
3267+
3268+-- | Creates a value of 'PigJob' with the minimum fields required to make a request.
3269+--
3270+-- Use one of the following lenses to modify other fields as desired:
3271+--
3272+-- * 'pjQueryFileURI'
3273+--
3274+-- * 'pjJarFileURIs'
3275+--
3276+-- * 'pjScriptVariables'
3277+--
3278+-- * 'pjQueryList'
3279+--
3280+-- * 'pjContinueOnFailure'
3281+--
3282+-- * 'pjLoggingConfig'
3283+--
3284+-- * 'pjProperties'
3285+pigJob
3286+ :: PigJob
3287+pigJob =
3288+ PigJob
3289+ { _pjQueryFileURI = Nothing
3290+ , _pjJarFileURIs = Nothing
3291+ , _pjScriptVariables = Nothing
3292+ , _pjQueryList = Nothing
3293+ , _pjContinueOnFailure = Nothing
3294+ , _pjLoggingConfig = Nothing
3295+ , _pjProperties = Nothing
3296+ }
3297+
3298+-- | The HCFS URI of the script that contains the Pig queries.
3299+pjQueryFileURI :: Lens' PigJob (Maybe Text)
3300+pjQueryFileURI
3301+ = lens _pjQueryFileURI
3302+ (\ s a -> s{_pjQueryFileURI = a})
3303+
3304+-- | [Optional] HCFS URIs of jar files to add to the CLASSPATH of the Pig
3305+-- Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs.
3306+pjJarFileURIs :: Lens' PigJob [Text]
3307+pjJarFileURIs
3308+ = lens _pjJarFileURIs
3309+ (\ s a -> s{_pjJarFileURIs = a})
3310+ . _Default
3311+ . _Coerce
3312+
3313+-- | [Optional] Mapping of query variable names to values (equivalent to the
3314+-- Pig command: \`name=[value]\`).
3315+pjScriptVariables :: Lens' PigJob (Maybe PigJobScriptVariables)
3316+pjScriptVariables
3317+ = lens _pjScriptVariables
3318+ (\ s a -> s{_pjScriptVariables = a})
3319+
3320+-- | A list of queries.
3321+pjQueryList :: Lens' PigJob (Maybe QueryList)
3322+pjQueryList
3323+ = lens _pjQueryList (\ s a -> s{_pjQueryList = a})
3324+
3325+-- | [Optional] Whether to continue executing queries if a query fails. The
3326+-- default value is \`false\`. Setting to \`true\` can be useful when
3327+-- executing independent parallel queries.
3328+pjContinueOnFailure :: Lens' PigJob (Maybe Bool)
3329+pjContinueOnFailure
3330+ = lens _pjContinueOnFailure
3331+ (\ s a -> s{_pjContinueOnFailure = a})
3332+
3333+-- | [Optional] The runtime log config for job execution.
3334+pjLoggingConfig :: Lens' PigJob (Maybe LoggingConfig)
3335+pjLoggingConfig
3336+ = lens _pjLoggingConfig
3337+ (\ s a -> s{_pjLoggingConfig = a})
3338+
3339+-- | [Optional] A mapping of property names to values, used to configure Pig.
3340+-- Properties that conflict with values set by the Cloud Dataproc API may
3341+-- be overwritten. Can include properties set in
3342+-- \/etc\/hadoop\/conf\/*-site.xml, \/etc\/pig\/conf\/pig.properties, and
3343+-- classes in user code.
3344+pjProperties :: Lens' PigJob (Maybe PigJobProperties)
3345+pjProperties
3346+ = lens _pjProperties (\ s a -> s{_pjProperties = a})
3347+
3348+instance FromJSON PigJob where
3349+ parseJSON
3350+ = withObject "PigJob"
3351+ (\ o ->
3352+ PigJob <$>
3353+ (o .:? "queryFileUri") <*>
3354+ (o .:? "jarFileUris" .!= mempty)
3355+ <*> (o .:? "scriptVariables")
3356+ <*> (o .:? "queryList")
3357+ <*> (o .:? "continueOnFailure")
3358+ <*> (o .:? "loggingConfig")
3359+ <*> (o .:? "properties"))
3360+
3361+instance ToJSON PigJob where
3362+ toJSON PigJob{..}
3363+ = object
3364+ (catMaybes
3365+ [("queryFileUri" .=) <$> _pjQueryFileURI,
3366+ ("jarFileUris" .=) <$> _pjJarFileURIs,
3367+ ("scriptVariables" .=) <$> _pjScriptVariables,
3368+ ("queryList" .=) <$> _pjQueryList,
3369+ ("continueOnFailure" .=) <$> _pjContinueOnFailure,
3370+ ("loggingConfig" .=) <$> _pjLoggingConfig,
3371+ ("properties" .=) <$> _pjProperties])
3372+
3373+-- | The runtime logging config of the job.
3374+--
3375+-- /See:/ 'loggingConfig' smart constructor.
3376+newtype LoggingConfig = LoggingConfig
3377+ { _lcDriverLogLevels :: Maybe LoggingConfigDriverLogLevels
3378+ } deriving (Eq,Show,Data,Typeable,Generic)
3379+
3380+-- | Creates a value of 'LoggingConfig' with the minimum fields required to make a request.
3381+--
3382+-- Use one of the following lenses to modify other fields as desired:
3383+--
3384+-- * 'lcDriverLogLevels'
3385+loggingConfig
3386+ :: LoggingConfig
3387+loggingConfig =
3388+ LoggingConfig
3389+ { _lcDriverLogLevels = Nothing
3390+ }
3391+
3392+-- | The per-package log levels for the driver. This may include \"root\"
3393+-- package name to configure rootLogger. Examples: \'com.google = FATAL\',
3394+-- \'root = INFO\', \'org.apache = DEBUG\'
3395+lcDriverLogLevels :: Lens' LoggingConfig (Maybe LoggingConfigDriverLogLevels)
3396+lcDriverLogLevels
3397+ = lens _lcDriverLogLevels
3398+ (\ s a -> s{_lcDriverLogLevels = a})
3399+
3400+instance FromJSON LoggingConfig where
3401+ parseJSON
3402+ = withObject "LoggingConfig"
3403+ (\ o -> LoggingConfig <$> (o .:? "driverLogLevels"))
3404+
3405+instance ToJSON LoggingConfig where
3406+ toJSON LoggingConfig{..}
3407+ = object
3408+ (catMaybes
3409+ [("driverLogLevels" .=) <$> _lcDriverLogLevels])