{-# 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.Lens as Lens
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
(SegmentImportResource -> SegmentImportResource -> Bool)
-> (SegmentImportResource -> SegmentImportResource -> Bool)
-> Eq SegmentImportResource
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]
(Int -> ReadS SegmentImportResource)
-> ReadS [SegmentImportResource]
-> ReadPrec SegmentImportResource
-> ReadPrec [SegmentImportResource]
-> Read 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
(Int -> SegmentImportResource -> ShowS)
-> (SegmentImportResource -> String)
-> ([SegmentImportResource] -> ShowS)
-> Show SegmentImportResource
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. SegmentImportResource -> Rep SegmentImportResource x)
-> (forall x. Rep SegmentImportResource x -> SegmentImportResource)
-> Generic SegmentImportResource
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' :: Maybe (HashMap Text Int)
-> DefinitionFormat
-> Text
-> Int
-> Text
-> Text
-> SegmentImportResource
SegmentImportResource'
{ $sel:channelCounts:SegmentImportResource' :: Maybe (HashMap Text Int)
channelCounts =
Maybe (HashMap Text Int)
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 :: (Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> SegmentImportResource -> f SegmentImportResource
segmentImportResource_channelCounts = (SegmentImportResource -> Maybe (HashMap Text Int))
-> (SegmentImportResource
-> Maybe (HashMap Text Int) -> SegmentImportResource)
-> Lens
SegmentImportResource
SegmentImportResource
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
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) ((Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> SegmentImportResource -> f SegmentImportResource)
-> ((Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> (Maybe (HashMap Text Int) -> f (Maybe (HashMap Text Int)))
-> SegmentImportResource
-> f SegmentImportResource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
-> Iso
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
(Maybe (HashMap Text Int))
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 AnIso
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
(HashMap Text Int)
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 :: (DefinitionFormat -> f DefinitionFormat)
-> SegmentImportResource -> f SegmentImportResource
segmentImportResource_format = (SegmentImportResource -> DefinitionFormat)
-> (SegmentImportResource
-> DefinitionFormat -> SegmentImportResource)
-> Lens
SegmentImportResource
SegmentImportResource
DefinitionFormat
DefinitionFormat
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 :: (Text -> f Text)
-> SegmentImportResource -> f SegmentImportResource
segmentImportResource_s3Url = (SegmentImportResource -> Text)
-> (SegmentImportResource -> Text -> SegmentImportResource)
-> Lens SegmentImportResource SegmentImportResource Text Text
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 :: (Int -> f Int) -> SegmentImportResource -> f SegmentImportResource
segmentImportResource_size = (SegmentImportResource -> Int)
-> (SegmentImportResource -> Int -> SegmentImportResource)
-> Lens SegmentImportResource SegmentImportResource Int Int
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 :: (Text -> f Text)
-> SegmentImportResource -> f SegmentImportResource
segmentImportResource_externalId = (SegmentImportResource -> Text)
-> (SegmentImportResource -> Text -> SegmentImportResource)
-> Lens SegmentImportResource SegmentImportResource Text Text
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 :: (Text -> f Text)
-> SegmentImportResource -> f SegmentImportResource
segmentImportResource_roleArn = (SegmentImportResource -> Text)
-> (SegmentImportResource -> Text -> SegmentImportResource)
-> Lens SegmentImportResource SegmentImportResource Text Text
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 Core.FromJSON SegmentImportResource where
parseJSON :: Value -> Parser SegmentImportResource
parseJSON =
String
-> (Object -> Parser SegmentImportResource)
-> Value
-> Parser SegmentImportResource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SegmentImportResource"
( \Object
x ->
Maybe (HashMap Text Int)
-> DefinitionFormat
-> Text
-> Int
-> Text
-> Text
-> SegmentImportResource
SegmentImportResource'
(Maybe (HashMap Text Int)
-> DefinitionFormat
-> Text
-> Int
-> Text
-> Text
-> SegmentImportResource)
-> Parser (Maybe (HashMap Text Int))
-> Parser
(DefinitionFormat
-> Text -> Int -> Text -> Text -> SegmentImportResource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Int)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ChannelCounts" Parser (Maybe (Maybe (HashMap Text Int)))
-> Maybe (HashMap Text Int) -> Parser (Maybe (HashMap Text Int))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Int)
forall a. Monoid a => a
Prelude.mempty)
Parser
(DefinitionFormat
-> Text -> Int -> Text -> Text -> SegmentImportResource)
-> Parser DefinitionFormat
-> Parser (Text -> Int -> Text -> Text -> SegmentImportResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DefinitionFormat
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Format")
Parser (Text -> Int -> Text -> Text -> SegmentImportResource)
-> Parser Text
-> Parser (Int -> Text -> Text -> SegmentImportResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3Url")
Parser (Int -> Text -> Text -> SegmentImportResource)
-> Parser Int -> Parser (Text -> Text -> SegmentImportResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Size")
Parser (Text -> Text -> SegmentImportResource)
-> Parser Text -> Parser (Text -> SegmentImportResource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ExternalId")
Parser (Text -> SegmentImportResource)
-> Parser Text -> Parser SegmentImportResource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RoleArn")
)
instance Prelude.Hashable SegmentImportResource
instance Prelude.NFData SegmentImportResource