on develop help sign in
Disambiguating time types
6f252b6Brendan Hay
core/src/Network/Google/Prelude.hs+2−1
@@ -20,7 +20,8 @@ import Data.Maybe as Export
20import Data.Monoid as Export (mempty, (<>))
20import Data.Monoid as Export (mempty, (<>))
21import Data.Proxy as Export
21import Data.Proxy as Export
22import Data.Text as Export (Text)
22import Data.Text as Export (Text)
23−import Data.Time as Export (UTCTime)
23+import Data.Time as Export (LocalTime, TimeOfDay,
24+ UTCTime)
24import Data.Word as Export (Word32, Word64, Word8)
25import Data.Word as Export (Word32, Word64, Word8)
25import GHC.Generics as Export (Generic)
26import GHC.Generics as Export (Generic)
26import Network.Google.Data.JSON as Export
27import Network.Google.Data.JSON as Export
gen/src/Gen/Text.hs+2
@@ -132,6 +132,8 @@ renameReserved x
132 , "Put"
132 , "Put"
133 , "log"
133 , "log"
134 , "Data"
134 , "Data"
135+ , "TimeOfDay"
136+ , "LocalTime"
135 ] ++ map Text.pack (reservedNames haskellDef)
137 ] ++ map Text.pack (reservedNames haskellDef)
136
138
137camelAcronym :: Text -> Text
139camelAcronym :: Text -> Text
gogol-storage-transfer/gen/Network/Google/StorageTransfer.hs+2−2
@@ -190,8 +190,8 @@ module Network.Google.StorageTransfer
190 , hTTPData
190 , hTTPData
191 , httpdListURL
191 , httpdListURL
192
192
193− -- ** TimeOfDay
193+ -- ** TimeOfDay'
194− , TimeOfDay
194+ , TimeOfDay'
195 , timeOfDay
195 , timeOfDay
196 , todNanos
196 , todNanos
197 , todHours
197 , todHours
gogol-storage-transfer/gen/Network/Google/StorageTransfer/Types.hs+2−2
@@ -142,8 +142,8 @@ module Network.Google.StorageTransfer.Types
142 , hTTPData
142 , hTTPData
143 , httpdListURL
143 , httpdListURL
144
144
145− -- * TimeOfDay
145+ -- * TimeOfDay'
146− , TimeOfDay
146+ , TimeOfDay'
147 , timeOfDay
147 , timeOfDay
148 , todNanos
148 , todNanos
149 , todHours
149 , todHours
gogol-storage-transfer/gen/Network/Google/StorageTransfer/Types/Product.hs+13−13
@@ -239,7 +239,7 @@ instance ToJSON ListOperationsResponse where
239data Schedule = Schedule
239data Schedule = Schedule
240 { _sScheduleEndDate :: !(Maybe Date)
240 { _sScheduleEndDate :: !(Maybe Date)
241 , _sScheduleStartDate :: !(Maybe Date)
241 , _sScheduleStartDate :: !(Maybe Date)
242− , _sStartTimeOfDay :: !(Maybe TimeOfDay)
242+ , _sStartTimeOfDay :: !(Maybe TimeOfDay')
243 } deriving (Eq,Show,Data,Typeable,Generic)
243 } deriving (Eq,Show,Data,Typeable,Generic)
244
244
245-- | Creates a value of 'Schedule' with the minimum fields required to make a request.
245-- | Creates a value of 'Schedule' with the minimum fields required to make a request.
@@ -277,7 +277,7 @@ sScheduleStartDate
277-- | The time in UTC at which the transfer will be scheduled to start in a
277-- | The time in UTC at which the transfer will be scheduled to start in a
278-- day. Transfers may start later than this time. If not specified,
278-- day. Transfers may start later than this time. If not specified,
279-- transfers are scheduled to start at midnight UTC.
279-- transfers are scheduled to start at midnight UTC.
280−sStartTimeOfDay :: Lens' Schedule (Maybe TimeOfDay)
280+sStartTimeOfDay :: Lens' Schedule (Maybe TimeOfDay')
281sStartTimeOfDay
281sStartTimeOfDay
282 = lens _sStartTimeOfDay
282 = lens _sStartTimeOfDay
283 (\ s a -> s{_sStartTimeOfDay = a})
283 (\ s a -> s{_sStartTimeOfDay = a})
@@ -1258,7 +1258,7 @@ instance ToJSON HTTPData where
1258-- \`google.protobuf.Timestamp\`.
1258-- \`google.protobuf.Timestamp\`.
1259--
1259--
1260-- /See:/ 'timeOfDay' smart constructor.
1260-- /See:/ 'timeOfDay' smart constructor.
1261−data TimeOfDay = TimeOfDay
1261+data TimeOfDay' = TimeOfDay'
1262 { _todNanos :: !(Maybe Int32)
1262 { _todNanos :: !(Maybe Int32)
1263 , _todHours :: !(Maybe Int32)
1263 , _todHours :: !(Maybe Int32)
1264 , _todMinutes :: !(Maybe Int32)
1264 , _todMinutes :: !(Maybe Int32)
@@ -1277,9 +1277,9 @@ data TimeOfDay = TimeOfDay
1277--
1277--
1278-- * 'todSeconds'
1278-- * 'todSeconds'
1279timeOfDay
1279timeOfDay
1280− :: TimeOfDay
1280+ :: TimeOfDay'
1281timeOfDay =
1281timeOfDay =
1282− TimeOfDay
1282+ TimeOfDay'
1283 { _todNanos = Nothing
1283 { _todNanos = Nothing
1284 , _todHours = Nothing
1284 , _todHours = Nothing
1285 , _todMinutes = Nothing
1285 , _todMinutes = Nothing
@@ -1287,37 +1287,37 @@ timeOfDay =
1287 }
1287 }
1288
1288
1289-- | Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
1289-- | Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
1290−todNanos :: Lens' TimeOfDay (Maybe Int32)
1290+todNanos :: Lens' TimeOfDay' (Maybe Int32)
1291todNanos = lens _todNanos (\ s a -> s{_todNanos = a})
1291todNanos = lens _todNanos (\ s a -> s{_todNanos = a})
1292
1292
1293-- | Hours of day in 24 hour format. Should be from 0 to 23. An API may
1293-- | Hours of day in 24 hour format. Should be from 0 to 23. An API may
1294-- choose to allow the value \"24:00:00\" for scenarios like business
1294-- choose to allow the value \"24:00:00\" for scenarios like business
1295-- closing time.
1295-- closing time.
1296−todHours :: Lens' TimeOfDay (Maybe Int32)
1296+todHours :: Lens' TimeOfDay' (Maybe Int32)
1297todHours = lens _todHours (\ s a -> s{_todHours = a})
1297todHours = lens _todHours (\ s a -> s{_todHours = a})
1298
1298
1299-- | Minutes of hour of day. Must be from 0 to 59.
1299-- | Minutes of hour of day. Must be from 0 to 59.
1300−todMinutes :: Lens' TimeOfDay (Maybe Int32)
1300+todMinutes :: Lens' TimeOfDay' (Maybe Int32)
1301todMinutes
1301todMinutes
1302 = lens _todMinutes (\ s a -> s{_todMinutes = a})
1302 = lens _todMinutes (\ s a -> s{_todMinutes = a})
1303
1303
1304-- | Seconds of minutes of the time. Must normally be from 0 to 59. An API
1304-- | Seconds of minutes of the time. Must normally be from 0 to 59. An API
1305-- may allow the value 60 if it allows leap-seconds.
1305-- may allow the value 60 if it allows leap-seconds.
1306−todSeconds :: Lens' TimeOfDay (Maybe Int32)
1306+todSeconds :: Lens' TimeOfDay' (Maybe Int32)
1307todSeconds
1307todSeconds
1308 = lens _todSeconds (\ s a -> s{_todSeconds = a})
1308 = lens _todSeconds (\ s a -> s{_todSeconds = a})
1309
1309
1310−instance FromJSON TimeOfDay where
1310+instance FromJSON TimeOfDay' where
1311 parseJSON
1311 parseJSON
1312 = withObject "TimeOfDay"
1312 = withObject "TimeOfDay"
1313 (\ o ->
1313 (\ o ->
1314− TimeOfDay <$>
1314+ TimeOfDay' <$>
1315 (o .:? "nanos") <*> (o .:? "hours") <*>
1315 (o .:? "nanos") <*> (o .:? "hours") <*>
1316 (o .:? "minutes")
1316 (o .:? "minutes")
1317 <*> (o .:? "seconds"))
1317 <*> (o .:? "seconds"))
1318
1318
1319−instance ToJSON TimeOfDay where
1319+instance ToJSON TimeOfDay' where
1320− toJSON TimeOfDay{..}
1320+ toJSON TimeOfDay'{..}
1321 = object
1321 = object
1322 (catMaybes
1322 (catMaybes
1323 [("nanos" .=) <$> _todNanos,
1323 [("nanos" .=) <$> _todNanos,