{-# 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.IoT.DeleteBillingGroup
(
DeleteBillingGroup (..),
newDeleteBillingGroup,
deleteBillingGroup_expectedVersion,
deleteBillingGroup_billingGroupName,
DeleteBillingGroupResponse (..),
newDeleteBillingGroupResponse,
deleteBillingGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoT.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 DeleteBillingGroup = DeleteBillingGroup'
{
DeleteBillingGroup -> Maybe Integer
expectedVersion :: Prelude.Maybe Prelude.Integer,
DeleteBillingGroup -> Text
billingGroupName :: Prelude.Text
}
deriving (DeleteBillingGroup -> DeleteBillingGroup -> Bool
(DeleteBillingGroup -> DeleteBillingGroup -> Bool)
-> (DeleteBillingGroup -> DeleteBillingGroup -> Bool)
-> Eq DeleteBillingGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBillingGroup -> DeleteBillingGroup -> Bool
$c/= :: DeleteBillingGroup -> DeleteBillingGroup -> Bool
== :: DeleteBillingGroup -> DeleteBillingGroup -> Bool
$c== :: DeleteBillingGroup -> DeleteBillingGroup -> Bool
Prelude.Eq, ReadPrec [DeleteBillingGroup]
ReadPrec DeleteBillingGroup
Int -> ReadS DeleteBillingGroup
ReadS [DeleteBillingGroup]
(Int -> ReadS DeleteBillingGroup)
-> ReadS [DeleteBillingGroup]
-> ReadPrec DeleteBillingGroup
-> ReadPrec [DeleteBillingGroup]
-> Read DeleteBillingGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBillingGroup]
$creadListPrec :: ReadPrec [DeleteBillingGroup]
readPrec :: ReadPrec DeleteBillingGroup
$creadPrec :: ReadPrec DeleteBillingGroup
readList :: ReadS [DeleteBillingGroup]
$creadList :: ReadS [DeleteBillingGroup]
readsPrec :: Int -> ReadS DeleteBillingGroup
$creadsPrec :: Int -> ReadS DeleteBillingGroup
Prelude.Read, Int -> DeleteBillingGroup -> ShowS
[DeleteBillingGroup] -> ShowS
DeleteBillingGroup -> String
(Int -> DeleteBillingGroup -> ShowS)
-> (DeleteBillingGroup -> String)
-> ([DeleteBillingGroup] -> ShowS)
-> Show DeleteBillingGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBillingGroup] -> ShowS
$cshowList :: [DeleteBillingGroup] -> ShowS
show :: DeleteBillingGroup -> String
$cshow :: DeleteBillingGroup -> String
showsPrec :: Int -> DeleteBillingGroup -> ShowS
$cshowsPrec :: Int -> DeleteBillingGroup -> ShowS
Prelude.Show, (forall x. DeleteBillingGroup -> Rep DeleteBillingGroup x)
-> (forall x. Rep DeleteBillingGroup x -> DeleteBillingGroup)
-> Generic DeleteBillingGroup
forall x. Rep DeleteBillingGroup x -> DeleteBillingGroup
forall x. DeleteBillingGroup -> Rep DeleteBillingGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBillingGroup x -> DeleteBillingGroup
$cfrom :: forall x. DeleteBillingGroup -> Rep DeleteBillingGroup x
Prelude.Generic)
newDeleteBillingGroup ::
Prelude.Text ->
DeleteBillingGroup
newDeleteBillingGroup :: Text -> DeleteBillingGroup
newDeleteBillingGroup Text
pBillingGroupName_ =
DeleteBillingGroup' :: Maybe Integer -> Text -> DeleteBillingGroup
DeleteBillingGroup'
{ $sel:expectedVersion:DeleteBillingGroup' :: Maybe Integer
expectedVersion =
Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:billingGroupName:DeleteBillingGroup' :: Text
billingGroupName = Text
pBillingGroupName_
}
deleteBillingGroup_expectedVersion :: Lens.Lens' DeleteBillingGroup (Prelude.Maybe Prelude.Integer)
deleteBillingGroup_expectedVersion :: (Maybe Integer -> f (Maybe Integer))
-> DeleteBillingGroup -> f DeleteBillingGroup
deleteBillingGroup_expectedVersion = (DeleteBillingGroup -> Maybe Integer)
-> (DeleteBillingGroup -> Maybe Integer -> DeleteBillingGroup)
-> Lens
DeleteBillingGroup
DeleteBillingGroup
(Maybe Integer)
(Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBillingGroup' {Maybe Integer
expectedVersion :: Maybe Integer
$sel:expectedVersion:DeleteBillingGroup' :: DeleteBillingGroup -> Maybe Integer
expectedVersion} -> Maybe Integer
expectedVersion) (\s :: DeleteBillingGroup
s@DeleteBillingGroup' {} Maybe Integer
a -> DeleteBillingGroup
s {$sel:expectedVersion:DeleteBillingGroup' :: Maybe Integer
expectedVersion = Maybe Integer
a} :: DeleteBillingGroup)
deleteBillingGroup_billingGroupName :: Lens.Lens' DeleteBillingGroup Prelude.Text
deleteBillingGroup_billingGroupName :: (Text -> f Text) -> DeleteBillingGroup -> f DeleteBillingGroup
deleteBillingGroup_billingGroupName = (DeleteBillingGroup -> Text)
-> (DeleteBillingGroup -> Text -> DeleteBillingGroup)
-> Lens DeleteBillingGroup DeleteBillingGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBillingGroup' {Text
billingGroupName :: Text
$sel:billingGroupName:DeleteBillingGroup' :: DeleteBillingGroup -> Text
billingGroupName} -> Text
billingGroupName) (\s :: DeleteBillingGroup
s@DeleteBillingGroup' {} Text
a -> DeleteBillingGroup
s {$sel:billingGroupName:DeleteBillingGroup' :: Text
billingGroupName = Text
a} :: DeleteBillingGroup)
instance Core.AWSRequest DeleteBillingGroup where
type
AWSResponse DeleteBillingGroup =
DeleteBillingGroupResponse
request :: DeleteBillingGroup -> Request DeleteBillingGroup
request = Service -> DeleteBillingGroup -> Request DeleteBillingGroup
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteBillingGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteBillingGroup)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteBillingGroup))
-> Logger
-> Service
-> Proxy DeleteBillingGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteBillingGroup)))
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 -> DeleteBillingGroupResponse
DeleteBillingGroupResponse'
(Int -> DeleteBillingGroupResponse)
-> Either String Int -> Either String DeleteBillingGroupResponse
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 DeleteBillingGroup
instance Prelude.NFData DeleteBillingGroup
instance Core.ToHeaders DeleteBillingGroup where
toHeaders :: DeleteBillingGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> DeleteBillingGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath DeleteBillingGroup where
toPath :: DeleteBillingGroup -> ByteString
toPath DeleteBillingGroup' {Maybe Integer
Text
billingGroupName :: Text
expectedVersion :: Maybe Integer
$sel:billingGroupName:DeleteBillingGroup' :: DeleteBillingGroup -> Text
$sel:expectedVersion:DeleteBillingGroup' :: DeleteBillingGroup -> Maybe Integer
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/billing-groups/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
billingGroupName]
instance Core.ToQuery DeleteBillingGroup where
toQuery :: DeleteBillingGroup -> QueryString
toQuery DeleteBillingGroup' {Maybe Integer
Text
billingGroupName :: Text
expectedVersion :: Maybe Integer
$sel:billingGroupName:DeleteBillingGroup' :: DeleteBillingGroup -> Text
$sel:expectedVersion:DeleteBillingGroup' :: DeleteBillingGroup -> Maybe Integer
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"expectedVersion" ByteString -> Maybe Integer -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Integer
expectedVersion]
data DeleteBillingGroupResponse = DeleteBillingGroupResponse'
{
DeleteBillingGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteBillingGroupResponse -> DeleteBillingGroupResponse -> Bool
(DeleteBillingGroupResponse -> DeleteBillingGroupResponse -> Bool)
-> (DeleteBillingGroupResponse
-> DeleteBillingGroupResponse -> Bool)
-> Eq DeleteBillingGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBillingGroupResponse -> DeleteBillingGroupResponse -> Bool
$c/= :: DeleteBillingGroupResponse -> DeleteBillingGroupResponse -> Bool
== :: DeleteBillingGroupResponse -> DeleteBillingGroupResponse -> Bool
$c== :: DeleteBillingGroupResponse -> DeleteBillingGroupResponse -> Bool
Prelude.Eq, ReadPrec [DeleteBillingGroupResponse]
ReadPrec DeleteBillingGroupResponse
Int -> ReadS DeleteBillingGroupResponse
ReadS [DeleteBillingGroupResponse]
(Int -> ReadS DeleteBillingGroupResponse)
-> ReadS [DeleteBillingGroupResponse]
-> ReadPrec DeleteBillingGroupResponse
-> ReadPrec [DeleteBillingGroupResponse]
-> Read DeleteBillingGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBillingGroupResponse]
$creadListPrec :: ReadPrec [DeleteBillingGroupResponse]
readPrec :: ReadPrec DeleteBillingGroupResponse
$creadPrec :: ReadPrec DeleteBillingGroupResponse
readList :: ReadS [DeleteBillingGroupResponse]
$creadList :: ReadS [DeleteBillingGroupResponse]
readsPrec :: Int -> ReadS DeleteBillingGroupResponse
$creadsPrec :: Int -> ReadS DeleteBillingGroupResponse
Prelude.Read, Int -> DeleteBillingGroupResponse -> ShowS
[DeleteBillingGroupResponse] -> ShowS
DeleteBillingGroupResponse -> String
(Int -> DeleteBillingGroupResponse -> ShowS)
-> (DeleteBillingGroupResponse -> String)
-> ([DeleteBillingGroupResponse] -> ShowS)
-> Show DeleteBillingGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBillingGroupResponse] -> ShowS
$cshowList :: [DeleteBillingGroupResponse] -> ShowS
show :: DeleteBillingGroupResponse -> String
$cshow :: DeleteBillingGroupResponse -> String
showsPrec :: Int -> DeleteBillingGroupResponse -> ShowS
$cshowsPrec :: Int -> DeleteBillingGroupResponse -> ShowS
Prelude.Show, (forall x.
DeleteBillingGroupResponse -> Rep DeleteBillingGroupResponse x)
-> (forall x.
Rep DeleteBillingGroupResponse x -> DeleteBillingGroupResponse)
-> Generic DeleteBillingGroupResponse
forall x.
Rep DeleteBillingGroupResponse x -> DeleteBillingGroupResponse
forall x.
DeleteBillingGroupResponse -> Rep DeleteBillingGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteBillingGroupResponse x -> DeleteBillingGroupResponse
$cfrom :: forall x.
DeleteBillingGroupResponse -> Rep DeleteBillingGroupResponse x
Prelude.Generic)
newDeleteBillingGroupResponse ::
Prelude.Int ->
DeleteBillingGroupResponse
newDeleteBillingGroupResponse :: Int -> DeleteBillingGroupResponse
newDeleteBillingGroupResponse Int
pHttpStatus_ =
DeleteBillingGroupResponse' :: Int -> DeleteBillingGroupResponse
DeleteBillingGroupResponse'
{ $sel:httpStatus:DeleteBillingGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteBillingGroupResponse_httpStatus :: Lens.Lens' DeleteBillingGroupResponse Prelude.Int
deleteBillingGroupResponse_httpStatus :: (Int -> f Int)
-> DeleteBillingGroupResponse -> f DeleteBillingGroupResponse
deleteBillingGroupResponse_httpStatus = (DeleteBillingGroupResponse -> Int)
-> (DeleteBillingGroupResponse
-> Int -> DeleteBillingGroupResponse)
-> Lens
DeleteBillingGroupResponse DeleteBillingGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBillingGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteBillingGroupResponse' :: DeleteBillingGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteBillingGroupResponse
s@DeleteBillingGroupResponse' {} Int
a -> DeleteBillingGroupResponse
s {$sel:httpStatus:DeleteBillingGroupResponse' :: Int
httpStatus = Int
a} :: DeleteBillingGroupResponse)
instance Prelude.NFData DeleteBillingGroupResponse