module Stratosphere.MediaPackage.Asset ( module Exports, Asset(..), mkAsset ) where import qualified Data.Aeson as JSON import qualified Stratosphere.Prelude as Prelude import Stratosphere.Property import {-# SOURCE #-} Stratosphere.MediaPackage.Asset.EgressEndpointProperty as Exports import Stratosphere.ResourceProperties import Stratosphere.Tag import Stratosphere.Value data Asset = -- | See: Asset {haddock_workaround_ :: (), -- | See: egressEndpoints :: (Prelude.Maybe [EgressEndpointProperty]), -- | See: id :: (Value Prelude.Text), -- | See: packagingGroupId :: (Value Prelude.Text), -- | See: resourceId :: (Prelude.Maybe (Value Prelude.Text)), -- | See: sourceArn :: (Value Prelude.Text), -- | See: sourceRoleArn :: (Value Prelude.Text), -- | See: tags :: (Prelude.Maybe [Tag])} deriving stock (Prelude.Eq, Prelude.Show) mkAsset :: Value Prelude.Text -> Value Prelude.Text -> Value Prelude.Text -> Value Prelude.Text -> Asset mkAsset id packagingGroupId sourceArn sourceRoleArn = Asset {haddock_workaround_ = (), id = id, packagingGroupId = packagingGroupId, sourceArn = sourceArn, sourceRoleArn = sourceRoleArn, egressEndpoints = Prelude.Nothing, resourceId = Prelude.Nothing, tags = Prelude.Nothing} instance ToResourceProperties Asset where toResourceProperties Asset {..} = ResourceProperties {awsType = "AWS::MediaPackage::Asset", supportsTags = Prelude.True, properties = Prelude.fromList ((Prelude.<>) ["Id" JSON..= id, "PackagingGroupId" JSON..= packagingGroupId, "SourceArn" JSON..= sourceArn, "SourceRoleArn" JSON..= sourceRoleArn] (Prelude.catMaybes [(JSON..=) "EgressEndpoints" Prelude.<$> egressEndpoints, (JSON..=) "ResourceId" Prelude.<$> resourceId, (JSON..=) "Tags" Prelude.<$> tags]))} instance JSON.ToJSON Asset where toJSON Asset {..} = JSON.object (Prelude.fromList ((Prelude.<>) ["Id" JSON..= id, "PackagingGroupId" JSON..= packagingGroupId, "SourceArn" JSON..= sourceArn, "SourceRoleArn" JSON..= sourceRoleArn] (Prelude.catMaybes [(JSON..=) "EgressEndpoints" Prelude.<$> egressEndpoints, (JSON..=) "ResourceId" Prelude.<$> resourceId, (JSON..=) "Tags" Prelude.<$> tags]))) instance Property "EgressEndpoints" Asset where type PropertyType "EgressEndpoints" Asset = [EgressEndpointProperty] set newValue Asset {..} = Asset {egressEndpoints = Prelude.pure newValue, ..} instance Property "Id" Asset where type PropertyType "Id" Asset = Value Prelude.Text set newValue Asset {..} = Asset {id = newValue, ..} instance Property "PackagingGroupId" Asset where type PropertyType "PackagingGroupId" Asset = Value Prelude.Text set newValue Asset {..} = Asset {packagingGroupId = newValue, ..} instance Property "ResourceId" Asset where type PropertyType "ResourceId" Asset = Value Prelude.Text set newValue Asset {..} = Asset {resourceId = Prelude.pure newValue, ..} instance Property "SourceArn" Asset where type PropertyType "SourceArn" Asset = Value Prelude.Text set newValue Asset {..} = Asset {sourceArn = newValue, ..} instance Property "SourceRoleArn" Asset where type PropertyType "SourceRoleArn" Asset = Value Prelude.Text set newValue Asset {..} = Asset {sourceRoleArn = newValue, ..} instance Property "Tags" Asset where type PropertyType "Tags" Asset = [Tag] set newValue Asset {..} = Asset {tags = Prelude.pure newValue, ..}