diff options
author | BrendanHay <> | 2016-06-21 04:13:00 (GMT) |
---|---|---|
committer | hdiff <hdiff@hdiff.luite.com> | 2016-06-21 04:13:00 (GMT) |
commit | 44db279026719962e435c51041fad2d4a45d0746 (patch) | |
tree | bda5a93b50a46ae8ce9c4677ea294c229f7800c0 | |
parent | a0c83449b2a6f2fff4043080fb06f4cc5ef40eb3 (diff) |
version 0.1.00.1.0
-rw-r--r-- | README.md | 6 | ||||
-rw-r--r-- | gen/Network/Google/Dataflow.hs | 101 | ||||
-rw-r--r-- | gen/Network/Google/Dataflow/Types.hs | 102 | ||||
-rw-r--r-- | gen/Network/Google/Dataflow/Types/Product.hs | 1710 | ||||
-rw-r--r-- | gen/Network/Google/Dataflow/Types/Sum.hs | 2 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/Create.hs | 11 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/Get.hs | 11 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/GetMetrics.hs | 11 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/List.hs | 33 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs | 11 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/Update.hs | 11 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/Lease.hs | 11 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/ReportStatus.hs | 11 | ||||
-rw-r--r-- | gen/Network/Google/Resource/Dataflow/Projects/WorkerMessages.hs | 187 | ||||
-rw-r--r-- | gogol-dataflow.cabal | 10 |
15 files changed, 1742 insertions, 486 deletions
@@ -8,7 +8,7 @@ ## Version -`0.0.1` +`0.1.0` ## Description @@ -18,9 +18,9 @@ A client library for the Google Dataflow. ## Contribute -For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/amazonka/issues). +For any problems, comments, or feedback please create an issue [here on GitHub](https://github.com/brendanhay/gogol/issues). -> _Note:_ this library is an auto-generated Haskell package. Please see `amazonka-gen` for more information. +> _Note:_ this library is an auto-generated Haskell package. Please see `gogol-gen` for more information. ## Licence diff --git a/gen/Network/Google/Dataflow.hs b/gen/Network/Google/Dataflow.hs index b1d49df..f50a02a 100644 --- a/gen/Network/Google/Dataflow.hs +++ b/gen/Network/Google/Dataflow.hs @@ -7,13 +7,14 @@ -- | -- Module : Network.Google.Dataflow --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- --- Google Dataflow API. +-- Develops and executes data processing patterns like ETL, batch +-- computation, and continuous computation. -- -- /See:/ <https://cloud.google.com/dataflow Google Dataflow API Reference> module Network.Google.Dataflow @@ -21,6 +22,10 @@ module Network.Google.Dataflow -- * Service Configuration dataflowService + -- * OAuth Scopes + , userInfoEmailScope + , cloudPlatformScope + -- * API Declaration , DataflowAPI @@ -50,6 +55,9 @@ module Network.Google.Dataflow -- ** dataflow.projects.jobs.workItems.reportStatus , module Network.Google.Resource.Dataflow.Projects.Jobs.WorkItems.ReportStatus + -- ** dataflow.projects.workerMessages + , module Network.Google.Resource.Dataflow.Projects.WorkerMessages + -- * Types -- ** JobExecutionInfoStages @@ -100,6 +108,14 @@ module Network.Google.Dataflow , wiConfiguration , wiSeqMapTask + -- ** WorkerHealthReport + , WorkerHealthReport + , workerHealthReport + , whrVMIsHealthy + , whrReportInterval + , whrPods + , whrVMStartupTime + -- ** SourceSplitOptions , SourceSplitOptions , sourceSplitOptions @@ -147,6 +163,11 @@ module Network.Google.Dataflow , sCodec , sSpec + -- ** WorkerHealthReportResponse + , WorkerHealthReportResponse + , workerHealthReportResponse + , whrrReportInterval + -- ** MetricStructuredName , MetricStructuredName , metricStructuredName @@ -234,6 +255,7 @@ module Network.Google.Dataflow -- ** WorkItemStatus , WorkItemStatus , workItemStatus + , wisReportedProgress , wisProgress , wisSourceOperationResponse , wisStopPosition @@ -246,11 +268,22 @@ module Network.Google.Dataflow , wisMetricUpdates , wisWorkItemId + -- ** WorkerMessageLabels + , WorkerMessageLabels + , workerMessageLabels + , wmlAddtional + -- ** FlattenInstruction , FlattenInstruction , flattenInstruction , fiInputs + -- ** WorkerMessageCode + , WorkerMessageCode + , workerMessageCode + , wmcParameters + , wmcCode + -- ** JobTransformNameMApping , JobTransformNameMApping , jobTransformNameMApping @@ -332,6 +365,12 @@ module Network.Google.Dataflow , statusDetailsItem , sdiAddtional + -- ** ReportedParallelism + , ReportedParallelism + , reportedParallelism + , rpValue + , rpIsInfinite + -- ** StepProperties , StepProperties , stepProperties @@ -341,9 +380,17 @@ module Network.Google.Dataflow , TopologyConfig , topologyConfig , tcDataDiskAssignments + , tcPersistentStateVersion + , tcForwardingKeyBits , tcUserStageToComputationNameMap , tcComputations + -- ** ApproximateSplitRequest + , ApproximateSplitRequest + , approximateSplitRequest + , asrFractionConsumed + , asrPosition + -- ** WorkerSettings , WorkerSettings , workerSettings @@ -365,6 +412,11 @@ module Network.Google.Dataflow , ddaVMInstance , ddaDataDisks + -- ** WorkerMessageResponse + , WorkerMessageResponse + , workerMessageResponse + , wmrWorkerHealthReportResponse + -- ** WorkItemServiceState , WorkItemServiceState , workItemServiceState @@ -374,6 +426,7 @@ module Network.Google.Dataflow , wissSuggestedStopPoint , wissSuggestedStopPosition , wissLeaseExpireTime + , wissSplitRequest -- ** StreamingSetupTask , StreamingSetupTask @@ -381,6 +434,7 @@ module Network.Google.Dataflow , sstStreamingComputationTopology , sstReceiveWorkPort , sstWorkerHarnessPort + , sstDrain -- ** PartialGroupByKeyInstructionInputElementCodec , PartialGroupByKeyInstructionInputElementCodec @@ -404,6 +458,11 @@ module Network.Google.Dataflow , sinkCodec , scAddtional + -- ** WorkerHealthReportPodsItem + , WorkerHealthReportPodsItem + , workerHealthReportPodsItem + , whrpiAddtional + -- ** ParDoInstructionUserFn , ParDoInstructionUserFn , parDoInstructionUserFn @@ -427,6 +486,11 @@ module Network.Google.Dataflow , workerPoolPoolArgs , wppaAddtional + -- ** SendWorkerMessagesResponse + , SendWorkerMessagesResponse + , sendWorkerMessagesResponse + , swmrWorkerMessageResponses + -- ** StreamingSideInputLocation , StreamingSideInputLocation , streamingSideInputLocation @@ -477,6 +541,7 @@ module Network.Google.Dataflow , jClientRequestId , jCurrentState , jReplacedByJobId + , jTempFiles , jSteps , jExecutionInfo , jName @@ -493,6 +558,14 @@ module Network.Google.Dataflow , readInstruction , riSource + -- ** ApproximateReportedProgress + , ApproximateReportedProgress + , approximateReportedProgress + , arpFractionConsumed + , arpConsumedParallelism + , arpRemainingParallelism + , arpPosition + -- ** SinkSpec , SinkSpec , sinkSpec @@ -502,6 +575,7 @@ module Network.Google.Dataflow , WorkerPool , workerPool , wpAutoscalingSettings + , wpNumThreadsPerWorker , wpDiskSizeGb , wpKind , wpTaskrunnerSettings @@ -511,12 +585,14 @@ module Network.Google.Dataflow , wpPackages , wpOnHostMaintenance , wpDiskSourceImage + , wpSubnetwork , wpMachineType , wpMetadata , wpDiskType , wpTeardownPolicy , wpDefaultPackageSet , wpPoolArgs + , wpWorkerHarnessContainerImage , wpDataDisks -- ** Step @@ -532,6 +608,11 @@ module Network.Google.Dataflow , pLocation , pName + -- ** WorkerMessageCodeParameters + , WorkerMessageCodeParameters + , workerMessageCodeParameters + , wmcpAddtional + -- ** DynamicSourceSplit , DynamicSourceSplit , dynamicSourceSplit @@ -579,6 +660,14 @@ module Network.Google.Dataflow , apPercentComplete , apPosition + -- ** WorkerMessage + , WorkerMessage + , workerMessage + , wmWorkerHealthReport + , wmTime + , wmWorkerMessageCode + , wmLabels + -- ** KeyRangeLocation , KeyRangeLocation , keyRangeLocation @@ -597,6 +686,7 @@ module Network.Google.Dataflow , PartialGroupByKeyInstruction , partialGroupByKeyInstruction , pgbkiValueCombiningFn + , pgbkiSideInputs , pgbkiInput , pgbkiInputElementCodec @@ -636,6 +726,11 @@ module Network.Google.Dataflow , sideInputInfoKind , siikAddtional + -- ** SendWorkerMessagesRequest + , SendWorkerMessagesRequest + , sendWorkerMessagesRequest + , swmrWorkerMessages + -- ** SourceSplitShard , SourceSplitShard , sourceSplitShard @@ -742,6 +837,7 @@ import Network.Google.Resource.Dataflow.Projects.Jobs.Messages.List import Network.Google.Resource.Dataflow.Projects.Jobs.Update import Network.Google.Resource.Dataflow.Projects.Jobs.WorkItems.Lease import Network.Google.Resource.Dataflow.Projects.Jobs.WorkItems.ReportStatus +import Network.Google.Resource.Dataflow.Projects.WorkerMessages {- $resources TODO @@ -757,3 +853,4 @@ type DataflowAPI = :<|> ProjectsJobsCreateResource :<|> ProjectsJobsUpdateResource :<|> ProjectsJobsGetMetricsResource + :<|> ProjectsWorkerMessagesResource diff --git a/gen/Network/Google/Dataflow/Types.hs b/gen/Network/Google/Dataflow/Types.hs index 852ee89..5b2a4f3 100644 --- a/gen/Network/Google/Dataflow/Types.hs +++ b/gen/Network/Google/Dataflow/Types.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE NoImplicitPrelude #-} @@ -7,7 +8,7 @@ -- | -- Module : Network.Google.Dataflow.Types --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -19,7 +20,7 @@ module Network.Google.Dataflow.Types dataflowService -- * OAuth Scopes - , userinfoEmailScope + , userInfoEmailScope , cloudPlatformScope -- * JobExecutionInfoStages @@ -70,6 +71,14 @@ module Network.Google.Dataflow.Types , wiConfiguration , wiSeqMapTask + -- * WorkerHealthReport + , WorkerHealthReport + , workerHealthReport + , whrVMIsHealthy + , whrReportInterval + , whrPods + , whrVMStartupTime + -- * SourceSplitOptions , SourceSplitOptions , sourceSplitOptions @@ -117,6 +126,11 @@ module Network.Google.Dataflow.Types , sCodec , sSpec + -- * WorkerHealthReportResponse + , WorkerHealthReportResponse + , workerHealthReportResponse + , whrrReportInterval + -- * MetricStructuredName , MetricStructuredName , metricStructuredName @@ -204,6 +218,7 @@ module Network.Google.Dataflow.Types -- * WorkItemStatus , WorkItemStatus , workItemStatus + , wisReportedProgress , wisProgress , wisSourceOperationResponse , wisStopPosition @@ -216,11 +231,22 @@ module Network.Google.Dataflow.Types , wisMetricUpdates , wisWorkItemId + -- * WorkerMessageLabels + , WorkerMessageLabels + , workerMessageLabels + , wmlAddtional + -- * FlattenInstruction , FlattenInstruction , flattenInstruction , fiInputs + -- * WorkerMessageCode + , WorkerMessageCode + , workerMessageCode + , wmcParameters + , wmcCode + -- * JobTransformNameMApping , JobTransformNameMApping , jobTransformNameMApping @@ -302,6 +328,12 @@ module Network.Google.Dataflow.Types , statusDetailsItem , sdiAddtional + -- * ReportedParallelism + , ReportedParallelism + , reportedParallelism + , rpValue + , rpIsInfinite + -- * StepProperties , StepProperties , stepProperties @@ -311,9 +343,17 @@ module Network.Google.Dataflow.Types , TopologyConfig , topologyConfig , tcDataDiskAssignments + , tcPersistentStateVersion + , tcForwardingKeyBits , tcUserStageToComputationNameMap , tcComputations + -- * ApproximateSplitRequest + , ApproximateSplitRequest + , approximateSplitRequest + , asrFractionConsumed + , asrPosition + -- * WorkerSettings , WorkerSettings , workerSettings @@ -335,6 +375,11 @@ module Network.Google.Dataflow.Types , ddaVMInstance , ddaDataDisks + -- * WorkerMessageResponse + , WorkerMessageResponse + , workerMessageResponse + , wmrWorkerHealthReportResponse + -- * WorkItemServiceState , WorkItemServiceState , workItemServiceState @@ -344,6 +389,7 @@ module Network.Google.Dataflow.Types , wissSuggestedStopPoint , wissSuggestedStopPosition , wissLeaseExpireTime + , wissSplitRequest -- * StreamingSetupTask , StreamingSetupTask @@ -351,6 +397,7 @@ module Network.Google.Dataflow.Types , sstStreamingComputationTopology , sstReceiveWorkPort , sstWorkerHarnessPort + , sstDrain -- * PartialGroupByKeyInstructionInputElementCodec , PartialGroupByKeyInstructionInputElementCodec @@ -374,6 +421,11 @@ module Network.Google.Dataflow.Types , sinkCodec , scAddtional + -- * WorkerHealthReportPodsItem + , WorkerHealthReportPodsItem + , workerHealthReportPodsItem + , whrpiAddtional + -- * ParDoInstructionUserFn , ParDoInstructionUserFn , parDoInstructionUserFn @@ -397,6 +449,11 @@ module Network.Google.Dataflow.Types , workerPoolPoolArgs , wppaAddtional + -- * SendWorkerMessagesResponse + , SendWorkerMessagesResponse + , sendWorkerMessagesResponse + , swmrWorkerMessageResponses + -- * StreamingSideInputLocation , StreamingSideInputLocation , streamingSideInputLocation @@ -447,6 +504,7 @@ module Network.Google.Dataflow.Types , jClientRequestId , jCurrentState , jReplacedByJobId + , jTempFiles , jSteps , jExecutionInfo , jName @@ -463,6 +521,14 @@ module Network.Google.Dataflow.Types , readInstruction , riSource + -- * ApproximateReportedProgress + , ApproximateReportedProgress + , approximateReportedProgress + , arpFractionConsumed + , arpConsumedParallelism + , arpRemainingParallelism + , arpPosition + -- * SinkSpec , SinkSpec , sinkSpec @@ -472,6 +538,7 @@ module Network.Google.Dataflow.Types , WorkerPool , workerPool , wpAutoscalingSettings + , wpNumThreadsPerWorker , wpDiskSizeGb , wpKind , wpTaskrunnerSettings @@ -481,12 +548,14 @@ module Network.Google.Dataflow.Types , wpPackages , wpOnHostMaintenance , wpDiskSourceImage + , wpSubnetwork , wpMachineType , wpMetadata , wpDiskType , wpTeardownPolicy , wpDefaultPackageSet , wpPoolArgs + , wpWorkerHarnessContainerImage , wpDataDisks -- * Step @@ -502,6 +571,11 @@ module Network.Google.Dataflow.Types , pLocation , pName + -- * WorkerMessageCodeParameters + , WorkerMessageCodeParameters + , workerMessageCodeParameters + , wmcpAddtional + -- * DynamicSourceSplit , DynamicSourceSplit , dynamicSourceSplit @@ -549,6 +623,14 @@ module Network.Google.Dataflow.Types , apPercentComplete , apPosition + -- * WorkerMessage + , WorkerMessage + , workerMessage + , wmWorkerHealthReport + , wmTime + , wmWorkerMessageCode + , wmLabels + -- * KeyRangeLocation , KeyRangeLocation , keyRangeLocation @@ -567,6 +649,7 @@ module Network.Google.Dataflow.Types , PartialGroupByKeyInstruction , partialGroupByKeyInstruction , pgbkiValueCombiningFn + , pgbkiSideInputs , pgbkiInput , pgbkiInputElementCodec @@ -606,6 +689,11 @@ module Network.Google.Dataflow.Types , sideInputInfoKind , siikAddtional + -- * SendWorkerMessagesRequest + , SendWorkerMessagesRequest + , sendWorkerMessagesRequest + , swmrWorkerMessages + -- * SourceSplitShard , SourceSplitShard , sourceSplitShard @@ -707,15 +795,15 @@ import Network.Google.Dataflow.Types.Sum import Network.Google.Prelude -- | Default request referring to version 'v1b3' of the Google Dataflow API. This contains the host and root path used as a starting point for constructing service requests. -dataflowService :: Service +dataflowService :: ServiceConfig dataflowService = defaultService (ServiceId "dataflow:v1b3") "dataflow.googleapis.com" -- | View your email address -userinfoEmailScope :: OAuthScope -userinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"; +userInfoEmailScope :: Proxy '["https://www.googleapis.com/auth/userinfo.email"] +userInfoEmailScope = Proxy; -- | View and manage your data across Google Cloud Platform services -cloudPlatformScope :: OAuthScope -cloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"; +cloudPlatformScope :: Proxy '["https://www.googleapis.com/auth/cloud-platform"] +cloudPlatformScope = Proxy; diff --git a/gen/Network/Google/Dataflow/Types/Product.hs b/gen/Network/Google/Dataflow/Types/Product.hs index 3e0fac0..efea034 100644 --- a/gen/Network/Google/Dataflow/Types/Product.hs +++ b/gen/Network/Google/Dataflow/Types/Product.hs @@ -9,7 +9,7 @@ -- | -- Module : Network.Google.Dataflow.Types.Product --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -23,7 +23,7 @@ import Network.Google.Prelude -- | A mapping from each stage to the information about that stage. -- -- /See:/ 'jobExecutionInfoStages' smart constructor. -newtype JobExecutionInfoStages = JobExecutionInfoStages +newtype JobExecutionInfoStages = JobExecutionInfoStages' { _jeisAddtional :: HashMap Text JobExecutionStageInfo } deriving (Eq,Show,Data,Typeable,Generic) @@ -36,7 +36,7 @@ jobExecutionInfoStages :: HashMap Text JobExecutionStageInfo -- ^ 'jeisAddtional' -> JobExecutionInfoStages jobExecutionInfoStages pJeisAddtional_ = - JobExecutionInfoStages + JobExecutionInfoStages' { _jeisAddtional = _Coerce # pJeisAddtional_ } @@ -50,7 +50,7 @@ instance FromJSON JobExecutionInfoStages where parseJSON = withObject "JobExecutionInfoStages" (\ o -> - JobExecutionInfoStages <$> (parseJSONObject o)) + JobExecutionInfoStages' <$> (parseJSONObject o)) instance ToJSON JobExecutionInfoStages where toJSON = toJSON . _jeisAddtional @@ -58,7 +58,7 @@ instance ToJSON JobExecutionInfoStages where -- | All configuration data for a particular Computation. -- -- /See:/ 'computationTopology' smart constructor. -data ComputationTopology = ComputationTopology +data ComputationTopology = ComputationTopology' { _ctStateFamilies :: !(Maybe [StateFamilyConfig]) , _ctUserStageName :: !(Maybe Text) , _ctInputs :: !(Maybe [StreamLocation]) @@ -88,7 +88,7 @@ data ComputationTopology = ComputationTopology computationTopology :: ComputationTopology computationTopology = - ComputationTopology + ComputationTopology' { _ctStateFamilies = Nothing , _ctUserStageName = Nothing , _ctInputs = Nothing @@ -149,7 +149,7 @@ instance FromJSON ComputationTopology where parseJSON = withObject "ComputationTopology" (\ o -> - ComputationTopology <$> + ComputationTopology' <$> (o .:? "stateFamilies" .!= mempty) <*> (o .:? "userStageName") <*> (o .:? "inputs" .!= mempty) @@ -159,7 +159,7 @@ instance FromJSON ComputationTopology where <*> (o .:? "systemStageName")) instance ToJSON ComputationTopology where - toJSON ComputationTopology{..} + toJSON ComputationTopology'{..} = object (catMaybes [("stateFamilies" .=) <$> _ctStateFamilies, @@ -173,7 +173,7 @@ instance ToJSON ComputationTopology where -- | The response to a SourceSplitRequest. -- -- /See:/ 'sourceSplitResponse' smart constructor. -data SourceSplitResponse = SourceSplitResponse +data SourceSplitResponse = SourceSplitResponse' { _ssrBundles :: !(Maybe [DerivedSource]) , _ssrShards :: !(Maybe [SourceSplitShard]) , _ssrOutcome :: !(Maybe Text) @@ -191,7 +191,7 @@ data SourceSplitResponse = SourceSplitResponse sourceSplitResponse :: SourceSplitResponse sourceSplitResponse = - SourceSplitResponse + SourceSplitResponse' { _ssrBundles = Nothing , _ssrShards = Nothing , _ssrOutcome = Nothing @@ -226,13 +226,13 @@ instance FromJSON SourceSplitResponse where parseJSON = withObject "SourceSplitResponse" (\ o -> - SourceSplitResponse <$> + SourceSplitResponse' <$> (o .:? "bundles" .!= mempty) <*> (o .:? "shards" .!= mempty) <*> (o .:? "outcome")) instance ToJSON SourceSplitResponse where - toJSON SourceSplitResponse{..} + toJSON SourceSplitResponse'{..} = object (catMaybes [("bundles" .=) <$> _ssrBundles, @@ -245,38 +245,38 @@ instance ToJSON SourceSplitResponse where -- designed to be: - Simple to use and understand for most users - Flexible -- enough to meet unexpected needs # Overview The \`Status\` message -- contains three pieces of data: error code, error message, and error --- details. The error code should be an enum value of [google.rpc.Code][], --- but it may accept additional error codes if needed. The error message --- should be a developer-facing English message that helps developers --- *understand* and *resolve* the error. If a localized user-facing error --- message is needed, put the localized message in the error details or --- localize it in the client. The optional error details may contain --- arbitrary information about the error. There is a predefined set of --- error detail types in the package \`google.rpc\` which can be used for --- common error conditions. # Language mapping The \`Status\` message is --- the logical representation of the error model, but it is not necessarily --- the actual wire format. When the \`Status\` message is exposed in --- different client libraries and different wire protocols, it can be --- mapped differently. For example, it will likely be mapped to some --- exceptions in Java, but more likely mapped to some error codes in C. # --- Other uses The error model and the \`Status\` message can be used in a --- variety of environments, either with or without APIs, to provide a --- consistent developer experience across different environments. Example --- uses of this error model include: - Partial errors. If a service needs --- to return partial errors to the client, it may embed the \`Status\` in --- the normal response to indicate the partial errors. - Workflow errors. A --- typical workflow has multiple steps. Each step may have a \`Status\` --- message for error reporting purpose. - Batch operations. If a client --- uses batch request and batch response, the \`Status\` message should be --- used directly inside batch response, one for each error sub-response. - --- Asynchronous operations. If an API call embeds asynchronous operation --- results in its response, the status of those operations should be --- represented directly using the \`Status\` message. - Logging. If some --- API errors are stored in logs, the message \`Status\` could be used --- directly after any stripping needed for security\/privacy reasons. +-- details. The error code should be an enum value of google.rpc.Code, but +-- it may accept additional error codes if needed. The error message should +-- be a developer-facing English message that helps developers *understand* +-- and *resolve* the error. If a localized user-facing error message is +-- needed, put the localized message in the error details or localize it in +-- the client. The optional error details may contain arbitrary information +-- about the error. There is a predefined set of error detail types in the +-- package \`google.rpc\` which can be used for common error conditions. # +-- Language mapping The \`Status\` message is the logical representation of +-- the error model, but it is not necessarily the actual wire format. When +-- the \`Status\` message is exposed in different client libraries and +-- different wire protocols, it can be mapped differently. For example, it +-- will likely be mapped to some exceptions in Java, but more likely mapped +-- to some error codes in C. # Other uses The error model and the +-- \`Status\` message can be used in a variety of environments, either with +-- or without APIs, to provide a consistent developer experience across +-- different environments. Example uses of this error model include: - +-- Partial errors. If a service needs to return partial errors to the +-- client, it may embed the \`Status\` in the normal response to indicate +-- the partial errors. - Workflow errors. A typical workflow has multiple +-- steps. Each step may have a \`Status\` message for error reporting +-- purpose. - Batch operations. If a client uses batch request and batch +-- response, the \`Status\` message should be used directly inside batch +-- response, one for each error sub-response. - Asynchronous operations. If +-- an API call embeds asynchronous operation results in its response, the +-- status of those operations should be represented directly using the +-- \`Status\` message. - Logging. If some API errors are stored in logs, +-- the message \`Status\` could be used directly after any stripping needed +-- for security\/privacy reasons. -- -- /See:/ 'status' smart constructor. -data Status = Status +data Status = Status' { _sDetails :: !(Maybe [StatusDetailsItem]) , _sCode :: !(Maybe (Textual Int32)) , _sMessage :: !(Maybe Text) @@ -294,7 +294,7 @@ data Status = Status status :: Status status = - Status + Status' { _sDetails = Nothing , _sCode = Nothing , _sMessage = Nothing @@ -308,7 +308,7 @@ sDetails _Default . _Coerce --- | The status code, which should be an enum value of [google.rpc.Code][]. +-- | The status code, which should be an enum value of google.rpc.Code. sCode :: Lens' Status (Maybe Int32) sCode = lens _sCode (\ s a -> s{_sCode = a}) . @@ -316,8 +316,7 @@ sCode -- | A developer-facing error message, which should be in English. Any -- user-facing error message should be localized and sent in the --- [google.rpc.Status.details][google.rpc.Status.details] field, or --- localized by the client. +-- google.rpc.Status.details field, or localized by the client. sMessage :: Lens' Status (Maybe Text) sMessage = lens _sMessage (\ s a -> s{_sMessage = a}) @@ -325,12 +324,12 @@ instance FromJSON Status where parseJSON = withObject "Status" (\ o -> - Status <$> + Status' <$> (o .:? "details" .!= mempty) <*> (o .:? "code") <*> (o .:? "message")) instance ToJSON Status where - toJSON Status{..} + toJSON Status'{..} = object (catMaybes [("details" .=) <$> _sDetails, @@ -341,7 +340,7 @@ instance ToJSON Status where -- the cloud. -- -- /See:/ 'workItem' smart constructor. -data WorkItem = WorkItem +data WorkItem = WorkItem' { _wiJobId :: !(Maybe Text) , _wiReportStatusInterval :: !(Maybe Text) , _wiShellTask :: !(Maybe ShellTask) @@ -392,7 +391,7 @@ data WorkItem = WorkItem workItem :: WorkItem workItem = - WorkItem + WorkItem' { _wiJobId = Nothing , _wiReportStatusInterval = Nothing , _wiShellTask = Nothing @@ -473,7 +472,7 @@ wiProjectId :: Lens' WorkItem (Maybe Text) wiProjectId = lens _wiProjectId (\ s a -> s{_wiProjectId = a}) --- | Time when the lease on this [Work][] will expire. +-- | Time when the lease on this Work will expire. wiLeaseExpireTime :: Lens' WorkItem (Maybe Text) wiLeaseExpireTime = lens _wiLeaseExpireTime @@ -494,7 +493,7 @@ instance FromJSON WorkItem where parseJSON = withObject "WorkItem" (\ o -> - WorkItem <$> + WorkItem' <$> (o .:? "jobId") <*> (o .:? "reportStatusInterval") <*> (o .:? "shellTask") <*> (o .:? "streamingSetupTask") @@ -510,7 +509,7 @@ instance FromJSON WorkItem where <*> (o .:? "seqMapTask")) instance ToJSON WorkItem where - toJSON WorkItem{..} + toJSON WorkItem'{..} = object (catMaybes [("jobId" .=) <$> _wiJobId, @@ -531,11 +530,91 @@ instance ToJSON WorkItem where ("configuration" .=) <$> _wiConfiguration, ("seqMapTask" .=) <$> _wiSeqMapTask]) +-- | WorkerHealthReport contains information about the health of a worker. +-- The VM should be identified by the labels attached to the WorkerMessage +-- that this health ping belongs to. +-- +-- /See:/ 'workerHealthReport' smart constructor. +data WorkerHealthReport = WorkerHealthReport' + { _whrVMIsHealthy :: !(Maybe Bool) + , _whrReportInterval :: !(Maybe Text) + , _whrPods :: !(Maybe [WorkerHealthReportPodsItem]) + , _whrVMStartupTime :: !(Maybe Text) + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerHealthReport' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'whrVMIsHealthy' +-- +-- * 'whrReportInterval' +-- +-- * 'whrPods' +-- +-- * 'whrVMStartupTime' +workerHealthReport + :: WorkerHealthReport +workerHealthReport = + WorkerHealthReport' + { _whrVMIsHealthy = Nothing + , _whrReportInterval = Nothing + , _whrPods = Nothing + , _whrVMStartupTime = Nothing + } + +-- | Whether the VM is healthy. +whrVMIsHealthy :: Lens' WorkerHealthReport (Maybe Bool) +whrVMIsHealthy + = lens _whrVMIsHealthy + (\ s a -> s{_whrVMIsHealthy = a}) + +-- | The interval at which the worker is sending health reports. The default +-- value of 0 should be interpreted as the field is not being explicitly +-- set by the worker. +whrReportInterval :: Lens' WorkerHealthReport (Maybe Text) +whrReportInterval + = lens _whrReportInterval + (\ s a -> s{_whrReportInterval = a}) + +-- | The pods running on the worker. See: +-- http:\/\/kubernetes.io\/v1.1\/docs\/api-reference\/v1\/definitions.html#_v1_pod +-- This field is used by the worker to send the status of the indvidual +-- containers running on each worker. +whrPods :: Lens' WorkerHealthReport [WorkerHealthReportPodsItem] +whrPods + = lens _whrPods (\ s a -> s{_whrPods = a}) . _Default + . _Coerce + +-- | The time the VM was booted. +whrVMStartupTime :: Lens' WorkerHealthReport (Maybe Text) +whrVMStartupTime + = lens _whrVMStartupTime + (\ s a -> s{_whrVMStartupTime = a}) + +instance FromJSON WorkerHealthReport where + parseJSON + = withObject "WorkerHealthReport" + (\ o -> + WorkerHealthReport' <$> + (o .:? "vmIsHealthy") <*> (o .:? "reportInterval") + <*> (o .:? "pods" .!= mempty) + <*> (o .:? "vmStartupTime")) + +instance ToJSON WorkerHealthReport where + toJSON WorkerHealthReport'{..} + = object + (catMaybes + [("vmIsHealthy" .=) <$> _whrVMIsHealthy, + ("reportInterval" .=) <$> _whrReportInterval, + ("pods" .=) <$> _whrPods, + ("vmStartupTime" .=) <$> _whrVMStartupTime]) + -- | Hints for splitting a Source into bundles (parts for parallel -- processing) using SourceSplitRequest. -- -- /See:/ 'sourceSplitOptions' smart constructor. -data SourceSplitOptions = SourceSplitOptions +data SourceSplitOptions = SourceSplitOptions' { _ssoDesiredShardSizeBytes :: !(Maybe (Textual Int64)) , _ssoDesiredBundleSizeBytes :: !(Maybe (Textual Int64)) } deriving (Eq,Show,Data,Typeable,Generic) @@ -550,7 +629,7 @@ data SourceSplitOptions = SourceSplitOptions sourceSplitOptions :: SourceSplitOptions sourceSplitOptions = - SourceSplitOptions + SourceSplitOptions' { _ssoDesiredShardSizeBytes = Nothing , _ssoDesiredBundleSizeBytes = Nothing } @@ -574,12 +653,12 @@ instance FromJSON SourceSplitOptions where parseJSON = withObject "SourceSplitOptions" (\ o -> - SourceSplitOptions <$> + SourceSplitOptions' <$> (o .:? "desiredShardSizeBytes") <*> (o .:? "desiredBundleSizeBytes")) instance ToJSON SourceSplitOptions where - toJSON SourceSplitOptions{..} + toJSON SourceSplitOptions'{..} = object (catMaybes [("desiredShardSizeBytes" .=) <$> @@ -590,7 +669,7 @@ instance ToJSON SourceSplitOptions where -- | Metadata to set on the Google Compute Engine VMs. -- -- /See:/ 'workerPoolMetadata' smart constructor. -newtype WorkerPoolMetadata = WorkerPoolMetadata +newtype WorkerPoolMetadata = WorkerPoolMetadata' { _wpmAddtional :: HashMap Text Text } deriving (Eq,Show,Data,Typeable,Generic) @@ -603,7 +682,7 @@ workerPoolMetadata :: HashMap Text Text -- ^ 'wpmAddtional' -> WorkerPoolMetadata workerPoolMetadata pWpmAddtional_ = - WorkerPoolMetadata + WorkerPoolMetadata' { _wpmAddtional = _Coerce # pWpmAddtional_ } @@ -615,7 +694,7 @@ wpmAddtional instance FromJSON WorkerPoolMetadata where parseJSON = withObject "WorkerPoolMetadata" - (\ o -> WorkerPoolMetadata <$> (parseJSONObject o)) + (\ o -> WorkerPoolMetadata' <$> (parseJSONObject o)) instance ToJSON WorkerPoolMetadata where toJSON = toJSON . _wpmAddtional @@ -623,7 +702,7 @@ instance ToJSON WorkerPoolMetadata where -- | Settings for WorkerPool autoscaling. -- -- /See:/ 'autoscalingSettings' smart constructor. -data AutoscalingSettings = AutoscalingSettings +data AutoscalingSettings = AutoscalingSettings' { _asMaxNumWorkers :: !(Maybe (Textual Int32)) , _asAlgorithm :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -638,7 +717,7 @@ data AutoscalingSettings = AutoscalingSettings autoscalingSettings :: AutoscalingSettings autoscalingSettings = - AutoscalingSettings + AutoscalingSettings' { _asMaxNumWorkers = Nothing , _asAlgorithm = Nothing } @@ -659,22 +738,21 @@ instance FromJSON AutoscalingSettings where parseJSON = withObject "AutoscalingSettings" (\ o -> - AutoscalingSettings <$> + AutoscalingSettings' <$> (o .:? "maxNumWorkers") <*> (o .:? "algorithm")) instance ToJSON AutoscalingSettings where - toJSON AutoscalingSettings{..} + toJSON AutoscalingSettings'{..} = object (catMaybes [("maxNumWorkers" .=) <$> _asMaxNumWorkers, ("algorithm" .=) <$> _asAlgorithm]) --- | Contains information about how a particular --- [google.dataflow.v1beta3.Step][google.dataflow.v1beta3.Step] will be --- executed. +-- | Contains information about how a particular google.dataflow.v1beta3.Step +-- will be executed. -- -- /See:/ 'jobExecutionStageInfo' smart constructor. -newtype JobExecutionStageInfo = JobExecutionStageInfo +newtype JobExecutionStageInfo = JobExecutionStageInfo' { _jesiStepName :: Maybe [Text] } deriving (Eq,Show,Data,Typeable,Generic) @@ -686,7 +764,7 @@ newtype JobExecutionStageInfo = JobExecutionStageInfo jobExecutionStageInfo :: JobExecutionStageInfo jobExecutionStageInfo = - JobExecutionStageInfo + JobExecutionStageInfo' { _jesiStepName = Nothing } @@ -703,18 +781,18 @@ instance FromJSON JobExecutionStageInfo where parseJSON = withObject "JobExecutionStageInfo" (\ o -> - JobExecutionStageInfo <$> + JobExecutionStageInfo' <$> (o .:? "stepName" .!= mempty)) instance ToJSON JobExecutionStageInfo where - toJSON JobExecutionStageInfo{..} + toJSON JobExecutionStageInfo'{..} = object (catMaybes [("stepName" .=) <$> _jesiStepName]) -- | An output of an instruction. -- -- /See:/ 'instructionOutput' smart constructor. -data InstructionOutput = InstructionOutput +data InstructionOutput = InstructionOutput' { _ioCodec :: !(Maybe InstructionOutputCodec) , _ioName :: !(Maybe Text) , _ioSystemName :: !(Maybe Text) @@ -732,7 +810,7 @@ data InstructionOutput = InstructionOutput instructionOutput :: InstructionOutput instructionOutput = - InstructionOutput + InstructionOutput' { _ioCodec = Nothing , _ioName = Nothing , _ioSystemName = Nothing @@ -755,12 +833,12 @@ instance FromJSON InstructionOutput where parseJSON = withObject "InstructionOutput" (\ o -> - InstructionOutput <$> + InstructionOutput' <$> (o .:? "codec") <*> (o .:? "name") <*> (o .:? "systemName")) instance ToJSON InstructionOutput where - toJSON InstructionOutput{..} + toJSON InstructionOutput'{..} = object (catMaybes [("codec" .=) <$> _ioCodec, ("name" .=) <$> _ioName, @@ -769,7 +847,7 @@ instance ToJSON InstructionOutput where -- | Request to report the status of WorkItems. -- -- /See:/ 'reportWorkItemStatusRequest' smart constructor. -data ReportWorkItemStatusRequest = ReportWorkItemStatusRequest +data ReportWorkItemStatusRequest = ReportWorkItemStatusRequest' { _rwisrCurrentWorkerTime :: !(Maybe Text) , _rwisrWorkItemStatuses :: !(Maybe [WorkItemStatus]) , _rwisrWorkerId :: !(Maybe Text) @@ -787,7 +865,7 @@ data ReportWorkItemStatusRequest = ReportWorkItemStatusRequest reportWorkItemStatusRequest :: ReportWorkItemStatusRequest reportWorkItemStatusRequest = - ReportWorkItemStatusRequest + ReportWorkItemStatusRequest' { _rwisrCurrentWorkerTime = Nothing , _rwisrWorkItemStatuses = Nothing , _rwisrWorkerId = Nothing @@ -822,13 +900,13 @@ instance FromJSON ReportWorkItemStatusRequest where parseJSON = withObject "ReportWorkItemStatusRequest" (\ o -> - ReportWorkItemStatusRequest <$> + ReportWorkItemStatusRequest' <$> (o .:? "currentWorkerTime") <*> (o .:? "workItemStatuses" .!= mempty) <*> (o .:? "workerId")) instance ToJSON ReportWorkItemStatusRequest where - toJSON ReportWorkItemStatusRequest{..} + toJSON ReportWorkItemStatusRequest'{..} = object (catMaybes [("currentWorkerTime" .=) <$> @@ -840,7 +918,7 @@ instance ToJSON ReportWorkItemStatusRequest where -- service are required in order to run the job. -- -- /See:/ 'environmentVersion' smart constructor. -newtype EnvironmentVersion = EnvironmentVersion +newtype EnvironmentVersion = EnvironmentVersion' { _evAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -853,7 +931,7 @@ environmentVersion :: HashMap Text JSONValue -- ^ 'evAddtional' -> EnvironmentVersion environmentVersion pEvAddtional_ = - EnvironmentVersion + EnvironmentVersion' { _evAddtional = _Coerce # pEvAddtional_ } @@ -866,7 +944,7 @@ evAddtional instance FromJSON EnvironmentVersion where parseJSON = withObject "EnvironmentVersion" - (\ o -> EnvironmentVersion <$> (parseJSONObject o)) + (\ o -> EnvironmentVersion' <$> (parseJSONObject o)) instance ToJSON EnvironmentVersion where toJSON = toJSON . _evAddtional @@ -874,7 +952,7 @@ instance ToJSON EnvironmentVersion where -- | A sink that records can be encoded and written to. -- -- /See:/ 'sink' smart constructor. -data Sink = Sink +data Sink = Sink' { _sCodec :: !(Maybe SinkCodec) , _sSpec :: !(Maybe SinkSpec) } deriving (Eq,Show,Data,Typeable,Generic) @@ -889,7 +967,7 @@ data Sink = Sink sink :: Sink sink = - Sink + Sink' { _sCodec = Nothing , _sSpec = Nothing } @@ -905,19 +983,60 @@ sSpec = lens _sSpec (\ s a -> s{_sSpec = a}) instance FromJSON Sink where parseJSON = withObject "Sink" - (\ o -> Sink <$> (o .:? "codec") <*> (o .:? "spec")) + (\ o -> Sink' <$> (o .:? "codec") <*> (o .:? "spec")) instance ToJSON Sink where - toJSON Sink{..} + toJSON Sink'{..} = object (catMaybes [("codec" .=) <$> _sCodec, ("spec" .=) <$> _sSpec]) +-- | WorkerHealthReportResponse contains information returned to the worker +-- in response to a health ping. +-- +-- /See:/ 'workerHealthReportResponse' smart constructor. +newtype WorkerHealthReportResponse = WorkerHealthReportResponse' + { _whrrReportInterval :: Maybe Text + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerHealthReportResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'whrrReportInterval' +workerHealthReportResponse + :: WorkerHealthReportResponse +workerHealthReportResponse = + WorkerHealthReportResponse' + { _whrrReportInterval = Nothing + } + +-- | A positive value indicates the worker should change its reporting +-- interval to the specified value. The default value of zero means no +-- change in report rate is requested by the server. +whrrReportInterval :: Lens' WorkerHealthReportResponse (Maybe Text) +whrrReportInterval + = lens _whrrReportInterval + (\ s a -> s{_whrrReportInterval = a}) + +instance FromJSON WorkerHealthReportResponse where + parseJSON + = withObject "WorkerHealthReportResponse" + (\ o -> + WorkerHealthReportResponse' <$> + (o .:? "reportInterval")) + +instance ToJSON WorkerHealthReportResponse where + toJSON WorkerHealthReportResponse'{..} + = object + (catMaybes + [("reportInterval" .=) <$> _whrrReportInterval]) + -- | Identifies a metric, by describing the source which generated the -- metric. -- -- /See:/ 'metricStructuredName' smart constructor. -data MetricStructuredName = MetricStructuredName +data MetricStructuredName = MetricStructuredName' { _msnOrigin :: !(Maybe Text) , _msnContext :: !(Maybe MetricStructuredNameContext) , _msnName :: !(Maybe Text) @@ -935,7 +1054,7 @@ data MetricStructuredName = MetricStructuredName metricStructuredName :: MetricStructuredName metricStructuredName = - MetricStructuredName + MetricStructuredName' { _msnOrigin = Nothing , _msnContext = Nothing , _msnName = Nothing @@ -964,12 +1083,12 @@ instance FromJSON MetricStructuredName where parseJSON = withObject "MetricStructuredName" (\ o -> - MetricStructuredName <$> + MetricStructuredName' <$> (o .:? "origin") <*> (o .:? "context") <*> (o .:? "name")) instance ToJSON MetricStructuredName where - toJSON MetricStructuredName{..} + toJSON MetricStructuredName'{..} = object (catMaybes [("origin" .=) <$> _msnOrigin, @@ -980,7 +1099,7 @@ instance ToJSON MetricStructuredName where -- outputs. -- -- /See:/ 'writeInstruction' smart constructor. -data WriteInstruction = WriteInstruction +data WriteInstruction = WriteInstruction' { _wiSink :: !(Maybe Sink) , _wiInput :: !(Maybe InstructionInput) } deriving (Eq,Show,Data,Typeable,Generic) @@ -995,7 +1114,7 @@ data WriteInstruction = WriteInstruction writeInstruction :: WriteInstruction writeInstruction = - WriteInstruction + WriteInstruction' { _wiSink = Nothing , _wiInput = Nothing } @@ -1012,11 +1131,11 @@ instance FromJSON WriteInstruction where parseJSON = withObject "WriteInstruction" (\ o -> - WriteInstruction <$> + WriteInstruction' <$> (o .:? "sink") <*> (o .:? "input")) instance ToJSON WriteInstruction where - toJSON WriteInstruction{..} + toJSON WriteInstruction'{..} = object (catMaybes [("sink" .=) <$> _wiSink, ("input" .=) <$> _wiInput]) @@ -1024,7 +1143,7 @@ instance ToJSON WriteInstruction where -- | A description of the process that generated the request. -- -- /See:/ 'environmentUserAgent' smart constructor. -newtype EnvironmentUserAgent = EnvironmentUserAgent +newtype EnvironmentUserAgent = EnvironmentUserAgent' { _euaAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -1037,7 +1156,7 @@ environmentUserAgent :: HashMap Text JSONValue -- ^ 'euaAddtional' -> EnvironmentUserAgent environmentUserAgent pEuaAddtional_ = - EnvironmentUserAgent + EnvironmentUserAgent' { _euaAddtional = _Coerce # pEuaAddtional_ } @@ -1050,7 +1169,8 @@ euaAddtional instance FromJSON EnvironmentUserAgent where parseJSON = withObject "EnvironmentUserAgent" - (\ o -> EnvironmentUserAgent <$> (parseJSONObject o)) + (\ o -> + EnvironmentUserAgent' <$> (parseJSONObject o)) instance ToJSON EnvironmentUserAgent where toJSON = toJSON . _euaAddtional @@ -1058,7 +1178,7 @@ instance ToJSON EnvironmentUserAgent where -- | Describes the data disk used by a workflow job. -- -- /See:/ 'disk' smart constructor. -data Disk = Disk +data Disk = Disk' { _dSizeGb :: !(Maybe (Textual Int32)) , _dDiskType :: !(Maybe Text) , _dMountPoint :: !(Maybe Text) @@ -1076,7 +1196,7 @@ data Disk = Disk disk :: Disk disk = - Disk + Disk' { _dSizeGb = Nothing , _dDiskType = Nothing , _dMountPoint = Nothing @@ -1115,12 +1235,12 @@ instance FromJSON Disk where parseJSON = withObject "Disk" (\ o -> - Disk <$> + Disk' <$> (o .:? "sizeGb") <*> (o .:? "diskType") <*> (o .:? "mountPoint")) instance ToJSON Disk where - toJSON Disk{..} + toJSON Disk'{..} = object (catMaybes [("sizeGb" .=) <$> _dSizeGb, @@ -1130,7 +1250,7 @@ instance ToJSON Disk where -- | Describes the state of a metric. -- -- /See:/ 'metricUpdate' smart constructor. -data MetricUpdate = MetricUpdate +data MetricUpdate = MetricUpdate' { _muMeanSum :: !(Maybe JSONValue) , _muInternal :: !(Maybe JSONValue) , _muSet :: !(Maybe JSONValue) @@ -1166,7 +1286,7 @@ data MetricUpdate = MetricUpdate metricUpdate :: MetricUpdate metricUpdate = - MetricUpdate + MetricUpdate' { _muMeanSum = Nothing , _muInternal = Nothing , _muSet = Nothing @@ -1243,7 +1363,7 @@ instance FromJSON MetricUpdate where parseJSON = withObject "MetricUpdate" (\ o -> - MetricUpdate <$> + MetricUpdate' <$> (o .:? "meanSum") <*> (o .:? "internal") <*> (o .:? "set") <*> (o .:? "cumulative") @@ -1254,7 +1374,7 @@ instance FromJSON MetricUpdate where <*> (o .:? "scalar")) instance ToJSON MetricUpdate where - toJSON MetricUpdate{..} + toJSON MetricUpdate'{..} = object (catMaybes [("meanSum" .=) <$> _muMeanSum, @@ -1270,7 +1390,7 @@ instance ToJSON MetricUpdate where -- | The result of a SourceGetMetadataOperation. -- -- /See:/ 'sourceGetMetadataResponse' smart constructor. -newtype SourceGetMetadataResponse = SourceGetMetadataResponse +newtype SourceGetMetadataResponse = SourceGetMetadataResponse' { _sgmrMetadata :: Maybe SourceMetadata } deriving (Eq,Show,Data,Typeable,Generic) @@ -1282,7 +1402,7 @@ newtype SourceGetMetadataResponse = SourceGetMetadataResponse sourceGetMetadataResponse :: SourceGetMetadataResponse sourceGetMetadataResponse = - SourceGetMetadataResponse + SourceGetMetadataResponse' { _sgmrMetadata = Nothing } @@ -1295,17 +1415,17 @@ instance FromJSON SourceGetMetadataResponse where parseJSON = withObject "SourceGetMetadataResponse" (\ o -> - SourceGetMetadataResponse <$> (o .:? "metadata")) + SourceGetMetadataResponse' <$> (o .:? "metadata")) instance ToJSON SourceGetMetadataResponse where - toJSON SourceGetMetadataResponse{..} + toJSON SourceGetMetadataResponse'{..} = object (catMaybes [("metadata" .=) <$> _sgmrMetadata]) -- | Describes the environment in which a Dataflow Job runs. -- -- /See:/ 'environment' smart constructor. -data Environment = Environment +data Environment = Environment' { _eDataSet :: !(Maybe Text) , _eExperiments :: !(Maybe [Text]) , _eWorkerPools :: !(Maybe [WorkerPool]) @@ -1341,7 +1461,7 @@ data Environment = Environment environment :: Environment environment = - Environment + Environment' { _eDataSet = Nothing , _eExperiments = Nothing , _eWorkerPools = Nothing @@ -1425,7 +1545,7 @@ instance FromJSON Environment where parseJSON = withObject "Environment" (\ o -> - Environment <$> + Environment' <$> (o .:? "dataset") <*> (o .:? "experiments" .!= mempty) <*> (o .:? "workerPools" .!= mempty) @@ -1437,7 +1557,7 @@ instance FromJSON Environment where <*> (o .:? "sdkPipelineOptions")) instance ToJSON Environment where - toJSON Environment{..} + toJSON Environment'{..} = object (catMaybes [("dataset" .=) <$> _eDataSet, @@ -1456,7 +1576,7 @@ instance ToJSON Environment where -- that encapsulates a set of other sources. -- -- /See:/ 'concatPosition' smart constructor. -data ConcatPosition = ConcatPosition +data ConcatPosition = ConcatPosition' { _cpIndex :: !(Maybe (Textual Int32)) , _cpPosition :: !(Maybe Position) } deriving (Eq,Show,Data,Typeable,Generic) @@ -1471,7 +1591,7 @@ data ConcatPosition = ConcatPosition concatPosition :: ConcatPosition concatPosition = - ConcatPosition + ConcatPosition' { _cpIndex = Nothing , _cpPosition = Nothing } @@ -1491,11 +1611,11 @@ instance FromJSON ConcatPosition where parseJSON = withObject "ConcatPosition" (\ o -> - ConcatPosition <$> + ConcatPosition' <$> (o .:? "index") <*> (o .:? "position")) instance ToJSON ConcatPosition where - toJSON ConcatPosition{..} + toJSON ConcatPosition'{..} = object (catMaybes [("index" .=) <$> _cpIndex, @@ -1508,7 +1628,7 @@ instance ToJSON ConcatPosition where -- will have context[\'pcollection\'] = . -- -- /See:/ 'metricStructuredNameContext' smart constructor. -newtype MetricStructuredNameContext = MetricStructuredNameContext +newtype MetricStructuredNameContext = MetricStructuredNameContext' { _msncAddtional :: HashMap Text Text } deriving (Eq,Show,Data,Typeable,Generic) @@ -1521,7 +1641,7 @@ metricStructuredNameContext :: HashMap Text Text -- ^ 'msncAddtional' -> MetricStructuredNameContext metricStructuredNameContext pMsncAddtional_ = - MetricStructuredNameContext + MetricStructuredNameContext' { _msncAddtional = _Coerce # pMsncAddtional_ } @@ -1535,7 +1655,7 @@ instance FromJSON MetricStructuredNameContext where parseJSON = withObject "MetricStructuredNameContext" (\ o -> - MetricStructuredNameContext <$> (parseJSONObject o)) + MetricStructuredNameContext' <$> (parseJSONObject o)) instance ToJSON MetricStructuredNameContext where toJSON = toJSON . _msncAddtional @@ -1544,7 +1664,7 @@ instance ToJSON MetricStructuredNameContext where -- stage-to-stage communication. -- -- /See:/ 'streamingStageLocation' smart constructor. -newtype StreamingStageLocation = StreamingStageLocation +newtype StreamingStageLocation = StreamingStageLocation' { _sslStreamId :: Maybe Text } deriving (Eq,Show,Data,Typeable,Generic) @@ -1556,7 +1676,7 @@ newtype StreamingStageLocation = StreamingStageLocation streamingStageLocation :: StreamingStageLocation streamingStageLocation = - StreamingStageLocation + StreamingStageLocation' { _sslStreamId = Nothing } @@ -1569,10 +1689,10 @@ instance FromJSON StreamingStageLocation where parseJSON = withObject "StreamingStageLocation" (\ o -> - StreamingStageLocation <$> (o .:? "streamId")) + StreamingStageLocation' <$> (o .:? "streamId")) instance ToJSON StreamingStageLocation where - toJSON StreamingStageLocation{..} + toJSON StreamingStageLocation'{..} = object (catMaybes [("streamId" .=) <$> _sslStreamId]) @@ -1582,7 +1702,7 @@ instance ToJSON StreamingStageLocation where -- source being split. -- -- /See:/ 'derivedSource' smart constructor. -data DerivedSource = DerivedSource +data DerivedSource = DerivedSource' { _dsDerivationMode :: !(Maybe Text) , _dsSource :: !(Maybe Source) } deriving (Eq,Show,Data,Typeable,Generic) @@ -1597,7 +1717,7 @@ data DerivedSource = DerivedSource derivedSource :: DerivedSource derivedSource = - DerivedSource + DerivedSource' { _dsDerivationMode = Nothing , _dsSource = Nothing } @@ -1616,11 +1736,11 @@ instance FromJSON DerivedSource where parseJSON = withObject "DerivedSource" (\ o -> - DerivedSource <$> + DerivedSource' <$> (o .:? "derivationMode") <*> (o .:? "source")) instance ToJSON DerivedSource where - toJSON DerivedSource{..} + toJSON DerivedSource'{..} = object (catMaybes [("derivationMode" .=) <$> _dsDerivationMode, @@ -1633,7 +1753,7 @@ instance ToJSON DerivedSource where -- (under the same metric names) from Cloud Monitoring. -- -- /See:/ 'jobMetrics' smart constructor. -data JobMetrics = JobMetrics +data JobMetrics = JobMetrics' { _jmMetrics :: !(Maybe [MetricUpdate]) , _jmMetricTime :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -1648,7 +1768,7 @@ data JobMetrics = JobMetrics jobMetrics :: JobMetrics jobMetrics = - JobMetrics + JobMetrics' { _jmMetrics = Nothing , _jmMetricTime = Nothing } @@ -1669,12 +1789,12 @@ instance FromJSON JobMetrics where parseJSON = withObject "JobMetrics" (\ o -> - JobMetrics <$> + JobMetrics' <$> (o .:? "metrics" .!= mempty) <*> (o .:? "metricTime")) instance ToJSON JobMetrics where - toJSON JobMetrics{..} + toJSON JobMetrics'{..} = object (catMaybes [("metrics" .=) <$> _jmMetrics, @@ -1683,8 +1803,9 @@ instance ToJSON JobMetrics where -- | Conveys a worker\'s progress through the work described by a WorkItem. -- -- /See:/ 'workItemStatus' smart constructor. -data WorkItemStatus = WorkItemStatus - { _wisProgress :: !(Maybe ApproximateProgress) +data WorkItemStatus = WorkItemStatus' + { _wisReportedProgress :: !(Maybe ApproximateReportedProgress) + , _wisProgress :: !(Maybe ApproximateProgress) , _wisSourceOperationResponse :: !(Maybe SourceOperationResponse) , _wisStopPosition :: !(Maybe Position) , _wisDynamicSourceSplit :: !(Maybe DynamicSourceSplit) @@ -1701,6 +1822,8 @@ data WorkItemStatus = WorkItemStatus -- -- Use one of the following lenses to modify other fields as desired: -- +-- * 'wisReportedProgress' +-- -- * 'wisProgress' -- -- * 'wisSourceOperationResponse' @@ -1725,8 +1848,9 @@ data WorkItemStatus = WorkItemStatus workItemStatus :: WorkItemStatus workItemStatus = - WorkItemStatus - { _wisProgress = Nothing + WorkItemStatus' + { _wisReportedProgress = Nothing + , _wisProgress = Nothing , _wisSourceOperationResponse = Nothing , _wisStopPosition = Nothing , _wisDynamicSourceSplit = Nothing @@ -1739,7 +1863,13 @@ workItemStatus = , _wisWorkItemId = Nothing } --- | The WorkItem\'s approximate progress. +-- | The worker\'s progress through this WorkItem. +wisReportedProgress :: Lens' WorkItemStatus (Maybe ApproximateReportedProgress) +wisReportedProgress + = lens _wisReportedProgress + (\ s a -> s{_wisReportedProgress = a}) + +-- | DEPRECATED in favor of reported_progress. wisProgress :: Lens' WorkItemStatus (Maybe ApproximateProgress) wisProgress = lens _wisProgress (\ s a -> s{_wisProgress = a}) @@ -1846,8 +1976,8 @@ instance FromJSON WorkItemStatus where parseJSON = withObject "WorkItemStatus" (\ o -> - WorkItemStatus <$> - (o .:? "progress") <*> + WorkItemStatus' <$> + (o .:? "reportedProgress") <*> (o .:? "progress") <*> (o .:? "sourceOperationResponse") <*> (o .:? "stopPosition") <*> (o .:? "dynamicSourceSplit") @@ -1860,10 +1990,11 @@ instance FromJSON WorkItemStatus where <*> (o .:? "workItemId")) instance ToJSON WorkItemStatus where - toJSON WorkItemStatus{..} + toJSON WorkItemStatus'{..} = object (catMaybes - [("progress" .=) <$> _wisProgress, + [("reportedProgress" .=) <$> _wisReportedProgress, + ("progress" .=) <$> _wisProgress, ("sourceOperationResponse" .=) <$> _wisSourceOperationResponse, ("stopPosition" .=) <$> _wisStopPosition, @@ -1877,11 +2008,50 @@ instance ToJSON WorkItemStatus where ("metricUpdates" .=) <$> _wisMetricUpdates, ("workItemId" .=) <$> _wisWorkItemId]) +-- | Labels are used to group WorkerMessages. For example, a worker_message +-- about a particular container might have the labels: { \"JOB_ID\": +-- \"2015-04-22\", \"WORKER_ID\": \"wordcount-vm-2015…\" +-- \"CONTAINER_TYPE\": \"worker\", \"CONTAINER_ID\": \"ac1234def\"} Label +-- tags typically correspond to Label enum values. However, for ease of +-- development other strings can be used as tags. LABEL_UNSPECIFIED should +-- not be used here. +-- +-- /See:/ 'workerMessageLabels' smart constructor. +newtype WorkerMessageLabels = WorkerMessageLabels' + { _wmlAddtional :: HashMap Text Text + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerMessageLabels' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'wmlAddtional' +workerMessageLabels + :: HashMap Text Text -- ^ 'wmlAddtional' + -> WorkerMessageLabels +workerMessageLabels pWmlAddtional_ = + WorkerMessageLabels' + { _wmlAddtional = _Coerce # pWmlAddtional_ + } + +wmlAddtional :: Lens' WorkerMessageLabels (HashMap Text Text) +wmlAddtional + = lens _wmlAddtional (\ s a -> s{_wmlAddtional = a}) + . _Coerce + +instance FromJSON WorkerMessageLabels where + parseJSON + = withObject "WorkerMessageLabels" + (\ o -> WorkerMessageLabels' <$> (parseJSONObject o)) + +instance ToJSON WorkerMessageLabels where + toJSON = toJSON . _wmlAddtional + -- | An instruction that copies its inputs (zero or more) to its (single) -- output. -- -- /See:/ 'flattenInstruction' smart constructor. -newtype FlattenInstruction = FlattenInstruction +newtype FlattenInstruction = FlattenInstruction' { _fiInputs :: Maybe [InstructionInput] } deriving (Eq,Show,Data,Typeable,Generic) @@ -1893,7 +2063,7 @@ newtype FlattenInstruction = FlattenInstruction flattenInstruction :: FlattenInstruction flattenInstruction = - FlattenInstruction + FlattenInstruction' { _fiInputs = Nothing } @@ -1908,17 +2078,87 @@ instance FromJSON FlattenInstruction where parseJSON = withObject "FlattenInstruction" (\ o -> - FlattenInstruction <$> (o .:? "inputs" .!= mempty)) + FlattenInstruction' <$> (o .:? "inputs" .!= mempty)) instance ToJSON FlattenInstruction where - toJSON FlattenInstruction{..} + toJSON FlattenInstruction'{..} = object (catMaybes [("inputs" .=) <$> _fiInputs]) +-- | A message code is used to report status and error messages to the +-- service. The message codes are intended to be machine readable. The +-- service will take care of translating these into user understandable +-- messages if necessary. Example use cases: 1. Worker processes reporting +-- successful startup. 2. Worker processes reporting specific errors (e.g. +-- package staging failure). +-- +-- /See:/ 'workerMessageCode' smart constructor. +data WorkerMessageCode = WorkerMessageCode' + { _wmcParameters :: !(Maybe WorkerMessageCodeParameters) + , _wmcCode :: !(Maybe Text) + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerMessageCode' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'wmcParameters' +-- +-- * 'wmcCode' +workerMessageCode + :: WorkerMessageCode +workerMessageCode = + WorkerMessageCode' + { _wmcParameters = Nothing + , _wmcCode = Nothing + } + +-- | Parameters contains specific information about the code. This is a +-- struct to allow parameters of different types. Examples: 1. For a +-- \"HARNESS_STARTED\" message parameters might provide the name of the +-- worker and additional data like timing information. 2. For a +-- \"GCS_DOWNLOAD_ERROR\" parameters might contain fields listing the GCS +-- objects being downloaded and fields containing errors. In general +-- complex data structures should be avoided. If a worker needs to send a +-- specific and complicated data structure then please consider defining a +-- new proto and adding it to the data oneof in WorkerMessageResponse. +-- Conventions: Parameters should only be used for information that isn\'t +-- typically passed as a label. hostname and other worker identifiers +-- should almost always be passed as labels since they will be included on +-- most messages. +wmcParameters :: Lens' WorkerMessageCode (Maybe WorkerMessageCodeParameters) +wmcParameters + = lens _wmcParameters + (\ s a -> s{_wmcParameters = a}) + +-- | The code is a string intended for consumption by a machine that +-- identifies the type of message being sent. Examples: 1. +-- \"HARNESS_STARTED\" might be used to indicate the worker harness has +-- started. 2. \"GCS_DOWNLOAD_ERROR\" might be used to indicate an error +-- downloading a GCS file as part of the boot process of one of the worker +-- containers. This is a string and not an enum to make it easy to add new +-- codes without waiting for an API change. +wmcCode :: Lens' WorkerMessageCode (Maybe Text) +wmcCode = lens _wmcCode (\ s a -> s{_wmcCode = a}) + +instance FromJSON WorkerMessageCode where + parseJSON + = withObject "WorkerMessageCode" + (\ o -> + WorkerMessageCode' <$> + (o .:? "parameters") <*> (o .:? "code")) + +instance ToJSON WorkerMessageCode where + toJSON WorkerMessageCode'{..} + = object + (catMaybes + [("parameters" .=) <$> _wmcParameters, + ("code" .=) <$> _wmcCode]) + -- | Map of transform name prefixes of the job to be replaced to the -- corresponding name prefixes of the new job. -- -- /See:/ 'jobTransformNameMApping' smart constructor. -newtype JobTransformNameMApping = JobTransformNameMApping +newtype JobTransformNameMApping = JobTransformNameMApping' { _jtnmaAddtional :: HashMap Text Text } deriving (Eq,Show,Data,Typeable,Generic) @@ -1931,7 +2171,7 @@ jobTransformNameMApping :: HashMap Text Text -- ^ 'jtnmaAddtional' -> JobTransformNameMApping jobTransformNameMApping pJtnmaAddtional_ = - JobTransformNameMApping + JobTransformNameMApping' { _jtnmaAddtional = _Coerce # pJtnmaAddtional_ } @@ -1945,7 +2185,7 @@ instance FromJSON JobTransformNameMApping where parseJSON = withObject "JobTransformNameMApping" (\ o -> - JobTransformNameMApping <$> (parseJSONObject o)) + JobTransformNameMApping' <$> (parseJSONObject o)) instance ToJSON JobTransformNameMApping where toJSON = toJSON . _jtnmaAddtional @@ -1953,7 +2193,7 @@ instance ToJSON JobTransformNameMApping where -- | The source to read from, plus its parameters. -- -- /See:/ 'sourceSpec' smart constructor. -newtype SourceSpec = SourceSpec +newtype SourceSpec = SourceSpec' { _ssAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -1966,7 +2206,7 @@ sourceSpec :: HashMap Text JSONValue -- ^ 'ssAddtional' -> SourceSpec sourceSpec pSsAddtional_ = - SourceSpec + SourceSpec' { _ssAddtional = _Coerce # pSsAddtional_ } @@ -1979,7 +2219,7 @@ ssAddtional instance FromJSON SourceSpec where parseJSON = withObject "SourceSpec" - (\ o -> SourceSpec <$> (parseJSONObject o)) + (\ o -> SourceSpec' <$> (parseJSONObject o)) instance ToJSON SourceSpec where toJSON = toJSON . _ssAddtional @@ -1988,7 +2228,7 @@ instance ToJSON SourceSpec where -- the pipeline, etc. -- -- /See:/ 'sourceMetadata' smart constructor. -data SourceMetadata = SourceMetadata +data SourceMetadata = SourceMetadata' { _smEstimatedSizeBytes :: !(Maybe (Textual Int64)) , _smProducesSortedKeys :: !(Maybe Bool) , _smInfinite :: !(Maybe Bool) @@ -2006,7 +2246,7 @@ data SourceMetadata = SourceMetadata sourceMetadata :: SourceMetadata sourceMetadata = - SourceMetadata + SourceMetadata' { _smEstimatedSizeBytes = Nothing , _smProducesSortedKeys = Nothing , _smInfinite = Nothing @@ -2038,13 +2278,13 @@ instance FromJSON SourceMetadata where parseJSON = withObject "SourceMetadata" (\ o -> - SourceMetadata <$> + SourceMetadata' <$> (o .:? "estimatedSizeBytes") <*> (o .:? "producesSortedKeys") <*> (o .:? "infinite")) instance ToJSON SourceMetadata where - toJSON SourceMetadata{..} + toJSON SourceMetadata'{..} = object (catMaybes [("estimatedSizeBytes" .=) <$> _smEstimatedSizeBytes, @@ -2054,7 +2294,7 @@ instance ToJSON SourceMetadata where -- | Experimental settings. -- -- /See:/ 'environmentInternalExperiments' smart constructor. -newtype EnvironmentInternalExperiments = EnvironmentInternalExperiments +newtype EnvironmentInternalExperiments = EnvironmentInternalExperiments' { _eieAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -2067,7 +2307,7 @@ environmentInternalExperiments :: HashMap Text JSONValue -- ^ 'eieAddtional' -> EnvironmentInternalExperiments environmentInternalExperiments pEieAddtional_ = - EnvironmentInternalExperiments + EnvironmentInternalExperiments' { _eieAddtional = _Coerce # pEieAddtional_ } @@ -2082,7 +2322,7 @@ instance FromJSON EnvironmentInternalExperiments parseJSON = withObject "EnvironmentInternalExperiments" (\ o -> - EnvironmentInternalExperiments <$> + EnvironmentInternalExperiments' <$> (parseJSONObject o)) instance ToJSON EnvironmentInternalExperiments where @@ -2091,7 +2331,7 @@ instance ToJSON EnvironmentInternalExperiments where -- | Taskrunner configuration settings. -- -- /See:/ 'taskRunnerSettings' smart constructor. -data TaskRunnerSettings = TaskRunnerSettings +data TaskRunnerSettings = TaskRunnerSettings' { _trsContinueOnException :: !(Maybe Bool) , _trsHarnessCommand :: !(Maybe Text) , _trsWorkflowFileName :: !(Maybe Text) @@ -2157,7 +2397,7 @@ data TaskRunnerSettings = TaskRunnerSettings taskRunnerSettings :: TaskRunnerSettings taskRunnerSettings = - TaskRunnerSettings + TaskRunnerSettings' { _trsContinueOnException = Nothing , _trsHarnessCommand = Nothing , _trsWorkflowFileName = Nothing @@ -2307,7 +2547,7 @@ instance FromJSON TaskRunnerSettings where parseJSON = withObject "TaskRunnerSettings" (\ o -> - TaskRunnerSettings <$> + TaskRunnerSettings' <$> (o .:? "continueOnException") <*> (o .:? "harnessCommand") <*> (o .:? "workflowFileName") @@ -2329,7 +2569,7 @@ instance FromJSON TaskRunnerSettings where <*> (o .:? "languageHint")) instance ToJSON TaskRunnerSettings where - toJSON TaskRunnerSettings{..} + toJSON TaskRunnerSettings'{..} = object (catMaybes [("continueOnException" .=) <$> @@ -2362,7 +2602,7 @@ instance ToJSON TaskRunnerSettings where -- way. -- -- /See:/ 'environmentSdkPipelineOptions' smart constructor. -newtype EnvironmentSdkPipelineOptions = EnvironmentSdkPipelineOptions +newtype EnvironmentSdkPipelineOptions = EnvironmentSdkPipelineOptions' { _espoAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -2375,7 +2615,7 @@ environmentSdkPipelineOptions :: HashMap Text JSONValue -- ^ 'espoAddtional' -> EnvironmentSdkPipelineOptions environmentSdkPipelineOptions pEspoAddtional_ = - EnvironmentSdkPipelineOptions + EnvironmentSdkPipelineOptions' { _espoAddtional = _Coerce # pEspoAddtional_ } @@ -2390,7 +2630,7 @@ instance FromJSON EnvironmentSdkPipelineOptions where parseJSON = withObject "EnvironmentSdkPipelineOptions" (\ o -> - EnvironmentSdkPipelineOptions <$> + EnvironmentSdkPipelineOptions' <$> (parseJSONObject o)) instance ToJSON EnvironmentSdkPipelineOptions where @@ -2399,7 +2639,7 @@ instance ToJSON EnvironmentSdkPipelineOptions where -- | Request to lease WorkItems. -- -- /See:/ 'leaseWorkItemRequest' smart constructor. -data LeaseWorkItemRequest = LeaseWorkItemRequest +data LeaseWorkItemRequest = LeaseWorkItemRequest' { _lwirWorkItemTypes :: !(Maybe [Text]) , _lwirCurrentWorkerTime :: !(Maybe Text) , _lwirWorkerCapabilities :: !(Maybe [Text]) @@ -2423,7 +2663,7 @@ data LeaseWorkItemRequest = LeaseWorkItemRequest leaseWorkItemRequest :: LeaseWorkItemRequest leaseWorkItemRequest = - LeaseWorkItemRequest + LeaseWorkItemRequest' { _lwirWorkItemTypes = Nothing , _lwirCurrentWorkerTime = Nothing , _lwirWorkerCapabilities = Nothing @@ -2470,7 +2710,7 @@ instance FromJSON LeaseWorkItemRequest where parseJSON = withObject "LeaseWorkItemRequest" (\ o -> - LeaseWorkItemRequest <$> + LeaseWorkItemRequest' <$> (o .:? "workItemTypes" .!= mempty) <*> (o .:? "currentWorkerTime") <*> (o .:? "workerCapabilities" .!= mempty) @@ -2478,7 +2718,7 @@ instance FromJSON LeaseWorkItemRequest where <*> (o .:? "workerId")) instance ToJSON LeaseWorkItemRequest where - toJSON LeaseWorkItemRequest{..} + toJSON LeaseWorkItemRequest'{..} = object (catMaybes [("workItemTypes" .=) <$> _lwirWorkItemTypes, @@ -2494,7 +2734,7 @@ instance ToJSON LeaseWorkItemRequest where -- completed. -- -- /See:/ 'sourceOperationResponse' smart constructor. -data SourceOperationResponse = SourceOperationResponse +data SourceOperationResponse = SourceOperationResponse' { _sorSplit :: !(Maybe SourceSplitResponse) , _sorGetMetadata :: !(Maybe SourceGetMetadataResponse) } deriving (Eq,Show,Data,Typeable,Generic) @@ -2509,7 +2749,7 @@ data SourceOperationResponse = SourceOperationResponse sourceOperationResponse :: SourceOperationResponse sourceOperationResponse = - SourceOperationResponse + SourceOperationResponse' { _sorSplit = Nothing , _sorGetMetadata = Nothing } @@ -2528,11 +2768,11 @@ instance FromJSON SourceOperationResponse where parseJSON = withObject "SourceOperationResponse" (\ o -> - SourceOperationResponse <$> + SourceOperationResponse' <$> (o .:? "split") <*> (o .:? "getMetadata")) instance ToJSON SourceOperationResponse where - toJSON SourceOperationResponse{..} + toJSON SourceOperationResponse'{..} = object (catMaybes [("split" .=) <$> _sorSplit, @@ -2541,7 +2781,7 @@ instance ToJSON SourceOperationResponse where -- | Maps user stage names to stable computation names. -- -- /See:/ 'topologyConfigUserStageToComputationNameMap' smart constructor. -newtype TopologyConfigUserStageToComputationNameMap = TopologyConfigUserStageToComputationNameMap +newtype TopologyConfigUserStageToComputationNameMap = TopologyConfigUserStageToComputationNameMap' { _tcustcnmAddtional :: HashMap Text Text } deriving (Eq,Show,Data,Typeable,Generic) @@ -2554,7 +2794,7 @@ topologyConfigUserStageToComputationNameMap :: HashMap Text Text -- ^ 'tcustcnmAddtional' -> TopologyConfigUserStageToComputationNameMap topologyConfigUserStageToComputationNameMap pTcustcnmAddtional_ = - TopologyConfigUserStageToComputationNameMap + TopologyConfigUserStageToComputationNameMap' { _tcustcnmAddtional = _Coerce # pTcustcnmAddtional_ } @@ -2570,7 +2810,7 @@ instance FromJSON = withObject "TopologyConfigUserStageToComputationNameMap" (\ o -> - TopologyConfigUserStageToComputationNameMap <$> + TopologyConfigUserStageToComputationNameMap' <$> (parseJSONObject o)) instance ToJSON @@ -2580,7 +2820,7 @@ instance ToJSON -- | A task which consists of a shell command for the worker to execute. -- -- /See:/ 'shellTask' smart constructor. -data ShellTask = ShellTask +data ShellTask = ShellTask' { _stCommand :: !(Maybe Text) , _stExitCode :: !(Maybe (Textual Int32)) } deriving (Eq,Show,Data,Typeable,Generic) @@ -2595,7 +2835,7 @@ data ShellTask = ShellTask shellTask :: ShellTask shellTask = - ShellTask + ShellTask' { _stCommand = Nothing , _stExitCode = Nothing } @@ -2615,11 +2855,11 @@ instance FromJSON ShellTask where parseJSON = withObject "ShellTask" (\ o -> - ShellTask <$> + ShellTask' <$> (o .:? "command") <*> (o .:? "exitCode")) instance ToJSON ShellTask where - toJSON ShellTask{..} + toJSON ShellTask'{..} = object (catMaybes [("command" .=) <$> _stCommand, @@ -2627,7 +2867,7 @@ instance ToJSON ShellTask where -- -- /See:/ 'statusDetailsItem' smart constructor. -newtype StatusDetailsItem = StatusDetailsItem +newtype StatusDetailsItem = StatusDetailsItem' { _sdiAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -2640,7 +2880,7 @@ statusDetailsItem :: HashMap Text JSONValue -- ^ 'sdiAddtional' -> StatusDetailsItem statusDetailsItem pSdiAddtional_ = - StatusDetailsItem + StatusDetailsItem' { _sdiAddtional = _Coerce # pSdiAddtional_ } @@ -2653,16 +2893,69 @@ sdiAddtional instance FromJSON StatusDetailsItem where parseJSON = withObject "StatusDetailsItem" - (\ o -> StatusDetailsItem <$> (parseJSONObject o)) + (\ o -> StatusDetailsItem' <$> (parseJSONObject o)) instance ToJSON StatusDetailsItem where toJSON = toJSON . _sdiAddtional +-- | Represents the level of parallelism in a WorkItem\'s input, reported by +-- the worker. +-- +-- /See:/ 'reportedParallelism' smart constructor. +data ReportedParallelism = ReportedParallelism' + { _rpValue :: !(Maybe (Textual Double)) + , _rpIsInfinite :: !(Maybe Bool) + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ReportedParallelism' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'rpValue' +-- +-- * 'rpIsInfinite' +reportedParallelism + :: ReportedParallelism +reportedParallelism = + ReportedParallelism' + { _rpValue = Nothing + , _rpIsInfinite = Nothing + } + +-- | Specifies the level of parallelism in case it is finite. +rpValue :: Lens' ReportedParallelism (Maybe Double) +rpValue + = lens _rpValue (\ s a -> s{_rpValue = a}) . + mapping _Coerce + +-- | Specifies whether the parallelism is infinite. If true, \"value\" is +-- ignored. Infinite parallelism means the service will assume that the +-- work item can always be split into more non-empty work items by dynamic +-- splitting. This is a work-around for lack of support for infinity by the +-- current JSON-based Java RPC stack. +rpIsInfinite :: Lens' ReportedParallelism (Maybe Bool) +rpIsInfinite + = lens _rpIsInfinite (\ s a -> s{_rpIsInfinite = a}) + +instance FromJSON ReportedParallelism where + parseJSON + = withObject "ReportedParallelism" + (\ o -> + ReportedParallelism' <$> + (o .:? "value") <*> (o .:? "isInfinite")) + +instance ToJSON ReportedParallelism where + toJSON ReportedParallelism'{..} + = object + (catMaybes + [("value" .=) <$> _rpValue, + ("isInfinite" .=) <$> _rpIsInfinite]) + -- | Named properties associated with the step. Each kind of predefined step -- has its own required set of properties. -- -- /See:/ 'stepProperties' smart constructor. -newtype StepProperties = StepProperties +newtype StepProperties = StepProperties' { _spAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -2675,7 +2968,7 @@ stepProperties :: HashMap Text JSONValue -- ^ 'spAddtional' -> StepProperties stepProperties pSpAddtional_ = - StepProperties + StepProperties' { _spAddtional = _Coerce # pSpAddtional_ } @@ -2688,7 +2981,7 @@ spAddtional instance FromJSON StepProperties where parseJSON = withObject "StepProperties" - (\ o -> StepProperties <$> (parseJSONObject o)) + (\ o -> StepProperties' <$> (parseJSONObject o)) instance ToJSON StepProperties where toJSON = toJSON . _spAddtional @@ -2697,8 +2990,10 @@ instance ToJSON StepProperties where -- computations and their sharded locations. -- -- /See:/ 'topologyConfig' smart constructor. -data TopologyConfig = TopologyConfig +data TopologyConfig = TopologyConfig' { _tcDataDiskAssignments :: !(Maybe [DataDiskAssignment]) + , _tcPersistentStateVersion :: !(Maybe (Textual Int32)) + , _tcForwardingKeyBits :: !(Maybe (Textual Int32)) , _tcUserStageToComputationNameMap :: !(Maybe TopologyConfigUserStageToComputationNameMap) , _tcComputations :: !(Maybe [ComputationTopology]) } deriving (Eq,Show,Data,Typeable,Generic) @@ -2709,14 +3004,20 @@ data TopologyConfig = TopologyConfig -- -- * 'tcDataDiskAssignments' -- +-- * 'tcPersistentStateVersion' +-- +-- * 'tcForwardingKeyBits' +-- -- * 'tcUserStageToComputationNameMap' -- -- * 'tcComputations' topologyConfig :: TopologyConfig topologyConfig = - TopologyConfig + TopologyConfig' { _tcDataDiskAssignments = Nothing + , _tcPersistentStateVersion = Nothing + , _tcForwardingKeyBits = Nothing , _tcUserStageToComputationNameMap = Nothing , _tcComputations = Nothing } @@ -2729,6 +3030,20 @@ tcDataDiskAssignments . _Default . _Coerce +-- | Version number for persistent state. +tcPersistentStateVersion :: Lens' TopologyConfig (Maybe Int32) +tcPersistentStateVersion + = lens _tcPersistentStateVersion + (\ s a -> s{_tcPersistentStateVersion = a}) + . mapping _Coerce + +-- | The size (in bits) of keys that will be assigned to source messages. +tcForwardingKeyBits :: Lens' TopologyConfig (Maybe Int32) +tcForwardingKeyBits + = lens _tcForwardingKeyBits + (\ s a -> s{_tcForwardingKeyBits = a}) + . mapping _Coerce + -- | Maps user stage names to stable computation names. tcUserStageToComputationNameMap :: Lens' TopologyConfig (Maybe TopologyConfigUserStageToComputationNameMap) tcUserStageToComputationNameMap @@ -2747,25 +3062,81 @@ instance FromJSON TopologyConfig where parseJSON = withObject "TopologyConfig" (\ o -> - TopologyConfig <$> + TopologyConfig' <$> (o .:? "dataDiskAssignments" .!= mempty) <*> - (o .:? "userStageToComputationNameMap") + (o .:? "persistentStateVersion") + <*> (o .:? "forwardingKeyBits") + <*> (o .:? "userStageToComputationNameMap") <*> (o .:? "computations" .!= mempty)) instance ToJSON TopologyConfig where - toJSON TopologyConfig{..} + toJSON TopologyConfig'{..} = object (catMaybes [("dataDiskAssignments" .=) <$> _tcDataDiskAssignments, + ("persistentStateVersion" .=) <$> + _tcPersistentStateVersion, + ("forwardingKeyBits" .=) <$> _tcForwardingKeyBits, ("userStageToComputationNameMap" .=) <$> _tcUserStageToComputationNameMap, ("computations" .=) <$> _tcComputations]) +-- | A suggestion by the service to the worker to dynamically split the +-- WorkItem. +-- +-- /See:/ 'approximateSplitRequest' smart constructor. +data ApproximateSplitRequest = ApproximateSplitRequest' + { _asrFractionConsumed :: !(Maybe (Textual Double)) + , _asrPosition :: !(Maybe Position) + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ApproximateSplitRequest' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'asrFractionConsumed' +-- +-- * 'asrPosition' +approximateSplitRequest + :: ApproximateSplitRequest +approximateSplitRequest = + ApproximateSplitRequest' + { _asrFractionConsumed = Nothing + , _asrPosition = Nothing + } + +-- | A fraction at which to split the work item, from 0.0 (beginning of the +-- input) to 1.0 (end of the input). +asrFractionConsumed :: Lens' ApproximateSplitRequest (Maybe Double) +asrFractionConsumed + = lens _asrFractionConsumed + (\ s a -> s{_asrFractionConsumed = a}) + . mapping _Coerce + +-- | A Position at which to split the work item. +asrPosition :: Lens' ApproximateSplitRequest (Maybe Position) +asrPosition + = lens _asrPosition (\ s a -> s{_asrPosition = a}) + +instance FromJSON ApproximateSplitRequest where + parseJSON + = withObject "ApproximateSplitRequest" + (\ o -> + ApproximateSplitRequest' <$> + (o .:? "fractionConsumed") <*> (o .:? "position")) + +instance ToJSON ApproximateSplitRequest where + toJSON ApproximateSplitRequest'{..} + = object + (catMaybes + [("fractionConsumed" .=) <$> _asrFractionConsumed, + ("position" .=) <$> _asrPosition]) + -- | Provides data to pass through to the worker harness. -- -- /See:/ 'workerSettings' smart constructor. -data WorkerSettings = WorkerSettings +data WorkerSettings = WorkerSettings' { _wsServicePath :: !(Maybe Text) , _wsBaseURL :: !(Maybe Text) , _wsShuffleServicePath :: !(Maybe Text) @@ -2792,7 +3163,7 @@ data WorkerSettings = WorkerSettings workerSettings :: WorkerSettings workerSettings = - WorkerSettings + WorkerSettings' { _wsServicePath = Nothing , _wsBaseURL = Nothing , _wsShuffleServicePath = Nothing @@ -2849,7 +3220,7 @@ instance FromJSON WorkerSettings where parseJSON = withObject "WorkerSettings" (\ o -> - WorkerSettings <$> + WorkerSettings' <$> (o .:? "servicePath") <*> (o .:? "baseUrl") <*> (o .:? "shuffleServicePath") <*> (o .:? "tempStoragePrefix") @@ -2857,7 +3228,7 @@ instance FromJSON WorkerSettings where <*> (o .:? "workerId")) instance ToJSON WorkerSettings where - toJSON WorkerSettings{..} + toJSON WorkerSettings'{..} = object (catMaybes [("servicePath" .=) <$> _wsServicePath, @@ -2871,7 +3242,7 @@ instance ToJSON WorkerSettings where -- harness. -- -- /See:/ 'workItemServiceStateHarnessData' smart constructor. -newtype WorkItemServiceStateHarnessData = WorkItemServiceStateHarnessData +newtype WorkItemServiceStateHarnessData = WorkItemServiceStateHarnessData' { _wisshdAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -2884,7 +3255,7 @@ workItemServiceStateHarnessData :: HashMap Text JSONValue -- ^ 'wisshdAddtional' -> WorkItemServiceStateHarnessData workItemServiceStateHarnessData pWisshdAddtional_ = - WorkItemServiceStateHarnessData + WorkItemServiceStateHarnessData' { _wisshdAddtional = _Coerce # pWisshdAddtional_ } @@ -2900,7 +3271,7 @@ instance FromJSON WorkItemServiceStateHarnessData parseJSON = withObject "WorkItemServiceStateHarnessData" (\ o -> - WorkItemServiceStateHarnessData <$> + WorkItemServiceStateHarnessData' <$> (parseJSONObject o)) instance ToJSON WorkItemServiceStateHarnessData where @@ -2909,7 +3280,7 @@ instance ToJSON WorkItemServiceStateHarnessData where -- | Data disk assignment for a given VM instance. -- -- /See:/ 'dataDiskAssignment' smart constructor. -data DataDiskAssignment = DataDiskAssignment +data DataDiskAssignment = DataDiskAssignment' { _ddaVMInstance :: !(Maybe Text) , _ddaDataDisks :: !(Maybe [Text]) } deriving (Eq,Show,Data,Typeable,Generic) @@ -2924,7 +3295,7 @@ data DataDiskAssignment = DataDiskAssignment dataDiskAssignment :: DataDiskAssignment dataDiskAssignment = - DataDiskAssignment + DataDiskAssignment' { _ddaVMInstance = Nothing , _ddaDataDisks = Nothing } @@ -2950,28 +3321,69 @@ instance FromJSON DataDiskAssignment where parseJSON = withObject "DataDiskAssignment" (\ o -> - DataDiskAssignment <$> + DataDiskAssignment' <$> (o .:? "vmInstance") <*> (o .:? "dataDisks" .!= mempty)) instance ToJSON DataDiskAssignment where - toJSON DataDiskAssignment{..} + toJSON DataDiskAssignment'{..} = object (catMaybes [("vmInstance" .=) <$> _ddaVMInstance, ("dataDisks" .=) <$> _ddaDataDisks]) +-- | A worker_message response allows the server to pass information to the +-- sender. +-- +-- /See:/ 'workerMessageResponse' smart constructor. +newtype WorkerMessageResponse = WorkerMessageResponse' + { _wmrWorkerHealthReportResponse :: Maybe WorkerHealthReportResponse + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerMessageResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'wmrWorkerHealthReportResponse' +workerMessageResponse + :: WorkerMessageResponse +workerMessageResponse = + WorkerMessageResponse' + { _wmrWorkerHealthReportResponse = Nothing + } + +-- | The service\'s response to a worker\'s health report. +wmrWorkerHealthReportResponse :: Lens' WorkerMessageResponse (Maybe WorkerHealthReportResponse) +wmrWorkerHealthReportResponse + = lens _wmrWorkerHealthReportResponse + (\ s a -> s{_wmrWorkerHealthReportResponse = a}) + +instance FromJSON WorkerMessageResponse where + parseJSON + = withObject "WorkerMessageResponse" + (\ o -> + WorkerMessageResponse' <$> + (o .:? "workerHealthReportResponse")) + +instance ToJSON WorkerMessageResponse where + toJSON WorkerMessageResponse'{..} + = object + (catMaybes + [("workerHealthReportResponse" .=) <$> + _wmrWorkerHealthReportResponse]) + -- | The Dataflow service\'s idea of the current state of a WorkItem being -- processed by a worker. -- -- /See:/ 'workItemServiceState' smart constructor. -data WorkItemServiceState = WorkItemServiceState +data WorkItemServiceState = WorkItemServiceState' { _wissNextReportIndex :: !(Maybe (Textual Int64)) , _wissReportStatusInterval :: !(Maybe Text) , _wissHarnessData :: !(Maybe WorkItemServiceStateHarnessData) , _wissSuggestedStopPoint :: !(Maybe ApproximateProgress) , _wissSuggestedStopPosition :: !(Maybe Position) , _wissLeaseExpireTime :: !(Maybe Text) + , _wissSplitRequest :: !(Maybe ApproximateSplitRequest) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'WorkItemServiceState' with the minimum fields required to make a request. @@ -2989,16 +3401,19 @@ data WorkItemServiceState = WorkItemServiceState -- * 'wissSuggestedStopPosition' -- -- * 'wissLeaseExpireTime' +-- +-- * 'wissSplitRequest' workItemServiceState :: WorkItemServiceState workItemServiceState = - WorkItemServiceState + WorkItemServiceState' { _wissNextReportIndex = Nothing , _wissReportStatusInterval = Nothing , _wissHarnessData = Nothing , _wissSuggestedStopPoint = Nothing , _wissSuggestedStopPosition = Nothing , _wissLeaseExpireTime = Nothing + , _wissSplitRequest = Nothing } -- | The index value to use for the next report sent by the worker. Note: If @@ -3023,8 +3438,7 @@ wissHarnessData = lens _wissHarnessData (\ s a -> s{_wissHarnessData = a}) --- | The progress point in the WorkItem where the Dataflow service suggests --- that the worker truncate the task. +-- | DEPRECATED in favor of split_request. wissSuggestedStopPoint :: Lens' WorkItemServiceState (Maybe ApproximateProgress) wissSuggestedStopPoint = lens _wissSuggestedStopPoint @@ -3042,20 +3456,28 @@ wissLeaseExpireTime = lens _wissLeaseExpireTime (\ s a -> s{_wissLeaseExpireTime = a}) +-- | The progress point in the WorkItem where the Dataflow service suggests +-- that the worker truncate the task. +wissSplitRequest :: Lens' WorkItemServiceState (Maybe ApproximateSplitRequest) +wissSplitRequest + = lens _wissSplitRequest + (\ s a -> s{_wissSplitRequest = a}) + instance FromJSON WorkItemServiceState where parseJSON = withObject "WorkItemServiceState" (\ o -> - WorkItemServiceState <$> + WorkItemServiceState' <$> (o .:? "nextReportIndex") <*> (o .:? "reportStatusInterval") <*> (o .:? "harnessData") <*> (o .:? "suggestedStopPoint") <*> (o .:? "suggestedStopPosition") - <*> (o .:? "leaseExpireTime")) + <*> (o .:? "leaseExpireTime") + <*> (o .:? "splitRequest")) instance ToJSON WorkItemServiceState where - toJSON WorkItemServiceState{..} + toJSON WorkItemServiceState'{..} = object (catMaybes [("nextReportIndex" .=) <$> _wissNextReportIndex, @@ -3066,15 +3488,17 @@ instance ToJSON WorkItemServiceState where _wissSuggestedStopPoint, ("suggestedStopPosition" .=) <$> _wissSuggestedStopPosition, - ("leaseExpireTime" .=) <$> _wissLeaseExpireTime]) + ("leaseExpireTime" .=) <$> _wissLeaseExpireTime, + ("splitRequest" .=) <$> _wissSplitRequest]) -- | A task which initializes part of a streaming Dataflow job. -- -- /See:/ 'streamingSetupTask' smart constructor. -data StreamingSetupTask = StreamingSetupTask +data StreamingSetupTask = StreamingSetupTask' { _sstStreamingComputationTopology :: !(Maybe TopologyConfig) , _sstReceiveWorkPort :: !(Maybe (Textual Int32)) , _sstWorkerHarnessPort :: !(Maybe (Textual Int32)) + , _sstDrain :: !(Maybe Bool) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'StreamingSetupTask' with the minimum fields required to make a request. @@ -3086,13 +3510,16 @@ data StreamingSetupTask = StreamingSetupTask -- * 'sstReceiveWorkPort' -- -- * 'sstWorkerHarnessPort' +-- +-- * 'sstDrain' streamingSetupTask :: StreamingSetupTask streamingSetupTask = - StreamingSetupTask + StreamingSetupTask' { _sstStreamingComputationTopology = Nothing , _sstReceiveWorkPort = Nothing , _sstWorkerHarnessPort = Nothing + , _sstDrain = Nothing } -- | The global topology of the streaming Dataflow job. @@ -3117,28 +3544,34 @@ sstWorkerHarnessPort (\ s a -> s{_sstWorkerHarnessPort = a}) . mapping _Coerce +-- | The user has requested drain. +sstDrain :: Lens' StreamingSetupTask (Maybe Bool) +sstDrain = lens _sstDrain (\ s a -> s{_sstDrain = a}) + instance FromJSON StreamingSetupTask where parseJSON = withObject "StreamingSetupTask" (\ o -> - StreamingSetupTask <$> + StreamingSetupTask' <$> (o .:? "streamingComputationTopology") <*> (o .:? "receiveWorkPort") - <*> (o .:? "workerHarnessPort")) + <*> (o .:? "workerHarnessPort") + <*> (o .:? "drain")) instance ToJSON StreamingSetupTask where - toJSON StreamingSetupTask{..} + toJSON StreamingSetupTask'{..} = object (catMaybes [("streamingComputationTopology" .=) <$> _sstStreamingComputationTopology, ("receiveWorkPort" .=) <$> _sstReceiveWorkPort, - ("workerHarnessPort" .=) <$> _sstWorkerHarnessPort]) + ("workerHarnessPort" .=) <$> _sstWorkerHarnessPort, + ("drain" .=) <$> _sstDrain]) -- | The codec to use for interpreting an element in the input PTable. -- -- /See:/ 'partialGroupByKeyInstructionInputElementCodec' smart constructor. -newtype PartialGroupByKeyInstructionInputElementCodec = PartialGroupByKeyInstructionInputElementCodec +newtype PartialGroupByKeyInstructionInputElementCodec = PartialGroupByKeyInstructionInputElementCodec' { _pgbkiiecAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -3151,7 +3584,7 @@ partialGroupByKeyInstructionInputElementCodec :: HashMap Text JSONValue -- ^ 'pgbkiiecAddtional' -> PartialGroupByKeyInstructionInputElementCodec partialGroupByKeyInstructionInputElementCodec pPgbkiiecAddtional_ = - PartialGroupByKeyInstructionInputElementCodec + PartialGroupByKeyInstructionInputElementCodec' { _pgbkiiecAddtional = _Coerce # pPgbkiiecAddtional_ } @@ -3168,7 +3601,7 @@ instance FromJSON = withObject "PartialGroupByKeyInstructionInputElementCodec" (\ o -> - PartialGroupByKeyInstructionInputElementCodec <$> + PartialGroupByKeyInstructionInputElementCodec' <$> (parseJSONObject o)) instance ToJSON @@ -3181,7 +3614,7 @@ instance ToJSON -- appear in the list before any instructions which depends on its output. -- -- /See:/ 'mapTask' smart constructor. -data MapTask = MapTask +data MapTask = MapTask' { _mtInstructions :: !(Maybe [ParallelInstruction]) , _mtSystemName :: !(Maybe Text) , _mtStageName :: !(Maybe Text) @@ -3199,7 +3632,7 @@ data MapTask = MapTask mapTask :: MapTask mapTask = - MapTask + MapTask' { _mtInstructions = Nothing , _mtSystemName = Nothing , _mtStageName = Nothing @@ -3228,13 +3661,13 @@ instance FromJSON MapTask where parseJSON = withObject "MapTask" (\ o -> - MapTask <$> + MapTask' <$> (o .:? "instructions" .!= mempty) <*> (o .:? "systemName") <*> (o .:? "stageName")) instance ToJSON MapTask where - toJSON MapTask{..} + toJSON MapTask'{..} = object (catMaybes [("instructions" .=) <$> _mtInstructions, @@ -3244,7 +3677,7 @@ instance ToJSON MapTask where -- | Describes mounted data disk. -- -- /See:/ 'mountedDataDisk' smart constructor. -newtype MountedDataDisk = MountedDataDisk +newtype MountedDataDisk = MountedDataDisk' { _mddDataDisk :: Maybe Text } deriving (Eq,Show,Data,Typeable,Generic) @@ -3256,7 +3689,7 @@ newtype MountedDataDisk = MountedDataDisk mountedDataDisk :: MountedDataDisk mountedDataDisk = - MountedDataDisk + MountedDataDisk' { _mddDataDisk = Nothing } @@ -3270,17 +3703,17 @@ mddDataDisk instance FromJSON MountedDataDisk where parseJSON = withObject "MountedDataDisk" - (\ o -> MountedDataDisk <$> (o .:? "dataDisk")) + (\ o -> MountedDataDisk' <$> (o .:? "dataDisk")) instance ToJSON MountedDataDisk where - toJSON MountedDataDisk{..} + toJSON MountedDataDisk'{..} = object (catMaybes [("dataDisk" .=) <$> _mddDataDisk]) -- | The codec to use to encode data written to the sink. -- -- /See:/ 'sinkCodec' smart constructor. -newtype SinkCodec = SinkCodec +newtype SinkCodec = SinkCodec' { _scAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -3293,7 +3726,7 @@ sinkCodec :: HashMap Text JSONValue -- ^ 'scAddtional' -> SinkCodec sinkCodec pScAddtional_ = - SinkCodec + SinkCodec' { _scAddtional = _Coerce # pScAddtional_ } @@ -3306,15 +3739,50 @@ scAddtional instance FromJSON SinkCodec where parseJSON = withObject "SinkCodec" - (\ o -> SinkCodec <$> (parseJSONObject o)) + (\ o -> SinkCodec' <$> (parseJSONObject o)) instance ToJSON SinkCodec where toJSON = toJSON . _scAddtional +-- +-- /See:/ 'workerHealthReportPodsItem' smart constructor. +newtype WorkerHealthReportPodsItem = WorkerHealthReportPodsItem' + { _whrpiAddtional :: HashMap Text JSONValue + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerHealthReportPodsItem' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'whrpiAddtional' +workerHealthReportPodsItem + :: HashMap Text JSONValue -- ^ 'whrpiAddtional' + -> WorkerHealthReportPodsItem +workerHealthReportPodsItem pWhrpiAddtional_ = + WorkerHealthReportPodsItem' + { _whrpiAddtional = _Coerce # pWhrpiAddtional_ + } + +-- | Properties of the object. +whrpiAddtional :: Lens' WorkerHealthReportPodsItem (HashMap Text JSONValue) +whrpiAddtional + = lens _whrpiAddtional + (\ s a -> s{_whrpiAddtional = a}) + . _Coerce + +instance FromJSON WorkerHealthReportPodsItem where + parseJSON + = withObject "WorkerHealthReportPodsItem" + (\ o -> + WorkerHealthReportPodsItem' <$> (parseJSONObject o)) + +instance ToJSON WorkerHealthReportPodsItem where + toJSON = toJSON . _whrpiAddtional + -- | The user function to invoke. -- -- /See:/ 'parDoInstructionUserFn' smart constructor. -newtype ParDoInstructionUserFn = ParDoInstructionUserFn +newtype ParDoInstructionUserFn = ParDoInstructionUserFn' { _pdiufAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -3327,7 +3795,7 @@ parDoInstructionUserFn :: HashMap Text JSONValue -- ^ 'pdiufAddtional' -> ParDoInstructionUserFn parDoInstructionUserFn pPdiufAddtional_ = - ParDoInstructionUserFn + ParDoInstructionUserFn' { _pdiufAddtional = _Coerce # pPdiufAddtional_ } @@ -3342,7 +3810,7 @@ instance FromJSON ParDoInstructionUserFn where parseJSON = withObject "ParDoInstructionUserFn" (\ o -> - ParDoInstructionUserFn <$> (parseJSONObject o)) + ParDoInstructionUserFn' <$> (parseJSONObject o)) instance ToJSON ParDoInstructionUserFn where toJSON = toJSON . _pdiufAddtional @@ -3350,7 +3818,7 @@ instance ToJSON ParDoInstructionUserFn where -- | The codec to use to encode data being written via this output. -- -- /See:/ 'instructionOutputCodec' smart constructor. -newtype InstructionOutputCodec = InstructionOutputCodec +newtype InstructionOutputCodec = InstructionOutputCodec' { _iocAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -3363,7 +3831,7 @@ instructionOutputCodec :: HashMap Text JSONValue -- ^ 'iocAddtional' -> InstructionOutputCodec instructionOutputCodec pIocAddtional_ = - InstructionOutputCodec + InstructionOutputCodec' { _iocAddtional = _Coerce # pIocAddtional_ } @@ -3377,7 +3845,7 @@ instance FromJSON InstructionOutputCodec where parseJSON = withObject "InstructionOutputCodec" (\ o -> - InstructionOutputCodec <$> (parseJSONObject o)) + InstructionOutputCodec' <$> (parseJSONObject o)) instance ToJSON InstructionOutputCodec where toJSON = toJSON . _iocAddtional @@ -3386,7 +3854,7 @@ instance ToJSON InstructionOutputCodec where -- of a streaming Dataflow job. -- -- /See:/ 'streamLocation' smart constructor. -data StreamLocation = StreamLocation +data StreamLocation = StreamLocation' { _slStreamingStageLocation :: !(Maybe StreamingStageLocation) , _slSideInputLocation :: !(Maybe StreamingSideInputLocation) , _slCustomSourceLocation :: !(Maybe CustomSourceLocation) @@ -3407,7 +3875,7 @@ data StreamLocation = StreamLocation streamLocation :: StreamLocation streamLocation = - StreamLocation + StreamLocation' { _slStreamingStageLocation = Nothing , _slSideInputLocation = Nothing , _slCustomSourceLocation = Nothing @@ -3443,14 +3911,14 @@ instance FromJSON StreamLocation where parseJSON = withObject "StreamLocation" (\ o -> - StreamLocation <$> + StreamLocation' <$> (o .:? "streamingStageLocation") <*> (o .:? "sideInputLocation") <*> (o .:? "customSourceLocation") <*> (o .:? "pubsubLocation")) instance ToJSON StreamLocation where - toJSON StreamLocation{..} + toJSON StreamLocation'{..} = object (catMaybes [("streamingStageLocation" .=) <$> @@ -3463,7 +3931,7 @@ instance ToJSON StreamLocation where -- | Extra arguments for this worker pool. -- -- /See:/ 'workerPoolPoolArgs' smart constructor. -newtype WorkerPoolPoolArgs = WorkerPoolPoolArgs +newtype WorkerPoolPoolArgs = WorkerPoolPoolArgs' { _wppaAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -3476,7 +3944,7 @@ workerPoolPoolArgs :: HashMap Text JSONValue -- ^ 'wppaAddtional' -> WorkerPoolPoolArgs workerPoolPoolArgs pWppaAddtional_ = - WorkerPoolPoolArgs + WorkerPoolPoolArgs' { _wppaAddtional = _Coerce # pWppaAddtional_ } @@ -3490,15 +3958,56 @@ wppaAddtional instance FromJSON WorkerPoolPoolArgs where parseJSON = withObject "WorkerPoolPoolArgs" - (\ o -> WorkerPoolPoolArgs <$> (parseJSONObject o)) + (\ o -> WorkerPoolPoolArgs' <$> (parseJSONObject o)) instance ToJSON WorkerPoolPoolArgs where toJSON = toJSON . _wppaAddtional +-- | The response to the worker messages. +-- +-- /See:/ 'sendWorkerMessagesResponse' smart constructor. +newtype SendWorkerMessagesResponse = SendWorkerMessagesResponse' + { _swmrWorkerMessageResponses :: Maybe [WorkerMessageResponse] + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'SendWorkerMessagesResponse' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'swmrWorkerMessageResponses' +sendWorkerMessagesResponse + :: SendWorkerMessagesResponse +sendWorkerMessagesResponse = + SendWorkerMessagesResponse' + { _swmrWorkerMessageResponses = Nothing + } + +-- | The servers response to the worker messages. +swmrWorkerMessageResponses :: Lens' SendWorkerMessagesResponse [WorkerMessageResponse] +swmrWorkerMessageResponses + = lens _swmrWorkerMessageResponses + (\ s a -> s{_swmrWorkerMessageResponses = a}) + . _Default + . _Coerce + +instance FromJSON SendWorkerMessagesResponse where + parseJSON + = withObject "SendWorkerMessagesResponse" + (\ o -> + SendWorkerMessagesResponse' <$> + (o .:? "workerMessageResponses" .!= mempty)) + +instance ToJSON SendWorkerMessagesResponse where + toJSON SendWorkerMessagesResponse'{..} + = object + (catMaybes + [("workerMessageResponses" .=) <$> + _swmrWorkerMessageResponses]) + -- | Identifies the location of a streaming side input. -- -- /See:/ 'streamingSideInputLocation' smart constructor. -data StreamingSideInputLocation = StreamingSideInputLocation +data StreamingSideInputLocation = StreamingSideInputLocation' { _ssilTag :: !(Maybe Text) , _ssilStateFamily :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -3513,7 +4022,7 @@ data StreamingSideInputLocation = StreamingSideInputLocation streamingSideInputLocation :: StreamingSideInputLocation streamingSideInputLocation = - StreamingSideInputLocation + StreamingSideInputLocation' { _ssilTag = Nothing , _ssilStateFamily = Nothing } @@ -3532,11 +4041,11 @@ instance FromJSON StreamingSideInputLocation where parseJSON = withObject "StreamingSideInputLocation" (\ o -> - StreamingSideInputLocation <$> + StreamingSideInputLocation' <$> (o .:? "tag") <*> (o .:? "stateFamily")) instance ToJSON StreamingSideInputLocation where - toJSON StreamingSideInputLocation{..} + toJSON StreamingSideInputLocation'{..} = object (catMaybes [("tag" .=) <$> _ssilTag, @@ -3546,7 +4055,7 @@ instance ToJSON StreamingSideInputLocation where -- streaming computation ranges. -- -- /See:/ 'streamingComputationTask' smart constructor. -data StreamingComputationTask = StreamingComputationTask +data StreamingComputationTask = StreamingComputationTask' { _sctTaskType :: !(Maybe Text) , _sctDataDisks :: !(Maybe [MountedDataDisk]) , _sctComputationRanges :: !(Maybe [StreamingComputationRanges]) @@ -3564,7 +4073,7 @@ data StreamingComputationTask = StreamingComputationTask streamingComputationTask :: StreamingComputationTask streamingComputationTask = - StreamingComputationTask + StreamingComputationTask' { _sctTaskType = Nothing , _sctDataDisks = Nothing , _sctComputationRanges = Nothing @@ -3594,12 +4103,12 @@ instance FromJSON StreamingComputationTask where parseJSON = withObject "StreamingComputationTask" (\ o -> - StreamingComputationTask <$> + StreamingComputationTask' <$> (o .:? "taskType") <*> (o .:? "dataDisks" .!= mempty) <*> (o .:? "computationRanges" .!= mempty)) instance ToJSON StreamingComputationTask where - toJSON StreamingComputationTask{..} + toJSON StreamingComputationTask'{..} = object (catMaybes [("taskType" .=) <$> _sctTaskType, @@ -3609,7 +4118,7 @@ instance ToJSON StreamingComputationTask where -- | A particular message pertaining to a Dataflow job. -- -- /See:/ 'jobMessage' smart constructor. -data JobMessage = JobMessage +data JobMessage = JobMessage' { _jmTime :: !(Maybe Text) , _jmMessageText :: !(Maybe Text) , _jmMessageImportance :: !(Maybe Text) @@ -3630,7 +4139,7 @@ data JobMessage = JobMessage jobMessage :: JobMessage jobMessage = - JobMessage + JobMessage' { _jmTime = Nothing , _jmMessageText = Nothing , _jmMessageImportance = Nothing @@ -3662,13 +4171,13 @@ instance FromJSON JobMessage where parseJSON = withObject "JobMessage" (\ o -> - JobMessage <$> + JobMessage' <$> (o .:? "time") <*> (o .:? "messageText") <*> (o .:? "messageImportance") <*> (o .:? "id")) instance ToJSON JobMessage where - toJSON JobMessage{..} + toJSON JobMessage'{..} = object (catMaybes [("time" .=) <$> _jmTime, @@ -3679,7 +4188,7 @@ instance ToJSON JobMessage where -- | Information about an output of a SeqMapTask. -- -- /See:/ 'seqMapTaskOutputInfo' smart constructor. -data SeqMapTaskOutputInfo = SeqMapTaskOutputInfo +data SeqMapTaskOutputInfo = SeqMapTaskOutputInfo' { _smtoiSink :: !(Maybe Sink) , _smtoiTag :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -3694,7 +4203,7 @@ data SeqMapTaskOutputInfo = SeqMapTaskOutputInfo seqMapTaskOutputInfo :: SeqMapTaskOutputInfo seqMapTaskOutputInfo = - SeqMapTaskOutputInfo + SeqMapTaskOutputInfo' { _smtoiSink = Nothing , _smtoiTag = Nothing } @@ -3712,11 +4221,11 @@ instance FromJSON SeqMapTaskOutputInfo where parseJSON = withObject "SeqMapTaskOutputInfo" (\ o -> - SeqMapTaskOutputInfo <$> + SeqMapTaskOutputInfo' <$> (o .:? "sink") <*> (o .:? "tag")) instance ToJSON SeqMapTaskOutputInfo where - toJSON SeqMapTaskOutputInfo{..} + toJSON SeqMapTaskOutputInfo'{..} = object (catMaybes [("sink" .=) <$> _smtoiSink, @@ -3725,7 +4234,7 @@ instance ToJSON SeqMapTaskOutputInfo where -- | A request to compute the SourceMetadata of a Source. -- -- /See:/ 'sourceGetMetadataRequest' smart constructor. -newtype SourceGetMetadataRequest = SourceGetMetadataRequest +newtype SourceGetMetadataRequest = SourceGetMetadataRequest' { _sgmrSource :: Maybe Source } deriving (Eq,Show,Data,Typeable,Generic) @@ -3737,7 +4246,7 @@ newtype SourceGetMetadataRequest = SourceGetMetadataRequest sourceGetMetadataRequest :: SourceGetMetadataRequest sourceGetMetadataRequest = - SourceGetMetadataRequest + SourceGetMetadataRequest' { _sgmrSource = Nothing } @@ -3750,16 +4259,16 @@ instance FromJSON SourceGetMetadataRequest where parseJSON = withObject "SourceGetMetadataRequest" (\ o -> - SourceGetMetadataRequest <$> (o .:? "source")) + SourceGetMetadataRequest' <$> (o .:? "source")) instance ToJSON SourceGetMetadataRequest where - toJSON SourceGetMetadataRequest{..} + toJSON SourceGetMetadataRequest'{..} = object (catMaybes [("source" .=) <$> _sgmrSource]) -- | The user function to invoke. -- -- /See:/ 'seqMapTaskUserFn' smart constructor. -newtype SeqMapTaskUserFn = SeqMapTaskUserFn +newtype SeqMapTaskUserFn = SeqMapTaskUserFn' { _smtufAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -3772,7 +4281,7 @@ seqMapTaskUserFn :: HashMap Text JSONValue -- ^ 'smtufAddtional' -> SeqMapTaskUserFn seqMapTaskUserFn pSmtufAddtional_ = - SeqMapTaskUserFn + SeqMapTaskUserFn' { _smtufAddtional = _Coerce # pSmtufAddtional_ } @@ -3786,7 +4295,7 @@ smtufAddtional instance FromJSON SeqMapTaskUserFn where parseJSON = withObject "SeqMapTaskUserFn" - (\ o -> SeqMapTaskUserFn <$> (parseJSONObject o)) + (\ o -> SeqMapTaskUserFn' <$> (parseJSONObject o)) instance ToJSON SeqMapTaskUserFn where toJSON = toJSON . _smtufAddtional @@ -3794,7 +4303,7 @@ instance ToJSON SeqMapTaskUserFn where -- | The value combining function to invoke. -- -- /See:/ 'partialGroupByKeyInstructionValueCombiningFn' smart constructor. -newtype PartialGroupByKeyInstructionValueCombiningFn = PartialGroupByKeyInstructionValueCombiningFn +newtype PartialGroupByKeyInstructionValueCombiningFn = PartialGroupByKeyInstructionValueCombiningFn' { _pgbkivcfAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -3807,7 +4316,7 @@ partialGroupByKeyInstructionValueCombiningFn :: HashMap Text JSONValue -- ^ 'pgbkivcfAddtional' -> PartialGroupByKeyInstructionValueCombiningFn partialGroupByKeyInstructionValueCombiningFn pPgbkivcfAddtional_ = - PartialGroupByKeyInstructionValueCombiningFn + PartialGroupByKeyInstructionValueCombiningFn' { _pgbkivcfAddtional = _Coerce # pPgbkivcfAddtional_ } @@ -3824,7 +4333,7 @@ instance FromJSON = withObject "PartialGroupByKeyInstructionValueCombiningFn" (\ o -> - PartialGroupByKeyInstructionValueCombiningFn <$> + PartialGroupByKeyInstructionValueCombiningFn' <$> (parseJSONObject o)) instance ToJSON @@ -3834,12 +4343,13 @@ instance ToJSON -- | Defines a job to be run by the Dataflow service. -- -- /See:/ 'job' smart constructor. -data Job = Job +data Job = Job' { _jRequestedState :: !(Maybe Text) , _jEnvironment :: !(Maybe Environment) , _jClientRequestId :: !(Maybe Text) , _jCurrentState :: !(Maybe Text) , _jReplacedByJobId :: !(Maybe Text) + , _jTempFiles :: !(Maybe [Text]) , _jSteps :: !(Maybe [Step]) , _jExecutionInfo :: !(Maybe JobExecutionInfo) , _jName :: !(Maybe Text) @@ -3866,6 +4376,8 @@ data Job = Job -- -- * 'jReplacedByJobId' -- +-- * 'jTempFiles' +-- -- * 'jSteps' -- -- * 'jExecutionInfo' @@ -3888,12 +4400,13 @@ data Job = Job job :: Job job = - Job + Job' { _jRequestedState = Nothing , _jEnvironment = Nothing , _jClientRequestId = Nothing , _jCurrentState = Nothing , _jReplacedByJobId = Nothing + , _jTempFiles = Nothing , _jSteps = Nothing , _jExecutionInfo = Nothing , _jName = Nothing @@ -3950,6 +4463,18 @@ jReplacedByJobId = lens _jReplacedByJobId (\ s a -> s{_jReplacedByJobId = a}) +-- | A set of files the system should be aware of that are used for temporary +-- storage. These temporary files will be removed on job completion. No +-- duplicates are allowed. No file patterns are supported. The supported +-- files are: Google Cloud Storage: +-- storage.googleapis.com\/{bucket}\/{object} +-- bucket.storage.googleapis.com\/{object} +jTempFiles :: Lens' Job [Text] +jTempFiles + = lens _jTempFiles (\ s a -> s{_jTempFiles = a}) . + _Default + . _Coerce + -- | The top-level steps that constitute the entire job. jSteps :: Lens' Job [Step] jSteps @@ -4016,11 +4541,12 @@ instance FromJSON Job where parseJSON = withObject "Job" (\ o -> - Job <$> + Job' <$> (o .:? "requestedState") <*> (o .:? "environment") <*> (o .:? "clientRequestId") <*> (o .:? "currentState") <*> (o .:? "replacedByJobId") + <*> (o .:? "tempFiles" .!= mempty) <*> (o .:? "steps" .!= mempty) <*> (o .:? "executionInfo") <*> (o .:? "name") @@ -4033,7 +4559,7 @@ instance FromJSON Job where <*> (o .:? "createTime")) instance ToJSON Job where - toJSON Job{..} + toJSON Job'{..} = object (catMaybes [("requestedState" .=) <$> _jRequestedState, @@ -4041,6 +4567,7 @@ instance ToJSON Job where ("clientRequestId" .=) <$> _jClientRequestId, ("currentState" .=) <$> _jCurrentState, ("replacedByJobId" .=) <$> _jReplacedByJobId, + ("tempFiles" .=) <$> _jTempFiles, ("steps" .=) <$> _jSteps, ("executionInfo" .=) <$> _jExecutionInfo, ("name" .=) <$> _jName, @@ -4055,7 +4582,7 @@ instance ToJSON Job where -- | An instruction that reads records. Takes no inputs, produces one output. -- -- /See:/ 'readInstruction' smart constructor. -newtype ReadInstruction = ReadInstruction +newtype ReadInstruction = ReadInstruction' { _riSource :: Maybe Source } deriving (Eq,Show,Data,Typeable,Generic) @@ -4067,7 +4594,7 @@ newtype ReadInstruction = ReadInstruction readInstruction :: ReadInstruction readInstruction = - ReadInstruction + ReadInstruction' { _riSource = Nothing } @@ -4078,16 +4605,114 @@ riSource = lens _riSource (\ s a -> s{_riSource = a}) instance FromJSON ReadInstruction where parseJSON = withObject "ReadInstruction" - (\ o -> ReadInstruction <$> (o .:? "source")) + (\ o -> ReadInstruction' <$> (o .:? "source")) instance ToJSON ReadInstruction where - toJSON ReadInstruction{..} + toJSON ReadInstruction'{..} = object (catMaybes [("source" .=) <$> _riSource]) +-- | A progress measurement of a WorkItem by a worker. +-- +-- /See:/ 'approximateReportedProgress' smart constructor. +data ApproximateReportedProgress = ApproximateReportedProgress' + { _arpFractionConsumed :: !(Maybe (Textual Double)) + , _arpConsumedParallelism :: !(Maybe ReportedParallelism) + , _arpRemainingParallelism :: !(Maybe ReportedParallelism) + , _arpPosition :: !(Maybe Position) + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ApproximateReportedProgress' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'arpFractionConsumed' +-- +-- * 'arpConsumedParallelism' +-- +-- * 'arpRemainingParallelism' +-- +-- * 'arpPosition' +approximateReportedProgress + :: ApproximateReportedProgress +approximateReportedProgress = + ApproximateReportedProgress' + { _arpFractionConsumed = Nothing + , _arpConsumedParallelism = Nothing + , _arpRemainingParallelism = Nothing + , _arpPosition = Nothing + } + +-- | Completion as fraction of the input consumed, from 0.0 (beginning, +-- nothing consumed), to 1.0 (end of the input, entire input consumed). +arpFractionConsumed :: Lens' ApproximateReportedProgress (Maybe Double) +arpFractionConsumed + = lens _arpFractionConsumed + (\ s a -> s{_arpFractionConsumed = a}) + . mapping _Coerce + +-- | Total amount of parallelism in the portion of input of this work item +-- that has already been consumed. In the first two examples above (see +-- remaining_parallelism), the value should be 30 or 3 respectively. The +-- sum of remaining_parallelism and consumed_parallelism should equal the +-- total amount of parallelism in this work item. If specified, must be +-- finite. +arpConsumedParallelism :: Lens' ApproximateReportedProgress (Maybe ReportedParallelism) +arpConsumedParallelism + = lens _arpConsumedParallelism + (\ s a -> s{_arpConsumedParallelism = a}) + +-- | Total amount of parallelism in the input of this WorkItem that has not +-- been consumed yet (i.e. can be delegated to a new WorkItem via dynamic +-- splitting). \"Amount of parallelism\" refers to how many non-empty parts +-- of the input can be read in parallel. This does not necessarily equal +-- number of records. An input that can be read in parallel down to the +-- individual records is called \"perfectly splittable\". An example of +-- non-perfectly parallelizable input is a block-compressed file format +-- where a block of records has to be read as a whole, but different blocks +-- can be read in parallel. Examples: * If we have read 30 records out of +-- 50 in a perfectly splittable 50-record input, this value should be 20. * +-- If we are reading through block 3 in a block-compressed file consisting +-- of 5 blocks, this value should be 2 (since blocks 4 and 5 can be +-- processed in parallel by new work items via dynamic splitting). * If we +-- are reading through the last block in a block-compressed file, or +-- reading or processing the last record in a perfectly splittable input, +-- this value should be 0, because the remainder of the work item cannot be +-- further split. +arpRemainingParallelism :: Lens' ApproximateReportedProgress (Maybe ReportedParallelism) +arpRemainingParallelism + = lens _arpRemainingParallelism + (\ s a -> s{_arpRemainingParallelism = a}) + +-- | A Position within the work to represent a progress. +arpPosition :: Lens' ApproximateReportedProgress (Maybe Position) +arpPosition + = lens _arpPosition (\ s a -> s{_arpPosition = a}) + +instance FromJSON ApproximateReportedProgress where + parseJSON + = withObject "ApproximateReportedProgress" + (\ o -> + ApproximateReportedProgress' <$> + (o .:? "fractionConsumed") <*> + (o .:? "consumedParallelism") + <*> (o .:? "remainingParallelism") + <*> (o .:? "position")) + +instance ToJSON ApproximateReportedProgress where + toJSON ApproximateReportedProgress'{..} + = object + (catMaybes + [("fractionConsumed" .=) <$> _arpFractionConsumed, + ("consumedParallelism" .=) <$> + _arpConsumedParallelism, + ("remainingParallelism" .=) <$> + _arpRemainingParallelism, + ("position" .=) <$> _arpPosition]) + -- | The sink to write to, plus its parameters. -- -- /See:/ 'sinkSpec' smart constructor. -newtype SinkSpec = SinkSpec +newtype SinkSpec = SinkSpec' { _sAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -4100,7 +4725,7 @@ sinkSpec :: HashMap Text JSONValue -- ^ 'sAddtional' -> SinkSpec sinkSpec pSAddtional_ = - SinkSpec + SinkSpec' { _sAddtional = _Coerce # pSAddtional_ } @@ -4113,7 +4738,7 @@ sAddtional instance FromJSON SinkSpec where parseJSON = withObject "SinkSpec" - (\ o -> SinkSpec <$> (parseJSONObject o)) + (\ o -> SinkSpec' <$> (parseJSONObject o)) instance ToJSON SinkSpec where toJSON = toJSON . _sAddtional @@ -4124,24 +4749,27 @@ instance ToJSON SinkSpec where -- the various computational requirements of the various stages of the job. -- -- /See:/ 'workerPool' smart constructor. -data WorkerPool = WorkerPool - { _wpAutoscalingSettings :: !(Maybe AutoscalingSettings) - , _wpDiskSizeGb :: !(Maybe (Textual Int32)) - , _wpKind :: !(Maybe Text) - , _wpTaskrunnerSettings :: !(Maybe TaskRunnerSettings) - , _wpNumWorkers :: !(Maybe (Textual Int32)) - , _wpNetwork :: !(Maybe Text) - , _wpZone :: !(Maybe Text) - , _wpPackages :: !(Maybe [Package]) - , _wpOnHostMaintenance :: !(Maybe Text) - , _wpDiskSourceImage :: !(Maybe Text) - , _wpMachineType :: !(Maybe Text) - , _wpMetadata :: !(Maybe WorkerPoolMetadata) - , _wpDiskType :: !(Maybe Text) - , _wpTeardownPolicy :: !(Maybe Text) - , _wpDefaultPackageSet :: !(Maybe Text) - , _wpPoolArgs :: !(Maybe WorkerPoolPoolArgs) - , _wpDataDisks :: !(Maybe [Disk]) +data WorkerPool = WorkerPool' + { _wpAutoscalingSettings :: !(Maybe AutoscalingSettings) + , _wpNumThreadsPerWorker :: !(Maybe (Textual Int32)) + , _wpDiskSizeGb :: !(Maybe (Textual Int32)) + , _wpKind :: !(Maybe Text) + , _wpTaskrunnerSettings :: !(Maybe TaskRunnerSettings) + , _wpNumWorkers :: !(Maybe (Textual Int32)) + , _wpNetwork :: !(Maybe Text) + , _wpZone :: !(Maybe Text) + , _wpPackages :: !(Maybe [Package]) + , _wpOnHostMaintenance :: !(Maybe Text) + , _wpDiskSourceImage :: !(Maybe Text) + , _wpSubnetwork :: !(Maybe Text) + , _wpMachineType :: !(Maybe Text) + , _wpMetadata :: !(Maybe WorkerPoolMetadata) + , _wpDiskType :: !(Maybe Text) + , _wpTeardownPolicy :: !(Maybe Text) + , _wpDefaultPackageSet :: !(Maybe Text) + , _wpPoolArgs :: !(Maybe WorkerPoolPoolArgs) + , _wpWorkerHarnessContainerImage :: !(Maybe Text) + , _wpDataDisks :: !(Maybe [Disk]) } deriving (Eq,Show,Data,Typeable,Generic) -- | Creates a value of 'WorkerPool' with the minimum fields required to make a request. @@ -4150,6 +4778,8 @@ data WorkerPool = WorkerPool -- -- * 'wpAutoscalingSettings' -- +-- * 'wpNumThreadsPerWorker' +-- -- * 'wpDiskSizeGb' -- -- * 'wpKind' @@ -4168,6 +4798,8 @@ data WorkerPool = WorkerPool -- -- * 'wpDiskSourceImage' -- +-- * 'wpSubnetwork' +-- -- * 'wpMachineType' -- -- * 'wpMetadata' @@ -4180,12 +4812,15 @@ data WorkerPool = WorkerPool -- -- * 'wpPoolArgs' -- +-- * 'wpWorkerHarnessContainerImage' +-- -- * 'wpDataDisks' workerPool :: WorkerPool workerPool = - WorkerPool + WorkerPool' { _wpAutoscalingSettings = Nothing + , _wpNumThreadsPerWorker = Nothing , _wpDiskSizeGb = Nothing , _wpKind = Nothing , _wpTaskrunnerSettings = Nothing @@ -4195,12 +4830,14 @@ workerPool = , _wpPackages = Nothing , _wpOnHostMaintenance = Nothing , _wpDiskSourceImage = Nothing + , _wpSubnetwork = Nothing , _wpMachineType = Nothing , _wpMetadata = Nothing , _wpDiskType = Nothing , _wpTeardownPolicy = Nothing , _wpDefaultPackageSet = Nothing , _wpPoolArgs = Nothing + , _wpWorkerHarnessContainerImage = Nothing , _wpDataDisks = Nothing } @@ -4210,6 +4847,16 @@ wpAutoscalingSettings = lens _wpAutoscalingSettings (\ s a -> s{_wpAutoscalingSettings = a}) +-- | The number of threads per worker harness. If empty or unspecified, the +-- service will choose a number of threads (according to the number of +-- cores on the selected machine type for batch, or 1 by convention for +-- streaming). +wpNumThreadsPerWorker :: Lens' WorkerPool (Maybe Int32) +wpNumThreadsPerWorker + = lens _wpNumThreadsPerWorker + (\ s a -> s{_wpNumThreadsPerWorker = a}) + . mapping _Coerce + -- | Size of root disk for VMs, in GB. If zero or unspecified, the service -- will attempt to choose a reasonable default. wpDiskSizeGb :: Lens' WorkerPool (Maybe Int32) @@ -4243,8 +4890,8 @@ wpNetwork :: Lens' WorkerPool (Maybe Text) wpNetwork = lens _wpNetwork (\ s a -> s{_wpNetwork = a}) --- | Zone to run the worker pools in (e.g. \"us-central1-b\"). If empty or --- unspecified, the service will attempt to choose a reasonable default. +-- | Zone to run the worker pools in. If empty or unspecified, the service +-- will attempt to choose a reasonable default. wpZone :: Lens' WorkerPool (Maybe Text) wpZone = lens _wpZone (\ s a -> s{_wpZone = a}) @@ -4268,6 +4915,12 @@ wpDiskSourceImage = lens _wpDiskSourceImage (\ s a -> s{_wpDiskSourceImage = a}) +-- | Subnetwork to which VMs will be assigned, if desired. Expected to be of +-- the form \"zones\/ZONE\/subnetworks\/SUBNETWORK\". +wpSubnetwork :: Lens' WorkerPool (Maybe Text) +wpSubnetwork + = lens _wpSubnetwork (\ s a -> s{_wpSubnetwork = a}) + -- | Machine type (e.g. \"n1-standard-1\"). If empty or unspecified, the -- service will attempt to choose a reasonable default. wpMachineType :: Lens' WorkerPool (Maybe Text) @@ -4315,6 +4968,13 @@ wpPoolArgs :: Lens' WorkerPool (Maybe WorkerPoolPoolArgs) wpPoolArgs = lens _wpPoolArgs (\ s a -> s{_wpPoolArgs = a}) +-- | Docker container image that executes Dataflow worker harness, residing +-- in Google Container Registry. Required. +wpWorkerHarnessContainerImage :: Lens' WorkerPool (Maybe Text) +wpWorkerHarnessContainerImage + = lens _wpWorkerHarnessContainerImage + (\ s a -> s{_wpWorkerHarnessContainerImage = a}) + -- | Data disks that are used by a VM in this workflow. wpDataDisks :: Lens' WorkerPool [Disk] wpDataDisks @@ -4326,9 +4986,10 @@ instance FromJSON WorkerPool where parseJSON = withObject "WorkerPool" (\ o -> - WorkerPool <$> + WorkerPool' <$> (o .:? "autoscalingSettings") <*> - (o .:? "diskSizeGb") + (o .:? "numThreadsPerWorker") + <*> (o .:? "diskSizeGb") <*> (o .:? "kind") <*> (o .:? "taskrunnerSettings") <*> (o .:? "numWorkers") @@ -4337,20 +4998,24 @@ instance FromJSON WorkerPool where <*> (o .:? "packages" .!= mempty) <*> (o .:? "onHostMaintenance") <*> (o .:? "diskSourceImage") + <*> (o .:? "subnetwork") <*> (o .:? "machineType") <*> (o .:? "metadata") <*> (o .:? "diskType") <*> (o .:? "teardownPolicy") <*> (o .:? "defaultPackageSet") <*> (o .:? "poolArgs") + <*> (o .:? "workerHarnessContainerImage") <*> (o .:? "dataDisks" .!= mempty)) instance ToJSON WorkerPool where - toJSON WorkerPool{..} + toJSON WorkerPool'{..} = object (catMaybes [("autoscalingSettings" .=) <$> _wpAutoscalingSettings, + ("numThreadsPerWorker" .=) <$> + _wpNumThreadsPerWorker, ("diskSizeGb" .=) <$> _wpDiskSizeGb, ("kind" .=) <$> _wpKind, ("taskrunnerSettings" .=) <$> _wpTaskrunnerSettings, @@ -4360,12 +5025,15 @@ instance ToJSON WorkerPool where ("packages" .=) <$> _wpPackages, ("onHostMaintenance" .=) <$> _wpOnHostMaintenance, ("diskSourceImage" .=) <$> _wpDiskSourceImage, + ("subnetwork" .=) <$> _wpSubnetwork, ("machineType" .=) <$> _wpMachineType, ("metadata" .=) <$> _wpMetadata, ("diskType" .=) <$> _wpDiskType, ("teardownPolicy" .=) <$> _wpTeardownPolicy, ("defaultPackageSet" .=) <$> _wpDefaultPackageSet, ("poolArgs" .=) <$> _wpPoolArgs, + ("workerHarnessContainerImage" .=) <$> + _wpWorkerHarnessContainerImage, ("dataDisks" .=) <$> _wpDataDisks]) -- | Defines a particular step within a Dataflow job. A job consists of @@ -4382,7 +5050,7 @@ instance ToJSON WorkerPool where -- used to run many different types of jobs, not just Map-Reduce). -- -- /See:/ 'step' smart constructor. -data Step = Step +data Step = Step' { _sKind :: !(Maybe Text) , _sName :: !(Maybe Text) , _sProperties :: !(Maybe StepProperties) @@ -4400,7 +5068,7 @@ data Step = Step step :: Step step = - Step + Step' { _sKind = Nothing , _sName = Nothing , _sProperties = Nothing @@ -4425,12 +5093,12 @@ instance FromJSON Step where parseJSON = withObject "Step" (\ o -> - Step <$> + Step' <$> (o .:? "kind") <*> (o .:? "name") <*> (o .:? "properties")) instance ToJSON Step where - toJSON Step{..} + toJSON Step'{..} = object (catMaybes [("kind" .=) <$> _sKind, ("name" .=) <$> _sName, @@ -4444,7 +5112,7 @@ instance ToJSON Step where -- (libraries, data files, etc) required in order for that code to run. -- -- /See:/ 'package' smart constructor. -data Package = Package +data Package = Package' { _pLocation :: !(Maybe Text) , _pName :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -4459,7 +5127,7 @@ data Package = Package package :: Package package = - Package + Package' { _pLocation = Nothing , _pName = Nothing } @@ -4479,21 +5147,69 @@ instance FromJSON Package where parseJSON = withObject "Package" (\ o -> - Package <$> (o .:? "location") <*> (o .:? "name")) + Package' <$> (o .:? "location") <*> (o .:? "name")) instance ToJSON Package where - toJSON Package{..} + toJSON Package'{..} = object (catMaybes [("location" .=) <$> _pLocation, ("name" .=) <$> _pName]) +-- | Parameters contains specific information about the code. This is a +-- struct to allow parameters of different types. Examples: 1. For a +-- \"HARNESS_STARTED\" message parameters might provide the name of the +-- worker and additional data like timing information. 2. For a +-- \"GCS_DOWNLOAD_ERROR\" parameters might contain fields listing the GCS +-- objects being downloaded and fields containing errors. In general +-- complex data structures should be avoided. If a worker needs to send a +-- specific and complicated data structure then please consider defining a +-- new proto and adding it to the data oneof in WorkerMessageResponse. +-- Conventions: Parameters should only be used for information that isn\'t +-- typically passed as a label. hostname and other worker identifiers +-- should almost always be passed as labels since they will be included on +-- most messages. +-- +-- /See:/ 'workerMessageCodeParameters' smart constructor. +newtype WorkerMessageCodeParameters = WorkerMessageCodeParameters' + { _wmcpAddtional :: HashMap Text JSONValue + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerMessageCodeParameters' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'wmcpAddtional' +workerMessageCodeParameters + :: HashMap Text JSONValue -- ^ 'wmcpAddtional' + -> WorkerMessageCodeParameters +workerMessageCodeParameters pWmcpAddtional_ = + WorkerMessageCodeParameters' + { _wmcpAddtional = _Coerce # pWmcpAddtional_ + } + +-- | Properties of the object. +wmcpAddtional :: Lens' WorkerMessageCodeParameters (HashMap Text JSONValue) +wmcpAddtional + = lens _wmcpAddtional + (\ s a -> s{_wmcpAddtional = a}) + . _Coerce + +instance FromJSON WorkerMessageCodeParameters where + parseJSON + = withObject "WorkerMessageCodeParameters" + (\ o -> + WorkerMessageCodeParameters' <$> (parseJSONObject o)) + +instance ToJSON WorkerMessageCodeParameters where + toJSON = toJSON . _wmcpAddtional + -- | When a task splits using WorkItemStatus.dynamic_source_split, this -- message describes the two parts of the split relative to the description -- of the current task\'s input. -- -- /See:/ 'dynamicSourceSplit' smart constructor. -data DynamicSourceSplit = DynamicSourceSplit +data DynamicSourceSplit = DynamicSourceSplit' { _dssResidual :: !(Maybe DerivedSource) , _dssPrimary :: !(Maybe DerivedSource) } deriving (Eq,Show,Data,Typeable,Generic) @@ -4508,7 +5224,7 @@ data DynamicSourceSplit = DynamicSourceSplit dynamicSourceSplit :: DynamicSourceSplit dynamicSourceSplit = - DynamicSourceSplit + DynamicSourceSplit' { _dssResidual = Nothing , _dssPrimary = Nothing } @@ -4529,11 +5245,11 @@ instance FromJSON DynamicSourceSplit where parseJSON = withObject "DynamicSourceSplit" (\ o -> - DynamicSourceSplit <$> + DynamicSourceSplit' <$> (o .:? "residual") <*> (o .:? "primary")) instance ToJSON DynamicSourceSplit where - toJSON DynamicSourceSplit{..} + toJSON DynamicSourceSplit'{..} = object (catMaybes [("residual" .=) <$> _dssResidual, @@ -4542,7 +5258,7 @@ instance ToJSON DynamicSourceSplit where -- | Response from a request to report the status of WorkItems. -- -- /See:/ 'reportWorkItemStatusResponse' smart constructor. -newtype ReportWorkItemStatusResponse = ReportWorkItemStatusResponse +newtype ReportWorkItemStatusResponse = ReportWorkItemStatusResponse' { _rwisrWorkItemServiceStates :: Maybe [WorkItemServiceState] } deriving (Eq,Show,Data,Typeable,Generic) @@ -4554,7 +5270,7 @@ newtype ReportWorkItemStatusResponse = ReportWorkItemStatusResponse reportWorkItemStatusResponse :: ReportWorkItemStatusResponse reportWorkItemStatusResponse = - ReportWorkItemStatusResponse + ReportWorkItemStatusResponse' { _rwisrWorkItemServiceStates = Nothing } @@ -4573,11 +5289,11 @@ instance FromJSON ReportWorkItemStatusResponse where parseJSON = withObject "ReportWorkItemStatusResponse" (\ o -> - ReportWorkItemStatusResponse <$> + ReportWorkItemStatusResponse' <$> (o .:? "workItemServiceStates" .!= mempty)) instance ToJSON ReportWorkItemStatusResponse where - toJSON ReportWorkItemStatusResponse{..} + toJSON ReportWorkItemStatusResponse'{..} = object (catMaybes [("workItemServiceStates" .=) <$> @@ -4586,7 +5302,7 @@ instance ToJSON ReportWorkItemStatusResponse where -- | DEPRECATED in favor of DynamicSourceSplit. -- -- /See:/ 'sourceFork' smart constructor. -data SourceFork = SourceFork +data SourceFork = SourceFork' { _sfResidual :: !(Maybe SourceSplitShard) , _sfPrimarySource :: !(Maybe DerivedSource) , _sfPrimary :: !(Maybe SourceSplitShard) @@ -4607,7 +5323,7 @@ data SourceFork = SourceFork sourceFork :: SourceFork sourceFork = - SourceFork + SourceFork' { _sfResidual = Nothing , _sfPrimarySource = Nothing , _sfPrimary = Nothing @@ -4640,13 +5356,13 @@ instance FromJSON SourceFork where parseJSON = withObject "SourceFork" (\ o -> - SourceFork <$> + SourceFork' <$> (o .:? "residual") <*> (o .:? "primarySource") <*> (o .:? "primary") <*> (o .:? "residualSource")) instance ToJSON SourceFork where - toJSON SourceFork{..} + toJSON SourceFork'{..} = object (catMaybes [("residual" .=) <$> _sfResidual, @@ -4658,7 +5374,7 @@ instance ToJSON SourceFork where -- computation ranges. -- -- /See:/ 'streamingComputationRanges' smart constructor. -data StreamingComputationRanges = StreamingComputationRanges +data StreamingComputationRanges = StreamingComputationRanges' { _scrRangeAssignments :: !(Maybe [KeyRangeDataDiskAssignment]) , _scrComputationId :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -4673,7 +5389,7 @@ data StreamingComputationRanges = StreamingComputationRanges streamingComputationRanges :: StreamingComputationRanges streamingComputationRanges = - StreamingComputationRanges + StreamingComputationRanges' { _scrRangeAssignments = Nothing , _scrComputationId = Nothing } @@ -4696,12 +5412,12 @@ instance FromJSON StreamingComputationRanges where parseJSON = withObject "StreamingComputationRanges" (\ o -> - StreamingComputationRanges <$> + StreamingComputationRanges' <$> (o .:? "rangeAssignments" .!= mempty) <*> (o .:? "computationId")) instance ToJSON StreamingComputationRanges where - toJSON StreamingComputationRanges{..} + toJSON StreamingComputationRanges'{..} = object (catMaybes [("rangeAssignments" .=) <$> _scrRangeAssignments, @@ -4711,7 +5427,7 @@ instance ToJSON StreamingComputationRanges where -- response, depending on the page size in the ListJobsRequest. -- -- /See:/ 'listJobsResponse' smart constructor. -data ListJobsResponse = ListJobsResponse +data ListJobsResponse = ListJobsResponse' { _ljrNextPageToken :: !(Maybe Text) , _ljrJobs :: !(Maybe [Job]) } deriving (Eq,Show,Data,Typeable,Generic) @@ -4726,7 +5442,7 @@ data ListJobsResponse = ListJobsResponse listJobsResponse :: ListJobsResponse listJobsResponse = - ListJobsResponse + ListJobsResponse' { _ljrNextPageToken = Nothing , _ljrJobs = Nothing } @@ -4747,12 +5463,12 @@ instance FromJSON ListJobsResponse where parseJSON = withObject "ListJobsResponse" (\ o -> - ListJobsResponse <$> + ListJobsResponse' <$> (o .:? "nextPageToken") <*> (o .:? "jobs" .!= mempty)) instance ToJSON ListJobsResponse where - toJSON ListJobsResponse{..} + toJSON ListJobsResponse'{..} = object (catMaybes [("nextPageToken" .=) <$> _ljrNextPageToken, @@ -4761,7 +5477,7 @@ instance ToJSON ListJobsResponse where -- | A source that records can be read and decoded from. -- -- /See:/ 'source' smart constructor. -data Source = Source +data Source = Source' { _souDoesNotNeedSplitting :: !(Maybe Bool) , _souBaseSpecs :: !(Maybe [SourceBaseSpecsItem]) , _souCodec :: !(Maybe SourceCodec) @@ -4785,7 +5501,7 @@ data Source = Source source :: Source source = - Source + Source' { _souDoesNotNeedSplitting = Nothing , _souBaseSpecs = Nothing , _souCodec = Nothing @@ -4845,7 +5561,7 @@ instance FromJSON Source where parseJSON = withObject "Source" (\ o -> - Source <$> + Source' <$> (o .:? "doesNotNeedSplitting") <*> (o .:? "baseSpecs" .!= mempty) <*> (o .:? "codec") @@ -4853,7 +5569,7 @@ instance FromJSON Source where <*> (o .:? "metadata")) instance ToJSON Source where - toJSON Source{..} + toJSON Source'{..} = object (catMaybes [("doesNotNeedSplitting" .=) <$> @@ -4862,10 +5578,11 @@ instance ToJSON Source where ("codec" .=) <$> _souCodec, ("spec" .=) <$> _souSpec, ("metadata" .=) <$> _souMetadata]) --- | A progress measurement of a WorkItem by a worker. +-- | Obsolete in favor of ApproximateReportedProgress and +-- ApproximateSplitRequest. -- -- /See:/ 'approximateProgress' smart constructor. -data ApproximateProgress = ApproximateProgress +data ApproximateProgress = ApproximateProgress' { _apRemainingTime :: !(Maybe Text) , _apPercentComplete :: !(Maybe (Textual Double)) , _apPosition :: !(Maybe Position) @@ -4883,27 +5600,26 @@ data ApproximateProgress = ApproximateProgress approximateProgress :: ApproximateProgress approximateProgress = - ApproximateProgress + ApproximateProgress' { _apRemainingTime = Nothing , _apPercentComplete = Nothing , _apPosition = Nothing } --- | Completion as an estimated time remaining. +-- | Obsolete. apRemainingTime :: Lens' ApproximateProgress (Maybe Text) apRemainingTime = lens _apRemainingTime (\ s a -> s{_apRemainingTime = a}) --- | Completion as percentage of the work, from 0.0 (beginning, nothing --- complete), to 1.0 (end of the work range, entire WorkItem complete). +-- | Obsolete. apPercentComplete :: Lens' ApproximateProgress (Maybe Double) apPercentComplete = lens _apPercentComplete (\ s a -> s{_apPercentComplete = a}) . mapping _Coerce --- | A Position within the work to represent a progress. +-- | Obsolete. apPosition :: Lens' ApproximateProgress (Maybe Position) apPosition = lens _apPosition (\ s a -> s{_apPosition = a}) @@ -4912,24 +5628,99 @@ instance FromJSON ApproximateProgress where parseJSON = withObject "ApproximateProgress" (\ o -> - ApproximateProgress <$> + ApproximateProgress' <$> (o .:? "remainingTime") <*> (o .:? "percentComplete") <*> (o .:? "position")) instance ToJSON ApproximateProgress where - toJSON ApproximateProgress{..} + toJSON ApproximateProgress'{..} = object (catMaybes [("remainingTime" .=) <$> _apRemainingTime, ("percentComplete" .=) <$> _apPercentComplete, ("position" .=) <$> _apPosition]) +-- | WorkerMessage provides information to the backend about a worker. +-- +-- /See:/ 'workerMessage' smart constructor. +data WorkerMessage = WorkerMessage' + { _wmWorkerHealthReport :: !(Maybe WorkerHealthReport) + , _wmTime :: !(Maybe Text) + , _wmWorkerMessageCode :: !(Maybe WorkerMessageCode) + , _wmLabels :: !(Maybe WorkerMessageLabels) + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'WorkerMessage' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'wmWorkerHealthReport' +-- +-- * 'wmTime' +-- +-- * 'wmWorkerMessageCode' +-- +-- * 'wmLabels' +workerMessage + :: WorkerMessage +workerMessage = + WorkerMessage' + { _wmWorkerHealthReport = Nothing + , _wmTime = Nothing + , _wmWorkerMessageCode = Nothing + , _wmLabels = Nothing + } + +-- | The health of a worker. +wmWorkerHealthReport :: Lens' WorkerMessage (Maybe WorkerHealthReport) +wmWorkerHealthReport + = lens _wmWorkerHealthReport + (\ s a -> s{_wmWorkerHealthReport = a}) + +-- | The timestamp of the worker_message. +wmTime :: Lens' WorkerMessage (Maybe Text) +wmTime = lens _wmTime (\ s a -> s{_wmTime = a}) + +-- | A worker message code. +wmWorkerMessageCode :: Lens' WorkerMessage (Maybe WorkerMessageCode) +wmWorkerMessageCode + = lens _wmWorkerMessageCode + (\ s a -> s{_wmWorkerMessageCode = a}) + +-- | Labels are used to group WorkerMessages. For example, a worker_message +-- about a particular container might have the labels: { \"JOB_ID\": +-- \"2015-04-22\", \"WORKER_ID\": \"wordcount-vm-2015…\" +-- \"CONTAINER_TYPE\": \"worker\", \"CONTAINER_ID\": \"ac1234def\"} Label +-- tags typically correspond to Label enum values. However, for ease of +-- development other strings can be used as tags. LABEL_UNSPECIFIED should +-- not be used here. +wmLabels :: Lens' WorkerMessage (Maybe WorkerMessageLabels) +wmLabels = lens _wmLabels (\ s a -> s{_wmLabels = a}) + +instance FromJSON WorkerMessage where + parseJSON + = withObject "WorkerMessage" + (\ o -> + WorkerMessage' <$> + (o .:? "workerHealthReport") <*> (o .:? "time") <*> + (o .:? "workerMessageCode") + <*> (o .:? "labels")) + +instance ToJSON WorkerMessage where + toJSON WorkerMessage'{..} + = object + (catMaybes + [("workerHealthReport" .=) <$> _wmWorkerHealthReport, + ("time" .=) <$> _wmTime, + ("workerMessageCode" .=) <$> _wmWorkerMessageCode, + ("labels" .=) <$> _wmLabels]) + -- | Location information for a specific key-range of a sharded computation. -- Currently we only support UTF-8 character splits to simplify encoding -- into JSON. -- -- /See:/ 'keyRangeLocation' smart constructor. -data KeyRangeLocation = KeyRangeLocation +data KeyRangeLocation = KeyRangeLocation' { _krlPersistentDirectory :: !(Maybe Text) , _krlDataDisk :: !(Maybe Text) , _krlStart :: !(Maybe Text) @@ -4953,7 +5744,7 @@ data KeyRangeLocation = KeyRangeLocation keyRangeLocation :: KeyRangeLocation keyRangeLocation = - KeyRangeLocation + KeyRangeLocation' { _krlPersistentDirectory = Nothing , _krlDataDisk = Nothing , _krlStart = Nothing @@ -4995,14 +5786,14 @@ instance FromJSON KeyRangeLocation where parseJSON = withObject "KeyRangeLocation" (\ o -> - KeyRangeLocation <$> + KeyRangeLocation' <$> (o .:? "persistentDirectory") <*> (o .:? "dataDisk") <*> (o .:? "start") <*> (o .:? "deliveryEndpoint") <*> (o .:? "end")) instance ToJSON KeyRangeLocation where - toJSON KeyRangeLocation{..} + toJSON KeyRangeLocation'{..} = object (catMaybes [("persistentDirectory" .=) <$> @@ -5015,7 +5806,7 @@ instance ToJSON KeyRangeLocation where -- | Information about an output of a multi-output DoFn. -- -- /See:/ 'multiOutputInfo' smart constructor. -newtype MultiOutputInfo = MultiOutputInfo +newtype MultiOutputInfo = MultiOutputInfo' { _moiTag :: Maybe Text } deriving (Eq,Show,Data,Typeable,Generic) @@ -5027,7 +5818,7 @@ newtype MultiOutputInfo = MultiOutputInfo multiOutputInfo :: MultiOutputInfo multiOutputInfo = - MultiOutputInfo + MultiOutputInfo' { _moiTag = Nothing } @@ -5039,18 +5830,19 @@ moiTag = lens _moiTag (\ s a -> s{_moiTag = a}) instance FromJSON MultiOutputInfo where parseJSON = withObject "MultiOutputInfo" - (\ o -> MultiOutputInfo <$> (o .:? "tag")) + (\ o -> MultiOutputInfo' <$> (o .:? "tag")) instance ToJSON MultiOutputInfo where - toJSON MultiOutputInfo{..} + toJSON MultiOutputInfo'{..} = object (catMaybes [("tag" .=) <$> _moiTag]) -- | An instruction that does a partial group-by-key. One input and one -- output. -- -- /See:/ 'partialGroupByKeyInstruction' smart constructor. -data PartialGroupByKeyInstruction = PartialGroupByKeyInstruction +data PartialGroupByKeyInstruction = PartialGroupByKeyInstruction' { _pgbkiValueCombiningFn :: !(Maybe PartialGroupByKeyInstructionValueCombiningFn) + , _pgbkiSideInputs :: !(Maybe [SideInputInfo]) , _pgbkiInput :: !(Maybe InstructionInput) , _pgbkiInputElementCodec :: !(Maybe PartialGroupByKeyInstructionInputElementCodec) } deriving (Eq,Show,Data,Typeable,Generic) @@ -5061,14 +5853,17 @@ data PartialGroupByKeyInstruction = PartialGroupByKeyInstruction -- -- * 'pgbkiValueCombiningFn' -- +-- * 'pgbkiSideInputs' +-- -- * 'pgbkiInput' -- -- * 'pgbkiInputElementCodec' partialGroupByKeyInstruction :: PartialGroupByKeyInstruction partialGroupByKeyInstruction = - PartialGroupByKeyInstruction + PartialGroupByKeyInstruction' { _pgbkiValueCombiningFn = Nothing + , _pgbkiSideInputs = Nothing , _pgbkiInput = Nothing , _pgbkiInputElementCodec = Nothing } @@ -5079,6 +5874,14 @@ pgbkiValueCombiningFn = lens _pgbkiValueCombiningFn (\ s a -> s{_pgbkiValueCombiningFn = a}) +-- | Zero or more side inputs. +pgbkiSideInputs :: Lens' PartialGroupByKeyInstruction [SideInputInfo] +pgbkiSideInputs + = lens _pgbkiSideInputs + (\ s a -> s{_pgbkiSideInputs = a}) + . _Default + . _Coerce + -- | Describes the input to the partial group-by-key instruction. pgbkiInput :: Lens' PartialGroupByKeyInstruction (Maybe InstructionInput) pgbkiInput @@ -5094,15 +5897,18 @@ instance FromJSON PartialGroupByKeyInstruction where parseJSON = withObject "PartialGroupByKeyInstruction" (\ o -> - PartialGroupByKeyInstruction <$> - (o .:? "valueCombiningFn") <*> (o .:? "input") <*> - (o .:? "inputElementCodec")) + PartialGroupByKeyInstruction' <$> + (o .:? "valueCombiningFn") <*> + (o .:? "sideInputs" .!= mempty) + <*> (o .:? "input") + <*> (o .:? "inputElementCodec")) instance ToJSON PartialGroupByKeyInstruction where - toJSON PartialGroupByKeyInstruction{..} + toJSON PartialGroupByKeyInstruction'{..} = object (catMaybes [("valueCombiningFn" .=) <$> _pgbkiValueCombiningFn, + ("sideInputs" .=) <$> _pgbkiSideInputs, ("input" .=) <$> _pgbkiInput, ("inputElementCodec" .=) <$> _pgbkiInputElementCodec]) @@ -5112,7 +5918,7 @@ instance ToJSON PartialGroupByKeyInstruction where -- code. -- -- /See:/ 'parDoInstruction' smart constructor. -data ParDoInstruction = ParDoInstruction +data ParDoInstruction = ParDoInstruction' { _pdiNumOutputs :: !(Maybe (Textual Int32)) , _pdiMultiOutputInfos :: !(Maybe [MultiOutputInfo]) , _pdiSideInputs :: !(Maybe [SideInputInfo]) @@ -5136,7 +5942,7 @@ data ParDoInstruction = ParDoInstruction parDoInstruction :: ParDoInstruction parDoInstruction = - ParDoInstruction + ParDoInstruction' { _pdiNumOutputs = Nothing , _pdiMultiOutputInfos = Nothing , _pdiSideInputs = Nothing @@ -5180,7 +5986,7 @@ instance FromJSON ParDoInstruction where parseJSON = withObject "ParDoInstruction" (\ o -> - ParDoInstruction <$> + ParDoInstruction' <$> (o .:? "numOutputs") <*> (o .:? "multiOutputInfos" .!= mempty) <*> (o .:? "sideInputs" .!= mempty) @@ -5188,7 +5994,7 @@ instance FromJSON ParDoInstruction where <*> (o .:? "userFn")) instance ToJSON ParDoInstruction where - toJSON ParDoInstruction{..} + toJSON ParDoInstruction'{..} = object (catMaybes [("numOutputs" .=) <$> _pdiNumOutputs, @@ -5200,7 +6006,7 @@ instance ToJSON ParDoInstruction where -- | Identifies the location of a custom souce. -- -- /See:/ 'customSourceLocation' smart constructor. -newtype CustomSourceLocation = CustomSourceLocation +newtype CustomSourceLocation = CustomSourceLocation' { _cslStateful :: Maybe Bool } deriving (Eq,Show,Data,Typeable,Generic) @@ -5212,7 +6018,7 @@ newtype CustomSourceLocation = CustomSourceLocation customSourceLocation :: CustomSourceLocation customSourceLocation = - CustomSourceLocation + CustomSourceLocation' { _cslStateful = Nothing } @@ -5224,16 +6030,16 @@ cslStateful instance FromJSON CustomSourceLocation where parseJSON = withObject "CustomSourceLocation" - (\ o -> CustomSourceLocation <$> (o .:? "stateful")) + (\ o -> CustomSourceLocation' <$> (o .:? "stateful")) instance ToJSON CustomSourceLocation where - toJSON CustomSourceLocation{..} + toJSON CustomSourceLocation'{..} = object (catMaybes [("stateful" .=) <$> _cslStateful]) -- -- /See:/ 'sourceBaseSpecsItem' smart constructor. -newtype SourceBaseSpecsItem = SourceBaseSpecsItem +newtype SourceBaseSpecsItem = SourceBaseSpecsItem' { _sbsiAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -5246,7 +6052,7 @@ sourceBaseSpecsItem :: HashMap Text JSONValue -- ^ 'sbsiAddtional' -> SourceBaseSpecsItem sourceBaseSpecsItem pSbsiAddtional_ = - SourceBaseSpecsItem + SourceBaseSpecsItem' { _sbsiAddtional = _Coerce # pSbsiAddtional_ } @@ -5260,7 +6066,7 @@ sbsiAddtional instance FromJSON SourceBaseSpecsItem where parseJSON = withObject "SourceBaseSpecsItem" - (\ o -> SourceBaseSpecsItem <$> (parseJSONObject o)) + (\ o -> SourceBaseSpecsItem' <$> (parseJSONObject o)) instance ToJSON SourceBaseSpecsItem where toJSON = toJSON . _sbsiAddtional @@ -5268,7 +6074,7 @@ instance ToJSON SourceBaseSpecsItem where -- | Describes a particular operation comprising a MapTask. -- -- /See:/ 'parallelInstruction' smart constructor. -data ParallelInstruction = ParallelInstruction +data ParallelInstruction = ParallelInstruction' { _piRead :: !(Maybe ReadInstruction) , _piWrite :: !(Maybe WriteInstruction) , _piParDo :: !(Maybe ParDoInstruction) @@ -5301,7 +6107,7 @@ data ParallelInstruction = ParallelInstruction parallelInstruction :: ParallelInstruction parallelInstruction = - ParallelInstruction + ParallelInstruction' { _piRead = Nothing , _piWrite = Nothing , _piParDo = Nothing @@ -5355,7 +6161,7 @@ instance FromJSON ParallelInstruction where parseJSON = withObject "ParallelInstruction" (\ o -> - ParallelInstruction <$> + ParallelInstruction' <$> (o .:? "read") <*> (o .:? "write") <*> (o .:? "parDo") <*> (o .:? "partialGroupByKey") @@ -5365,7 +6171,7 @@ instance FromJSON ParallelInstruction where <*> (o .:? "flatten")) instance ToJSON ParallelInstruction where - toJSON ParallelInstruction{..} + toJSON ParallelInstruction'{..} = object (catMaybes [("read" .=) <$> _piRead, ("write" .=) <$> _piWrite, @@ -5379,7 +6185,7 @@ instance ToJSON ParallelInstruction where -- | How to interpret the source element(s) as a side input value. -- -- /See:/ 'sideInputInfoKind' smart constructor. -newtype SideInputInfoKind = SideInputInfoKind +newtype SideInputInfoKind = SideInputInfoKind' { _siikAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -5392,7 +6198,7 @@ sideInputInfoKind :: HashMap Text JSONValue -- ^ 'siikAddtional' -> SideInputInfoKind sideInputInfoKind pSiikAddtional_ = - SideInputInfoKind + SideInputInfoKind' { _siikAddtional = _Coerce # pSiikAddtional_ } @@ -5406,15 +6212,55 @@ siikAddtional instance FromJSON SideInputInfoKind where parseJSON = withObject "SideInputInfoKind" - (\ o -> SideInputInfoKind <$> (parseJSONObject o)) + (\ o -> SideInputInfoKind' <$> (parseJSONObject o)) instance ToJSON SideInputInfoKind where toJSON = toJSON . _siikAddtional +-- | A request for sending worker messages to the service. +-- +-- /See:/ 'sendWorkerMessagesRequest' smart constructor. +newtype SendWorkerMessagesRequest = SendWorkerMessagesRequest' + { _swmrWorkerMessages :: Maybe [WorkerMessage] + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'SendWorkerMessagesRequest' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'swmrWorkerMessages' +sendWorkerMessagesRequest + :: SendWorkerMessagesRequest +sendWorkerMessagesRequest = + SendWorkerMessagesRequest' + { _swmrWorkerMessages = Nothing + } + +-- | The WorkerMessages to send. +swmrWorkerMessages :: Lens' SendWorkerMessagesRequest [WorkerMessage] +swmrWorkerMessages + = lens _swmrWorkerMessages + (\ s a -> s{_swmrWorkerMessages = a}) + . _Default + . _Coerce + +instance FromJSON SendWorkerMessagesRequest where + parseJSON + = withObject "SendWorkerMessagesRequest" + (\ o -> + SendWorkerMessagesRequest' <$> + (o .:? "workerMessages" .!= mempty)) + +instance ToJSON SendWorkerMessagesRequest where + toJSON SendWorkerMessagesRequest'{..} + = object + (catMaybes + [("workerMessages" .=) <$> _swmrWorkerMessages]) + -- | DEPRECATED in favor of DerivedSource. -- -- /See:/ 'sourceSplitShard' smart constructor. -data SourceSplitShard = SourceSplitShard +data SourceSplitShard = SourceSplitShard' { _sssDerivationMode :: !(Maybe Text) , _sssSource :: !(Maybe Source) } deriving (Eq,Show,Data,Typeable,Generic) @@ -5429,7 +6275,7 @@ data SourceSplitShard = SourceSplitShard sourceSplitShard :: SourceSplitShard sourceSplitShard = - SourceSplitShard + SourceSplitShard' { _sssDerivationMode = Nothing , _sssSource = Nothing } @@ -5449,11 +6295,11 @@ instance FromJSON SourceSplitShard where parseJSON = withObject "SourceSplitShard" (\ o -> - SourceSplitShard <$> + SourceSplitShard' <$> (o .:? "derivationMode") <*> (o .:? "source")) instance ToJSON SourceSplitShard where - toJSON SourceSplitShard{..} + toJSON SourceSplitShard'{..} = object (catMaybes [("derivationMode" .=) <$> _sssDerivationMode, @@ -5462,7 +6308,7 @@ instance ToJSON SourceSplitShard where -- | Information about a side input of a DoFn or an input of a SeqDoFn. -- -- /See:/ 'sideInputInfo' smart constructor. -data SideInputInfo = SideInputInfo +data SideInputInfo = SideInputInfo' { _siiTag :: !(Maybe Text) , _siiKind :: !(Maybe SideInputInfoKind) , _siiSources :: !(Maybe [Source]) @@ -5480,7 +6326,7 @@ data SideInputInfo = SideInputInfo sideInputInfo :: SideInputInfo sideInputInfo = - SideInputInfo + SideInputInfo' { _siiTag = Nothing , _siiKind = Nothing , _siiSources = Nothing @@ -5509,12 +6355,12 @@ instance FromJSON SideInputInfo where parseJSON = withObject "SideInputInfo" (\ o -> - SideInputInfo <$> + SideInputInfo' <$> (o .:? "tag") <*> (o .:? "kind") <*> (o .:? "sources" .!= mempty)) instance ToJSON SideInputInfo where - toJSON SideInputInfo{..} + toJSON SideInputInfo'{..} = object (catMaybes [("tag" .=) <$> _siiTag, ("kind" .=) <$> _siiKind, @@ -5524,7 +6370,7 @@ instance ToJSON SideInputInfo where -- isn’t contained in the submitted job. -- -- /See:/ 'jobExecutionInfo' smart constructor. -newtype JobExecutionInfo = JobExecutionInfo +newtype JobExecutionInfo = JobExecutionInfo' { _jeiStages :: Maybe JobExecutionInfoStages } deriving (Eq,Show,Data,Typeable,Generic) @@ -5536,7 +6382,7 @@ newtype JobExecutionInfo = JobExecutionInfo jobExecutionInfo :: JobExecutionInfo jobExecutionInfo = - JobExecutionInfo + JobExecutionInfo' { _jeiStages = Nothing } @@ -5548,16 +6394,16 @@ jeiStages instance FromJSON JobExecutionInfo where parseJSON = withObject "JobExecutionInfo" - (\ o -> JobExecutionInfo <$> (o .:? "stages")) + (\ o -> JobExecutionInfo' <$> (o .:? "stages")) instance ToJSON JobExecutionInfo where - toJSON JobExecutionInfo{..} + toJSON JobExecutionInfo'{..} = object (catMaybes [("stages" .=) <$> _jeiStages]) -- | The codec to use to decode data read from the source. -- -- /See:/ 'sourceCodec' smart constructor. -newtype SourceCodec = SourceCodec +newtype SourceCodec = SourceCodec' { _souAddtional :: HashMap Text JSONValue } deriving (Eq,Show,Data,Typeable,Generic) @@ -5570,7 +6416,7 @@ sourceCodec :: HashMap Text JSONValue -- ^ 'souAddtional' -> SourceCodec sourceCodec pSouAddtional_ = - SourceCodec + SourceCodec' { _souAddtional = _Coerce # pSouAddtional_ } @@ -5583,7 +6429,7 @@ souAddtional instance FromJSON SourceCodec where parseJSON = withObject "SourceCodec" - (\ o -> SourceCodec <$> (parseJSONObject o)) + (\ o -> SourceCodec' <$> (parseJSONObject o)) instance ToJSON SourceCodec where toJSON = toJSON . _souAddtional @@ -5591,7 +6437,7 @@ instance ToJSON SourceCodec where -- | State family configuration. -- -- /See:/ 'stateFamilyConfig' smart constructor. -data StateFamilyConfig = StateFamilyConfig +data StateFamilyConfig = StateFamilyConfig' { _sfcIsRead :: !(Maybe Bool) , _sfcStateFamily :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -5606,7 +6452,7 @@ data StateFamilyConfig = StateFamilyConfig stateFamilyConfig :: StateFamilyConfig stateFamilyConfig = - StateFamilyConfig + StateFamilyConfig' { _sfcIsRead = Nothing , _sfcStateFamily = Nothing } @@ -5626,11 +6472,11 @@ instance FromJSON StateFamilyConfig where parseJSON = withObject "StateFamilyConfig" (\ o -> - StateFamilyConfig <$> + StateFamilyConfig' <$> (o .:? "isRead") <*> (o .:? "stateFamily")) instance ToJSON StateFamilyConfig where - toJSON StateFamilyConfig{..} + toJSON StateFamilyConfig'{..} = object (catMaybes [("isRead" .=) <$> _sfcIsRead, @@ -5641,7 +6487,7 @@ instance ToJSON StateFamilyConfig where -- simplify encoding into JSON. -- -- /See:/ 'keyRangeDataDiskAssignment' smart constructor. -data KeyRangeDataDiskAssignment = KeyRangeDataDiskAssignment +data KeyRangeDataDiskAssignment = KeyRangeDataDiskAssignment' { _krddaDataDisk :: !(Maybe Text) , _krddaStart :: !(Maybe Text) , _krddaEnd :: !(Maybe Text) @@ -5659,7 +6505,7 @@ data KeyRangeDataDiskAssignment = KeyRangeDataDiskAssignment keyRangeDataDiskAssignment :: KeyRangeDataDiskAssignment keyRangeDataDiskAssignment = - KeyRangeDataDiskAssignment + KeyRangeDataDiskAssignment' { _krddaDataDisk = Nothing , _krddaStart = Nothing , _krddaEnd = Nothing @@ -5687,12 +6533,12 @@ instance FromJSON KeyRangeDataDiskAssignment where parseJSON = withObject "KeyRangeDataDiskAssignment" (\ o -> - KeyRangeDataDiskAssignment <$> + KeyRangeDataDiskAssignment' <$> (o .:? "dataDisk") <*> (o .:? "start") <*> (o .:? "end")) instance ToJSON KeyRangeDataDiskAssignment where - toJSON KeyRangeDataDiskAssignment{..} + toJSON KeyRangeDataDiskAssignment'{..} = object (catMaybes [("dataDisk" .=) <$> _krddaDataDisk, @@ -5712,7 +6558,7 @@ instance ToJSON KeyRangeDataDiskAssignment where -- and to bundles produced from it. -- -- /See:/ 'sourceSplitRequest' smart constructor. -data SourceSplitRequest = SourceSplitRequest +data SourceSplitRequest = SourceSplitRequest' { _ssrSource :: !(Maybe Source) , _ssrOptions :: !(Maybe SourceSplitOptions) } deriving (Eq,Show,Data,Typeable,Generic) @@ -5727,7 +6573,7 @@ data SourceSplitRequest = SourceSplitRequest sourceSplitRequest :: SourceSplitRequest sourceSplitRequest = - SourceSplitRequest + SourceSplitRequest' { _ssrSource = Nothing , _ssrOptions = Nothing } @@ -5746,11 +6592,11 @@ instance FromJSON SourceSplitRequest where parseJSON = withObject "SourceSplitRequest" (\ o -> - SourceSplitRequest <$> + SourceSplitRequest' <$> (o .:? "source") <*> (o .:? "options")) instance ToJSON SourceSplitRequest where - toJSON SourceSplitRequest{..} + toJSON SourceSplitRequest'{..} = object (catMaybes [("source" .=) <$> _ssrSource, @@ -5759,7 +6605,7 @@ instance ToJSON SourceSplitRequest where -- | Response to a request to list job messages. -- -- /See:/ 'listJobMessagesResponse' smart constructor. -data ListJobMessagesResponse = ListJobMessagesResponse +data ListJobMessagesResponse = ListJobMessagesResponse' { _ljmrJobMessages :: !(Maybe [JobMessage]) , _ljmrNextPageToken :: !(Maybe Text) } deriving (Eq,Show,Data,Typeable,Generic) @@ -5774,7 +6620,7 @@ data ListJobMessagesResponse = ListJobMessagesResponse listJobMessagesResponse :: ListJobMessagesResponse listJobMessagesResponse = - ListJobMessagesResponse + ListJobMessagesResponse' { _ljmrJobMessages = Nothing , _ljmrNextPageToken = Nothing } @@ -5797,12 +6643,12 @@ instance FromJSON ListJobMessagesResponse where parseJSON = withObject "ListJobMessagesResponse" (\ o -> - ListJobMessagesResponse <$> + ListJobMessagesResponse' <$> (o .:? "jobMessages" .!= mempty) <*> (o .:? "nextPageToken")) instance ToJSON ListJobMessagesResponse where - toJSON ListJobMessagesResponse{..} + toJSON ListJobMessagesResponse'{..} = object (catMaybes [("jobMessages" .=) <$> _ljmrJobMessages, @@ -5812,7 +6658,7 @@ instance ToJSON ListJobMessagesResponse where -- a streaming Dataflow job. -- -- /See:/ 'pubsubLocation' smart constructor. -data PubsubLocation = PubsubLocation +data PubsubLocation = PubsubLocation' { _plTrackingSubscription :: !(Maybe Text) , _plDropLateData :: !(Maybe Bool) , _plTimestampLabel :: !(Maybe Text) @@ -5839,7 +6685,7 @@ data PubsubLocation = PubsubLocation pubsubLocation :: PubsubLocation pubsubLocation = - PubsubLocation + PubsubLocation' { _plTrackingSubscription = Nothing , _plDropLateData = Nothing , _plTimestampLabel = Nothing @@ -5889,7 +6735,7 @@ instance FromJSON PubsubLocation where parseJSON = withObject "PubsubLocation" (\ o -> - PubsubLocation <$> + PubsubLocation' <$> (o .:? "trackingSubscription") <*> (o .:? "dropLateData") <*> (o .:? "timestampLabel") @@ -5898,7 +6744,7 @@ instance FromJSON PubsubLocation where <*> (o .:? "subscription")) instance ToJSON PubsubLocation where - toJSON PubsubLocation{..} + toJSON PubsubLocation'{..} = object (catMaybes [("trackingSubscription" .=) <$> @@ -5913,7 +6759,7 @@ instance ToJSON PubsubLocation where -- instruction. -- -- /See:/ 'instructionInput' smart constructor. -data InstructionInput = InstructionInput +data InstructionInput = InstructionInput' { _iiProducerInstructionIndex :: !(Maybe (Textual Int32)) , _iiOutputNum :: !(Maybe (Textual Int32)) } deriving (Eq,Show,Data,Typeable,Generic) @@ -5928,7 +6774,7 @@ data InstructionInput = InstructionInput instructionInput :: InstructionInput instructionInput = - InstructionInput + InstructionInput' { _iiProducerInstructionIndex = Nothing , _iiOutputNum = Nothing } @@ -5952,12 +6798,12 @@ instance FromJSON InstructionInput where parseJSON = withObject "InstructionInput" (\ o -> - InstructionInput <$> + InstructionInput' <$> (o .:? "producerInstructionIndex") <*> (o .:? "outputNum")) instance ToJSON InstructionInput where - toJSON InstructionInput{..} + toJSON InstructionInput'{..} = object (catMaybes [("producerInstructionIndex" .=) <$> @@ -5967,7 +6813,7 @@ instance ToJSON InstructionInput where -- | Describes a particular function to invoke. -- -- /See:/ 'seqMapTask' smart constructor. -data SeqMapTask = SeqMapTask +data SeqMapTask = SeqMapTask' { _smtInputs :: !(Maybe [SideInputInfo]) , _smtName :: !(Maybe Text) , _smtOutputInfos :: !(Maybe [SeqMapTaskOutputInfo]) @@ -5994,7 +6840,7 @@ data SeqMapTask = SeqMapTask seqMapTask :: SeqMapTask seqMapTask = - SeqMapTask + SeqMapTask' { _smtInputs = Nothing , _smtName = Nothing , _smtOutputInfos = Nothing @@ -6043,7 +6889,7 @@ instance FromJSON SeqMapTask where parseJSON = withObject "SeqMapTask" (\ o -> - SeqMapTask <$> + SeqMapTask' <$> (o .:? "inputs" .!= mempty) <*> (o .:? "name") <*> (o .:? "outputInfos" .!= mempty) <*> (o .:? "systemName") @@ -6051,7 +6897,7 @@ instance FromJSON SeqMapTask where <*> (o .:? "userFn")) instance ToJSON SeqMapTask where - toJSON SeqMapTask{..} + toJSON SeqMapTask'{..} = object (catMaybes [("inputs" .=) <$> _smtInputs, @@ -6065,7 +6911,7 @@ instance ToJSON SeqMapTask where -- performed on a user-defined Source specification. -- -- /See:/ 'sourceOperationRequest' smart constructor. -data SourceOperationRequest = SourceOperationRequest +data SourceOperationRequest = SourceOperationRequest' { _sSplit :: !(Maybe SourceSplitRequest) , _sGetMetadata :: !(Maybe SourceGetMetadataRequest) } deriving (Eq,Show,Data,Typeable,Generic) @@ -6080,7 +6926,7 @@ data SourceOperationRequest = SourceOperationRequest sourceOperationRequest :: SourceOperationRequest sourceOperationRequest = - SourceOperationRequest + SourceOperationRequest' { _sSplit = Nothing , _sGetMetadata = Nothing } @@ -6098,11 +6944,11 @@ instance FromJSON SourceOperationRequest where parseJSON = withObject "SourceOperationRequest" (\ o -> - SourceOperationRequest <$> + SourceOperationRequest' <$> (o .:? "split") <*> (o .:? "getMetadata")) instance ToJSON SourceOperationRequest where - toJSON SourceOperationRequest{..} + toJSON SourceOperationRequest'{..} = object (catMaybes [("split" .=) <$> _sSplit, @@ -6111,7 +6957,7 @@ instance ToJSON SourceOperationRequest where -- | Response to a request to lease WorkItems. -- -- /See:/ 'leaseWorkItemResponse' smart constructor. -newtype LeaseWorkItemResponse = LeaseWorkItemResponse +newtype LeaseWorkItemResponse = LeaseWorkItemResponse' { _lwirWorkItems :: Maybe [WorkItem] } deriving (Eq,Show,Data,Typeable,Generic) @@ -6123,7 +6969,7 @@ newtype LeaseWorkItemResponse = LeaseWorkItemResponse leaseWorkItemResponse :: LeaseWorkItemResponse leaseWorkItemResponse = - LeaseWorkItemResponse + LeaseWorkItemResponse' { _lwirWorkItems = Nothing } @@ -6139,11 +6985,11 @@ instance FromJSON LeaseWorkItemResponse where parseJSON = withObject "LeaseWorkItemResponse" (\ o -> - LeaseWorkItemResponse <$> + LeaseWorkItemResponse' <$> (o .:? "workItems" .!= mempty)) instance ToJSON LeaseWorkItemResponse where - toJSON LeaseWorkItemResponse{..} + toJSON LeaseWorkItemResponse'{..} = object (catMaybes [("workItems" .=) <$> _lwirWorkItems]) @@ -6152,7 +6998,7 @@ instance ToJSON LeaseWorkItemResponse where -- byte offset, or a record index. -- -- /See:/ 'position' smart constructor. -data Position = Position +data Position = Position' { _pByteOffSet :: !(Maybe (Textual Int64)) , _pConcatPosition :: !(Maybe ConcatPosition) , _pRecordIndex :: !(Maybe (Textual Int64)) @@ -6179,7 +7025,7 @@ data Position = Position position :: Position position = - Position + Position' { _pByteOffSet = Nothing , _pConcatPosition = Nothing , _pRecordIndex = Nothing @@ -6226,7 +7072,7 @@ instance FromJSON Position where parseJSON = withObject "Position" (\ o -> - Position <$> + Position' <$> (o .:? "byteOffset") <*> (o .:? "concatPosition") <*> (o .:? "recordIndex") <*> (o .:? "shufflePosition") @@ -6234,7 +7080,7 @@ instance FromJSON Position where <*> (o .:? "end")) instance ToJSON Position where - toJSON Position{..} + toJSON Position'{..} = object (catMaybes [("byteOffset" .=) <$> _pByteOffSet, diff --git a/gen/Network/Google/Dataflow/Types/Sum.hs b/gen/Network/Google/Dataflow/Types/Sum.hs index 3b5648e..b0bcf0c 100644 --- a/gen/Network/Google/Dataflow/Types/Sum.hs +++ b/gen/Network/Google/Dataflow/Types/Sum.hs @@ -8,7 +8,7 @@ -- | -- Module : Network.Google.Dataflow.Types.Sum --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Create.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Create.hs index 749c467..518266d 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Create.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Create.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.Create --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -71,7 +71,7 @@ type ProjectsJobsCreateResource = -- | Creates a dataflow job. -- -- /See:/ 'projectsJobsCreate' smart constructor. -data ProjectsJobsCreate = ProjectsJobsCreate +data ProjectsJobsCreate = ProjectsJobsCreate' { _pjcXgafv :: !(Maybe Text) , _pjcUploadProtocol :: !(Maybe Text) , _pjcPp :: !Bool @@ -115,7 +115,7 @@ projectsJobsCreate -> Text -- ^ 'pjcProjectId' -> ProjectsJobsCreate projectsJobsCreate pPjcPayload_ pPjcProjectId_ = - ProjectsJobsCreate + ProjectsJobsCreate' { _pjcXgafv = Nothing , _pjcUploadProtocol = Nothing , _pjcPp = True @@ -188,7 +188,10 @@ pjcCallback instance GoogleRequest ProjectsJobsCreate where type Rs ProjectsJobsCreate = Job - requestClient ProjectsJobsCreate{..} + type Scopes ProjectsJobsCreate = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsCreate'{..} = go _pjcProjectId _pjcXgafv _pjcUploadProtocol (Just _pjcPp) _pjcAccessToken diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Get.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Get.hs index 0a5f6b5..187a194 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Get.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Get.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.Get --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -69,7 +69,7 @@ type ProjectsJobsGetResource = -- | Gets the state of the specified dataflow job. -- -- /See:/ 'projectsJobsGet' smart constructor. -data ProjectsJobsGet = ProjectsJobsGet +data ProjectsJobsGet = ProjectsJobsGet' { _pjgXgafv :: !(Maybe Text) , _pjgJobId :: !Text , _pjgUploadProtocol :: !(Maybe Text) @@ -110,7 +110,7 @@ projectsJobsGet -> Text -- ^ 'pjgProjectId' -> ProjectsJobsGet projectsJobsGet pPjgJobId_ pPjgProjectId_ = - ProjectsJobsGet + ProjectsJobsGet' { _pjgXgafv = Nothing , _pjgJobId = pPjgJobId_ , _pjgUploadProtocol = Nothing @@ -175,7 +175,10 @@ pjgCallback instance GoogleRequest ProjectsJobsGet where type Rs ProjectsJobsGet = Job - requestClient ProjectsJobsGet{..} + type Scopes ProjectsJobsGet = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsGet'{..} = go _pjgProjectId _pjgJobId _pjgXgafv _pjgUploadProtocol (Just _pjgPp) diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/GetMetrics.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/GetMetrics.hs index 1792914..b14b853 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/GetMetrics.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/GetMetrics.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.GetMetrics --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -71,7 +71,7 @@ type ProjectsJobsGetMetricsResource = -- | Request the job status. -- -- /See:/ 'projectsJobsGetMetrics' smart constructor. -data ProjectsJobsGetMetrics = ProjectsJobsGetMetrics +data ProjectsJobsGetMetrics = ProjectsJobsGetMetrics' { _pjgmXgafv :: !(Maybe Text) , _pjgmJobId :: !Text , _pjgmUploadProtocol :: !(Maybe Text) @@ -112,7 +112,7 @@ projectsJobsGetMetrics -> Text -- ^ 'pjgmProjectId' -> ProjectsJobsGetMetrics projectsJobsGetMetrics pPjgmJobId_ pPjgmProjectId_ = - ProjectsJobsGetMetrics + ProjectsJobsGetMetrics' { _pjgmXgafv = Nothing , _pjgmJobId = pPjgmJobId_ , _pjgmUploadProtocol = Nothing @@ -183,7 +183,10 @@ pjgmCallback instance GoogleRequest ProjectsJobsGetMetrics where type Rs ProjectsJobsGetMetrics = JobMetrics - requestClient ProjectsJobsGetMetrics{..} + type Scopes ProjectsJobsGetMetrics = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsGetMetrics'{..} = go _pjgmProjectId _pjgmJobId _pjgmXgafv _pjgmUploadProtocol _pjgmStartTime diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/List.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/List.hs index 3f62d90..bbafeae 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/List.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/List.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.List --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -40,6 +40,7 @@ module Network.Google.Resource.Dataflow.Projects.Jobs.List , pjlUploadType , pjlBearerToken , pjlView + , pjlFilter , pjlPageToken , pjlProjectId , pjlPageSize @@ -63,16 +64,17 @@ type ProjectsJobsListResource = QueryParam "uploadType" Text :> QueryParam "bearer_token" Text :> QueryParam "view" Text :> - QueryParam "pageToken" Text :> - QueryParam "pageSize" (Textual Int32) :> - QueryParam "callback" Text :> - QueryParam "alt" AltJSON :> - Get '[JSON] ListJobsResponse + QueryParam "filter" Text :> + QueryParam "pageToken" Text :> + QueryParam "pageSize" (Textual Int32) :> + QueryParam "callback" Text :> + QueryParam "alt" AltJSON :> + Get '[JSON] ListJobsResponse -- | List the jobs of a project -- -- /See:/ 'projectsJobsList' smart constructor. -data ProjectsJobsList = ProjectsJobsList +data ProjectsJobsList = ProjectsJobsList' { _pjlXgafv :: !(Maybe Text) , _pjlUploadProtocol :: !(Maybe Text) , _pjlPp :: !Bool @@ -80,6 +82,7 @@ data ProjectsJobsList = ProjectsJobsList , _pjlUploadType :: !(Maybe Text) , _pjlBearerToken :: !(Maybe Text) , _pjlView :: !(Maybe Text) + , _pjlFilter :: !(Maybe Text) , _pjlPageToken :: !(Maybe Text) , _pjlProjectId :: !Text , _pjlPageSize :: !(Maybe (Textual Int32)) @@ -104,6 +107,8 @@ data ProjectsJobsList = ProjectsJobsList -- -- * 'pjlView' -- +-- * 'pjlFilter' +-- -- * 'pjlPageToken' -- -- * 'pjlProjectId' @@ -115,7 +120,7 @@ projectsJobsList :: Text -- ^ 'pjlProjectId' -> ProjectsJobsList projectsJobsList pPjlProjectId_ = - ProjectsJobsList + ProjectsJobsList' { _pjlXgafv = Nothing , _pjlUploadProtocol = Nothing , _pjlPp = True @@ -123,6 +128,7 @@ projectsJobsList pPjlProjectId_ = , _pjlUploadType = Nothing , _pjlBearerToken = Nothing , _pjlView = Nothing + , _pjlFilter = Nothing , _pjlPageToken = Nothing , _pjlProjectId = pPjlProjectId_ , _pjlPageSize = Nothing @@ -165,6 +171,11 @@ pjlBearerToken pjlView :: Lens' ProjectsJobsList (Maybe Text) pjlView = lens _pjlView (\ s a -> s{_pjlView = a}) +-- | The kind of filter to use. +pjlFilter :: Lens' ProjectsJobsList (Maybe Text) +pjlFilter + = lens _pjlFilter (\ s a -> s{_pjlFilter = a}) + -- | Set this to the \'next_page_token\' field of a previous response to -- request additional results in a long list. pjlPageToken :: Lens' ProjectsJobsList (Maybe Text) @@ -191,13 +202,17 @@ pjlCallback instance GoogleRequest ProjectsJobsList where type Rs ProjectsJobsList = ListJobsResponse - requestClient ProjectsJobsList{..} + type Scopes ProjectsJobsList = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsList'{..} = go _pjlProjectId _pjlXgafv _pjlUploadProtocol (Just _pjlPp) _pjlAccessToken _pjlUploadType _pjlBearerToken _pjlView + _pjlFilter _pjlPageToken _pjlPageSize _pjlCallback diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs index 6c29fc0..ef0fada 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Messages/List.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.Messages.List --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -79,7 +79,7 @@ type ProjectsJobsMessagesListResource = -- | Request the job status. -- -- /See:/ 'projectsJobsMessagesList' smart constructor. -data ProjectsJobsMessagesList = ProjectsJobsMessagesList +data ProjectsJobsMessagesList = ProjectsJobsMessagesList' { _pjmlXgafv :: !(Maybe Text) , _pjmlJobId :: !Text , _pjmlUploadProtocol :: !(Maybe Text) @@ -132,7 +132,7 @@ projectsJobsMessagesList -> Text -- ^ 'pjmlProjectId' -> ProjectsJobsMessagesList projectsJobsMessagesList pPjmlJobId_ pPjmlProjectId_ = - ProjectsJobsMessagesList + ProjectsJobsMessagesList' { _pjmlXgafv = Nothing , _pjmlJobId = pPjmlJobId_ , _pjmlUploadProtocol = Nothing @@ -235,7 +235,10 @@ pjmlCallback instance GoogleRequest ProjectsJobsMessagesList where type Rs ProjectsJobsMessagesList = ListJobMessagesResponse - requestClient ProjectsJobsMessagesList{..} + type Scopes ProjectsJobsMessagesList = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsMessagesList'{..} = go _pjmlProjectId _pjmlJobId _pjmlXgafv _pjmlUploadProtocol _pjmlStartTime diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Update.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Update.hs index 5a0e99f..662a445 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Update.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/Update.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.Update --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -69,7 +69,7 @@ type ProjectsJobsUpdateResource = -- | Updates the state of an existing dataflow job. -- -- /See:/ 'projectsJobsUpdate' smart constructor. -data ProjectsJobsUpdate = ProjectsJobsUpdate +data ProjectsJobsUpdate = ProjectsJobsUpdate' { _pjuXgafv :: !(Maybe Text) , _pjuJobId :: !Text , _pjuUploadProtocol :: !(Maybe Text) @@ -111,7 +111,7 @@ projectsJobsUpdate -> Text -- ^ 'pjuProjectId' -> ProjectsJobsUpdate projectsJobsUpdate pPjuJobId_ pPjuPayload_ pPjuProjectId_ = - ProjectsJobsUpdate + ProjectsJobsUpdate' { _pjuXgafv = Nothing , _pjuJobId = pPjuJobId_ , _pjuUploadProtocol = Nothing @@ -177,7 +177,10 @@ pjuCallback instance GoogleRequest ProjectsJobsUpdate where type Rs ProjectsJobsUpdate = Job - requestClient ProjectsJobsUpdate{..} + type Scopes ProjectsJobsUpdate = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsUpdate'{..} = go _pjuProjectId _pjuJobId _pjuXgafv _pjuUploadProtocol (Just _pjuPp) diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/Lease.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/Lease.hs index d2389a1..bfec2f1 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/Lease.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/Lease.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.WorkItems.Lease --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -71,7 +71,7 @@ type ProjectsJobsWorkItemsLeaseResource = -- | Leases a dataflow WorkItem to run. -- -- /See:/ 'projectsJobsWorkItemsLease' smart constructor. -data ProjectsJobsWorkItemsLease = ProjectsJobsWorkItemsLease +data ProjectsJobsWorkItemsLease = ProjectsJobsWorkItemsLease' { _pjwilXgafv :: !(Maybe Text) , _pjwilJobId :: !Text , _pjwilUploadProtocol :: !(Maybe Text) @@ -113,7 +113,7 @@ projectsJobsWorkItemsLease -> Text -- ^ 'pjwilProjectId' -> ProjectsJobsWorkItemsLease projectsJobsWorkItemsLease pPjwilJobId_ pPjwilPayload_ pPjwilProjectId_ = - ProjectsJobsWorkItemsLease + ProjectsJobsWorkItemsLease' { _pjwilXgafv = Nothing , _pjwilJobId = pPjwilJobId_ , _pjwilUploadProtocol = Nothing @@ -185,7 +185,10 @@ instance GoogleRequest ProjectsJobsWorkItemsLease where type Rs ProjectsJobsWorkItemsLease = LeaseWorkItemResponse - requestClient ProjectsJobsWorkItemsLease{..} + type Scopes ProjectsJobsWorkItemsLease = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsWorkItemsLease'{..} = go _pjwilProjectId _pjwilJobId _pjwilXgafv _pjwilUploadProtocol (Just _pjwilPp) diff --git a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/ReportStatus.hs b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/ReportStatus.hs index 1546938..4db7ff5 100644 --- a/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/ReportStatus.hs +++ b/gen/Network/Google/Resource/Dataflow/Projects/Jobs/WorkItems/ReportStatus.hs @@ -14,7 +14,7 @@ -- | -- Module : Network.Google.Resource.Dataflow.Projects.Jobs.WorkItems.ReportStatus --- Copyright : (c) 2015 Brendan Hay +-- Copyright : (c) 2015-2016 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> -- Stability : auto-generated @@ -71,7 +71,7 @@ type ProjectsJobsWorkItemsReportStatusResource = -- | Reports the status of dataflow WorkItems leased by a worker. -- -- /See:/ 'projectsJobsWorkItemsReportStatus' smart constructor. -data ProjectsJobsWorkItemsReportStatus = ProjectsJobsWorkItemsReportStatus +data ProjectsJobsWorkItemsReportStatus = ProjectsJobsWorkItemsReportStatus' { _pjwirsXgafv :: !(Maybe Text) , _pjwirsJobId :: !Text , _pjwirsUploadProtocol :: !(Maybe Text) @@ -113,7 +113,7 @@ projectsJobsWorkItemsReportStatus -> Text -- ^ 'pjwirsProjectId' -> ProjectsJobsWorkItemsReportStatus projectsJobsWorkItemsReportStatus pPjwirsJobId_ pPjwirsPayload_ pPjwirsProjectId_ = - ProjectsJobsWorkItemsReportStatus + ProjectsJobsWorkItemsReportStatus' { _pjwirsXgafv = Nothing , _pjwirsJobId = pPjwirsJobId_ , _pjwirsUploadProtocol = Nothing @@ -186,7 +186,10 @@ instance GoogleRequest ProjectsJobsWorkItemsReportStatus where type Rs ProjectsJobsWorkItemsReportStatus = ReportWorkItemStatusResponse - requestClient ProjectsJobsWorkItemsReportStatus{..} + type Scopes ProjectsJobsWorkItemsReportStatus = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsJobsWorkItemsReportStatus'{..} = go _pjwirsProjectId _pjwirsJobId _pjwirsXgafv _pjwirsUploadProtocol (Just _pjwirsPp) diff --git a/gen/Network/Google/Resource/Dataflow/Projects/WorkerMessages.hs b/gen/Network/Google/Resource/Dataflow/Projects/WorkerMessages.hs new file mode 100644 index 0000000..337a181 --- /dev/null +++ b/gen/Network/Google/Resource/Dataflow/Projects/WorkerMessages.hs @@ -0,0 +1,187 @@ +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveDataTypeable #-} +{-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE NoImplicitPrelude #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} + +{-# OPTIONS_GHC -fno-warn-duplicate-exports #-} +{-# OPTIONS_GHC -fno-warn-unused-binds #-} +{-# OPTIONS_GHC -fno-warn-unused-imports #-} + +-- | +-- Module : Network.Google.Resource.Dataflow.Projects.WorkerMessages +-- Copyright : (c) 2015-2016 Brendan Hay +-- License : Mozilla Public License, v. 2.0. +-- Maintainer : Brendan Hay <brendan.g.hay@gmail.com> +-- Stability : auto-generated +-- Portability : non-portable (GHC extensions) +-- +-- Send a worker_message to the service. +-- +-- /See:/ <https://cloud.google.com/dataflow Google Dataflow API Reference> for @dataflow.projects.workerMessages@. +module Network.Google.Resource.Dataflow.Projects.WorkerMessages + ( + -- * REST Resource + ProjectsWorkerMessagesResource + + -- * Creating a Request + , projectsWorkerMessages + , ProjectsWorkerMessages + + -- * Request Lenses + , pwmXgafv + , pwmUploadProtocol + , pwmPp + , pwmAccessToken + , pwmUploadType + , pwmPayload + , pwmBearerToken + , pwmProjectId + , pwmCallback + ) where + +import Network.Google.Dataflow.Types +import Network.Google.Prelude + +-- | A resource alias for @dataflow.projects.workerMessages@ method which the +-- 'ProjectsWorkerMessages' request conforms to. +type ProjectsWorkerMessagesResource = + "v1b3" :> + "projects" :> + Capture "projectId" Text :> + "WorkerMessages" :> + QueryParam "$.xgafv" Text :> + QueryParam "upload_protocol" Text :> + QueryParam "pp" Bool :> + QueryParam "access_token" Text :> + QueryParam "uploadType" Text :> + QueryParam "bearer_token" Text :> + QueryParam "callback" Text :> + QueryParam "alt" AltJSON :> + ReqBody '[JSON] SendWorkerMessagesRequest :> + Post '[JSON] SendWorkerMessagesResponse + +-- | Send a worker_message to the service. +-- +-- /See:/ 'projectsWorkerMessages' smart constructor. +data ProjectsWorkerMessages = ProjectsWorkerMessages' + { _pwmXgafv :: !(Maybe Text) + , _pwmUploadProtocol :: !(Maybe Text) + , _pwmPp :: !Bool + , _pwmAccessToken :: !(Maybe Text) + , _pwmUploadType :: !(Maybe Text) + , _pwmPayload :: !SendWorkerMessagesRequest + , _pwmBearerToken :: !(Maybe Text) + , _pwmProjectId :: !Text + , _pwmCallback :: !(Maybe Text) + } deriving (Eq,Show,Data,Typeable,Generic) + +-- | Creates a value of 'ProjectsWorkerMessages' with the minimum fields required to make a request. +-- +-- Use one of the following lenses to modify other fields as desired: +-- +-- * 'pwmXgafv' +-- +-- * 'pwmUploadProtocol' +-- +-- * 'pwmPp' +-- +-- * 'pwmAccessToken' +-- +-- * 'pwmUploadType' +-- +-- * 'pwmPayload' +-- +-- * 'pwmBearerToken' +-- +-- * 'pwmProjectId' +-- +-- * 'pwmCallback' +projectsWorkerMessages + :: SendWorkerMessagesRequest -- ^ 'pwmPayload' + -> Text -- ^ 'pwmProjectId' + -> ProjectsWorkerMessages +projectsWorkerMessages pPwmPayload_ pPwmProjectId_ = + ProjectsWorkerMessages' + { _pwmXgafv = Nothing + , _pwmUploadProtocol = Nothing + , _pwmPp = True + , _pwmAccessToken = Nothing + , _pwmUploadType = Nothing + , _pwmPayload = pPwmPayload_ + , _pwmBearerToken = Nothing + , _pwmProjectId = pPwmProjectId_ + , _pwmCallback = Nothing + } + +-- | V1 error format. +pwmXgafv :: Lens' ProjectsWorkerMessages (Maybe Text) +pwmXgafv = lens _pwmXgafv (\ s a -> s{_pwmXgafv = a}) + +-- | Upload protocol for media (e.g. \"raw\", \"multipart\"). +pwmUploadProtocol :: Lens' ProjectsWorkerMessages (Maybe Text) +pwmUploadProtocol + = lens _pwmUploadProtocol + (\ s a -> s{_pwmUploadProtocol = a}) + +-- | Pretty-print response. +pwmPp :: Lens' ProjectsWorkerMessages Bool +pwmPp = lens _pwmPp (\ s a -> s{_pwmPp = a}) + +-- | OAuth access token. +pwmAccessToken :: Lens' ProjectsWorkerMessages (Maybe Text) +pwmAccessToken + = lens _pwmAccessToken + (\ s a -> s{_pwmAccessToken = a}) + +-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\"). +pwmUploadType :: Lens' ProjectsWorkerMessages (Maybe Text) +pwmUploadType + = lens _pwmUploadType + (\ s a -> s{_pwmUploadType = a}) + +-- | Multipart request metadata. +pwmPayload :: Lens' ProjectsWorkerMessages SendWorkerMessagesRequest +pwmPayload + = lens _pwmPayload (\ s a -> s{_pwmPayload = a}) + +-- | OAuth bearer token. +pwmBearerToken :: Lens' ProjectsWorkerMessages (Maybe Text) +pwmBearerToken + = lens _pwmBearerToken + (\ s a -> s{_pwmBearerToken = a}) + +-- | The project to send the WorkerMessages to. +pwmProjectId :: Lens' ProjectsWorkerMessages Text +pwmProjectId + = lens _pwmProjectId (\ s a -> s{_pwmProjectId = a}) + +-- | JSONP +pwmCallback :: Lens' ProjectsWorkerMessages (Maybe Text) +pwmCallback + = lens _pwmCallback (\ s a -> s{_pwmCallback = a}) + +instance GoogleRequest ProjectsWorkerMessages where + type Rs ProjectsWorkerMessages = + SendWorkerMessagesResponse + type Scopes ProjectsWorkerMessages = + '["https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/userinfo.email"] + requestClient ProjectsWorkerMessages'{..} + = go _pwmProjectId _pwmXgafv _pwmUploadProtocol + (Just _pwmPp) + _pwmAccessToken + _pwmUploadType + _pwmBearerToken + _pwmCallback + (Just AltJSON) + _pwmPayload + dataflowService + where go + = buildClient + (Proxy :: Proxy ProjectsWorkerMessagesResource) + mempty diff --git a/gogol-dataflow.cabal b/gogol-dataflow.cabal index af1c5c1..505aad8 100644 --- a/gogol-dataflow.cabal +++ b/gogol-dataflow.cabal @@ -1,5 +1,5 @@ name: gogol-dataflow -version: 0.0.1 +version: 0.1.0 synopsis: Google Dataflow SDK. homepage: https://github.com/brendanhay/gogol bug-reports: https://github.com/brendanhay/gogol/issues @@ -7,14 +7,15 @@ license: OtherLicense license-file: LICENSE author: Brendan Hay maintainer: Brendan Hay <brendan.g.hay@gmail.com> -copyright: Copyright (c) 2015 Brendan Hay +copyright: Copyright (c) 2015-2016 Brendan Hay category: Network, Google, Cloud build-type: Simple cabal-version: >= 1.10 extra-source-files: README.md description: - Google Dataflow API. + Develops and executes data processing patterns like ETL, batch + computation, and continuous computation. . /Warning:/ This is an experimental prototype/preview release which is still under exploratory development and not intended for public use, caveat emptor! @@ -43,11 +44,12 @@ library , Network.Google.Resource.Dataflow.Projects.Jobs.Update , Network.Google.Resource.Dataflow.Projects.Jobs.WorkItems.Lease , Network.Google.Resource.Dataflow.Projects.Jobs.WorkItems.ReportStatus + , Network.Google.Resource.Dataflow.Projects.WorkerMessages other-modules: Network.Google.Dataflow.Types.Product , Network.Google.Dataflow.Types.Sum build-depends: - gogol-core == 0.0.1.* + gogol-core == 0.1.0.* , base >= 4.7 && < 5 |