{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.LibraryAgent.Types.Product where
import Network.Google.LibraryAgent.Types.Sum
import Network.Google.Prelude
data GoogleExampleLibraryagentV1Shelf = GoogleExampleLibraryagentV1Shelf'
{ _gelvsName :: !(Maybe Text)
, _gelvsTheme :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleExampleLibraryagentV1Shelf
:: GoogleExampleLibraryagentV1Shelf
googleExampleLibraryagentV1Shelf =
GoogleExampleLibraryagentV1Shelf'
{ _gelvsName = Nothing
, _gelvsTheme = Nothing
}
gelvsName :: Lens' GoogleExampleLibraryagentV1Shelf (Maybe Text)
gelvsName
= lens _gelvsName (\ s a -> s{_gelvsName = a})
gelvsTheme :: Lens' GoogleExampleLibraryagentV1Shelf (Maybe Text)
gelvsTheme
= lens _gelvsTheme (\ s a -> s{_gelvsTheme = a})
instance FromJSON GoogleExampleLibraryagentV1Shelf
where
parseJSON
= withObject "GoogleExampleLibraryagentV1Shelf"
(\ o ->
GoogleExampleLibraryagentV1Shelf' <$>
(o .:? "name") <*> (o .:? "theme"))
instance ToJSON GoogleExampleLibraryagentV1Shelf
where
toJSON GoogleExampleLibraryagentV1Shelf'{..}
= object
(catMaybes
[("name" .=) <$> _gelvsName,
("theme" .=) <$> _gelvsTheme])
data GoogleExampleLibraryagentV1ListShelvesResponse = GoogleExampleLibraryagentV1ListShelvesResponse'
{ _gelvlsrNextPageToken :: !(Maybe Text)
, _gelvlsrShelves :: !(Maybe [GoogleExampleLibraryagentV1Shelf])
} deriving (Eq,Show,Data,Typeable,Generic)
googleExampleLibraryagentV1ListShelvesResponse
:: GoogleExampleLibraryagentV1ListShelvesResponse
googleExampleLibraryagentV1ListShelvesResponse =
GoogleExampleLibraryagentV1ListShelvesResponse'
{ _gelvlsrNextPageToken = Nothing
, _gelvlsrShelves = Nothing
}
gelvlsrNextPageToken :: Lens' GoogleExampleLibraryagentV1ListShelvesResponse (Maybe Text)
gelvlsrNextPageToken
= lens _gelvlsrNextPageToken
(\ s a -> s{_gelvlsrNextPageToken = a})
gelvlsrShelves :: Lens' GoogleExampleLibraryagentV1ListShelvesResponse [GoogleExampleLibraryagentV1Shelf]
gelvlsrShelves
= lens _gelvlsrShelves
(\ s a -> s{_gelvlsrShelves = a})
. _Default
. _Coerce
instance FromJSON
GoogleExampleLibraryagentV1ListShelvesResponse where
parseJSON
= withObject
"GoogleExampleLibraryagentV1ListShelvesResponse"
(\ o ->
GoogleExampleLibraryagentV1ListShelvesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "shelves" .!= mempty))
instance ToJSON
GoogleExampleLibraryagentV1ListShelvesResponse where
toJSON
GoogleExampleLibraryagentV1ListShelvesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _gelvlsrNextPageToken,
("shelves" .=) <$> _gelvlsrShelves])
data GoogleExampleLibraryagentV1ListBooksResponse = GoogleExampleLibraryagentV1ListBooksResponse'
{ _gelvlbrNextPageToken :: !(Maybe Text)
, _gelvlbrBooks :: !(Maybe [GoogleExampleLibraryagentV1Book])
} deriving (Eq,Show,Data,Typeable,Generic)
googleExampleLibraryagentV1ListBooksResponse
:: GoogleExampleLibraryagentV1ListBooksResponse
googleExampleLibraryagentV1ListBooksResponse =
GoogleExampleLibraryagentV1ListBooksResponse'
{ _gelvlbrNextPageToken = Nothing
, _gelvlbrBooks = Nothing
}
gelvlbrNextPageToken :: Lens' GoogleExampleLibraryagentV1ListBooksResponse (Maybe Text)
gelvlbrNextPageToken
= lens _gelvlbrNextPageToken
(\ s a -> s{_gelvlbrNextPageToken = a})
gelvlbrBooks :: Lens' GoogleExampleLibraryagentV1ListBooksResponse [GoogleExampleLibraryagentV1Book]
gelvlbrBooks
= lens _gelvlbrBooks (\ s a -> s{_gelvlbrBooks = a})
. _Default
. _Coerce
instance FromJSON
GoogleExampleLibraryagentV1ListBooksResponse where
parseJSON
= withObject
"GoogleExampleLibraryagentV1ListBooksResponse"
(\ o ->
GoogleExampleLibraryagentV1ListBooksResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "books" .!= mempty))
instance ToJSON
GoogleExampleLibraryagentV1ListBooksResponse where
toJSON
GoogleExampleLibraryagentV1ListBooksResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _gelvlbrNextPageToken,
("books" .=) <$> _gelvlbrBooks])
data GoogleExampleLibraryagentV1Book = GoogleExampleLibraryagentV1Book'
{ _gelvbRead :: !(Maybe Bool)
, _gelvbName :: !(Maybe Text)
, _gelvbAuthor :: !(Maybe Text)
, _gelvbTitle :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleExampleLibraryagentV1Book
:: GoogleExampleLibraryagentV1Book
googleExampleLibraryagentV1Book =
GoogleExampleLibraryagentV1Book'
{ _gelvbRead = Nothing
, _gelvbName = Nothing
, _gelvbAuthor = Nothing
, _gelvbTitle = Nothing
}
gelvbRead :: Lens' GoogleExampleLibraryagentV1Book (Maybe Bool)
gelvbRead
= lens _gelvbRead (\ s a -> s{_gelvbRead = a})
gelvbName :: Lens' GoogleExampleLibraryagentV1Book (Maybe Text)
gelvbName
= lens _gelvbName (\ s a -> s{_gelvbName = a})
gelvbAuthor :: Lens' GoogleExampleLibraryagentV1Book (Maybe Text)
gelvbAuthor
= lens _gelvbAuthor (\ s a -> s{_gelvbAuthor = a})
gelvbTitle :: Lens' GoogleExampleLibraryagentV1Book (Maybe Text)
gelvbTitle
= lens _gelvbTitle (\ s a -> s{_gelvbTitle = a})
instance FromJSON GoogleExampleLibraryagentV1Book
where
parseJSON
= withObject "GoogleExampleLibraryagentV1Book"
(\ o ->
GoogleExampleLibraryagentV1Book' <$>
(o .:? "read") <*> (o .:? "name") <*>
(o .:? "author")
<*> (o .:? "title"))
instance ToJSON GoogleExampleLibraryagentV1Book where
toJSON GoogleExampleLibraryagentV1Book'{..}
= object
(catMaybes
[("read" .=) <$> _gelvbRead,
("name" .=) <$> _gelvbName,
("author" .=) <$> _gelvbAuthor,
("title" .=) <$> _gelvbTitle])