{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CodeDeploy.Types.RevisionLocation where
import Amazonka.CodeDeploy.Types.AppSpecContent
import Amazonka.CodeDeploy.Types.GitHubLocation
import Amazonka.CodeDeploy.Types.RawString
import Amazonka.CodeDeploy.Types.RevisionLocationType
import Amazonka.CodeDeploy.Types.S3Location
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RevisionLocation = RevisionLocation'
{
RevisionLocation -> Maybe RawString
string :: Prelude.Maybe RawString,
RevisionLocation -> Maybe RevisionLocationType
revisionType :: Prelude.Maybe RevisionLocationType,
RevisionLocation -> Maybe S3Location
s3Location :: Prelude.Maybe S3Location,
RevisionLocation -> Maybe AppSpecContent
appSpecContent :: Prelude.Maybe AppSpecContent,
RevisionLocation -> Maybe GitHubLocation
gitHubLocation :: Prelude.Maybe GitHubLocation
}
deriving (RevisionLocation -> RevisionLocation -> Bool
(RevisionLocation -> RevisionLocation -> Bool)
-> (RevisionLocation -> RevisionLocation -> Bool)
-> Eq RevisionLocation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevisionLocation -> RevisionLocation -> Bool
$c/= :: RevisionLocation -> RevisionLocation -> Bool
== :: RevisionLocation -> RevisionLocation -> Bool
$c== :: RevisionLocation -> RevisionLocation -> Bool
Prelude.Eq, ReadPrec [RevisionLocation]
ReadPrec RevisionLocation
Int -> ReadS RevisionLocation
ReadS [RevisionLocation]
(Int -> ReadS RevisionLocation)
-> ReadS [RevisionLocation]
-> ReadPrec RevisionLocation
-> ReadPrec [RevisionLocation]
-> Read RevisionLocation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevisionLocation]
$creadListPrec :: ReadPrec [RevisionLocation]
readPrec :: ReadPrec RevisionLocation
$creadPrec :: ReadPrec RevisionLocation
readList :: ReadS [RevisionLocation]
$creadList :: ReadS [RevisionLocation]
readsPrec :: Int -> ReadS RevisionLocation
$creadsPrec :: Int -> ReadS RevisionLocation
Prelude.Read, Int -> RevisionLocation -> ShowS
[RevisionLocation] -> ShowS
RevisionLocation -> String
(Int -> RevisionLocation -> ShowS)
-> (RevisionLocation -> String)
-> ([RevisionLocation] -> ShowS)
-> Show RevisionLocation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevisionLocation] -> ShowS
$cshowList :: [RevisionLocation] -> ShowS
show :: RevisionLocation -> String
$cshow :: RevisionLocation -> String
showsPrec :: Int -> RevisionLocation -> ShowS
$cshowsPrec :: Int -> RevisionLocation -> ShowS
Prelude.Show, (forall x. RevisionLocation -> Rep RevisionLocation x)
-> (forall x. Rep RevisionLocation x -> RevisionLocation)
-> Generic RevisionLocation
forall x. Rep RevisionLocation x -> RevisionLocation
forall x. RevisionLocation -> Rep RevisionLocation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RevisionLocation x -> RevisionLocation
$cfrom :: forall x. RevisionLocation -> Rep RevisionLocation x
Prelude.Generic)
newRevisionLocation ::
RevisionLocation
newRevisionLocation :: RevisionLocation
newRevisionLocation =
RevisionLocation' :: Maybe RawString
-> Maybe RevisionLocationType
-> Maybe S3Location
-> Maybe AppSpecContent
-> Maybe GitHubLocation
-> RevisionLocation
RevisionLocation'
{ $sel:string:RevisionLocation' :: Maybe RawString
string = Maybe RawString
forall a. Maybe a
Prelude.Nothing,
$sel:revisionType:RevisionLocation' :: Maybe RevisionLocationType
revisionType = Maybe RevisionLocationType
forall a. Maybe a
Prelude.Nothing,
$sel:s3Location:RevisionLocation' :: Maybe S3Location
s3Location = Maybe S3Location
forall a. Maybe a
Prelude.Nothing,
$sel:appSpecContent:RevisionLocation' :: Maybe AppSpecContent
appSpecContent = Maybe AppSpecContent
forall a. Maybe a
Prelude.Nothing,
$sel:gitHubLocation:RevisionLocation' :: Maybe GitHubLocation
gitHubLocation = Maybe GitHubLocation
forall a. Maybe a
Prelude.Nothing
}
revisionLocation_string :: Lens.Lens' RevisionLocation (Prelude.Maybe RawString)
revisionLocation_string :: (Maybe RawString -> f (Maybe RawString))
-> RevisionLocation -> f RevisionLocation
revisionLocation_string = (RevisionLocation -> Maybe RawString)
-> (RevisionLocation -> Maybe RawString -> RevisionLocation)
-> Lens
RevisionLocation
RevisionLocation
(Maybe RawString)
(Maybe RawString)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevisionLocation' {Maybe RawString
string :: Maybe RawString
$sel:string:RevisionLocation' :: RevisionLocation -> Maybe RawString
string} -> Maybe RawString
string) (\s :: RevisionLocation
s@RevisionLocation' {} Maybe RawString
a -> RevisionLocation
s {$sel:string:RevisionLocation' :: Maybe RawString
string = Maybe RawString
a} :: RevisionLocation)
revisionLocation_revisionType :: Lens.Lens' RevisionLocation (Prelude.Maybe RevisionLocationType)
revisionLocation_revisionType :: (Maybe RevisionLocationType -> f (Maybe RevisionLocationType))
-> RevisionLocation -> f RevisionLocation
revisionLocation_revisionType = (RevisionLocation -> Maybe RevisionLocationType)
-> (RevisionLocation
-> Maybe RevisionLocationType -> RevisionLocation)
-> Lens
RevisionLocation
RevisionLocation
(Maybe RevisionLocationType)
(Maybe RevisionLocationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevisionLocation' {Maybe RevisionLocationType
revisionType :: Maybe RevisionLocationType
$sel:revisionType:RevisionLocation' :: RevisionLocation -> Maybe RevisionLocationType
revisionType} -> Maybe RevisionLocationType
revisionType) (\s :: RevisionLocation
s@RevisionLocation' {} Maybe RevisionLocationType
a -> RevisionLocation
s {$sel:revisionType:RevisionLocation' :: Maybe RevisionLocationType
revisionType = Maybe RevisionLocationType
a} :: RevisionLocation)
revisionLocation_s3Location :: Lens.Lens' RevisionLocation (Prelude.Maybe S3Location)
revisionLocation_s3Location :: (Maybe S3Location -> f (Maybe S3Location))
-> RevisionLocation -> f RevisionLocation
revisionLocation_s3Location = (RevisionLocation -> Maybe S3Location)
-> (RevisionLocation -> Maybe S3Location -> RevisionLocation)
-> Lens
RevisionLocation
RevisionLocation
(Maybe S3Location)
(Maybe S3Location)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevisionLocation' {Maybe S3Location
s3Location :: Maybe S3Location
$sel:s3Location:RevisionLocation' :: RevisionLocation -> Maybe S3Location
s3Location} -> Maybe S3Location
s3Location) (\s :: RevisionLocation
s@RevisionLocation' {} Maybe S3Location
a -> RevisionLocation
s {$sel:s3Location:RevisionLocation' :: Maybe S3Location
s3Location = Maybe S3Location
a} :: RevisionLocation)
revisionLocation_appSpecContent :: Lens.Lens' RevisionLocation (Prelude.Maybe AppSpecContent)
revisionLocation_appSpecContent :: (Maybe AppSpecContent -> f (Maybe AppSpecContent))
-> RevisionLocation -> f RevisionLocation
revisionLocation_appSpecContent = (RevisionLocation -> Maybe AppSpecContent)
-> (RevisionLocation -> Maybe AppSpecContent -> RevisionLocation)
-> Lens
RevisionLocation
RevisionLocation
(Maybe AppSpecContent)
(Maybe AppSpecContent)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevisionLocation' {Maybe AppSpecContent
appSpecContent :: Maybe AppSpecContent
$sel:appSpecContent:RevisionLocation' :: RevisionLocation -> Maybe AppSpecContent
appSpecContent} -> Maybe AppSpecContent
appSpecContent) (\s :: RevisionLocation
s@RevisionLocation' {} Maybe AppSpecContent
a -> RevisionLocation
s {$sel:appSpecContent:RevisionLocation' :: Maybe AppSpecContent
appSpecContent = Maybe AppSpecContent
a} :: RevisionLocation)
revisionLocation_gitHubLocation :: Lens.Lens' RevisionLocation (Prelude.Maybe GitHubLocation)
revisionLocation_gitHubLocation :: (Maybe GitHubLocation -> f (Maybe GitHubLocation))
-> RevisionLocation -> f RevisionLocation
revisionLocation_gitHubLocation = (RevisionLocation -> Maybe GitHubLocation)
-> (RevisionLocation -> Maybe GitHubLocation -> RevisionLocation)
-> Lens
RevisionLocation
RevisionLocation
(Maybe GitHubLocation)
(Maybe GitHubLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevisionLocation' {Maybe GitHubLocation
gitHubLocation :: Maybe GitHubLocation
$sel:gitHubLocation:RevisionLocation' :: RevisionLocation -> Maybe GitHubLocation
gitHubLocation} -> Maybe GitHubLocation
gitHubLocation) (\s :: RevisionLocation
s@RevisionLocation' {} Maybe GitHubLocation
a -> RevisionLocation
s {$sel:gitHubLocation:RevisionLocation' :: Maybe GitHubLocation
gitHubLocation = Maybe GitHubLocation
a} :: RevisionLocation)
instance Core.FromJSON RevisionLocation where
parseJSON :: Value -> Parser RevisionLocation
parseJSON =
String
-> (Object -> Parser RevisionLocation)
-> Value
-> Parser RevisionLocation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RevisionLocation"
( \Object
x ->
Maybe RawString
-> Maybe RevisionLocationType
-> Maybe S3Location
-> Maybe AppSpecContent
-> Maybe GitHubLocation
-> RevisionLocation
RevisionLocation'
(Maybe RawString
-> Maybe RevisionLocationType
-> Maybe S3Location
-> Maybe AppSpecContent
-> Maybe GitHubLocation
-> RevisionLocation)
-> Parser (Maybe RawString)
-> Parser
(Maybe RevisionLocationType
-> Maybe S3Location
-> Maybe AppSpecContent
-> Maybe GitHubLocation
-> RevisionLocation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe RawString)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"string")
Parser
(Maybe RevisionLocationType
-> Maybe S3Location
-> Maybe AppSpecContent
-> Maybe GitHubLocation
-> RevisionLocation)
-> Parser (Maybe RevisionLocationType)
-> Parser
(Maybe S3Location
-> Maybe AppSpecContent
-> Maybe GitHubLocation
-> RevisionLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RevisionLocationType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"revisionType")
Parser
(Maybe S3Location
-> Maybe AppSpecContent
-> Maybe GitHubLocation
-> RevisionLocation)
-> Parser (Maybe S3Location)
-> Parser
(Maybe AppSpecContent -> Maybe GitHubLocation -> RevisionLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3Location)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3Location")
Parser
(Maybe AppSpecContent -> Maybe GitHubLocation -> RevisionLocation)
-> Parser (Maybe AppSpecContent)
-> Parser (Maybe GitHubLocation -> RevisionLocation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AppSpecContent)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"appSpecContent")
Parser (Maybe GitHubLocation -> RevisionLocation)
-> Parser (Maybe GitHubLocation) -> Parser RevisionLocation
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GitHubLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"gitHubLocation")
)
instance Prelude.Hashable RevisionLocation
instance Prelude.NFData RevisionLocation
instance Core.ToJSON RevisionLocation where
toJSON :: RevisionLocation -> Value
toJSON RevisionLocation' {Maybe AppSpecContent
Maybe GitHubLocation
Maybe RawString
Maybe RevisionLocationType
Maybe S3Location
gitHubLocation :: Maybe GitHubLocation
appSpecContent :: Maybe AppSpecContent
s3Location :: Maybe S3Location
revisionType :: Maybe RevisionLocationType
string :: Maybe RawString
$sel:gitHubLocation:RevisionLocation' :: RevisionLocation -> Maybe GitHubLocation
$sel:appSpecContent:RevisionLocation' :: RevisionLocation -> Maybe AppSpecContent
$sel:s3Location:RevisionLocation' :: RevisionLocation -> Maybe S3Location
$sel:revisionType:RevisionLocation' :: RevisionLocation -> Maybe RevisionLocationType
$sel:string:RevisionLocation' :: RevisionLocation -> Maybe RawString
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"string" Text -> RawString -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RawString -> Pair) -> Maybe RawString -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RawString
string,
(Text
"revisionType" Text -> RevisionLocationType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (RevisionLocationType -> Pair)
-> Maybe RevisionLocationType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RevisionLocationType
revisionType,
(Text
"s3Location" Text -> S3Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3Location -> Pair) -> Maybe S3Location -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3Location
s3Location,
(Text
"appSpecContent" Text -> AppSpecContent -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AppSpecContent -> Pair) -> Maybe AppSpecContent -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AppSpecContent
appSpecContent,
(Text
"gitHubLocation" Text -> GitHubLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(GitHubLocation -> Pair) -> Maybe GitHubLocation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GitHubLocation
gitHubLocation
]
)