{-# 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.SSM.DeleteParameters
(
DeleteParameters (..),
newDeleteParameters,
deleteParameters_names,
DeleteParametersResponse (..),
newDeleteParametersResponse,
deleteParametersResponse_deletedParameters,
deleteParametersResponse_invalidParameters,
deleteParametersResponse_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.SSM.Types
data DeleteParameters = DeleteParameters'
{
DeleteParameters -> NonEmpty Text
names :: Prelude.NonEmpty Prelude.Text
}
deriving (DeleteParameters -> DeleteParameters -> Bool
(DeleteParameters -> DeleteParameters -> Bool)
-> (DeleteParameters -> DeleteParameters -> Bool)
-> Eq DeleteParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteParameters -> DeleteParameters -> Bool
$c/= :: DeleteParameters -> DeleteParameters -> Bool
== :: DeleteParameters -> DeleteParameters -> Bool
$c== :: DeleteParameters -> DeleteParameters -> Bool
Prelude.Eq, ReadPrec [DeleteParameters]
ReadPrec DeleteParameters
Int -> ReadS DeleteParameters
ReadS [DeleteParameters]
(Int -> ReadS DeleteParameters)
-> ReadS [DeleteParameters]
-> ReadPrec DeleteParameters
-> ReadPrec [DeleteParameters]
-> Read DeleteParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteParameters]
$creadListPrec :: ReadPrec [DeleteParameters]
readPrec :: ReadPrec DeleteParameters
$creadPrec :: ReadPrec DeleteParameters
readList :: ReadS [DeleteParameters]
$creadList :: ReadS [DeleteParameters]
readsPrec :: Int -> ReadS DeleteParameters
$creadsPrec :: Int -> ReadS DeleteParameters
Prelude.Read, Int -> DeleteParameters -> ShowS
[DeleteParameters] -> ShowS
DeleteParameters -> String
(Int -> DeleteParameters -> ShowS)
-> (DeleteParameters -> String)
-> ([DeleteParameters] -> ShowS)
-> Show DeleteParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteParameters] -> ShowS
$cshowList :: [DeleteParameters] -> ShowS
show :: DeleteParameters -> String
$cshow :: DeleteParameters -> String
showsPrec :: Int -> DeleteParameters -> ShowS
$cshowsPrec :: Int -> DeleteParameters -> ShowS
Prelude.Show, (forall x. DeleteParameters -> Rep DeleteParameters x)
-> (forall x. Rep DeleteParameters x -> DeleteParameters)
-> Generic DeleteParameters
forall x. Rep DeleteParameters x -> DeleteParameters
forall x. DeleteParameters -> Rep DeleteParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteParameters x -> DeleteParameters
$cfrom :: forall x. DeleteParameters -> Rep DeleteParameters x
Prelude.Generic)
newDeleteParameters ::
Prelude.NonEmpty Prelude.Text ->
DeleteParameters
newDeleteParameters :: NonEmpty Text -> DeleteParameters
newDeleteParameters NonEmpty Text
pNames_ =
DeleteParameters' :: NonEmpty Text -> DeleteParameters
DeleteParameters'
{ $sel:names:DeleteParameters' :: NonEmpty Text
names =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pNames_
}
deleteParameters_names :: Lens.Lens' DeleteParameters (Prelude.NonEmpty Prelude.Text)
deleteParameters_names :: (NonEmpty Text -> f (NonEmpty Text))
-> DeleteParameters -> f DeleteParameters
deleteParameters_names = (DeleteParameters -> NonEmpty Text)
-> (DeleteParameters -> NonEmpty Text -> DeleteParameters)
-> Lens
DeleteParameters DeleteParameters (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteParameters' {NonEmpty Text
names :: NonEmpty Text
$sel:names:DeleteParameters' :: DeleteParameters -> NonEmpty Text
names} -> NonEmpty Text
names) (\s :: DeleteParameters
s@DeleteParameters' {} NonEmpty Text
a -> DeleteParameters
s {$sel:names:DeleteParameters' :: NonEmpty Text
names = NonEmpty Text
a} :: DeleteParameters) ((NonEmpty Text -> f (NonEmpty Text))
-> DeleteParameters -> f DeleteParameters)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> DeleteParameters
-> f DeleteParameters
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DeleteParameters where
type
AWSResponse DeleteParameters =
DeleteParametersResponse
request :: DeleteParameters -> Request DeleteParameters
request = Service -> DeleteParameters -> Request DeleteParameters
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteParameters
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteParameters)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteParameters))
-> Logger
-> Service
-> Proxy DeleteParameters
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteParameters)))
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 (NonEmpty Text)
-> Maybe (NonEmpty Text) -> Int -> DeleteParametersResponse
DeleteParametersResponse'
(Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text) -> Int -> DeleteParametersResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either
String (Maybe (NonEmpty Text) -> Int -> DeleteParametersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeletedParameters")
Either
String (Maybe (NonEmpty Text) -> Int -> DeleteParametersResponse)
-> Either String (Maybe (NonEmpty Text))
-> Either String (Int -> DeleteParametersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InvalidParameters")
Either String (Int -> DeleteParametersResponse)
-> Either String Int -> Either String DeleteParametersResponse
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 DeleteParameters
instance Prelude.NFData DeleteParameters
instance Core.ToHeaders DeleteParameters where
toHeaders :: DeleteParameters -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteParameters -> 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
"AmazonSSM.DeleteParameters" :: 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 DeleteParameters where
toJSON :: DeleteParameters -> Value
toJSON DeleteParameters' {NonEmpty Text
names :: NonEmpty Text
$sel:names:DeleteParameters' :: DeleteParameters -> NonEmpty Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Names" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
names)]
)
instance Core.ToPath DeleteParameters where
toPath :: DeleteParameters -> ByteString
toPath = ByteString -> DeleteParameters -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteParameters where
toQuery :: DeleteParameters -> QueryString
toQuery = QueryString -> DeleteParameters -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteParametersResponse = DeleteParametersResponse'
{
DeleteParametersResponse -> Maybe (NonEmpty Text)
deletedParameters :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
DeleteParametersResponse -> Maybe (NonEmpty Text)
invalidParameters :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
DeleteParametersResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteParametersResponse -> DeleteParametersResponse -> Bool
(DeleteParametersResponse -> DeleteParametersResponse -> Bool)
-> (DeleteParametersResponse -> DeleteParametersResponse -> Bool)
-> Eq DeleteParametersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteParametersResponse -> DeleteParametersResponse -> Bool
$c/= :: DeleteParametersResponse -> DeleteParametersResponse -> Bool
== :: DeleteParametersResponse -> DeleteParametersResponse -> Bool
$c== :: DeleteParametersResponse -> DeleteParametersResponse -> Bool
Prelude.Eq, ReadPrec [DeleteParametersResponse]
ReadPrec DeleteParametersResponse
Int -> ReadS DeleteParametersResponse
ReadS [DeleteParametersResponse]
(Int -> ReadS DeleteParametersResponse)
-> ReadS [DeleteParametersResponse]
-> ReadPrec DeleteParametersResponse
-> ReadPrec [DeleteParametersResponse]
-> Read DeleteParametersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteParametersResponse]
$creadListPrec :: ReadPrec [DeleteParametersResponse]
readPrec :: ReadPrec DeleteParametersResponse
$creadPrec :: ReadPrec DeleteParametersResponse
readList :: ReadS [DeleteParametersResponse]
$creadList :: ReadS [DeleteParametersResponse]
readsPrec :: Int -> ReadS DeleteParametersResponse
$creadsPrec :: Int -> ReadS DeleteParametersResponse
Prelude.Read, Int -> DeleteParametersResponse -> ShowS
[DeleteParametersResponse] -> ShowS
DeleteParametersResponse -> String
(Int -> DeleteParametersResponse -> ShowS)
-> (DeleteParametersResponse -> String)
-> ([DeleteParametersResponse] -> ShowS)
-> Show DeleteParametersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteParametersResponse] -> ShowS
$cshowList :: [DeleteParametersResponse] -> ShowS
show :: DeleteParametersResponse -> String
$cshow :: DeleteParametersResponse -> String
showsPrec :: Int -> DeleteParametersResponse -> ShowS
$cshowsPrec :: Int -> DeleteParametersResponse -> ShowS
Prelude.Show, (forall x.
DeleteParametersResponse -> Rep DeleteParametersResponse x)
-> (forall x.
Rep DeleteParametersResponse x -> DeleteParametersResponse)
-> Generic DeleteParametersResponse
forall x.
Rep DeleteParametersResponse x -> DeleteParametersResponse
forall x.
DeleteParametersResponse -> Rep DeleteParametersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteParametersResponse x -> DeleteParametersResponse
$cfrom :: forall x.
DeleteParametersResponse -> Rep DeleteParametersResponse x
Prelude.Generic)
newDeleteParametersResponse ::
Prelude.Int ->
DeleteParametersResponse
newDeleteParametersResponse :: Int -> DeleteParametersResponse
newDeleteParametersResponse Int
pHttpStatus_ =
DeleteParametersResponse' :: Maybe (NonEmpty Text)
-> Maybe (NonEmpty Text) -> Int -> DeleteParametersResponse
DeleteParametersResponse'
{ $sel:deletedParameters:DeleteParametersResponse' :: Maybe (NonEmpty Text)
deletedParameters =
Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:invalidParameters:DeleteParametersResponse' :: Maybe (NonEmpty Text)
invalidParameters = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteParametersResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteParametersResponse_deletedParameters :: Lens.Lens' DeleteParametersResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
deleteParametersResponse_deletedParameters :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DeleteParametersResponse -> f DeleteParametersResponse
deleteParametersResponse_deletedParameters = (DeleteParametersResponse -> Maybe (NonEmpty Text))
-> (DeleteParametersResponse
-> Maybe (NonEmpty Text) -> DeleteParametersResponse)
-> Lens
DeleteParametersResponse
DeleteParametersResponse
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteParametersResponse' {Maybe (NonEmpty Text)
deletedParameters :: Maybe (NonEmpty Text)
$sel:deletedParameters:DeleteParametersResponse' :: DeleteParametersResponse -> Maybe (NonEmpty Text)
deletedParameters} -> Maybe (NonEmpty Text)
deletedParameters) (\s :: DeleteParametersResponse
s@DeleteParametersResponse' {} Maybe (NonEmpty Text)
a -> DeleteParametersResponse
s {$sel:deletedParameters:DeleteParametersResponse' :: Maybe (NonEmpty Text)
deletedParameters = Maybe (NonEmpty Text)
a} :: DeleteParametersResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DeleteParametersResponse -> f DeleteParametersResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DeleteParametersResponse
-> f DeleteParametersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteParametersResponse_invalidParameters :: Lens.Lens' DeleteParametersResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
deleteParametersResponse_invalidParameters :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DeleteParametersResponse -> f DeleteParametersResponse
deleteParametersResponse_invalidParameters = (DeleteParametersResponse -> Maybe (NonEmpty Text))
-> (DeleteParametersResponse
-> Maybe (NonEmpty Text) -> DeleteParametersResponse)
-> Lens
DeleteParametersResponse
DeleteParametersResponse
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteParametersResponse' {Maybe (NonEmpty Text)
invalidParameters :: Maybe (NonEmpty Text)
$sel:invalidParameters:DeleteParametersResponse' :: DeleteParametersResponse -> Maybe (NonEmpty Text)
invalidParameters} -> Maybe (NonEmpty Text)
invalidParameters) (\s :: DeleteParametersResponse
s@DeleteParametersResponse' {} Maybe (NonEmpty Text)
a -> DeleteParametersResponse
s {$sel:invalidParameters:DeleteParametersResponse' :: Maybe (NonEmpty Text)
invalidParameters = Maybe (NonEmpty Text)
a} :: DeleteParametersResponse) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DeleteParametersResponse -> f DeleteParametersResponse)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> DeleteParametersResponse
-> f DeleteParametersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteParametersResponse_httpStatus :: Lens.Lens' DeleteParametersResponse Prelude.Int
deleteParametersResponse_httpStatus :: (Int -> f Int)
-> DeleteParametersResponse -> f DeleteParametersResponse
deleteParametersResponse_httpStatus = (DeleteParametersResponse -> Int)
-> (DeleteParametersResponse -> Int -> DeleteParametersResponse)
-> Lens DeleteParametersResponse DeleteParametersResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteParametersResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteParametersResponse' :: DeleteParametersResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteParametersResponse
s@DeleteParametersResponse' {} Int
a -> DeleteParametersResponse
s {$sel:httpStatus:DeleteParametersResponse' :: Int
httpStatus = Int
a} :: DeleteParametersResponse)
instance Prelude.NFData DeleteParametersResponse