{-# 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.XRay.DeleteSamplingRule
(
DeleteSamplingRule (..),
newDeleteSamplingRule,
deleteSamplingRule_ruleName,
deleteSamplingRule_ruleARN,
DeleteSamplingRuleResponse (..),
newDeleteSamplingRuleResponse,
deleteSamplingRuleResponse_samplingRuleRecord,
deleteSamplingRuleResponse_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.XRay.Types
data DeleteSamplingRule = DeleteSamplingRule'
{
DeleteSamplingRule -> Maybe Text
ruleName :: Prelude.Maybe Prelude.Text,
DeleteSamplingRule -> Maybe Text
ruleARN :: Prelude.Maybe Prelude.Text
}
deriving (DeleteSamplingRule -> DeleteSamplingRule -> Bool
(DeleteSamplingRule -> DeleteSamplingRule -> Bool)
-> (DeleteSamplingRule -> DeleteSamplingRule -> Bool)
-> Eq DeleteSamplingRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSamplingRule -> DeleteSamplingRule -> Bool
$c/= :: DeleteSamplingRule -> DeleteSamplingRule -> Bool
== :: DeleteSamplingRule -> DeleteSamplingRule -> Bool
$c== :: DeleteSamplingRule -> DeleteSamplingRule -> Bool
Prelude.Eq, ReadPrec [DeleteSamplingRule]
ReadPrec DeleteSamplingRule
Int -> ReadS DeleteSamplingRule
ReadS [DeleteSamplingRule]
(Int -> ReadS DeleteSamplingRule)
-> ReadS [DeleteSamplingRule]
-> ReadPrec DeleteSamplingRule
-> ReadPrec [DeleteSamplingRule]
-> Read DeleteSamplingRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSamplingRule]
$creadListPrec :: ReadPrec [DeleteSamplingRule]
readPrec :: ReadPrec DeleteSamplingRule
$creadPrec :: ReadPrec DeleteSamplingRule
readList :: ReadS [DeleteSamplingRule]
$creadList :: ReadS [DeleteSamplingRule]
readsPrec :: Int -> ReadS DeleteSamplingRule
$creadsPrec :: Int -> ReadS DeleteSamplingRule
Prelude.Read, Int -> DeleteSamplingRule -> ShowS
[DeleteSamplingRule] -> ShowS
DeleteSamplingRule -> String
(Int -> DeleteSamplingRule -> ShowS)
-> (DeleteSamplingRule -> String)
-> ([DeleteSamplingRule] -> ShowS)
-> Show DeleteSamplingRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSamplingRule] -> ShowS
$cshowList :: [DeleteSamplingRule] -> ShowS
show :: DeleteSamplingRule -> String
$cshow :: DeleteSamplingRule -> String
showsPrec :: Int -> DeleteSamplingRule -> ShowS
$cshowsPrec :: Int -> DeleteSamplingRule -> ShowS
Prelude.Show, (forall x. DeleteSamplingRule -> Rep DeleteSamplingRule x)
-> (forall x. Rep DeleteSamplingRule x -> DeleteSamplingRule)
-> Generic DeleteSamplingRule
forall x. Rep DeleteSamplingRule x -> DeleteSamplingRule
forall x. DeleteSamplingRule -> Rep DeleteSamplingRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteSamplingRule x -> DeleteSamplingRule
$cfrom :: forall x. DeleteSamplingRule -> Rep DeleteSamplingRule x
Prelude.Generic)
newDeleteSamplingRule ::
DeleteSamplingRule
newDeleteSamplingRule :: DeleteSamplingRule
newDeleteSamplingRule =
DeleteSamplingRule' :: Maybe Text -> Maybe Text -> DeleteSamplingRule
DeleteSamplingRule'
{ $sel:ruleName:DeleteSamplingRule' :: Maybe Text
ruleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ruleARN:DeleteSamplingRule' :: Maybe Text
ruleARN = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deleteSamplingRule_ruleName :: Lens.Lens' DeleteSamplingRule (Prelude.Maybe Prelude.Text)
deleteSamplingRule_ruleName :: (Maybe Text -> f (Maybe Text))
-> DeleteSamplingRule -> f DeleteSamplingRule
deleteSamplingRule_ruleName = (DeleteSamplingRule -> Maybe Text)
-> (DeleteSamplingRule -> Maybe Text -> DeleteSamplingRule)
-> Lens
DeleteSamplingRule DeleteSamplingRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSamplingRule' {Maybe Text
ruleName :: Maybe Text
$sel:ruleName:DeleteSamplingRule' :: DeleteSamplingRule -> Maybe Text
ruleName} -> Maybe Text
ruleName) (\s :: DeleteSamplingRule
s@DeleteSamplingRule' {} Maybe Text
a -> DeleteSamplingRule
s {$sel:ruleName:DeleteSamplingRule' :: Maybe Text
ruleName = Maybe Text
a} :: DeleteSamplingRule)
deleteSamplingRule_ruleARN :: Lens.Lens' DeleteSamplingRule (Prelude.Maybe Prelude.Text)
deleteSamplingRule_ruleARN :: (Maybe Text -> f (Maybe Text))
-> DeleteSamplingRule -> f DeleteSamplingRule
deleteSamplingRule_ruleARN = (DeleteSamplingRule -> Maybe Text)
-> (DeleteSamplingRule -> Maybe Text -> DeleteSamplingRule)
-> Lens
DeleteSamplingRule DeleteSamplingRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSamplingRule' {Maybe Text
ruleARN :: Maybe Text
$sel:ruleARN:DeleteSamplingRule' :: DeleteSamplingRule -> Maybe Text
ruleARN} -> Maybe Text
ruleARN) (\s :: DeleteSamplingRule
s@DeleteSamplingRule' {} Maybe Text
a -> DeleteSamplingRule
s {$sel:ruleARN:DeleteSamplingRule' :: Maybe Text
ruleARN = Maybe Text
a} :: DeleteSamplingRule)
instance Core.AWSRequest DeleteSamplingRule where
type
AWSResponse DeleteSamplingRule =
DeleteSamplingRuleResponse
request :: DeleteSamplingRule -> Request DeleteSamplingRule
request = Service -> DeleteSamplingRule -> Request DeleteSamplingRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteSamplingRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSamplingRule)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteSamplingRule))
-> Logger
-> Service
-> Proxy DeleteSamplingRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteSamplingRule)))
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 SamplingRuleRecord -> Int -> DeleteSamplingRuleResponse
DeleteSamplingRuleResponse'
(Maybe SamplingRuleRecord -> Int -> DeleteSamplingRuleResponse)
-> Either String (Maybe SamplingRuleRecord)
-> Either String (Int -> DeleteSamplingRuleResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe SamplingRuleRecord)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SamplingRuleRecord")
Either String (Int -> DeleteSamplingRuleResponse)
-> Either String Int -> Either String DeleteSamplingRuleResponse
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 DeleteSamplingRule
instance Prelude.NFData DeleteSamplingRule
instance Core.ToHeaders DeleteSamplingRule where
toHeaders :: DeleteSamplingRule -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteSamplingRule -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON DeleteSamplingRule where
toJSON :: DeleteSamplingRule -> Value
toJSON DeleteSamplingRule' {Maybe Text
ruleARN :: Maybe Text
ruleName :: Maybe Text
$sel:ruleARN:DeleteSamplingRule' :: DeleteSamplingRule -> Maybe Text
$sel:ruleName:DeleteSamplingRule' :: DeleteSamplingRule -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"RuleName" 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
ruleName,
(Text
"RuleARN" 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
ruleARN
]
)
instance Core.ToPath DeleteSamplingRule where
toPath :: DeleteSamplingRule -> ByteString
toPath = ByteString -> DeleteSamplingRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/DeleteSamplingRule"
instance Core.ToQuery DeleteSamplingRule where
toQuery :: DeleteSamplingRule -> QueryString
toQuery = QueryString -> DeleteSamplingRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteSamplingRuleResponse = DeleteSamplingRuleResponse'
{
DeleteSamplingRuleResponse -> Maybe SamplingRuleRecord
samplingRuleRecord :: Prelude.Maybe SamplingRuleRecord,
DeleteSamplingRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteSamplingRuleResponse -> DeleteSamplingRuleResponse -> Bool
(DeleteSamplingRuleResponse -> DeleteSamplingRuleResponse -> Bool)
-> (DeleteSamplingRuleResponse
-> DeleteSamplingRuleResponse -> Bool)
-> Eq DeleteSamplingRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteSamplingRuleResponse -> DeleteSamplingRuleResponse -> Bool
$c/= :: DeleteSamplingRuleResponse -> DeleteSamplingRuleResponse -> Bool
== :: DeleteSamplingRuleResponse -> DeleteSamplingRuleResponse -> Bool
$c== :: DeleteSamplingRuleResponse -> DeleteSamplingRuleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteSamplingRuleResponse]
ReadPrec DeleteSamplingRuleResponse
Int -> ReadS DeleteSamplingRuleResponse
ReadS [DeleteSamplingRuleResponse]
(Int -> ReadS DeleteSamplingRuleResponse)
-> ReadS [DeleteSamplingRuleResponse]
-> ReadPrec DeleteSamplingRuleResponse
-> ReadPrec [DeleteSamplingRuleResponse]
-> Read DeleteSamplingRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteSamplingRuleResponse]
$creadListPrec :: ReadPrec [DeleteSamplingRuleResponse]
readPrec :: ReadPrec DeleteSamplingRuleResponse
$creadPrec :: ReadPrec DeleteSamplingRuleResponse
readList :: ReadS [DeleteSamplingRuleResponse]
$creadList :: ReadS [DeleteSamplingRuleResponse]
readsPrec :: Int -> ReadS DeleteSamplingRuleResponse
$creadsPrec :: Int -> ReadS DeleteSamplingRuleResponse
Prelude.Read, Int -> DeleteSamplingRuleResponse -> ShowS
[DeleteSamplingRuleResponse] -> ShowS
DeleteSamplingRuleResponse -> String
(Int -> DeleteSamplingRuleResponse -> ShowS)
-> (DeleteSamplingRuleResponse -> String)
-> ([DeleteSamplingRuleResponse] -> ShowS)
-> Show DeleteSamplingRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteSamplingRuleResponse] -> ShowS
$cshowList :: [DeleteSamplingRuleResponse] -> ShowS
show :: DeleteSamplingRuleResponse -> String
$cshow :: DeleteSamplingRuleResponse -> String
showsPrec :: Int -> DeleteSamplingRuleResponse -> ShowS
$cshowsPrec :: Int -> DeleteSamplingRuleResponse -> ShowS
Prelude.Show, (forall x.
DeleteSamplingRuleResponse -> Rep DeleteSamplingRuleResponse x)
-> (forall x.
Rep DeleteSamplingRuleResponse x -> DeleteSamplingRuleResponse)
-> Generic DeleteSamplingRuleResponse
forall x.
Rep DeleteSamplingRuleResponse x -> DeleteSamplingRuleResponse
forall x.
DeleteSamplingRuleResponse -> Rep DeleteSamplingRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteSamplingRuleResponse x -> DeleteSamplingRuleResponse
$cfrom :: forall x.
DeleteSamplingRuleResponse -> Rep DeleteSamplingRuleResponse x
Prelude.Generic)
newDeleteSamplingRuleResponse ::
Prelude.Int ->
DeleteSamplingRuleResponse
newDeleteSamplingRuleResponse :: Int -> DeleteSamplingRuleResponse
newDeleteSamplingRuleResponse Int
pHttpStatus_ =
DeleteSamplingRuleResponse' :: Maybe SamplingRuleRecord -> Int -> DeleteSamplingRuleResponse
DeleteSamplingRuleResponse'
{ $sel:samplingRuleRecord:DeleteSamplingRuleResponse' :: Maybe SamplingRuleRecord
samplingRuleRecord =
Maybe SamplingRuleRecord
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteSamplingRuleResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteSamplingRuleResponse_samplingRuleRecord :: Lens.Lens' DeleteSamplingRuleResponse (Prelude.Maybe SamplingRuleRecord)
deleteSamplingRuleResponse_samplingRuleRecord :: (Maybe SamplingRuleRecord -> f (Maybe SamplingRuleRecord))
-> DeleteSamplingRuleResponse -> f DeleteSamplingRuleResponse
deleteSamplingRuleResponse_samplingRuleRecord = (DeleteSamplingRuleResponse -> Maybe SamplingRuleRecord)
-> (DeleteSamplingRuleResponse
-> Maybe SamplingRuleRecord -> DeleteSamplingRuleResponse)
-> Lens
DeleteSamplingRuleResponse
DeleteSamplingRuleResponse
(Maybe SamplingRuleRecord)
(Maybe SamplingRuleRecord)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSamplingRuleResponse' {Maybe SamplingRuleRecord
samplingRuleRecord :: Maybe SamplingRuleRecord
$sel:samplingRuleRecord:DeleteSamplingRuleResponse' :: DeleteSamplingRuleResponse -> Maybe SamplingRuleRecord
samplingRuleRecord} -> Maybe SamplingRuleRecord
samplingRuleRecord) (\s :: DeleteSamplingRuleResponse
s@DeleteSamplingRuleResponse' {} Maybe SamplingRuleRecord
a -> DeleteSamplingRuleResponse
s {$sel:samplingRuleRecord:DeleteSamplingRuleResponse' :: Maybe SamplingRuleRecord
samplingRuleRecord = Maybe SamplingRuleRecord
a} :: DeleteSamplingRuleResponse)
deleteSamplingRuleResponse_httpStatus :: Lens.Lens' DeleteSamplingRuleResponse Prelude.Int
deleteSamplingRuleResponse_httpStatus :: (Int -> f Int)
-> DeleteSamplingRuleResponse -> f DeleteSamplingRuleResponse
deleteSamplingRuleResponse_httpStatus = (DeleteSamplingRuleResponse -> Int)
-> (DeleteSamplingRuleResponse
-> Int -> DeleteSamplingRuleResponse)
-> Lens
DeleteSamplingRuleResponse DeleteSamplingRuleResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteSamplingRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteSamplingRuleResponse' :: DeleteSamplingRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteSamplingRuleResponse
s@DeleteSamplingRuleResponse' {} Int
a -> DeleteSamplingRuleResponse
s {$sel:httpStatus:DeleteSamplingRuleResponse' :: Int
httpStatus = Int
a} :: DeleteSamplingRuleResponse)
instance Prelude.NFData DeleteSamplingRuleResponse