module Patrol.Type.AppleDebugImage where
import qualified Data.Aeson as Aeson
import qualified Data.Text as Text
import qualified Patrol.Extra.Aeson as Aeson
data AppleDebugImage = AppleDebugImage
{ AppleDebugImage -> Text
arch :: Text.Text,
AppleDebugImage -> Maybe Int
cpuSubtype :: Maybe Int,
AppleDebugImage -> Maybe Int
cpuType :: Maybe Int,
AppleDebugImage -> Text
imageAddr :: Text.Text,
AppleDebugImage -> Maybe Int
imageSize :: Maybe Int,
AppleDebugImage -> Text
imageVmaddr :: Text.Text,
AppleDebugImage -> Text
name :: Text.Text,
AppleDebugImage -> Text
uuid :: Text.Text
}
deriving (AppleDebugImage -> AppleDebugImage -> Bool
(AppleDebugImage -> AppleDebugImage -> Bool)
-> (AppleDebugImage -> AppleDebugImage -> Bool)
-> Eq AppleDebugImage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AppleDebugImage -> AppleDebugImage -> Bool
== :: AppleDebugImage -> AppleDebugImage -> Bool
$c/= :: AppleDebugImage -> AppleDebugImage -> Bool
/= :: AppleDebugImage -> AppleDebugImage -> Bool
Eq, Int -> AppleDebugImage -> ShowS
[AppleDebugImage] -> ShowS
AppleDebugImage -> String
(Int -> AppleDebugImage -> ShowS)
-> (AppleDebugImage -> String)
-> ([AppleDebugImage] -> ShowS)
-> Show AppleDebugImage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AppleDebugImage -> ShowS
showsPrec :: Int -> AppleDebugImage -> ShowS
$cshow :: AppleDebugImage -> String
show :: AppleDebugImage -> String
$cshowList :: [AppleDebugImage] -> ShowS
showList :: [AppleDebugImage] -> ShowS
Show)
instance Aeson.ToJSON AppleDebugImage where
toJSON :: AppleDebugImage -> Value
toJSON AppleDebugImage
appleDebugImage =
[Pair] -> Value
Aeson.intoObject
[ String -> Text -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"arch" (Text -> Pair) -> Text -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Text
arch AppleDebugImage
appleDebugImage,
String -> Maybe Int -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"cpu_subtype" (Maybe Int -> Pair) -> Maybe Int -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Maybe Int
cpuSubtype AppleDebugImage
appleDebugImage,
String -> Maybe Int -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"cpu_type" (Maybe Int -> Pair) -> Maybe Int -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Maybe Int
cpuType AppleDebugImage
appleDebugImage,
String -> Text -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"image_addr" (Text -> Pair) -> Text -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Text
imageAddr AppleDebugImage
appleDebugImage,
String -> Maybe Int -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"image_size" (Maybe Int -> Pair) -> Maybe Int -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Maybe Int
imageSize AppleDebugImage
appleDebugImage,
String -> Text -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"image_vmaddr" (Text -> Pair) -> Text -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Text
imageVmaddr AppleDebugImage
appleDebugImage,
String -> Text -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"name" (Text -> Pair) -> Text -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Text
name AppleDebugImage
appleDebugImage,
String -> Text -> Pair
forall a. ToJSON a => String -> a -> Pair
Aeson.pair String
"uuid" (Text -> Pair) -> Text -> Pair
forall a b. (a -> b) -> a -> b
$ AppleDebugImage -> Text
uuid AppleDebugImage
appleDebugImage
]
empty :: AppleDebugImage
empty :: AppleDebugImage
empty =
AppleDebugImage
{ arch :: Text
arch = Text
Text.empty,
cpuSubtype :: Maybe Int
cpuSubtype = Maybe Int
forall a. Maybe a
Nothing,
cpuType :: Maybe Int
cpuType = Maybe Int
forall a. Maybe a
Nothing,
imageAddr :: Text
imageAddr = Text
Text.empty,
imageSize :: Maybe Int
imageSize = Maybe Int
forall a. Maybe a
Nothing,
imageVmaddr :: Text
imageVmaddr = Text
Text.empty,
name :: Text
name = Text
Text.empty,
uuid :: Text
uuid = Text
Text.empty
}