{-# 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.ImageBuilder.CreateComponent
(
CreateComponent (..),
newCreateComponent,
createComponent_data,
createComponent_supportedOsVersions,
createComponent_uri,
createComponent_kmsKeyId,
createComponent_changeDescription,
createComponent_description,
createComponent_tags,
createComponent_name,
createComponent_semanticVersion,
createComponent_platform,
createComponent_clientToken,
CreateComponentResponse (..),
newCreateComponentResponse,
createComponentResponse_requestId,
createComponentResponse_clientToken,
createComponentResponse_componentBuildVersionArn,
createComponentResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data CreateComponent = CreateComponent'
{
CreateComponent -> Maybe Text
data' :: Prelude.Maybe Prelude.Text,
CreateComponent -> Maybe (NonEmpty Text)
supportedOsVersions :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
CreateComponent -> Maybe Text
uri :: Prelude.Maybe Prelude.Text,
CreateComponent -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
CreateComponent -> Maybe Text
changeDescription :: Prelude.Maybe Prelude.Text,
CreateComponent -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
CreateComponent -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateComponent -> Text
name :: Prelude.Text,
CreateComponent -> Text
semanticVersion :: Prelude.Text,
CreateComponent -> Platform
platform :: Platform,
CreateComponent -> Text
clientToken :: Prelude.Text
}
deriving (CreateComponent -> CreateComponent -> Bool
(CreateComponent -> CreateComponent -> Bool)
-> (CreateComponent -> CreateComponent -> Bool)
-> Eq CreateComponent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateComponent -> CreateComponent -> Bool
$c/= :: CreateComponent -> CreateComponent -> Bool
== :: CreateComponent -> CreateComponent -> Bool
$c== :: CreateComponent -> CreateComponent -> Bool
Prelude.Eq, ReadPrec [CreateComponent]
ReadPrec CreateComponent
Int -> ReadS CreateComponent
ReadS [CreateComponent]
(Int -> ReadS CreateComponent)
-> ReadS [CreateComponent]
-> ReadPrec CreateComponent
-> ReadPrec [CreateComponent]
-> Read CreateComponent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateComponent]
$creadListPrec :: ReadPrec [CreateComponent]
readPrec :: ReadPrec CreateComponent
$creadPrec :: ReadPrec CreateComponent
readList :: ReadS [CreateComponent]
$creadList :: ReadS [CreateComponent]
readsPrec :: Int -> ReadS CreateComponent
$creadsPrec :: Int -> ReadS CreateComponent
Prelude.Read, Int -> CreateComponent -> ShowS
[CreateComponent] -> ShowS
CreateComponent -> String
(Int -> CreateComponent -> ShowS)
-> (CreateComponent -> String)
-> ([CreateComponent] -> ShowS)
-> Show CreateComponent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateComponent] -> ShowS
$cshowList :: [CreateComponent] -> ShowS
show :: CreateComponent -> String
$cshow :: CreateComponent -> String
showsPrec :: Int -> CreateComponent -> ShowS
$cshowsPrec :: Int -> CreateComponent -> ShowS
Prelude.Show, (forall x. CreateComponent -> Rep CreateComponent x)
-> (forall x. Rep CreateComponent x -> CreateComponent)
-> Generic CreateComponent
forall x. Rep CreateComponent x -> CreateComponent
forall x. CreateComponent -> Rep CreateComponent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateComponent x -> CreateComponent
$cfrom :: forall x. CreateComponent -> Rep CreateComponent x
Prelude.Generic)
newCreateComponent ::
Prelude.Text ->
Prelude.Text ->
Platform ->
Prelude.Text ->
CreateComponent
newCreateComponent :: Text -> Text -> Platform -> Text -> CreateComponent
newCreateComponent
Text
pName_
Text
pSemanticVersion_
Platform
pPlatform_
Text
pClientToken_ =
CreateComponent' :: Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Platform
-> Text
-> CreateComponent
CreateComponent'
{ $sel:data':CreateComponent' :: Maybe Text
data' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:supportedOsVersions:CreateComponent' :: Maybe (NonEmpty Text)
supportedOsVersions = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:uri:CreateComponent' :: Maybe Text
uri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:CreateComponent' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:changeDescription:CreateComponent' :: Maybe Text
changeDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:CreateComponent' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateComponent' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateComponent' :: Text
name = Text
pName_,
$sel:semanticVersion:CreateComponent' :: Text
semanticVersion = Text
pSemanticVersion_,
$sel:platform:CreateComponent' :: Platform
platform = Platform
pPlatform_,
$sel:clientToken:CreateComponent' :: Text
clientToken = Text
pClientToken_
}
createComponent_data :: Lens.Lens' CreateComponent (Prelude.Maybe Prelude.Text)
createComponent_data :: (Maybe Text -> f (Maybe Text))
-> CreateComponent -> f CreateComponent
createComponent_data = (CreateComponent -> Maybe Text)
-> (CreateComponent -> Maybe Text -> CreateComponent)
-> Lens CreateComponent CreateComponent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Maybe Text
data' :: Maybe Text
$sel:data':CreateComponent' :: CreateComponent -> Maybe Text
data'} -> Maybe Text
data') (\s :: CreateComponent
s@CreateComponent' {} Maybe Text
a -> CreateComponent
s {$sel:data':CreateComponent' :: Maybe Text
data' = Maybe Text
a} :: CreateComponent)
createComponent_supportedOsVersions :: Lens.Lens' CreateComponent (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
createComponent_supportedOsVersions :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreateComponent -> f CreateComponent
createComponent_supportedOsVersions = (CreateComponent -> Maybe (NonEmpty Text))
-> (CreateComponent -> Maybe (NonEmpty Text) -> CreateComponent)
-> Lens
CreateComponent
CreateComponent
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Maybe (NonEmpty Text)
supportedOsVersions :: Maybe (NonEmpty Text)
$sel:supportedOsVersions:CreateComponent' :: CreateComponent -> Maybe (NonEmpty Text)
supportedOsVersions} -> Maybe (NonEmpty Text)
supportedOsVersions) (\s :: CreateComponent
s@CreateComponent' {} Maybe (NonEmpty Text)
a -> CreateComponent
s {$sel:supportedOsVersions:CreateComponent' :: Maybe (NonEmpty Text)
supportedOsVersions = Maybe (NonEmpty Text)
a} :: CreateComponent) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreateComponent -> f CreateComponent)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> CreateComponent
-> f CreateComponent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createComponent_uri :: Lens.Lens' CreateComponent (Prelude.Maybe Prelude.Text)
createComponent_uri :: (Maybe Text -> f (Maybe Text))
-> CreateComponent -> f CreateComponent
createComponent_uri = (CreateComponent -> Maybe Text)
-> (CreateComponent -> Maybe Text -> CreateComponent)
-> Lens CreateComponent CreateComponent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Maybe Text
uri :: Maybe Text
$sel:uri:CreateComponent' :: CreateComponent -> Maybe Text
uri} -> Maybe Text
uri) (\s :: CreateComponent
s@CreateComponent' {} Maybe Text
a -> CreateComponent
s {$sel:uri:CreateComponent' :: Maybe Text
uri = Maybe Text
a} :: CreateComponent)
createComponent_kmsKeyId :: Lens.Lens' CreateComponent (Prelude.Maybe Prelude.Text)
createComponent_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CreateComponent -> f CreateComponent
createComponent_kmsKeyId = (CreateComponent -> Maybe Text)
-> (CreateComponent -> Maybe Text -> CreateComponent)
-> Lens CreateComponent CreateComponent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CreateComponent' :: CreateComponent -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CreateComponent
s@CreateComponent' {} Maybe Text
a -> CreateComponent
s {$sel:kmsKeyId:CreateComponent' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CreateComponent)
createComponent_changeDescription :: Lens.Lens' CreateComponent (Prelude.Maybe Prelude.Text)
createComponent_changeDescription :: (Maybe Text -> f (Maybe Text))
-> CreateComponent -> f CreateComponent
createComponent_changeDescription = (CreateComponent -> Maybe Text)
-> (CreateComponent -> Maybe Text -> CreateComponent)
-> Lens CreateComponent CreateComponent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Maybe Text
changeDescription :: Maybe Text
$sel:changeDescription:CreateComponent' :: CreateComponent -> Maybe Text
changeDescription} -> Maybe Text
changeDescription) (\s :: CreateComponent
s@CreateComponent' {} Maybe Text
a -> CreateComponent
s {$sel:changeDescription:CreateComponent' :: Maybe Text
changeDescription = Maybe Text
a} :: CreateComponent)
createComponent_description :: Lens.Lens' CreateComponent (Prelude.Maybe Prelude.Text)
createComponent_description :: (Maybe Text -> f (Maybe Text))
-> CreateComponent -> f CreateComponent
createComponent_description = (CreateComponent -> Maybe Text)
-> (CreateComponent -> Maybe Text -> CreateComponent)
-> Lens CreateComponent CreateComponent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Maybe Text
description :: Maybe Text
$sel:description:CreateComponent' :: CreateComponent -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateComponent
s@CreateComponent' {} Maybe Text
a -> CreateComponent
s {$sel:description:CreateComponent' :: Maybe Text
description = Maybe Text
a} :: CreateComponent)
createComponent_tags :: Lens.Lens' CreateComponent (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createComponent_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateComponent -> f CreateComponent
createComponent_tags = (CreateComponent -> Maybe (HashMap Text Text))
-> (CreateComponent
-> Maybe (HashMap Text Text) -> CreateComponent)
-> Lens
CreateComponent
CreateComponent
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateComponent' :: CreateComponent -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateComponent
s@CreateComponent' {} Maybe (HashMap Text Text)
a -> CreateComponent
s {$sel:tags:CreateComponent' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateComponent) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateComponent -> f CreateComponent)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateComponent
-> f CreateComponent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createComponent_name :: Lens.Lens' CreateComponent Prelude.Text
createComponent_name :: (Text -> f Text) -> CreateComponent -> f CreateComponent
createComponent_name = (CreateComponent -> Text)
-> (CreateComponent -> Text -> CreateComponent)
-> Lens CreateComponent CreateComponent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Text
name :: Text
$sel:name:CreateComponent' :: CreateComponent -> Text
name} -> Text
name) (\s :: CreateComponent
s@CreateComponent' {} Text
a -> CreateComponent
s {$sel:name:CreateComponent' :: Text
name = Text
a} :: CreateComponent)
createComponent_semanticVersion :: Lens.Lens' CreateComponent Prelude.Text
createComponent_semanticVersion :: (Text -> f Text) -> CreateComponent -> f CreateComponent
createComponent_semanticVersion = (CreateComponent -> Text)
-> (CreateComponent -> Text -> CreateComponent)
-> Lens CreateComponent CreateComponent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Text
semanticVersion :: Text
$sel:semanticVersion:CreateComponent' :: CreateComponent -> Text
semanticVersion} -> Text
semanticVersion) (\s :: CreateComponent
s@CreateComponent' {} Text
a -> CreateComponent
s {$sel:semanticVersion:CreateComponent' :: Text
semanticVersion = Text
a} :: CreateComponent)
createComponent_platform :: Lens.Lens' CreateComponent Platform
createComponent_platform :: (Platform -> f Platform) -> CreateComponent -> f CreateComponent
createComponent_platform = (CreateComponent -> Platform)
-> (CreateComponent -> Platform -> CreateComponent)
-> Lens CreateComponent CreateComponent Platform Platform
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Platform
platform :: Platform
$sel:platform:CreateComponent' :: CreateComponent -> Platform
platform} -> Platform
platform) (\s :: CreateComponent
s@CreateComponent' {} Platform
a -> CreateComponent
s {$sel:platform:CreateComponent' :: Platform
platform = Platform
a} :: CreateComponent)
createComponent_clientToken :: Lens.Lens' CreateComponent Prelude.Text
createComponent_clientToken :: (Text -> f Text) -> CreateComponent -> f CreateComponent
createComponent_clientToken = (CreateComponent -> Text)
-> (CreateComponent -> Text -> CreateComponent)
-> Lens CreateComponent CreateComponent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponent' {Text
clientToken :: Text
$sel:clientToken:CreateComponent' :: CreateComponent -> Text
clientToken} -> Text
clientToken) (\s :: CreateComponent
s@CreateComponent' {} Text
a -> CreateComponent
s {$sel:clientToken:CreateComponent' :: Text
clientToken = Text
a} :: CreateComponent)
instance Core.AWSRequest CreateComponent where
type
AWSResponse CreateComponent =
CreateComponentResponse
request :: CreateComponent -> Request CreateComponent
request = Service -> CreateComponent -> Request CreateComponent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateComponent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateComponent)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateComponent))
-> Logger
-> Service
-> Proxy CreateComponent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateComponent)))
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 -> Maybe Text -> Int -> CreateComponentResponse
CreateComponentResponse'
(Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateComponentResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Int -> CreateComponentResponse)
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
"requestId")
Either
String (Maybe Text -> Maybe Text -> Int -> CreateComponentResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateComponentResponse)
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
"clientToken")
Either String (Maybe Text -> Int -> CreateComponentResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateComponentResponse)
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
"componentBuildVersionArn")
Either String (Int -> CreateComponentResponse)
-> Either String Int -> Either String CreateComponentResponse
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 CreateComponent
instance Prelude.NFData CreateComponent
instance Core.ToHeaders CreateComponent where
toHeaders :: CreateComponent -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateComponent -> 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 CreateComponent where
toJSON :: CreateComponent -> Value
toJSON CreateComponent' {Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text Text)
Text
Platform
clientToken :: Text
platform :: Platform
semanticVersion :: Text
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
changeDescription :: Maybe Text
kmsKeyId :: Maybe Text
uri :: Maybe Text
supportedOsVersions :: Maybe (NonEmpty Text)
data' :: Maybe Text
$sel:clientToken:CreateComponent' :: CreateComponent -> Text
$sel:platform:CreateComponent' :: CreateComponent -> Platform
$sel:semanticVersion:CreateComponent' :: CreateComponent -> Text
$sel:name:CreateComponent' :: CreateComponent -> Text
$sel:tags:CreateComponent' :: CreateComponent -> Maybe (HashMap Text Text)
$sel:description:CreateComponent' :: CreateComponent -> Maybe Text
$sel:changeDescription:CreateComponent' :: CreateComponent -> Maybe Text
$sel:kmsKeyId:CreateComponent' :: CreateComponent -> Maybe Text
$sel:uri:CreateComponent' :: CreateComponent -> Maybe Text
$sel:supportedOsVersions:CreateComponent' :: CreateComponent -> Maybe (NonEmpty Text)
$sel:data':CreateComponent' :: CreateComponent -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"data" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
data',
(Text
"supportedOsVersions" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
supportedOsVersions,
(Text
"uri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
uri,
(Text
"kmsKeyId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
(Text
"changeDescription" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
changeDescription,
(Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
(Text
"tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"semanticVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
semanticVersion),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"platform" Text -> Platform -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Platform
platform),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
]
)
instance Core.ToPath CreateComponent where
toPath :: CreateComponent -> ByteString
toPath = ByteString -> CreateComponent -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/CreateComponent"
instance Core.ToQuery CreateComponent where
toQuery :: CreateComponent -> QueryString
toQuery = QueryString -> CreateComponent -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateComponentResponse = CreateComponentResponse'
{
CreateComponentResponse -> Maybe Text
requestId :: Prelude.Maybe Prelude.Text,
CreateComponentResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
CreateComponentResponse -> Maybe Text
componentBuildVersionArn :: Prelude.Maybe Prelude.Text,
CreateComponentResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateComponentResponse -> CreateComponentResponse -> Bool
(CreateComponentResponse -> CreateComponentResponse -> Bool)
-> (CreateComponentResponse -> CreateComponentResponse -> Bool)
-> Eq CreateComponentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateComponentResponse -> CreateComponentResponse -> Bool
$c/= :: CreateComponentResponse -> CreateComponentResponse -> Bool
== :: CreateComponentResponse -> CreateComponentResponse -> Bool
$c== :: CreateComponentResponse -> CreateComponentResponse -> Bool
Prelude.Eq, ReadPrec [CreateComponentResponse]
ReadPrec CreateComponentResponse
Int -> ReadS CreateComponentResponse
ReadS [CreateComponentResponse]
(Int -> ReadS CreateComponentResponse)
-> ReadS [CreateComponentResponse]
-> ReadPrec CreateComponentResponse
-> ReadPrec [CreateComponentResponse]
-> Read CreateComponentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateComponentResponse]
$creadListPrec :: ReadPrec [CreateComponentResponse]
readPrec :: ReadPrec CreateComponentResponse
$creadPrec :: ReadPrec CreateComponentResponse
readList :: ReadS [CreateComponentResponse]
$creadList :: ReadS [CreateComponentResponse]
readsPrec :: Int -> ReadS CreateComponentResponse
$creadsPrec :: Int -> ReadS CreateComponentResponse
Prelude.Read, Int -> CreateComponentResponse -> ShowS
[CreateComponentResponse] -> ShowS
CreateComponentResponse -> String
(Int -> CreateComponentResponse -> ShowS)
-> (CreateComponentResponse -> String)
-> ([CreateComponentResponse] -> ShowS)
-> Show CreateComponentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateComponentResponse] -> ShowS
$cshowList :: [CreateComponentResponse] -> ShowS
show :: CreateComponentResponse -> String
$cshow :: CreateComponentResponse -> String
showsPrec :: Int -> CreateComponentResponse -> ShowS
$cshowsPrec :: Int -> CreateComponentResponse -> ShowS
Prelude.Show, (forall x.
CreateComponentResponse -> Rep CreateComponentResponse x)
-> (forall x.
Rep CreateComponentResponse x -> CreateComponentResponse)
-> Generic CreateComponentResponse
forall x. Rep CreateComponentResponse x -> CreateComponentResponse
forall x. CreateComponentResponse -> Rep CreateComponentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateComponentResponse x -> CreateComponentResponse
$cfrom :: forall x. CreateComponentResponse -> Rep CreateComponentResponse x
Prelude.Generic)
newCreateComponentResponse ::
Prelude.Int ->
CreateComponentResponse
newCreateComponentResponse :: Int -> CreateComponentResponse
newCreateComponentResponse Int
pHttpStatus_ =
CreateComponentResponse' :: Maybe Text
-> Maybe Text -> Maybe Text -> Int -> CreateComponentResponse
CreateComponentResponse'
{ $sel:requestId:CreateComponentResponse' :: Maybe Text
requestId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clientToken:CreateComponentResponse' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:componentBuildVersionArn:CreateComponentResponse' :: Maybe Text
componentBuildVersionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateComponentResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createComponentResponse_requestId :: Lens.Lens' CreateComponentResponse (Prelude.Maybe Prelude.Text)
createComponentResponse_requestId :: (Maybe Text -> f (Maybe Text))
-> CreateComponentResponse -> f CreateComponentResponse
createComponentResponse_requestId = (CreateComponentResponse -> Maybe Text)
-> (CreateComponentResponse
-> Maybe Text -> CreateComponentResponse)
-> Lens
CreateComponentResponse
CreateComponentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentResponse' {Maybe Text
requestId :: Maybe Text
$sel:requestId:CreateComponentResponse' :: CreateComponentResponse -> Maybe Text
requestId} -> Maybe Text
requestId) (\s :: CreateComponentResponse
s@CreateComponentResponse' {} Maybe Text
a -> CreateComponentResponse
s {$sel:requestId:CreateComponentResponse' :: Maybe Text
requestId = Maybe Text
a} :: CreateComponentResponse)
createComponentResponse_clientToken :: Lens.Lens' CreateComponentResponse (Prelude.Maybe Prelude.Text)
createComponentResponse_clientToken :: (Maybe Text -> f (Maybe Text))
-> CreateComponentResponse -> f CreateComponentResponse
createComponentResponse_clientToken = (CreateComponentResponse -> Maybe Text)
-> (CreateComponentResponse
-> Maybe Text -> CreateComponentResponse)
-> Lens
CreateComponentResponse
CreateComponentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateComponentResponse' :: CreateComponentResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateComponentResponse
s@CreateComponentResponse' {} Maybe Text
a -> CreateComponentResponse
s {$sel:clientToken:CreateComponentResponse' :: Maybe Text
clientToken = Maybe Text
a} :: CreateComponentResponse)
createComponentResponse_componentBuildVersionArn :: Lens.Lens' CreateComponentResponse (Prelude.Maybe Prelude.Text)
createComponentResponse_componentBuildVersionArn :: (Maybe Text -> f (Maybe Text))
-> CreateComponentResponse -> f CreateComponentResponse
createComponentResponse_componentBuildVersionArn = (CreateComponentResponse -> Maybe Text)
-> (CreateComponentResponse
-> Maybe Text -> CreateComponentResponse)
-> Lens
CreateComponentResponse
CreateComponentResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentResponse' {Maybe Text
componentBuildVersionArn :: Maybe Text
$sel:componentBuildVersionArn:CreateComponentResponse' :: CreateComponentResponse -> Maybe Text
componentBuildVersionArn} -> Maybe Text
componentBuildVersionArn) (\s :: CreateComponentResponse
s@CreateComponentResponse' {} Maybe Text
a -> CreateComponentResponse
s {$sel:componentBuildVersionArn:CreateComponentResponse' :: Maybe Text
componentBuildVersionArn = Maybe Text
a} :: CreateComponentResponse)
createComponentResponse_httpStatus :: Lens.Lens' CreateComponentResponse Prelude.Int
createComponentResponse_httpStatus :: (Int -> f Int)
-> CreateComponentResponse -> f CreateComponentResponse
createComponentResponse_httpStatus = (CreateComponentResponse -> Int)
-> (CreateComponentResponse -> Int -> CreateComponentResponse)
-> Lens CreateComponentResponse CreateComponentResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateComponentResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateComponentResponse' :: CreateComponentResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateComponentResponse
s@CreateComponentResponse' {} Int
a -> CreateComponentResponse
s {$sel:httpStatus:CreateComponentResponse' :: Int
httpStatus = Int
a} :: CreateComponentResponse)
instance Prelude.NFData CreateComponentResponse