module Stratosphere.ManagedBlockchain.Accessor (
        Accessor(..), mkAccessor
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Accessor
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-managedblockchain-accessor.html>
    Accessor {Accessor -> ()
haddock_workaround_ :: (),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-managedblockchain-accessor.html#cfn-managedblockchain-accessor-accessortype>
              Accessor -> Value Text
accessorType :: (Value Prelude.Text),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-managedblockchain-accessor.html#cfn-managedblockchain-accessor-networktype>
              Accessor -> Maybe (Value Text)
networkType :: (Prelude.Maybe (Value Prelude.Text)),
              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-managedblockchain-accessor.html#cfn-managedblockchain-accessor-tags>
              Accessor -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Accessor -> Accessor -> Bool
(Accessor -> Accessor -> Bool)
-> (Accessor -> Accessor -> Bool) -> Eq Accessor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Accessor -> Accessor -> Bool
== :: Accessor -> Accessor -> Bool
$c/= :: Accessor -> Accessor -> Bool
/= :: Accessor -> Accessor -> Bool
Prelude.Eq, Int -> Accessor -> ShowS
[Accessor] -> ShowS
Accessor -> String
(Int -> Accessor -> ShowS)
-> (Accessor -> String) -> ([Accessor] -> ShowS) -> Show Accessor
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Accessor -> ShowS
showsPrec :: Int -> Accessor -> ShowS
$cshow :: Accessor -> String
show :: Accessor -> String
$cshowList :: [Accessor] -> ShowS
showList :: [Accessor] -> ShowS
Prelude.Show)
mkAccessor :: Value Prelude.Text -> Accessor
mkAccessor :: Value Text -> Accessor
mkAccessor Value Text
accessorType
  = Accessor
      {haddock_workaround_ :: ()
haddock_workaround_ = (), accessorType :: Value Text
accessorType = Value Text
accessorType,
       networkType :: Maybe (Value Text)
networkType = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Accessor where
  toResourceProperties :: Accessor -> ResourceProperties
toResourceProperties Accessor {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Accessor -> ()
accessorType :: Accessor -> Value Text
networkType :: Accessor -> Maybe (Value Text)
tags :: Accessor -> Maybe [Tag]
haddock_workaround_ :: ()
accessorType :: Value Text
networkType :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::ManagedBlockchain::Accessor",
         supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"AccessorType" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
accessorType]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"NetworkType" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
networkType,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Accessor where
  toJSON :: Accessor -> Value
toJSON Accessor {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Accessor -> ()
accessorType :: Accessor -> Value Text
networkType :: Accessor -> Maybe (Value Text)
tags :: Accessor -> Maybe [Tag]
haddock_workaround_ :: ()
accessorType :: Value Text
networkType :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"AccessorType" Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= Value Text
accessorType]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"NetworkType" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
networkType,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "AccessorType" Accessor where
  type PropertyType "AccessorType" Accessor = Value Prelude.Text
  set :: PropertyType "AccessorType" Accessor -> Accessor -> Accessor
set PropertyType "AccessorType" Accessor
newValue Accessor {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Accessor -> ()
accessorType :: Accessor -> Value Text
networkType :: Accessor -> Maybe (Value Text)
tags :: Accessor -> Maybe [Tag]
haddock_workaround_ :: ()
accessorType :: Value Text
networkType :: Maybe (Value Text)
tags :: Maybe [Tag]
..} = Accessor {accessorType :: Value Text
accessorType = PropertyType "AccessorType" Accessor
Value Text
newValue, Maybe [Tag]
Maybe (Value Text)
()
haddock_workaround_ :: ()
networkType :: Maybe (Value Text)
tags :: Maybe [Tag]
haddock_workaround_ :: ()
networkType :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
instance Property "NetworkType" Accessor where
  type PropertyType "NetworkType" Accessor = Value Prelude.Text
  set :: PropertyType "NetworkType" Accessor -> Accessor -> Accessor
set PropertyType "NetworkType" Accessor
newValue Accessor {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Accessor -> ()
accessorType :: Accessor -> Value Text
networkType :: Accessor -> Maybe (Value Text)
tags :: Accessor -> Maybe [Tag]
haddock_workaround_ :: ()
accessorType :: Value Text
networkType :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = Accessor {networkType :: Maybe (Value Text)
networkType = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "NetworkType" Accessor
Value Text
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
accessorType :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
accessorType :: Value Text
tags :: Maybe [Tag]
..}
instance Property "Tags" Accessor where
  type PropertyType "Tags" Accessor = [Tag]
  set :: PropertyType "Tags" Accessor -> Accessor -> Accessor
set PropertyType "Tags" Accessor
newValue Accessor {Maybe [Tag]
Maybe (Value Text)
()
Value Text
haddock_workaround_ :: Accessor -> ()
accessorType :: Accessor -> Value Text
networkType :: Accessor -> Maybe (Value Text)
tags :: Accessor -> Maybe [Tag]
haddock_workaround_ :: ()
accessorType :: Value Text
networkType :: Maybe (Value Text)
tags :: Maybe [Tag]
..}
    = Accessor {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Accessor
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
accessorType :: Value Text
networkType :: Maybe (Value Text)
haddock_workaround_ :: ()
accessorType :: Value Text
networkType :: Maybe (Value Text)
..}