{-# 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.ServiceCatalogAppRegistry.AssociateAttributeGroup
(
AssociateAttributeGroup (..),
newAssociateAttributeGroup,
associateAttributeGroup_application,
associateAttributeGroup_attributeGroup,
AssociateAttributeGroupResponse (..),
newAssociateAttributeGroupResponse,
associateAttributeGroupResponse_applicationArn,
associateAttributeGroupResponse_attributeGroupArn,
associateAttributeGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalogAppRegistry.Types
data AssociateAttributeGroup = AssociateAttributeGroup'
{
AssociateAttributeGroup -> Text
application :: Prelude.Text,
AssociateAttributeGroup -> Text
attributeGroup :: Prelude.Text
}
deriving (AssociateAttributeGroup -> AssociateAttributeGroup -> Bool
(AssociateAttributeGroup -> AssociateAttributeGroup -> Bool)
-> (AssociateAttributeGroup -> AssociateAttributeGroup -> Bool)
-> Eq AssociateAttributeGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateAttributeGroup -> AssociateAttributeGroup -> Bool
$c/= :: AssociateAttributeGroup -> AssociateAttributeGroup -> Bool
== :: AssociateAttributeGroup -> AssociateAttributeGroup -> Bool
$c== :: AssociateAttributeGroup -> AssociateAttributeGroup -> Bool
Prelude.Eq, ReadPrec [AssociateAttributeGroup]
ReadPrec AssociateAttributeGroup
Int -> ReadS AssociateAttributeGroup
ReadS [AssociateAttributeGroup]
(Int -> ReadS AssociateAttributeGroup)
-> ReadS [AssociateAttributeGroup]
-> ReadPrec AssociateAttributeGroup
-> ReadPrec [AssociateAttributeGroup]
-> Read AssociateAttributeGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateAttributeGroup]
$creadListPrec :: ReadPrec [AssociateAttributeGroup]
readPrec :: ReadPrec AssociateAttributeGroup
$creadPrec :: ReadPrec AssociateAttributeGroup
readList :: ReadS [AssociateAttributeGroup]
$creadList :: ReadS [AssociateAttributeGroup]
readsPrec :: Int -> ReadS AssociateAttributeGroup
$creadsPrec :: Int -> ReadS AssociateAttributeGroup
Prelude.Read, Int -> AssociateAttributeGroup -> ShowS
[AssociateAttributeGroup] -> ShowS
AssociateAttributeGroup -> String
(Int -> AssociateAttributeGroup -> ShowS)
-> (AssociateAttributeGroup -> String)
-> ([AssociateAttributeGroup] -> ShowS)
-> Show AssociateAttributeGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateAttributeGroup] -> ShowS
$cshowList :: [AssociateAttributeGroup] -> ShowS
show :: AssociateAttributeGroup -> String
$cshow :: AssociateAttributeGroup -> String
showsPrec :: Int -> AssociateAttributeGroup -> ShowS
$cshowsPrec :: Int -> AssociateAttributeGroup -> ShowS
Prelude.Show, (forall x.
AssociateAttributeGroup -> Rep AssociateAttributeGroup x)
-> (forall x.
Rep AssociateAttributeGroup x -> AssociateAttributeGroup)
-> Generic AssociateAttributeGroup
forall x. Rep AssociateAttributeGroup x -> AssociateAttributeGroup
forall x. AssociateAttributeGroup -> Rep AssociateAttributeGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateAttributeGroup x -> AssociateAttributeGroup
$cfrom :: forall x. AssociateAttributeGroup -> Rep AssociateAttributeGroup x
Prelude.Generic)
newAssociateAttributeGroup ::
Prelude.Text ->
Prelude.Text ->
AssociateAttributeGroup
newAssociateAttributeGroup :: Text -> Text -> AssociateAttributeGroup
newAssociateAttributeGroup
Text
pApplication_
Text
pAttributeGroup_ =
AssociateAttributeGroup' :: Text -> Text -> AssociateAttributeGroup
AssociateAttributeGroup'
{ $sel:application:AssociateAttributeGroup' :: Text
application =
Text
pApplication_,
$sel:attributeGroup:AssociateAttributeGroup' :: Text
attributeGroup = Text
pAttributeGroup_
}
associateAttributeGroup_application :: Lens.Lens' AssociateAttributeGroup Prelude.Text
associateAttributeGroup_application :: (Text -> f Text)
-> AssociateAttributeGroup -> f AssociateAttributeGroup
associateAttributeGroup_application = (AssociateAttributeGroup -> Text)
-> (AssociateAttributeGroup -> Text -> AssociateAttributeGroup)
-> Lens AssociateAttributeGroup AssociateAttributeGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAttributeGroup' {Text
application :: Text
$sel:application:AssociateAttributeGroup' :: AssociateAttributeGroup -> Text
application} -> Text
application) (\s :: AssociateAttributeGroup
s@AssociateAttributeGroup' {} Text
a -> AssociateAttributeGroup
s {$sel:application:AssociateAttributeGroup' :: Text
application = Text
a} :: AssociateAttributeGroup)
associateAttributeGroup_attributeGroup :: Lens.Lens' AssociateAttributeGroup Prelude.Text
associateAttributeGroup_attributeGroup :: (Text -> f Text)
-> AssociateAttributeGroup -> f AssociateAttributeGroup
associateAttributeGroup_attributeGroup = (AssociateAttributeGroup -> Text)
-> (AssociateAttributeGroup -> Text -> AssociateAttributeGroup)
-> Lens AssociateAttributeGroup AssociateAttributeGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAttributeGroup' {Text
attributeGroup :: Text
$sel:attributeGroup:AssociateAttributeGroup' :: AssociateAttributeGroup -> Text
attributeGroup} -> Text
attributeGroup) (\s :: AssociateAttributeGroup
s@AssociateAttributeGroup' {} Text
a -> AssociateAttributeGroup
s {$sel:attributeGroup:AssociateAttributeGroup' :: Text
attributeGroup = Text
a} :: AssociateAttributeGroup)
instance Core.AWSRequest AssociateAttributeGroup where
type
AWSResponse AssociateAttributeGroup =
AssociateAttributeGroupResponse
request :: AssociateAttributeGroup -> Request AssociateAttributeGroup
request = Service
-> AssociateAttributeGroup -> Request AssociateAttributeGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateAttributeGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateAttributeGroup)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse AssociateAttributeGroup))
-> Logger
-> Service
-> Proxy AssociateAttributeGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateAttributeGroup)))
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 Text -> Maybe Text -> Int -> AssociateAttributeGroupResponse
AssociateAttributeGroupResponse'
(Maybe Text
-> Maybe Text -> Int -> AssociateAttributeGroupResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Int -> AssociateAttributeGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"applicationArn")
Either
String (Maybe Text -> Int -> AssociateAttributeGroupResponse)
-> Either String (Maybe Text)
-> Either String (Int -> AssociateAttributeGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"attributeGroupArn")
Either String (Int -> AssociateAttributeGroupResponse)
-> Either String Int
-> Either String AssociateAttributeGroupResponse
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 AssociateAttributeGroup
instance Prelude.NFData AssociateAttributeGroup
instance Core.ToHeaders AssociateAttributeGroup where
toHeaders :: AssociateAttributeGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> AssociateAttributeGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 AssociateAttributeGroup where
toJSON :: AssociateAttributeGroup -> Value
toJSON = Value -> AssociateAttributeGroup -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath AssociateAttributeGroup where
toPath :: AssociateAttributeGroup -> ByteString
toPath AssociateAttributeGroup' {Text
attributeGroup :: Text
application :: Text
$sel:attributeGroup:AssociateAttributeGroup' :: AssociateAttributeGroup -> Text
$sel:application:AssociateAttributeGroup' :: AssociateAttributeGroup -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/applications/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
application,
ByteString
"/attribute-groups/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
attributeGroup
]
instance Core.ToQuery AssociateAttributeGroup where
toQuery :: AssociateAttributeGroup -> QueryString
toQuery = QueryString -> AssociateAttributeGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateAttributeGroupResponse = AssociateAttributeGroupResponse'
{
AssociateAttributeGroupResponse -> Maybe Text
applicationArn :: Prelude.Maybe Prelude.Text,
AssociateAttributeGroupResponse -> Maybe Text
attributeGroupArn :: Prelude.Maybe Prelude.Text,
AssociateAttributeGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateAttributeGroupResponse
-> AssociateAttributeGroupResponse -> Bool
(AssociateAttributeGroupResponse
-> AssociateAttributeGroupResponse -> Bool)
-> (AssociateAttributeGroupResponse
-> AssociateAttributeGroupResponse -> Bool)
-> Eq AssociateAttributeGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateAttributeGroupResponse
-> AssociateAttributeGroupResponse -> Bool
$c/= :: AssociateAttributeGroupResponse
-> AssociateAttributeGroupResponse -> Bool
== :: AssociateAttributeGroupResponse
-> AssociateAttributeGroupResponse -> Bool
$c== :: AssociateAttributeGroupResponse
-> AssociateAttributeGroupResponse -> Bool
Prelude.Eq, ReadPrec [AssociateAttributeGroupResponse]
ReadPrec AssociateAttributeGroupResponse
Int -> ReadS AssociateAttributeGroupResponse
ReadS [AssociateAttributeGroupResponse]
(Int -> ReadS AssociateAttributeGroupResponse)
-> ReadS [AssociateAttributeGroupResponse]
-> ReadPrec AssociateAttributeGroupResponse
-> ReadPrec [AssociateAttributeGroupResponse]
-> Read AssociateAttributeGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateAttributeGroupResponse]
$creadListPrec :: ReadPrec [AssociateAttributeGroupResponse]
readPrec :: ReadPrec AssociateAttributeGroupResponse
$creadPrec :: ReadPrec AssociateAttributeGroupResponse
readList :: ReadS [AssociateAttributeGroupResponse]
$creadList :: ReadS [AssociateAttributeGroupResponse]
readsPrec :: Int -> ReadS AssociateAttributeGroupResponse
$creadsPrec :: Int -> ReadS AssociateAttributeGroupResponse
Prelude.Read, Int -> AssociateAttributeGroupResponse -> ShowS
[AssociateAttributeGroupResponse] -> ShowS
AssociateAttributeGroupResponse -> String
(Int -> AssociateAttributeGroupResponse -> ShowS)
-> (AssociateAttributeGroupResponse -> String)
-> ([AssociateAttributeGroupResponse] -> ShowS)
-> Show AssociateAttributeGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateAttributeGroupResponse] -> ShowS
$cshowList :: [AssociateAttributeGroupResponse] -> ShowS
show :: AssociateAttributeGroupResponse -> String
$cshow :: AssociateAttributeGroupResponse -> String
showsPrec :: Int -> AssociateAttributeGroupResponse -> ShowS
$cshowsPrec :: Int -> AssociateAttributeGroupResponse -> ShowS
Prelude.Show, (forall x.
AssociateAttributeGroupResponse
-> Rep AssociateAttributeGroupResponse x)
-> (forall x.
Rep AssociateAttributeGroupResponse x
-> AssociateAttributeGroupResponse)
-> Generic AssociateAttributeGroupResponse
forall x.
Rep AssociateAttributeGroupResponse x
-> AssociateAttributeGroupResponse
forall x.
AssociateAttributeGroupResponse
-> Rep AssociateAttributeGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateAttributeGroupResponse x
-> AssociateAttributeGroupResponse
$cfrom :: forall x.
AssociateAttributeGroupResponse
-> Rep AssociateAttributeGroupResponse x
Prelude.Generic)
newAssociateAttributeGroupResponse ::
Prelude.Int ->
AssociateAttributeGroupResponse
newAssociateAttributeGroupResponse :: Int -> AssociateAttributeGroupResponse
newAssociateAttributeGroupResponse Int
pHttpStatus_ =
AssociateAttributeGroupResponse' :: Maybe Text -> Maybe Text -> Int -> AssociateAttributeGroupResponse
AssociateAttributeGroupResponse'
{ $sel:applicationArn:AssociateAttributeGroupResponse' :: Maybe Text
applicationArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributeGroupArn:AssociateAttributeGroupResponse' :: Maybe Text
attributeGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AssociateAttributeGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
associateAttributeGroupResponse_applicationArn :: Lens.Lens' AssociateAttributeGroupResponse (Prelude.Maybe Prelude.Text)
associateAttributeGroupResponse_applicationArn :: (Maybe Text -> f (Maybe Text))
-> AssociateAttributeGroupResponse
-> f AssociateAttributeGroupResponse
associateAttributeGroupResponse_applicationArn = (AssociateAttributeGroupResponse -> Maybe Text)
-> (AssociateAttributeGroupResponse
-> Maybe Text -> AssociateAttributeGroupResponse)
-> Lens
AssociateAttributeGroupResponse
AssociateAttributeGroupResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAttributeGroupResponse' {Maybe Text
applicationArn :: Maybe Text
$sel:applicationArn:AssociateAttributeGroupResponse' :: AssociateAttributeGroupResponse -> Maybe Text
applicationArn} -> Maybe Text
applicationArn) (\s :: AssociateAttributeGroupResponse
s@AssociateAttributeGroupResponse' {} Maybe Text
a -> AssociateAttributeGroupResponse
s {$sel:applicationArn:AssociateAttributeGroupResponse' :: Maybe Text
applicationArn = Maybe Text
a} :: AssociateAttributeGroupResponse)
associateAttributeGroupResponse_attributeGroupArn :: Lens.Lens' AssociateAttributeGroupResponse (Prelude.Maybe Prelude.Text)
associateAttributeGroupResponse_attributeGroupArn :: (Maybe Text -> f (Maybe Text))
-> AssociateAttributeGroupResponse
-> f AssociateAttributeGroupResponse
associateAttributeGroupResponse_attributeGroupArn = (AssociateAttributeGroupResponse -> Maybe Text)
-> (AssociateAttributeGroupResponse
-> Maybe Text -> AssociateAttributeGroupResponse)
-> Lens
AssociateAttributeGroupResponse
AssociateAttributeGroupResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAttributeGroupResponse' {Maybe Text
attributeGroupArn :: Maybe Text
$sel:attributeGroupArn:AssociateAttributeGroupResponse' :: AssociateAttributeGroupResponse -> Maybe Text
attributeGroupArn} -> Maybe Text
attributeGroupArn) (\s :: AssociateAttributeGroupResponse
s@AssociateAttributeGroupResponse' {} Maybe Text
a -> AssociateAttributeGroupResponse
s {$sel:attributeGroupArn:AssociateAttributeGroupResponse' :: Maybe Text
attributeGroupArn = Maybe Text
a} :: AssociateAttributeGroupResponse)
associateAttributeGroupResponse_httpStatus :: Lens.Lens' AssociateAttributeGroupResponse Prelude.Int
associateAttributeGroupResponse_httpStatus :: (Int -> f Int)
-> AssociateAttributeGroupResponse
-> f AssociateAttributeGroupResponse
associateAttributeGroupResponse_httpStatus = (AssociateAttributeGroupResponse -> Int)
-> (AssociateAttributeGroupResponse
-> Int -> AssociateAttributeGroupResponse)
-> Lens
AssociateAttributeGroupResponse
AssociateAttributeGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateAttributeGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateAttributeGroupResponse' :: AssociateAttributeGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateAttributeGroupResponse
s@AssociateAttributeGroupResponse' {} Int
a -> AssociateAttributeGroupResponse
s {$sel:httpStatus:AssociateAttributeGroupResponse' :: Int
httpStatus = Int
a} :: AssociateAttributeGroupResponse)
instance
Prelude.NFData
AssociateAttributeGroupResponse