{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
module Podman.Types
( module Podman.Types,
)
where
import Data.Aeson (FromJSON (..), Options (fieldLabelModifier, omitNothingFields), ToJSON (..), Value (Number, String), defaultOptions, genericParseJSON, genericToJSON, withScientific, withText)
import qualified Data.Map as M
import Data.Text (Text)
import qualified Data.Text as T
import Data.Time.Clock (UTCTime)
import GHC.Generics (Generic)
import GHC.Int (Int32, Int64)
import GHC.Word (Word16, Word32, Word64, Word8)
import Lens.Micro.TH
import System.Linux.Capabilities (Capability (..))
newtype LinuxCapability = LinuxCapability Capability deriving newtype (Eq, Show)
instance ToJSON LinuxCapability where
toJSON (LinuxCapability x) = String (T.pack (show x))
instance FromJSON LinuxCapability where
parseJSON = withText "cap" $ \txt -> pure (LinuxCapability (read (T.unpack txt)))
data SystemdRestartPolicy
= SystemdRestartPolicyNo
| SystemdRestartPolicyOnSuccess
| SystemdRestartPolicyOnAbnormal
| SystemdRestartPolicyOnWatchdog
| SystemdRestartPolicyOnAbort
| SystemdRestartPolicyAlways
deriving stock (Eq, Generic)
instance Show SystemdRestartPolicy where
show SystemdRestartPolicyNo = "no"
show SystemdRestartPolicyOnSuccess = "on-success"
show SystemdRestartPolicyOnAbnormal = "on-abnormal"
show SystemdRestartPolicyOnWatchdog = "on-watchdog"
show SystemdRestartPolicyOnAbort = "on-abort"
show SystemdRestartPolicyAlways = "always"
instance ToJSON SystemdRestartPolicy where
toJSON SystemdRestartPolicyNo = String "no"
toJSON SystemdRestartPolicyOnSuccess = String "on-success"
toJSON SystemdRestartPolicyOnAbnormal = String "on-abnormal"
toJSON SystemdRestartPolicyOnWatchdog = String "on-watchdog"
toJSON SystemdRestartPolicyOnAbort = String "on-abort"
toJSON SystemdRestartPolicyAlways = String "always"
instance FromJSON SystemdRestartPolicy where
parseJSON = withText "SystemdRestartPolicy" $ \txt -> pure $ case txt of
"no" -> SystemdRestartPolicyNo
"on-success" -> SystemdRestartPolicyOnSuccess
"on-abnormal" -> SystemdRestartPolicyOnAbnormal
"on-watchdog" -> SystemdRestartPolicyOnWatchdog
"on-abort" -> SystemdRestartPolicyOnAbort
"always" -> SystemdRestartPolicyAlways
x -> error ("Unknown SystemdRestartPolicy" <> T.unpack x)
newtype ExecResponse = ExecResponse
{ _execResponseId :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ExecResponse where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
instance ToJSON ExecResponse where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
newtype SecretCreateResponse = SecretCreateResponse
{ _secretCreateResponseID :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON SecretCreateResponse where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 21, omitNothingFields = True})
instance ToJSON SecretCreateResponse where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 21, omitNothingFields = True})
data ContainerChangeKind = Modified | Added | Deleted deriving stock (Show, Eq, Generic)
instance ToJSON ContainerChangeKind where
toJSON Modified = Number 0
toJSON Added = Number 1
toJSON Deleted = Number 2
instance FromJSON ContainerChangeKind where
parseJSON = withScientific "change" $ \num -> pure $ case num of
0 -> Modified
1 -> Added
2 -> Deleted
x -> error ("Unknown change kind " <> show x)
data ContainerStatus
= StatusUnknown
| StatusConfigured
| StatusCreated
| StatusRunning
| StatusStopped
| StatusPaused
| StatusExited
| StatusRemoving
| StatusStopping
deriving stock (Eq, Generic)
instance Show ContainerStatus where
show StatusUnknown = "unknown"
show StatusConfigured = "configured"
show StatusCreated = "created"
show StatusRunning = "running"
show StatusStopped = "stopped"
show StatusPaused = "paused"
show StatusExited = "exited"
show StatusRemoving = "removing"
show StatusStopping = "stopping"
instance ToJSON ContainerStatus where
toJSON StatusUnknown = String "unknown"
toJSON StatusConfigured = String "configured"
toJSON StatusCreated = String "created"
toJSON StatusRunning = String "running"
toJSON StatusStopped = String "stopped"
toJSON StatusPaused = String "paused"
toJSON StatusExited = String "exited"
toJSON StatusRemoving = String "removing"
toJSON StatusStopping = String "stopping"
instance FromJSON ContainerStatus where
parseJSON = withText "ContainerStatus" $ \txt -> pure $ case txt of
"unknown" -> StatusUnknown
"configured" -> StatusConfigured
"created" -> StatusCreated
"running" -> StatusRunning
"stopped" -> StatusStopped
"paused" -> StatusPaused
"exited" -> StatusExited
"removing" -> StatusRemoving
"stopping" -> StatusStopping
x -> error ("Unknown ContainerStatus" <> T.unpack x)
newtype IP = IP [Word8]
deriving stock (Generic)
deriving newtype (Eq, Show)
deriving anyclass (FromJSON, ToJSON)
newtype Signal = Signal Int64
deriving stock (Generic)
deriving newtype (Eq, Show)
deriving anyclass (FromJSON, ToJSON)
newtype FileMode = FileMode Word32
deriving stock (Generic)
deriving newtype (Eq, Show)
deriving anyclass (FromJSON, ToJSON)
newtype Duration = Duration Int64
deriving stock (Generic)
deriving newtype (Eq, Show)
deriving anyclass (FromJSON, ToJSON)
data Error = Error
{ _errorcause :: Text,
_errormessage :: Text,
_errorresponse :: Int
}
deriving stock (Show, Eq, Generic)
instance FromJSON Error where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 6, omitNothingFields = True})
instance ToJSON Error where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 6, omitNothingFields = True})
data Version = Version
{ _versionApiVersion :: Text,
_versionVersion :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON Version where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 8, omitNothingFields = True})
instance ToJSON Version where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 8, omitNothingFields = True})
data Health = Health
{ _healthStatus :: Text,
_healthLog :: [HealthcheckResult],
_healthFailingStreak :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON Health where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 7, omitNothingFields = True})
instance ToJSON Health where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 7, omitNothingFields = True})
data HealthConfig = HealthConfig
{ _healthConfigStartPeriod :: Duration,
_healthConfigTest :: [Text],
_healthConfigRetries :: Int64,
_healthConfigInterval :: Duration,
_healthConfigTimeout :: Duration
}
deriving stock (Show, Eq, Generic)
instance FromJSON HealthConfig where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
instance ToJSON HealthConfig where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
data HealthcheckResult = HealthcheckResult
{ _healthcheckResultStart :: UTCTime,
_healthcheckResultEnd :: UTCTime,
_healthcheckResultOutput :: Text,
_healthcheckResultExitCode :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON HealthcheckResult where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
instance ToJSON HealthcheckResult where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
data HealthCheckResults = HealthCheckResults
{
_healthCheckResultsStatus :: Text,
_healthCheckResultsLog :: [HealthCheckLog],
_healthCheckResultsFailingStreak :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON HealthCheckResults where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
instance ToJSON HealthCheckResults where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
data HealthCheckLog = HealthCheckLog
{
_healthCheckLogStart :: Text,
_healthCheckLogEnd :: Text,
_healthCheckLogOutput :: Text,
_healthCheckLogExitCode :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON HealthCheckLog where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
instance ToJSON HealthCheckLog where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
data Schema2HealthConfig = Schema2HealthConfig
{ _schema2HealthConfigStartPeriod :: Duration,
_schema2HealthConfigTest :: [Text],
_schema2HealthConfigRetries :: Int64,
_schema2HealthConfigInterval :: Duration,
_schema2HealthConfigTimeout :: Duration
}
deriving stock (Show, Eq, Generic)
instance FromJSON Schema2HealthConfig where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 20, omitNothingFields = True})
instance ToJSON Schema2HealthConfig where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 20, omitNothingFields = True})
data IDMap = IDMap
{ _iDMapsize :: Int64,
_iDMapcontainer_id :: Int64,
_iDMaphost_id :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON IDMap where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 6, omitNothingFields = True})
instance ToJSON IDMap where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 6, omitNothingFields = True})
data InspectContainerState = InspectContainerState
{ _inspectContainerStateStatus :: ContainerStatus,
_inspectContainerStateDead :: Bool,
_inspectContainerStateOciVersion :: Text,
_inspectContainerStateRestarting :: Bool,
_inspectContainerStateError :: Text,
_inspectContainerStateConmonPid :: Maybe Int64,
_inspectContainerStateStartedAt :: UTCTime,
_inspectContainerStateFinishedAt :: UTCTime,
_inspectContainerStateRunning :: Bool,
_inspectContainerStatePid :: Int64,
_inspectContainerStateExitCode :: Int32,
_inspectContainerStatePaused :: Bool,
_inspectContainerStateOOMKilled :: Bool
}
deriving stock (Show, Eq, Generic)
instance FromJSON InspectContainerState where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 22, omitNothingFields = True})
instance ToJSON InspectContainerState where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 22, omitNothingFields = True})
data InspectContainerConfig = InspectContainerConfig
{
_inspectContainerConfigAnnotations :: M.Map Text Text,
_inspectContainerConfigHostname :: Text,
_inspectContainerConfigImage :: Text,
_inspectContainerConfigSystemdMode :: Maybe Bool,
_inspectContainerConfigSecrets :: Maybe [InspectSecret],
_inspectContainerConfigEnv :: [Text],
_inspectContainerConfigEntrypoint :: Text,
_inspectContainerConfigStopTimeout :: Word64,
_inspectContainerConfigStdinOnce :: Bool,
_inspectContainerConfigWorkingDir :: Text,
_inspectContainerConfigStopSignal :: Word64,
_inspectContainerConfigUmask :: Text,
_inspectContainerConfigUser :: Text,
_inspectContainerConfigOnBuild :: Maybe Text,
_inspectContainerConfigDomainname :: Text,
_inspectContainerConfigAttachStdin :: Bool,
_inspectContainerConfigCmd :: [Text],
_inspectContainerConfigLabels :: Maybe (M.Map Text Text),
_inspectContainerConfigAttachStderr :: Bool,
_inspectContainerConfigOpenStdin :: Bool,
_inspectContainerConfigTimeout :: Word64,
_inspectContainerConfigCreateCommand :: Maybe [Text],
_inspectContainerConfigAttachStdout :: Bool,
_inspectContainerConfigTty :: Bool
}
deriving stock (Show, Eq, Generic)
instance FromJSON InspectContainerConfig where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 23, omitNothingFields = True})
instance ToJSON InspectContainerConfig where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 23, omitNothingFields = True})
data SpecGenerator = SpecGenerator
{
_specGeneratorstop_timeout :: Maybe Word64,
_specGeneratorthrottleWriteBpsDevice :: Maybe (M.Map Text Text),
_specGeneratorannotations :: Maybe (M.Map Text Text),
_specGeneratorraw_image_name :: Maybe Text,
_specGeneratorcap_add :: Maybe [LinuxCapability],
_specGeneratoruserns :: Maybe Namespace,
_specGeneratorpublish_image_ports :: Maybe Bool,
_specGeneratorstdin :: Maybe Bool,
_specGeneratorgroups :: Maybe [Text],
_specGeneratoripcns :: Maybe Namespace,
_specGeneratorunmask :: Maybe [Text],
_specGeneratoruse_image_hosts :: Maybe Bool,
_specGeneratorsdnotifyMode :: Maybe Text,
_specGeneratorimage :: Text,
_specGeneratorcommand :: Maybe [Text],
_specGeneratorselinux_opts :: Maybe [Text],
_specGeneratorhostname :: Maybe Text,
_specGeneratorvolumes_from :: Maybe [Text],
_specGeneratorinit :: Maybe Bool,
_specGeneratorrootfs_propagation :: Maybe Text,
_specGeneratoroom_score_adj :: Maybe Int64,
_specGeneratornetns :: Maybe Namespace,
_specGeneratordns_option :: Maybe [Text],
_specGeneratorsecrets :: Maybe [Secret],
_specGeneratorenv :: Maybe (M.Map Text Text),
_specGeneratorentrypoint :: Maybe [Text],
_specGeneratoraliases :: Maybe (M.Map Text Text),
_specGeneratorweightDevice :: Maybe (M.Map Text Text),
_specGeneratorrestart_policy :: Maybe Text,
_specGeneratorvolatile :: Maybe Bool,
_specGeneratordependencyContainers :: Maybe [Text],
_specGeneratorrootfs :: Maybe Text,
_specGeneratoruse_image_resolve_conf :: Maybe Bool,
_specGeneratorseccomp_policy :: Maybe Text,
_specGeneratorprivileged :: Maybe Bool,
_specGeneratornamespace :: Maybe Text,
_specGeneratordns_server :: Maybe [IP],
_specGeneratorportmappings :: Maybe [PortMapping],
_specGeneratorapparmor_profile :: Maybe Text,
_specGeneratorstatic_ip :: Maybe IP,
_specGeneratorremove :: Maybe Bool,
_specGeneratormounts :: Maybe [Mount],
_specGeneratorstatic_ipv6 :: Maybe IP,
_specGeneratorcgroupns :: Maybe Namespace,
_specGeneratornetwork_options :: Maybe (M.Map Text Text),
_specGeneratorno_new_privileges :: Maybe Bool,
_specGeneratorumask :: Maybe Text,
_specGeneratorsystemd :: Maybe Text,
_specGeneratorstop_signal :: Maybe Signal,
_specGeneratoruser :: Maybe Text,
_specGeneratorunified :: Maybe (M.Map Text Text),
_specGeneratorhttpproxy :: Maybe Bool,
_specGeneratorcap_drop :: Maybe [LinuxCapability],
_specGeneratorcontainerCreateCommand :: Maybe [Text],
_specGeneratorterminal :: Maybe Bool,
_specGeneratorprocfs_opts :: Maybe [Text],
_specGeneratorimage_volume_mode :: Maybe Text,
_specGeneratorsecret_env :: Maybe (M.Map Text Text),
_specGeneratormask :: Maybe [Text],
_specGeneratorshm_size :: Maybe Int64,
_specGeneratorexpose :: Maybe (M.Map Word Text),
_specGeneratorutsns :: Maybe Namespace,
_specGeneratorname :: Maybe Text,
_specGeneratorthrottleReadIOPSDevice :: Maybe (M.Map Text Text),
_specGeneratorcgroup_parent :: Maybe Text,
_specGeneratorseccomp_profile_path :: Maybe Text,
_specGeneratorenv_host :: Maybe Bool,
_specGeneratorsysctl :: Maybe (M.Map Text Text),
_specGeneratorconmon_pid_file :: Maybe Text,
_specGeneratorlabels :: Maybe (M.Map Text Text),
_specGeneratorread_only_filesystem :: Maybe Bool,
_specGeneratorpidns :: Maybe Namespace,
_specGeneratorthrottleWriteIOPSDevice :: Maybe (M.Map Text Text),
_specGeneratordns_search :: Maybe [Text],
_specGeneratorinit_path :: Maybe Text,
_specGeneratorr_limits :: Maybe [POSIXRlimit],
_specGeneratorpod :: Maybe Text,
_specGeneratordevices :: Maybe [LinuxDevice],
_specGeneratorthrottleReadBpsDevice :: Maybe (M.Map Text Text),
_specGeneratorcgroups_mode :: Maybe Text,
_specGeneratortimeout :: Maybe Word64,
_specGeneratortimezone :: Maybe Text,
_specGeneratorvolumes :: Maybe [NamedVolume],
_specGeneratorimage_volumes :: Maybe [ImageVolume],
_specGeneratorlog_configuration :: Maybe LogConfig,
_specGeneratorresource_limits :: Maybe LinuxResources,
_specGeneratoroci_runtime :: Maybe Text,
_specGeneratoroverlay_volumes :: Maybe [OverlayVolume],
_specGeneratorcni_networks :: Maybe [Text],
_specGeneratorrestart_tries :: Maybe Word64,
_specGeneratorwork_dir :: Maybe Text,
_specGeneratorhostadd :: Maybe [Text]
}
deriving stock (Show, Eq, Generic)
instance FromJSON SpecGenerator where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
instance ToJSON SpecGenerator where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
data PortMapping = PortMapping
{
_portMappinghost_port :: Word16,
_portMappingprotocol :: Text,
_portMappingcontainer_port :: Word16,
_portMappingrange :: Word16,
_portMappinghost_ip :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON PortMapping where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
instance ToJSON PortMapping where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
data ListContainer = ListContainer
{
_listContainerPodName :: Text,
_listContainerStatus :: Text,
_listContainerState :: Text,
_listContainerCommand :: Maybe [Text],
_listContainerImage :: Text,
_listContainerSize :: Maybe ContainerSize,
_listContainerNetworks :: Maybe [Text],
_listContainerCreatedAt :: Text,
_listContainerIsInfra :: Bool,
_listContainerNamespaces :: ListContainerNamespaces,
_listContainerCreated :: UTCTime,
_listContainerStartedAt :: Int64,
_listContainerNames :: [Text],
_listContainerExitedAt :: Int64,
_listContainerPorts :: Maybe [PortMapping],
_listContainerImageID :: Text,
_listContainerPid :: Int64,
_listContainerId :: Text,
_listContainerLabels :: Maybe (M.Map Text Text),
_listContainerExitCode :: Int32,
_listContainerPod :: Maybe Text,
_listContainerExited :: Bool,
_listContainerAutoRemove :: Bool
}
deriving stock (Show, Eq, Generic)
instance FromJSON ListContainer where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
instance ToJSON ListContainer where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
data ListContainerNamespaces = ListContainerNamespaces
{
_listContainerNamespacesCgroup :: Maybe Text,
_listContainerNamespacesMnt :: Maybe Text,
_listContainerNamespacesNet :: Maybe Text,
_listContainerNamespacesIpc :: Maybe Text,
_listContainerNamespacesUser :: Maybe Text,
_listContainerNamespacesUts :: Maybe Text,
_listContainerNamespacesPidns :: Maybe Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ListContainerNamespaces where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 24, omitNothingFields = True})
instance ToJSON ListContainerNamespaces where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 24, omitNothingFields = True})
data ContainerSize = ContainerSize
{ _containerSizerwSize :: Int64,
_containerSizerootFsSize :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON ContainerSize where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
instance ToJSON ContainerSize where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
data Mount = Mount
{
_mountdestination :: Text,
_mountsource :: Text,
_mountoptions :: [Text],
_mounttype :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON Mount where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 6, omitNothingFields = True})
instance ToJSON Mount where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 6, omitNothingFields = True})
data Namespace = Namespace
{ _namespacevalue :: Text,
_namespacensmode :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON Namespace where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
instance ToJSON Namespace where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
data LinuxDevice = LinuxDevice
{
_linuxDeviceminor :: Int64,
_linuxDevicepath :: Text,
_linuxDevicefileMode :: FileMode,
_linuxDeviceuid :: Word32,
_linuxDevicemajor :: Int64,
_linuxDevicegid :: Word32,
_linuxDevicetype :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxDevice where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
instance ToJSON LinuxDevice where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
data LinuxCPU = LinuxCPU
{
_linuxCPUperiod :: Word64,
_linuxCPUrealtimeRuntime :: Int64,
_linuxCPUrealtimePeriod :: Word64,
_linuxCPUcpus :: Text,
_linuxCPUquota :: Int64,
_linuxCPUmems :: Text,
_linuxCPUshares :: Word64
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxCPU where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 9, omitNothingFields = True})
instance ToJSON LinuxCPU where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 9, omitNothingFields = True})
data LinuxThrottleDevice = LinuxThrottleDevice
{
_linuxThrottleDeviceminor :: Int64,
_linuxThrottleDevicemajor :: Int64,
_linuxThrottleDevicerate :: Word64
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxThrottleDevice where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 20, omitNothingFields = True})
instance ToJSON LinuxThrottleDevice where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 20, omitNothingFields = True})
data LinuxWeightDevice = LinuxWeightDevice
{
_linuxWeightDeviceminor :: Int64,
_linuxWeightDeviceweight :: Word16,
_linuxWeightDevicemajor :: Int64,
_linuxWeightDeviceleafWeight :: Word16
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxWeightDevice where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
instance ToJSON LinuxWeightDevice where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
data LinuxBlockIO = LinuxBlockIO
{
_linuxBlockIOthrottleWriteBpsDevice :: [LinuxThrottleDevice],
_linuxBlockIOweight :: Word16,
_linuxBlockIOweightDevice :: [LinuxWeightDevice],
_linuxBlockIOthrottleReadIOPSDevice :: [LinuxThrottleDevice],
_linuxBlockIOthrottleWriteIOPSDevice :: [LinuxThrottleDevice],
_linuxBlockIOthrottleReadBpsDevice :: [LinuxThrottleDevice],
_linuxBlockIOleafWeight :: Word16
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxBlockIO where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
instance ToJSON LinuxBlockIO where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
data LinuxDeviceCgroup = LinuxDeviceCgroup
{
_linuxDeviceCgroupaccess :: Text,
_linuxDeviceCgroupminor :: Int64,
_linuxDeviceCgroupmajor :: Int64,
_linuxDeviceCgroupallow :: Bool,
_linuxDeviceCgrouptype :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxDeviceCgroup where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
instance ToJSON LinuxDeviceCgroup where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
data LinuxHugepageLimit = LinuxHugepageLimit
{
_linuxHugepageLimitlimit :: Word64,
_linuxHugepageLimitpageSize :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxHugepageLimit where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
instance ToJSON LinuxHugepageLimit where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
data LinuxInterfacePriority = LinuxInterfacePriority
{
_linuxInterfacePrioritypriority :: Word32,
_linuxInterfacePriorityname :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxInterfacePriority where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 23, omitNothingFields = True})
instance ToJSON LinuxInterfacePriority where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 23, omitNothingFields = True})
data LinuxMemory = LinuxMemory
{
_linuxMemoryuseHierarchy :: Bool,
_linuxMemorykernelTCP :: Int64,
_linuxMemoryreservation :: Int64,
_linuxMemorykernel :: Int64,
_linuxMemorydisableOOMKiller :: Bool,
_linuxMemoryswappiness :: Word64,
_linuxMemorylimit :: Int64,
_linuxMemoryswap :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxMemory where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
instance ToJSON LinuxMemory where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
data LinuxNetwork = LinuxNetwork
{
_linuxNetworkpriorities :: [LinuxInterfacePriority],
_linuxNetworkclassID :: Word32
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxNetwork where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
instance ToJSON LinuxNetwork where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
data LinuxPids = LinuxPids
{
_linuxPidslimit :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxPids where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
instance ToJSON LinuxPids where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
data LinuxResources = LinuxResources
{ _linuxResourcesnetwork :: LinuxNetwork,
_linuxResourcespids :: LinuxPids,
_linuxResourcesmemory :: LinuxMemory,
_linuxResourcesunified :: M.Map Text Text,
_linuxResourcesblockIO :: LinuxBlockIO,
_linuxResourcesrdma :: M.Map Text Text,
_linuxResourceshugepageLimits :: [LinuxHugepageLimit],
_linuxResourcesdevices :: [LinuxDeviceCgroup],
_linuxResourcescpu :: LinuxCPU
}
deriving stock (Show, Eq, Generic)
instance FromJSON LinuxResources where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
instance ToJSON LinuxResources where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
data NamedVolume = NamedVolume
{
_namedVolumeDest :: Text,
_namedVolumeName :: Text,
_namedVolumeOptions :: [Text]
}
deriving stock (Show, Eq, Generic)
instance FromJSON NamedVolume where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
instance ToJSON NamedVolume where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
data ImageVolume = ImageVolume
{
_imageVolumeDestination :: Text,
_imageVolumeReadWrite :: Bool,
_imageVolumeSource :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ImageVolume where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
instance ToJSON ImageVolume where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
data LogConfig = LogConfig
{
_logConfigpath :: Text,
_logConfigsize :: Int64,
_logConfigdriver :: Text,
_logConfigoptions :: M.Map Text Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON LogConfig where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
instance ToJSON LogConfig where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
data OverlayVolume = OverlayVolume
{
_overlayVolumedestination :: Text,
_overlayVolumesource :: Text,
_overlayVolumeoptions :: [Text]
}
deriving stock (Show, Eq, Generic)
instance FromJSON OverlayVolume where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
instance ToJSON OverlayVolume where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
data ImageSummary = ImageSummary
{
_imageSummaryVirtualSize :: Int64,
_imageSummarySharedSize :: Int64,
_imageSummarySize :: Int64,
_imageSummaryCreated :: Int64,
_imageSummaryRepoTags :: Maybe [Text],
_imageSummaryContainers :: Int64,
_imageSummaryId :: Text,
_imageSummaryLabels :: Maybe (M.Map Text Text),
_imageSummaryRepoDigests :: Maybe [Text],
_imageSummaryParentId :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ImageSummary where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
instance ToJSON ImageSummary where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 13, omitNothingFields = True})
data ImageTreeResponse = ImageTreeResponse
{ _imageTreeResponseTree :: Text,
_imageTreeResponselayers :: Maybe [Text]
}
deriving stock (Show, Eq, Generic)
instance FromJSON ImageTreeResponse where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
instance ToJSON ImageTreeResponse where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
data ContainerChange = ContainerChange
{ _containerChangePath :: Text,
_containerChangeKind :: ContainerChangeKind
}
deriving stock (Show, Eq, Generic)
instance FromJSON ContainerChange where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 16, omitNothingFields = True})
instance ToJSON ContainerChange where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 16, omitNothingFields = True})
data ImagesPullResponse = ImagesPullResponse
{
_imagesPullResponsestream :: Maybe Text,
_imagesPullResponseimages :: Maybe [Text],
_imagesPullResponseerror :: Maybe Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ImagesPullResponse where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
instance ToJSON ImagesPullResponse where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
data POSIXRlimit = POSIXRlimit
{
_pOSIXRlimithard :: Word64,
_pOSIXRlimittype :: Text,
_pOSIXRlimitsoft :: Word64
}
deriving stock (Show, Eq, Generic)
instance FromJSON POSIXRlimit where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
instance ToJSON POSIXRlimit where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
data Dns = Dns
{ _dnsdomain :: Maybe Text,
_dnsoptions :: Maybe [Text],
_dnssearch :: Maybe [Text],
_dnsnameservers :: Maybe [Text]
}
deriving stock (Show, Eq, Generic)
instance FromJSON Dns where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 4, omitNothingFields = True})
instance ToJSON Dns where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 4, omitNothingFields = True})
data NetConf = NetConf
{ _netConfname :: Maybe Text,
_netConfprevResult :: Maybe (M.Map Text Text),
_netConftype :: Text,
_netConfcniVersion :: Maybe Text,
_netConfcapabilities :: Maybe (Maybe (M.Map Text Bool)),
_netConfdns :: Maybe Dns
}
deriving stock (Show, Eq, Generic)
instance FromJSON NetConf where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 8, omitNothingFields = True})
instance ToJSON NetConf where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 8, omitNothingFields = True})
data NetworkConfig = NetworkConfig
{ _networkConfigNetwork :: NetConf,
_networkConfigBytes :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON NetworkConfig where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
instance ToJSON NetworkConfig where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
data NetworkListReport = NetworkListReport
{ _networkListReportDisableCheck :: Bool,
_networkListReportName :: Text,
_networkListReportPlugins :: [NetworkConfig],
_networkListReportLabels :: Maybe (M.Map Text Text),
_networkListReportCNIVersion :: Text,
_networkListReportBytes :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON NetworkListReport where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
instance ToJSON NetworkListReport where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 18, omitNothingFields = True})
data Volume = Volume
{
_volumeStatus :: Maybe (M.Map Text Text),
_volumeCreatedAt :: UTCTime,
_volumeDriver :: Text,
_volumeName :: Text,
_volumeScope :: Text,
_volumeLabels :: M.Map Text Text,
_volumeUsageData :: Maybe VolumeUsageData,
_volumeOptions :: M.Map Text Text,
_volumeMountpoint :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON Volume where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 7, omitNothingFields = True})
instance ToJSON Volume where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 7, omitNothingFields = True})
data VolumeUsageData = VolumeUsageData
{
_volumeUsageDataRefCount :: Int64,
_volumeUsageDataSize :: Int64
}
deriving stock (Show, Eq, Generic)
instance FromJSON VolumeUsageData where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 16, omitNothingFields = True})
instance ToJSON VolumeUsageData where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 16, omitNothingFields = True})
data InspectSecret = InspectSecret
{
_inspectSecretUID :: Word32,
_inspectSecretMode :: Word32,
_inspectSecretName :: Text,
_inspectSecretGID :: Word32,
_inspectSecretID :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON InspectSecret where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
instance ToJSON InspectSecret where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
data Secret = Secret
{ _secretUID :: Word32,
_secretMode :: Word32,
_secretGID :: Word32,
_secretSource :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON Secret where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 7, omitNothingFields = True})
instance ToJSON Secret where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 7, omitNothingFields = True})
data SecretInfoReport = SecretInfoReport
{ _secretInfoReportCreatedAt :: UTCTime,
_secretInfoReportID :: Text,
_secretInfoReportSpec :: SecretSpec,
_secretInfoReportUpdatedAt :: UTCTime
}
deriving stock (Show, Eq, Generic)
instance FromJSON SecretInfoReport where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 17, omitNothingFields = True})
instance ToJSON SecretInfoReport where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 17, omitNothingFields = True})
data SecretSpec = SecretSpec
{ _secretSpecDriver :: SecretDriverSpec,
_secretSpecName :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON SecretSpec where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 11, omitNothingFields = True})
instance ToJSON SecretSpec where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 11, omitNothingFields = True})
data SecretDriverSpec = SecretDriverSpec
{ _secretDriverSpecName :: Text,
_secretDriverSpecOptions :: Maybe (M.Map Text Text)
}
deriving stock (Show, Eq, Generic)
instance FromJSON SecretDriverSpec where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 17, omitNothingFields = True})
instance ToJSON SecretDriverSpec where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 17, omitNothingFields = True})
data ProcessConfig = ProcessConfig
{ _processConfigarguments :: [Text],
_processConfigentrypoint :: Text,
_processConfigprivileged :: Bool,
_processConfigtty :: Bool,
_processConfiguser :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ProcessConfig where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
instance ToJSON ProcessConfig where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 14, omitNothingFields = True})
data ExecInspectResponse = ExecInspectResponse
{ _execInspectResponseCanRemove :: Bool,
_execInspectResponseContainerID :: Text,
_execInspectResponseExitCode :: Int,
_execInspectResponseID :: Text,
_execInspectResponseOpenStderr :: Bool,
_execInspectResponseOpenStdin :: Bool,
_execInspectResponseOpenStdout :: Bool,
_execInspectResponseRunning :: Bool,
_execInspectResponsePid :: Word64,
_execInspectResponseProcessConfig :: ProcessConfig
}
deriving stock (Show, Eq, Generic)
instance FromJSON ExecInspectResponse where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 20, omitNothingFields = True})
instance ToJSON ExecInspectResponse where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 20, omitNothingFields = True})
data InspectContainerResponse = InspectContainerResponse
{ _inspectContainerResponseEffectiveCaps :: [LinuxCapability],
_inspectContainerResponseRestartCount :: Int32,
_inspectContainerResponseState :: InspectContainerState,
_inspectContainerResponseExitCommand :: [Text],
_inspectContainerResponseStaticDir :: Text,
_inspectContainerResponseArgs :: [Text],
_inspectContainerResponseImage :: Text,
_inspectContainerResponseConfig :: InspectContainerConfig,
_inspectContainerResponseHostnamePath :: Text,
_inspectContainerResponseOCIConfigPath :: Maybe Text,
_inspectContainerResponseExecIDs :: [Text],
_inspectContainerResponsePath :: Text,
_inspectContainerResponseConmonPidFile :: Text,
_inspectContainerResponseIsInfra :: Bool,
_inspectContainerResponseCreated :: UTCTime,
_inspectContainerResponseRootfs :: Text,
_inspectContainerResponseNamespace :: Text,
_inspectContainerResponseMountLabel :: Text,
_inspectContainerResponseDriver :: Text,
_inspectContainerResponseDependencies :: [Text],
_inspectContainerResponseName :: Text,
_inspectContainerResponseId :: Text,
_inspectContainerResponseProcessLabel :: Text,
_inspectContainerResponseResolvConfPath :: Text,
_inspectContainerResponseSizeRw :: Maybe Int64,
_inspectContainerResponseImageName :: Text,
_inspectContainerResponsePidFile :: Text,
_inspectContainerResponsePod :: Text,
_inspectContainerResponseBoundingCaps :: [LinuxCapability],
_inspectContainerResponseSizeRootFs :: Maybe Int64,
_inspectContainerResponseHostsPath :: Text,
_inspectContainerResponseOCIRuntime :: Text,
_inspectContainerResponseAppArmorProfile :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON InspectContainerResponse where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 25, omitNothingFields = True})
instance ToJSON InspectContainerResponse where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 25, omitNothingFields = True})
data ContainerCreateResponse = ContainerCreateResponse
{
_containerCreateResponseWarnings :: [Text],
_containerCreateResponseId :: Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ContainerCreateResponse where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 24, omitNothingFields = True})
instance ToJSON ContainerCreateResponse where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 24, omitNothingFields = True})
data ContainerListQuery = ContainerListQuery
{
_containerListQueryall :: Maybe Bool,
_containerListQuerylimit :: Maybe Int,
_containerListQuerysize :: Maybe Bool,
_containerListQuerysync :: Maybe Bool,
_containerListQueryfilters :: Maybe Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ContainerListQuery where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
instance ToJSON ContainerListQuery where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 19, omitNothingFields = True})
defaultContainerListQuery :: ContainerListQuery
defaultContainerListQuery = ContainerListQuery Nothing Nothing Nothing Nothing Nothing
data GenerateSystemdQuery = GenerateSystemdQuery
{
_generateSystemdQueryuseName :: Maybe Bool,
_generateSystemdQuerynew :: Maybe Bool,
_generateSystemdQuerynoHeader :: Maybe Bool,
_generateSystemdQuerytime :: Maybe Int,
_generateSystemdQueryrestartPolicy :: Maybe SystemdRestartPolicy,
_generateSystemdQuerycontainerPrefix :: Maybe Text,
_generateSystemdQuerypodPrefix :: Maybe Text,
_generateSystemdQueryseparator :: Maybe Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON GenerateSystemdQuery where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 21, omitNothingFields = True})
instance ToJSON GenerateSystemdQuery where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 21, omitNothingFields = True})
defaultGenerateSystemdQuery :: GenerateSystemdQuery
defaultGenerateSystemdQuery = GenerateSystemdQuery Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
data ImageListQuery = ImageListQuery
{
_imageListQueryall :: Maybe Bool,
_imageListQueryfilters :: Maybe Text
}
deriving stock (Show, Eq, Generic)
instance FromJSON ImageListQuery where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
instance ToJSON ImageListQuery where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
defaultImageListQuery :: ImageListQuery
defaultImageListQuery = ImageListQuery Nothing Nothing
data AttachQuery = AttachQuery
{
_attachQuerydetachKeys :: Maybe Text,
_attachQuerylogs :: Maybe Bool,
_attachQuerystream :: Maybe Bool,
_attachQuerystdout :: Maybe Bool,
_attachQuerystderr :: Maybe Bool,
_attachQuerystdin :: Maybe Bool
}
deriving stock (Show, Eq, Generic)
instance FromJSON AttachQuery where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
instance ToJSON AttachQuery where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 12, omitNothingFields = True})
defaultAttachQuery :: AttachQuery
defaultAttachQuery = AttachQuery Nothing Nothing Nothing Nothing Nothing Nothing
data LogsQuery = LogsQuery
{
_logsQueryfollow :: Maybe Bool,
_logsQuerysince :: Maybe UTCTime,
_logsQueryuntil :: Maybe UTCTime,
_logsQuerytimestamps :: Maybe Bool,
_logsQuerytail :: Maybe Word64
}
deriving stock (Show, Eq, Generic)
instance FromJSON LogsQuery where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
instance ToJSON LogsQuery where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 10, omitNothingFields = True})
defaultLogsQuery :: LogsQuery
defaultLogsQuery = LogsQuery Nothing Nothing Nothing Nothing Nothing
data ImagePullQuery = ImagePullQuery
{
_imagePullQueryreference :: Text,
_imagePullQuerycredentials :: Maybe Text,
_imagePullQueryArch :: Maybe Text,
_imagePullQueryOS :: Maybe Text,
_imagePullQueryVariant :: Maybe Text,
_imagePullQuerypolicy :: Maybe Text,
_imagePullQuerytlsVerify :: Maybe Bool,
_imagePullQueryallTags :: Maybe Bool
}
deriving stock (Show, Eq, Generic)
instance FromJSON ImagePullQuery where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
instance ToJSON ImagePullQuery where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 15, omitNothingFields = True})
data ExecConfig = ExecConfig
{
_execConfigEnv :: Maybe [Text],
_execConfigPrivileged :: Maybe Bool,
_execConfigWorkingDir :: Maybe Text,
_execConfigUser :: Maybe Text,
_execConfigAttachStdin :: Maybe Bool,
_execConfigCmd :: [Text],
_execConfigAttachStderr :: Maybe Bool,
_execConfigDetachKeys :: Maybe Text,
_execConfigAttachStdout :: Maybe Bool,
_execConfigTty :: Maybe Bool
}
deriving stock (Show, Eq, Generic)
instance FromJSON ExecConfig where
parseJSON = genericParseJSON (defaultOptions {fieldLabelModifier = drop 11, omitNothingFields = True})
instance ToJSON ExecConfig where
toJSON = genericToJSON (defaultOptions {fieldLabelModifier = drop 11, omitNothingFields = True})
mkSpecGenerator ::
Text ->
SpecGenerator
mkSpecGenerator image = SpecGenerator Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing image Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
mkExecConfig ::
[Text] ->
ExecConfig
mkExecConfig cmd = ExecConfig Nothing Nothing Nothing Nothing Nothing cmd Nothing Nothing Nothing Nothing
mkImagePullQuery ::
Text ->
ImagePullQuery
mkImagePullQuery reference = ImagePullQuery reference Nothing Nothing Nothing Nothing Nothing Nothing Nothing
makeLenses ''AttachQuery
makeLenses ''ContainerChange
makeLenses ''ContainerCreateResponse
makeLenses ''ContainerListQuery
makeLenses ''ContainerSize
makeLenses ''Dns
makeLenses ''Error
makeLenses ''ExecConfig
makeLenses ''ExecInspectResponse
makeLenses ''ExecResponse
makeLenses ''GenerateSystemdQuery
makeLenses ''ImageListQuery
makeLenses ''ImagePullQuery
makeLenses ''ImagesPullResponse
makeLenses ''ImageSummary
makeLenses ''ImageTreeResponse
makeLenses ''ImageVolume
makeLenses ''InspectContainerConfig
makeLenses ''InspectContainerResponse
makeLenses ''InspectContainerState
makeLenses ''LinuxDevice
makeLenses ''ListContainer
makeLenses ''ListContainerNamespaces
makeLenses ''LogConfig
makeLenses ''LogsQuery
makeLenses ''Mount
makeLenses ''NamedVolume
makeLenses ''Namespace
makeLenses ''NetConf
makeLenses ''NetworkConfig
makeLenses ''NetworkListReport
makeLenses ''OverlayVolume
makeLenses ''PortMapping
makeLenses ''POSIXRlimit
makeLenses ''ProcessConfig
makeLenses ''SecretCreateResponse
makeLenses ''SecretDriverSpec
makeLenses ''SecretInfoReport
makeLenses ''SecretSpec
makeLenses ''SpecGenerator
makeLenses ''Version
makeLenses ''Volume
makeLenses ''VolumeUsageData