{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.ECS.RegisterContainerInstance
(
RegisterContainerInstance (..),
newRegisterContainerInstance,
registerContainerInstance_platformDevices,
registerContainerInstance_instanceIdentityDocumentSignature,
registerContainerInstance_cluster,
registerContainerInstance_instanceIdentityDocument,
registerContainerInstance_containerInstanceArn,
registerContainerInstance_versionInfo,
registerContainerInstance_attributes,
registerContainerInstance_totalResources,
registerContainerInstance_tags,
RegisterContainerInstanceResponse (..),
newRegisterContainerInstanceResponse,
registerContainerInstanceResponse_containerInstance,
registerContainerInstanceResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RegisterContainerInstance = RegisterContainerInstance'
{
RegisterContainerInstance -> Maybe [PlatformDevice]
platformDevices :: Prelude.Maybe [PlatformDevice],
RegisterContainerInstance -> Maybe Text
instanceIdentityDocumentSignature :: Prelude.Maybe Prelude.Text,
RegisterContainerInstance -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
RegisterContainerInstance -> Maybe Text
instanceIdentityDocument :: Prelude.Maybe Prelude.Text,
RegisterContainerInstance -> Maybe Text
containerInstanceArn :: Prelude.Maybe Prelude.Text,
RegisterContainerInstance -> Maybe VersionInfo
versionInfo :: Prelude.Maybe VersionInfo,
RegisterContainerInstance -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
RegisterContainerInstance -> Maybe [Resource]
totalResources :: Prelude.Maybe [Resource],
RegisterContainerInstance -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (RegisterContainerInstance -> RegisterContainerInstance -> Bool
(RegisterContainerInstance -> RegisterContainerInstance -> Bool)
-> (RegisterContainerInstance -> RegisterContainerInstance -> Bool)
-> Eq RegisterContainerInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterContainerInstance -> RegisterContainerInstance -> Bool
$c/= :: RegisterContainerInstance -> RegisterContainerInstance -> Bool
== :: RegisterContainerInstance -> RegisterContainerInstance -> Bool
$c== :: RegisterContainerInstance -> RegisterContainerInstance -> Bool
Prelude.Eq, ReadPrec [RegisterContainerInstance]
ReadPrec RegisterContainerInstance
Int -> ReadS RegisterContainerInstance
ReadS [RegisterContainerInstance]
(Int -> ReadS RegisterContainerInstance)
-> ReadS [RegisterContainerInstance]
-> ReadPrec RegisterContainerInstance
-> ReadPrec [RegisterContainerInstance]
-> Read RegisterContainerInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterContainerInstance]
$creadListPrec :: ReadPrec [RegisterContainerInstance]
readPrec :: ReadPrec RegisterContainerInstance
$creadPrec :: ReadPrec RegisterContainerInstance
readList :: ReadS [RegisterContainerInstance]
$creadList :: ReadS [RegisterContainerInstance]
readsPrec :: Int -> ReadS RegisterContainerInstance
$creadsPrec :: Int -> ReadS RegisterContainerInstance
Prelude.Read, Int -> RegisterContainerInstance -> ShowS
[RegisterContainerInstance] -> ShowS
RegisterContainerInstance -> String
(Int -> RegisterContainerInstance -> ShowS)
-> (RegisterContainerInstance -> String)
-> ([RegisterContainerInstance] -> ShowS)
-> Show RegisterContainerInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterContainerInstance] -> ShowS
$cshowList :: [RegisterContainerInstance] -> ShowS
show :: RegisterContainerInstance -> String
$cshow :: RegisterContainerInstance -> String
showsPrec :: Int -> RegisterContainerInstance -> ShowS
$cshowsPrec :: Int -> RegisterContainerInstance -> ShowS
Prelude.Show, (forall x.
RegisterContainerInstance -> Rep RegisterContainerInstance x)
-> (forall x.
Rep RegisterContainerInstance x -> RegisterContainerInstance)
-> Generic RegisterContainerInstance
forall x.
Rep RegisterContainerInstance x -> RegisterContainerInstance
forall x.
RegisterContainerInstance -> Rep RegisterContainerInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterContainerInstance x -> RegisterContainerInstance
$cfrom :: forall x.
RegisterContainerInstance -> Rep RegisterContainerInstance x
Prelude.Generic)
newRegisterContainerInstance ::
RegisterContainerInstance
newRegisterContainerInstance :: RegisterContainerInstance
newRegisterContainerInstance =
RegisterContainerInstance' :: Maybe [PlatformDevice]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VersionInfo
-> Maybe [Attribute]
-> Maybe [Resource]
-> Maybe [Tag]
-> RegisterContainerInstance
RegisterContainerInstance'
{ $sel:platformDevices:RegisterContainerInstance' :: Maybe [PlatformDevice]
platformDevices =
Maybe [PlatformDevice]
forall a. Maybe a
Prelude.Nothing,
$sel:instanceIdentityDocumentSignature:RegisterContainerInstance' :: Maybe Text
instanceIdentityDocumentSignature =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cluster:RegisterContainerInstance' :: Maybe Text
cluster = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceIdentityDocument:RegisterContainerInstance' :: Maybe Text
instanceIdentityDocument = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:containerInstanceArn:RegisterContainerInstance' :: Maybe Text
containerInstanceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:versionInfo:RegisterContainerInstance' :: Maybe VersionInfo
versionInfo = Maybe VersionInfo
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:RegisterContainerInstance' :: Maybe [Attribute]
attributes = Maybe [Attribute]
forall a. Maybe a
Prelude.Nothing,
$sel:totalResources:RegisterContainerInstance' :: Maybe [Resource]
totalResources = Maybe [Resource]
forall a. Maybe a
Prelude.Nothing,
$sel:tags:RegisterContainerInstance' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
}
registerContainerInstance_platformDevices :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe [PlatformDevice])
registerContainerInstance_platformDevices :: (Maybe [PlatformDevice] -> f (Maybe [PlatformDevice]))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_platformDevices = (RegisterContainerInstance -> Maybe [PlatformDevice])
-> (RegisterContainerInstance
-> Maybe [PlatformDevice] -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe [PlatformDevice])
(Maybe [PlatformDevice])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe [PlatformDevice]
platformDevices :: Maybe [PlatformDevice]
$sel:platformDevices:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [PlatformDevice]
platformDevices} -> Maybe [PlatformDevice]
platformDevices) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe [PlatformDevice]
a -> RegisterContainerInstance
s {$sel:platformDevices:RegisterContainerInstance' :: Maybe [PlatformDevice]
platformDevices = Maybe [PlatformDevice]
a} :: RegisterContainerInstance) ((Maybe [PlatformDevice] -> f (Maybe [PlatformDevice]))
-> RegisterContainerInstance -> f RegisterContainerInstance)
-> ((Maybe [PlatformDevice] -> f (Maybe [PlatformDevice]))
-> Maybe [PlatformDevice] -> f (Maybe [PlatformDevice]))
-> (Maybe [PlatformDevice] -> f (Maybe [PlatformDevice]))
-> RegisterContainerInstance
-> f RegisterContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PlatformDevice] [PlatformDevice] [PlatformDevice] [PlatformDevice]
-> Iso
(Maybe [PlatformDevice])
(Maybe [PlatformDevice])
(Maybe [PlatformDevice])
(Maybe [PlatformDevice])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[PlatformDevice] [PlatformDevice] [PlatformDevice] [PlatformDevice]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
registerContainerInstance_instanceIdentityDocumentSignature :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe Prelude.Text)
registerContainerInstance_instanceIdentityDocumentSignature :: (Maybe Text -> f (Maybe Text))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_instanceIdentityDocumentSignature = (RegisterContainerInstance -> Maybe Text)
-> (RegisterContainerInstance
-> Maybe Text -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe Text
instanceIdentityDocumentSignature :: Maybe Text
$sel:instanceIdentityDocumentSignature:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
instanceIdentityDocumentSignature} -> Maybe Text
instanceIdentityDocumentSignature) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe Text
a -> RegisterContainerInstance
s {$sel:instanceIdentityDocumentSignature:RegisterContainerInstance' :: Maybe Text
instanceIdentityDocumentSignature = Maybe Text
a} :: RegisterContainerInstance)
registerContainerInstance_cluster :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe Prelude.Text)
registerContainerInstance_cluster :: (Maybe Text -> f (Maybe Text))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_cluster = (RegisterContainerInstance -> Maybe Text)
-> (RegisterContainerInstance
-> Maybe Text -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe Text
cluster :: Maybe Text
$sel:cluster:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
cluster} -> Maybe Text
cluster) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe Text
a -> RegisterContainerInstance
s {$sel:cluster:RegisterContainerInstance' :: Maybe Text
cluster = Maybe Text
a} :: RegisterContainerInstance)
registerContainerInstance_instanceIdentityDocument :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe Prelude.Text)
registerContainerInstance_instanceIdentityDocument :: (Maybe Text -> f (Maybe Text))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_instanceIdentityDocument = (RegisterContainerInstance -> Maybe Text)
-> (RegisterContainerInstance
-> Maybe Text -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe Text
instanceIdentityDocument :: Maybe Text
$sel:instanceIdentityDocument:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
instanceIdentityDocument} -> Maybe Text
instanceIdentityDocument) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe Text
a -> RegisterContainerInstance
s {$sel:instanceIdentityDocument:RegisterContainerInstance' :: Maybe Text
instanceIdentityDocument = Maybe Text
a} :: RegisterContainerInstance)
registerContainerInstance_containerInstanceArn :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe Prelude.Text)
registerContainerInstance_containerInstanceArn :: (Maybe Text -> f (Maybe Text))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_containerInstanceArn = (RegisterContainerInstance -> Maybe Text)
-> (RegisterContainerInstance
-> Maybe Text -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe Text
containerInstanceArn :: Maybe Text
$sel:containerInstanceArn:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
containerInstanceArn} -> Maybe Text
containerInstanceArn) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe Text
a -> RegisterContainerInstance
s {$sel:containerInstanceArn:RegisterContainerInstance' :: Maybe Text
containerInstanceArn = Maybe Text
a} :: RegisterContainerInstance)
registerContainerInstance_versionInfo :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe VersionInfo)
registerContainerInstance_versionInfo :: (Maybe VersionInfo -> f (Maybe VersionInfo))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_versionInfo = (RegisterContainerInstance -> Maybe VersionInfo)
-> (RegisterContainerInstance
-> Maybe VersionInfo -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe VersionInfo)
(Maybe VersionInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe VersionInfo
versionInfo :: Maybe VersionInfo
$sel:versionInfo:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe VersionInfo
versionInfo} -> Maybe VersionInfo
versionInfo) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe VersionInfo
a -> RegisterContainerInstance
s {$sel:versionInfo:RegisterContainerInstance' :: Maybe VersionInfo
versionInfo = Maybe VersionInfo
a} :: RegisterContainerInstance)
registerContainerInstance_attributes :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe [Attribute])
registerContainerInstance_attributes :: (Maybe [Attribute] -> f (Maybe [Attribute]))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_attributes = (RegisterContainerInstance -> Maybe [Attribute])
-> (RegisterContainerInstance
-> Maybe [Attribute] -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe [Attribute])
(Maybe [Attribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe [Attribute]
a -> RegisterContainerInstance
s {$sel:attributes:RegisterContainerInstance' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: RegisterContainerInstance) ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> RegisterContainerInstance -> f RegisterContainerInstance)
-> ((Maybe [Attribute] -> f (Maybe [Attribute]))
-> Maybe [Attribute] -> f (Maybe [Attribute]))
-> (Maybe [Attribute] -> f (Maybe [Attribute]))
-> RegisterContainerInstance
-> f RegisterContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Attribute] [Attribute] [Attribute] [Attribute]
-> Iso
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
(Maybe [Attribute])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Attribute] [Attribute] [Attribute] [Attribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
registerContainerInstance_totalResources :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe [Resource])
registerContainerInstance_totalResources :: (Maybe [Resource] -> f (Maybe [Resource]))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_totalResources = (RegisterContainerInstance -> Maybe [Resource])
-> (RegisterContainerInstance
-> Maybe [Resource] -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe [Resource])
(Maybe [Resource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe [Resource]
totalResources :: Maybe [Resource]
$sel:totalResources:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [Resource]
totalResources} -> Maybe [Resource]
totalResources) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe [Resource]
a -> RegisterContainerInstance
s {$sel:totalResources:RegisterContainerInstance' :: Maybe [Resource]
totalResources = Maybe [Resource]
a} :: RegisterContainerInstance) ((Maybe [Resource] -> f (Maybe [Resource]))
-> RegisterContainerInstance -> f RegisterContainerInstance)
-> ((Maybe [Resource] -> f (Maybe [Resource]))
-> Maybe [Resource] -> f (Maybe [Resource]))
-> (Maybe [Resource] -> f (Maybe [Resource]))
-> RegisterContainerInstance
-> f RegisterContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Resource] [Resource] [Resource] [Resource]
-> Iso
(Maybe [Resource])
(Maybe [Resource])
(Maybe [Resource])
(Maybe [Resource])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Resource] [Resource] [Resource] [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
registerContainerInstance_tags :: Lens.Lens' RegisterContainerInstance (Prelude.Maybe [Tag])
registerContainerInstance_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> RegisterContainerInstance -> f RegisterContainerInstance
registerContainerInstance_tags = (RegisterContainerInstance -> Maybe [Tag])
-> (RegisterContainerInstance
-> Maybe [Tag] -> RegisterContainerInstance)
-> Lens
RegisterContainerInstance
RegisterContainerInstance
(Maybe [Tag])
(Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstance' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: RegisterContainerInstance
s@RegisterContainerInstance' {} Maybe [Tag]
a -> RegisterContainerInstance
s {$sel:tags:RegisterContainerInstance' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: RegisterContainerInstance) ((Maybe [Tag] -> f (Maybe [Tag]))
-> RegisterContainerInstance -> f RegisterContainerInstance)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
-> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> RegisterContainerInstance
-> f RegisterContainerInstance
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest RegisterContainerInstance where
type
AWSResponse RegisterContainerInstance =
RegisterContainerInstanceResponse
request :: RegisterContainerInstance -> Request RegisterContainerInstance
request = Service
-> RegisterContainerInstance -> Request RegisterContainerInstance
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterContainerInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterContainerInstance)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse RegisterContainerInstance))
-> Logger
-> Service
-> Proxy RegisterContainerInstance
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RegisterContainerInstance)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ContainerInstance -> Int -> RegisterContainerInstanceResponse
RegisterContainerInstanceResponse'
(Maybe ContainerInstance
-> Int -> RegisterContainerInstanceResponse)
-> Either String (Maybe ContainerInstance)
-> Either String (Int -> RegisterContainerInstanceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ContainerInstance)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"containerInstance")
Either String (Int -> RegisterContainerInstanceResponse)
-> Either String Int
-> Either String RegisterContainerInstanceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable RegisterContainerInstance
instance Prelude.NFData RegisterContainerInstance
instance Core.ToHeaders RegisterContainerInstance where
toHeaders :: RegisterContainerInstance -> ResponseHeaders
toHeaders =
ResponseHeaders -> RegisterContainerInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonEC2ContainerServiceV20141113.RegisterContainerInstance" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RegisterContainerInstance where
toJSON :: RegisterContainerInstance -> Value
toJSON RegisterContainerInstance' {Maybe [PlatformDevice]
Maybe [Resource]
Maybe [Tag]
Maybe [Attribute]
Maybe Text
Maybe VersionInfo
tags :: Maybe [Tag]
totalResources :: Maybe [Resource]
attributes :: Maybe [Attribute]
versionInfo :: Maybe VersionInfo
containerInstanceArn :: Maybe Text
instanceIdentityDocument :: Maybe Text
cluster :: Maybe Text
instanceIdentityDocumentSignature :: Maybe Text
platformDevices :: Maybe [PlatformDevice]
$sel:tags:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [Tag]
$sel:totalResources:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [Resource]
$sel:attributes:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [Attribute]
$sel:versionInfo:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe VersionInfo
$sel:containerInstanceArn:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
$sel:instanceIdentityDocument:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
$sel:cluster:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
$sel:instanceIdentityDocumentSignature:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe Text
$sel:platformDevices:RegisterContainerInstance' :: RegisterContainerInstance -> Maybe [PlatformDevice]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"platformDevices" Text -> [PlatformDevice] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([PlatformDevice] -> Pair) -> Maybe [PlatformDevice] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PlatformDevice]
platformDevices,
(Text
"instanceIdentityDocumentSignature" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
instanceIdentityDocumentSignature,
(Text
"cluster" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
cluster,
(Text
"instanceIdentityDocument" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
instanceIdentityDocument,
(Text
"containerInstanceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
containerInstanceArn,
(Text
"versionInfo" Text -> VersionInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (VersionInfo -> Pair) -> Maybe VersionInfo -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VersionInfo
versionInfo,
(Text
"attributes" Text -> [Attribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Attribute] -> Pair) -> Maybe [Attribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Attribute]
attributes,
(Text
"totalResources" Text -> [Resource] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([Resource] -> Pair) -> Maybe [Resource] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Resource]
totalResources,
(Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags
]
)
instance Core.ToPath RegisterContainerInstance where
toPath :: RegisterContainerInstance -> ByteString
toPath = ByteString -> RegisterContainerInstance -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RegisterContainerInstance where
toQuery :: RegisterContainerInstance -> QueryString
toQuery = QueryString -> RegisterContainerInstance -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RegisterContainerInstanceResponse = RegisterContainerInstanceResponse'
{
RegisterContainerInstanceResponse -> Maybe ContainerInstance
containerInstance :: Prelude.Maybe ContainerInstance,
RegisterContainerInstanceResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RegisterContainerInstanceResponse
-> RegisterContainerInstanceResponse -> Bool
(RegisterContainerInstanceResponse
-> RegisterContainerInstanceResponse -> Bool)
-> (RegisterContainerInstanceResponse
-> RegisterContainerInstanceResponse -> Bool)
-> Eq RegisterContainerInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterContainerInstanceResponse
-> RegisterContainerInstanceResponse -> Bool
$c/= :: RegisterContainerInstanceResponse
-> RegisterContainerInstanceResponse -> Bool
== :: RegisterContainerInstanceResponse
-> RegisterContainerInstanceResponse -> Bool
$c== :: RegisterContainerInstanceResponse
-> RegisterContainerInstanceResponse -> Bool
Prelude.Eq, ReadPrec [RegisterContainerInstanceResponse]
ReadPrec RegisterContainerInstanceResponse
Int -> ReadS RegisterContainerInstanceResponse
ReadS [RegisterContainerInstanceResponse]
(Int -> ReadS RegisterContainerInstanceResponse)
-> ReadS [RegisterContainerInstanceResponse]
-> ReadPrec RegisterContainerInstanceResponse
-> ReadPrec [RegisterContainerInstanceResponse]
-> Read RegisterContainerInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterContainerInstanceResponse]
$creadListPrec :: ReadPrec [RegisterContainerInstanceResponse]
readPrec :: ReadPrec RegisterContainerInstanceResponse
$creadPrec :: ReadPrec RegisterContainerInstanceResponse
readList :: ReadS [RegisterContainerInstanceResponse]
$creadList :: ReadS [RegisterContainerInstanceResponse]
readsPrec :: Int -> ReadS RegisterContainerInstanceResponse
$creadsPrec :: Int -> ReadS RegisterContainerInstanceResponse
Prelude.Read, Int -> RegisterContainerInstanceResponse -> ShowS
[RegisterContainerInstanceResponse] -> ShowS
RegisterContainerInstanceResponse -> String
(Int -> RegisterContainerInstanceResponse -> ShowS)
-> (RegisterContainerInstanceResponse -> String)
-> ([RegisterContainerInstanceResponse] -> ShowS)
-> Show RegisterContainerInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterContainerInstanceResponse] -> ShowS
$cshowList :: [RegisterContainerInstanceResponse] -> ShowS
show :: RegisterContainerInstanceResponse -> String
$cshow :: RegisterContainerInstanceResponse -> String
showsPrec :: Int -> RegisterContainerInstanceResponse -> ShowS
$cshowsPrec :: Int -> RegisterContainerInstanceResponse -> ShowS
Prelude.Show, (forall x.
RegisterContainerInstanceResponse
-> Rep RegisterContainerInstanceResponse x)
-> (forall x.
Rep RegisterContainerInstanceResponse x
-> RegisterContainerInstanceResponse)
-> Generic RegisterContainerInstanceResponse
forall x.
Rep RegisterContainerInstanceResponse x
-> RegisterContainerInstanceResponse
forall x.
RegisterContainerInstanceResponse
-> Rep RegisterContainerInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterContainerInstanceResponse x
-> RegisterContainerInstanceResponse
$cfrom :: forall x.
RegisterContainerInstanceResponse
-> Rep RegisterContainerInstanceResponse x
Prelude.Generic)
newRegisterContainerInstanceResponse ::
Prelude.Int ->
RegisterContainerInstanceResponse
newRegisterContainerInstanceResponse :: Int -> RegisterContainerInstanceResponse
newRegisterContainerInstanceResponse Int
pHttpStatus_ =
RegisterContainerInstanceResponse' :: Maybe ContainerInstance -> Int -> RegisterContainerInstanceResponse
RegisterContainerInstanceResponse'
{ $sel:containerInstance:RegisterContainerInstanceResponse' :: Maybe ContainerInstance
containerInstance =
Maybe ContainerInstance
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RegisterContainerInstanceResponse' :: Int
httpStatus = Int
pHttpStatus_
}
registerContainerInstanceResponse_containerInstance :: Lens.Lens' RegisterContainerInstanceResponse (Prelude.Maybe ContainerInstance)
registerContainerInstanceResponse_containerInstance :: (Maybe ContainerInstance -> f (Maybe ContainerInstance))
-> RegisterContainerInstanceResponse
-> f RegisterContainerInstanceResponse
registerContainerInstanceResponse_containerInstance = (RegisterContainerInstanceResponse -> Maybe ContainerInstance)
-> (RegisterContainerInstanceResponse
-> Maybe ContainerInstance -> RegisterContainerInstanceResponse)
-> Lens
RegisterContainerInstanceResponse
RegisterContainerInstanceResponse
(Maybe ContainerInstance)
(Maybe ContainerInstance)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstanceResponse' {Maybe ContainerInstance
containerInstance :: Maybe ContainerInstance
$sel:containerInstance:RegisterContainerInstanceResponse' :: RegisterContainerInstanceResponse -> Maybe ContainerInstance
containerInstance} -> Maybe ContainerInstance
containerInstance) (\s :: RegisterContainerInstanceResponse
s@RegisterContainerInstanceResponse' {} Maybe ContainerInstance
a -> RegisterContainerInstanceResponse
s {$sel:containerInstance:RegisterContainerInstanceResponse' :: Maybe ContainerInstance
containerInstance = Maybe ContainerInstance
a} :: RegisterContainerInstanceResponse)
registerContainerInstanceResponse_httpStatus :: Lens.Lens' RegisterContainerInstanceResponse Prelude.Int
registerContainerInstanceResponse_httpStatus :: (Int -> f Int)
-> RegisterContainerInstanceResponse
-> f RegisterContainerInstanceResponse
registerContainerInstanceResponse_httpStatus = (RegisterContainerInstanceResponse -> Int)
-> (RegisterContainerInstanceResponse
-> Int -> RegisterContainerInstanceResponse)
-> Lens
RegisterContainerInstanceResponse
RegisterContainerInstanceResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterContainerInstanceResponse' {Int
httpStatus :: Int
$sel:httpStatus:RegisterContainerInstanceResponse' :: RegisterContainerInstanceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RegisterContainerInstanceResponse
s@RegisterContainerInstanceResponse' {} Int
a -> RegisterContainerInstanceResponse
s {$sel:httpStatus:RegisterContainerInstanceResponse' :: Int
httpStatus = Int
a} :: RegisterContainerInstanceResponse)
instance
Prelude.NFData
RegisterContainerInstanceResponse