{-# 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.SageMaker.GetModelPackageGroupPolicy
(
GetModelPackageGroupPolicy (..),
newGetModelPackageGroupPolicy,
getModelPackageGroupPolicy_modelPackageGroupName,
GetModelPackageGroupPolicyResponse (..),
newGetModelPackageGroupPolicyResponse,
getModelPackageGroupPolicyResponse_httpStatus,
getModelPackageGroupPolicyResponse_resourcePolicy,
)
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.SageMaker.Types
data GetModelPackageGroupPolicy = GetModelPackageGroupPolicy'
{
GetModelPackageGroupPolicy -> Text
modelPackageGroupName :: Prelude.Text
}
deriving (GetModelPackageGroupPolicy -> GetModelPackageGroupPolicy -> Bool
(GetModelPackageGroupPolicy -> GetModelPackageGroupPolicy -> Bool)
-> (GetModelPackageGroupPolicy
-> GetModelPackageGroupPolicy -> Bool)
-> Eq GetModelPackageGroupPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetModelPackageGroupPolicy -> GetModelPackageGroupPolicy -> Bool
$c/= :: GetModelPackageGroupPolicy -> GetModelPackageGroupPolicy -> Bool
== :: GetModelPackageGroupPolicy -> GetModelPackageGroupPolicy -> Bool
$c== :: GetModelPackageGroupPolicy -> GetModelPackageGroupPolicy -> Bool
Prelude.Eq, ReadPrec [GetModelPackageGroupPolicy]
ReadPrec GetModelPackageGroupPolicy
Int -> ReadS GetModelPackageGroupPolicy
ReadS [GetModelPackageGroupPolicy]
(Int -> ReadS GetModelPackageGroupPolicy)
-> ReadS [GetModelPackageGroupPolicy]
-> ReadPrec GetModelPackageGroupPolicy
-> ReadPrec [GetModelPackageGroupPolicy]
-> Read GetModelPackageGroupPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetModelPackageGroupPolicy]
$creadListPrec :: ReadPrec [GetModelPackageGroupPolicy]
readPrec :: ReadPrec GetModelPackageGroupPolicy
$creadPrec :: ReadPrec GetModelPackageGroupPolicy
readList :: ReadS [GetModelPackageGroupPolicy]
$creadList :: ReadS [GetModelPackageGroupPolicy]
readsPrec :: Int -> ReadS GetModelPackageGroupPolicy
$creadsPrec :: Int -> ReadS GetModelPackageGroupPolicy
Prelude.Read, Int -> GetModelPackageGroupPolicy -> ShowS
[GetModelPackageGroupPolicy] -> ShowS
GetModelPackageGroupPolicy -> String
(Int -> GetModelPackageGroupPolicy -> ShowS)
-> (GetModelPackageGroupPolicy -> String)
-> ([GetModelPackageGroupPolicy] -> ShowS)
-> Show GetModelPackageGroupPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetModelPackageGroupPolicy] -> ShowS
$cshowList :: [GetModelPackageGroupPolicy] -> ShowS
show :: GetModelPackageGroupPolicy -> String
$cshow :: GetModelPackageGroupPolicy -> String
showsPrec :: Int -> GetModelPackageGroupPolicy -> ShowS
$cshowsPrec :: Int -> GetModelPackageGroupPolicy -> ShowS
Prelude.Show, (forall x.
GetModelPackageGroupPolicy -> Rep GetModelPackageGroupPolicy x)
-> (forall x.
Rep GetModelPackageGroupPolicy x -> GetModelPackageGroupPolicy)
-> Generic GetModelPackageGroupPolicy
forall x.
Rep GetModelPackageGroupPolicy x -> GetModelPackageGroupPolicy
forall x.
GetModelPackageGroupPolicy -> Rep GetModelPackageGroupPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetModelPackageGroupPolicy x -> GetModelPackageGroupPolicy
$cfrom :: forall x.
GetModelPackageGroupPolicy -> Rep GetModelPackageGroupPolicy x
Prelude.Generic)
newGetModelPackageGroupPolicy ::
Prelude.Text ->
GetModelPackageGroupPolicy
newGetModelPackageGroupPolicy :: Text -> GetModelPackageGroupPolicy
newGetModelPackageGroupPolicy Text
pModelPackageGroupName_ =
GetModelPackageGroupPolicy' :: Text -> GetModelPackageGroupPolicy
GetModelPackageGroupPolicy'
{ $sel:modelPackageGroupName:GetModelPackageGroupPolicy' :: Text
modelPackageGroupName =
Text
pModelPackageGroupName_
}
getModelPackageGroupPolicy_modelPackageGroupName :: Lens.Lens' GetModelPackageGroupPolicy Prelude.Text
getModelPackageGroupPolicy_modelPackageGroupName :: (Text -> f Text)
-> GetModelPackageGroupPolicy -> f GetModelPackageGroupPolicy
getModelPackageGroupPolicy_modelPackageGroupName = (GetModelPackageGroupPolicy -> Text)
-> (GetModelPackageGroupPolicy
-> Text -> GetModelPackageGroupPolicy)
-> Lens
GetModelPackageGroupPolicy GetModelPackageGroupPolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetModelPackageGroupPolicy' {Text
modelPackageGroupName :: Text
$sel:modelPackageGroupName:GetModelPackageGroupPolicy' :: GetModelPackageGroupPolicy -> Text
modelPackageGroupName} -> Text
modelPackageGroupName) (\s :: GetModelPackageGroupPolicy
s@GetModelPackageGroupPolicy' {} Text
a -> GetModelPackageGroupPolicy
s {$sel:modelPackageGroupName:GetModelPackageGroupPolicy' :: Text
modelPackageGroupName = Text
a} :: GetModelPackageGroupPolicy)
instance Core.AWSRequest GetModelPackageGroupPolicy where
type
AWSResponse GetModelPackageGroupPolicy =
GetModelPackageGroupPolicyResponse
request :: GetModelPackageGroupPolicy -> Request GetModelPackageGroupPolicy
request = Service
-> GetModelPackageGroupPolicy -> Request GetModelPackageGroupPolicy
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetModelPackageGroupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetModelPackageGroupPolicy)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetModelPackageGroupPolicy))
-> Logger
-> Service
-> Proxy GetModelPackageGroupPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetModelPackageGroupPolicy)))
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 ->
Int -> Text -> GetModelPackageGroupPolicyResponse
GetModelPackageGroupPolicyResponse'
(Int -> Text -> GetModelPackageGroupPolicyResponse)
-> Either String Int
-> Either String (Text -> GetModelPackageGroupPolicyResponse)
forall (f :: * -> *) a b. Functor 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))
Either String (Text -> GetModelPackageGroupPolicyResponse)
-> Either String Text
-> Either String GetModelPackageGroupPolicyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ResourcePolicy")
)
instance Prelude.Hashable GetModelPackageGroupPolicy
instance Prelude.NFData GetModelPackageGroupPolicy
instance Core.ToHeaders GetModelPackageGroupPolicy where
toHeaders :: GetModelPackageGroupPolicy -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetModelPackageGroupPolicy -> 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
"SageMaker.GetModelPackageGroupPolicy" ::
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 GetModelPackageGroupPolicy where
toJSON :: GetModelPackageGroupPolicy -> Value
toJSON GetModelPackageGroupPolicy' {Text
modelPackageGroupName :: Text
$sel:modelPackageGroupName:GetModelPackageGroupPolicy' :: GetModelPackageGroupPolicy -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"ModelPackageGroupName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
modelPackageGroupName
)
]
)
instance Core.ToPath GetModelPackageGroupPolicy where
toPath :: GetModelPackageGroupPolicy -> ByteString
toPath = ByteString -> GetModelPackageGroupPolicy -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetModelPackageGroupPolicy where
toQuery :: GetModelPackageGroupPolicy -> QueryString
toQuery = QueryString -> GetModelPackageGroupPolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetModelPackageGroupPolicyResponse = GetModelPackageGroupPolicyResponse'
{
GetModelPackageGroupPolicyResponse -> Int
httpStatus :: Prelude.Int,
GetModelPackageGroupPolicyResponse -> Text
resourcePolicy :: Prelude.Text
}
deriving (GetModelPackageGroupPolicyResponse
-> GetModelPackageGroupPolicyResponse -> Bool
(GetModelPackageGroupPolicyResponse
-> GetModelPackageGroupPolicyResponse -> Bool)
-> (GetModelPackageGroupPolicyResponse
-> GetModelPackageGroupPolicyResponse -> Bool)
-> Eq GetModelPackageGroupPolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetModelPackageGroupPolicyResponse
-> GetModelPackageGroupPolicyResponse -> Bool
$c/= :: GetModelPackageGroupPolicyResponse
-> GetModelPackageGroupPolicyResponse -> Bool
== :: GetModelPackageGroupPolicyResponse
-> GetModelPackageGroupPolicyResponse -> Bool
$c== :: GetModelPackageGroupPolicyResponse
-> GetModelPackageGroupPolicyResponse -> Bool
Prelude.Eq, ReadPrec [GetModelPackageGroupPolicyResponse]
ReadPrec GetModelPackageGroupPolicyResponse
Int -> ReadS GetModelPackageGroupPolicyResponse
ReadS [GetModelPackageGroupPolicyResponse]
(Int -> ReadS GetModelPackageGroupPolicyResponse)
-> ReadS [GetModelPackageGroupPolicyResponse]
-> ReadPrec GetModelPackageGroupPolicyResponse
-> ReadPrec [GetModelPackageGroupPolicyResponse]
-> Read GetModelPackageGroupPolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetModelPackageGroupPolicyResponse]
$creadListPrec :: ReadPrec [GetModelPackageGroupPolicyResponse]
readPrec :: ReadPrec GetModelPackageGroupPolicyResponse
$creadPrec :: ReadPrec GetModelPackageGroupPolicyResponse
readList :: ReadS [GetModelPackageGroupPolicyResponse]
$creadList :: ReadS [GetModelPackageGroupPolicyResponse]
readsPrec :: Int -> ReadS GetModelPackageGroupPolicyResponse
$creadsPrec :: Int -> ReadS GetModelPackageGroupPolicyResponse
Prelude.Read, Int -> GetModelPackageGroupPolicyResponse -> ShowS
[GetModelPackageGroupPolicyResponse] -> ShowS
GetModelPackageGroupPolicyResponse -> String
(Int -> GetModelPackageGroupPolicyResponse -> ShowS)
-> (GetModelPackageGroupPolicyResponse -> String)
-> ([GetModelPackageGroupPolicyResponse] -> ShowS)
-> Show GetModelPackageGroupPolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetModelPackageGroupPolicyResponse] -> ShowS
$cshowList :: [GetModelPackageGroupPolicyResponse] -> ShowS
show :: GetModelPackageGroupPolicyResponse -> String
$cshow :: GetModelPackageGroupPolicyResponse -> String
showsPrec :: Int -> GetModelPackageGroupPolicyResponse -> ShowS
$cshowsPrec :: Int -> GetModelPackageGroupPolicyResponse -> ShowS
Prelude.Show, (forall x.
GetModelPackageGroupPolicyResponse
-> Rep GetModelPackageGroupPolicyResponse x)
-> (forall x.
Rep GetModelPackageGroupPolicyResponse x
-> GetModelPackageGroupPolicyResponse)
-> Generic GetModelPackageGroupPolicyResponse
forall x.
Rep GetModelPackageGroupPolicyResponse x
-> GetModelPackageGroupPolicyResponse
forall x.
GetModelPackageGroupPolicyResponse
-> Rep GetModelPackageGroupPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetModelPackageGroupPolicyResponse x
-> GetModelPackageGroupPolicyResponse
$cfrom :: forall x.
GetModelPackageGroupPolicyResponse
-> Rep GetModelPackageGroupPolicyResponse x
Prelude.Generic)
newGetModelPackageGroupPolicyResponse ::
Prelude.Int ->
Prelude.Text ->
GetModelPackageGroupPolicyResponse
newGetModelPackageGroupPolicyResponse :: Int -> Text -> GetModelPackageGroupPolicyResponse
newGetModelPackageGroupPolicyResponse
Int
pHttpStatus_
Text
pResourcePolicy_ =
GetModelPackageGroupPolicyResponse' :: Int -> Text -> GetModelPackageGroupPolicyResponse
GetModelPackageGroupPolicyResponse'
{ $sel:httpStatus:GetModelPackageGroupPolicyResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:resourcePolicy:GetModelPackageGroupPolicyResponse' :: Text
resourcePolicy = Text
pResourcePolicy_
}
getModelPackageGroupPolicyResponse_httpStatus :: Lens.Lens' GetModelPackageGroupPolicyResponse Prelude.Int
getModelPackageGroupPolicyResponse_httpStatus :: (Int -> f Int)
-> GetModelPackageGroupPolicyResponse
-> f GetModelPackageGroupPolicyResponse
getModelPackageGroupPolicyResponse_httpStatus = (GetModelPackageGroupPolicyResponse -> Int)
-> (GetModelPackageGroupPolicyResponse
-> Int -> GetModelPackageGroupPolicyResponse)
-> Lens
GetModelPackageGroupPolicyResponse
GetModelPackageGroupPolicyResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetModelPackageGroupPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetModelPackageGroupPolicyResponse' :: GetModelPackageGroupPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetModelPackageGroupPolicyResponse
s@GetModelPackageGroupPolicyResponse' {} Int
a -> GetModelPackageGroupPolicyResponse
s {$sel:httpStatus:GetModelPackageGroupPolicyResponse' :: Int
httpStatus = Int
a} :: GetModelPackageGroupPolicyResponse)
getModelPackageGroupPolicyResponse_resourcePolicy :: Lens.Lens' GetModelPackageGroupPolicyResponse Prelude.Text
getModelPackageGroupPolicyResponse_resourcePolicy :: (Text -> f Text)
-> GetModelPackageGroupPolicyResponse
-> f GetModelPackageGroupPolicyResponse
getModelPackageGroupPolicyResponse_resourcePolicy = (GetModelPackageGroupPolicyResponse -> Text)
-> (GetModelPackageGroupPolicyResponse
-> Text -> GetModelPackageGroupPolicyResponse)
-> Lens
GetModelPackageGroupPolicyResponse
GetModelPackageGroupPolicyResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetModelPackageGroupPolicyResponse' {Text
resourcePolicy :: Text
$sel:resourcePolicy:GetModelPackageGroupPolicyResponse' :: GetModelPackageGroupPolicyResponse -> Text
resourcePolicy} -> Text
resourcePolicy) (\s :: GetModelPackageGroupPolicyResponse
s@GetModelPackageGroupPolicyResponse' {} Text
a -> GetModelPackageGroupPolicyResponse
s {$sel:resourcePolicy:GetModelPackageGroupPolicyResponse' :: Text
resourcePolicy = Text
a} :: GetModelPackageGroupPolicyResponse)
instance
Prelude.NFData
GetModelPackageGroupPolicyResponse