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