{-# 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.GreengrassV2.ResolveComponentCandidates
(
ResolveComponentCandidates (..),
newResolveComponentCandidates,
resolveComponentCandidates_platform,
resolveComponentCandidates_componentCandidates,
ResolveComponentCandidatesResponse (..),
newResolveComponentCandidatesResponse,
resolveComponentCandidatesResponse_resolvedComponentVersions,
resolveComponentCandidatesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.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 ResolveComponentCandidates = ResolveComponentCandidates'
{
ResolveComponentCandidates -> ComponentPlatform
platform :: ComponentPlatform,
ResolveComponentCandidates -> [ComponentCandidate]
componentCandidates :: [ComponentCandidate]
}
deriving (ResolveComponentCandidates -> ResolveComponentCandidates -> Bool
(ResolveComponentCandidates -> ResolveComponentCandidates -> Bool)
-> (ResolveComponentCandidates
-> ResolveComponentCandidates -> Bool)
-> Eq ResolveComponentCandidates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolveComponentCandidates -> ResolveComponentCandidates -> Bool
$c/= :: ResolveComponentCandidates -> ResolveComponentCandidates -> Bool
== :: ResolveComponentCandidates -> ResolveComponentCandidates -> Bool
$c== :: ResolveComponentCandidates -> ResolveComponentCandidates -> Bool
Prelude.Eq, ReadPrec [ResolveComponentCandidates]
ReadPrec ResolveComponentCandidates
Int -> ReadS ResolveComponentCandidates
ReadS [ResolveComponentCandidates]
(Int -> ReadS ResolveComponentCandidates)
-> ReadS [ResolveComponentCandidates]
-> ReadPrec ResolveComponentCandidates
-> ReadPrec [ResolveComponentCandidates]
-> Read ResolveComponentCandidates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolveComponentCandidates]
$creadListPrec :: ReadPrec [ResolveComponentCandidates]
readPrec :: ReadPrec ResolveComponentCandidates
$creadPrec :: ReadPrec ResolveComponentCandidates
readList :: ReadS [ResolveComponentCandidates]
$creadList :: ReadS [ResolveComponentCandidates]
readsPrec :: Int -> ReadS ResolveComponentCandidates
$creadsPrec :: Int -> ReadS ResolveComponentCandidates
Prelude.Read, Int -> ResolveComponentCandidates -> ShowS
[ResolveComponentCandidates] -> ShowS
ResolveComponentCandidates -> String
(Int -> ResolveComponentCandidates -> ShowS)
-> (ResolveComponentCandidates -> String)
-> ([ResolveComponentCandidates] -> ShowS)
-> Show ResolveComponentCandidates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolveComponentCandidates] -> ShowS
$cshowList :: [ResolveComponentCandidates] -> ShowS
show :: ResolveComponentCandidates -> String
$cshow :: ResolveComponentCandidates -> String
showsPrec :: Int -> ResolveComponentCandidates -> ShowS
$cshowsPrec :: Int -> ResolveComponentCandidates -> ShowS
Prelude.Show, (forall x.
ResolveComponentCandidates -> Rep ResolveComponentCandidates x)
-> (forall x.
Rep ResolveComponentCandidates x -> ResolveComponentCandidates)
-> Generic ResolveComponentCandidates
forall x.
Rep ResolveComponentCandidates x -> ResolveComponentCandidates
forall x.
ResolveComponentCandidates -> Rep ResolveComponentCandidates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResolveComponentCandidates x -> ResolveComponentCandidates
$cfrom :: forall x.
ResolveComponentCandidates -> Rep ResolveComponentCandidates x
Prelude.Generic)
newResolveComponentCandidates ::
ComponentPlatform ->
ResolveComponentCandidates
newResolveComponentCandidates :: ComponentPlatform -> ResolveComponentCandidates
newResolveComponentCandidates ComponentPlatform
pPlatform_ =
ResolveComponentCandidates' :: ComponentPlatform
-> [ComponentCandidate] -> ResolveComponentCandidates
ResolveComponentCandidates'
{ $sel:platform:ResolveComponentCandidates' :: ComponentPlatform
platform = ComponentPlatform
pPlatform_,
$sel:componentCandidates:ResolveComponentCandidates' :: [ComponentCandidate]
componentCandidates = [ComponentCandidate]
forall a. Monoid a => a
Prelude.mempty
}
resolveComponentCandidates_platform :: Lens.Lens' ResolveComponentCandidates ComponentPlatform
resolveComponentCandidates_platform :: (ComponentPlatform -> f ComponentPlatform)
-> ResolveComponentCandidates -> f ResolveComponentCandidates
resolveComponentCandidates_platform = (ResolveComponentCandidates -> ComponentPlatform)
-> (ResolveComponentCandidates
-> ComponentPlatform -> ResolveComponentCandidates)
-> Lens
ResolveComponentCandidates
ResolveComponentCandidates
ComponentPlatform
ComponentPlatform
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolveComponentCandidates' {ComponentPlatform
platform :: ComponentPlatform
$sel:platform:ResolveComponentCandidates' :: ResolveComponentCandidates -> ComponentPlatform
platform} -> ComponentPlatform
platform) (\s :: ResolveComponentCandidates
s@ResolveComponentCandidates' {} ComponentPlatform
a -> ResolveComponentCandidates
s {$sel:platform:ResolveComponentCandidates' :: ComponentPlatform
platform = ComponentPlatform
a} :: ResolveComponentCandidates)
resolveComponentCandidates_componentCandidates :: Lens.Lens' ResolveComponentCandidates [ComponentCandidate]
resolveComponentCandidates_componentCandidates :: ([ComponentCandidate] -> f [ComponentCandidate])
-> ResolveComponentCandidates -> f ResolveComponentCandidates
resolveComponentCandidates_componentCandidates = (ResolveComponentCandidates -> [ComponentCandidate])
-> (ResolveComponentCandidates
-> [ComponentCandidate] -> ResolveComponentCandidates)
-> Lens
ResolveComponentCandidates
ResolveComponentCandidates
[ComponentCandidate]
[ComponentCandidate]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolveComponentCandidates' {[ComponentCandidate]
componentCandidates :: [ComponentCandidate]
$sel:componentCandidates:ResolveComponentCandidates' :: ResolveComponentCandidates -> [ComponentCandidate]
componentCandidates} -> [ComponentCandidate]
componentCandidates) (\s :: ResolveComponentCandidates
s@ResolveComponentCandidates' {} [ComponentCandidate]
a -> ResolveComponentCandidates
s {$sel:componentCandidates:ResolveComponentCandidates' :: [ComponentCandidate]
componentCandidates = [ComponentCandidate]
a} :: ResolveComponentCandidates) (([ComponentCandidate] -> f [ComponentCandidate])
-> ResolveComponentCandidates -> f ResolveComponentCandidates)
-> (([ComponentCandidate] -> f [ComponentCandidate])
-> [ComponentCandidate] -> f [ComponentCandidate])
-> ([ComponentCandidate] -> f [ComponentCandidate])
-> ResolveComponentCandidates
-> f ResolveComponentCandidates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ComponentCandidate] -> f [ComponentCandidate])
-> [ComponentCandidate] -> f [ComponentCandidate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest ResolveComponentCandidates where
type
AWSResponse ResolveComponentCandidates =
ResolveComponentCandidatesResponse
request :: ResolveComponentCandidates -> Request ResolveComponentCandidates
request = Service
-> ResolveComponentCandidates -> Request ResolveComponentCandidates
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ResolveComponentCandidates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResolveComponentCandidates)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ResolveComponentCandidates))
-> Logger
-> Service
-> Proxy ResolveComponentCandidates
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ResolveComponentCandidates)))
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 [ResolvedComponentVersion]
-> Int -> ResolveComponentCandidatesResponse
ResolveComponentCandidatesResponse'
(Maybe [ResolvedComponentVersion]
-> Int -> ResolveComponentCandidatesResponse)
-> Either String (Maybe [ResolvedComponentVersion])
-> Either String (Int -> ResolveComponentCandidatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Key -> Either String (Maybe (Maybe [ResolvedComponentVersion]))
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"resolvedComponentVersions"
Either String (Maybe (Maybe [ResolvedComponentVersion]))
-> Maybe [ResolvedComponentVersion]
-> Either String (Maybe [ResolvedComponentVersion])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ResolvedComponentVersion]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ResolveComponentCandidatesResponse)
-> Either String Int
-> Either String ResolveComponentCandidatesResponse
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 ResolveComponentCandidates
instance Prelude.NFData ResolveComponentCandidates
instance Core.ToHeaders ResolveComponentCandidates where
toHeaders :: ResolveComponentCandidates -> ResponseHeaders
toHeaders =
ResponseHeaders -> ResolveComponentCandidates -> 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 ResolveComponentCandidates where
toJSON :: ResolveComponentCandidates -> Value
toJSON ResolveComponentCandidates' {[ComponentCandidate]
ComponentPlatform
componentCandidates :: [ComponentCandidate]
platform :: ComponentPlatform
$sel:componentCandidates:ResolveComponentCandidates' :: ResolveComponentCandidates -> [ComponentCandidate]
$sel:platform:ResolveComponentCandidates' :: ResolveComponentCandidates -> ComponentPlatform
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Key
"platform" Key -> ComponentPlatform -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= ComponentPlatform
platform),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Key
"componentCandidates" Key -> [ComponentCandidate] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Core..= [ComponentCandidate]
componentCandidates)
]
)
instance Core.ToPath ResolveComponentCandidates where
toPath :: ResolveComponentCandidates -> ByteString
toPath =
ByteString -> ResolveComponentCandidates -> ByteString
forall a b. a -> b -> a
Prelude.const
ByteString
"/greengrass/v2/resolveComponentCandidates"
instance Core.ToQuery ResolveComponentCandidates where
toQuery :: ResolveComponentCandidates -> QueryString
toQuery = QueryString -> ResolveComponentCandidates -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ResolveComponentCandidatesResponse = ResolveComponentCandidatesResponse'
{
ResolveComponentCandidatesResponse
-> Maybe [ResolvedComponentVersion]
resolvedComponentVersions :: Prelude.Maybe [ResolvedComponentVersion],
ResolveComponentCandidatesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ResolveComponentCandidatesResponse
-> ResolveComponentCandidatesResponse -> Bool
(ResolveComponentCandidatesResponse
-> ResolveComponentCandidatesResponse -> Bool)
-> (ResolveComponentCandidatesResponse
-> ResolveComponentCandidatesResponse -> Bool)
-> Eq ResolveComponentCandidatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolveComponentCandidatesResponse
-> ResolveComponentCandidatesResponse -> Bool
$c/= :: ResolveComponentCandidatesResponse
-> ResolveComponentCandidatesResponse -> Bool
== :: ResolveComponentCandidatesResponse
-> ResolveComponentCandidatesResponse -> Bool
$c== :: ResolveComponentCandidatesResponse
-> ResolveComponentCandidatesResponse -> Bool
Prelude.Eq, ReadPrec [ResolveComponentCandidatesResponse]
ReadPrec ResolveComponentCandidatesResponse
Int -> ReadS ResolveComponentCandidatesResponse
ReadS [ResolveComponentCandidatesResponse]
(Int -> ReadS ResolveComponentCandidatesResponse)
-> ReadS [ResolveComponentCandidatesResponse]
-> ReadPrec ResolveComponentCandidatesResponse
-> ReadPrec [ResolveComponentCandidatesResponse]
-> Read ResolveComponentCandidatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolveComponentCandidatesResponse]
$creadListPrec :: ReadPrec [ResolveComponentCandidatesResponse]
readPrec :: ReadPrec ResolveComponentCandidatesResponse
$creadPrec :: ReadPrec ResolveComponentCandidatesResponse
readList :: ReadS [ResolveComponentCandidatesResponse]
$creadList :: ReadS [ResolveComponentCandidatesResponse]
readsPrec :: Int -> ReadS ResolveComponentCandidatesResponse
$creadsPrec :: Int -> ReadS ResolveComponentCandidatesResponse
Prelude.Read, Int -> ResolveComponentCandidatesResponse -> ShowS
[ResolveComponentCandidatesResponse] -> ShowS
ResolveComponentCandidatesResponse -> String
(Int -> ResolveComponentCandidatesResponse -> ShowS)
-> (ResolveComponentCandidatesResponse -> String)
-> ([ResolveComponentCandidatesResponse] -> ShowS)
-> Show ResolveComponentCandidatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolveComponentCandidatesResponse] -> ShowS
$cshowList :: [ResolveComponentCandidatesResponse] -> ShowS
show :: ResolveComponentCandidatesResponse -> String
$cshow :: ResolveComponentCandidatesResponse -> String
showsPrec :: Int -> ResolveComponentCandidatesResponse -> ShowS
$cshowsPrec :: Int -> ResolveComponentCandidatesResponse -> ShowS
Prelude.Show, (forall x.
ResolveComponentCandidatesResponse
-> Rep ResolveComponentCandidatesResponse x)
-> (forall x.
Rep ResolveComponentCandidatesResponse x
-> ResolveComponentCandidatesResponse)
-> Generic ResolveComponentCandidatesResponse
forall x.
Rep ResolveComponentCandidatesResponse x
-> ResolveComponentCandidatesResponse
forall x.
ResolveComponentCandidatesResponse
-> Rep ResolveComponentCandidatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResolveComponentCandidatesResponse x
-> ResolveComponentCandidatesResponse
$cfrom :: forall x.
ResolveComponentCandidatesResponse
-> Rep ResolveComponentCandidatesResponse x
Prelude.Generic)
newResolveComponentCandidatesResponse ::
Prelude.Int ->
ResolveComponentCandidatesResponse
newResolveComponentCandidatesResponse :: Int -> ResolveComponentCandidatesResponse
newResolveComponentCandidatesResponse Int
pHttpStatus_ =
ResolveComponentCandidatesResponse' :: Maybe [ResolvedComponentVersion]
-> Int -> ResolveComponentCandidatesResponse
ResolveComponentCandidatesResponse'
{ $sel:resolvedComponentVersions:ResolveComponentCandidatesResponse' :: Maybe [ResolvedComponentVersion]
resolvedComponentVersions =
Maybe [ResolvedComponentVersion]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ResolveComponentCandidatesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
resolveComponentCandidatesResponse_resolvedComponentVersions :: Lens.Lens' ResolveComponentCandidatesResponse (Prelude.Maybe [ResolvedComponentVersion])
resolveComponentCandidatesResponse_resolvedComponentVersions :: (Maybe [ResolvedComponentVersion]
-> f (Maybe [ResolvedComponentVersion]))
-> ResolveComponentCandidatesResponse
-> f ResolveComponentCandidatesResponse
resolveComponentCandidatesResponse_resolvedComponentVersions = (ResolveComponentCandidatesResponse
-> Maybe [ResolvedComponentVersion])
-> (ResolveComponentCandidatesResponse
-> Maybe [ResolvedComponentVersion]
-> ResolveComponentCandidatesResponse)
-> Lens
ResolveComponentCandidatesResponse
ResolveComponentCandidatesResponse
(Maybe [ResolvedComponentVersion])
(Maybe [ResolvedComponentVersion])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolveComponentCandidatesResponse' {Maybe [ResolvedComponentVersion]
resolvedComponentVersions :: Maybe [ResolvedComponentVersion]
$sel:resolvedComponentVersions:ResolveComponentCandidatesResponse' :: ResolveComponentCandidatesResponse
-> Maybe [ResolvedComponentVersion]
resolvedComponentVersions} -> Maybe [ResolvedComponentVersion]
resolvedComponentVersions) (\s :: ResolveComponentCandidatesResponse
s@ResolveComponentCandidatesResponse' {} Maybe [ResolvedComponentVersion]
a -> ResolveComponentCandidatesResponse
s {$sel:resolvedComponentVersions:ResolveComponentCandidatesResponse' :: Maybe [ResolvedComponentVersion]
resolvedComponentVersions = Maybe [ResolvedComponentVersion]
a} :: ResolveComponentCandidatesResponse) ((Maybe [ResolvedComponentVersion]
-> f (Maybe [ResolvedComponentVersion]))
-> ResolveComponentCandidatesResponse
-> f ResolveComponentCandidatesResponse)
-> ((Maybe [ResolvedComponentVersion]
-> f (Maybe [ResolvedComponentVersion]))
-> Maybe [ResolvedComponentVersion]
-> f (Maybe [ResolvedComponentVersion]))
-> (Maybe [ResolvedComponentVersion]
-> f (Maybe [ResolvedComponentVersion]))
-> ResolveComponentCandidatesResponse
-> f ResolveComponentCandidatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ResolvedComponentVersion]
[ResolvedComponentVersion]
[ResolvedComponentVersion]
[ResolvedComponentVersion]
-> Iso
(Maybe [ResolvedComponentVersion])
(Maybe [ResolvedComponentVersion])
(Maybe [ResolvedComponentVersion])
(Maybe [ResolvedComponentVersion])
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
[ResolvedComponentVersion]
[ResolvedComponentVersion]
[ResolvedComponentVersion]
[ResolvedComponentVersion]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
resolveComponentCandidatesResponse_httpStatus :: Lens.Lens' ResolveComponentCandidatesResponse Prelude.Int
resolveComponentCandidatesResponse_httpStatus :: (Int -> f Int)
-> ResolveComponentCandidatesResponse
-> f ResolveComponentCandidatesResponse
resolveComponentCandidatesResponse_httpStatus = (ResolveComponentCandidatesResponse -> Int)
-> (ResolveComponentCandidatesResponse
-> Int -> ResolveComponentCandidatesResponse)
-> Lens
ResolveComponentCandidatesResponse
ResolveComponentCandidatesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolveComponentCandidatesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ResolveComponentCandidatesResponse' :: ResolveComponentCandidatesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ResolveComponentCandidatesResponse
s@ResolveComponentCandidatesResponse' {} Int
a -> ResolveComponentCandidatesResponse
s {$sel:httpStatus:ResolveComponentCandidatesResponse' :: Int
httpStatus = Int
a} :: ResolveComponentCandidatesResponse)
instance
Prelude.NFData
ResolveComponentCandidatesResponse