{-# 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.Lightsail.ReleaseStaticIp
(
ReleaseStaticIp (..),
newReleaseStaticIp,
releaseStaticIp_staticIpName,
ReleaseStaticIpResponse (..),
newReleaseStaticIpResponse,
releaseStaticIpResponse_operations,
releaseStaticIpResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ReleaseStaticIp = ReleaseStaticIp'
{
ReleaseStaticIp -> Text
staticIpName :: Prelude.Text
}
deriving (ReleaseStaticIp -> ReleaseStaticIp -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReleaseStaticIp -> ReleaseStaticIp -> Bool
$c/= :: ReleaseStaticIp -> ReleaseStaticIp -> Bool
== :: ReleaseStaticIp -> ReleaseStaticIp -> Bool
$c== :: ReleaseStaticIp -> ReleaseStaticIp -> Bool
Prelude.Eq, ReadPrec [ReleaseStaticIp]
ReadPrec ReleaseStaticIp
Int -> ReadS ReleaseStaticIp
ReadS [ReleaseStaticIp]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReleaseStaticIp]
$creadListPrec :: ReadPrec [ReleaseStaticIp]
readPrec :: ReadPrec ReleaseStaticIp
$creadPrec :: ReadPrec ReleaseStaticIp
readList :: ReadS [ReleaseStaticIp]
$creadList :: ReadS [ReleaseStaticIp]
readsPrec :: Int -> ReadS ReleaseStaticIp
$creadsPrec :: Int -> ReadS ReleaseStaticIp
Prelude.Read, Int -> ReleaseStaticIp -> ShowS
[ReleaseStaticIp] -> ShowS
ReleaseStaticIp -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReleaseStaticIp] -> ShowS
$cshowList :: [ReleaseStaticIp] -> ShowS
show :: ReleaseStaticIp -> String
$cshow :: ReleaseStaticIp -> String
showsPrec :: Int -> ReleaseStaticIp -> ShowS
$cshowsPrec :: Int -> ReleaseStaticIp -> ShowS
Prelude.Show, forall x. Rep ReleaseStaticIp x -> ReleaseStaticIp
forall x. ReleaseStaticIp -> Rep ReleaseStaticIp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReleaseStaticIp x -> ReleaseStaticIp
$cfrom :: forall x. ReleaseStaticIp -> Rep ReleaseStaticIp x
Prelude.Generic)
newReleaseStaticIp ::
Prelude.Text ->
ReleaseStaticIp
newReleaseStaticIp :: Text -> ReleaseStaticIp
newReleaseStaticIp Text
pStaticIpName_ =
ReleaseStaticIp' {$sel:staticIpName:ReleaseStaticIp' :: Text
staticIpName = Text
pStaticIpName_}
releaseStaticIp_staticIpName :: Lens.Lens' ReleaseStaticIp Prelude.Text
releaseStaticIp_staticIpName :: Lens' ReleaseStaticIp Text
releaseStaticIp_staticIpName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReleaseStaticIp' {Text
staticIpName :: Text
$sel:staticIpName:ReleaseStaticIp' :: ReleaseStaticIp -> Text
staticIpName} -> Text
staticIpName) (\s :: ReleaseStaticIp
s@ReleaseStaticIp' {} Text
a -> ReleaseStaticIp
s {$sel:staticIpName:ReleaseStaticIp' :: Text
staticIpName = Text
a} :: ReleaseStaticIp)
instance Core.AWSRequest ReleaseStaticIp where
type
AWSResponse ReleaseStaticIp =
ReleaseStaticIpResponse
request :: (Service -> Service) -> ReleaseStaticIp -> Request ReleaseStaticIp
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 ReleaseStaticIp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ReleaseStaticIp)))
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 [Operation] -> Int -> ReleaseStaticIpResponse
ReleaseStaticIpResponse'
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
"operations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
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 ReleaseStaticIp where
hashWithSalt :: Int -> ReleaseStaticIp -> Int
hashWithSalt Int
_salt ReleaseStaticIp' {Text
staticIpName :: Text
$sel:staticIpName:ReleaseStaticIp' :: ReleaseStaticIp -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
staticIpName
instance Prelude.NFData ReleaseStaticIp where
rnf :: ReleaseStaticIp -> ()
rnf ReleaseStaticIp' {Text
staticIpName :: Text
$sel:staticIpName:ReleaseStaticIp' :: ReleaseStaticIp -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
staticIpName
instance Data.ToHeaders ReleaseStaticIp where
toHeaders :: ReleaseStaticIp -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.ReleaseStaticIp" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ReleaseStaticIp where
toJSON :: ReleaseStaticIp -> Value
toJSON ReleaseStaticIp' {Text
staticIpName :: Text
$sel:staticIpName:ReleaseStaticIp' :: ReleaseStaticIp -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"staticIpName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
staticIpName)]
)
instance Data.ToPath ReleaseStaticIp where
toPath :: ReleaseStaticIp -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ReleaseStaticIp where
toQuery :: ReleaseStaticIp -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ReleaseStaticIpResponse = ReleaseStaticIpResponse'
{
ReleaseStaticIpResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
ReleaseStaticIpResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ReleaseStaticIpResponse -> ReleaseStaticIpResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReleaseStaticIpResponse -> ReleaseStaticIpResponse -> Bool
$c/= :: ReleaseStaticIpResponse -> ReleaseStaticIpResponse -> Bool
== :: ReleaseStaticIpResponse -> ReleaseStaticIpResponse -> Bool
$c== :: ReleaseStaticIpResponse -> ReleaseStaticIpResponse -> Bool
Prelude.Eq, ReadPrec [ReleaseStaticIpResponse]
ReadPrec ReleaseStaticIpResponse
Int -> ReadS ReleaseStaticIpResponse
ReadS [ReleaseStaticIpResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReleaseStaticIpResponse]
$creadListPrec :: ReadPrec [ReleaseStaticIpResponse]
readPrec :: ReadPrec ReleaseStaticIpResponse
$creadPrec :: ReadPrec ReleaseStaticIpResponse
readList :: ReadS [ReleaseStaticIpResponse]
$creadList :: ReadS [ReleaseStaticIpResponse]
readsPrec :: Int -> ReadS ReleaseStaticIpResponse
$creadsPrec :: Int -> ReadS ReleaseStaticIpResponse
Prelude.Read, Int -> ReleaseStaticIpResponse -> ShowS
[ReleaseStaticIpResponse] -> ShowS
ReleaseStaticIpResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReleaseStaticIpResponse] -> ShowS
$cshowList :: [ReleaseStaticIpResponse] -> ShowS
show :: ReleaseStaticIpResponse -> String
$cshow :: ReleaseStaticIpResponse -> String
showsPrec :: Int -> ReleaseStaticIpResponse -> ShowS
$cshowsPrec :: Int -> ReleaseStaticIpResponse -> ShowS
Prelude.Show, forall x. Rep ReleaseStaticIpResponse x -> ReleaseStaticIpResponse
forall x. ReleaseStaticIpResponse -> Rep ReleaseStaticIpResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReleaseStaticIpResponse x -> ReleaseStaticIpResponse
$cfrom :: forall x. ReleaseStaticIpResponse -> Rep ReleaseStaticIpResponse x
Prelude.Generic)
newReleaseStaticIpResponse ::
Prelude.Int ->
ReleaseStaticIpResponse
newReleaseStaticIpResponse :: Int -> ReleaseStaticIpResponse
newReleaseStaticIpResponse Int
pHttpStatus_ =
ReleaseStaticIpResponse'
{ $sel:operations:ReleaseStaticIpResponse' :: Maybe [Operation]
operations =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ReleaseStaticIpResponse' :: Int
httpStatus = Int
pHttpStatus_
}
releaseStaticIpResponse_operations :: Lens.Lens' ReleaseStaticIpResponse (Prelude.Maybe [Operation])
releaseStaticIpResponse_operations :: Lens' ReleaseStaticIpResponse (Maybe [Operation])
releaseStaticIpResponse_operations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReleaseStaticIpResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:ReleaseStaticIpResponse' :: ReleaseStaticIpResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: ReleaseStaticIpResponse
s@ReleaseStaticIpResponse' {} Maybe [Operation]
a -> ReleaseStaticIpResponse
s {$sel:operations:ReleaseStaticIpResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: ReleaseStaticIpResponse) 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
releaseStaticIpResponse_httpStatus :: Lens.Lens' ReleaseStaticIpResponse Prelude.Int
releaseStaticIpResponse_httpStatus :: Lens' ReleaseStaticIpResponse Int
releaseStaticIpResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReleaseStaticIpResponse' {Int
httpStatus :: Int
$sel:httpStatus:ReleaseStaticIpResponse' :: ReleaseStaticIpResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ReleaseStaticIpResponse
s@ReleaseStaticIpResponse' {} Int
a -> ReleaseStaticIpResponse
s {$sel:httpStatus:ReleaseStaticIpResponse' :: Int
httpStatus = Int
a} :: ReleaseStaticIpResponse)
instance Prelude.NFData ReleaseStaticIpResponse where
rnf :: ReleaseStaticIpResponse -> ()
rnf ReleaseStaticIpResponse' {Int
Maybe [Operation]
httpStatus :: Int
operations :: Maybe [Operation]
$sel:httpStatus:ReleaseStaticIpResponse' :: ReleaseStaticIpResponse -> Int
$sel:operations:ReleaseStaticIpResponse' :: ReleaseStaticIpResponse -> Maybe [Operation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Operation]
operations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus