{-# 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.Organizations.EnableAllFeatures
(
EnableAllFeatures (..),
newEnableAllFeatures,
EnableAllFeaturesResponse (..),
newEnableAllFeaturesResponse,
enableAllFeaturesResponse_handshake,
enableAllFeaturesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Organizations.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data EnableAllFeatures = EnableAllFeatures'
{
}
deriving (EnableAllFeatures -> EnableAllFeatures -> Bool
(EnableAllFeatures -> EnableAllFeatures -> Bool)
-> (EnableAllFeatures -> EnableAllFeatures -> Bool)
-> Eq EnableAllFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableAllFeatures -> EnableAllFeatures -> Bool
$c/= :: EnableAllFeatures -> EnableAllFeatures -> Bool
== :: EnableAllFeatures -> EnableAllFeatures -> Bool
$c== :: EnableAllFeatures -> EnableAllFeatures -> Bool
Prelude.Eq, ReadPrec [EnableAllFeatures]
ReadPrec EnableAllFeatures
Int -> ReadS EnableAllFeatures
ReadS [EnableAllFeatures]
(Int -> ReadS EnableAllFeatures)
-> ReadS [EnableAllFeatures]
-> ReadPrec EnableAllFeatures
-> ReadPrec [EnableAllFeatures]
-> Read EnableAllFeatures
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableAllFeatures]
$creadListPrec :: ReadPrec [EnableAllFeatures]
readPrec :: ReadPrec EnableAllFeatures
$creadPrec :: ReadPrec EnableAllFeatures
readList :: ReadS [EnableAllFeatures]
$creadList :: ReadS [EnableAllFeatures]
readsPrec :: Int -> ReadS EnableAllFeatures
$creadsPrec :: Int -> ReadS EnableAllFeatures
Prelude.Read, Int -> EnableAllFeatures -> ShowS
[EnableAllFeatures] -> ShowS
EnableAllFeatures -> String
(Int -> EnableAllFeatures -> ShowS)
-> (EnableAllFeatures -> String)
-> ([EnableAllFeatures] -> ShowS)
-> Show EnableAllFeatures
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableAllFeatures] -> ShowS
$cshowList :: [EnableAllFeatures] -> ShowS
show :: EnableAllFeatures -> String
$cshow :: EnableAllFeatures -> String
showsPrec :: Int -> EnableAllFeatures -> ShowS
$cshowsPrec :: Int -> EnableAllFeatures -> ShowS
Prelude.Show, (forall x. EnableAllFeatures -> Rep EnableAllFeatures x)
-> (forall x. Rep EnableAllFeatures x -> EnableAllFeatures)
-> Generic EnableAllFeatures
forall x. Rep EnableAllFeatures x -> EnableAllFeatures
forall x. EnableAllFeatures -> Rep EnableAllFeatures x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableAllFeatures x -> EnableAllFeatures
$cfrom :: forall x. EnableAllFeatures -> Rep EnableAllFeatures x
Prelude.Generic)
newEnableAllFeatures ::
EnableAllFeatures
newEnableAllFeatures :: EnableAllFeatures
newEnableAllFeatures = EnableAllFeatures
EnableAllFeatures'
instance Core.AWSRequest EnableAllFeatures where
type
AWSResponse EnableAllFeatures =
EnableAllFeaturesResponse
request :: EnableAllFeatures -> Request EnableAllFeatures
request = Service -> EnableAllFeatures -> Request EnableAllFeatures
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy EnableAllFeatures
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableAllFeatures)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse EnableAllFeatures))
-> Logger
-> Service
-> Proxy EnableAllFeatures
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse EnableAllFeatures)))
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 Handshake -> Int -> EnableAllFeaturesResponse
EnableAllFeaturesResponse'
(Maybe Handshake -> Int -> EnableAllFeaturesResponse)
-> Either String (Maybe Handshake)
-> Either String (Int -> EnableAllFeaturesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Key -> Either String (Maybe Handshake)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"Handshake")
Either String (Int -> EnableAllFeaturesResponse)
-> Either String Int -> Either String EnableAllFeaturesResponse
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 EnableAllFeatures
instance Prelude.NFData EnableAllFeatures
instance Core.ToHeaders EnableAllFeatures where
toHeaders :: EnableAllFeatures -> ResponseHeaders
toHeaders =
ResponseHeaders -> EnableAllFeatures -> 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
"AWSOrganizationsV20161128.EnableAllFeatures" ::
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 EnableAllFeatures where
toJSON :: EnableAllFeatures -> Value
toJSON = Value -> EnableAllFeatures -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath EnableAllFeatures where
toPath :: EnableAllFeatures -> ByteString
toPath = ByteString -> EnableAllFeatures -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery EnableAllFeatures where
toQuery :: EnableAllFeatures -> QueryString
toQuery = QueryString -> EnableAllFeatures -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data EnableAllFeaturesResponse = EnableAllFeaturesResponse'
{
EnableAllFeaturesResponse -> Maybe Handshake
handshake :: Prelude.Maybe Handshake,
EnableAllFeaturesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (EnableAllFeaturesResponse -> EnableAllFeaturesResponse -> Bool
(EnableAllFeaturesResponse -> EnableAllFeaturesResponse -> Bool)
-> (EnableAllFeaturesResponse -> EnableAllFeaturesResponse -> Bool)
-> Eq EnableAllFeaturesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableAllFeaturesResponse -> EnableAllFeaturesResponse -> Bool
$c/= :: EnableAllFeaturesResponse -> EnableAllFeaturesResponse -> Bool
== :: EnableAllFeaturesResponse -> EnableAllFeaturesResponse -> Bool
$c== :: EnableAllFeaturesResponse -> EnableAllFeaturesResponse -> Bool
Prelude.Eq, Int -> EnableAllFeaturesResponse -> ShowS
[EnableAllFeaturesResponse] -> ShowS
EnableAllFeaturesResponse -> String
(Int -> EnableAllFeaturesResponse -> ShowS)
-> (EnableAllFeaturesResponse -> String)
-> ([EnableAllFeaturesResponse] -> ShowS)
-> Show EnableAllFeaturesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableAllFeaturesResponse] -> ShowS
$cshowList :: [EnableAllFeaturesResponse] -> ShowS
show :: EnableAllFeaturesResponse -> String
$cshow :: EnableAllFeaturesResponse -> String
showsPrec :: Int -> EnableAllFeaturesResponse -> ShowS
$cshowsPrec :: Int -> EnableAllFeaturesResponse -> ShowS
Prelude.Show, (forall x.
EnableAllFeaturesResponse -> Rep EnableAllFeaturesResponse x)
-> (forall x.
Rep EnableAllFeaturesResponse x -> EnableAllFeaturesResponse)
-> Generic EnableAllFeaturesResponse
forall x.
Rep EnableAllFeaturesResponse x -> EnableAllFeaturesResponse
forall x.
EnableAllFeaturesResponse -> Rep EnableAllFeaturesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableAllFeaturesResponse x -> EnableAllFeaturesResponse
$cfrom :: forall x.
EnableAllFeaturesResponse -> Rep EnableAllFeaturesResponse x
Prelude.Generic)
newEnableAllFeaturesResponse ::
Prelude.Int ->
EnableAllFeaturesResponse
newEnableAllFeaturesResponse :: Int -> EnableAllFeaturesResponse
newEnableAllFeaturesResponse Int
pHttpStatus_ =
EnableAllFeaturesResponse' :: Maybe Handshake -> Int -> EnableAllFeaturesResponse
EnableAllFeaturesResponse'
{ $sel:handshake:EnableAllFeaturesResponse' :: Maybe Handshake
handshake =
Maybe Handshake
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:EnableAllFeaturesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
enableAllFeaturesResponse_handshake :: Lens.Lens' EnableAllFeaturesResponse (Prelude.Maybe Handshake)
enableAllFeaturesResponse_handshake :: (Maybe Handshake -> f (Maybe Handshake))
-> EnableAllFeaturesResponse -> f EnableAllFeaturesResponse
enableAllFeaturesResponse_handshake = (EnableAllFeaturesResponse -> Maybe Handshake)
-> (EnableAllFeaturesResponse
-> Maybe Handshake -> EnableAllFeaturesResponse)
-> Lens
EnableAllFeaturesResponse
EnableAllFeaturesResponse
(Maybe Handshake)
(Maybe Handshake)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableAllFeaturesResponse' {Maybe Handshake
handshake :: Maybe Handshake
$sel:handshake:EnableAllFeaturesResponse' :: EnableAllFeaturesResponse -> Maybe Handshake
handshake} -> Maybe Handshake
handshake) (\s :: EnableAllFeaturesResponse
s@EnableAllFeaturesResponse' {} Maybe Handshake
a -> EnableAllFeaturesResponse
s {$sel:handshake:EnableAllFeaturesResponse' :: Maybe Handshake
handshake = Maybe Handshake
a} :: EnableAllFeaturesResponse)
enableAllFeaturesResponse_httpStatus :: Lens.Lens' EnableAllFeaturesResponse Prelude.Int
enableAllFeaturesResponse_httpStatus :: (Int -> f Int)
-> EnableAllFeaturesResponse -> f EnableAllFeaturesResponse
enableAllFeaturesResponse_httpStatus = (EnableAllFeaturesResponse -> Int)
-> (EnableAllFeaturesResponse -> Int -> EnableAllFeaturesResponse)
-> Lens EnableAllFeaturesResponse EnableAllFeaturesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableAllFeaturesResponse' {Int
httpStatus :: Int
$sel:httpStatus:EnableAllFeaturesResponse' :: EnableAllFeaturesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: EnableAllFeaturesResponse
s@EnableAllFeaturesResponse' {} Int
a -> EnableAllFeaturesResponse
s {$sel:httpStatus:EnableAllFeaturesResponse' :: Int
httpStatus = Int
a} :: EnableAllFeaturesResponse)
instance Prelude.NFData EnableAllFeaturesResponse