{-# 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.EFS.PutAccountPreferences
(
PutAccountPreferences (..),
newPutAccountPreferences,
putAccountPreferences_resourceIdType,
PutAccountPreferencesResponse (..),
newPutAccountPreferencesResponse,
putAccountPreferencesResponse_resourceIdPreference,
putAccountPreferencesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EFS.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutAccountPreferences = PutAccountPreferences'
{
PutAccountPreferences -> ResourceIdType
resourceIdType :: ResourceIdType
}
deriving (PutAccountPreferences -> PutAccountPreferences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountPreferences -> PutAccountPreferences -> Bool
$c/= :: PutAccountPreferences -> PutAccountPreferences -> Bool
== :: PutAccountPreferences -> PutAccountPreferences -> Bool
$c== :: PutAccountPreferences -> PutAccountPreferences -> Bool
Prelude.Eq, ReadPrec [PutAccountPreferences]
ReadPrec PutAccountPreferences
Int -> ReadS PutAccountPreferences
ReadS [PutAccountPreferences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountPreferences]
$creadListPrec :: ReadPrec [PutAccountPreferences]
readPrec :: ReadPrec PutAccountPreferences
$creadPrec :: ReadPrec PutAccountPreferences
readList :: ReadS [PutAccountPreferences]
$creadList :: ReadS [PutAccountPreferences]
readsPrec :: Int -> ReadS PutAccountPreferences
$creadsPrec :: Int -> ReadS PutAccountPreferences
Prelude.Read, Int -> PutAccountPreferences -> ShowS
[PutAccountPreferences] -> ShowS
PutAccountPreferences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountPreferences] -> ShowS
$cshowList :: [PutAccountPreferences] -> ShowS
show :: PutAccountPreferences -> String
$cshow :: PutAccountPreferences -> String
showsPrec :: Int -> PutAccountPreferences -> ShowS
$cshowsPrec :: Int -> PutAccountPreferences -> ShowS
Prelude.Show, forall x. Rep PutAccountPreferences x -> PutAccountPreferences
forall x. PutAccountPreferences -> Rep PutAccountPreferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAccountPreferences x -> PutAccountPreferences
$cfrom :: forall x. PutAccountPreferences -> Rep PutAccountPreferences x
Prelude.Generic)
newPutAccountPreferences ::
ResourceIdType ->
PutAccountPreferences
newPutAccountPreferences :: ResourceIdType -> PutAccountPreferences
newPutAccountPreferences ResourceIdType
pResourceIdType_ =
PutAccountPreferences'
{ $sel:resourceIdType:PutAccountPreferences' :: ResourceIdType
resourceIdType =
ResourceIdType
pResourceIdType_
}
putAccountPreferences_resourceIdType :: Lens.Lens' PutAccountPreferences ResourceIdType
putAccountPreferences_resourceIdType :: Lens' PutAccountPreferences ResourceIdType
putAccountPreferences_resourceIdType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountPreferences' {ResourceIdType
resourceIdType :: ResourceIdType
$sel:resourceIdType:PutAccountPreferences' :: PutAccountPreferences -> ResourceIdType
resourceIdType} -> ResourceIdType
resourceIdType) (\s :: PutAccountPreferences
s@PutAccountPreferences' {} ResourceIdType
a -> PutAccountPreferences
s {$sel:resourceIdType:PutAccountPreferences' :: ResourceIdType
resourceIdType = ResourceIdType
a} :: PutAccountPreferences)
instance Core.AWSRequest PutAccountPreferences where
type
AWSResponse PutAccountPreferences =
PutAccountPreferencesResponse
request :: (Service -> Service)
-> PutAccountPreferences -> Request PutAccountPreferences
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutAccountPreferences
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutAccountPreferences)))
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 ResourceIdPreference -> Int -> PutAccountPreferencesResponse
PutAccountPreferencesResponse'
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
"ResourceIdPreference")
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 PutAccountPreferences where
hashWithSalt :: Int -> PutAccountPreferences -> Int
hashWithSalt Int
_salt PutAccountPreferences' {ResourceIdType
resourceIdType :: ResourceIdType
$sel:resourceIdType:PutAccountPreferences' :: PutAccountPreferences -> ResourceIdType
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ResourceIdType
resourceIdType
instance Prelude.NFData PutAccountPreferences where
rnf :: PutAccountPreferences -> ()
rnf PutAccountPreferences' {ResourceIdType
resourceIdType :: ResourceIdType
$sel:resourceIdType:PutAccountPreferences' :: PutAccountPreferences -> ResourceIdType
..} =
forall a. NFData a => a -> ()
Prelude.rnf ResourceIdType
resourceIdType
instance Data.ToHeaders PutAccountPreferences where
toHeaders :: PutAccountPreferences -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON PutAccountPreferences where
toJSON :: PutAccountPreferences -> Value
toJSON PutAccountPreferences' {ResourceIdType
resourceIdType :: ResourceIdType
$sel:resourceIdType:PutAccountPreferences' :: PutAccountPreferences -> ResourceIdType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"ResourceIdType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ResourceIdType
resourceIdType)
]
)
instance Data.ToPath PutAccountPreferences where
toPath :: PutAccountPreferences -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/2015-02-01/account-preferences"
instance Data.ToQuery PutAccountPreferences where
toQuery :: PutAccountPreferences -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutAccountPreferencesResponse = PutAccountPreferencesResponse'
{ PutAccountPreferencesResponse -> Maybe ResourceIdPreference
resourceIdPreference :: Prelude.Maybe ResourceIdPreference,
PutAccountPreferencesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutAccountPreferencesResponse
-> PutAccountPreferencesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountPreferencesResponse
-> PutAccountPreferencesResponse -> Bool
$c/= :: PutAccountPreferencesResponse
-> PutAccountPreferencesResponse -> Bool
== :: PutAccountPreferencesResponse
-> PutAccountPreferencesResponse -> Bool
$c== :: PutAccountPreferencesResponse
-> PutAccountPreferencesResponse -> Bool
Prelude.Eq, ReadPrec [PutAccountPreferencesResponse]
ReadPrec PutAccountPreferencesResponse
Int -> ReadS PutAccountPreferencesResponse
ReadS [PutAccountPreferencesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountPreferencesResponse]
$creadListPrec :: ReadPrec [PutAccountPreferencesResponse]
readPrec :: ReadPrec PutAccountPreferencesResponse
$creadPrec :: ReadPrec PutAccountPreferencesResponse
readList :: ReadS [PutAccountPreferencesResponse]
$creadList :: ReadS [PutAccountPreferencesResponse]
readsPrec :: Int -> ReadS PutAccountPreferencesResponse
$creadsPrec :: Int -> ReadS PutAccountPreferencesResponse
Prelude.Read, Int -> PutAccountPreferencesResponse -> ShowS
[PutAccountPreferencesResponse] -> ShowS
PutAccountPreferencesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountPreferencesResponse] -> ShowS
$cshowList :: [PutAccountPreferencesResponse] -> ShowS
show :: PutAccountPreferencesResponse -> String
$cshow :: PutAccountPreferencesResponse -> String
showsPrec :: Int -> PutAccountPreferencesResponse -> ShowS
$cshowsPrec :: Int -> PutAccountPreferencesResponse -> ShowS
Prelude.Show, forall x.
Rep PutAccountPreferencesResponse x
-> PutAccountPreferencesResponse
forall x.
PutAccountPreferencesResponse
-> Rep PutAccountPreferencesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccountPreferencesResponse x
-> PutAccountPreferencesResponse
$cfrom :: forall x.
PutAccountPreferencesResponse
-> Rep PutAccountPreferencesResponse x
Prelude.Generic)
newPutAccountPreferencesResponse ::
Prelude.Int ->
PutAccountPreferencesResponse
newPutAccountPreferencesResponse :: Int -> PutAccountPreferencesResponse
newPutAccountPreferencesResponse Int
pHttpStatus_ =
PutAccountPreferencesResponse'
{ $sel:resourceIdPreference:PutAccountPreferencesResponse' :: Maybe ResourceIdPreference
resourceIdPreference =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutAccountPreferencesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putAccountPreferencesResponse_resourceIdPreference :: Lens.Lens' PutAccountPreferencesResponse (Prelude.Maybe ResourceIdPreference)
putAccountPreferencesResponse_resourceIdPreference :: Lens' PutAccountPreferencesResponse (Maybe ResourceIdPreference)
putAccountPreferencesResponse_resourceIdPreference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountPreferencesResponse' {Maybe ResourceIdPreference
resourceIdPreference :: Maybe ResourceIdPreference
$sel:resourceIdPreference:PutAccountPreferencesResponse' :: PutAccountPreferencesResponse -> Maybe ResourceIdPreference
resourceIdPreference} -> Maybe ResourceIdPreference
resourceIdPreference) (\s :: PutAccountPreferencesResponse
s@PutAccountPreferencesResponse' {} Maybe ResourceIdPreference
a -> PutAccountPreferencesResponse
s {$sel:resourceIdPreference:PutAccountPreferencesResponse' :: Maybe ResourceIdPreference
resourceIdPreference = Maybe ResourceIdPreference
a} :: PutAccountPreferencesResponse)
putAccountPreferencesResponse_httpStatus :: Lens.Lens' PutAccountPreferencesResponse Prelude.Int
putAccountPreferencesResponse_httpStatus :: Lens' PutAccountPreferencesResponse Int
putAccountPreferencesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountPreferencesResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAccountPreferencesResponse' :: PutAccountPreferencesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutAccountPreferencesResponse
s@PutAccountPreferencesResponse' {} Int
a -> PutAccountPreferencesResponse
s {$sel:httpStatus:PutAccountPreferencesResponse' :: Int
httpStatus = Int
a} :: PutAccountPreferencesResponse)
instance Prelude.NFData PutAccountPreferencesResponse where
rnf :: PutAccountPreferencesResponse -> ()
rnf PutAccountPreferencesResponse' {Int
Maybe ResourceIdPreference
httpStatus :: Int
resourceIdPreference :: Maybe ResourceIdPreference
$sel:httpStatus:PutAccountPreferencesResponse' :: PutAccountPreferencesResponse -> Int
$sel:resourceIdPreference:PutAccountPreferencesResponse' :: PutAccountPreferencesResponse -> Maybe ResourceIdPreference
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceIdPreference
resourceIdPreference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus