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