{-# 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.Pinpoint.Types.SegmentImportResource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Pinpoint.Types.DefinitionFormat
import qualified Amazonka.Prelude as Prelude
data SegmentImportResource = SegmentImportResource'
{
SegmentImportResource -> Maybe (HashMap Text Int)
channelCounts :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int),
SegmentImportResource -> DefinitionFormat
format :: DefinitionFormat,
SegmentImportResource -> Text
s3Url :: Prelude.Text,
SegmentImportResource -> Int
size :: Prelude.Int,
SegmentImportResource -> Text
externalId :: Prelude.Text,
SegmentImportResource -> Text
roleArn :: Prelude.Text
}
deriving (SegmentImportResource -> SegmentImportResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SegmentImportResource -> SegmentImportResource -> Bool
$c/= :: SegmentImportResource -> SegmentImportResource -> Bool
== :: SegmentImportResource -> SegmentImportResource -> Bool
$c== :: SegmentImportResource -> SegmentImportResource -> Bool
Prelude.Eq, ReadPrec [SegmentImportResource]
ReadPrec SegmentImportResource
Int -> ReadS SegmentImportResource
ReadS [SegmentImportResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SegmentImportResource]
$creadListPrec :: ReadPrec [SegmentImportResource]
readPrec :: ReadPrec SegmentImportResource
$creadPrec :: ReadPrec SegmentImportResource
readList :: ReadS [SegmentImportResource]
$creadList :: ReadS [SegmentImportResource]
readsPrec :: Int -> ReadS SegmentImportResource
$creadsPrec :: Int -> ReadS SegmentImportResource
Prelude.Read, Int -> SegmentImportResource -> ShowS
[SegmentImportResource] -> ShowS
SegmentImportResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SegmentImportResource] -> ShowS
$cshowList :: [SegmentImportResource] -> ShowS
show :: SegmentImportResource -> String
$cshow :: SegmentImportResource -> String
showsPrec :: Int -> SegmentImportResource -> ShowS
$cshowsPrec :: Int -> SegmentImportResource -> ShowS
Prelude.Show, forall x. Rep SegmentImportResource x -> SegmentImportResource
forall x. SegmentImportResource -> Rep SegmentImportResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SegmentImportResource x -> SegmentImportResource
$cfrom :: forall x. SegmentImportResource -> Rep SegmentImportResource x
Prelude.Generic)
newSegmentImportResource ::
DefinitionFormat ->
Prelude.Text ->
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
SegmentImportResource
newSegmentImportResource :: DefinitionFormat
-> Text -> Int -> Text -> Text -> SegmentImportResource
newSegmentImportResource
DefinitionFormat
pFormat_
Text
pS3Url_
Int
pSize_
Text
pExternalId_
Text
pRoleArn_ =
SegmentImportResource'
{ $sel:channelCounts:SegmentImportResource' :: Maybe (HashMap Text Int)
channelCounts =
forall a. Maybe a
Prelude.Nothing,
$sel:format:SegmentImportResource' :: DefinitionFormat
format = DefinitionFormat
pFormat_,
$sel:s3Url:SegmentImportResource' :: Text
s3Url = Text
pS3Url_,
$sel:size:SegmentImportResource' :: Int
size = Int
pSize_,
$sel:externalId:SegmentImportResource' :: Text
externalId = Text
pExternalId_,
$sel:roleArn:SegmentImportResource' :: Text
roleArn = Text
pRoleArn_
}
segmentImportResource_channelCounts :: Lens.Lens' SegmentImportResource (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Int))
segmentImportResource_channelCounts :: Lens' SegmentImportResource (Maybe (HashMap Text Int))
segmentImportResource_channelCounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentImportResource' {Maybe (HashMap Text Int)
channelCounts :: Maybe (HashMap Text Int)
$sel:channelCounts:SegmentImportResource' :: SegmentImportResource -> Maybe (HashMap Text Int)
channelCounts} -> Maybe (HashMap Text Int)
channelCounts) (\s :: SegmentImportResource
s@SegmentImportResource' {} Maybe (HashMap Text Int)
a -> SegmentImportResource
s {$sel:channelCounts:SegmentImportResource' :: Maybe (HashMap Text Int)
channelCounts = Maybe (HashMap Text Int)
a} :: SegmentImportResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
segmentImportResource_format :: Lens.Lens' SegmentImportResource DefinitionFormat
segmentImportResource_format :: Lens' SegmentImportResource DefinitionFormat
segmentImportResource_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentImportResource' {DefinitionFormat
format :: DefinitionFormat
$sel:format:SegmentImportResource' :: SegmentImportResource -> DefinitionFormat
format} -> DefinitionFormat
format) (\s :: SegmentImportResource
s@SegmentImportResource' {} DefinitionFormat
a -> SegmentImportResource
s {$sel:format:SegmentImportResource' :: DefinitionFormat
format = DefinitionFormat
a} :: SegmentImportResource)
segmentImportResource_s3Url :: Lens.Lens' SegmentImportResource Prelude.Text
segmentImportResource_s3Url :: Lens' SegmentImportResource Text
segmentImportResource_s3Url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentImportResource' {Text
s3Url :: Text
$sel:s3Url:SegmentImportResource' :: SegmentImportResource -> Text
s3Url} -> Text
s3Url) (\s :: SegmentImportResource
s@SegmentImportResource' {} Text
a -> SegmentImportResource
s {$sel:s3Url:SegmentImportResource' :: Text
s3Url = Text
a} :: SegmentImportResource)
segmentImportResource_size :: Lens.Lens' SegmentImportResource Prelude.Int
segmentImportResource_size :: Lens' SegmentImportResource Int
segmentImportResource_size = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentImportResource' {Int
size :: Int
$sel:size:SegmentImportResource' :: SegmentImportResource -> Int
size} -> Int
size) (\s :: SegmentImportResource
s@SegmentImportResource' {} Int
a -> SegmentImportResource
s {$sel:size:SegmentImportResource' :: Int
size = Int
a} :: SegmentImportResource)
segmentImportResource_externalId :: Lens.Lens' SegmentImportResource Prelude.Text
segmentImportResource_externalId :: Lens' SegmentImportResource Text
segmentImportResource_externalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentImportResource' {Text
externalId :: Text
$sel:externalId:SegmentImportResource' :: SegmentImportResource -> Text
externalId} -> Text
externalId) (\s :: SegmentImportResource
s@SegmentImportResource' {} Text
a -> SegmentImportResource
s {$sel:externalId:SegmentImportResource' :: Text
externalId = Text
a} :: SegmentImportResource)
segmentImportResource_roleArn :: Lens.Lens' SegmentImportResource Prelude.Text
segmentImportResource_roleArn :: Lens' SegmentImportResource Text
segmentImportResource_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentImportResource' {Text
roleArn :: Text
$sel:roleArn:SegmentImportResource' :: SegmentImportResource -> Text
roleArn} -> Text
roleArn) (\s :: SegmentImportResource
s@SegmentImportResource' {} Text
a -> SegmentImportResource
s {$sel:roleArn:SegmentImportResource' :: Text
roleArn = Text
a} :: SegmentImportResource)
instance Data.FromJSON SegmentImportResource where
parseJSON :: Value -> Parser SegmentImportResource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SegmentImportResource"
( \Object
x ->
Maybe (HashMap Text Int)
-> DefinitionFormat
-> Text
-> Int
-> Text
-> Text
-> SegmentImportResource
SegmentImportResource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ChannelCounts" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Format")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"S3Url")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Size")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ExternalId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RoleArn")
)
instance Prelude.Hashable SegmentImportResource where
hashWithSalt :: Int -> SegmentImportResource -> Int
hashWithSalt Int
_salt SegmentImportResource' {Int
Maybe (HashMap Text Int)
Text
DefinitionFormat
roleArn :: Text
externalId :: Text
size :: Int
s3Url :: Text
format :: DefinitionFormat
channelCounts :: Maybe (HashMap Text Int)
$sel:roleArn:SegmentImportResource' :: SegmentImportResource -> Text
$sel:externalId:SegmentImportResource' :: SegmentImportResource -> Text
$sel:size:SegmentImportResource' :: SegmentImportResource -> Int
$sel:s3Url:SegmentImportResource' :: SegmentImportResource -> Text
$sel:format:SegmentImportResource' :: SegmentImportResource -> DefinitionFormat
$sel:channelCounts:SegmentImportResource' :: SegmentImportResource -> Maybe (HashMap Text Int)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Int)
channelCounts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DefinitionFormat
format
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3Url
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
size
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
externalId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
instance Prelude.NFData SegmentImportResource where
rnf :: SegmentImportResource -> ()
rnf SegmentImportResource' {Int
Maybe (HashMap Text Int)
Text
DefinitionFormat
roleArn :: Text
externalId :: Text
size :: Int
s3Url :: Text
format :: DefinitionFormat
channelCounts :: Maybe (HashMap Text Int)
$sel:roleArn:SegmentImportResource' :: SegmentImportResource -> Text
$sel:externalId:SegmentImportResource' :: SegmentImportResource -> Text
$sel:size:SegmentImportResource' :: SegmentImportResource -> Int
$sel:s3Url:SegmentImportResource' :: SegmentImportResource -> Text
$sel:format:SegmentImportResource' :: SegmentImportResource -> DefinitionFormat
$sel:channelCounts:SegmentImportResource' :: SegmentImportResource -> Maybe (HashMap Text Int)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Int)
channelCounts
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DefinitionFormat
format
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
s3Url
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
size
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
externalId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn