@@ -0,0 +1,3409 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2+{-# LANGUAGE DeriveGeneric #-}
3+{-# LANGUAGE NoImplicitPrelude #-}
4+{-# LANGUAGE OverloadedStrings #-}
5+{-# LANGUAGE RecordWildCards #-}
7+{-# OPTIONS_GHC -fno-warn-unused-binds #-}
8+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
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)
18+module Network.Google.Dataproc.Types.Product where
20+import Network.Google.Dataproc.Types.Sum
21+import Network.Google.Prelude
23+-- | Encapsulates the full scoping used to reference a job.
25+-- /See:/ 'jobReference' smart constructor.
26+data JobReference = JobReference
27+ { _jrJobId :: !(Maybe Text)
28+ , _jrProjectId :: !(Maybe Text)
29+ } deriving (Eq,Show,Data,Typeable,Generic)
31+-- | Creates a value of 'JobReference' with the minimum fields required to make a request.
33+-- Use one of the following lenses to modify other fields as desired:
43+ , _jrProjectId = Nothing
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})
54+-- | [Required] The ID of the Google Cloud Platform project that the job
56+jrProjectId :: Lens' JobReference (Maybe Text)
58+ = lens _jrProjectId (\ s a -> s{_jrProjectId = a})
60+instance FromJSON JobReference where
62+ = withObject "JobReference"
65+ (o .:? "jobId") <*> (o .:? "projectId"))
67+instance ToJSON JobReference where
68+ toJSON JobReference{..}
71+ [("jobId" .=) <$> _jrJobId,
72+ ("projectId" .=) <$> _jrProjectId])
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.
110+-- /See:/ 'status' smart constructor.
112+ { _sDetails :: !(Maybe [StatusDetailsItem])
113+ , _sCode :: !(Maybe (Textual Int32))
114+ , _sMessage :: !(Maybe Text)
115+ } deriving (Eq,Show,Data,Typeable,Generic)
117+-- | Creates a value of 'Status' with the minimum fields required to make a request.
119+-- Use one of the following lenses to modify other fields as desired:
130+ { _sDetails = Nothing
132+ , _sMessage = Nothing
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]
139+ = lens _sDetails (\ s a -> s{_sDetails = a}) .
143+-- | The status code, which should be an enum value of google.rpc.Code.
144+sCode :: Lens' Status (Maybe Int32)
146+ = lens _sCode (\ s a -> s{_sCode = a}) .
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})
155+instance FromJSON Status where
157+ = withObject "Status"
160+ (o .:? "details" .!= mempty) <*> (o .:? "code") <*>
163+instance ToJSON Status where
167+ [("details" .=) <$> _sDetails,
168+ ("code" .=) <$> _sCode,
169+ ("message" .=) <$> _sMessage])
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.
176+-- /See:/ 'operationSchema' smart constructor.
177+newtype OperationSchema = OperationSchema
178+ { _osAddtional :: HashMap Text JSONValue
179+ } deriving (Eq,Show,Data,Typeable,Generic)
181+-- | Creates a value of 'OperationSchema' with the minimum fields required to make a request.
183+-- Use one of the following lenses to modify other fields as desired:
187+ :: HashMap Text JSONValue -- ^ 'osAddtional'
189+operationSchema pOsAddtional_ =
191+ { _osAddtional = _Coerce # pOsAddtional_
194+-- | Properties of the object. Contains field \'ype with type URL.
195+osAddtional :: Lens' OperationSchema (HashMap Text JSONValue)
197+ = lens _osAddtional (\ s a -> s{_osAddtional = a}) .
200+instance FromJSON OperationSchema where
202+ = withObject "OperationSchema"
203+ (\ o -> OperationSchema <$> (parseJSONObject o))
205+instance ToJSON OperationSchema where
206+ toJSON = toJSON . _osAddtional
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.
213+-- /See:/ 'pySparkJobProperties' smart constructor.
214+newtype PySparkJobProperties = PySparkJobProperties
215+ { _psjpAddtional :: HashMap Text Text
216+ } deriving (Eq,Show,Data,Typeable,Generic)
218+-- | Creates a value of 'PySparkJobProperties' with the minimum fields required to make a request.
220+-- Use one of the following lenses to modify other fields as desired:
224+ :: HashMap Text Text -- ^ 'psjpAddtional'
225+ -> PySparkJobProperties
226+pySparkJobProperties pPsjpAddtional_ =
227+ PySparkJobProperties
228+ { _psjpAddtional = _Coerce # pPsjpAddtional_
231+psjpAddtional :: Lens' PySparkJobProperties (HashMap Text Text)
233+ = lens _psjpAddtional
234+ (\ s a -> s{_psjpAddtional = a})
237+instance FromJSON PySparkJobProperties where
239+ = withObject "PySparkJobProperties"
240+ (\ o -> PySparkJobProperties <$> (parseJSONObject o))
242+instance ToJSON PySparkJobProperties where
243+ toJSON = toJSON . _psjpAddtional
245+-- | The location of diagnostic output.
247+-- /See:/ 'diagnoseClusterResults' smart constructor.
248+newtype DiagnoseClusterResults = DiagnoseClusterResults
249+ { _dcrOutputURI :: Maybe Text
250+ } deriving (Eq,Show,Data,Typeable,Generic)
252+-- | Creates a value of 'DiagnoseClusterResults' with the minimum fields required to make a request.
254+-- Use one of the following lenses to modify other fields as desired:
257+diagnoseClusterResults
258+ :: DiagnoseClusterResults
259+diagnoseClusterResults =
260+ DiagnoseClusterResults
261+ { _dcrOutputURI = Nothing
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)
268+ = lens _dcrOutputURI (\ s a -> s{_dcrOutputURI = a})
270+instance FromJSON DiagnoseClusterResults where
272+ = withObject "DiagnoseClusterResults"
274+ DiagnoseClusterResults <$> (o .:? "outputUri"))
276+instance ToJSON DiagnoseClusterResults where
277+ toJSON DiagnoseClusterResults{..}
279+ (catMaybes [("outputUri" .=) <$> _dcrOutputURI])
281+-- | The config settings for Google Compute Engine resources in an instance
282+-- group, such as a master or worker group.
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)
295+-- | Creates a value of 'InstanceGroupConfig' with the minimum fields required to make a request.
297+-- Use one of the following lenses to modify other fields as desired:
299+-- * 'igcNumInstances'
303+-- * 'igcIsPreemptible'
307+-- * 'igcInstanceNames'
309+-- * 'igcManagedGroupConfig'
311+-- * 'igcMachineTypeURI'
313+ :: InstanceGroupConfig
314+instanceGroupConfig =
316+ { _igcNumInstances = Nothing
317+ , _igcDiskConfig = Nothing
318+ , _igcIsPreemptible = Nothing
319+ , _igcImageURI = Nothing
320+ , _igcInstanceNames = Nothing
321+ , _igcManagedGroupConfig = Nothing
322+ , _igcMachineTypeURI = Nothing
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)
329+ = lens _igcNumInstances
330+ (\ s a -> s{_igcNumInstances = a})
333+-- | Disk option config settings.
334+igcDiskConfig :: Lens' InstanceGroupConfig (Maybe DiskConfig)
336+ = lens _igcDiskConfig
337+ (\ s a -> s{_igcDiskConfig = a})
339+-- | Specifies that this instance group contains Preemptible Instances.
340+igcIsPreemptible :: Lens' InstanceGroupConfig (Maybe Bool)
342+ = lens _igcIsPreemptible
343+ (\ s a -> s{_igcIsPreemptible = a})
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)
349+ = lens _igcImageURI (\ s a -> s{_igcImageURI = a})
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]
356+ = lens _igcInstanceNames
357+ (\ s a -> s{_igcInstanceNames = a})
361+-- | [Output-only] The config for Google Compute Engine Instance Group
362+-- Manager that manages this group. This is only used for preemptible
364+igcManagedGroupConfig :: Lens' InstanceGroupConfig (Maybe ManagedGroupConfig)
365+igcManagedGroupConfig
366+ = lens _igcManagedGroupConfig
367+ (\ s a -> s{_igcManagedGroupConfig = a})
369+-- | The Google Compute Engine machine type used for cluster instances.
371+-- \`https:\/\/www.googleapis.com\/compute\/v1\/projects\/[project_id]\/zones\/us-east1-a\/machineTypes\/n1-standard-2\`.
372+igcMachineTypeURI :: Lens' InstanceGroupConfig (Maybe Text)
374+ = lens _igcMachineTypeURI
375+ (\ s a -> s{_igcMachineTypeURI = a})
377+instance FromJSON InstanceGroupConfig where
379+ = withObject "InstanceGroupConfig"
381+ InstanceGroupConfig <$>
382+ (o .:? "numInstances") <*> (o .:? "diskConfig") <*>
383+ (o .:? "isPreemptible")
384+ <*> (o .:? "imageUri")
385+ <*> (o .:? "instanceNames" .!= mempty)
386+ <*> (o .:? "managedGroupConfig")
387+ <*> (o .:? "machineTypeUri"))
389+instance ToJSON InstanceGroupConfig where
390+ toJSON InstanceGroupConfig{..}
393+ [("numInstances" .=) <$> _igcNumInstances,
394+ ("diskConfig" .=) <$> _igcDiskConfig,
395+ ("isPreemptible" .=) <$> _igcIsPreemptible,
396+ ("imageUri" .=) <$> _igcImageURI,
397+ ("instanceNames" .=) <$> _igcInstanceNames,
398+ ("managedGroupConfig" .=) <$> _igcManagedGroupConfig,
399+ ("machineTypeUri" .=) <$> _igcMachineTypeURI])
401+-- | A Cloud Dataproc job for running Spark applications on YARN.
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)
415+-- | Creates a value of 'SparkJob' with the minimum fields required to make a request.
417+-- Use one of the following lenses to modify other fields as desired:
421+-- * 'sjMainJarFileURI'
431+-- * 'sjLoggingConfig'
439+ , _sjMainJarFileURI = Nothing
440+ , _sjJarFileURIs = Nothing
441+ , _sjFileURIs = Nothing
442+ , _sjArchiveURIs = Nothing
443+ , _sjMainClass = Nothing
444+ , _sjLoggingConfig = Nothing
445+ , _sjProperties = Nothing
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]
453+ = lens _sjArgs (\ s a -> s{_sjArgs = a}) . _Default .
456+-- | The HCFS URI of the jar file that contains the main class.
457+sjMainJarFileURI :: Lens' SparkJob (Maybe Text)
459+ = lens _sjMainJarFileURI
460+ (\ s a -> s{_sjMainJarFileURI = a})
462+-- | [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the Spark
464+sjJarFileURIs :: Lens' SparkJob [Text]
466+ = lens _sjJarFileURIs
467+ (\ s a -> s{_sjJarFileURIs = a})
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]
475+ = lens _sjFileURIs (\ s a -> s{_sjFileURIs = a}) .
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]
484+ = lens _sjArchiveURIs
485+ (\ s a -> s{_sjArchiveURIs = a})
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)
494+ = lens _sjMainClass (\ s a -> s{_sjMainClass = a})
496+-- | [Optional] The runtime log config for job execution.
497+sjLoggingConfig :: Lens' SparkJob (Maybe LoggingConfig)
499+ = lens _sjLoggingConfig
500+ (\ s a -> s{_sjLoggingConfig = a})
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)
508+ = lens _sjProperties (\ s a -> s{_sjProperties = a})
510+instance FromJSON SparkJob where
512+ = withObject "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"))
524+instance ToJSON SparkJob where
528+ [("args" .=) <$> _sjArgs,
529+ ("mainJarFileUri" .=) <$> _sjMainJarFileURI,
530+ ("jarFileUris" .=) <$> _sjJarFileURIs,
531+ ("fileUris" .=) <$> _sjFileURIs,
532+ ("archiveUris" .=) <$> _sjArchiveURIs,
533+ ("mainClass" .=) <$> _sjMainClass,
534+ ("loggingConfig" .=) <$> _sjLoggingConfig,
535+ ("properties" .=) <$> _sjProperties])
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\`
544+-- /See:/ 'softwareConfigProperties' smart constructor.
545+newtype SoftwareConfigProperties = SoftwareConfigProperties
546+ { _scpAddtional :: HashMap Text Text
547+ } deriving (Eq,Show,Data,Typeable,Generic)
549+-- | Creates a value of 'SoftwareConfigProperties' with the minimum fields required to make a request.
551+-- Use one of the following lenses to modify other fields as desired:
554+softwareConfigProperties
555+ :: HashMap Text Text -- ^ 'scpAddtional'
556+ -> SoftwareConfigProperties
557+softwareConfigProperties pScpAddtional_ =
558+ SoftwareConfigProperties
559+ { _scpAddtional = _Coerce # pScpAddtional_
562+scpAddtional :: Lens' SoftwareConfigProperties (HashMap Text Text)
564+ = lens _scpAddtional (\ s a -> s{_scpAddtional = a})
567+instance FromJSON SoftwareConfigProperties where
569+ = withObject "SoftwareConfigProperties"
571+ SoftwareConfigProperties <$> (parseJSONObject o))
573+instance ToJSON SoftwareConfigProperties where
574+ toJSON = toJSON . _scpAddtional
576+-- | Specifies the config of disk options for a group of VM instances.
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)
584+-- | Creates a value of 'DiskConfig' with the minimum fields required to make a request.
586+-- Use one of the following lenses to modify other fields as desired:
588+-- * 'dcNumLocalSsds'
590+-- * 'dcBootDiskSizeGb'
595+ { _dcNumLocalSsds = Nothing
596+ , _dcBootDiskSizeGb = Nothing
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
604+dcNumLocalSsds :: Lens' DiskConfig (Maybe Int32)
606+ = lens _dcNumLocalSsds
607+ (\ s a -> s{_dcNumLocalSsds = a})
610+-- | [Optional] Size in GB of the boot disk (default is 500GB).
611+dcBootDiskSizeGb :: Lens' DiskConfig (Maybe Int32)
613+ = lens _dcBootDiskSizeGb
614+ (\ s a -> s{_dcBootDiskSizeGb = a})
617+instance FromJSON DiskConfig where
619+ = withObject "DiskConfig"
622+ (o .:? "numLocalSsds") <*> (o .:? "bootDiskSizeGb"))
624+instance ToJSON DiskConfig where
625+ toJSON DiskConfig{..}
628+ [("numLocalSsds" .=) <$> _dcNumLocalSsds,
629+ ("bootDiskSizeGb" .=) <$> _dcBootDiskSizeGb])
631+-- | The response message for Operations.ListOperations.
633+-- /See:/ 'listOperationsResponse' smart constructor.
634+data ListOperationsResponse = ListOperationsResponse
635+ { _lorNextPageToken :: !(Maybe Text)
636+ , _lorOperations :: !(Maybe [Operation])
637+ } deriving (Eq,Show,Data,Typeable,Generic)
639+-- | Creates a value of 'ListOperationsResponse' with the minimum fields required to make a request.
641+-- Use one of the following lenses to modify other fields as desired:
643+-- * 'lorNextPageToken'
646+listOperationsResponse
647+ :: ListOperationsResponse
648+listOperationsResponse =
649+ ListOperationsResponse
650+ { _lorNextPageToken = Nothing
651+ , _lorOperations = Nothing
654+-- | The standard List next-page token.
655+lorNextPageToken :: Lens' ListOperationsResponse (Maybe Text)
657+ = lens _lorNextPageToken
658+ (\ s a -> s{_lorNextPageToken = a})
660+-- | A list of operations that matches the specified filter in the request.
661+lorOperations :: Lens' ListOperationsResponse [Operation]
663+ = lens _lorOperations
664+ (\ s a -> s{_lorOperations = a})
668+instance FromJSON ListOperationsResponse where
670+ = withObject "ListOperationsResponse"
672+ ListOperationsResponse <$>
673+ (o .:? "nextPageToken") <*>
674+ (o .:? "operations" .!= mempty))
676+instance ToJSON ListOperationsResponse where
677+ toJSON ListOperationsResponse{..}
680+ [("nextPageToken" .=) <$> _lorNextPageToken,
681+ ("operations" .=) <$> _lorOperations])
683+-- | [Optional] Mapping of query variable names to values (equivalent to the
684+-- Hive command: \`SET name=\"value\";\`).
686+-- /See:/ 'hiveJobScriptVariables' smart constructor.
687+newtype HiveJobScriptVariables = HiveJobScriptVariables
688+ { _hjsvAddtional :: HashMap Text Text
689+ } deriving (Eq,Show,Data,Typeable,Generic)
691+-- | Creates a value of 'HiveJobScriptVariables' with the minimum fields required to make a request.
693+-- Use one of the following lenses to modify other fields as desired:
696+hiveJobScriptVariables
697+ :: HashMap Text Text -- ^ 'hjsvAddtional'
698+ -> HiveJobScriptVariables
699+hiveJobScriptVariables pHjsvAddtional_ =
700+ HiveJobScriptVariables
701+ { _hjsvAddtional = _Coerce # pHjsvAddtional_
704+hjsvAddtional :: Lens' HiveJobScriptVariables (HashMap Text Text)
706+ = lens _hjsvAddtional
707+ (\ s a -> s{_hjsvAddtional = a})
710+instance FromJSON HiveJobScriptVariables where
712+ = withObject "HiveJobScriptVariables"
714+ HiveJobScriptVariables <$> (parseJSONObject o))
716+instance ToJSON HiveJobScriptVariables where
717+ toJSON = toJSON . _hjsvAddtional
719+-- | Describes the identifying information, config, and status of a cluster
720+-- of Google Compute Engine instances.
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)
732+-- | Creates a value of 'Cluster' with the minimum fields required to make a request.
734+-- Use one of the following lenses to modify other fields as desired:
746+-- * 'cStatusHistory'
751+ { _cStatus = Nothing
752+ , _cClusterUuid = Nothing
753+ , _cConfig = Nothing
754+ , _cClusterName = Nothing
755+ , _cProjectId = Nothing
756+ , _cStatusHistory = Nothing
759+-- | [Output-only] Cluster status.
760+cStatus :: Lens' Cluster (Maybe ClusterStatus)
761+cStatus = lens _cStatus (\ s a -> s{_cStatus = a})
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)
767+ = lens _cClusterUuid (\ s a -> s{_cClusterUuid = a})
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})
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)
778+ = lens _cClusterName (\ s a -> s{_cClusterName = a})
780+-- | [Required] The Google Cloud Platform project ID that the cluster belongs
782+cProjectId :: Lens' Cluster (Maybe Text)
784+ = lens _cProjectId (\ s a -> s{_cProjectId = a})
786+-- | [Output-only] The previous cluster status.
787+cStatusHistory :: Lens' Cluster [ClusterStatus]
789+ = lens _cStatusHistory
790+ (\ s a -> s{_cStatusHistory = a})
794+instance FromJSON Cluster where
796+ = withObject "Cluster"
799+ (o .:? "status") <*> (o .:? "clusterUuid") <*>
801+ <*> (o .:? "clusterName")
802+ <*> (o .:? "projectId")
803+ <*> (o .:? "statusHistory" .!= mempty))
805+instance ToJSON Cluster where
809+ [("status" .=) <$> _cStatus,
810+ ("clusterUuid" .=) <$> _cClusterUuid,
811+ ("config" .=) <$> _cConfig,
812+ ("clusterName" .=) <$> _cClusterName,
813+ ("projectId" .=) <$> _cProjectId,
814+ ("statusHistory" .=) <$> _cStatusHistory])
816+-- | A request to submit a job.
818+-- /See:/ 'submitJobRequest' smart constructor.
819+newtype SubmitJobRequest = SubmitJobRequest
820+ { _sjrJob :: Maybe Job
821+ } deriving (Eq,Show,Data,Typeable,Generic)
823+-- | Creates a value of 'SubmitJobRequest' with the minimum fields required to make a request.
825+-- Use one of the following lenses to modify other fields as desired:
835+-- | [Required] The job resource.
836+sjrJob :: Lens' SubmitJobRequest (Maybe Job)
837+sjrJob = lens _sjrJob (\ s a -> s{_sjrJob = a})
839+instance FromJSON SubmitJobRequest where
841+ = withObject "SubmitJobRequest"
842+ (\ o -> SubmitJobRequest <$> (o .:? "job"))
844+instance ToJSON SubmitJobRequest where
845+ toJSON SubmitJobRequest{..}
846+ = object (catMaybes [("job" .=) <$> _sjrJob])
848+-- | This resource represents a long-running operation that is the result of
849+-- a network API call.
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)
860+-- | Creates a value of 'Operation' with the minimum fields required to make a request.
862+-- Use one of the following lenses to modify other fields as desired:
879+ , _oResponse = Nothing
881+ , _oMetadata = Nothing
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})
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})
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)
904+ = lens _oResponse (\ s a -> s{_oResponse = a})
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})
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)
918+ = lens _oMetadata (\ s a -> s{_oMetadata = a})
920+instance FromJSON Operation where
922+ = withObject "Operation"
925+ (o .:? "done") <*> (o .:? "error") <*>
928+ <*> (o .:? "metadata"))
930+instance ToJSON Operation where
931+ toJSON Operation{..}
934+ [("done" .=) <$> _oDone, ("error" .=) <$> _oError,
935+ ("response" .=) <$> _oResponse,
936+ ("name" .=) <$> _oName,
937+ ("metadata" .=) <$> _oMetadata])
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 \`{}\`.
945+-- /See:/ 'empty' smart constructor.
948+ deriving (Eq,Show,Data,Typeable,Generic)
950+-- | Creates a value of 'Empty' with the minimum fields required to make a request.
956+instance FromJSON Empty where
957+ parseJSON = withObject "Empty" (\ o -> pure Empty)
959+instance ToJSON Empty where
960+ toJSON = const emptyObject
962+-- | A Cloud Dataproc job for running Hive queries on YARN.
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)
974+-- | Creates a value of 'HiveJob' with the minimum fields required to make a request.
976+-- Use one of the following lenses to modify other fields as desired:
978+-- * 'hjQueryFileURI'
982+-- * 'hjScriptVariables'
986+-- * 'hjContinueOnFailure'
993+ { _hjQueryFileURI = Nothing
994+ , _hjJarFileURIs = Nothing
995+ , _hjScriptVariables = Nothing
996+ , _hjQueryList = Nothing
997+ , _hjContinueOnFailure = Nothing
998+ , _hjProperties = Nothing
1001+-- | The HCFS URI of the script that contains Hive queries.
1002+hjQueryFileURI :: Lens' HiveJob (Maybe Text)
1004+ = lens _hjQueryFileURI
1005+ (\ s a -> s{_hjQueryFileURI = a})
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
1010+hjJarFileURIs :: Lens' HiveJob [Text]
1012+ = lens _hjJarFileURIs
1013+ (\ s a -> s{_hjJarFileURIs = a})
1017+-- | [Optional] Mapping of query variable names to values (equivalent to the
1018+-- Hive command: \`SET name=\"value\";\`).
1019+hjScriptVariables :: Lens' HiveJob (Maybe HiveJobScriptVariables)
1021+ = lens _hjScriptVariables
1022+ (\ s a -> s{_hjScriptVariables = a})
1024+-- | A list of queries.
1025+hjQueryList :: Lens' HiveJob (Maybe QueryList)
1027+ = lens _hjQueryList (\ s a -> s{_hjQueryList = a})
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)
1034+ = lens _hjContinueOnFailure
1035+ (\ s a -> s{_hjContinueOnFailure = a})
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)
1044+ = lens _hjProperties (\ s a -> s{_hjProperties = a})
1046+instance FromJSON HiveJob where
1048+ = withObject "HiveJob"
1051+ (o .:? "queryFileUri") <*>
1052+ (o .:? "jarFileUris" .!= mempty)
1053+ <*> (o .:? "scriptVariables")
1054+ <*> (o .:? "queryList")
1055+ <*> (o .:? "continueOnFailure")
1056+ <*> (o .:? "properties"))
1058+instance ToJSON HiveJob where
1062+ [("queryFileUri" .=) <$> _hjQueryFileURI,
1063+ ("jarFileUris" .=) <$> _hjJarFileURIs,
1064+ ("scriptVariables" .=) <$> _hjScriptVariables,
1065+ ("queryList" .=) <$> _hjQueryList,
1066+ ("continueOnFailure" .=) <$> _hjContinueOnFailure,
1067+ ("properties" .=) <$> _hjProperties])
1069+-- | [Optional] Mapping of query variable names to values (equivalent to the
1070+-- Spark SQL command: SET \`name=\"value\";\`).
1072+-- /See:/ 'sparkSQLJobScriptVariables' smart constructor.
1073+newtype SparkSQLJobScriptVariables = SparkSQLJobScriptVariables
1074+ { _ssqljsvAddtional :: HashMap Text Text
1075+ } deriving (Eq,Show,Data,Typeable,Generic)
1077+-- | Creates a value of 'SparkSQLJobScriptVariables' with the minimum fields required to make a request.
1079+-- Use one of the following lenses to modify other fields as desired:
1081+-- * 'ssqljsvAddtional'
1082+sparkSQLJobScriptVariables
1083+ :: HashMap Text Text -- ^ 'ssqljsvAddtional'
1084+ -> SparkSQLJobScriptVariables
1085+sparkSQLJobScriptVariables pSsqljsvAddtional_ =
1086+ SparkSQLJobScriptVariables
1087+ { _ssqljsvAddtional = _Coerce # pSsqljsvAddtional_
1090+ssqljsvAddtional :: Lens' SparkSQLJobScriptVariables (HashMap Text Text)
1092+ = lens _ssqljsvAddtional
1093+ (\ s a -> s{_ssqljsvAddtional = a})
1096+instance FromJSON SparkSQLJobScriptVariables where
1098+ = withObject "SparkSQLJobScriptVariables"
1100+ SparkSQLJobScriptVariables <$> (parseJSONObject o))
1102+instance ToJSON SparkSQLJobScriptVariables where
1103+ toJSON = toJSON . _ssqljsvAddtional
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.
1111+-- /See:/ 'pigJobProperties' smart constructor.
1112+newtype PigJobProperties = PigJobProperties
1113+ { _pjpAddtional :: HashMap Text Text
1114+ } deriving (Eq,Show,Data,Typeable,Generic)
1116+-- | Creates a value of 'PigJobProperties' with the minimum fields required to make a request.
1118+-- Use one of the following lenses to modify other fields as desired:
1122+ :: HashMap Text Text -- ^ 'pjpAddtional'
1123+ -> PigJobProperties
1124+pigJobProperties pPjpAddtional_ =
1126+ { _pjpAddtional = _Coerce # pPjpAddtional_
1129+pjpAddtional :: Lens' PigJobProperties (HashMap Text Text)
1131+ = lens _pjpAddtional (\ s a -> s{_pjpAddtional = a})
1134+instance FromJSON PigJobProperties where
1136+ = withObject "PigJobProperties"
1137+ (\ o -> PigJobProperties <$> (parseJSONObject o))
1139+instance ToJSON PigJobProperties where
1140+ toJSON = toJSON . _pjpAddtional
1142+-- | The cluster config.
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)
1155+-- | Creates a value of 'ClusterConfig' with the minimum fields required to make a request.
1157+-- Use one of the following lenses to modify other fields as desired:
1159+-- * 'ccWorkerConfig'
1161+-- * 'ccInitializationActions'
1163+-- * 'ccMasterConfig'
1165+-- * 'ccGceClusterConfig'
1167+-- * 'ccConfigBucket'
1169+-- * 'ccSoftwareConfig'
1171+-- * 'ccSecondaryWorkerConfig'
1176+ { _ccWorkerConfig = Nothing
1177+ , _ccInitializationActions = Nothing
1178+ , _ccMasterConfig = Nothing
1179+ , _ccGceClusterConfig = Nothing
1180+ , _ccConfigBucket = Nothing
1181+ , _ccSoftwareConfig = Nothing
1182+ , _ccSecondaryWorkerConfig = Nothing
1185+-- | [Optional] The Google Compute Engine config settings for worker
1186+-- instances in a cluster.
1187+ccWorkerConfig :: Lens' ClusterConfig (Maybe InstanceGroupConfig)
1189+ = lens _ccWorkerConfig
1190+ (\ s a -> s{_ccWorkerConfig = a})
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})
1206+-- | [Optional] The Google Compute Engine config settings for the master
1207+-- instance in a cluster.
1208+ccMasterConfig :: Lens' ClusterConfig (Maybe InstanceGroupConfig)
1210+ = lens _ccMasterConfig
1211+ (\ s a -> s{_ccMasterConfig = a})
1213+-- | [Optional] The shared Google Compute Engine config settings for all
1214+-- instances in a cluster.
1215+ccGceClusterConfig :: Lens' ClusterConfig (Maybe GceClusterConfig)
1217+ = lens _ccGceClusterConfig
1218+ (\ s a -> s{_ccGceClusterConfig = a})
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)
1228+ = lens _ccConfigBucket
1229+ (\ s a -> s{_ccConfigBucket = a})
1231+-- | [Optional] The config settings for software inside the cluster.
1232+ccSoftwareConfig :: Lens' ClusterConfig (Maybe SoftwareConfig)
1234+ = lens _ccSoftwareConfig
1235+ (\ s a -> s{_ccSoftwareConfig = a})
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})
1244+instance FromJSON ClusterConfig where
1246+ = withObject "ClusterConfig"
1249+ (o .:? "workerConfig") <*>
1250+ (o .:? "initializationActions" .!= mempty)
1251+ <*> (o .:? "masterConfig")
1252+ <*> (o .:? "gceClusterConfig")
1253+ <*> (o .:? "configBucket")
1254+ <*> (o .:? "softwareConfig")
1255+ <*> (o .:? "secondaryWorkerConfig"))
1257+instance ToJSON ClusterConfig where
1258+ toJSON ClusterConfig{..}
1261+ [("workerConfig" .=) <$> _ccWorkerConfig,
1262+ ("initializationActions" .=) <$>
1263+ _ccInitializationActions,
1264+ ("masterConfig" .=) <$> _ccMasterConfig,
1265+ ("gceClusterConfig" .=) <$> _ccGceClusterConfig,
1266+ ("configBucket" .=) <$> _ccConfigBucket,
1267+ ("softwareConfig" .=) <$> _ccSoftwareConfig,
1268+ ("secondaryWorkerConfig" .=) <$>
1269+ _ccSecondaryWorkerConfig])
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.
1276+-- /See:/ 'hadoopJobProperties' smart constructor.
1277+newtype HadoopJobProperties = HadoopJobProperties
1278+ { _hjpAddtional :: HashMap Text Text
1279+ } deriving (Eq,Show,Data,Typeable,Generic)
1281+-- | Creates a value of 'HadoopJobProperties' with the minimum fields required to make a request.
1283+-- Use one of the following lenses to modify other fields as desired:
1287+ :: HashMap Text Text -- ^ 'hjpAddtional'
1288+ -> HadoopJobProperties
1289+hadoopJobProperties pHjpAddtional_ =
1290+ HadoopJobProperties
1291+ { _hjpAddtional = _Coerce # pHjpAddtional_
1294+hjpAddtional :: Lens' HadoopJobProperties (HashMap Text Text)
1296+ = lens _hjpAddtional (\ s a -> s{_hjpAddtional = a})
1299+instance FromJSON HadoopJobProperties where
1301+ = withObject "HadoopJobProperties"
1302+ (\ o -> HadoopJobProperties <$> (parseJSONObject o))
1304+instance ToJSON HadoopJobProperties where
1305+ toJSON = toJSON . _hjpAddtional
1307+-- | The status of the operation.
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)
1317+-- | Creates a value of 'ClusterOperationStatus' with the minimum fields required to make a request.
1319+-- Use one of the following lenses to modify other fields as desired:
1323+-- * 'cosInnerState'
1325+-- * 'cosStateStartTime'
1328+clusterOperationStatus
1329+ :: ClusterOperationStatus
1330+clusterOperationStatus =
1331+ ClusterOperationStatus
1332+ { _cosState = Nothing
1333+ , _cosInnerState = Nothing
1334+ , _cosStateStartTime = Nothing
1335+ , _cosDetails = Nothing
1338+-- | A message containing the operation state.
1339+cosState :: Lens' ClusterOperationStatus (Maybe Text)
1340+cosState = lens _cosState (\ s a -> s{_cosState = a})
1342+-- | A message containing the detailed operation state.
1343+cosInnerState :: Lens' ClusterOperationStatus (Maybe Text)
1345+ = lens _cosInnerState
1346+ (\ s a -> s{_cosInnerState = a})
1348+-- | The time this state was entered.
1349+cosStateStartTime :: Lens' ClusterOperationStatus (Maybe Text)
1351+ = lens _cosStateStartTime
1352+ (\ s a -> s{_cosStateStartTime = a})
1354+-- | A message containing any operation metadata details.
1355+cosDetails :: Lens' ClusterOperationStatus (Maybe Text)
1357+ = lens _cosDetails (\ s a -> s{_cosDetails = a})
1359+instance FromJSON ClusterOperationStatus where
1361+ = withObject "ClusterOperationStatus"
1363+ ClusterOperationStatus <$>
1364+ (o .:? "state") <*> (o .:? "innerState") <*>
1365+ (o .:? "stateStartTime")
1366+ <*> (o .:? "details"))
1368+instance ToJSON ClusterOperationStatus where
1369+ toJSON ClusterOperationStatus{..}
1372+ [("state" .=) <$> _cosState,
1373+ ("innerState" .=) <$> _cosInnerState,
1374+ ("stateStartTime" .=) <$> _cosStateStartTime,
1375+ ("details" .=) <$> _cosDetails])
1378+-- /See:/ 'statusDetailsItem' smart constructor.
1379+newtype StatusDetailsItem = StatusDetailsItem
1380+ { _sdiAddtional :: HashMap Text JSONValue
1381+ } deriving (Eq,Show,Data,Typeable,Generic)
1383+-- | Creates a value of 'StatusDetailsItem' with the minimum fields required to make a request.
1385+-- Use one of the following lenses to modify other fields as desired:
1389+ :: HashMap Text JSONValue -- ^ 'sdiAddtional'
1390+ -> StatusDetailsItem
1391+statusDetailsItem pSdiAddtional_ =
1393+ { _sdiAddtional = _Coerce # pSdiAddtional_
1396+-- | Properties of the object. Contains field \'ype with type URL.
1397+sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
1399+ = lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
1402+instance FromJSON StatusDetailsItem where
1404+ = withObject "StatusDetailsItem"
1405+ (\ o -> StatusDetailsItem <$> (parseJSONObject o))
1407+instance ToJSON StatusDetailsItem where
1408+ toJSON = toJSON . _sdiAddtional
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.
1414+-- /See:/ 'sparkSQLJobProperties' smart constructor.
1415+newtype SparkSQLJobProperties = SparkSQLJobProperties
1416+ { _ssqljpAddtional :: HashMap Text Text
1417+ } deriving (Eq,Show,Data,Typeable,Generic)
1419+-- | Creates a value of 'SparkSQLJobProperties' with the minimum fields required to make a request.
1421+-- Use one of the following lenses to modify other fields as desired:
1423+-- * 'ssqljpAddtional'
1424+sparkSQLJobProperties
1425+ :: HashMap Text Text -- ^ 'ssqljpAddtional'
1426+ -> SparkSQLJobProperties
1427+sparkSQLJobProperties pSsqljpAddtional_ =
1428+ SparkSQLJobProperties
1429+ { _ssqljpAddtional = _Coerce # pSsqljpAddtional_
1432+ssqljpAddtional :: Lens' SparkSQLJobProperties (HashMap Text Text)
1434+ = lens _ssqljpAddtional
1435+ (\ s a -> s{_ssqljpAddtional = a})
1438+instance FromJSON SparkSQLJobProperties where
1440+ = withObject "SparkSQLJobProperties"
1442+ SparkSQLJobProperties <$> (parseJSONObject o))
1444+instance ToJSON SparkSQLJobProperties where
1445+ toJSON = toJSON . _ssqljpAddtional
1447+-- | Specifies an executable to run on a fully configured node and a timeout
1448+-- period for executable completion.
1450+-- /See:/ 'nodeInitializationAction' smart constructor.
1451+data NodeInitializationAction = NodeInitializationAction
1452+ { _niaExecutionTimeout :: !(Maybe Text)
1453+ , _niaExecutableFile :: !(Maybe Text)
1454+ } deriving (Eq,Show,Data,Typeable,Generic)
1456+-- | Creates a value of 'NodeInitializationAction' with the minimum fields required to make a request.
1458+-- Use one of the following lenses to modify other fields as desired:
1460+-- * 'niaExecutionTimeout'
1462+-- * 'niaExecutableFile'
1463+nodeInitializationAction
1464+ :: NodeInitializationAction
1465+nodeInitializationAction =
1466+ NodeInitializationAction
1467+ { _niaExecutionTimeout = Nothing
1468+ , _niaExecutableFile = Nothing
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)
1477+ = lens _niaExecutionTimeout
1478+ (\ s a -> s{_niaExecutionTimeout = a})
1480+-- | [Required] Google Cloud Storage URI of executable file.
1481+niaExecutableFile :: Lens' NodeInitializationAction (Maybe Text)
1483+ = lens _niaExecutableFile
1484+ (\ s a -> s{_niaExecutableFile = a})
1486+instance FromJSON NodeInitializationAction where
1488+ = withObject "NodeInitializationAction"
1490+ NodeInitializationAction <$>
1491+ (o .:? "executionTimeout") <*>
1492+ (o .:? "executableFile"))
1494+instance ToJSON NodeInitializationAction where
1495+ toJSON NodeInitializationAction{..}
1498+ [("executionTimeout" .=) <$> _niaExecutionTimeout,
1499+ ("executableFile" .=) <$> _niaExecutableFile])
1501+-- | Cloud Dataproc job config.
1503+-- /See:/ 'jobPlacement' smart constructor.
1504+data JobPlacement = JobPlacement
1505+ { _jpClusterUuid :: !(Maybe Text)
1506+ , _jpClusterName :: !(Maybe Text)
1507+ } deriving (Eq,Show,Data,Typeable,Generic)
1509+-- | Creates a value of 'JobPlacement' with the minimum fields required to make a request.
1511+-- Use one of the following lenses to modify other fields as desired:
1513+-- * 'jpClusterUuid'
1515+-- * 'jpClusterName'
1520+ { _jpClusterUuid = Nothing
1521+ , _jpClusterName = Nothing
1524+-- | [Output-only] A cluster UUID generated by the Cloud Dataproc service
1525+-- when the job is submitted.
1526+jpClusterUuid :: Lens' JobPlacement (Maybe Text)
1528+ = lens _jpClusterUuid
1529+ (\ s a -> s{_jpClusterUuid = a})
1531+-- | [Required] The name of the cluster where the job will be submitted.
1532+jpClusterName :: Lens' JobPlacement (Maybe Text)
1534+ = lens _jpClusterName
1535+ (\ s a -> s{_jpClusterName = a})
1537+instance FromJSON JobPlacement where
1539+ = withObject "JobPlacement"
1542+ (o .:? "clusterUuid") <*> (o .:? "clusterName"))
1544+instance ToJSON JobPlacement where
1545+ toJSON JobPlacement{..}
1548+ [("clusterUuid" .=) <$> _jpClusterUuid,
1549+ ("clusterName" .=) <$> _jpClusterName])
1551+-- | Common config settings for resources of Google Compute Engine cluster
1552+-- instances, applicable to all instances in the cluster.
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)
1564+-- | Creates a value of 'GceClusterConfig' with the minimum fields required to make a request.
1566+-- Use one of the following lenses to modify other fields as desired:
1568+-- * 'gccSubnetworkURI'
1570+-- * 'gccNetworkURI'
1576+-- * 'gccServiceAccountScopes'
1580+ :: GceClusterConfig
1583+ { _gccSubnetworkURI = Nothing
1584+ , _gccNetworkURI = Nothing
1585+ , _gccZoneURI = Nothing
1586+ , _gccMetadata = Nothing
1587+ , _gccServiceAccountScopes = Nothing
1588+ , _gccTags = Nothing
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)
1596+ = lens _gccSubnetworkURI
1597+ (\ s a -> s{_gccSubnetworkURI = a})
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)
1608+ = lens _gccNetworkURI
1609+ (\ s a -> s{_gccNetworkURI = a})
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)
1616+ = lens _gccZoneURI (\ s a -> s{_gccZoneURI = a})
1618+-- | The Google Compute Engine metadata entries to add to all instances.
1619+gccMetadata :: Lens' GceClusterConfig (Maybe GceClusterConfigMetadata)
1621+ = lens _gccMetadata (\ s a -> s{_gccMetadata = a})
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})
1640+-- | The Google Compute Engine tags to add to all instances.
1641+gccTags :: Lens' GceClusterConfig [Text]
1643+ = lens _gccTags (\ s a -> s{_gccTags = a}) . _Default
1646+instance FromJSON GceClusterConfig where
1648+ = withObject "GceClusterConfig"
1650+ GceClusterConfig <$>
1651+ (o .:? "subnetworkUri") <*> (o .:? "networkUri") <*>
1653+ <*> (o .:? "metadata")
1654+ <*> (o .:? "serviceAccountScopes" .!= mempty)
1655+ <*> (o .:? "tags" .!= mempty))
1657+instance ToJSON GceClusterConfig where
1658+ toJSON GceClusterConfig{..}
1661+ [("subnetworkUri" .=) <$> _gccSubnetworkURI,
1662+ ("networkUri" .=) <$> _gccNetworkURI,
1663+ ("zoneUri" .=) <$> _gccZoneURI,
1664+ ("metadata" .=) <$> _gccMetadata,
1665+ ("serviceAccountScopes" .=) <$>
1666+ _gccServiceAccountScopes,
1667+ ("tags" .=) <$> _gccTags])
1669+-- | The status of the operation.
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)
1679+-- | Creates a value of 'OperationStatus' with the minimum fields required to make a request.
1681+-- Use one of the following lenses to modify other fields as desired:
1687+-- * 'osStateStartTime'
1694+ { _osState = Nothing
1695+ , _osInnerState = Nothing
1696+ , _osStateStartTime = Nothing
1697+ , _osDetails = Nothing
1700+-- | A message containing the operation state.
1701+osState :: Lens' OperationStatus (Maybe Text)
1702+osState = lens _osState (\ s a -> s{_osState = a})
1704+-- | A message containing the detailed operation state.
1705+osInnerState :: Lens' OperationStatus (Maybe Text)
1707+ = lens _osInnerState (\ s a -> s{_osInnerState = a})
1709+-- | The time this state was entered.
1710+osStateStartTime :: Lens' OperationStatus (Maybe Text)
1712+ = lens _osStateStartTime
1713+ (\ s a -> s{_osStateStartTime = a})
1715+-- | A message containing any operation metadata details.
1716+osDetails :: Lens' OperationStatus (Maybe Text)
1718+ = lens _osDetails (\ s a -> s{_osDetails = a})
1720+instance FromJSON OperationStatus where
1722+ = withObject "OperationStatus"
1724+ OperationStatus <$>
1725+ (o .:? "state") <*> (o .:? "innerState") <*>
1726+ (o .:? "stateStartTime")
1727+ <*> (o .:? "details"))
1729+instance ToJSON OperationStatus where
1730+ toJSON OperationStatus{..}
1733+ [("state" .=) <$> _osState,
1734+ ("innerState" .=) <$> _osInnerState,
1735+ ("stateStartTime" .=) <$> _osStateStartTime,
1736+ ("details" .=) <$> _osDetails])
1738+-- | The Google Compute Engine metadata entries to add to all instances.
1740+-- /See:/ 'gceClusterConfigMetadata' smart constructor.
1741+newtype GceClusterConfigMetadata = GceClusterConfigMetadata
1742+ { _gccmAddtional :: HashMap Text Text
1743+ } deriving (Eq,Show,Data,Typeable,Generic)
1745+-- | Creates a value of 'GceClusterConfigMetadata' with the minimum fields required to make a request.
1747+-- Use one of the following lenses to modify other fields as desired:
1749+-- * 'gccmAddtional'
1750+gceClusterConfigMetadata
1751+ :: HashMap Text Text -- ^ 'gccmAddtional'
1752+ -> GceClusterConfigMetadata
1753+gceClusterConfigMetadata pGccmAddtional_ =
1754+ GceClusterConfigMetadata
1755+ { _gccmAddtional = _Coerce # pGccmAddtional_
1758+gccmAddtional :: Lens' GceClusterConfigMetadata (HashMap Text Text)
1760+ = lens _gccmAddtional
1761+ (\ s a -> s{_gccmAddtional = a})
1764+instance FromJSON GceClusterConfigMetadata where
1766+ = withObject "GceClusterConfigMetadata"
1768+ GceClusterConfigMetadata <$> (parseJSONObject o))
1770+instance ToJSON GceClusterConfigMetadata where
1771+ toJSON = toJSON . _gccmAddtional
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.
1779+-- /See:/ 'hiveJobProperties' smart constructor.
1780+newtype HiveJobProperties = HiveJobProperties
1781+ { _hAddtional :: HashMap Text Text
1782+ } deriving (Eq,Show,Data,Typeable,Generic)
1784+-- | Creates a value of 'HiveJobProperties' with the minimum fields required to make a request.
1786+-- Use one of the following lenses to modify other fields as desired:
1790+ :: HashMap Text Text -- ^ 'hAddtional'
1791+ -> HiveJobProperties
1792+hiveJobProperties pHAddtional_ =
1794+ { _hAddtional = _Coerce # pHAddtional_
1797+hAddtional :: Lens' HiveJobProperties (HashMap Text Text)
1799+ = lens _hAddtional (\ s a -> s{_hAddtional = a}) .
1802+instance FromJSON HiveJobProperties where
1804+ = withObject "HiveJobProperties"
1805+ (\ o -> HiveJobProperties <$> (parseJSONObject o))
1807+instance ToJSON HiveJobProperties where
1808+ toJSON = toJSON . _hAddtional
1810+-- | Media resource.
1812+-- /See:/ 'media' smart constructor.
1813+newtype Media = Media
1814+ { _mResourceName :: Maybe Text
1815+ } deriving (Eq,Show,Data,Typeable,Generic)
1817+-- | Creates a value of 'Media' with the minimum fields required to make a request.
1819+-- Use one of the following lenses to modify other fields as desired:
1821+-- * 'mResourceName'
1826+ { _mResourceName = Nothing
1829+-- | Name of the media resource.
1830+mResourceName :: Lens' Media (Maybe Text)
1832+ = lens _mResourceName
1833+ (\ s a -> s{_mResourceName = a})
1835+instance FromJSON Media where
1837+ = withObject "Media"
1838+ (\ o -> Media <$> (o .:? "resourceName"))
1840+instance ToJSON Media where
1843+ (catMaybes [("resourceName" .=) <$> _mResourceName])
1845+-- | The location where output from diagnostic command can be found.
1847+-- /See:/ 'diagnoseClusterOutputLocation' smart constructor.
1848+newtype DiagnoseClusterOutputLocation = DiagnoseClusterOutputLocation
1849+ { _dcolOutputURI :: Maybe Text
1850+ } deriving (Eq,Show,Data,Typeable,Generic)
1852+-- | Creates a value of 'DiagnoseClusterOutputLocation' with the minimum fields required to make a request.
1854+-- Use one of the following lenses to modify other fields as desired:
1856+-- * 'dcolOutputURI'
1857+diagnoseClusterOutputLocation
1858+ :: DiagnoseClusterOutputLocation
1859+diagnoseClusterOutputLocation =
1860+ DiagnoseClusterOutputLocation
1861+ { _dcolOutputURI = Nothing
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)
1868+ = lens _dcolOutputURI
1869+ (\ s a -> s{_dcolOutputURI = a})
1871+instance FromJSON DiagnoseClusterOutputLocation where
1873+ = withObject "DiagnoseClusterOutputLocation"
1875+ DiagnoseClusterOutputLocation <$>
1876+ (o .:? "outputUri"))
1878+instance ToJSON DiagnoseClusterOutputLocation where
1879+ toJSON DiagnoseClusterOutputLocation{..}
1881+ (catMaybes [("outputUri" .=) <$> _dcolOutputURI])
1883+-- | A Cloud Dataproc job resource.
1885+-- /See:/ 'job' smart constructor.
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)
1901+-- | Creates a value of 'Job' with the minimum fields required to make a request.
1903+-- Use one of the following lenses to modify other fields as desired:
1909+-- * 'jDriverControlFilesURI'
1921+-- * 'jDriverOutputResourceURI'
1923+-- * 'jStatusHistory'
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
1946+-- | Job is a Spark job.
1947+jSparkJob :: Lens' Job (Maybe SparkJob)
1949+ = lens _jSparkJob (\ s a -> s{_jSparkJob = a})
1951+-- | [Output-only] The job status. Additional application-specific status
1952+-- information may be contained in the type_job and yarn_applications
1954+jStatus :: Lens' Job (Maybe JobStatus)
1955+jStatus = lens _jStatus (\ s a -> s{_jStatus = a})
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})
1966+-- | Job is a Hive job.
1967+jHiveJob :: Lens' Job (Maybe HiveJob)
1968+jHiveJob = lens _jHiveJob (\ s a -> s{_jHiveJob = a})
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)
1975+ = lens _jReference (\ s a -> s{_jReference = a})
1977+-- | Job is a SparkSql job.
1978+jSparkSQLJob :: Lens' Job (Maybe SparkSQLJob)
1980+ = lens _jSparkSQLJob (\ s a -> s{_jSparkSQLJob = a})
1982+-- | Job is a Hadoop job.
1983+jHadoopJob :: Lens' Job (Maybe HadoopJob)
1985+ = lens _jHadoopJob (\ s a -> s{_jHadoopJob = a})
1987+-- | Job is a Pyspark job.
1988+jPysparkJob :: Lens' Job (Maybe PySparkJob)
1990+ = lens _jPysparkJob (\ s a -> s{_jPysparkJob = a})
1992+-- | [Output-only] A URI pointing to the location of the stdout of the job\'s
1994+jDriverOutputResourceURI :: Lens' Job (Maybe Text)
1995+jDriverOutputResourceURI
1996+ = lens _jDriverOutputResourceURI
1997+ (\ s a -> s{_jDriverOutputResourceURI = a})
1999+-- | [Output-only] The previous job status.
2000+jStatusHistory :: Lens' Job [JobStatus]
2002+ = lens _jStatusHistory
2003+ (\ s a -> s{_jStatusHistory = a})
2007+-- | [Required] Job information, including how, when, and where to run the
2009+jPlacement :: Lens' Job (Maybe JobPlacement)
2011+ = lens _jPlacement (\ s a -> s{_jPlacement = a})
2013+-- | Job is a Pig job.
2014+jPigJob :: Lens' Job (Maybe PigJob)
2015+jPigJob = lens _jPigJob (\ s a -> s{_jPigJob = a})
2017+instance FromJSON Job where
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"))
2034+instance ToJSON Job where
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])
2053+-- | A request to collect cluster diagnostic information.
2055+-- /See:/ 'diagnoseClusterRequest' smart constructor.
2056+data DiagnoseClusterRequest =
2057+ DiagnoseClusterRequest
2058+ deriving (Eq,Show,Data,Typeable,Generic)
2060+-- | Creates a value of 'DiagnoseClusterRequest' with the minimum fields required to make a request.
2062+diagnoseClusterRequest
2063+ :: DiagnoseClusterRequest
2064+diagnoseClusterRequest = DiagnoseClusterRequest
2066+instance FromJSON DiagnoseClusterRequest where
2068+ = withObject "DiagnoseClusterRequest"
2069+ (\ o -> pure DiagnoseClusterRequest)
2071+instance ToJSON DiagnoseClusterRequest where
2072+ toJSON = const emptyObject
2074+-- | A Cloud Dataproc job for running Hadoop MapReduce jobs on YARN.
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)
2088+-- | Creates a value of 'HadoopJob' with the minimum fields required to make a request.
2090+-- Use one of the following lenses to modify other fields as desired:
2094+-- * 'hMainJarFileURI'
2104+-- * 'hLoggingConfig'
2112+ , _hMainJarFileURI = Nothing
2113+ , _hJarFileURIs = Nothing
2114+ , _hFileURIs = Nothing
2115+ , _hArchiveURIs = Nothing
2116+ , _hMainClass = Nothing
2117+ , _hLoggingConfig = Nothing
2118+ , _hProperties = Nothing
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
2125+hArgs :: Lens' HadoopJob [Text]
2127+ = lens _hArgs (\ s a -> s{_hArgs = a}) . _Default .
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)
2136+ = lens _hMainJarFileURI
2137+ (\ s a -> s{_hMainJarFileURI = a})
2139+-- | [Optional] Jar file URIs to add to the CLASSPATHs of the Hadoop driver
2141+hJarFileURIs :: Lens' HadoopJob [Text]
2143+ = lens _hJarFileURIs (\ s a -> s{_hJarFileURIs = a})
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]
2152+ = lens _hFileURIs (\ s a -> s{_hFileURIs = a}) .
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]
2161+ = lens _hArchiveURIs (\ s a -> s{_hArchiveURIs = a})
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)
2169+ = lens _hMainClass (\ s a -> s{_hMainClass = a})
2171+-- | [Optional] The runtime log config for job execution.
2172+hLoggingConfig :: Lens' HadoopJob (Maybe LoggingConfig)
2174+ = lens _hLoggingConfig
2175+ (\ s a -> s{_hLoggingConfig = a})
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)
2183+ = lens _hProperties (\ s a -> s{_hProperties = a})
2185+instance FromJSON HadoopJob where
2187+ = withObject "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"))
2199+instance ToJSON HadoopJob where
2200+ toJSON HadoopJob{..}
2203+ [("args" .=) <$> _hArgs,
2204+ ("mainJarFileUri" .=) <$> _hMainJarFileURI,
2205+ ("jarFileUris" .=) <$> _hJarFileURIs,
2206+ ("fileUris" .=) <$> _hFileURIs,
2207+ ("archiveUris" .=) <$> _hArchiveURIs,
2208+ ("mainClass" .=) <$> _hMainClass,
2209+ ("loggingConfig" .=) <$> _hLoggingConfig,
2210+ ("properties" .=) <$> _hProperties])
2212+-- | Metadata describing the operation.
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)
2224+-- | Creates a value of 'ClusterOperationMetadata' with the minimum fields required to make a request.
2226+-- Use one of the following lenses to modify other fields as desired:
2230+-- * 'comClusterUuid'
2232+-- * 'comClusterName'
2234+-- * 'comOperationType'
2236+-- * 'comStatusHistory'
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
2251+-- | [Output-only] Current operation status.
2252+comStatus :: Lens' ClusterOperationMetadata (Maybe ClusterOperationStatus)
2254+ = lens _comStatus (\ s a -> s{_comStatus = a})
2256+-- | Cluster UUId for the operation.
2257+comClusterUuid :: Lens' ClusterOperationMetadata (Maybe Text)
2259+ = lens _comClusterUuid
2260+ (\ s a -> s{_comClusterUuid = a})
2262+-- | Name of the cluster for the operation.
2263+comClusterName :: Lens' ClusterOperationMetadata (Maybe Text)
2265+ = lens _comClusterName
2266+ (\ s a -> s{_comClusterName = a})
2268+-- | [Output-only] The operation type.
2269+comOperationType :: Lens' ClusterOperationMetadata (Maybe Text)
2271+ = lens _comOperationType
2272+ (\ s a -> s{_comOperationType = a})
2274+-- | [Output-only] The previous operation status.
2275+comStatusHistory :: Lens' ClusterOperationMetadata [ClusterOperationStatus]
2277+ = lens _comStatusHistory
2278+ (\ s a -> s{_comStatusHistory = a})
2282+-- | [Output-only] Short description of operation.
2283+comDescription :: Lens' ClusterOperationMetadata (Maybe Text)
2285+ = lens _comDescription
2286+ (\ s a -> s{_comDescription = a})
2288+instance FromJSON ClusterOperationMetadata where
2290+ = withObject "ClusterOperationMetadata"
2292+ ClusterOperationMetadata <$>
2293+ (o .:? "status") <*> (o .:? "clusterUuid") <*>
2294+ (o .:? "clusterName")
2295+ <*> (o .:? "operationType")
2296+ <*> (o .:? "statusHistory" .!= mempty)
2297+ <*> (o .:? "description"))
2299+instance ToJSON ClusterOperationMetadata where
2300+ toJSON ClusterOperationMetadata{..}
2303+ [("status" .=) <$> _comStatus,
2304+ ("clusterUuid" .=) <$> _comClusterUuid,
2305+ ("clusterName" .=) <$> _comClusterName,
2306+ ("operationType" .=) <$> _comOperationType,
2307+ ("statusHistory" .=) <$> _comStatusHistory,
2308+ ("description" .=) <$> _comDescription])
2310+-- | A Cloud Dataproc job for running Spark SQL queries.
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)
2322+-- | Creates a value of 'SparkSQLJob' with the minimum fields required to make a request.
2324+-- Use one of the following lenses to modify other fields as desired:
2326+-- * 'ssqljQueryFileURI'
2328+-- * 'ssqljJarFileURIs'
2330+-- * 'ssqljScriptVariables'
2332+-- * 'ssqljQueryList'
2334+-- * 'ssqljLoggingConfig'
2336+-- * 'ssqljProperties'
2341+ { _ssqljQueryFileURI = Nothing
2342+ , _ssqljJarFileURIs = Nothing
2343+ , _ssqljScriptVariables = Nothing
2344+ , _ssqljQueryList = Nothing
2345+ , _ssqljLoggingConfig = Nothing
2346+ , _ssqljProperties = Nothing
2349+-- | The HCFS URI of the script that contains SQL queries.
2350+ssqljQueryFileURI :: Lens' SparkSQLJob (Maybe Text)
2352+ = lens _ssqljQueryFileURI
2353+ (\ s a -> s{_ssqljQueryFileURI = a})
2355+-- | [Optional] HCFS URIs of jar files to be added to the Spark CLASSPATH.
2356+ssqljJarFileURIs :: Lens' SparkSQLJob [Text]
2358+ = lens _ssqljJarFileURIs
2359+ (\ s a -> s{_ssqljJarFileURIs = a})
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})
2370+-- | A list of queries.
2371+ssqljQueryList :: Lens' SparkSQLJob (Maybe QueryList)
2373+ = lens _ssqljQueryList
2374+ (\ s a -> s{_ssqljQueryList = a})
2376+-- | [Optional] The runtime log config for job execution.
2377+ssqljLoggingConfig :: Lens' SparkSQLJob (Maybe LoggingConfig)
2379+ = lens _ssqljLoggingConfig
2380+ (\ s a -> s{_ssqljLoggingConfig = a})
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)
2387+ = lens _ssqljProperties
2388+ (\ s a -> s{_ssqljProperties = a})
2390+instance FromJSON SparkSQLJob where
2392+ = withObject "SparkSQLJob"
2395+ (o .:? "queryFileUri") <*>
2396+ (o .:? "jarFileUris" .!= mempty)
2397+ <*> (o .:? "scriptVariables")
2398+ <*> (o .:? "queryList")
2399+ <*> (o .:? "loggingConfig")
2400+ <*> (o .:? "properties"))
2402+instance ToJSON SparkSQLJob where
2403+ toJSON SparkSQLJob{..}
2406+ [("queryFileUri" .=) <$> _ssqljQueryFileURI,
2407+ ("jarFileUris" .=) <$> _ssqljJarFileURIs,
2408+ ("scriptVariables" .=) <$> _ssqljScriptVariables,
2409+ ("queryList" .=) <$> _ssqljQueryList,
2410+ ("loggingConfig" .=) <$> _ssqljLoggingConfig,
2411+ ("properties" .=) <$> _ssqljProperties])
2413+-- | Specifies the selection and config of software inside the cluster.
2415+-- /See:/ 'softwareConfig' smart constructor.
2416+data SoftwareConfig = SoftwareConfig
2417+ { _scImageVersion :: !(Maybe Text)
2418+ , _scProperties :: !(Maybe SoftwareConfigProperties)
2419+ } deriving (Eq,Show,Data,Typeable,Generic)
2421+-- | Creates a value of 'SoftwareConfig' with the minimum fields required to make a request.
2423+-- Use one of the following lenses to modify other fields as desired:
2425+-- * 'scImageVersion'
2432+ { _scImageVersion = Nothing
2433+ , _scProperties = Nothing
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)
2442+ = lens _scImageVersion
2443+ (\ s a -> s{_scImageVersion = a})
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)
2453+ = lens _scProperties (\ s a -> s{_scProperties = a})
2455+instance FromJSON SoftwareConfig where
2457+ = withObject "SoftwareConfig"
2460+ (o .:? "imageVersion") <*> (o .:? "properties"))
2462+instance ToJSON SoftwareConfig where
2463+ toJSON SoftwareConfig{..}
2466+ [("imageVersion" .=) <$> _scImageVersion,
2467+ ("properties" .=) <$> _scProperties])
2469+-- | A list of jobs in a project.
2471+-- /See:/ 'listJobsResponse' smart constructor.
2472+data ListJobsResponse = ListJobsResponse
2473+ { _ljrNextPageToken :: !(Maybe Text)
2474+ , _ljrJobs :: !(Maybe [Job])
2475+ } deriving (Eq,Show,Data,Typeable,Generic)
2477+-- | Creates a value of 'ListJobsResponse' with the minimum fields required to make a request.
2479+-- Use one of the following lenses to modify other fields as desired:
2481+-- * 'ljrNextPageToken'
2485+ :: ListJobsResponse
2488+ { _ljrNextPageToken = Nothing
2489+ , _ljrJobs = Nothing
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)
2497+ = lens _ljrNextPageToken
2498+ (\ s a -> s{_ljrNextPageToken = a})
2500+-- | [Output-only] Jobs list.
2501+ljrJobs :: Lens' ListJobsResponse [Job]
2503+ = lens _ljrJobs (\ s a -> s{_ljrJobs = a}) . _Default
2506+instance FromJSON ListJobsResponse where
2508+ = withObject "ListJobsResponse"
2510+ ListJobsResponse <$>
2511+ (o .:? "nextPageToken") <*>
2512+ (o .:? "jobs" .!= mempty))
2514+instance ToJSON ListJobsResponse where
2515+ toJSON ListJobsResponse{..}
2518+ [("nextPageToken" .=) <$> _ljrNextPageToken,
2519+ ("jobs" .=) <$> _ljrJobs])
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.
2526+-- /See:/ 'sparkJobProperties' smart constructor.
2527+newtype SparkJobProperties = SparkJobProperties
2528+ { _sjpAddtional :: HashMap Text Text
2529+ } deriving (Eq,Show,Data,Typeable,Generic)
2531+-- | Creates a value of 'SparkJobProperties' with the minimum fields required to make a request.
2533+-- Use one of the following lenses to modify other fields as desired:
2537+ :: HashMap Text Text -- ^ 'sjpAddtional'
2538+ -> SparkJobProperties
2539+sparkJobProperties pSjpAddtional_ =
2541+ { _sjpAddtional = _Coerce # pSjpAddtional_
2544+sjpAddtional :: Lens' SparkJobProperties (HashMap Text Text)
2546+ = lens _sjpAddtional (\ s a -> s{_sjpAddtional = a})
2549+instance FromJSON SparkJobProperties where
2551+ = withObject "SparkJobProperties"
2552+ (\ o -> SparkJobProperties <$> (parseJSONObject o))
2554+instance ToJSON SparkJobProperties where
2555+ toJSON = toJSON . _sjpAddtional
2557+-- | A Cloud Dataproc job for running PySpark applications on YARN.
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)
2571+-- | Creates a value of 'PySparkJob' with the minimum fields required to make a request.
2573+-- Use one of the following lenses to modify other fields as desired:
2575+-- * 'psjPythonFileURIs'
2577+-- * 'psjMainPythonFileURI'
2581+-- * 'psjJarFileURIs'
2585+-- * 'psjArchiveURIs'
2587+-- * 'psjLoggingConfig'
2589+-- * 'psjProperties'
2594+ { _psjPythonFileURIs = Nothing
2595+ , _psjMainPythonFileURI = Nothing
2596+ , _psjArgs = Nothing
2597+ , _psjJarFileURIs = Nothing
2598+ , _psjFileURIs = Nothing
2599+ , _psjArchiveURIs = Nothing
2600+ , _psjLoggingConfig = Nothing
2601+ , _psjProperties = Nothing
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]
2608+ = lens _psjPythonFileURIs
2609+ (\ s a -> s{_psjPythonFileURIs = a})
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})
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]
2625+ = lens _psjArgs (\ s a -> s{_psjArgs = a}) . _Default
2628+-- | [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the Python
2629+-- driver and tasks.
2630+psjJarFileURIs :: Lens' PySparkJob [Text]
2632+ = lens _psjJarFileURIs
2633+ (\ s a -> s{_psjJarFileURIs = a})
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]
2641+ = lens _psjFileURIs (\ s a -> s{_psjFileURIs = a}) .
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]
2649+ = lens _psjArchiveURIs
2650+ (\ s a -> s{_psjArchiveURIs = a})
2654+-- | [Optional] The runtime log config for job execution.
2655+psjLoggingConfig :: Lens' PySparkJob (Maybe LoggingConfig)
2657+ = lens _psjLoggingConfig
2658+ (\ s a -> s{_psjLoggingConfig = a})
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)
2666+ = lens _psjProperties
2667+ (\ s a -> s{_psjProperties = a})
2669+instance FromJSON PySparkJob where
2671+ = withObject "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"))
2683+instance ToJSON PySparkJob where
2684+ toJSON PySparkJob{..}
2687+ [("pythonFileUris" .=) <$> _psjPythonFileURIs,
2688+ ("mainPythonFileUri" .=) <$> _psjMainPythonFileURI,
2689+ ("args" .=) <$> _psjArgs,
2690+ ("jarFileUris" .=) <$> _psjJarFileURIs,
2691+ ("fileUris" .=) <$> _psjFileURIs,
2692+ ("archiveUris" .=) <$> _psjArchiveURIs,
2693+ ("loggingConfig" .=) <$> _psjLoggingConfig,
2694+ ("properties" .=) <$> _psjProperties])
2696+-- | Specifies the resources used to actively manage an instance group.
2698+-- /See:/ 'managedGroupConfig' smart constructor.
2699+data ManagedGroupConfig = ManagedGroupConfig
2700+ { _mgcInstanceTemplateName :: !(Maybe Text)
2701+ , _mgcInstanceGroupManagerName :: !(Maybe Text)
2702+ } deriving (Eq,Show,Data,Typeable,Generic)
2704+-- | Creates a value of 'ManagedGroupConfig' with the minimum fields required to make a request.
2706+-- Use one of the following lenses to modify other fields as desired:
2708+-- * 'mgcInstanceTemplateName'
2710+-- * 'mgcInstanceGroupManagerName'
2712+ :: ManagedGroupConfig
2713+managedGroupConfig =
2715+ { _mgcInstanceTemplateName = Nothing
2716+ , _mgcInstanceGroupManagerName = Nothing
2719+-- | [Output-only] The name of the Instance Template used for the Managed
2721+mgcInstanceTemplateName :: Lens' ManagedGroupConfig (Maybe Text)
2722+mgcInstanceTemplateName
2723+ = lens _mgcInstanceTemplateName
2724+ (\ s a -> s{_mgcInstanceTemplateName = a})
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})
2732+instance FromJSON ManagedGroupConfig where
2734+ = withObject "ManagedGroupConfig"
2736+ ManagedGroupConfig <$>
2737+ (o .:? "instanceTemplateName") <*>
2738+ (o .:? "instanceGroupManagerName"))
2740+instance ToJSON ManagedGroupConfig where
2741+ toJSON ManagedGroupConfig{..}
2744+ [("instanceTemplateName" .=) <$>
2745+ _mgcInstanceTemplateName,
2746+ ("instanceGroupManagerName" .=) <$>
2747+ _mgcInstanceGroupManagerName])
2749+-- | The list of all clusters in a project.
2751+-- /See:/ 'listClustersResponse' smart constructor.
2752+data ListClustersResponse = ListClustersResponse
2753+ { _lcrNextPageToken :: !(Maybe Text)
2754+ , _lcrClusters :: !(Maybe [Cluster])
2755+ } deriving (Eq,Show,Data,Typeable,Generic)
2757+-- | Creates a value of 'ListClustersResponse' with the minimum fields required to make a request.
2759+-- Use one of the following lenses to modify other fields as desired:
2761+-- * 'lcrNextPageToken'
2764+listClustersResponse
2765+ :: ListClustersResponse
2766+listClustersResponse =
2767+ ListClustersResponse
2768+ { _lcrNextPageToken = Nothing
2769+ , _lcrClusters = Nothing
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)
2777+ = lens _lcrNextPageToken
2778+ (\ s a -> s{_lcrNextPageToken = a})
2780+-- | [Output-only] The clusters in the project.
2781+lcrClusters :: Lens' ListClustersResponse [Cluster]
2783+ = lens _lcrClusters (\ s a -> s{_lcrClusters = a}) .
2787+instance FromJSON ListClustersResponse where
2789+ = withObject "ListClustersResponse"
2791+ ListClustersResponse <$>
2792+ (o .:? "nextPageToken") <*>
2793+ (o .:? "clusters" .!= mempty))
2795+instance ToJSON ListClustersResponse where
2796+ toJSON ListClustersResponse{..}
2799+ [("nextPageToken" .=) <$> _lcrNextPageToken,
2800+ ("clusters" .=) <$> _lcrClusters])
2802+-- | A request to cancel a job.
2804+-- /See:/ 'cancelJobRequest' smart constructor.
2805+data CancelJobRequest =
2807+ deriving (Eq,Show,Data,Typeable,Generic)
2809+-- | Creates a value of 'CancelJobRequest' with the minimum fields required to make a request.
2812+ :: CancelJobRequest
2813+cancelJobRequest = CancelJobRequest
2815+instance FromJSON CancelJobRequest where
2817+ = withObject "CancelJobRequest"
2818+ (\ o -> pure CancelJobRequest)
2820+instance ToJSON CancelJobRequest where
2821+ toJSON = const emptyObject
2823+-- | A list of queries to run on a cluster.
2825+-- /See:/ 'queryList' smart constructor.
2826+newtype QueryList = QueryList
2827+ { _qlQueries :: Maybe [Text]
2828+ } deriving (Eq,Show,Data,Typeable,Generic)
2830+-- | Creates a value of 'QueryList' with the minimum fields required to make a request.
2832+-- Use one of the following lenses to modify other fields as desired:
2839+ { _qlQueries = Nothing
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]
2850+ = lens _qlQueries (\ s a -> s{_qlQueries = a}) .
2854+instance FromJSON QueryList where
2856+ = withObject "QueryList"
2857+ (\ o -> QueryList <$> (o .:? "queries" .!= mempty))
2859+instance ToJSON QueryList where
2860+ toJSON QueryList{..}
2861+ = object (catMaybes [("queries" .=) <$> _qlQueries])
2863+-- | Metadata describing the operation.
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)
2881+-- | Creates a value of 'OperationMetadata' with the minimum fields required to make a request.
2883+-- Use one of the following lenses to modify other fields as desired:
2889+-- * 'omClusterUuid'
2901+-- * 'omClusterName'
2903+-- * 'omOperationType'
2905+-- * 'omStatusHistory'
2907+-- * 'omDescription'
2909+ :: 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
2926+-- | [Output-only] Current operation status.
2927+omStatus :: Lens' OperationMetadata (Maybe OperationStatus)
2928+omStatus = lens _omStatus (\ s a -> s{_omStatus = a})
2930+-- | A message containing the operation state.
2931+omState :: Lens' OperationMetadata (Maybe Text)
2932+omState = lens _omState (\ s a -> s{_omState = a})
2934+-- | Cluster UUId for the operation.
2935+omClusterUuid :: Lens' OperationMetadata (Maybe Text)
2937+ = lens _omClusterUuid
2938+ (\ s a -> s{_omClusterUuid = a})
2940+-- | The time that the operation was requested.
2941+omInsertTime :: Lens' OperationMetadata (Maybe Text)
2943+ = lens _omInsertTime (\ s a -> s{_omInsertTime = a})
2945+-- | The time that the operation was started by the server.
2946+omStartTime :: Lens' OperationMetadata (Maybe Text)
2948+ = lens _omStartTime (\ s a -> s{_omStartTime = a})
2950+-- | A message containing the detailed operation state.
2951+omInnerState :: Lens' OperationMetadata (Maybe Text)
2953+ = lens _omInnerState (\ s a -> s{_omInnerState = a})
2955+-- | The time that the operation completed.
2956+omEndTime :: Lens' OperationMetadata (Maybe Text)
2958+ = lens _omEndTime (\ s a -> s{_omEndTime = a})
2960+-- | A message containing any operation metadata details.
2961+omDetails :: Lens' OperationMetadata (Maybe Text)
2963+ = lens _omDetails (\ s a -> s{_omDetails = a})
2965+-- | Name of the cluster for the operation.
2966+omClusterName :: Lens' OperationMetadata (Maybe Text)
2968+ = lens _omClusterName
2969+ (\ s a -> s{_omClusterName = a})
2971+-- | [Output-only] The operation type.
2972+omOperationType :: Lens' OperationMetadata (Maybe Text)
2974+ = lens _omOperationType
2975+ (\ s a -> s{_omOperationType = a})
2977+-- | [Output-only] Previous operation status.
2978+omStatusHistory :: Lens' OperationMetadata [OperationStatus]
2980+ = lens _omStatusHistory
2981+ (\ s a -> s{_omStatusHistory = a})
2985+-- | [Output-only] Short description of operation.
2986+omDescription :: Lens' OperationMetadata (Maybe Text)
2988+ = lens _omDescription
2989+ (\ s a -> s{_omDescription = a})
2991+instance FromJSON OperationMetadata where
2993+ = withObject "OperationMetadata"
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"))
3008+instance ToJSON OperationMetadata where
3009+ toJSON OperationMetadata{..}
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])
3025+-- | Cloud Dataproc job status.
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)
3034+-- | Creates a value of 'JobStatus' with the minimum fields required to make a request.
3036+-- Use one of the following lenses to modify other fields as desired:
3040+-- * 'jsStateStartTime'
3047+ { _jsState = Nothing
3048+ , _jsStateStartTime = Nothing
3049+ , _jsDetails = Nothing
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})
3056+-- | [Output-only] The time when this state was entered.
3057+jsStateStartTime :: Lens' JobStatus (Maybe Text)
3059+ = lens _jsStateStartTime
3060+ (\ s a -> s{_jsStateStartTime = a})
3062+-- | [Optional] Job state details, such as an error description if the state
3064+jsDetails :: Lens' JobStatus (Maybe Text)
3066+ = lens _jsDetails (\ s a -> s{_jsDetails = a})
3068+instance FromJSON JobStatus where
3070+ = withObject "JobStatus"
3073+ (o .:? "state") <*> (o .:? "stateStartTime") <*>
3076+instance ToJSON JobStatus where
3077+ toJSON JobStatus{..}
3080+ [("state" .=) <$> _jsState,
3081+ ("stateStartTime" .=) <$> _jsStateStartTime,
3082+ ("details" .=) <$> _jsDetails])
3084+-- | [Optional] Mapping of query variable names to values (equivalent to the
3085+-- Pig command: \`name=[value]\`).
3087+-- /See:/ 'pigJobScriptVariables' smart constructor.
3088+newtype PigJobScriptVariables = PigJobScriptVariables
3089+ { _pjsvAddtional :: HashMap Text Text
3090+ } deriving (Eq,Show,Data,Typeable,Generic)
3092+-- | Creates a value of 'PigJobScriptVariables' with the minimum fields required to make a request.
3094+-- Use one of the following lenses to modify other fields as desired:
3096+-- * 'pjsvAddtional'
3097+pigJobScriptVariables
3098+ :: HashMap Text Text -- ^ 'pjsvAddtional'
3099+ -> PigJobScriptVariables
3100+pigJobScriptVariables pPjsvAddtional_ =
3101+ PigJobScriptVariables
3102+ { _pjsvAddtional = _Coerce # pPjsvAddtional_
3105+pjsvAddtional :: Lens' PigJobScriptVariables (HashMap Text Text)
3107+ = lens _pjsvAddtional
3108+ (\ s a -> s{_pjsvAddtional = a})
3111+instance FromJSON PigJobScriptVariables where
3113+ = withObject "PigJobScriptVariables"
3115+ PigJobScriptVariables <$> (parseJSONObject o))
3117+instance ToJSON PigJobScriptVariables where
3118+ toJSON = toJSON . _pjsvAddtional
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\`.
3129+-- /See:/ 'operationResponse' smart constructor.
3130+newtype OperationResponse = OperationResponse
3131+ { _orAddtional :: HashMap Text JSONValue
3132+ } deriving (Eq,Show,Data,Typeable,Generic)
3134+-- | Creates a value of 'OperationResponse' with the minimum fields required to make a request.
3136+-- Use one of the following lenses to modify other fields as desired:
3140+ :: HashMap Text JSONValue -- ^ 'orAddtional'
3141+ -> OperationResponse
3142+operationResponse pOrAddtional_ =
3144+ { _orAddtional = _Coerce # pOrAddtional_
3147+-- | Properties of the object. Contains field \'ype with type URL.
3148+orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
3150+ = lens _orAddtional (\ s a -> s{_orAddtional = a}) .
3153+instance FromJSON OperationResponse where
3155+ = withObject "OperationResponse"
3156+ (\ o -> OperationResponse <$> (parseJSONObject o))
3158+instance ToJSON OperationResponse where
3159+ toJSON = toJSON . _orAddtional
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\'
3165+-- /See:/ 'loggingConfigDriverLogLevels' smart constructor.
3166+newtype LoggingConfigDriverLogLevels = LoggingConfigDriverLogLevels
3167+ { _lcdllAddtional :: HashMap Text Text
3168+ } deriving (Eq,Show,Data,Typeable,Generic)
3170+-- | Creates a value of 'LoggingConfigDriverLogLevels' with the minimum fields required to make a request.
3172+-- Use one of the following lenses to modify other fields as desired:
3174+-- * 'lcdllAddtional'
3175+loggingConfigDriverLogLevels
3176+ :: HashMap Text Text -- ^ 'lcdllAddtional'
3177+ -> LoggingConfigDriverLogLevels
3178+loggingConfigDriverLogLevels pLcdllAddtional_ =
3179+ LoggingConfigDriverLogLevels
3180+ { _lcdllAddtional = _Coerce # pLcdllAddtional_
3183+lcdllAddtional :: Lens' LoggingConfigDriverLogLevels (HashMap Text Text)
3185+ = lens _lcdllAddtional
3186+ (\ s a -> s{_lcdllAddtional = a})
3189+instance FromJSON LoggingConfigDriverLogLevels where
3191+ = withObject "LoggingConfigDriverLogLevels"
3193+ LoggingConfigDriverLogLevels <$> (parseJSONObject o))
3195+instance ToJSON LoggingConfigDriverLogLevels where
3196+ toJSON = toJSON . _lcdllAddtional
3198+-- | The status of a cluster and its instances.
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)
3207+-- | Creates a value of 'ClusterStatus' with the minimum fields required to make a request.
3209+-- Use one of the following lenses to modify other fields as desired:
3213+-- * 'csStateStartTime'
3220+ { _csState = Nothing
3221+ , _csStateStartTime = Nothing
3222+ , _csDetail = Nothing
3225+-- | The cluster\'s state.
3226+csState :: Lens' ClusterStatus (Maybe Text)
3227+csState = lens _csState (\ s a -> s{_csState = a})
3229+-- | Time when this state was entered.
3230+csStateStartTime :: Lens' ClusterStatus (Maybe Text)
3232+ = lens _csStateStartTime
3233+ (\ s a -> s{_csStateStartTime = a})
3235+-- | Optional details of cluster\'s state.
3236+csDetail :: Lens' ClusterStatus (Maybe Text)
3237+csDetail = lens _csDetail (\ s a -> s{_csDetail = a})
3239+instance FromJSON ClusterStatus where
3241+ = withObject "ClusterStatus"
3244+ (o .:? "state") <*> (o .:? "stateStartTime") <*>
3247+instance ToJSON ClusterStatus where
3248+ toJSON ClusterStatus{..}
3251+ [("state" .=) <$> _csState,
3252+ ("stateStartTime" .=) <$> _csStateStartTime,
3253+ ("detail" .=) <$> _csDetail])
3255+-- | A Cloud Dataproc job for running Pig queries on YARN.
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)
3268+-- | Creates a value of 'PigJob' with the minimum fields required to make a request.
3270+-- Use one of the following lenses to modify other fields as desired:
3272+-- * 'pjQueryFileURI'
3274+-- * 'pjJarFileURIs'
3276+-- * 'pjScriptVariables'
3280+-- * 'pjContinueOnFailure'
3282+-- * 'pjLoggingConfig'
3289+ { _pjQueryFileURI = Nothing
3290+ , _pjJarFileURIs = Nothing
3291+ , _pjScriptVariables = Nothing
3292+ , _pjQueryList = Nothing
3293+ , _pjContinueOnFailure = Nothing
3294+ , _pjLoggingConfig = Nothing
3295+ , _pjProperties = Nothing
3298+-- | The HCFS URI of the script that contains the Pig queries.
3299+pjQueryFileURI :: Lens' PigJob (Maybe Text)
3301+ = lens _pjQueryFileURI
3302+ (\ s a -> s{_pjQueryFileURI = a})
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]
3308+ = lens _pjJarFileURIs
3309+ (\ s a -> s{_pjJarFileURIs = a})
3313+-- | [Optional] Mapping of query variable names to values (equivalent to the
3314+-- Pig command: \`name=[value]\`).
3315+pjScriptVariables :: Lens' PigJob (Maybe PigJobScriptVariables)
3317+ = lens _pjScriptVariables
3318+ (\ s a -> s{_pjScriptVariables = a})
3320+-- | A list of queries.
3321+pjQueryList :: Lens' PigJob (Maybe QueryList)
3323+ = lens _pjQueryList (\ s a -> s{_pjQueryList = a})
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)
3330+ = lens _pjContinueOnFailure
3331+ (\ s a -> s{_pjContinueOnFailure = a})
3333+-- | [Optional] The runtime log config for job execution.
3334+pjLoggingConfig :: Lens' PigJob (Maybe LoggingConfig)
3336+ = lens _pjLoggingConfig
3337+ (\ s a -> s{_pjLoggingConfig = a})
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)
3346+ = lens _pjProperties (\ s a -> s{_pjProperties = a})
3348+instance FromJSON PigJob where
3350+ = withObject "PigJob"
3353+ (o .:? "queryFileUri") <*>
3354+ (o .:? "jarFileUris" .!= mempty)
3355+ <*> (o .:? "scriptVariables")
3356+ <*> (o .:? "queryList")
3357+ <*> (o .:? "continueOnFailure")
3358+ <*> (o .:? "loggingConfig")
3359+ <*> (o .:? "properties"))
3361+instance ToJSON PigJob where
3365+ [("queryFileUri" .=) <$> _pjQueryFileURI,
3366+ ("jarFileUris" .=) <$> _pjJarFileURIs,
3367+ ("scriptVariables" .=) <$> _pjScriptVariables,
3368+ ("queryList" .=) <$> _pjQueryList,
3369+ ("continueOnFailure" .=) <$> _pjContinueOnFailure,
3370+ ("loggingConfig" .=) <$> _pjLoggingConfig,
3371+ ("properties" .=) <$> _pjProperties])
3373+-- | The runtime logging config of the job.
3375+-- /See:/ 'loggingConfig' smart constructor.
3376+newtype LoggingConfig = LoggingConfig
3377+ { _lcDriverLogLevels :: Maybe LoggingConfigDriverLogLevels
3378+ } deriving (Eq,Show,Data,Typeable,Generic)
3380+-- | Creates a value of 'LoggingConfig' with the minimum fields required to make a request.
3382+-- Use one of the following lenses to modify other fields as desired:
3384+-- * 'lcDriverLogLevels'
3389+ { _lcDriverLogLevels = Nothing
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)
3397+ = lens _lcDriverLogLevels
3398+ (\ s a -> s{_lcDriverLogLevels = a})
3400+instance FromJSON LoggingConfig where
3402+ = withObject "LoggingConfig"
3403+ (\ o -> LoggingConfig <$> (o .:? "driverLogLevels"))
3405+instance ToJSON LoggingConfig where
3406+ toJSON LoggingConfig{..}
3409+ [("driverLogLevels" .=) <$> _lcDriverLogLevels])