{-# 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.MarketplaceCatalog.StartChangeSet
(
StartChangeSet (..),
newStartChangeSet,
startChangeSet_changeSetName,
startChangeSet_changeSetTags,
startChangeSet_clientRequestToken,
startChangeSet_catalog,
startChangeSet_changeSet,
StartChangeSetResponse (..),
newStartChangeSetResponse,
startChangeSetResponse_changeSetArn,
startChangeSetResponse_changeSetId,
startChangeSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MarketplaceCatalog.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartChangeSet = StartChangeSet'
{
StartChangeSet -> Maybe Text
changeSetName :: Prelude.Maybe Prelude.Text,
StartChangeSet -> Maybe (NonEmpty Tag)
changeSetTags :: Prelude.Maybe (Prelude.NonEmpty Tag),
StartChangeSet -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
StartChangeSet -> Text
catalog :: Prelude.Text,
StartChangeSet -> NonEmpty Change
changeSet :: Prelude.NonEmpty Change
}
deriving (StartChangeSet -> StartChangeSet -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartChangeSet -> StartChangeSet -> Bool
$c/= :: StartChangeSet -> StartChangeSet -> Bool
== :: StartChangeSet -> StartChangeSet -> Bool
$c== :: StartChangeSet -> StartChangeSet -> Bool
Prelude.Eq, ReadPrec [StartChangeSet]
ReadPrec StartChangeSet
Int -> ReadS StartChangeSet
ReadS [StartChangeSet]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartChangeSet]
$creadListPrec :: ReadPrec [StartChangeSet]
readPrec :: ReadPrec StartChangeSet
$creadPrec :: ReadPrec StartChangeSet
readList :: ReadS [StartChangeSet]
$creadList :: ReadS [StartChangeSet]
readsPrec :: Int -> ReadS StartChangeSet
$creadsPrec :: Int -> ReadS StartChangeSet
Prelude.Read, Int -> StartChangeSet -> ShowS
[StartChangeSet] -> ShowS
StartChangeSet -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartChangeSet] -> ShowS
$cshowList :: [StartChangeSet] -> ShowS
show :: StartChangeSet -> String
$cshow :: StartChangeSet -> String
showsPrec :: Int -> StartChangeSet -> ShowS
$cshowsPrec :: Int -> StartChangeSet -> ShowS
Prelude.Show, forall x. Rep StartChangeSet x -> StartChangeSet
forall x. StartChangeSet -> Rep StartChangeSet x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartChangeSet x -> StartChangeSet
$cfrom :: forall x. StartChangeSet -> Rep StartChangeSet x
Prelude.Generic)
newStartChangeSet ::
Prelude.Text ->
Prelude.NonEmpty Change ->
StartChangeSet
newStartChangeSet :: Text -> NonEmpty Change -> StartChangeSet
newStartChangeSet Text
pCatalog_ NonEmpty Change
pChangeSet_ =
StartChangeSet'
{ $sel:changeSetName:StartChangeSet' :: Maybe Text
changeSetName = forall a. Maybe a
Prelude.Nothing,
$sel:changeSetTags:StartChangeSet' :: Maybe (NonEmpty Tag)
changeSetTags = forall a. Maybe a
Prelude.Nothing,
$sel:clientRequestToken:StartChangeSet' :: Maybe Text
clientRequestToken = forall a. Maybe a
Prelude.Nothing,
$sel:catalog:StartChangeSet' :: Text
catalog = Text
pCatalog_,
$sel:changeSet:StartChangeSet' :: NonEmpty Change
changeSet = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Change
pChangeSet_
}
startChangeSet_changeSetName :: Lens.Lens' StartChangeSet (Prelude.Maybe Prelude.Text)
startChangeSet_changeSetName :: Lens' StartChangeSet (Maybe Text)
startChangeSet_changeSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSet' {Maybe Text
changeSetName :: Maybe Text
$sel:changeSetName:StartChangeSet' :: StartChangeSet -> Maybe Text
changeSetName} -> Maybe Text
changeSetName) (\s :: StartChangeSet
s@StartChangeSet' {} Maybe Text
a -> StartChangeSet
s {$sel:changeSetName:StartChangeSet' :: Maybe Text
changeSetName = Maybe Text
a} :: StartChangeSet)
startChangeSet_changeSetTags :: Lens.Lens' StartChangeSet (Prelude.Maybe (Prelude.NonEmpty Tag))
startChangeSet_changeSetTags :: Lens' StartChangeSet (Maybe (NonEmpty Tag))
startChangeSet_changeSetTags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSet' {Maybe (NonEmpty Tag)
changeSetTags :: Maybe (NonEmpty Tag)
$sel:changeSetTags:StartChangeSet' :: StartChangeSet -> Maybe (NonEmpty Tag)
changeSetTags} -> Maybe (NonEmpty Tag)
changeSetTags) (\s :: StartChangeSet
s@StartChangeSet' {} Maybe (NonEmpty Tag)
a -> StartChangeSet
s {$sel:changeSetTags:StartChangeSet' :: Maybe (NonEmpty Tag)
changeSetTags = Maybe (NonEmpty Tag)
a} :: StartChangeSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startChangeSet_clientRequestToken :: Lens.Lens' StartChangeSet (Prelude.Maybe Prelude.Text)
startChangeSet_clientRequestToken :: Lens' StartChangeSet (Maybe Text)
startChangeSet_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSet' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:StartChangeSet' :: StartChangeSet -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: StartChangeSet
s@StartChangeSet' {} Maybe Text
a -> StartChangeSet
s {$sel:clientRequestToken:StartChangeSet' :: Maybe Text
clientRequestToken = Maybe Text
a} :: StartChangeSet)
startChangeSet_catalog :: Lens.Lens' StartChangeSet Prelude.Text
startChangeSet_catalog :: Lens' StartChangeSet Text
startChangeSet_catalog = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSet' {Text
catalog :: Text
$sel:catalog:StartChangeSet' :: StartChangeSet -> Text
catalog} -> Text
catalog) (\s :: StartChangeSet
s@StartChangeSet' {} Text
a -> StartChangeSet
s {$sel:catalog:StartChangeSet' :: Text
catalog = Text
a} :: StartChangeSet)
startChangeSet_changeSet :: Lens.Lens' StartChangeSet (Prelude.NonEmpty Change)
startChangeSet_changeSet :: Lens' StartChangeSet (NonEmpty Change)
startChangeSet_changeSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSet' {NonEmpty Change
changeSet :: NonEmpty Change
$sel:changeSet:StartChangeSet' :: StartChangeSet -> NonEmpty Change
changeSet} -> NonEmpty Change
changeSet) (\s :: StartChangeSet
s@StartChangeSet' {} NonEmpty Change
a -> StartChangeSet
s {$sel:changeSet:StartChangeSet' :: NonEmpty Change
changeSet = NonEmpty Change
a} :: StartChangeSet) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest StartChangeSet where
type
AWSResponse StartChangeSet =
StartChangeSetResponse
request :: (Service -> Service) -> StartChangeSet -> Request StartChangeSet
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartChangeSet
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse StartChangeSet)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> StartChangeSetResponse
StartChangeSetResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ChangeSetArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ChangeSetId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable StartChangeSet where
hashWithSalt :: Int -> StartChangeSet -> Int
hashWithSalt Int
_salt StartChangeSet' {Maybe (NonEmpty Tag)
Maybe Text
NonEmpty Change
Text
changeSet :: NonEmpty Change
catalog :: Text
clientRequestToken :: Maybe Text
changeSetTags :: Maybe (NonEmpty Tag)
changeSetName :: Maybe Text
$sel:changeSet:StartChangeSet' :: StartChangeSet -> NonEmpty Change
$sel:catalog:StartChangeSet' :: StartChangeSet -> Text
$sel:clientRequestToken:StartChangeSet' :: StartChangeSet -> Maybe Text
$sel:changeSetTags:StartChangeSet' :: StartChangeSet -> Maybe (NonEmpty Tag)
$sel:changeSetName:StartChangeSet' :: StartChangeSet -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
changeSetName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
changeSetTags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientRequestToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
catalog
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Change
changeSet
instance Prelude.NFData StartChangeSet where
rnf :: StartChangeSet -> ()
rnf StartChangeSet' {Maybe (NonEmpty Tag)
Maybe Text
NonEmpty Change
Text
changeSet :: NonEmpty Change
catalog :: Text
clientRequestToken :: Maybe Text
changeSetTags :: Maybe (NonEmpty Tag)
changeSetName :: Maybe Text
$sel:changeSet:StartChangeSet' :: StartChangeSet -> NonEmpty Change
$sel:catalog:StartChangeSet' :: StartChangeSet -> Text
$sel:clientRequestToken:StartChangeSet' :: StartChangeSet -> Maybe Text
$sel:changeSetTags:StartChangeSet' :: StartChangeSet -> Maybe (NonEmpty Tag)
$sel:changeSetName:StartChangeSet' :: StartChangeSet -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
changeSetName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
changeSetTags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientRequestToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
catalog
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Change
changeSet
instance Data.ToHeaders StartChangeSet where
toHeaders :: StartChangeSet -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StartChangeSet where
toJSON :: StartChangeSet -> Value
toJSON StartChangeSet' {Maybe (NonEmpty Tag)
Maybe Text
NonEmpty Change
Text
changeSet :: NonEmpty Change
catalog :: Text
clientRequestToken :: Maybe Text
changeSetTags :: Maybe (NonEmpty Tag)
changeSetName :: Maybe Text
$sel:changeSet:StartChangeSet' :: StartChangeSet -> NonEmpty Change
$sel:catalog:StartChangeSet' :: StartChangeSet -> Text
$sel:clientRequestToken:StartChangeSet' :: StartChangeSet -> Maybe Text
$sel:changeSetTags:StartChangeSet' :: StartChangeSet -> Maybe (NonEmpty Tag)
$sel:changeSetName:StartChangeSet' :: StartChangeSet -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ChangeSetName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
changeSetName,
(Key
"ChangeSetTags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Tag)
changeSetTags,
(Key
"ClientRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
forall a. a -> Maybe a
Prelude.Just (Key
"Catalog" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
catalog),
forall a. a -> Maybe a
Prelude.Just (Key
"ChangeSet" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Change
changeSet)
]
)
instance Data.ToPath StartChangeSet where
toPath :: StartChangeSet -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/StartChangeSet"
instance Data.ToQuery StartChangeSet where
toQuery :: StartChangeSet -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartChangeSetResponse = StartChangeSetResponse'
{
StartChangeSetResponse -> Maybe Text
changeSetArn :: Prelude.Maybe Prelude.Text,
StartChangeSetResponse -> Maybe Text
changeSetId :: Prelude.Maybe Prelude.Text,
StartChangeSetResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartChangeSetResponse -> StartChangeSetResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartChangeSetResponse -> StartChangeSetResponse -> Bool
$c/= :: StartChangeSetResponse -> StartChangeSetResponse -> Bool
== :: StartChangeSetResponse -> StartChangeSetResponse -> Bool
$c== :: StartChangeSetResponse -> StartChangeSetResponse -> Bool
Prelude.Eq, ReadPrec [StartChangeSetResponse]
ReadPrec StartChangeSetResponse
Int -> ReadS StartChangeSetResponse
ReadS [StartChangeSetResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartChangeSetResponse]
$creadListPrec :: ReadPrec [StartChangeSetResponse]
readPrec :: ReadPrec StartChangeSetResponse
$creadPrec :: ReadPrec StartChangeSetResponse
readList :: ReadS [StartChangeSetResponse]
$creadList :: ReadS [StartChangeSetResponse]
readsPrec :: Int -> ReadS StartChangeSetResponse
$creadsPrec :: Int -> ReadS StartChangeSetResponse
Prelude.Read, Int -> StartChangeSetResponse -> ShowS
[StartChangeSetResponse] -> ShowS
StartChangeSetResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartChangeSetResponse] -> ShowS
$cshowList :: [StartChangeSetResponse] -> ShowS
show :: StartChangeSetResponse -> String
$cshow :: StartChangeSetResponse -> String
showsPrec :: Int -> StartChangeSetResponse -> ShowS
$cshowsPrec :: Int -> StartChangeSetResponse -> ShowS
Prelude.Show, forall x. Rep StartChangeSetResponse x -> StartChangeSetResponse
forall x. StartChangeSetResponse -> Rep StartChangeSetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartChangeSetResponse x -> StartChangeSetResponse
$cfrom :: forall x. StartChangeSetResponse -> Rep StartChangeSetResponse x
Prelude.Generic)
newStartChangeSetResponse ::
Prelude.Int ->
StartChangeSetResponse
newStartChangeSetResponse :: Int -> StartChangeSetResponse
newStartChangeSetResponse Int
pHttpStatus_ =
StartChangeSetResponse'
{ $sel:changeSetArn:StartChangeSetResponse' :: Maybe Text
changeSetArn =
forall a. Maybe a
Prelude.Nothing,
$sel:changeSetId:StartChangeSetResponse' :: Maybe Text
changeSetId = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartChangeSetResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startChangeSetResponse_changeSetArn :: Lens.Lens' StartChangeSetResponse (Prelude.Maybe Prelude.Text)
startChangeSetResponse_changeSetArn :: Lens' StartChangeSetResponse (Maybe Text)
startChangeSetResponse_changeSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSetResponse' {Maybe Text
changeSetArn :: Maybe Text
$sel:changeSetArn:StartChangeSetResponse' :: StartChangeSetResponse -> Maybe Text
changeSetArn} -> Maybe Text
changeSetArn) (\s :: StartChangeSetResponse
s@StartChangeSetResponse' {} Maybe Text
a -> StartChangeSetResponse
s {$sel:changeSetArn:StartChangeSetResponse' :: Maybe Text
changeSetArn = Maybe Text
a} :: StartChangeSetResponse)
startChangeSetResponse_changeSetId :: Lens.Lens' StartChangeSetResponse (Prelude.Maybe Prelude.Text)
startChangeSetResponse_changeSetId :: Lens' StartChangeSetResponse (Maybe Text)
startChangeSetResponse_changeSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSetResponse' {Maybe Text
changeSetId :: Maybe Text
$sel:changeSetId:StartChangeSetResponse' :: StartChangeSetResponse -> Maybe Text
changeSetId} -> Maybe Text
changeSetId) (\s :: StartChangeSetResponse
s@StartChangeSetResponse' {} Maybe Text
a -> StartChangeSetResponse
s {$sel:changeSetId:StartChangeSetResponse' :: Maybe Text
changeSetId = Maybe Text
a} :: StartChangeSetResponse)
startChangeSetResponse_httpStatus :: Lens.Lens' StartChangeSetResponse Prelude.Int
startChangeSetResponse_httpStatus :: Lens' StartChangeSetResponse Int
startChangeSetResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartChangeSetResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartChangeSetResponse' :: StartChangeSetResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartChangeSetResponse
s@StartChangeSetResponse' {} Int
a -> StartChangeSetResponse
s {$sel:httpStatus:StartChangeSetResponse' :: Int
httpStatus = Int
a} :: StartChangeSetResponse)
instance Prelude.NFData StartChangeSetResponse where
rnf :: StartChangeSetResponse -> ()
rnf StartChangeSetResponse' {Int
Maybe Text
httpStatus :: Int
changeSetId :: Maybe Text
changeSetArn :: Maybe Text
$sel:httpStatus:StartChangeSetResponse' :: StartChangeSetResponse -> Int
$sel:changeSetId:StartChangeSetResponse' :: StartChangeSetResponse -> Maybe Text
$sel:changeSetArn:StartChangeSetResponse' :: StartChangeSetResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
changeSetArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
changeSetId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus