{-# 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.SubmitAttachmentStateChanges
(
SubmitAttachmentStateChanges (..),
newSubmitAttachmentStateChanges,
submitAttachmentStateChanges_cluster,
submitAttachmentStateChanges_attachments,
SubmitAttachmentStateChangesResponse (..),
newSubmitAttachmentStateChangesResponse,
submitAttachmentStateChangesResponse_acknowledgment,
submitAttachmentStateChangesResponse_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 SubmitAttachmentStateChanges = SubmitAttachmentStateChanges'
{
SubmitAttachmentStateChanges -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
SubmitAttachmentStateChanges -> [AttachmentStateChange]
attachments :: [AttachmentStateChange]
}
deriving (SubmitAttachmentStateChanges
-> SubmitAttachmentStateChanges -> Bool
(SubmitAttachmentStateChanges
-> SubmitAttachmentStateChanges -> Bool)
-> (SubmitAttachmentStateChanges
-> SubmitAttachmentStateChanges -> Bool)
-> Eq SubmitAttachmentStateChanges
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubmitAttachmentStateChanges
-> SubmitAttachmentStateChanges -> Bool
$c/= :: SubmitAttachmentStateChanges
-> SubmitAttachmentStateChanges -> Bool
== :: SubmitAttachmentStateChanges
-> SubmitAttachmentStateChanges -> Bool
$c== :: SubmitAttachmentStateChanges
-> SubmitAttachmentStateChanges -> Bool
Prelude.Eq, ReadPrec [SubmitAttachmentStateChanges]
ReadPrec SubmitAttachmentStateChanges
Int -> ReadS SubmitAttachmentStateChanges
ReadS [SubmitAttachmentStateChanges]
(Int -> ReadS SubmitAttachmentStateChanges)
-> ReadS [SubmitAttachmentStateChanges]
-> ReadPrec SubmitAttachmentStateChanges
-> ReadPrec [SubmitAttachmentStateChanges]
-> Read SubmitAttachmentStateChanges
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubmitAttachmentStateChanges]
$creadListPrec :: ReadPrec [SubmitAttachmentStateChanges]
readPrec :: ReadPrec SubmitAttachmentStateChanges
$creadPrec :: ReadPrec SubmitAttachmentStateChanges
readList :: ReadS [SubmitAttachmentStateChanges]
$creadList :: ReadS [SubmitAttachmentStateChanges]
readsPrec :: Int -> ReadS SubmitAttachmentStateChanges
$creadsPrec :: Int -> ReadS SubmitAttachmentStateChanges
Prelude.Read, Int -> SubmitAttachmentStateChanges -> ShowS
[SubmitAttachmentStateChanges] -> ShowS
SubmitAttachmentStateChanges -> String
(Int -> SubmitAttachmentStateChanges -> ShowS)
-> (SubmitAttachmentStateChanges -> String)
-> ([SubmitAttachmentStateChanges] -> ShowS)
-> Show SubmitAttachmentStateChanges
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubmitAttachmentStateChanges] -> ShowS
$cshowList :: [SubmitAttachmentStateChanges] -> ShowS
show :: SubmitAttachmentStateChanges -> String
$cshow :: SubmitAttachmentStateChanges -> String
showsPrec :: Int -> SubmitAttachmentStateChanges -> ShowS
$cshowsPrec :: Int -> SubmitAttachmentStateChanges -> ShowS
Prelude.Show, (forall x.
SubmitAttachmentStateChanges -> Rep SubmitAttachmentStateChanges x)
-> (forall x.
Rep SubmitAttachmentStateChanges x -> SubmitAttachmentStateChanges)
-> Generic SubmitAttachmentStateChanges
forall x.
Rep SubmitAttachmentStateChanges x -> SubmitAttachmentStateChanges
forall x.
SubmitAttachmentStateChanges -> Rep SubmitAttachmentStateChanges x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SubmitAttachmentStateChanges x -> SubmitAttachmentStateChanges
$cfrom :: forall x.
SubmitAttachmentStateChanges -> Rep SubmitAttachmentStateChanges x
Prelude.Generic)
newSubmitAttachmentStateChanges ::
SubmitAttachmentStateChanges
newSubmitAttachmentStateChanges :: SubmitAttachmentStateChanges
newSubmitAttachmentStateChanges =
SubmitAttachmentStateChanges' :: Maybe Text
-> [AttachmentStateChange] -> SubmitAttachmentStateChanges
SubmitAttachmentStateChanges'
{ $sel:cluster:SubmitAttachmentStateChanges' :: Maybe Text
cluster =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attachments:SubmitAttachmentStateChanges' :: [AttachmentStateChange]
attachments = [AttachmentStateChange]
forall a. Monoid a => a
Prelude.mempty
}
submitAttachmentStateChanges_cluster :: Lens.Lens' SubmitAttachmentStateChanges (Prelude.Maybe Prelude.Text)
submitAttachmentStateChanges_cluster :: (Maybe Text -> f (Maybe Text))
-> SubmitAttachmentStateChanges -> f SubmitAttachmentStateChanges
submitAttachmentStateChanges_cluster = (SubmitAttachmentStateChanges -> Maybe Text)
-> (SubmitAttachmentStateChanges
-> Maybe Text -> SubmitAttachmentStateChanges)
-> Lens
SubmitAttachmentStateChanges
SubmitAttachmentStateChanges
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitAttachmentStateChanges' {Maybe Text
cluster :: Maybe Text
$sel:cluster:SubmitAttachmentStateChanges' :: SubmitAttachmentStateChanges -> Maybe Text
cluster} -> Maybe Text
cluster) (\s :: SubmitAttachmentStateChanges
s@SubmitAttachmentStateChanges' {} Maybe Text
a -> SubmitAttachmentStateChanges
s {$sel:cluster:SubmitAttachmentStateChanges' :: Maybe Text
cluster = Maybe Text
a} :: SubmitAttachmentStateChanges)
submitAttachmentStateChanges_attachments :: Lens.Lens' SubmitAttachmentStateChanges [AttachmentStateChange]
submitAttachmentStateChanges_attachments :: ([AttachmentStateChange] -> f [AttachmentStateChange])
-> SubmitAttachmentStateChanges -> f SubmitAttachmentStateChanges
submitAttachmentStateChanges_attachments = (SubmitAttachmentStateChanges -> [AttachmentStateChange])
-> (SubmitAttachmentStateChanges
-> [AttachmentStateChange] -> SubmitAttachmentStateChanges)
-> Lens
SubmitAttachmentStateChanges
SubmitAttachmentStateChanges
[AttachmentStateChange]
[AttachmentStateChange]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitAttachmentStateChanges' {[AttachmentStateChange]
attachments :: [AttachmentStateChange]
$sel:attachments:SubmitAttachmentStateChanges' :: SubmitAttachmentStateChanges -> [AttachmentStateChange]
attachments} -> [AttachmentStateChange]
attachments) (\s :: SubmitAttachmentStateChanges
s@SubmitAttachmentStateChanges' {} [AttachmentStateChange]
a -> SubmitAttachmentStateChanges
s {$sel:attachments:SubmitAttachmentStateChanges' :: [AttachmentStateChange]
attachments = [AttachmentStateChange]
a} :: SubmitAttachmentStateChanges) (([AttachmentStateChange] -> f [AttachmentStateChange])
-> SubmitAttachmentStateChanges -> f SubmitAttachmentStateChanges)
-> (([AttachmentStateChange] -> f [AttachmentStateChange])
-> [AttachmentStateChange] -> f [AttachmentStateChange])
-> ([AttachmentStateChange] -> f [AttachmentStateChange])
-> SubmitAttachmentStateChanges
-> f SubmitAttachmentStateChanges
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AttachmentStateChange] -> f [AttachmentStateChange])
-> [AttachmentStateChange] -> f [AttachmentStateChange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest SubmitAttachmentStateChanges where
type
AWSResponse SubmitAttachmentStateChanges =
SubmitAttachmentStateChangesResponse
request :: SubmitAttachmentStateChanges
-> Request SubmitAttachmentStateChanges
request = Service
-> SubmitAttachmentStateChanges
-> Request SubmitAttachmentStateChanges
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SubmitAttachmentStateChanges
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SubmitAttachmentStateChanges)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SubmitAttachmentStateChanges))
-> Logger
-> Service
-> Proxy SubmitAttachmentStateChanges
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SubmitAttachmentStateChanges)))
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 Text -> Int -> SubmitAttachmentStateChangesResponse
SubmitAttachmentStateChangesResponse'
(Maybe Text -> Int -> SubmitAttachmentStateChangesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> SubmitAttachmentStateChangesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"acknowledgment")
Either String (Int -> SubmitAttachmentStateChangesResponse)
-> Either String Int
-> Either String SubmitAttachmentStateChangesResponse
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
SubmitAttachmentStateChanges
instance Prelude.NFData SubmitAttachmentStateChanges
instance Core.ToHeaders SubmitAttachmentStateChanges where
toHeaders :: SubmitAttachmentStateChanges -> ResponseHeaders
toHeaders =
ResponseHeaders -> SubmitAttachmentStateChanges -> 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.SubmitAttachmentStateChanges" ::
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 SubmitAttachmentStateChanges where
toJSON :: SubmitAttachmentStateChanges -> Value
toJSON SubmitAttachmentStateChanges' {[AttachmentStateChange]
Maybe Text
attachments :: [AttachmentStateChange]
cluster :: Maybe Text
$sel:attachments:SubmitAttachmentStateChanges' :: SubmitAttachmentStateChanges -> [AttachmentStateChange]
$sel:cluster:SubmitAttachmentStateChanges' :: SubmitAttachmentStateChanges -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"attachments" Text -> [AttachmentStateChange] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AttachmentStateChange]
attachments)
]
)
instance Core.ToPath SubmitAttachmentStateChanges where
toPath :: SubmitAttachmentStateChanges -> ByteString
toPath = ByteString -> SubmitAttachmentStateChanges -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SubmitAttachmentStateChanges where
toQuery :: SubmitAttachmentStateChanges -> QueryString
toQuery = QueryString -> SubmitAttachmentStateChanges -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SubmitAttachmentStateChangesResponse = SubmitAttachmentStateChangesResponse'
{
SubmitAttachmentStateChangesResponse -> Maybe Text
acknowledgment :: Prelude.Maybe Prelude.Text,
SubmitAttachmentStateChangesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SubmitAttachmentStateChangesResponse
-> SubmitAttachmentStateChangesResponse -> Bool
(SubmitAttachmentStateChangesResponse
-> SubmitAttachmentStateChangesResponse -> Bool)
-> (SubmitAttachmentStateChangesResponse
-> SubmitAttachmentStateChangesResponse -> Bool)
-> Eq SubmitAttachmentStateChangesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SubmitAttachmentStateChangesResponse
-> SubmitAttachmentStateChangesResponse -> Bool
$c/= :: SubmitAttachmentStateChangesResponse
-> SubmitAttachmentStateChangesResponse -> Bool
== :: SubmitAttachmentStateChangesResponse
-> SubmitAttachmentStateChangesResponse -> Bool
$c== :: SubmitAttachmentStateChangesResponse
-> SubmitAttachmentStateChangesResponse -> Bool
Prelude.Eq, ReadPrec [SubmitAttachmentStateChangesResponse]
ReadPrec SubmitAttachmentStateChangesResponse
Int -> ReadS SubmitAttachmentStateChangesResponse
ReadS [SubmitAttachmentStateChangesResponse]
(Int -> ReadS SubmitAttachmentStateChangesResponse)
-> ReadS [SubmitAttachmentStateChangesResponse]
-> ReadPrec SubmitAttachmentStateChangesResponse
-> ReadPrec [SubmitAttachmentStateChangesResponse]
-> Read SubmitAttachmentStateChangesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SubmitAttachmentStateChangesResponse]
$creadListPrec :: ReadPrec [SubmitAttachmentStateChangesResponse]
readPrec :: ReadPrec SubmitAttachmentStateChangesResponse
$creadPrec :: ReadPrec SubmitAttachmentStateChangesResponse
readList :: ReadS [SubmitAttachmentStateChangesResponse]
$creadList :: ReadS [SubmitAttachmentStateChangesResponse]
readsPrec :: Int -> ReadS SubmitAttachmentStateChangesResponse
$creadsPrec :: Int -> ReadS SubmitAttachmentStateChangesResponse
Prelude.Read, Int -> SubmitAttachmentStateChangesResponse -> ShowS
[SubmitAttachmentStateChangesResponse] -> ShowS
SubmitAttachmentStateChangesResponse -> String
(Int -> SubmitAttachmentStateChangesResponse -> ShowS)
-> (SubmitAttachmentStateChangesResponse -> String)
-> ([SubmitAttachmentStateChangesResponse] -> ShowS)
-> Show SubmitAttachmentStateChangesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SubmitAttachmentStateChangesResponse] -> ShowS
$cshowList :: [SubmitAttachmentStateChangesResponse] -> ShowS
show :: SubmitAttachmentStateChangesResponse -> String
$cshow :: SubmitAttachmentStateChangesResponse -> String
showsPrec :: Int -> SubmitAttachmentStateChangesResponse -> ShowS
$cshowsPrec :: Int -> SubmitAttachmentStateChangesResponse -> ShowS
Prelude.Show, (forall x.
SubmitAttachmentStateChangesResponse
-> Rep SubmitAttachmentStateChangesResponse x)
-> (forall x.
Rep SubmitAttachmentStateChangesResponse x
-> SubmitAttachmentStateChangesResponse)
-> Generic SubmitAttachmentStateChangesResponse
forall x.
Rep SubmitAttachmentStateChangesResponse x
-> SubmitAttachmentStateChangesResponse
forall x.
SubmitAttachmentStateChangesResponse
-> Rep SubmitAttachmentStateChangesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SubmitAttachmentStateChangesResponse x
-> SubmitAttachmentStateChangesResponse
$cfrom :: forall x.
SubmitAttachmentStateChangesResponse
-> Rep SubmitAttachmentStateChangesResponse x
Prelude.Generic)
newSubmitAttachmentStateChangesResponse ::
Prelude.Int ->
SubmitAttachmentStateChangesResponse
newSubmitAttachmentStateChangesResponse :: Int -> SubmitAttachmentStateChangesResponse
newSubmitAttachmentStateChangesResponse Int
pHttpStatus_ =
SubmitAttachmentStateChangesResponse' :: Maybe Text -> Int -> SubmitAttachmentStateChangesResponse
SubmitAttachmentStateChangesResponse'
{ $sel:acknowledgment:SubmitAttachmentStateChangesResponse' :: Maybe Text
acknowledgment =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SubmitAttachmentStateChangesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
submitAttachmentStateChangesResponse_acknowledgment :: Lens.Lens' SubmitAttachmentStateChangesResponse (Prelude.Maybe Prelude.Text)
submitAttachmentStateChangesResponse_acknowledgment :: (Maybe Text -> f (Maybe Text))
-> SubmitAttachmentStateChangesResponse
-> f SubmitAttachmentStateChangesResponse
submitAttachmentStateChangesResponse_acknowledgment = (SubmitAttachmentStateChangesResponse -> Maybe Text)
-> (SubmitAttachmentStateChangesResponse
-> Maybe Text -> SubmitAttachmentStateChangesResponse)
-> Lens
SubmitAttachmentStateChangesResponse
SubmitAttachmentStateChangesResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitAttachmentStateChangesResponse' {Maybe Text
acknowledgment :: Maybe Text
$sel:acknowledgment:SubmitAttachmentStateChangesResponse' :: SubmitAttachmentStateChangesResponse -> Maybe Text
acknowledgment} -> Maybe Text
acknowledgment) (\s :: SubmitAttachmentStateChangesResponse
s@SubmitAttachmentStateChangesResponse' {} Maybe Text
a -> SubmitAttachmentStateChangesResponse
s {$sel:acknowledgment:SubmitAttachmentStateChangesResponse' :: Maybe Text
acknowledgment = Maybe Text
a} :: SubmitAttachmentStateChangesResponse)
submitAttachmentStateChangesResponse_httpStatus :: Lens.Lens' SubmitAttachmentStateChangesResponse Prelude.Int
submitAttachmentStateChangesResponse_httpStatus :: (Int -> f Int)
-> SubmitAttachmentStateChangesResponse
-> f SubmitAttachmentStateChangesResponse
submitAttachmentStateChangesResponse_httpStatus = (SubmitAttachmentStateChangesResponse -> Int)
-> (SubmitAttachmentStateChangesResponse
-> Int -> SubmitAttachmentStateChangesResponse)
-> Lens
SubmitAttachmentStateChangesResponse
SubmitAttachmentStateChangesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SubmitAttachmentStateChangesResponse' {Int
httpStatus :: Int
$sel:httpStatus:SubmitAttachmentStateChangesResponse' :: SubmitAttachmentStateChangesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SubmitAttachmentStateChangesResponse
s@SubmitAttachmentStateChangesResponse' {} Int
a -> SubmitAttachmentStateChangesResponse
s {$sel:httpStatus:SubmitAttachmentStateChangesResponse' :: Int
httpStatus = Int
a} :: SubmitAttachmentStateChangesResponse)
instance
Prelude.NFData
SubmitAttachmentStateChangesResponse