{-# 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.SMS.ImportAppCatalog
(
ImportAppCatalog (..),
newImportAppCatalog,
importAppCatalog_roleName,
ImportAppCatalogResponse (..),
newImportAppCatalogResponse,
importAppCatalogResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SMS.Types
data ImportAppCatalog = ImportAppCatalog'
{
ImportAppCatalog -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text
}
deriving (ImportAppCatalog -> ImportAppCatalog -> Bool
(ImportAppCatalog -> ImportAppCatalog -> Bool)
-> (ImportAppCatalog -> ImportAppCatalog -> Bool)
-> Eq ImportAppCatalog
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAppCatalog -> ImportAppCatalog -> Bool
$c/= :: ImportAppCatalog -> ImportAppCatalog -> Bool
== :: ImportAppCatalog -> ImportAppCatalog -> Bool
$c== :: ImportAppCatalog -> ImportAppCatalog -> Bool
Prelude.Eq, ReadPrec [ImportAppCatalog]
ReadPrec ImportAppCatalog
Int -> ReadS ImportAppCatalog
ReadS [ImportAppCatalog]
(Int -> ReadS ImportAppCatalog)
-> ReadS [ImportAppCatalog]
-> ReadPrec ImportAppCatalog
-> ReadPrec [ImportAppCatalog]
-> Read ImportAppCatalog
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAppCatalog]
$creadListPrec :: ReadPrec [ImportAppCatalog]
readPrec :: ReadPrec ImportAppCatalog
$creadPrec :: ReadPrec ImportAppCatalog
readList :: ReadS [ImportAppCatalog]
$creadList :: ReadS [ImportAppCatalog]
readsPrec :: Int -> ReadS ImportAppCatalog
$creadsPrec :: Int -> ReadS ImportAppCatalog
Prelude.Read, Int -> ImportAppCatalog -> ShowS
[ImportAppCatalog] -> ShowS
ImportAppCatalog -> String
(Int -> ImportAppCatalog -> ShowS)
-> (ImportAppCatalog -> String)
-> ([ImportAppCatalog] -> ShowS)
-> Show ImportAppCatalog
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAppCatalog] -> ShowS
$cshowList :: [ImportAppCatalog] -> ShowS
show :: ImportAppCatalog -> String
$cshow :: ImportAppCatalog -> String
showsPrec :: Int -> ImportAppCatalog -> ShowS
$cshowsPrec :: Int -> ImportAppCatalog -> ShowS
Prelude.Show, (forall x. ImportAppCatalog -> Rep ImportAppCatalog x)
-> (forall x. Rep ImportAppCatalog x -> ImportAppCatalog)
-> Generic ImportAppCatalog
forall x. Rep ImportAppCatalog x -> ImportAppCatalog
forall x. ImportAppCatalog -> Rep ImportAppCatalog x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportAppCatalog x -> ImportAppCatalog
$cfrom :: forall x. ImportAppCatalog -> Rep ImportAppCatalog x
Prelude.Generic)
newImportAppCatalog ::
ImportAppCatalog
newImportAppCatalog :: ImportAppCatalog
newImportAppCatalog =
ImportAppCatalog' :: Maybe Text -> ImportAppCatalog
ImportAppCatalog' {$sel:roleName:ImportAppCatalog' :: Maybe Text
roleName = Maybe Text
forall a. Maybe a
Prelude.Nothing}
importAppCatalog_roleName :: Lens.Lens' ImportAppCatalog (Prelude.Maybe Prelude.Text)
importAppCatalog_roleName :: (Maybe Text -> f (Maybe Text))
-> ImportAppCatalog -> f ImportAppCatalog
importAppCatalog_roleName = (ImportAppCatalog -> Maybe Text)
-> (ImportAppCatalog -> Maybe Text -> ImportAppCatalog)
-> Lens ImportAppCatalog ImportAppCatalog (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAppCatalog' {Maybe Text
roleName :: Maybe Text
$sel:roleName:ImportAppCatalog' :: ImportAppCatalog -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: ImportAppCatalog
s@ImportAppCatalog' {} Maybe Text
a -> ImportAppCatalog
s {$sel:roleName:ImportAppCatalog' :: Maybe Text
roleName = Maybe Text
a} :: ImportAppCatalog)
instance Core.AWSRequest ImportAppCatalog where
type
AWSResponse ImportAppCatalog =
ImportAppCatalogResponse
request :: ImportAppCatalog -> Request ImportAppCatalog
request = Service -> ImportAppCatalog -> Request ImportAppCatalog
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ImportAppCatalog
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ImportAppCatalog)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse ImportAppCatalog))
-> Logger
-> Service
-> Proxy ImportAppCatalog
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ImportAppCatalog)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> ImportAppCatalogResponse
ImportAppCatalogResponse'
(Int -> ImportAppCatalogResponse)
-> Either String Int -> Either String ImportAppCatalogResponse
forall (f :: * -> *) a b. Functor 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 ImportAppCatalog
instance Prelude.NFData ImportAppCatalog
instance Core.ToHeaders ImportAppCatalog where
toHeaders :: ImportAppCatalog -> ResponseHeaders
toHeaders =
ResponseHeaders -> ImportAppCatalog -> 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
"AWSServerMigrationService_V2016_10_24.ImportAppCatalog" ::
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 ImportAppCatalog where
toJSON :: ImportAppCatalog -> Value
toJSON ImportAppCatalog' {Maybe Text
roleName :: Maybe Text
$sel:roleName:ImportAppCatalog' :: ImportAppCatalog -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"roleName" 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
roleName]
)
instance Core.ToPath ImportAppCatalog where
toPath :: ImportAppCatalog -> ByteString
toPath = ByteString -> ImportAppCatalog -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ImportAppCatalog where
toQuery :: ImportAppCatalog -> QueryString
toQuery = QueryString -> ImportAppCatalog -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ImportAppCatalogResponse = ImportAppCatalogResponse'
{
ImportAppCatalogResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ImportAppCatalogResponse -> ImportAppCatalogResponse -> Bool
(ImportAppCatalogResponse -> ImportAppCatalogResponse -> Bool)
-> (ImportAppCatalogResponse -> ImportAppCatalogResponse -> Bool)
-> Eq ImportAppCatalogResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAppCatalogResponse -> ImportAppCatalogResponse -> Bool
$c/= :: ImportAppCatalogResponse -> ImportAppCatalogResponse -> Bool
== :: ImportAppCatalogResponse -> ImportAppCatalogResponse -> Bool
$c== :: ImportAppCatalogResponse -> ImportAppCatalogResponse -> Bool
Prelude.Eq, ReadPrec [ImportAppCatalogResponse]
ReadPrec ImportAppCatalogResponse
Int -> ReadS ImportAppCatalogResponse
ReadS [ImportAppCatalogResponse]
(Int -> ReadS ImportAppCatalogResponse)
-> ReadS [ImportAppCatalogResponse]
-> ReadPrec ImportAppCatalogResponse
-> ReadPrec [ImportAppCatalogResponse]
-> Read ImportAppCatalogResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAppCatalogResponse]
$creadListPrec :: ReadPrec [ImportAppCatalogResponse]
readPrec :: ReadPrec ImportAppCatalogResponse
$creadPrec :: ReadPrec ImportAppCatalogResponse
readList :: ReadS [ImportAppCatalogResponse]
$creadList :: ReadS [ImportAppCatalogResponse]
readsPrec :: Int -> ReadS ImportAppCatalogResponse
$creadsPrec :: Int -> ReadS ImportAppCatalogResponse
Prelude.Read, Int -> ImportAppCatalogResponse -> ShowS
[ImportAppCatalogResponse] -> ShowS
ImportAppCatalogResponse -> String
(Int -> ImportAppCatalogResponse -> ShowS)
-> (ImportAppCatalogResponse -> String)
-> ([ImportAppCatalogResponse] -> ShowS)
-> Show ImportAppCatalogResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAppCatalogResponse] -> ShowS
$cshowList :: [ImportAppCatalogResponse] -> ShowS
show :: ImportAppCatalogResponse -> String
$cshow :: ImportAppCatalogResponse -> String
showsPrec :: Int -> ImportAppCatalogResponse -> ShowS
$cshowsPrec :: Int -> ImportAppCatalogResponse -> ShowS
Prelude.Show, (forall x.
ImportAppCatalogResponse -> Rep ImportAppCatalogResponse x)
-> (forall x.
Rep ImportAppCatalogResponse x -> ImportAppCatalogResponse)
-> Generic ImportAppCatalogResponse
forall x.
Rep ImportAppCatalogResponse x -> ImportAppCatalogResponse
forall x.
ImportAppCatalogResponse -> Rep ImportAppCatalogResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportAppCatalogResponse x -> ImportAppCatalogResponse
$cfrom :: forall x.
ImportAppCatalogResponse -> Rep ImportAppCatalogResponse x
Prelude.Generic)
newImportAppCatalogResponse ::
Prelude.Int ->
ImportAppCatalogResponse
newImportAppCatalogResponse :: Int -> ImportAppCatalogResponse
newImportAppCatalogResponse Int
pHttpStatus_ =
ImportAppCatalogResponse' :: Int -> ImportAppCatalogResponse
ImportAppCatalogResponse'
{ $sel:httpStatus:ImportAppCatalogResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
importAppCatalogResponse_httpStatus :: Lens.Lens' ImportAppCatalogResponse Prelude.Int
importAppCatalogResponse_httpStatus :: (Int -> f Int)
-> ImportAppCatalogResponse -> f ImportAppCatalogResponse
importAppCatalogResponse_httpStatus = (ImportAppCatalogResponse -> Int)
-> (ImportAppCatalogResponse -> Int -> ImportAppCatalogResponse)
-> Lens ImportAppCatalogResponse ImportAppCatalogResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAppCatalogResponse' {Int
httpStatus :: Int
$sel:httpStatus:ImportAppCatalogResponse' :: ImportAppCatalogResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ImportAppCatalogResponse
s@ImportAppCatalogResponse' {} Int
a -> ImportAppCatalogResponse
s {$sel:httpStatus:ImportAppCatalogResponse' :: Int
httpStatus = Int
a} :: ImportAppCatalogResponse)
instance Prelude.NFData ImportAppCatalogResponse