module Stratosphere.IoT.ThingPrincipalAttachment (
        ThingPrincipalAttachment(..), mkThingPrincipalAttachment
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data ThingPrincipalAttachment
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-thingprincipalattachment.html>
    ThingPrincipalAttachment {ThingPrincipalAttachment -> ()
haddock_workaround_ :: (),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-thingprincipalattachment.html#cfn-iot-thingprincipalattachment-principal>
                              ThingPrincipalAttachment -> Value Text
principal :: (Value Prelude.Text),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-thingprincipalattachment.html#cfn-iot-thingprincipalattachment-thingname>
                              ThingPrincipalAttachment -> Value Text
thingName :: (Value Prelude.Text),
                              -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iot-thingprincipalattachment.html#cfn-iot-thingprincipalattachment-thingprincipaltype>
                              ThingPrincipalAttachment -> Maybe (Value Text)
thingPrincipalType :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (ThingPrincipalAttachment -> ThingPrincipalAttachment -> Bool
(ThingPrincipalAttachment -> ThingPrincipalAttachment -> Bool)
-> (ThingPrincipalAttachment -> ThingPrincipalAttachment -> Bool)
-> Eq ThingPrincipalAttachment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ThingPrincipalAttachment -> ThingPrincipalAttachment -> Bool
== :: ThingPrincipalAttachment -> ThingPrincipalAttachment -> Bool
$c/= :: ThingPrincipalAttachment -> ThingPrincipalAttachment -> Bool
/= :: ThingPrincipalAttachment -> ThingPrincipalAttachment -> Bool
Prelude.Eq, Int -> ThingPrincipalAttachment -> ShowS
[ThingPrincipalAttachment] -> ShowS
ThingPrincipalAttachment -> String
(Int -> ThingPrincipalAttachment -> ShowS)
-> (ThingPrincipalAttachment -> String)
-> ([ThingPrincipalAttachment] -> ShowS)
-> Show ThingPrincipalAttachment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ThingPrincipalAttachment -> ShowS
showsPrec :: Int -> ThingPrincipalAttachment -> ShowS
$cshow :: ThingPrincipalAttachment -> String
show :: ThingPrincipalAttachment -> String
$cshowList :: [ThingPrincipalAttachment] -> ShowS
showList :: [ThingPrincipalAttachment] -> ShowS
Prelude.Show)
mkThingPrincipalAttachment ::
  Value Prelude.Text
  -> Value Prelude.Text -> ThingPrincipalAttachment
mkThingPrincipalAttachment :: Value Text -> Value Text -> ThingPrincipalAttachment
mkThingPrincipalAttachment Value Text
principal Value Text
thingName
  = ThingPrincipalAttachment
      {haddock_workaround_ :: ()
haddock_workaround_ = (), principal :: Value Text
principal = Value Text
principal,
       thingName :: Value Text
thingName = Value Text
thingName, thingPrincipalType :: Maybe (Value Text)
thingPrincipalType = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ThingPrincipalAttachment where
  toResourceProperties :: ThingPrincipalAttachment -> ResourceProperties
toResourceProperties ThingPrincipalAttachment {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ThingPrincipalAttachment -> ()
principal :: ThingPrincipalAttachment -> Value Text
thingName :: ThingPrincipalAttachment -> Value Text
thingPrincipalType :: ThingPrincipalAttachment -> Maybe (Value Text)
haddock_workaround_ :: ()
principal :: Value Text
thingName :: Value Text
thingPrincipalType :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::IoT::ThingPrincipalAttachment",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         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
"Principal" 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
principal, Key
"ThingName" 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
thingName]
                           ([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
"ThingPrincipalType" (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)
thingPrincipalType]))}
instance JSON.ToJSON ThingPrincipalAttachment where
  toJSON :: ThingPrincipalAttachment -> Value
toJSON ThingPrincipalAttachment {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ThingPrincipalAttachment -> ()
principal :: ThingPrincipalAttachment -> Value Text
thingName :: ThingPrincipalAttachment -> Value Text
thingPrincipalType :: ThingPrincipalAttachment -> Maybe (Value Text)
haddock_workaround_ :: ()
principal :: Value Text
thingName :: Value Text
thingPrincipalType :: Maybe (Value Text)
..}
    = [(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
"Principal" 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
principal, Key
"ThingName" 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
thingName]
              ([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
"ThingPrincipalType" (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)
thingPrincipalType])))
instance Property "Principal" ThingPrincipalAttachment where
  type PropertyType "Principal" ThingPrincipalAttachment = Value Prelude.Text
  set :: PropertyType "Principal" ThingPrincipalAttachment
-> ThingPrincipalAttachment -> ThingPrincipalAttachment
set PropertyType "Principal" ThingPrincipalAttachment
newValue ThingPrincipalAttachment {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ThingPrincipalAttachment -> ()
principal :: ThingPrincipalAttachment -> Value Text
thingName :: ThingPrincipalAttachment -> Value Text
thingPrincipalType :: ThingPrincipalAttachment -> Maybe (Value Text)
haddock_workaround_ :: ()
principal :: Value Text
thingName :: Value Text
thingPrincipalType :: Maybe (Value Text)
..}
    = ThingPrincipalAttachment {principal :: Value Text
principal = PropertyType "Principal" ThingPrincipalAttachment
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
thingName :: Value Text
thingPrincipalType :: Maybe (Value Text)
haddock_workaround_ :: ()
thingName :: Value Text
thingPrincipalType :: Maybe (Value Text)
..}
instance Property "ThingName" ThingPrincipalAttachment where
  type PropertyType "ThingName" ThingPrincipalAttachment = Value Prelude.Text
  set :: PropertyType "ThingName" ThingPrincipalAttachment
-> ThingPrincipalAttachment -> ThingPrincipalAttachment
set PropertyType "ThingName" ThingPrincipalAttachment
newValue ThingPrincipalAttachment {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ThingPrincipalAttachment -> ()
principal :: ThingPrincipalAttachment -> Value Text
thingName :: ThingPrincipalAttachment -> Value Text
thingPrincipalType :: ThingPrincipalAttachment -> Maybe (Value Text)
haddock_workaround_ :: ()
principal :: Value Text
thingName :: Value Text
thingPrincipalType :: Maybe (Value Text)
..}
    = ThingPrincipalAttachment {thingName :: Value Text
thingName = PropertyType "ThingName" ThingPrincipalAttachment
Value Text
newValue, Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ()
principal :: Value Text
thingPrincipalType :: Maybe (Value Text)
haddock_workaround_ :: ()
principal :: Value Text
thingPrincipalType :: Maybe (Value Text)
..}
instance Property "ThingPrincipalType" ThingPrincipalAttachment where
  type PropertyType "ThingPrincipalType" ThingPrincipalAttachment = Value Prelude.Text
  set :: PropertyType "ThingPrincipalType" ThingPrincipalAttachment
-> ThingPrincipalAttachment -> ThingPrincipalAttachment
set PropertyType "ThingPrincipalType" ThingPrincipalAttachment
newValue ThingPrincipalAttachment {Maybe (Value Text)
()
Value Text
haddock_workaround_ :: ThingPrincipalAttachment -> ()
principal :: ThingPrincipalAttachment -> Value Text
thingName :: ThingPrincipalAttachment -> Value Text
thingPrincipalType :: ThingPrincipalAttachment -> Maybe (Value Text)
haddock_workaround_ :: ()
principal :: Value Text
thingName :: Value Text
thingPrincipalType :: Maybe (Value Text)
..}
    = ThingPrincipalAttachment
        {thingPrincipalType :: Maybe (Value Text)
thingPrincipalType = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ThingPrincipalType" ThingPrincipalAttachment
Value Text
newValue, ()
Value Text
haddock_workaround_ :: ()
principal :: Value Text
thingName :: Value Text
haddock_workaround_ :: ()
principal :: Value Text
thingName :: Value Text
..}