@@ -155,6 +155,7 @@ data DataSetListDataSetsItem = DataSetListDataSetsItem'
155155 , _dsldsiKind :: !Text
156156 , _dsldsiDataSetReference :: !(Maybe DataSetReference)
157157 , _dsldsiId :: !(Maybe Text)
158+ , _dsldsiLabels :: !(Maybe DataSetListDataSetsItemLabels)
158159 } deriving (Eq,Show,Data,Typeable,Generic)
159160
160161-- | Creates a value of 'DataSetListDataSetsItem' with the minimum fields required to make a request.
@@ -168,6 +169,8 @@ data DataSetListDataSetsItem = DataSetListDataSetsItem'
168169-- * 'dsldsiDataSetReference'
169170--
170171-- * 'dsldsiId'
172+--
173+-- * 'dsldsiLabels'
171174dataSetListDataSetsItem
172175 :: DataSetListDataSetsItem
173176dataSetListDataSetsItem =
@@ -176,6 +179,7 @@ dataSetListDataSetsItem =
176179 , _dsldsiKind = "bigquery#dataset"
177180 , _dsldsiDataSetReference = Nothing
178181 , _dsldsiId = Nothing
182+ , _dsldsiLabels = Nothing
179183 }
180184
181185-- | A descriptive name for the dataset, if one exists.
@@ -201,6 +205,12 @@ dsldsiDataSetReference
201205dsldsiId :: Lens' DataSetListDataSetsItem (Maybe Text)
202206dsldsiId = lens _dsldsiId (\ s a -> s{_dsldsiId = a})
203207
208+-- | [Experimental] The labels associated with this dataset. You can use
209+-- these to organize and group your datasets.
210+dsldsiLabels :: Lens' DataSetListDataSetsItem (Maybe DataSetListDataSetsItemLabels)
211+dsldsiLabels
212+ = lens _dsldsiLabels (\ s a -> s{_dsldsiLabels = a})
213+
204214instance FromJSON DataSetListDataSetsItem where
205215 parseJSON
206216 = withObject "DataSetListDataSetsItem"
@@ -209,7 +219,8 @@ instance FromJSON DataSetListDataSetsItem where
209219 (o .:? "friendlyName") <*>
210220 (o .:? "kind" .!= "bigquery#dataset")
211221 <*> (o .:? "datasetReference")
212− <*> (o .:? "id"))
222+ <*> (o .:? "id")
223+ <*> (o .:? "labels"))
213224
214225instance ToJSON DataSetListDataSetsItem where
215226 toJSON DataSetListDataSetsItem'{..}
@@ -218,7 +229,8 @@ instance ToJSON DataSetListDataSetsItem where
218229 [("friendlyName" .=) <$> _dsldsiFriendlyName,
219230 Just ("kind" .= _dsldsiKind),
220231 ("datasetReference" .=) <$> _dsldsiDataSetReference,
221− ("id" .=) <$> _dsldsiId])
232+ ("id" .=) <$> _dsldsiId,
233+ ("labels" .=) <$> _dsldsiLabels])
222234
223235--
224236-- /See:/ 'tableDataList' smart constructor.
@@ -640,6 +652,66 @@ instance ToJSON ExplainQueryStep where
640652 [("substeps" .=) <$> _eqsSubsteps,
641653 ("kind" .=) <$> _eqsKind])
642654
655+--
656+-- /See:/ 'queryParameterTypeStructTypesItem' smart constructor.
657+data QueryParameterTypeStructTypesItem = QueryParameterTypeStructTypesItem'
658+ { _qptstiName :: !(Maybe Text)
659+ , _qptstiType :: !(Maybe QueryParameterType)
660+ , _qptstiDescription :: !(Maybe Text)
661+ } deriving (Eq,Show,Data,Typeable,Generic)
662+
663+-- | Creates a value of 'QueryParameterTypeStructTypesItem' with the minimum fields required to make a request.
664+--
665+-- Use one of the following lenses to modify other fields as desired:
666+--
667+-- * 'qptstiName'
668+--
669+-- * 'qptstiType'
670+--
671+-- * 'qptstiDescription'
672+queryParameterTypeStructTypesItem
673+ :: QueryParameterTypeStructTypesItem
674+queryParameterTypeStructTypesItem =
675+ QueryParameterTypeStructTypesItem'
676+ { _qptstiName = Nothing
677+ , _qptstiType = Nothing
678+ , _qptstiDescription = Nothing
679+ }
680+
681+-- | [Optional] The name of this field.
682+qptstiName :: Lens' QueryParameterTypeStructTypesItem (Maybe Text)
683+qptstiName
684+ = lens _qptstiName (\ s a -> s{_qptstiName = a})
685+
686+-- | [Required] The type of this field.
687+qptstiType :: Lens' QueryParameterTypeStructTypesItem (Maybe QueryParameterType)
688+qptstiType
689+ = lens _qptstiType (\ s a -> s{_qptstiType = a})
690+
691+-- | [Optional] Human-oriented description of the field.
692+qptstiDescription :: Lens' QueryParameterTypeStructTypesItem (Maybe Text)
693+qptstiDescription
694+ = lens _qptstiDescription
695+ (\ s a -> s{_qptstiDescription = a})
696+
697+instance FromJSON QueryParameterTypeStructTypesItem
698+ where
699+ parseJSON
700+ = withObject "QueryParameterTypeStructTypesItem"
701+ (\ o ->
702+ QueryParameterTypeStructTypesItem' <$>
703+ (o .:? "name") <*> (o .:? "type") <*>
704+ (o .:? "description"))
705+
706+instance ToJSON QueryParameterTypeStructTypesItem
707+ where
708+ toJSON QueryParameterTypeStructTypesItem'{..}
709+ = object
710+ (catMaybes
711+ [("name" .=) <$> _qptstiName,
712+ ("type" .=) <$> _qptstiType,
713+ ("description" .=) <$> _qptstiDescription])
714+
643715--
644716-- /See:/ 'bigtableColumnFamily' smart constructor.
645717data BigtableColumnFamily = BigtableColumnFamily'
@@ -701,7 +773,7 @@ bcfOnlyReadLatest
701773-- | [Optional] The type to convert the value in cells of this column family.
702774-- The values are expected to be encoded using HBase Bytes.toBytes function
703775-- when using the BINARY encoding value. Following BigQuery types are
704−-- allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Defaut
776+-- allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default
705777-- type is BYTES. This can be overridden for a specific column by listing
706778-- that column in \'columns\' and specifying a type for it.
707779bcfType :: Lens' BigtableColumnFamily (Maybe Text)
@@ -848,6 +920,46 @@ instance ToJSON JobStatistics where
848920 ("query" .=) <$> _jsQuery,
849921 ("extract" .=) <$> _jsExtract])
850922
923+-- | [Experimental] The labels associated with this job. You can use these to
924+-- organize and group your jobs. Label keys and values can be no longer
925+-- than 63 characters, can only contain letters, numeric characters,
926+-- underscores and dashes. International characters are allowed. Label
927+-- values are optional. Label keys must start with a letter and must be
928+-- unique within a dataset. Both keys and values are additionally
929+-- constrained to be \<= 128 bytes in size.
930+--
931+-- /See:/ 'jobConfigurationLabels' smart constructor.
932+newtype JobConfigurationLabels = JobConfigurationLabels'
933+ { _jclAddtional :: HashMap Text Text
934+ } deriving (Eq,Show,Data,Typeable,Generic)
935+
936+-- | Creates a value of 'JobConfigurationLabels' with the minimum fields required to make a request.
937+--
938+-- Use one of the following lenses to modify other fields as desired:
939+--
940+-- * 'jclAddtional'
941+jobConfigurationLabels
942+ :: HashMap Text Text -- ^ 'jclAddtional'
943+ -> JobConfigurationLabels
944+jobConfigurationLabels pJclAddtional_ =
945+ JobConfigurationLabels'
946+ { _jclAddtional = _Coerce # pJclAddtional_
947+ }
948+
949+jclAddtional :: Lens' JobConfigurationLabels (HashMap Text Text)
950+jclAddtional
951+ = lens _jclAddtional (\ s a -> s{_jclAddtional = a})
952+ . _Coerce
953+
954+instance FromJSON JobConfigurationLabels where
955+ parseJSON
956+ = withObject "JobConfigurationLabels"
957+ (\ o ->
958+ JobConfigurationLabels' <$> (parseJSONObject o))
959+
960+instance ToJSON JobConfigurationLabels where
961+ toJSON = toJSON . _jclAddtional
962+
851963--
852964-- /See:/ 'dataSet' smart constructor.
853965data DataSet = DataSet'
@@ -861,6 +973,7 @@ data DataSet = DataSet'
861973 , _dsDataSetReference :: !(Maybe DataSetReference)
862974 , _dsSelfLink :: !(Maybe Text)
863975 , _dsId :: !(Maybe Text)
976+ , _dsLabels :: !(Maybe DataSetLabels)
864977 , _dsDefaultTableExpirationMs :: !(Maybe (Textual Int64))
865978 , _dsDescription :: !(Maybe Text)
866979 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -889,6 +1002,8 @@ data DataSet = DataSet'
8891002--
8901003-- * 'dsId'
8911004--
1005+-- * 'dsLabels'
1006+--
8921007-- * 'dsDefaultTableExpirationMs'
8931008--
8941009-- * 'dsDescription'
@@ -906,6 +1021,7 @@ dataSet =
9061021 , _dsDataSetReference = Nothing
9071022 , _dsSelfLink = Nothing
9081023 , _dsId = Nothing
1024+ , _dsLabels = Nothing
9091025 , _dsDefaultTableExpirationMs = Nothing
9101026 , _dsDescription = Nothing
9111027 }
@@ -979,6 +1095,13 @@ dsSelfLink
9791095dsId :: Lens' DataSet (Maybe Text)
9801096dsId = lens _dsId (\ s a -> s{_dsId = a})
9811097
1098+-- | [Experimental] The labels associated with this dataset. You can use
1099+-- these to organize and group your datasets. You can set this property
1100+-- when inserting or updating a dataset. See Labeling Datasets for more
1101+-- information.
1102+dsLabels :: Lens' DataSet (Maybe DataSetLabels)
1103+dsLabels = lens _dsLabels (\ s a -> s{_dsLabels = a})
1104+
9821105-- | [Optional] The default lifetime of all tables in the dataset, in
9831106-- milliseconds. The minimum value is 3600000 milliseconds (one hour). Once
9841107-- this property is set, all newly-created tables in the dataset will have
@@ -1016,6 +1139,7 @@ instance FromJSON DataSet where
10161139 <*> (o .:? "datasetReference")
10171140 <*> (o .:? "selfLink")
10181141 <*> (o .:? "id")
1142+ <*> (o .:? "labels")
10191143 <*> (o .:? "defaultTableExpirationMs")
10201144 <*> (o .:? "description"))
10211145
@@ -1031,6 +1155,7 @@ instance ToJSON DataSet where
10311155 ("lastModifiedTime" .=) <$> _dsLastModifiedTime,
10321156 ("datasetReference" .=) <$> _dsDataSetReference,
10331157 ("selfLink" .=) <$> _dsSelfLink, ("id" .=) <$> _dsId,
1158+ ("labels" .=) <$> _dsLabels,
10341159 ("defaultTableExpirationMs" .=) <$>
10351160 _dsDefaultTableExpirationMs,
10361161 ("description" .=) <$> _dsDescription])
@@ -1038,7 +1163,8 @@ instance ToJSON DataSet where
10381163--
10391164-- /See:/ 'bigtableOptions' smart constructor.
10401165data BigtableOptions = BigtableOptions'
1041− { _boIgnoreUnspecifiedColumnFamilies :: !(Maybe Bool)
1166+ { _boReadRowkeyAsString :: !(Maybe Bool)
1167+ , _boIgnoreUnspecifiedColumnFamilies :: !(Maybe Bool)
10421168 , _boColumnFamilies :: !(Maybe [BigtableColumnFamily])
10431169 } deriving (Eq,Show,Data,Typeable,Generic)
10441170
@@ -1046,6 +1172,8 @@ data BigtableOptions = BigtableOptions'
10461172--
10471173-- Use one of the following lenses to modify other fields as desired:
10481174--
1175+-- * 'boReadRowkeyAsString'
1176+--
10491177-- * 'boIgnoreUnspecifiedColumnFamilies'
10501178--
10511179-- * 'boColumnFamilies'
@@ -1053,10 +1181,20 @@ bigtableOptions
10531181 :: BigtableOptions
10541182bigtableOptions =
10551183 BigtableOptions'
1056− { _boIgnoreUnspecifiedColumnFamilies = Nothing
1184+ { _boReadRowkeyAsString = Nothing
1185+ , _boIgnoreUnspecifiedColumnFamilies = Nothing
10571186 , _boColumnFamilies = Nothing
10581187 }
10591188
1189+-- | [Optional] If field is true, then the rowkey column families will be
1190+-- read and converted to string. Otherwise they are read with BYTES type
1191+-- values and users need to manually cast them with CAST if necessary. The
1192+-- default value is false.
1193+boReadRowkeyAsString :: Lens' BigtableOptions (Maybe Bool)
1194+boReadRowkeyAsString
1195+ = lens _boReadRowkeyAsString
1196+ (\ s a -> s{_boReadRowkeyAsString = a})
1197+
10601198-- | [Optional] If field is true, then the column families that are not
10611199-- specified in columnFamilies list are not exposed in the table schema.
10621200-- Otherwise, they are read with BYTES type values. The default value is
@@ -1085,14 +1223,16 @@ instance FromJSON BigtableOptions where
10851223 = withObject "BigtableOptions"
10861224 (\ o ->
10871225 BigtableOptions' <$>
1088− (o .:? "ignoreUnspecifiedColumnFamilies") <*>
1089− (o .:? "columnFamilies" .!= mempty))
1226+ (o .:? "readRowkeyAsString") <*>
1227+ (o .:? "ignoreUnspecifiedColumnFamilies")
1228+ <*> (o .:? "columnFamilies" .!= mempty))
10901229
10911230instance ToJSON BigtableOptions where
10921231 toJSON BigtableOptions'{..}
10931232 = object
10941233 (catMaybes
1095− [("ignoreUnspecifiedColumnFamilies" .=) <$>
1234+ [("readRowkeyAsString" .=) <$> _boReadRowkeyAsString,
1235+ ("ignoreUnspecifiedColumnFamilies" .=) <$>
10961236 _boIgnoreUnspecifiedColumnFamilies,
10971237 ("columnFamilies" .=) <$> _boColumnFamilies])
10981238
@@ -1383,8 +1523,8 @@ tfsName :: Lens' TableFieldSchema (Maybe Text)
13831523tfsName = lens _tfsName (\ s a -> s{_tfsName = a})
13841524
13851525-- | [Required] The field data type. Possible values include STRING, BYTES,
1386−-- INTEGER, FLOAT, BOOLEAN, TIMESTAMP or RECORD (where RECORD indicates
1387−-- that the field contains a nested schema).
1526+-- INTEGER, FLOAT, BOOLEAN, TIMESTAMP, DATE, TIME, DATETIME, or RECORD
1527+-- (where RECORD indicates that the field contains a nested schema).
13881528tfsType :: Lens' TableFieldSchema (Maybe Text)
13891529tfsType = lens _tfsType (\ s a -> s{_tfsType = a})
13901530
@@ -1430,6 +1570,7 @@ data GetQueryResultsResponse = GetQueryResultsResponse'
14301570 , _gqrrTotalBytesProcessed :: !(Maybe (Textual Int64))
14311571 , _gqrrRows :: !(Maybe [TableRow])
14321572 , _gqrrPageToken :: !(Maybe Text)
1573+ , _gqrrNumDmlAffectedRows :: !(Maybe (Textual Int64))
14331574 , _gqrrTotalRows :: !(Maybe (Textual Word64))
14341575 , _gqrrErrors :: !(Maybe [ErrorProto])
14351576 , _gqrrJobComplete :: !(Maybe Bool)
@@ -1454,6 +1595,8 @@ data GetQueryResultsResponse = GetQueryResultsResponse'
14541595--
14551596-- * 'gqrrPageToken'
14561597--
1598+-- * 'gqrrNumDmlAffectedRows'
1599+--
14571600-- * 'gqrrTotalRows'
14581601--
14591602-- * 'gqrrErrors'
@@ -1472,6 +1615,7 @@ getQueryResultsResponse =
14721615 , _gqrrTotalBytesProcessed = Nothing
14731616 , _gqrrRows = Nothing
14741617 , _gqrrPageToken = Nothing
1618+ , _gqrrNumDmlAffectedRows = Nothing
14751619 , _gqrrTotalRows = Nothing
14761620 , _gqrrErrors = Nothing
14771621 , _gqrrJobComplete = Nothing
@@ -1526,6 +1670,14 @@ gqrrPageToken
15261670 = lens _gqrrPageToken
15271671 (\ s a -> s{_gqrrPageToken = a})
15281672
1673+-- | [Output-only, Experimental] The number of rows affected by a DML
1674+-- statement. Present only for DML statements INSERT, UPDATE or DELETE.
1675+gqrrNumDmlAffectedRows :: Lens' GetQueryResultsResponse (Maybe Int64)
1676+gqrrNumDmlAffectedRows
1677+ = lens _gqrrNumDmlAffectedRows
1678+ (\ s a -> s{_gqrrNumDmlAffectedRows = a})
1679+ . mapping _Coerce
1680+
15291681-- | The total number of rows in the complete query result set, which can be
15301682-- more than the number of rows in this single page of results. Present
15311683-- only when the query completes successfully.
@@ -1568,6 +1720,7 @@ instance FromJSON GetQueryResultsResponse where
15681720 <*> (o .:? "totalBytesProcessed")
15691721 <*> (o .:? "rows" .!= mempty)
15701722 <*> (o .:? "pageToken")
1723+ <*> (o .:? "numDmlAffectedRows")
15711724 <*> (o .:? "totalRows")
15721725 <*> (o .:? "errors" .!= mempty)
15731726 <*> (o .:? "jobComplete")
@@ -1585,6 +1738,8 @@ instance ToJSON GetQueryResultsResponse where
15851738 _gqrrTotalBytesProcessed,
15861739 ("rows" .=) <$> _gqrrRows,
15871740 ("pageToken" .=) <$> _gqrrPageToken,
1741+ ("numDmlAffectedRows" .=) <$>
1742+ _gqrrNumDmlAffectedRows,
15881743 ("totalRows" .=) <$> _gqrrTotalRows,
15891744 ("errors" .=) <$> _gqrrErrors,
15901745 ("jobComplete" .=) <$> _gqrrJobComplete,
@@ -1668,15 +1823,17 @@ instance ToJSON DataSetList where
16681823--
16691824-- /See:/ 'queryRequest' smart constructor.
16701825data QueryRequest = QueryRequest'
1671− { _qrUseQueryCache :: !Bool
1672− , _qrPreserveNulls :: !(Maybe Bool)
1673− , _qrKind :: !Text
1674− , _qrQuery :: !(Maybe Text)
1675− , _qrTimeoutMs :: !(Maybe (Textual Word32))
1676− , _qrUseLegacySQL :: !(Maybe Bool)
1677− , _qrDryRun :: !(Maybe Bool)
1678− , _qrMaxResults :: !(Maybe (Textual Word32))
1679− , _qrDefaultDataSet :: !(Maybe DataSetReference)
1826+ { _qrUseQueryCache :: !Bool
1827+ , _qrPreserveNulls :: !(Maybe Bool)
1828+ , _qrKind :: !Text
1829+ , _qrQueryParameters :: !(Maybe [QueryParameter])
1830+ , _qrQuery :: !(Maybe Text)
1831+ , _qrParameterMode :: !(Maybe Text)
1832+ , _qrTimeoutMs :: !(Maybe (Textual Word32))
1833+ , _qrUseLegacySQL :: !Bool
1834+ , _qrDryRun :: !(Maybe Bool)
1835+ , _qrMaxResults :: !(Maybe (Textual Word32))
1836+ , _qrDefaultDataSet :: !(Maybe DataSetReference)
16801837 } deriving (Eq,Show,Data,Typeable,Generic)
16811838
16821839-- | Creates a value of 'QueryRequest' with the minimum fields required to make a request.
@@ -1689,8 +1846,12 @@ data QueryRequest = QueryRequest'
16891846--
16901847-- * 'qrKind'
16911848--
1849+-- * 'qrQueryParameters'
1850+--
16921851-- * 'qrQuery'
16931852--
1853+-- * 'qrParameterMode'
1854+--
16941855-- * 'qrTimeoutMs'
16951856--
16961857-- * 'qrUseLegacySQL'
@@ -1707,9 +1868,11 @@ queryRequest =
17071868 { _qrUseQueryCache = True
17081869 , _qrPreserveNulls = Nothing
17091870 , _qrKind = "bigquery#queryRequest"
1871+ , _qrQueryParameters = Nothing
17101872 , _qrQuery = Nothing
1873+ , _qrParameterMode = Nothing
17111874 , _qrTimeoutMs = Nothing
1712− , _qrUseLegacySQL = Nothing
1875+ , _qrUseLegacySQL = True
17131876 , _qrDryRun = Nothing
17141877 , _qrMaxResults = Nothing
17151878 , _qrDefaultDataSet = Nothing
@@ -1733,12 +1896,27 @@ qrPreserveNulls
17331896qrKind :: Lens' QueryRequest Text
17341897qrKind = lens _qrKind (\ s a -> s{_qrKind = a})
17351898
1899+-- | [Experimental] Query parameters for Standard SQL queries.
1900+qrQueryParameters :: Lens' QueryRequest [QueryParameter]
1901+qrQueryParameters
1902+ = lens _qrQueryParameters
1903+ (\ s a -> s{_qrQueryParameters = a})
1904+ . _Default
1905+ . _Coerce
1906+
17361907-- | [Required] A query string, following the BigQuery query syntax, of the
17371908-- query to execute. Example: \"SELECT count(f1) FROM
17381909-- [myProjectId:myDatasetId.myTableId]\".
17391910qrQuery :: Lens' QueryRequest (Maybe Text)
17401911qrQuery = lens _qrQuery (\ s a -> s{_qrQuery = a})
17411912
1913+-- | [Experimental] Standard SQL only. Whether to use positional (?) or named
1914+-- (\'myparam) query parameters in this query.
1915+qrParameterMode :: Lens' QueryRequest (Maybe Text)
1916+qrParameterMode
1917+ = lens _qrParameterMode
1918+ (\ s a -> s{_qrParameterMode = a})
1919+
17421920-- | [Optional] How long to wait for the query to complete, in milliseconds,
17431921-- before the request times out and returns. Note that this is only a
17441922-- timeout for the request, not the query. If the query takes longer to run
@@ -1758,7 +1936,7 @@ qrTimeoutMs
17581936-- is set to false, the values of allowLargeResults and flattenResults are
17591937-- ignored; query will be run as if allowLargeResults is true and
17601938-- flattenResults is false.
1761−qrUseLegacySQL :: Lens' QueryRequest (Maybe Bool)
1939+qrUseLegacySQL :: Lens' QueryRequest Bool
17621940qrUseLegacySQL
17631941 = lens _qrUseLegacySQL
17641942 (\ s a -> s{_qrUseLegacySQL = a})
@@ -1797,9 +1975,11 @@ instance FromJSON QueryRequest where
17971975 (o .:? "useQueryCache" .!= True) <*>
17981976 (o .:? "preserveNulls")
17991977 <*> (o .:? "kind" .!= "bigquery#queryRequest")
1978+ <*> (o .:? "queryParameters" .!= mempty)
18001979 <*> (o .:? "query")
1980+ <*> (o .:? "parameterMode")
18011981 <*> (o .:? "timeoutMs")
1802− <*> (o .:? "useLegacySql")
1982+ <*> (o .:? "useLegacySql" .!= True)
18031983 <*> (o .:? "dryRun")
18041984 <*> (o .:? "maxResults")
18051985 <*> (o .:? "defaultDataset"))
@@ -1810,13 +1990,75 @@ instance ToJSON QueryRequest where
18101990 (catMaybes
18111991 [Just ("useQueryCache" .= _qrUseQueryCache),
18121992 ("preserveNulls" .=) <$> _qrPreserveNulls,
1813− Just ("kind" .= _qrKind), ("query" .=) <$> _qrQuery,
1993+ Just ("kind" .= _qrKind),
1994+ ("queryParameters" .=) <$> _qrQueryParameters,
1995+ ("query" .=) <$> _qrQuery,
1996+ ("parameterMode" .=) <$> _qrParameterMode,
18141997 ("timeoutMs" .=) <$> _qrTimeoutMs,
1815− ("useLegacySql" .=) <$> _qrUseLegacySQL,
1998+ Just ("useLegacySql" .= _qrUseLegacySQL),
18161999 ("dryRun" .=) <$> _qrDryRun,
18172000 ("maxResults" .=) <$> _qrMaxResults,
18182001 ("defaultDataset" .=) <$> _qrDefaultDataSet])
18192002
2003+--
2004+-- /See:/ 'queryParameter' smart constructor.
2005+data QueryParameter = QueryParameter'
2006+ { _qpParameterValue :: !(Maybe QueryParameterValue)
2007+ , _qpParameterType :: !(Maybe QueryParameterType)
2008+ , _qpName :: !(Maybe Text)
2009+ } deriving (Eq,Show,Data,Typeable,Generic)
2010+
2011+-- | Creates a value of 'QueryParameter' with the minimum fields required to make a request.
2012+--
2013+-- Use one of the following lenses to modify other fields as desired:
2014+--
2015+-- * 'qpParameterValue'
2016+--
2017+-- * 'qpParameterType'
2018+--
2019+-- * 'qpName'
2020+queryParameter
2021+ :: QueryParameter
2022+queryParameter =
2023+ QueryParameter'
2024+ { _qpParameterValue = Nothing
2025+ , _qpParameterType = Nothing
2026+ , _qpName = Nothing
2027+ }
2028+
2029+-- | [Required] The value of this parameter.
2030+qpParameterValue :: Lens' QueryParameter (Maybe QueryParameterValue)
2031+qpParameterValue
2032+ = lens _qpParameterValue
2033+ (\ s a -> s{_qpParameterValue = a})
2034+
2035+-- | [Required] The type of this parameter.
2036+qpParameterType :: Lens' QueryParameter (Maybe QueryParameterType)
2037+qpParameterType
2038+ = lens _qpParameterType
2039+ (\ s a -> s{_qpParameterType = a})
2040+
2041+-- | [Optional] If unset, this is a positional parameter. Otherwise, should
2042+-- be unique within a query.
2043+qpName :: Lens' QueryParameter (Maybe Text)
2044+qpName = lens _qpName (\ s a -> s{_qpName = a})
2045+
2046+instance FromJSON QueryParameter where
2047+ parseJSON
2048+ = withObject "QueryParameter"
2049+ (\ o ->
2050+ QueryParameter' <$>
2051+ (o .:? "parameterValue") <*> (o .:? "parameterType")
2052+ <*> (o .:? "name"))
2053+
2054+instance ToJSON QueryParameter where
2055+ toJSON QueryParameter'{..}
2056+ = object
2057+ (catMaybes
2058+ [("parameterValue" .=) <$> _qpParameterValue,
2059+ ("parameterType" .=) <$> _qpParameterType,
2060+ ("name" .=) <$> _qpName])
2061+
18202062--
18212063-- /See:/ 'jobStatistics4' smart constructor.
18222064newtype JobStatistics4 = JobStatistics4'
@@ -2093,6 +2335,7 @@ data JobConfigurationLoad = JobConfigurationLoad'
20932335 , _jclAllowJaggedRows :: !(Maybe Bool)
20942336 , _jclSchemaInline :: !(Maybe Text)
20952337 , _jclIgnoreUnknownValues :: !(Maybe Bool)
2338+ , _jclSchemaUpdateOptions :: !(Maybe [Text])
20962339 , _jclCreateDisPosition :: !(Maybe Text)
20972340 , _jclSchemaInlineFormat :: !(Maybe Text)
20982341 , _jclAllowQuotedNewlines :: !(Maybe Bool)
@@ -2124,6 +2367,8 @@ data JobConfigurationLoad = JobConfigurationLoad'
21242367--
21252368-- * 'jclIgnoreUnknownValues'
21262369--
2370+-- * 'jclSchemaUpdateOptions'
2371+--
21272372-- * 'jclCreateDisPosition'
21282373--
21292374-- * 'jclSchemaInlineFormat'
@@ -2156,6 +2401,7 @@ jobConfigurationLoad =
21562401 , _jclAllowJaggedRows = Nothing
21572402 , _jclSchemaInline = Nothing
21582403 , _jclIgnoreUnknownValues = Nothing
2404+ , _jclSchemaUpdateOptions = Nothing
21592405 , _jclCreateDisPosition = Nothing
21602406 , _jclSchemaInlineFormat = Nothing
21612407 , _jclAllowQuotedNewlines = Nothing
@@ -2241,6 +2487,22 @@ jclIgnoreUnknownValues
22412487 = lens _jclIgnoreUnknownValues
22422488 (\ s a -> s{_jclIgnoreUnknownValues = a})
22432489
2490+-- | [Experimental] Allows the schema of the desitination table to be updated
2491+-- as a side effect of the load job. Schema update options are supported in
2492+-- two cases: when writeDisposition is WRITE_APPEND; when writeDisposition
2493+-- is WRITE_TRUNCATE and the destination table is a partition of a table,
2494+-- specified by partition decorators. For normal tables, WRITE_TRUNCATE
2495+-- will always overwrite the schema. One or more of the following values
2496+-- are specified: ALLOW_FIELD_ADDITION: allow adding a nullable field to
2497+-- the schema. ALLOW_FIELD_RELAXATION: allow relaxing a required field in
2498+-- the original schema to nullable.
2499+jclSchemaUpdateOptions :: Lens' JobConfigurationLoad [Text]
2500+jclSchemaUpdateOptions
2501+ = lens _jclSchemaUpdateOptions
2502+ (\ s a -> s{_jclSchemaUpdateOptions = a})
2503+ . _Default
2504+ . _Coerce
2505+
22442506-- | [Optional] Specifies whether the job is allowed to create new tables.
22452507-- The following values are supported: CREATE_IF_NEEDED: If the table does
22462508-- not exist, BigQuery creates the table. CREATE_NEVER: The table must
@@ -2350,6 +2612,7 @@ instance FromJSON JobConfigurationLoad where
23502612 <*> (o .:? "allowJaggedRows")
23512613 <*> (o .:? "schemaInline")
23522614 <*> (o .:? "ignoreUnknownValues")
2615+ <*> (o .:? "schemaUpdateOptions" .!= mempty)
23532616 <*> (o .:? "createDisposition")
23542617 <*> (o .:? "schemaInlineFormat")
23552618 <*> (o .:? "allowQuotedNewlines")
@@ -2374,6 +2637,8 @@ instance ToJSON JobConfigurationLoad where
23742637 ("schemaInline" .=) <$> _jclSchemaInline,
23752638 ("ignoreUnknownValues" .=) <$>
23762639 _jclIgnoreUnknownValues,
2640+ ("schemaUpdateOptions" .=) <$>
2641+ _jclSchemaUpdateOptions,
23772642 ("createDisposition" .=) <$> _jclCreateDisPosition,
23782643 ("schemaInlineFormat" .=) <$> _jclSchemaInlineFormat,
23792644 ("allowQuotedNewlines" .=) <$>
@@ -2689,7 +2954,7 @@ bcOnlyReadLatest
26892954-- | [Optional] The type to convert the value in cells of this column. The
26902955-- values are expected to be encoded using HBase Bytes.toBytes function
26912956-- when using the BINARY encoding value. Following BigQuery types are
2692−-- allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Defaut
2957+-- allowed (case-sensitive) - BYTES STRING INTEGER FLOAT BOOLEAN Default
26932958-- type is BYTES. \'type\' can also be set at the column family level.
26942959-- However, the setting at this level takes precedence if \'type\' is set
26952960-- at both levels.
@@ -3007,6 +3272,80 @@ instance ToJSON TimePartitioning where
30073272 [("expirationMs" .=) <$> _tpExpirationMs,
30083273 ("type" .=) <$> _tpType])
30093274
3275+-- | [Optional] The struct field values, in order of the struct type\'s
3276+-- declaration.
3277+--
3278+-- /See:/ 'queryParameterValueStructValues' smart constructor.
3279+newtype QueryParameterValueStructValues = QueryParameterValueStructValues'
3280+ { _qpvsvAddtional :: HashMap Text QueryParameterValue
3281+ } deriving (Eq,Show,Data,Typeable,Generic)
3282+
3283+-- | Creates a value of 'QueryParameterValueStructValues' with the minimum fields required to make a request.
3284+--
3285+-- Use one of the following lenses to modify other fields as desired:
3286+--
3287+-- * 'qpvsvAddtional'
3288+queryParameterValueStructValues
3289+ :: HashMap Text QueryParameterValue -- ^ 'qpvsvAddtional'
3290+ -> QueryParameterValueStructValues
3291+queryParameterValueStructValues pQpvsvAddtional_ =
3292+ QueryParameterValueStructValues'
3293+ { _qpvsvAddtional = _Coerce # pQpvsvAddtional_
3294+ }
3295+
3296+qpvsvAddtional :: Lens' QueryParameterValueStructValues (HashMap Text QueryParameterValue)
3297+qpvsvAddtional
3298+ = lens _qpvsvAddtional
3299+ (\ s a -> s{_qpvsvAddtional = a})
3300+ . _Coerce
3301+
3302+instance FromJSON QueryParameterValueStructValues
3303+ where
3304+ parseJSON
3305+ = withObject "QueryParameterValueStructValues"
3306+ (\ o ->
3307+ QueryParameterValueStructValues' <$>
3308+ (parseJSONObject o))
3309+
3310+instance ToJSON QueryParameterValueStructValues where
3311+ toJSON = toJSON . _qpvsvAddtional
3312+
3313+-- | [Experimental] The labels associated with this dataset. You can use
3314+-- these to organize and group your datasets. You can set this property
3315+-- when inserting or updating a dataset. See Labeling Datasets for more
3316+-- information.
3317+--
3318+-- /See:/ 'dataSetLabels' smart constructor.
3319+newtype DataSetLabels = DataSetLabels'
3320+ { _dslAddtional :: HashMap Text Text
3321+ } deriving (Eq,Show,Data,Typeable,Generic)
3322+
3323+-- | Creates a value of 'DataSetLabels' with the minimum fields required to make a request.
3324+--
3325+-- Use one of the following lenses to modify other fields as desired:
3326+--
3327+-- * 'dslAddtional'
3328+dataSetLabels
3329+ :: HashMap Text Text -- ^ 'dslAddtional'
3330+ -> DataSetLabels
3331+dataSetLabels pDslAddtional_ =
3332+ DataSetLabels'
3333+ { _dslAddtional = _Coerce # pDslAddtional_
3334+ }
3335+
3336+dslAddtional :: Lens' DataSetLabels (HashMap Text Text)
3337+dslAddtional
3338+ = lens _dslAddtional (\ s a -> s{_dslAddtional = a})
3339+ . _Coerce
3340+
3341+instance FromJSON DataSetLabels where
3342+ parseJSON
3343+ = withObject "DataSetLabels"
3344+ (\ o -> DataSetLabels' <$> (parseJSONObject o))
3345+
3346+instance ToJSON DataSetLabels where
3347+ toJSON = toJSON . _dslAddtional
3348+
30103349--
30113350-- /See:/ 'jobConfiguration' smart constructor.
30123351data JobConfiguration = JobConfiguration'
@@ -3014,6 +3353,7 @@ data JobConfiguration = JobConfiguration'
30143353 , _jcLoad :: !(Maybe JobConfigurationLoad)
30153354 , _jcQuery :: !(Maybe JobConfigurationQuery)
30163355 , _jcExtract :: !(Maybe JobConfigurationExtract)
3356+ , _jcLabels :: !(Maybe JobConfigurationLabels)
30173357 , _jcDryRun :: !(Maybe Bool)
30183358 } deriving (Eq,Show,Data,Typeable,Generic)
30193359
@@ -3029,6 +3369,8 @@ data JobConfiguration = JobConfiguration'
30293369--
30303370-- * 'jcExtract'
30313371--
3372+-- * 'jcLabels'
3373+--
30323374-- * 'jcDryRun'
30333375jobConfiguration
30343376 :: JobConfiguration
@@ -3038,6 +3380,7 @@ jobConfiguration =
30383380 , _jcLoad = Nothing
30393381 , _jcQuery = Nothing
30403382 , _jcExtract = Nothing
3383+ , _jcLabels = Nothing
30413384 , _jcDryRun = Nothing
30423385 }
30433386
@@ -3058,6 +3401,16 @@ jcExtract :: Lens' JobConfiguration (Maybe JobConfigurationExtract)
30583401jcExtract
30593402 = lens _jcExtract (\ s a -> s{_jcExtract = a})
30603403
3404+-- | [Experimental] The labels associated with this job. You can use these to
3405+-- organize and group your jobs. Label keys and values can be no longer
3406+-- than 63 characters, can only contain letters, numeric characters,
3407+-- underscores and dashes. International characters are allowed. Label
3408+-- values are optional. Label keys must start with a letter and must be
3409+-- unique within a dataset. Both keys and values are additionally
3410+-- constrained to be \<= 128 bytes in size.
3411+jcLabels :: Lens' JobConfiguration (Maybe JobConfigurationLabels)
3412+jcLabels = lens _jcLabels (\ s a -> s{_jcLabels = a})
3413+
30613414-- | [Optional] If set, don\'t actually run this job. A valid query will
30623415-- return a mostly empty response with some processing statistics, while an
30633416-- invalid query will return the same error it would if it wasn\'t a dry
@@ -3072,6 +3425,7 @@ instance FromJSON JobConfiguration where
30723425 JobConfiguration' <$>
30733426 (o .:? "copy") <*> (o .:? "load") <*> (o .:? "query")
30743427 <*> (o .:? "extract")
3428+ <*> (o .:? "labels")
30753429 <*> (o .:? "dryRun"))
30763430
30773431instance ToJSON JobConfiguration where
@@ -3081,6 +3435,7 @@ instance ToJSON JobConfiguration where
30813435 [("copy" .=) <$> _jcCopy, ("load" .=) <$> _jcLoad,
30823436 ("query" .=) <$> _jcQuery,
30833437 ("extract" .=) <$> _jcExtract,
3438+ ("labels" .=) <$> _jcLabels,
30843439 ("dryRun" .=) <$> _jcDryRun])
30853440
30863441--
@@ -3463,12 +3818,16 @@ data JobConfigurationQuery = JobConfigurationQuery'
34633818 , _jcqUseQueryCache :: !Bool
34643819 , _jcqPreserveNulls :: !(Maybe Bool)
34653820 , _jcqTableDefinitions :: !(Maybe JobConfigurationQueryTableDefinitions)
3821+ , _jcqQueryParameters :: !(Maybe [QueryParameter])
3822+ , _jcqSchemaUpdateOptions :: !(Maybe [Text])
3823+ , _jcqMaximumBytesBilled :: !(Maybe (Textual Int64))
34663824 , _jcqCreateDisPosition :: !(Maybe Text)
34673825 , _jcqUserDefinedFunctionResources :: !(Maybe [UserDefinedFunctionResource])
34683826 , _jcqAllowLargeResults :: !(Maybe Bool)
34693827 , _jcqMaximumBillingTier :: !(Textual Int32)
34703828 , _jcqQuery :: !(Maybe Text)
34713829 , _jcqFlattenResults :: !Bool
3830+ , _jcqParameterMode :: !(Maybe Text)
34723831 , _jcqUseLegacySQL :: !(Maybe Bool)
34733832 , _jcqDefaultDataSet :: !(Maybe DataSetReference)
34743833 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -3489,6 +3848,12 @@ data JobConfigurationQuery = JobConfigurationQuery'
34893848--
34903849-- * 'jcqTableDefinitions'
34913850--
3851+-- * 'jcqQueryParameters'
3852+--
3853+-- * 'jcqSchemaUpdateOptions'
3854+--
3855+-- * 'jcqMaximumBytesBilled'
3856+--
34923857-- * 'jcqCreateDisPosition'
34933858--
34943859-- * 'jcqUserDefinedFunctionResources'
@@ -3501,6 +3866,8 @@ data JobConfigurationQuery = JobConfigurationQuery'
35013866--
35023867-- * 'jcqFlattenResults'
35033868--
3869+-- * 'jcqParameterMode'
3870+--
35043871-- * 'jcqUseLegacySQL'
35053872--
35063873-- * 'jcqDefaultDataSet'
@@ -3514,12 +3881,16 @@ jobConfigurationQuery =
35143881 , _jcqUseQueryCache = True
35153882 , _jcqPreserveNulls = Nothing
35163883 , _jcqTableDefinitions = Nothing
3884+ , _jcqQueryParameters = Nothing
3885+ , _jcqSchemaUpdateOptions = Nothing
3886+ , _jcqMaximumBytesBilled = Nothing
35173887 , _jcqCreateDisPosition = Nothing
35183888 , _jcqUserDefinedFunctionResources = Nothing
35193889 , _jcqAllowLargeResults = Nothing
35203890 , _jcqMaximumBillingTier = 1
35213891 , _jcqQuery = Nothing
35223892 , _jcqFlattenResults = True
3893+ , _jcqParameterMode = Nothing
35233894 , _jcqUseLegacySQL = Nothing
35243895 , _jcqDefaultDataSet = Nothing
35253896 }
@@ -3576,6 +3947,39 @@ jcqTableDefinitions
35763947 = lens _jcqTableDefinitions
35773948 (\ s a -> s{_jcqTableDefinitions = a})
35783949
3950+-- | Query parameters for standard SQL queries.
3951+jcqQueryParameters :: Lens' JobConfigurationQuery [QueryParameter]
3952+jcqQueryParameters
3953+ = lens _jcqQueryParameters
3954+ (\ s a -> s{_jcqQueryParameters = a})
3955+ . _Default
3956+ . _Coerce
3957+
3958+-- | [Experimental] Allows the schema of the destination table to be updated
3959+-- as a side effect of the query job. Schema update options are supported
3960+-- in two cases: when writeDisposition is WRITE_APPEND; when
3961+-- writeDisposition is WRITE_TRUNCATE and the destination table is a
3962+-- partition of a table, specified by partition decorators. For normal
3963+-- tables, WRITE_TRUNCATE will always overwrite the schema. One or more of
3964+-- the following values are specified: ALLOW_FIELD_ADDITION: allow adding a
3965+-- nullable field to the schema. ALLOW_FIELD_RELAXATION: allow relaxing a
3966+-- required field in the original schema to nullable.
3967+jcqSchemaUpdateOptions :: Lens' JobConfigurationQuery [Text]
3968+jcqSchemaUpdateOptions
3969+ = lens _jcqSchemaUpdateOptions
3970+ (\ s a -> s{_jcqSchemaUpdateOptions = a})
3971+ . _Default
3972+ . _Coerce
3973+
3974+-- | [Optional] Limits the bytes billed for this job. Queries that will have
3975+-- bytes billed beyond this limit will fail (without incurring a charge).
3976+-- If unspecified, this will be set to your project default.
3977+jcqMaximumBytesBilled :: Lens' JobConfigurationQuery (Maybe Int64)
3978+jcqMaximumBytesBilled
3979+ = lens _jcqMaximumBytesBilled
3980+ (\ s a -> s{_jcqMaximumBytesBilled = a})
3981+ . mapping _Coerce
3982+
35793983-- | [Optional] Specifies whether the job is allowed to create new tables.
35803984-- The following values are supported: CREATE_IF_NEEDED: If the table does
35813985-- not exist, BigQuery creates the table. CREATE_NEVER: The table must
@@ -3624,6 +4028,13 @@ jcqFlattenResults
36244028 = lens _jcqFlattenResults
36254029 (\ s a -> s{_jcqFlattenResults = a})
36264030
4031+-- | [Experimental] Standard SQL only. Whether to use positional (?) or named
4032+-- (\'myparam) query parameters in this query.
4033+jcqParameterMode :: Lens' JobConfigurationQuery (Maybe Text)
4034+jcqParameterMode
4035+ = lens _jcqParameterMode
4036+ (\ s a -> s{_jcqParameterMode = a})
4037+
36274038-- | [Experimental] Specifies whether to use BigQuery\'s legacy SQL dialect
36284039-- for this query. The default value is true. If set to false, the query
36294040-- will use BigQuery\'s standard SQL:
@@ -3654,12 +4065,16 @@ instance FromJSON JobConfigurationQuery where
36544065 <*> (o .:? "useQueryCache" .!= True)
36554066 <*> (o .:? "preserveNulls")
36564067 <*> (o .:? "tableDefinitions")
4068+ <*> (o .:? "queryParameters" .!= mempty)
4069+ <*> (o .:? "schemaUpdateOptions" .!= mempty)
4070+ <*> (o .:? "maximumBytesBilled")
36574071 <*> (o .:? "createDisposition")
36584072 <*> (o .:? "userDefinedFunctionResources" .!= mempty)
36594073 <*> (o .:? "allowLargeResults")
36604074 <*> (o .:? "maximumBillingTier" .!= 1)
36614075 <*> (o .:? "query")
36624076 <*> (o .:? "flattenResults" .!= True)
4077+ <*> (o .:? "parameterMode")
36634078 <*> (o .:? "useLegacySql")
36644079 <*> (o .:? "defaultDataset"))
36654080
@@ -3673,6 +4088,10 @@ instance ToJSON JobConfigurationQuery where
36734088 Just ("useQueryCache" .= _jcqUseQueryCache),
36744089 ("preserveNulls" .=) <$> _jcqPreserveNulls,
36754090 ("tableDefinitions" .=) <$> _jcqTableDefinitions,
4091+ ("queryParameters" .=) <$> _jcqQueryParameters,
4092+ ("schemaUpdateOptions" .=) <$>
4093+ _jcqSchemaUpdateOptions,
4094+ ("maximumBytesBilled" .=) <$> _jcqMaximumBytesBilled,
36764095 ("createDisposition" .=) <$> _jcqCreateDisPosition,
36774096 ("userDefinedFunctionResources" .=) <$>
36784097 _jcqUserDefinedFunctionResources,
@@ -3681,6 +4100,7 @@ instance ToJSON JobConfigurationQuery where
36814100 ("maximumBillingTier" .= _jcqMaximumBillingTier),
36824101 ("query" .=) <$> _jcqQuery,
36834102 Just ("flattenResults" .= _jcqFlattenResults),
4103+ ("parameterMode" .=) <$> _jcqParameterMode,
36844104 ("useLegacySql" .=) <$> _jcqUseLegacySQL,
36854105 ("defaultDataset" .=) <$> _jcqDefaultDataSet])
36864106
@@ -3920,11 +4340,73 @@ instance ToJSON TableCell where
39204340 toJSON TableCell'{..}
39214341 = object (catMaybes [("v" .=) <$> _tcV])
39224342
4343+--
4344+-- /See:/ 'queryParameterValue' smart constructor.
4345+data QueryParameterValue = QueryParameterValue'
4346+ { _qpvStructValues :: !(Maybe QueryParameterValueStructValues)
4347+ , _qpvValue :: !(Maybe Text)
4348+ , _qpvArrayValues :: !(Maybe [QueryParameterValue])
4349+ } deriving (Eq,Show,Data,Typeable,Generic)
4350+
4351+-- | Creates a value of 'QueryParameterValue' with the minimum fields required to make a request.
4352+--
4353+-- Use one of the following lenses to modify other fields as desired:
4354+--
4355+-- * 'qpvStructValues'
4356+--
4357+-- * 'qpvValue'
4358+--
4359+-- * 'qpvArrayValues'
4360+queryParameterValue
4361+ :: QueryParameterValue
4362+queryParameterValue =
4363+ QueryParameterValue'
4364+ { _qpvStructValues = Nothing
4365+ , _qpvValue = Nothing
4366+ , _qpvArrayValues = Nothing
4367+ }
4368+
4369+-- | [Optional] The struct field values, in order of the struct type\'s
4370+-- declaration.
4371+qpvStructValues :: Lens' QueryParameterValue (Maybe QueryParameterValueStructValues)
4372+qpvStructValues
4373+ = lens _qpvStructValues
4374+ (\ s a -> s{_qpvStructValues = a})
4375+
4376+-- | [Optional] The value of this value, if a simple scalar type.
4377+qpvValue :: Lens' QueryParameterValue (Maybe Text)
4378+qpvValue = lens _qpvValue (\ s a -> s{_qpvValue = a})
4379+
4380+-- | [Optional] The array values, if this is an array type.
4381+qpvArrayValues :: Lens' QueryParameterValue [QueryParameterValue]
4382+qpvArrayValues
4383+ = lens _qpvArrayValues
4384+ (\ s a -> s{_qpvArrayValues = a})
4385+ . _Default
4386+ . _Coerce
4387+
4388+instance FromJSON QueryParameterValue where
4389+ parseJSON
4390+ = withObject "QueryParameterValue"
4391+ (\ o ->
4392+ QueryParameterValue' <$>
4393+ (o .:? "structValues") <*> (o .:? "value") <*>
4394+ (o .:? "arrayValues" .!= mempty))
4395+
4396+instance ToJSON QueryParameterValue where
4397+ toJSON QueryParameterValue'{..}
4398+ = object
4399+ (catMaybes
4400+ [("structValues" .=) <$> _qpvStructValues,
4401+ ("value" .=) <$> _qpvValue,
4402+ ("arrayValues" .=) <$> _qpvArrayValues])
4403+
39234404--
39244405-- /See:/ 'viewDefinition' smart constructor.
39254406data ViewDefinition = ViewDefinition'
39264407 { _vdUserDefinedFunctionResources :: !(Maybe [UserDefinedFunctionResource])
39274408 , _vdQuery :: !(Maybe Text)
4409+ , _vdUseLegacySQL :: !(Maybe Bool)
39284410 } deriving (Eq,Show,Data,Typeable,Generic)
39294411
39304412-- | Creates a value of 'ViewDefinition' with the minimum fields required to make a request.
@@ -3934,12 +4416,15 @@ data ViewDefinition = ViewDefinition'
39344416-- * 'vdUserDefinedFunctionResources'
39354417--
39364418-- * 'vdQuery'
4419+--
4420+-- * 'vdUseLegacySQL'
39374421viewDefinition
39384422 :: ViewDefinition
39394423viewDefinition =
39404424 ViewDefinition'
39414425 { _vdUserDefinedFunctionResources = Nothing
39424426 , _vdQuery = Nothing
4427+ , _vdUseLegacySQL = Nothing
39434428 }
39444429
39454430-- | [Experimental] Describes user-defined function resources used in the
@@ -3955,13 +4440,24 @@ vdUserDefinedFunctionResources
39554440vdQuery :: Lens' ViewDefinition (Maybe Text)
39564441vdQuery = lens _vdQuery (\ s a -> s{_vdQuery = a})
39574442
4443+-- | [Experimental] Specifies whether to use BigQuery\'s legacy SQL for this
4444+-- view. The default value is true. If set to false, the view will use
4445+-- BigQuery\'s standard SQL:
4446+-- https:\/\/cloud.google.com\/bigquery\/sql-reference\/ Queries and views
4447+-- that reference this view must use the same flag value.
4448+vdUseLegacySQL :: Lens' ViewDefinition (Maybe Bool)
4449+vdUseLegacySQL
4450+ = lens _vdUseLegacySQL
4451+ (\ s a -> s{_vdUseLegacySQL = a})
4452+
39584453instance FromJSON ViewDefinition where
39594454 parseJSON
39604455 = withObject "ViewDefinition"
39614456 (\ o ->
39624457 ViewDefinition' <$>
39634458 (o .:? "userDefinedFunctionResources" .!= mempty) <*>
3964− (o .:? "query"))
4459+ (o .:? "query")
4460+ <*> (o .:? "useLegacySql"))
39654461
39664462instance ToJSON ViewDefinition where
39674463 toJSON ViewDefinition'{..}
@@ -3969,7 +4465,8 @@ instance ToJSON ViewDefinition where
39694465 (catMaybes
39704466 [("userDefinedFunctionResources" .=) <$>
39714467 _vdUserDefinedFunctionResources,
3972− ("query" .=) <$> _vdQuery])
4468+ ("query" .=) <$> _vdQuery,
4469+ ("useLegacySql" .=) <$> _vdUseLegacySQL])
39734470
39744471--
39754472-- /See:/ 'userDefinedFunctionResource' smart constructor.
@@ -4025,13 +4522,15 @@ instance ToJSON UserDefinedFunctionResource where
40254522--
40264523-- /See:/ 'jobStatistics2' smart constructor.
40274524data JobStatistics2 = JobStatistics2'
4028− { _jSchema :: !(Maybe TableSchema)
4029− , _jTotalBytesProcessed :: !(Maybe (Textual Int64))
4030− , _jBillingTier :: !(Maybe (Textual Int32))
4031− , _jReferencedTables :: !(Maybe [TableReference])
4032− , _jQueryPlan :: !(Maybe [ExplainQueryStage])
4033− , _jCacheHit :: !(Maybe Bool)
4034− , _jTotalBytesBilled :: !(Maybe (Textual Int64))
4525+ { _jSchema :: !(Maybe TableSchema)
4526+ , _jTotalBytesProcessed :: !(Maybe (Textual Int64))
4527+ , _jBillingTier :: !(Maybe (Textual Int32))
4528+ , _jUndeclaredQueryParameters :: !(Maybe [QueryParameter])
4529+ , _jReferencedTables :: !(Maybe [TableReference])
4530+ , _jNumDmlAffectedRows :: !(Maybe (Textual Int64))
4531+ , _jQueryPlan :: !(Maybe [ExplainQueryStage])
4532+ , _jCacheHit :: !(Maybe Bool)
4533+ , _jTotalBytesBilled :: !(Maybe (Textual Int64))
40354534 } deriving (Eq,Show,Data,Typeable,Generic)
40364535
40374536-- | Creates a value of 'JobStatistics2' with the minimum fields required to make a request.
@@ -4044,8 +4543,12 @@ data JobStatistics2 = JobStatistics2'
40444543--
40454544-- * 'jBillingTier'
40464545--
4546+-- * 'jUndeclaredQueryParameters'
4547+--
40474548-- * 'jReferencedTables'
40484549--
4550+-- * 'jNumDmlAffectedRows'
4551+--
40494552-- * 'jQueryPlan'
40504553--
40514554-- * 'jCacheHit'
@@ -4058,7 +4561,9 @@ jobStatistics2 =
40584561 { _jSchema = Nothing
40594562 , _jTotalBytesProcessed = Nothing
40604563 , _jBillingTier = Nothing
4564+ , _jUndeclaredQueryParameters = Nothing
40614565 , _jReferencedTables = Nothing
4566+ , _jNumDmlAffectedRows = Nothing
40624567 , _jQueryPlan = Nothing
40634568 , _jCacheHit = Nothing
40644569 , _jTotalBytesBilled = Nothing
@@ -4082,6 +4587,15 @@ jBillingTier
40824587 = lens _jBillingTier (\ s a -> s{_jBillingTier = a})
40834588 . mapping _Coerce
40844589
4590+-- | [Output-only, Experimental] Standard SQL only: list of undeclared query
4591+-- parameters detected during a dry run validation.
4592+jUndeclaredQueryParameters :: Lens' JobStatistics2 [QueryParameter]
4593+jUndeclaredQueryParameters
4594+ = lens _jUndeclaredQueryParameters
4595+ (\ s a -> s{_jUndeclaredQueryParameters = a})
4596+ . _Default
4597+ . _Coerce
4598+
40854599-- | [Output-only, Experimental] Referenced tables for the job. Queries that
40864600-- reference more than 50 tables will not have a complete list.
40874601jReferencedTables :: Lens' JobStatistics2 [TableReference]
@@ -4091,8 +4605,15 @@ jReferencedTables
40914605 . _Default
40924606 . _Coerce
40934607
4094−-- | [Output-only, Experimental] Describes execution plan for the query as a
4095−-- list of stages.
4608+-- | [Output-only, Experimental] The number of rows affected by a DML
4609+-- statement. Present only for DML statements INSERT, UPDATE or DELETE.
4610+jNumDmlAffectedRows :: Lens' JobStatistics2 (Maybe Int64)
4611+jNumDmlAffectedRows
4612+ = lens _jNumDmlAffectedRows
4613+ (\ s a -> s{_jNumDmlAffectedRows = a})
4614+ . mapping _Coerce
4615+
4616+-- | [Output-only, Experimental] Describes execution plan for the query.
40964617jQueryPlan :: Lens' JobStatistics2 [ExplainQueryStage]
40974618jQueryPlan
40984619 = lens _jQueryPlan (\ s a -> s{_jQueryPlan = a}) .
@@ -4118,7 +4639,9 @@ instance FromJSON JobStatistics2 where
41184639 JobStatistics2' <$>
41194640 (o .:? "schema") <*> (o .:? "totalBytesProcessed")
41204641 <*> (o .:? "billingTier")
4642+ <*> (o .:? "undeclaredQueryParameters" .!= mempty)
41214643 <*> (o .:? "referencedTables" .!= mempty)
4644+ <*> (o .:? "numDmlAffectedRows")
41224645 <*> (o .:? "queryPlan" .!= mempty)
41234646 <*> (o .:? "cacheHit")
41244647 <*> (o .:? "totalBytesBilled"))
@@ -4130,7 +4653,10 @@ instance ToJSON JobStatistics2 where
41304653 [("schema" .=) <$> _jSchema,
41314654 ("totalBytesProcessed" .=) <$> _jTotalBytesProcessed,
41324655 ("billingTier" .=) <$> _jBillingTier,
4656+ ("undeclaredQueryParameters" .=) <$>
4657+ _jUndeclaredQueryParameters,
41334658 ("referencedTables" .=) <$> _jReferencedTables,
4659+ ("numDmlAffectedRows" .=) <$> _jNumDmlAffectedRows,
41344660 ("queryPlan" .=) <$> _jQueryPlan,
41354661 ("cacheHit" .=) <$> _jCacheHit,
41364662 ("totalBytesBilled" .=) <$> _jTotalBytesBilled])
@@ -4349,6 +4875,66 @@ instance ToJSON TableDataInsertAllResponse where
43494875 [Just ("kind" .= _tKind),
43504876 ("insertErrors" .=) <$> _tInsertErrors])
43514877
4878+--
4879+-- /See:/ 'queryParameterType' smart constructor.
4880+data QueryParameterType = QueryParameterType'
4881+ { _qptStructTypes :: !(Maybe [QueryParameterTypeStructTypesItem])
4882+ , _qptType :: !(Maybe Text)
4883+ , _qptArrayType :: !(Maybe QueryParameterType)
4884+ } deriving (Eq,Show,Data,Typeable,Generic)
4885+
4886+-- | Creates a value of 'QueryParameterType' with the minimum fields required to make a request.
4887+--
4888+-- Use one of the following lenses to modify other fields as desired:
4889+--
4890+-- * 'qptStructTypes'
4891+--
4892+-- * 'qptType'
4893+--
4894+-- * 'qptArrayType'
4895+queryParameterType
4896+ :: QueryParameterType
4897+queryParameterType =
4898+ QueryParameterType'
4899+ { _qptStructTypes = Nothing
4900+ , _qptType = Nothing
4901+ , _qptArrayType = Nothing
4902+ }
4903+
4904+-- | [Optional] The types of the fields of this struct, in order, if this is
4905+-- a struct.
4906+qptStructTypes :: Lens' QueryParameterType [QueryParameterTypeStructTypesItem]
4907+qptStructTypes
4908+ = lens _qptStructTypes
4909+ (\ s a -> s{_qptStructTypes = a})
4910+ . _Default
4911+ . _Coerce
4912+
4913+-- | [Required] The top level type of this field.
4914+qptType :: Lens' QueryParameterType (Maybe Text)
4915+qptType = lens _qptType (\ s a -> s{_qptType = a})
4916+
4917+-- | [Optional] The type of the array\'s elements, if this is an array.
4918+qptArrayType :: Lens' QueryParameterType (Maybe QueryParameterType)
4919+qptArrayType
4920+ = lens _qptArrayType (\ s a -> s{_qptArrayType = a})
4921+
4922+instance FromJSON QueryParameterType where
4923+ parseJSON
4924+ = withObject "QueryParameterType"
4925+ (\ o ->
4926+ QueryParameterType' <$>
4927+ (o .:? "structTypes" .!= mempty) <*> (o .:? "type")
4928+ <*> (o .:? "arrayType"))
4929+
4930+instance ToJSON QueryParameterType where
4931+ toJSON QueryParameterType'{..}
4932+ = object
4933+ (catMaybes
4934+ [("structTypes" .=) <$> _qptStructTypes,
4935+ ("type" .=) <$> _qptType,
4936+ ("arrayType" .=) <$> _qptArrayType])
4937+
43524938--
43534939-- /See:/ 'table' smart constructor.
43544940data Table = Table'
@@ -4890,6 +5476,7 @@ data QueryResponse = QueryResponse'
48905476 , _qTotalBytesProcessed :: !(Maybe (Textual Int64))
48915477 , _qRows :: !(Maybe [TableRow])
48925478 , _qPageToken :: !(Maybe Text)
5479+ , _qNumDmlAffectedRows :: !(Maybe (Textual Int64))
48935480 , _qTotalRows :: !(Maybe (Textual Word64))
48945481 , _qErrors :: !(Maybe [ErrorProto])
48955482 , _qJobComplete :: !(Maybe Bool)
@@ -4912,6 +5499,8 @@ data QueryResponse = QueryResponse'
49125499--
49135500-- * 'qPageToken'
49145501--
5502+-- * 'qNumDmlAffectedRows'
5503+--
49155504-- * 'qTotalRows'
49165505--
49175506-- * 'qErrors'
@@ -4929,6 +5518,7 @@ queryResponse =
49295518 , _qTotalBytesProcessed = Nothing
49305519 , _qRows = Nothing
49315520 , _qPageToken = Nothing
5521+ , _qNumDmlAffectedRows = Nothing
49325522 , _qTotalRows = Nothing
49335523 , _qErrors = Nothing
49345524 , _qJobComplete = Nothing
@@ -4977,6 +5567,14 @@ qPageToken :: Lens' QueryResponse (Maybe Text)
49775567qPageToken
49785568 = lens _qPageToken (\ s a -> s{_qPageToken = a})
49795569
5570+-- | [Output-only, Experimental] The number of rows affected by a DML
5571+-- statement. Present only for DML statements INSERT, UPDATE or DELETE.
5572+qNumDmlAffectedRows :: Lens' QueryResponse (Maybe Int64)
5573+qNumDmlAffectedRows
5574+ = lens _qNumDmlAffectedRows
5575+ (\ s a -> s{_qNumDmlAffectedRows = a})
5576+ . mapping _Coerce
5577+
49805578-- | The total number of rows in the complete query result set, which can be
49815579-- more than the number of rows in this single page of results.
49825580qTotalRows :: Lens' QueryResponse (Maybe Word64)
@@ -5015,6 +5613,7 @@ instance FromJSON QueryResponse where
50155613 <*> (o .:? "totalBytesProcessed")
50165614 <*> (o .:? "rows" .!= mempty)
50175615 <*> (o .:? "pageToken")
5616+ <*> (o .:? "numDmlAffectedRows")
50185617 <*> (o .:? "totalRows")
50195618 <*> (o .:? "errors" .!= mempty)
50205619 <*> (o .:? "jobComplete")
@@ -5029,7 +5628,45 @@ instance ToJSON QueryResponse where
50295628 ("totalBytesProcessed" .=) <$> _qTotalBytesProcessed,
50305629 ("rows" .=) <$> _qRows,
50315630 ("pageToken" .=) <$> _qPageToken,
5631+ ("numDmlAffectedRows" .=) <$> _qNumDmlAffectedRows,
50325632 ("totalRows" .=) <$> _qTotalRows,
50335633 ("errors" .=) <$> _qErrors,
50345634 ("jobComplete" .=) <$> _qJobComplete,
50355635 ("cacheHit" .=) <$> _qCacheHit])
5636+
5637+-- | [Experimental] The labels associated with this dataset. You can use
5638+-- these to organize and group your datasets.
5639+--
5640+-- /See:/ 'dataSetListDataSetsItemLabels' smart constructor.
5641+newtype DataSetListDataSetsItemLabels = DataSetListDataSetsItemLabels'
5642+ { _dsldsilAddtional :: HashMap Text Text
5643+ } deriving (Eq,Show,Data,Typeable,Generic)
5644+
5645+-- | Creates a value of 'DataSetListDataSetsItemLabels' with the minimum fields required to make a request.
5646+--
5647+-- Use one of the following lenses to modify other fields as desired:
5648+--
5649+-- * 'dsldsilAddtional'
5650+dataSetListDataSetsItemLabels
5651+ :: HashMap Text Text -- ^ 'dsldsilAddtional'
5652+ -> DataSetListDataSetsItemLabels
5653+dataSetListDataSetsItemLabels pDsldsilAddtional_ =
5654+ DataSetListDataSetsItemLabels'
5655+ { _dsldsilAddtional = _Coerce # pDsldsilAddtional_
5656+ }
5657+
5658+dsldsilAddtional :: Lens' DataSetListDataSetsItemLabels (HashMap Text Text)
5659+dsldsilAddtional
5660+ = lens _dsldsilAddtional
5661+ (\ s a -> s{_dsldsilAddtional = a})
5662+ . _Coerce
5663+
5664+instance FromJSON DataSetListDataSetsItemLabels where
5665+ parseJSON
5666+ = withObject "DataSetListDataSetsItemLabels"
5667+ (\ o ->
5668+ DataSetListDataSetsItemLabels' <$>
5669+ (parseJSONObject o))
5670+
5671+instance ToJSON DataSetListDataSetsItemLabels where
5672+ toJSON = toJSON . _dsldsilAddtional