on develop help sign in
Disambiguating time types
commit6f252b691bddfc344d31fb5916f10f0b2d9951a7 authorBrendan Hay <brendan.g.hay@gmail.com> dateWed 7 Oct 2015, 09:29 (11 years ago) parent0b8c6b9
5 files changed+21−18
core/src/Network/Google/Prelude.hs+2−1 gen/src/Gen/Text.hs+2 gogol-storage-transfer/gen/Network/Google/StorageTransfer.hs+2−2 gogol-storage-transfer/gen/Network/Google/StorageTransfer/Types.hs+2−2 gogol-storage-transfer/gen/Network/Google/StorageTransfer/Types/Product.hs+13−13
core/src/Network/Google/Prelude.hs+2−1
@@ -20,7 +20,8 @@ import Data.Maybe as Export
2020import Data.Monoid as Export (mempty, (<>))
2121import Data.Proxy as Export
2222import Data.Text as Export (Text)
23−import Data.Time as Export (UTCTime)
23+import Data.Time as Export (LocalTime, TimeOfDay,
24+ UTCTime)
2425import Data.Word as Export (Word32, Word64, Word8)
2526import GHC.Generics as Export (Generic)
2627import Network.Google.Data.JSON as Export
gen/src/Gen/Text.hs+2
@@ -132,6 +132,8 @@ renameReserved x
132132 , "Put"
133133 , "log"
134134 , "Data"
135+ , "TimeOfDay"
136+ , "LocalTime"
135137 ] ++ map Text.pack (reservedNames haskellDef)
136138
137139camelAcronym :: Text -> Text
gogol-storage-transfer/gen/Network/Google/StorageTransfer.hs+2−2
@@ -190,8 +190,8 @@ module Network.Google.StorageTransfer
190190 , hTTPData
191191 , httpdListURL
192192
193− -- ** TimeOfDay
194− , TimeOfDay
193+ -- ** TimeOfDay'
194+ , TimeOfDay'
195195 , timeOfDay
196196 , todNanos
197197 , todHours
gogol-storage-transfer/gen/Network/Google/StorageTransfer/Types.hs+2−2
@@ -142,8 +142,8 @@ module Network.Google.StorageTransfer.Types
142142 , hTTPData
143143 , httpdListURL
144144
145− -- * TimeOfDay
146− , TimeOfDay
145+ -- * TimeOfDay'
146+ , TimeOfDay'
147147 , timeOfDay
148148 , todNanos
149149 , todHours
gogol-storage-transfer/gen/Network/Google/StorageTransfer/Types/Product.hs+13−13
@@ -239,7 +239,7 @@ instance ToJSON ListOperationsResponse where
239239data Schedule = Schedule
240240 { _sScheduleEndDate :: !(Maybe Date)
241241 , _sScheduleStartDate :: !(Maybe Date)
242− , _sStartTimeOfDay :: !(Maybe TimeOfDay)
242+ , _sStartTimeOfDay :: !(Maybe TimeOfDay')
243243 } deriving (Eq,Show,Data,Typeable,Generic)
244244
245245-- | Creates a value of 'Schedule' with the minimum fields required to make a request.
@@ -277,7 +277,7 @@ sScheduleStartDate
277277-- | The time in UTC at which the transfer will be scheduled to start in a
278278-- day. Transfers may start later than this time. If not specified,
279279-- transfers are scheduled to start at midnight UTC.
280−sStartTimeOfDay :: Lens' Schedule (Maybe TimeOfDay)
280+sStartTimeOfDay :: Lens' Schedule (Maybe TimeOfDay')
281281sStartTimeOfDay
282282 = lens _sStartTimeOfDay
283283 (\ s a -> s{_sStartTimeOfDay = a})
@@ -1258,7 +1258,7 @@ instance ToJSON HTTPData where
12581258-- \`google.protobuf.Timestamp\`.
12591259--
12601260-- /See:/ 'timeOfDay' smart constructor.
1261−data TimeOfDay = TimeOfDay
1261+data TimeOfDay' = TimeOfDay'
12621262 { _todNanos :: !(Maybe Int32)
12631263 , _todHours :: !(Maybe Int32)
12641264 , _todMinutes :: !(Maybe Int32)
@@ -1277,9 +1277,9 @@ data TimeOfDay = TimeOfDay
12771277--
12781278-- * 'todSeconds'
12791279timeOfDay
1280− :: TimeOfDay
1280+ :: TimeOfDay'
12811281timeOfDay =
1282− TimeOfDay
1282+ TimeOfDay'
12831283 { _todNanos = Nothing
12841284 , _todHours = Nothing
12851285 , _todMinutes = Nothing
@@ -1287,37 +1287,37 @@ timeOfDay =
12871287 }
12881288
12891289-- | 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)
12911291todNanos = lens _todNanos (\ s a -> s{_todNanos = a})
12921292
12931293-- | Hours of day in 24 hour format. Should be from 0 to 23. An API may
12941294-- choose to allow the value \"24:00:00\" for scenarios like business
12951295-- closing time.
1296−todHours :: Lens' TimeOfDay (Maybe Int32)
1296+todHours :: Lens' TimeOfDay' (Maybe Int32)
12971297todHours = lens _todHours (\ s a -> s{_todHours = a})
12981298
12991299-- | Minutes of hour of day. Must be from 0 to 59.
1300−todMinutes :: Lens' TimeOfDay (Maybe Int32)
1300+todMinutes :: Lens' TimeOfDay' (Maybe Int32)
13011301todMinutes
13021302 = lens _todMinutes (\ s a -> s{_todMinutes = a})
13031303
13041304-- | Seconds of minutes of the time. Must normally be from 0 to 59. An API
13051305-- may allow the value 60 if it allows leap-seconds.
1306−todSeconds :: Lens' TimeOfDay (Maybe Int32)
1306+todSeconds :: Lens' TimeOfDay' (Maybe Int32)
13071307todSeconds
13081308 = lens _todSeconds (\ s a -> s{_todSeconds = a})
13091309
1310−instance FromJSON TimeOfDay where
1310+instance FromJSON TimeOfDay' where
13111311 parseJSON
13121312 = withObject "TimeOfDay"
13131313 (\ o ->
1314− TimeOfDay <$>
1314+ TimeOfDay' <$>
13151315 (o .:? "nanos") <*> (o .:? "hours") <*>
13161316 (o .:? "minutes")
13171317 <*> (o .:? "seconds"))
13181318
1319−instance ToJSON TimeOfDay where
1320− toJSON TimeOfDay{..}
1319+instance ToJSON TimeOfDay' where
1320+ toJSON TimeOfDay'{..}
13211321 = object
13221322 (catMaybes
13231323 [("nanos" .=) <$> _todNanos,