module Network.Google.Mirror.Types.Product where
import Network.Google.Mirror.Types.Sum
import Network.Google.Prelude
data NotificationConfig = NotificationConfig'
{ _ncDeliveryTime :: !(Maybe DateTime')
, _ncLevel :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
notificationConfig
:: NotificationConfig
notificationConfig =
NotificationConfig'
{ _ncDeliveryTime = Nothing
, _ncLevel = Nothing
}
ncDeliveryTime :: Lens' NotificationConfig (Maybe UTCTime)
ncDeliveryTime
= lens _ncDeliveryTime
(\ s a -> s{_ncDeliveryTime = a})
. mapping _DateTime
ncLevel :: Lens' NotificationConfig (Maybe Text)
ncLevel = lens _ncLevel (\ s a -> s{_ncLevel = a})
instance FromJSON NotificationConfig where
parseJSON
= withObject "NotificationConfig"
(\ o ->
NotificationConfig' <$>
(o .:? "deliveryTime") <*> (o .:? "level"))
instance ToJSON NotificationConfig where
toJSON NotificationConfig'{..}
= object
(catMaybes
[("deliveryTime" .=) <$> _ncDeliveryTime,
("level" .=) <$> _ncLevel])
newtype Command = Command'
{ _cType :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
command
:: Command
command =
Command'
{ _cType = Nothing
}
cType :: Lens' Command (Maybe Text)
cType = lens _cType (\ s a -> s{_cType = a})
instance FromJSON Command where
parseJSON
= withObject "Command"
(\ o -> Command' <$> (o .:? "type"))
instance ToJSON Command where
toJSON Command'{..}
= object (catMaybes [("type" .=) <$> _cType])
data LocationsListResponse = LocationsListResponse'
{ _llrKind :: !Text
, _llrItems :: !(Maybe [Location])
} deriving (Eq,Show,Data,Typeable,Generic)
locationsListResponse
:: LocationsListResponse
locationsListResponse =
LocationsListResponse'
{ _llrKind = "mirror#locationsList"
, _llrItems = Nothing
}
llrKind :: Lens' LocationsListResponse Text
llrKind = lens _llrKind (\ s a -> s{_llrKind = a})
llrItems :: Lens' LocationsListResponse [Location]
llrItems
= lens _llrItems (\ s a -> s{_llrItems = a}) .
_Default
. _Coerce
instance FromJSON LocationsListResponse where
parseJSON
= withObject "LocationsListResponse"
(\ o ->
LocationsListResponse' <$>
(o .:? "kind" .!= "mirror#locationsList") <*>
(o .:? "items" .!= mempty))
instance ToJSON LocationsListResponse where
toJSON LocationsListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _llrKind),
("items" .=) <$> _llrItems])
data Location = Location'
{ _lKind :: !Text
, _lLatitude :: !(Maybe (Textual Double))
, _lAddress :: !(Maybe Text)
, _lDisplayName :: !(Maybe Text)
, _lId :: !(Maybe Text)
, _lAccuracy :: !(Maybe (Textual Double))
, _lLongitude :: !(Maybe (Textual Double))
, _lTimestamp :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
location
:: Location
location =
Location'
{ _lKind = "mirror#location"
, _lLatitude = Nothing
, _lAddress = Nothing
, _lDisplayName = Nothing
, _lId = Nothing
, _lAccuracy = Nothing
, _lLongitude = Nothing
, _lTimestamp = Nothing
}
lKind :: Lens' Location Text
lKind = lens _lKind (\ s a -> s{_lKind = a})
lLatitude :: Lens' Location (Maybe Double)
lLatitude
= lens _lLatitude (\ s a -> s{_lLatitude = a}) .
mapping _Coerce
lAddress :: Lens' Location (Maybe Text)
lAddress = lens _lAddress (\ s a -> s{_lAddress = a})
lDisplayName :: Lens' Location (Maybe Text)
lDisplayName
= lens _lDisplayName (\ s a -> s{_lDisplayName = a})
lId :: Lens' Location (Maybe Text)
lId = lens _lId (\ s a -> s{_lId = a})
lAccuracy :: Lens' Location (Maybe Double)
lAccuracy
= lens _lAccuracy (\ s a -> s{_lAccuracy = a}) .
mapping _Coerce
lLongitude :: Lens' Location (Maybe Double)
lLongitude
= lens _lLongitude (\ s a -> s{_lLongitude = a}) .
mapping _Coerce
lTimestamp :: Lens' Location (Maybe UTCTime)
lTimestamp
= lens _lTimestamp (\ s a -> s{_lTimestamp = a}) .
mapping _DateTime
instance FromJSON Location where
parseJSON
= withObject "Location"
(\ o ->
Location' <$>
(o .:? "kind" .!= "mirror#location") <*>
(o .:? "latitude")
<*> (o .:? "address")
<*> (o .:? "displayName")
<*> (o .:? "id")
<*> (o .:? "accuracy")
<*> (o .:? "longitude")
<*> (o .:? "timestamp"))
instance ToJSON Location where
toJSON Location'{..}
= object
(catMaybes
[Just ("kind" .= _lKind),
("latitude" .=) <$> _lLatitude,
("address" .=) <$> _lAddress,
("displayName" .=) <$> _lDisplayName,
("id" .=) <$> _lId, ("accuracy" .=) <$> _lAccuracy,
("longitude" .=) <$> _lLongitude,
("timestamp" .=) <$> _lTimestamp])
data Notification = Notification'
{ _nOperation :: !(Maybe Text)
, _nItemId :: !(Maybe Text)
, _nCollection :: !(Maybe Text)
, _nUserActions :: !(Maybe [UserAction])
, _nVerifyToken :: !(Maybe Text)
, _nUserToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
notification
:: Notification
notification =
Notification'
{ _nOperation = Nothing
, _nItemId = Nothing
, _nCollection = Nothing
, _nUserActions = Nothing
, _nVerifyToken = Nothing
, _nUserToken = Nothing
}
nOperation :: Lens' Notification (Maybe Text)
nOperation
= lens _nOperation (\ s a -> s{_nOperation = a})
nItemId :: Lens' Notification (Maybe Text)
nItemId = lens _nItemId (\ s a -> s{_nItemId = a})
nCollection :: Lens' Notification (Maybe Text)
nCollection
= lens _nCollection (\ s a -> s{_nCollection = a})
nUserActions :: Lens' Notification [UserAction]
nUserActions
= lens _nUserActions (\ s a -> s{_nUserActions = a})
. _Default
. _Coerce
nVerifyToken :: Lens' Notification (Maybe Text)
nVerifyToken
= lens _nVerifyToken (\ s a -> s{_nVerifyToken = a})
nUserToken :: Lens' Notification (Maybe Text)
nUserToken
= lens _nUserToken (\ s a -> s{_nUserToken = a})
instance FromJSON Notification where
parseJSON
= withObject "Notification"
(\ o ->
Notification' <$>
(o .:? "operation") <*> (o .:? "itemId") <*>
(o .:? "collection")
<*> (o .:? "userActions" .!= mempty)
<*> (o .:? "verifyToken")
<*> (o .:? "userToken"))
instance ToJSON Notification where
toJSON Notification'{..}
= object
(catMaybes
[("operation" .=) <$> _nOperation,
("itemId" .=) <$> _nItemId,
("collection" .=) <$> _nCollection,
("userActions" .=) <$> _nUserActions,
("verifyToken" .=) <$> _nVerifyToken,
("userToken" .=) <$> _nUserToken])
data Contact = Contact'
{ _conAcceptCommands :: !(Maybe [Command])
, _conSharingFeatures :: !(Maybe [Text])
, _conImageURLs :: !(Maybe [Text])
, _conPriority :: !(Maybe (Textual Word32))
, _conKind :: !Text
, _conAcceptTypes :: !(Maybe [Text])
, _conPhoneNumber :: !(Maybe Text)
, _conDisplayName :: !(Maybe Text)
, _conSource :: !(Maybe Text)
, _conId :: !(Maybe Text)
, _conType :: !(Maybe Text)
, _conSpeakableName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
contact
:: Contact
contact =
Contact'
{ _conAcceptCommands = Nothing
, _conSharingFeatures = Nothing
, _conImageURLs = Nothing
, _conPriority = Nothing
, _conKind = "mirror#contact"
, _conAcceptTypes = Nothing
, _conPhoneNumber = Nothing
, _conDisplayName = Nothing
, _conSource = Nothing
, _conId = Nothing
, _conType = Nothing
, _conSpeakableName = Nothing
}
conAcceptCommands :: Lens' Contact [Command]
conAcceptCommands
= lens _conAcceptCommands
(\ s a -> s{_conAcceptCommands = a})
. _Default
. _Coerce
conSharingFeatures :: Lens' Contact [Text]
conSharingFeatures
= lens _conSharingFeatures
(\ s a -> s{_conSharingFeatures = a})
. _Default
. _Coerce
conImageURLs :: Lens' Contact [Text]
conImageURLs
= lens _conImageURLs (\ s a -> s{_conImageURLs = a})
. _Default
. _Coerce
conPriority :: Lens' Contact (Maybe Word32)
conPriority
= lens _conPriority (\ s a -> s{_conPriority = a}) .
mapping _Coerce
conKind :: Lens' Contact Text
conKind = lens _conKind (\ s a -> s{_conKind = a})
conAcceptTypes :: Lens' Contact [Text]
conAcceptTypes
= lens _conAcceptTypes
(\ s a -> s{_conAcceptTypes = a})
. _Default
. _Coerce
conPhoneNumber :: Lens' Contact (Maybe Text)
conPhoneNumber
= lens _conPhoneNumber
(\ s a -> s{_conPhoneNumber = a})
conDisplayName :: Lens' Contact (Maybe Text)
conDisplayName
= lens _conDisplayName
(\ s a -> s{_conDisplayName = a})
conSource :: Lens' Contact (Maybe Text)
conSource
= lens _conSource (\ s a -> s{_conSource = a})
conId :: Lens' Contact (Maybe Text)
conId = lens _conId (\ s a -> s{_conId = a})
conType :: Lens' Contact (Maybe Text)
conType = lens _conType (\ s a -> s{_conType = a})
conSpeakableName :: Lens' Contact (Maybe Text)
conSpeakableName
= lens _conSpeakableName
(\ s a -> s{_conSpeakableName = a})
instance FromJSON Contact where
parseJSON
= withObject "Contact"
(\ o ->
Contact' <$>
(o .:? "acceptCommands" .!= mempty) <*>
(o .:? "sharingFeatures" .!= mempty)
<*> (o .:? "imageUrls" .!= mempty)
<*> (o .:? "priority")
<*> (o .:? "kind" .!= "mirror#contact")
<*> (o .:? "acceptTypes" .!= mempty)
<*> (o .:? "phoneNumber")
<*> (o .:? "displayName")
<*> (o .:? "source")
<*> (o .:? "id")
<*> (o .:? "type")
<*> (o .:? "speakableName"))
instance ToJSON Contact where
toJSON Contact'{..}
= object
(catMaybes
[("acceptCommands" .=) <$> _conAcceptCommands,
("sharingFeatures" .=) <$> _conSharingFeatures,
("imageUrls" .=) <$> _conImageURLs,
("priority" .=) <$> _conPriority,
Just ("kind" .= _conKind),
("acceptTypes" .=) <$> _conAcceptTypes,
("phoneNumber" .=) <$> _conPhoneNumber,
("displayName" .=) <$> _conDisplayName,
("source" .=) <$> _conSource, ("id" .=) <$> _conId,
("type" .=) <$> _conType,
("speakableName" .=) <$> _conSpeakableName])
data AuthToken = AuthToken'
{ _atAuthToken :: !(Maybe Text)
, _atType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
authToken
:: AuthToken
authToken =
AuthToken'
{ _atAuthToken = Nothing
, _atType = Nothing
}
atAuthToken :: Lens' AuthToken (Maybe Text)
atAuthToken
= lens _atAuthToken (\ s a -> s{_atAuthToken = a})
atType :: Lens' AuthToken (Maybe Text)
atType = lens _atType (\ s a -> s{_atType = a})
instance FromJSON AuthToken where
parseJSON
= withObject "AuthToken"
(\ o ->
AuthToken' <$>
(o .:? "authToken") <*> (o .:? "type"))
instance ToJSON AuthToken where
toJSON AuthToken'{..}
= object
(catMaybes
[("authToken" .=) <$> _atAuthToken,
("type" .=) <$> _atType])
data AttachmentsListResponse = AttachmentsListResponse'
{ _alrKind :: !Text
, _alrItems :: !(Maybe [Attachment])
} deriving (Eq,Show,Data,Typeable,Generic)
attachmentsListResponse
:: AttachmentsListResponse
attachmentsListResponse =
AttachmentsListResponse'
{ _alrKind = "mirror#attachmentsList"
, _alrItems = Nothing
}
alrKind :: Lens' AttachmentsListResponse Text
alrKind = lens _alrKind (\ s a -> s{_alrKind = a})
alrItems :: Lens' AttachmentsListResponse [Attachment]
alrItems
= lens _alrItems (\ s a -> s{_alrItems = a}) .
_Default
. _Coerce
instance FromJSON AttachmentsListResponse where
parseJSON
= withObject "AttachmentsListResponse"
(\ o ->
AttachmentsListResponse' <$>
(o .:? "kind" .!= "mirror#attachmentsList") <*>
(o .:? "items" .!= mempty))
instance ToJSON AttachmentsListResponse where
toJSON AttachmentsListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _alrKind),
("items" .=) <$> _alrItems])
data MenuItem = MenuItem'
{ _miValues :: !(Maybe [MenuValue])
, _miRemoveWhenSelected :: !(Maybe Bool)
, _miAction :: !(Maybe Text)
, _miPayload :: !(Maybe Text)
, _miContextualCommand :: !(Maybe Text)
, _miId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
menuItem
:: MenuItem
menuItem =
MenuItem'
{ _miValues = Nothing
, _miRemoveWhenSelected = Nothing
, _miAction = Nothing
, _miPayload = Nothing
, _miContextualCommand = Nothing
, _miId = Nothing
}
miValues :: Lens' MenuItem [MenuValue]
miValues
= lens _miValues (\ s a -> s{_miValues = a}) .
_Default
. _Coerce
miRemoveWhenSelected :: Lens' MenuItem (Maybe Bool)
miRemoveWhenSelected
= lens _miRemoveWhenSelected
(\ s a -> s{_miRemoveWhenSelected = a})
miAction :: Lens' MenuItem (Maybe Text)
miAction = lens _miAction (\ s a -> s{_miAction = a})
miPayload :: Lens' MenuItem (Maybe Text)
miPayload
= lens _miPayload (\ s a -> s{_miPayload = a})
miContextualCommand :: Lens' MenuItem (Maybe Text)
miContextualCommand
= lens _miContextualCommand
(\ s a -> s{_miContextualCommand = a})
miId :: Lens' MenuItem (Maybe Text)
miId = lens _miId (\ s a -> s{_miId = a})
instance FromJSON MenuItem where
parseJSON
= withObject "MenuItem"
(\ o ->
MenuItem' <$>
(o .:? "values" .!= mempty) <*>
(o .:? "removeWhenSelected")
<*> (o .:? "action")
<*> (o .:? "payload")
<*> (o .:? "contextual_command")
<*> (o .:? "id"))
instance ToJSON MenuItem where
toJSON MenuItem'{..}
= object
(catMaybes
[("values" .=) <$> _miValues,
("removeWhenSelected" .=) <$> _miRemoveWhenSelected,
("action" .=) <$> _miAction,
("payload" .=) <$> _miPayload,
("contextual_command" .=) <$> _miContextualCommand,
("id" .=) <$> _miId])
data Setting = Setting'
{ _sKind :: !Text
, _sValue :: !(Maybe Text)
, _sId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
setting
:: Setting
setting =
Setting'
{ _sKind = "mirror#setting"
, _sValue = Nothing
, _sId = Nothing
}
sKind :: Lens' Setting Text
sKind = lens _sKind (\ s a -> s{_sKind = a})
sValue :: Lens' Setting (Maybe Text)
sValue = lens _sValue (\ s a -> s{_sValue = a})
sId :: Lens' Setting (Maybe Text)
sId = lens _sId (\ s a -> s{_sId = a})
instance FromJSON Setting where
parseJSON
= withObject "Setting"
(\ o ->
Setting' <$>
(o .:? "kind" .!= "mirror#setting") <*>
(o .:? "value")
<*> (o .:? "id"))
instance ToJSON Setting where
toJSON Setting'{..}
= object
(catMaybes
[Just ("kind" .= _sKind), ("value" .=) <$> _sValue,
("id" .=) <$> _sId])
data Attachment = Attachment'
{ _aContentURL :: !(Maybe Text)
, _aId :: !(Maybe Text)
, _aIsProcessingContent :: !(Maybe Bool)
, _aContentType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
attachment
:: Attachment
attachment =
Attachment'
{ _aContentURL = Nothing
, _aId = Nothing
, _aIsProcessingContent = Nothing
, _aContentType = Nothing
}
aContentURL :: Lens' Attachment (Maybe Text)
aContentURL
= lens _aContentURL (\ s a -> s{_aContentURL = a})
aId :: Lens' Attachment (Maybe Text)
aId = lens _aId (\ s a -> s{_aId = a})
aIsProcessingContent :: Lens' Attachment (Maybe Bool)
aIsProcessingContent
= lens _aIsProcessingContent
(\ s a -> s{_aIsProcessingContent = a})
aContentType :: Lens' Attachment (Maybe Text)
aContentType
= lens _aContentType (\ s a -> s{_aContentType = a})
instance FromJSON Attachment where
parseJSON
= withObject "Attachment"
(\ o ->
Attachment' <$>
(o .:? "contentUrl") <*> (o .:? "id") <*>
(o .:? "isProcessingContent")
<*> (o .:? "contentType"))
instance ToJSON Attachment where
toJSON Attachment'{..}
= object
(catMaybes
[("contentUrl" .=) <$> _aContentURL,
("id" .=) <$> _aId,
("isProcessingContent" .=) <$> _aIsProcessingContent,
("contentType" .=) <$> _aContentType])
data Account = Account'
{ _aAuthTokens :: !(Maybe [AuthToken])
, _aUserData :: !(Maybe [UserData])
, _aPassword :: !(Maybe Text)
, _aFeatures :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
account
:: Account
account =
Account'
{ _aAuthTokens = Nothing
, _aUserData = Nothing
, _aPassword = Nothing
, _aFeatures = Nothing
}
aAuthTokens :: Lens' Account [AuthToken]
aAuthTokens
= lens _aAuthTokens (\ s a -> s{_aAuthTokens = a}) .
_Default
. _Coerce
aUserData :: Lens' Account [UserData]
aUserData
= lens _aUserData (\ s a -> s{_aUserData = a}) .
_Default
. _Coerce
aPassword :: Lens' Account (Maybe Text)
aPassword
= lens _aPassword (\ s a -> s{_aPassword = a})
aFeatures :: Lens' Account [Text]
aFeatures
= lens _aFeatures (\ s a -> s{_aFeatures = a}) .
_Default
. _Coerce
instance FromJSON Account where
parseJSON
= withObject "Account"
(\ o ->
Account' <$>
(o .:? "authTokens" .!= mempty) <*>
(o .:? "userData" .!= mempty)
<*> (o .:? "password")
<*> (o .:? "features" .!= mempty))
instance ToJSON Account where
toJSON Account'{..}
= object
(catMaybes
[("authTokens" .=) <$> _aAuthTokens,
("userData" .=) <$> _aUserData,
("password" .=) <$> _aPassword,
("features" .=) <$> _aFeatures])
data UserData = UserData'
{ _udValue :: !(Maybe Text)
, _udKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
userData
:: UserData
userData =
UserData'
{ _udValue = Nothing
, _udKey = Nothing
}
udValue :: Lens' UserData (Maybe Text)
udValue = lens _udValue (\ s a -> s{_udValue = a})
udKey :: Lens' UserData (Maybe Text)
udKey = lens _udKey (\ s a -> s{_udKey = a})
instance FromJSON UserData where
parseJSON
= withObject "UserData"
(\ o ->
UserData' <$> (o .:? "value") <*> (o .:? "key"))
instance ToJSON UserData where
toJSON UserData'{..}
= object
(catMaybes
[("value" .=) <$> _udValue, ("key" .=) <$> _udKey])
data UserAction = UserAction'
{ _uaPayload :: !(Maybe Text)
, _uaType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
userAction
:: UserAction
userAction =
UserAction'
{ _uaPayload = Nothing
, _uaType = Nothing
}
uaPayload :: Lens' UserAction (Maybe Text)
uaPayload
= lens _uaPayload (\ s a -> s{_uaPayload = a})
uaType :: Lens' UserAction (Maybe Text)
uaType = lens _uaType (\ s a -> s{_uaType = a})
instance FromJSON UserAction where
parseJSON
= withObject "UserAction"
(\ o ->
UserAction' <$> (o .:? "payload") <*> (o .:? "type"))
instance ToJSON UserAction where
toJSON UserAction'{..}
= object
(catMaybes
[("payload" .=) <$> _uaPayload,
("type" .=) <$> _uaType])
data TimelineListResponse = TimelineListResponse'
{ _tlrNextPageToken :: !(Maybe Text)
, _tlrKind :: !Text
, _tlrItems :: !(Maybe [TimelineItem])
} deriving (Eq,Show,Data,Typeable,Generic)
timelineListResponse
:: TimelineListResponse
timelineListResponse =
TimelineListResponse'
{ _tlrNextPageToken = Nothing
, _tlrKind = "mirror#timeline"
, _tlrItems = Nothing
}
tlrNextPageToken :: Lens' TimelineListResponse (Maybe Text)
tlrNextPageToken
= lens _tlrNextPageToken
(\ s a -> s{_tlrNextPageToken = a})
tlrKind :: Lens' TimelineListResponse Text
tlrKind = lens _tlrKind (\ s a -> s{_tlrKind = a})
tlrItems :: Lens' TimelineListResponse [TimelineItem]
tlrItems
= lens _tlrItems (\ s a -> s{_tlrItems = a}) .
_Default
. _Coerce
instance FromJSON TimelineListResponse where
parseJSON
= withObject "TimelineListResponse"
(\ o ->
TimelineListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "mirror#timeline")
<*> (o .:? "items" .!= mempty))
instance ToJSON TimelineListResponse where
toJSON TimelineListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _tlrNextPageToken,
Just ("kind" .= _tlrKind),
("items" .=) <$> _tlrItems])
data ContactsListResponse = ContactsListResponse'
{ _clrKind :: !Text
, _clrItems :: !(Maybe [Contact])
} deriving (Eq,Show,Data,Typeable,Generic)
contactsListResponse
:: ContactsListResponse
contactsListResponse =
ContactsListResponse'
{ _clrKind = "mirror#contacts"
, _clrItems = Nothing
}
clrKind :: Lens' ContactsListResponse Text
clrKind = lens _clrKind (\ s a -> s{_clrKind = a})
clrItems :: Lens' ContactsListResponse [Contact]
clrItems
= lens _clrItems (\ s a -> s{_clrItems = a}) .
_Default
. _Coerce
instance FromJSON ContactsListResponse where
parseJSON
= withObject "ContactsListResponse"
(\ o ->
ContactsListResponse' <$>
(o .:? "kind" .!= "mirror#contacts") <*>
(o .:? "items" .!= mempty))
instance ToJSON ContactsListResponse where
toJSON ContactsListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _clrKind),
("items" .=) <$> _clrItems])
data MenuValue = MenuValue'
{ _mvState :: !(Maybe Text)
, _mvDisplayName :: !(Maybe Text)
, _mvIconURL :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
menuValue
:: MenuValue
menuValue =
MenuValue'
{ _mvState = Nothing
, _mvDisplayName = Nothing
, _mvIconURL = Nothing
}
mvState :: Lens' MenuValue (Maybe Text)
mvState = lens _mvState (\ s a -> s{_mvState = a})
mvDisplayName :: Lens' MenuValue (Maybe Text)
mvDisplayName
= lens _mvDisplayName
(\ s a -> s{_mvDisplayName = a})
mvIconURL :: Lens' MenuValue (Maybe Text)
mvIconURL
= lens _mvIconURL (\ s a -> s{_mvIconURL = a})
instance FromJSON MenuValue where
parseJSON
= withObject "MenuValue"
(\ o ->
MenuValue' <$>
(o .:? "state") <*> (o .:? "displayName") <*>
(o .:? "iconUrl"))
instance ToJSON MenuValue where
toJSON MenuValue'{..}
= object
(catMaybes
[("state" .=) <$> _mvState,
("displayName" .=) <$> _mvDisplayName,
("iconUrl" .=) <$> _mvIconURL])
data Subscription = Subscription'
{ _subCallbackURL :: !(Maybe Text)
, _subOperation :: !(Maybe [Text])
, _subNotification :: !(Maybe Notification)
, _subKind :: !Text
, _subCollection :: !(Maybe Text)
, _subVerifyToken :: !(Maybe Text)
, _subUserToken :: !(Maybe Text)
, _subId :: !(Maybe Text)
, _subUpdated :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
subscription
:: Subscription
subscription =
Subscription'
{ _subCallbackURL = Nothing
, _subOperation = Nothing
, _subNotification = Nothing
, _subKind = "mirror#subscription"
, _subCollection = Nothing
, _subVerifyToken = Nothing
, _subUserToken = Nothing
, _subId = Nothing
, _subUpdated = Nothing
}
subCallbackURL :: Lens' Subscription (Maybe Text)
subCallbackURL
= lens _subCallbackURL
(\ s a -> s{_subCallbackURL = a})
subOperation :: Lens' Subscription [Text]
subOperation
= lens _subOperation (\ s a -> s{_subOperation = a})
. _Default
. _Coerce
subNotification :: Lens' Subscription (Maybe Notification)
subNotification
= lens _subNotification
(\ s a -> s{_subNotification = a})
subKind :: Lens' Subscription Text
subKind = lens _subKind (\ s a -> s{_subKind = a})
subCollection :: Lens' Subscription (Maybe Text)
subCollection
= lens _subCollection
(\ s a -> s{_subCollection = a})
subVerifyToken :: Lens' Subscription (Maybe Text)
subVerifyToken
= lens _subVerifyToken
(\ s a -> s{_subVerifyToken = a})
subUserToken :: Lens' Subscription (Maybe Text)
subUserToken
= lens _subUserToken (\ s a -> s{_subUserToken = a})
subId :: Lens' Subscription (Maybe Text)
subId = lens _subId (\ s a -> s{_subId = a})
subUpdated :: Lens' Subscription (Maybe UTCTime)
subUpdated
= lens _subUpdated (\ s a -> s{_subUpdated = a}) .
mapping _DateTime
instance FromJSON Subscription where
parseJSON
= withObject "Subscription"
(\ o ->
Subscription' <$>
(o .:? "callbackUrl") <*>
(o .:? "operation" .!= mempty)
<*> (o .:? "notification")
<*> (o .:? "kind" .!= "mirror#subscription")
<*> (o .:? "collection")
<*> (o .:? "verifyToken")
<*> (o .:? "userToken")
<*> (o .:? "id")
<*> (o .:? "updated"))
instance ToJSON Subscription where
toJSON Subscription'{..}
= object
(catMaybes
[("callbackUrl" .=) <$> _subCallbackURL,
("operation" .=) <$> _subOperation,
("notification" .=) <$> _subNotification,
Just ("kind" .= _subKind),
("collection" .=) <$> _subCollection,
("verifyToken" .=) <$> _subVerifyToken,
("userToken" .=) <$> _subUserToken,
("id" .=) <$> _subId,
("updated" .=) <$> _subUpdated])
data TimelineItem = TimelineItem'
{ _tiCreator :: !(Maybe Contact)
, _tiDisplayTime :: !(Maybe DateTime')
, _tiEtag :: !(Maybe Text)
, _tiIsDeleted :: !(Maybe Bool)
, _tiPinScore :: !(Maybe (Textual Int32))
, _tiAttachments :: !(Maybe [Attachment])
, _tiLocation :: !(Maybe Location)
, _tiMenuItems :: !(Maybe [MenuItem])
, _tiNotification :: !(Maybe NotificationConfig)
, _tiText :: !(Maybe Text)
, _tiKind :: !Text
, _tiCreated :: !(Maybe DateTime')
, _tiSpeakableText :: !(Maybe Text)
, _tiIsBundleCover :: !(Maybe Bool)
, _tiSpeakableType :: !(Maybe Text)
, _tiBundleId :: !(Maybe Text)
, _tiCanonicalURL :: !(Maybe Text)
, _tiSelfLink :: !(Maybe Text)
, _tiIsPinned :: !(Maybe Bool)
, _tiSourceItemId :: !(Maybe Text)
, _tiId :: !(Maybe Text)
, _tiHTML :: !(Maybe Text)
, _tiUpdated :: !(Maybe DateTime')
, _tiRecipients :: !(Maybe [Contact])
, _tiTitle :: !(Maybe Text)
, _tiInReplyTo :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
timelineItem
:: TimelineItem
timelineItem =
TimelineItem'
{ _tiCreator = Nothing
, _tiDisplayTime = Nothing
, _tiEtag = Nothing
, _tiIsDeleted = Nothing
, _tiPinScore = Nothing
, _tiAttachments = Nothing
, _tiLocation = Nothing
, _tiMenuItems = Nothing
, _tiNotification = Nothing
, _tiText = Nothing
, _tiKind = "mirror#timelineItem"
, _tiCreated = Nothing
, _tiSpeakableText = Nothing
, _tiIsBundleCover = Nothing
, _tiSpeakableType = Nothing
, _tiBundleId = Nothing
, _tiCanonicalURL = Nothing
, _tiSelfLink = Nothing
, _tiIsPinned = Nothing
, _tiSourceItemId = Nothing
, _tiId = Nothing
, _tiHTML = Nothing
, _tiUpdated = Nothing
, _tiRecipients = Nothing
, _tiTitle = Nothing
, _tiInReplyTo = Nothing
}
tiCreator :: Lens' TimelineItem (Maybe Contact)
tiCreator
= lens _tiCreator (\ s a -> s{_tiCreator = a})
tiDisplayTime :: Lens' TimelineItem (Maybe UTCTime)
tiDisplayTime
= lens _tiDisplayTime
(\ s a -> s{_tiDisplayTime = a})
. mapping _DateTime
tiEtag :: Lens' TimelineItem (Maybe Text)
tiEtag = lens _tiEtag (\ s a -> s{_tiEtag = a})
tiIsDeleted :: Lens' TimelineItem (Maybe Bool)
tiIsDeleted
= lens _tiIsDeleted (\ s a -> s{_tiIsDeleted = a})
tiPinScore :: Lens' TimelineItem (Maybe Int32)
tiPinScore
= lens _tiPinScore (\ s a -> s{_tiPinScore = a}) .
mapping _Coerce
tiAttachments :: Lens' TimelineItem [Attachment]
tiAttachments
= lens _tiAttachments
(\ s a -> s{_tiAttachments = a})
. _Default
. _Coerce
tiLocation :: Lens' TimelineItem (Maybe Location)
tiLocation
= lens _tiLocation (\ s a -> s{_tiLocation = a})
tiMenuItems :: Lens' TimelineItem [MenuItem]
tiMenuItems
= lens _tiMenuItems (\ s a -> s{_tiMenuItems = a}) .
_Default
. _Coerce
tiNotification :: Lens' TimelineItem (Maybe NotificationConfig)
tiNotification
= lens _tiNotification
(\ s a -> s{_tiNotification = a})
tiText :: Lens' TimelineItem (Maybe Text)
tiText = lens _tiText (\ s a -> s{_tiText = a})
tiKind :: Lens' TimelineItem Text
tiKind = lens _tiKind (\ s a -> s{_tiKind = a})
tiCreated :: Lens' TimelineItem (Maybe UTCTime)
tiCreated
= lens _tiCreated (\ s a -> s{_tiCreated = a}) .
mapping _DateTime
tiSpeakableText :: Lens' TimelineItem (Maybe Text)
tiSpeakableText
= lens _tiSpeakableText
(\ s a -> s{_tiSpeakableText = a})
tiIsBundleCover :: Lens' TimelineItem (Maybe Bool)
tiIsBundleCover
= lens _tiIsBundleCover
(\ s a -> s{_tiIsBundleCover = a})
tiSpeakableType :: Lens' TimelineItem (Maybe Text)
tiSpeakableType
= lens _tiSpeakableType
(\ s a -> s{_tiSpeakableType = a})
tiBundleId :: Lens' TimelineItem (Maybe Text)
tiBundleId
= lens _tiBundleId (\ s a -> s{_tiBundleId = a})
tiCanonicalURL :: Lens' TimelineItem (Maybe Text)
tiCanonicalURL
= lens _tiCanonicalURL
(\ s a -> s{_tiCanonicalURL = a})
tiSelfLink :: Lens' TimelineItem (Maybe Text)
tiSelfLink
= lens _tiSelfLink (\ s a -> s{_tiSelfLink = a})
tiIsPinned :: Lens' TimelineItem (Maybe Bool)
tiIsPinned
= lens _tiIsPinned (\ s a -> s{_tiIsPinned = a})
tiSourceItemId :: Lens' TimelineItem (Maybe Text)
tiSourceItemId
= lens _tiSourceItemId
(\ s a -> s{_tiSourceItemId = a})
tiId :: Lens' TimelineItem (Maybe Text)
tiId = lens _tiId (\ s a -> s{_tiId = a})
tiHTML :: Lens' TimelineItem (Maybe Text)
tiHTML = lens _tiHTML (\ s a -> s{_tiHTML = a})
tiUpdated :: Lens' TimelineItem (Maybe UTCTime)
tiUpdated
= lens _tiUpdated (\ s a -> s{_tiUpdated = a}) .
mapping _DateTime
tiRecipients :: Lens' TimelineItem [Contact]
tiRecipients
= lens _tiRecipients (\ s a -> s{_tiRecipients = a})
. _Default
. _Coerce
tiTitle :: Lens' TimelineItem (Maybe Text)
tiTitle = lens _tiTitle (\ s a -> s{_tiTitle = a})
tiInReplyTo :: Lens' TimelineItem (Maybe Text)
tiInReplyTo
= lens _tiInReplyTo (\ s a -> s{_tiInReplyTo = a})
instance FromJSON TimelineItem where
parseJSON
= withObject "TimelineItem"
(\ o ->
TimelineItem' <$>
(o .:? "creator") <*> (o .:? "displayTime") <*>
(o .:? "etag")
<*> (o .:? "isDeleted")
<*> (o .:? "pinScore")
<*> (o .:? "attachments" .!= mempty)
<*> (o .:? "location")
<*> (o .:? "menuItems" .!= mempty)
<*> (o .:? "notification")
<*> (o .:? "text")
<*> (o .:? "kind" .!= "mirror#timelineItem")
<*> (o .:? "created")
<*> (o .:? "speakableText")
<*> (o .:? "isBundleCover")
<*> (o .:? "speakableType")
<*> (o .:? "bundleId")
<*> (o .:? "canonicalUrl")
<*> (o .:? "selfLink")
<*> (o .:? "isPinned")
<*> (o .:? "sourceItemId")
<*> (o .:? "id")
<*> (o .:? "html")
<*> (o .:? "updated")
<*> (o .:? "recipients" .!= mempty)
<*> (o .:? "title")
<*> (o .:? "inReplyTo"))
instance ToJSON TimelineItem where
toJSON TimelineItem'{..}
= object
(catMaybes
[("creator" .=) <$> _tiCreator,
("displayTime" .=) <$> _tiDisplayTime,
("etag" .=) <$> _tiEtag,
("isDeleted" .=) <$> _tiIsDeleted,
("pinScore" .=) <$> _tiPinScore,
("attachments" .=) <$> _tiAttachments,
("location" .=) <$> _tiLocation,
("menuItems" .=) <$> _tiMenuItems,
("notification" .=) <$> _tiNotification,
("text" .=) <$> _tiText, Just ("kind" .= _tiKind),
("created" .=) <$> _tiCreated,
("speakableText" .=) <$> _tiSpeakableText,
("isBundleCover" .=) <$> _tiIsBundleCover,
("speakableType" .=) <$> _tiSpeakableType,
("bundleId" .=) <$> _tiBundleId,
("canonicalUrl" .=) <$> _tiCanonicalURL,
("selfLink" .=) <$> _tiSelfLink,
("isPinned" .=) <$> _tiIsPinned,
("sourceItemId" .=) <$> _tiSourceItemId,
("id" .=) <$> _tiId, ("html" .=) <$> _tiHTML,
("updated" .=) <$> _tiUpdated,
("recipients" .=) <$> _tiRecipients,
("title" .=) <$> _tiTitle,
("inReplyTo" .=) <$> _tiInReplyTo])
data SubscriptionsListResponse = SubscriptionsListResponse'
{ _slrKind :: !Text
, _slrItems :: !(Maybe [Subscription])
} deriving (Eq,Show,Data,Typeable,Generic)
subscriptionsListResponse
:: SubscriptionsListResponse
subscriptionsListResponse =
SubscriptionsListResponse'
{ _slrKind = "mirror#subscriptionsList"
, _slrItems = Nothing
}
slrKind :: Lens' SubscriptionsListResponse Text
slrKind = lens _slrKind (\ s a -> s{_slrKind = a})
slrItems :: Lens' SubscriptionsListResponse [Subscription]
slrItems
= lens _slrItems (\ s a -> s{_slrItems = a}) .
_Default
. _Coerce
instance FromJSON SubscriptionsListResponse where
parseJSON
= withObject "SubscriptionsListResponse"
(\ o ->
SubscriptionsListResponse' <$>
(o .:? "kind" .!= "mirror#subscriptionsList") <*>
(o .:? "items" .!= mempty))
instance ToJSON SubscriptionsListResponse where
toJSON SubscriptionsListResponse'{..}
= object
(catMaybes
[Just ("kind" .= _slrKind),
("items" .=) <$> _slrItems])