{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Pinpoint.Types.SegmentResponse
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.SegmentResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.SegmentDimensions
import Amazonka.Pinpoint.Types.SegmentGroupList
import Amazonka.Pinpoint.Types.SegmentImportResource
import Amazonka.Pinpoint.Types.SegmentType
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the configuration, dimension, and other
-- settings for a segment.
--
-- /See:/ 'newSegmentResponse' smart constructor.
data SegmentResponse = SegmentResponse'
  { -- | The date and time when the segment was last modified.
    SegmentResponse -> Maybe Text
lastModifiedDate :: Prelude.Maybe Prelude.Text,
    -- | A list of one or more segment groups that apply to the segment. Each
    -- segment group consists of zero or more base segments and the dimensions
    -- that are applied to those base segments.
    SegmentResponse -> Maybe SegmentGroupList
segmentGroups :: Prelude.Maybe SegmentGroupList,
    -- | The name of the segment.
    SegmentResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The version number of the segment.
    SegmentResponse -> Maybe Int
version :: Prelude.Maybe Prelude.Int,
    -- | The settings for the import job that\'s associated with the segment.
    SegmentResponse -> Maybe SegmentImportResource
importDefinition :: Prelude.Maybe SegmentImportResource,
    -- | The dimension settings for the segment.
    SegmentResponse -> Maybe SegmentDimensions
dimensions :: Prelude.Maybe SegmentDimensions,
    -- | A string-to-string map of key-value pairs that identifies the tags that
    -- are associated with the segment. Each tag consists of a required tag key
    -- and an associated tag value.
    SegmentResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The segment type. Valid values are:
    --
    -- -   DIMENSIONAL - A dynamic segment, which is a segment that uses
    --     selection criteria that you specify and is based on endpoint data
    --     that\'s reported by your app. Dynamic segments can change over time.
    --
    -- -   IMPORT - A static segment, which is a segment that uses selection
    --     criteria that you specify and is based on endpoint definitions that
    --     you import from a file. Imported segments are static; they don\'t
    --     change over time.
    SegmentResponse -> SegmentType
segmentType :: SegmentType,
    -- | The date and time when the segment was created.
    SegmentResponse -> Text
creationDate :: Prelude.Text,
    -- | The unique identifier for the segment.
    SegmentResponse -> Text
id :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the segment.
    SegmentResponse -> Text
arn :: Prelude.Text,
    -- | The unique identifier for the application that the segment is associated
    -- with.
    SegmentResponse -> Text
applicationId :: Prelude.Text
  }
  deriving (SegmentResponse -> SegmentResponse -> Bool
(SegmentResponse -> SegmentResponse -> Bool)
-> (SegmentResponse -> SegmentResponse -> Bool)
-> Eq SegmentResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SegmentResponse -> SegmentResponse -> Bool
$c/= :: SegmentResponse -> SegmentResponse -> Bool
== :: SegmentResponse -> SegmentResponse -> Bool
$c== :: SegmentResponse -> SegmentResponse -> Bool
Prelude.Eq, ReadPrec [SegmentResponse]
ReadPrec SegmentResponse
Int -> ReadS SegmentResponse
ReadS [SegmentResponse]
(Int -> ReadS SegmentResponse)
-> ReadS [SegmentResponse]
-> ReadPrec SegmentResponse
-> ReadPrec [SegmentResponse]
-> Read SegmentResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SegmentResponse]
$creadListPrec :: ReadPrec [SegmentResponse]
readPrec :: ReadPrec SegmentResponse
$creadPrec :: ReadPrec SegmentResponse
readList :: ReadS [SegmentResponse]
$creadList :: ReadS [SegmentResponse]
readsPrec :: Int -> ReadS SegmentResponse
$creadsPrec :: Int -> ReadS SegmentResponse
Prelude.Read, Int -> SegmentResponse -> ShowS
[SegmentResponse] -> ShowS
SegmentResponse -> String
(Int -> SegmentResponse -> ShowS)
-> (SegmentResponse -> String)
-> ([SegmentResponse] -> ShowS)
-> Show SegmentResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SegmentResponse] -> ShowS
$cshowList :: [SegmentResponse] -> ShowS
show :: SegmentResponse -> String
$cshow :: SegmentResponse -> String
showsPrec :: Int -> SegmentResponse -> ShowS
$cshowsPrec :: Int -> SegmentResponse -> ShowS
Prelude.Show, (forall x. SegmentResponse -> Rep SegmentResponse x)
-> (forall x. Rep SegmentResponse x -> SegmentResponse)
-> Generic SegmentResponse
forall x. Rep SegmentResponse x -> SegmentResponse
forall x. SegmentResponse -> Rep SegmentResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SegmentResponse x -> SegmentResponse
$cfrom :: forall x. SegmentResponse -> Rep SegmentResponse x
Prelude.Generic)

-- |
-- Create a value of 'SegmentResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'lastModifiedDate', 'segmentResponse_lastModifiedDate' - The date and time when the segment was last modified.
--
-- 'segmentGroups', 'segmentResponse_segmentGroups' - A list of one or more segment groups that apply to the segment. Each
-- segment group consists of zero or more base segments and the dimensions
-- that are applied to those base segments.
--
-- 'name', 'segmentResponse_name' - The name of the segment.
--
-- 'version', 'segmentResponse_version' - The version number of the segment.
--
-- 'importDefinition', 'segmentResponse_importDefinition' - The settings for the import job that\'s associated with the segment.
--
-- 'dimensions', 'segmentResponse_dimensions' - The dimension settings for the segment.
--
-- 'tags', 'segmentResponse_tags' - A string-to-string map of key-value pairs that identifies the tags that
-- are associated with the segment. Each tag consists of a required tag key
-- and an associated tag value.
--
-- 'segmentType', 'segmentResponse_segmentType' - The segment type. Valid values are:
--
-- -   DIMENSIONAL - A dynamic segment, which is a segment that uses
--     selection criteria that you specify and is based on endpoint data
--     that\'s reported by your app. Dynamic segments can change over time.
--
-- -   IMPORT - A static segment, which is a segment that uses selection
--     criteria that you specify and is based on endpoint definitions that
--     you import from a file. Imported segments are static; they don\'t
--     change over time.
--
-- 'creationDate', 'segmentResponse_creationDate' - The date and time when the segment was created.
--
-- 'id', 'segmentResponse_id' - The unique identifier for the segment.
--
-- 'arn', 'segmentResponse_arn' - The Amazon Resource Name (ARN) of the segment.
--
-- 'applicationId', 'segmentResponse_applicationId' - The unique identifier for the application that the segment is associated
-- with.
newSegmentResponse ::
  -- | 'segmentType'
  SegmentType ->
  -- | 'creationDate'
  Prelude.Text ->
  -- | 'id'
  Prelude.Text ->
  -- | 'arn'
  Prelude.Text ->
  -- | 'applicationId'
  Prelude.Text ->
  SegmentResponse
newSegmentResponse :: SegmentType -> Text -> Text -> Text -> Text -> SegmentResponse
newSegmentResponse
  SegmentType
pSegmentType_
  Text
pCreationDate_
  Text
pId_
  Text
pArn_
  Text
pApplicationId_ =
    SegmentResponse' :: Maybe Text
-> Maybe SegmentGroupList
-> Maybe Text
-> Maybe Int
-> Maybe SegmentImportResource
-> Maybe SegmentDimensions
-> Maybe (HashMap Text Text)
-> SegmentType
-> Text
-> Text
-> Text
-> Text
-> SegmentResponse
SegmentResponse'
      { $sel:lastModifiedDate:SegmentResponse' :: Maybe Text
lastModifiedDate =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:segmentGroups:SegmentResponse' :: Maybe SegmentGroupList
segmentGroups = Maybe SegmentGroupList
forall a. Maybe a
Prelude.Nothing,
        $sel:name:SegmentResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:version:SegmentResponse' :: Maybe Int
version = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:importDefinition:SegmentResponse' :: Maybe SegmentImportResource
importDefinition = Maybe SegmentImportResource
forall a. Maybe a
Prelude.Nothing,
        $sel:dimensions:SegmentResponse' :: Maybe SegmentDimensions
dimensions = Maybe SegmentDimensions
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:SegmentResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:segmentType:SegmentResponse' :: SegmentType
segmentType = SegmentType
pSegmentType_,
        $sel:creationDate:SegmentResponse' :: Text
creationDate = Text
pCreationDate_,
        $sel:id:SegmentResponse' :: Text
id = Text
pId_,
        $sel:arn:SegmentResponse' :: Text
arn = Text
pArn_,
        $sel:applicationId:SegmentResponse' :: Text
applicationId = Text
pApplicationId_
      }

-- | The date and time when the segment was last modified.
segmentResponse_lastModifiedDate :: Lens.Lens' SegmentResponse (Prelude.Maybe Prelude.Text)
segmentResponse_lastModifiedDate :: (Maybe Text -> f (Maybe Text))
-> SegmentResponse -> f SegmentResponse
segmentResponse_lastModifiedDate = (SegmentResponse -> Maybe Text)
-> (SegmentResponse -> Maybe Text -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Maybe Text
lastModifiedDate :: Maybe Text
$sel:lastModifiedDate:SegmentResponse' :: SegmentResponse -> Maybe Text
lastModifiedDate} -> Maybe Text
lastModifiedDate) (\s :: SegmentResponse
s@SegmentResponse' {} Maybe Text
a -> SegmentResponse
s {$sel:lastModifiedDate:SegmentResponse' :: Maybe Text
lastModifiedDate = Maybe Text
a} :: SegmentResponse)

-- | A list of one or more segment groups that apply to the segment. Each
-- segment group consists of zero or more base segments and the dimensions
-- that are applied to those base segments.
segmentResponse_segmentGroups :: Lens.Lens' SegmentResponse (Prelude.Maybe SegmentGroupList)
segmentResponse_segmentGroups :: (Maybe SegmentGroupList -> f (Maybe SegmentGroupList))
-> SegmentResponse -> f SegmentResponse
segmentResponse_segmentGroups = (SegmentResponse -> Maybe SegmentGroupList)
-> (SegmentResponse -> Maybe SegmentGroupList -> SegmentResponse)
-> Lens
     SegmentResponse
     SegmentResponse
     (Maybe SegmentGroupList)
     (Maybe SegmentGroupList)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Maybe SegmentGroupList
segmentGroups :: Maybe SegmentGroupList
$sel:segmentGroups:SegmentResponse' :: SegmentResponse -> Maybe SegmentGroupList
segmentGroups} -> Maybe SegmentGroupList
segmentGroups) (\s :: SegmentResponse
s@SegmentResponse' {} Maybe SegmentGroupList
a -> SegmentResponse
s {$sel:segmentGroups:SegmentResponse' :: Maybe SegmentGroupList
segmentGroups = Maybe SegmentGroupList
a} :: SegmentResponse)

-- | The name of the segment.
segmentResponse_name :: Lens.Lens' SegmentResponse (Prelude.Maybe Prelude.Text)
segmentResponse_name :: (Maybe Text -> f (Maybe Text))
-> SegmentResponse -> f SegmentResponse
segmentResponse_name = (SegmentResponse -> Maybe Text)
-> (SegmentResponse -> Maybe Text -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Maybe Text
name :: Maybe Text
$sel:name:SegmentResponse' :: SegmentResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: SegmentResponse
s@SegmentResponse' {} Maybe Text
a -> SegmentResponse
s {$sel:name:SegmentResponse' :: Maybe Text
name = Maybe Text
a} :: SegmentResponse)

-- | The version number of the segment.
segmentResponse_version :: Lens.Lens' SegmentResponse (Prelude.Maybe Prelude.Int)
segmentResponse_version :: (Maybe Int -> f (Maybe Int))
-> SegmentResponse -> f SegmentResponse
segmentResponse_version = (SegmentResponse -> Maybe Int)
-> (SegmentResponse -> Maybe Int -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Maybe Int
version :: Maybe Int
$sel:version:SegmentResponse' :: SegmentResponse -> Maybe Int
version} -> Maybe Int
version) (\s :: SegmentResponse
s@SegmentResponse' {} Maybe Int
a -> SegmentResponse
s {$sel:version:SegmentResponse' :: Maybe Int
version = Maybe Int
a} :: SegmentResponse)

-- | The settings for the import job that\'s associated with the segment.
segmentResponse_importDefinition :: Lens.Lens' SegmentResponse (Prelude.Maybe SegmentImportResource)
segmentResponse_importDefinition :: (Maybe SegmentImportResource -> f (Maybe SegmentImportResource))
-> SegmentResponse -> f SegmentResponse
segmentResponse_importDefinition = (SegmentResponse -> Maybe SegmentImportResource)
-> (SegmentResponse
    -> Maybe SegmentImportResource -> SegmentResponse)
-> Lens
     SegmentResponse
     SegmentResponse
     (Maybe SegmentImportResource)
     (Maybe SegmentImportResource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Maybe SegmentImportResource
importDefinition :: Maybe SegmentImportResource
$sel:importDefinition:SegmentResponse' :: SegmentResponse -> Maybe SegmentImportResource
importDefinition} -> Maybe SegmentImportResource
importDefinition) (\s :: SegmentResponse
s@SegmentResponse' {} Maybe SegmentImportResource
a -> SegmentResponse
s {$sel:importDefinition:SegmentResponse' :: Maybe SegmentImportResource
importDefinition = Maybe SegmentImportResource
a} :: SegmentResponse)

-- | The dimension settings for the segment.
segmentResponse_dimensions :: Lens.Lens' SegmentResponse (Prelude.Maybe SegmentDimensions)
segmentResponse_dimensions :: (Maybe SegmentDimensions -> f (Maybe SegmentDimensions))
-> SegmentResponse -> f SegmentResponse
segmentResponse_dimensions = (SegmentResponse -> Maybe SegmentDimensions)
-> (SegmentResponse -> Maybe SegmentDimensions -> SegmentResponse)
-> Lens
     SegmentResponse
     SegmentResponse
     (Maybe SegmentDimensions)
     (Maybe SegmentDimensions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Maybe SegmentDimensions
dimensions :: Maybe SegmentDimensions
$sel:dimensions:SegmentResponse' :: SegmentResponse -> Maybe SegmentDimensions
dimensions} -> Maybe SegmentDimensions
dimensions) (\s :: SegmentResponse
s@SegmentResponse' {} Maybe SegmentDimensions
a -> SegmentResponse
s {$sel:dimensions:SegmentResponse' :: Maybe SegmentDimensions
dimensions = Maybe SegmentDimensions
a} :: SegmentResponse)

-- | A string-to-string map of key-value pairs that identifies the tags that
-- are associated with the segment. Each tag consists of a required tag key
-- and an associated tag value.
segmentResponse_tags :: Lens.Lens' SegmentResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
segmentResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SegmentResponse -> f SegmentResponse
segmentResponse_tags = (SegmentResponse -> Maybe (HashMap Text Text))
-> (SegmentResponse
    -> Maybe (HashMap Text Text) -> SegmentResponse)
-> Lens
     SegmentResponse
     SegmentResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:SegmentResponse' :: SegmentResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: SegmentResponse
s@SegmentResponse' {} Maybe (HashMap Text Text)
a -> SegmentResponse
s {$sel:tags:SegmentResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: SegmentResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> SegmentResponse -> f SegmentResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> SegmentResponse
-> f SegmentResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The segment type. Valid values are:
--
-- -   DIMENSIONAL - A dynamic segment, which is a segment that uses
--     selection criteria that you specify and is based on endpoint data
--     that\'s reported by your app. Dynamic segments can change over time.
--
-- -   IMPORT - A static segment, which is a segment that uses selection
--     criteria that you specify and is based on endpoint definitions that
--     you import from a file. Imported segments are static; they don\'t
--     change over time.
segmentResponse_segmentType :: Lens.Lens' SegmentResponse SegmentType
segmentResponse_segmentType :: (SegmentType -> f SegmentType)
-> SegmentResponse -> f SegmentResponse
segmentResponse_segmentType = (SegmentResponse -> SegmentType)
-> (SegmentResponse -> SegmentType -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse SegmentType SegmentType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {SegmentType
segmentType :: SegmentType
$sel:segmentType:SegmentResponse' :: SegmentResponse -> SegmentType
segmentType} -> SegmentType
segmentType) (\s :: SegmentResponse
s@SegmentResponse' {} SegmentType
a -> SegmentResponse
s {$sel:segmentType:SegmentResponse' :: SegmentType
segmentType = SegmentType
a} :: SegmentResponse)

-- | The date and time when the segment was created.
segmentResponse_creationDate :: Lens.Lens' SegmentResponse Prelude.Text
segmentResponse_creationDate :: (Text -> f Text) -> SegmentResponse -> f SegmentResponse
segmentResponse_creationDate = (SegmentResponse -> Text)
-> (SegmentResponse -> Text -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Text
creationDate :: Text
$sel:creationDate:SegmentResponse' :: SegmentResponse -> Text
creationDate} -> Text
creationDate) (\s :: SegmentResponse
s@SegmentResponse' {} Text
a -> SegmentResponse
s {$sel:creationDate:SegmentResponse' :: Text
creationDate = Text
a} :: SegmentResponse)

-- | The unique identifier for the segment.
segmentResponse_id :: Lens.Lens' SegmentResponse Prelude.Text
segmentResponse_id :: (Text -> f Text) -> SegmentResponse -> f SegmentResponse
segmentResponse_id = (SegmentResponse -> Text)
-> (SegmentResponse -> Text -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Text
id :: Text
$sel:id:SegmentResponse' :: SegmentResponse -> Text
id} -> Text
id) (\s :: SegmentResponse
s@SegmentResponse' {} Text
a -> SegmentResponse
s {$sel:id:SegmentResponse' :: Text
id = Text
a} :: SegmentResponse)

-- | The Amazon Resource Name (ARN) of the segment.
segmentResponse_arn :: Lens.Lens' SegmentResponse Prelude.Text
segmentResponse_arn :: (Text -> f Text) -> SegmentResponse -> f SegmentResponse
segmentResponse_arn = (SegmentResponse -> Text)
-> (SegmentResponse -> Text -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Text
arn :: Text
$sel:arn:SegmentResponse' :: SegmentResponse -> Text
arn} -> Text
arn) (\s :: SegmentResponse
s@SegmentResponse' {} Text
a -> SegmentResponse
s {$sel:arn:SegmentResponse' :: Text
arn = Text
a} :: SegmentResponse)

-- | The unique identifier for the application that the segment is associated
-- with.
segmentResponse_applicationId :: Lens.Lens' SegmentResponse Prelude.Text
segmentResponse_applicationId :: (Text -> f Text) -> SegmentResponse -> f SegmentResponse
segmentResponse_applicationId = (SegmentResponse -> Text)
-> (SegmentResponse -> Text -> SegmentResponse)
-> Lens SegmentResponse SegmentResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentResponse' {Text
applicationId :: Text
$sel:applicationId:SegmentResponse' :: SegmentResponse -> Text
applicationId} -> Text
applicationId) (\s :: SegmentResponse
s@SegmentResponse' {} Text
a -> SegmentResponse
s {$sel:applicationId:SegmentResponse' :: Text
applicationId = Text
a} :: SegmentResponse)

instance Core.FromJSON SegmentResponse where
  parseJSON :: Value -> Parser SegmentResponse
parseJSON =
    String
-> (Object -> Parser SegmentResponse)
-> Value
-> Parser SegmentResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SegmentResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe SegmentGroupList
-> Maybe Text
-> Maybe Int
-> Maybe SegmentImportResource
-> Maybe SegmentDimensions
-> Maybe (HashMap Text Text)
-> SegmentType
-> Text
-> Text
-> Text
-> Text
-> SegmentResponse
SegmentResponse'
            (Maybe Text
 -> Maybe SegmentGroupList
 -> Maybe Text
 -> Maybe Int
 -> Maybe SegmentImportResource
 -> Maybe SegmentDimensions
 -> Maybe (HashMap Text Text)
 -> SegmentType
 -> Text
 -> Text
 -> Text
 -> Text
 -> SegmentResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe SegmentGroupList
      -> Maybe Text
      -> Maybe Int
      -> Maybe SegmentImportResource
      -> Maybe SegmentDimensions
      -> Maybe (HashMap Text Text)
      -> SegmentType
      -> Text
      -> Text
      -> Text
      -> Text
      -> SegmentResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastModifiedDate")
            Parser
  (Maybe SegmentGroupList
   -> Maybe Text
   -> Maybe Int
   -> Maybe SegmentImportResource
   -> Maybe SegmentDimensions
   -> Maybe (HashMap Text Text)
   -> SegmentType
   -> Text
   -> Text
   -> Text
   -> Text
   -> SegmentResponse)
-> Parser (Maybe SegmentGroupList)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe SegmentImportResource
      -> Maybe SegmentDimensions
      -> Maybe (HashMap Text Text)
      -> SegmentType
      -> Text
      -> Text
      -> Text
      -> Text
      -> SegmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SegmentGroupList)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SegmentGroups")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe SegmentImportResource
   -> Maybe SegmentDimensions
   -> Maybe (HashMap Text Text)
   -> SegmentType
   -> Text
   -> Text
   -> Text
   -> Text
   -> SegmentResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe SegmentImportResource
      -> Maybe SegmentDimensions
      -> Maybe (HashMap Text Text)
      -> SegmentType
      -> Text
      -> Text
      -> Text
      -> Text
      -> SegmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Int
   -> Maybe SegmentImportResource
   -> Maybe SegmentDimensions
   -> Maybe (HashMap Text Text)
   -> SegmentType
   -> Text
   -> Text
   -> Text
   -> Text
   -> SegmentResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe SegmentImportResource
      -> Maybe SegmentDimensions
      -> Maybe (HashMap Text Text)
      -> SegmentType
      -> Text
      -> Text
      -> Text
      -> Text
      -> SegmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Version")
            Parser
  (Maybe SegmentImportResource
   -> Maybe SegmentDimensions
   -> Maybe (HashMap Text Text)
   -> SegmentType
   -> Text
   -> Text
   -> Text
   -> Text
   -> SegmentResponse)
-> Parser (Maybe SegmentImportResource)
-> Parser
     (Maybe SegmentDimensions
      -> Maybe (HashMap Text Text)
      -> SegmentType
      -> Text
      -> Text
      -> Text
      -> Text
      -> SegmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SegmentImportResource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ImportDefinition")
            Parser
  (Maybe SegmentDimensions
   -> Maybe (HashMap Text Text)
   -> SegmentType
   -> Text
   -> Text
   -> Text
   -> Text
   -> SegmentResponse)
-> Parser (Maybe SegmentDimensions)
-> Parser
     (Maybe (HashMap Text Text)
      -> SegmentType -> Text -> Text -> Text -> Text -> SegmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SegmentDimensions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Dimensions")
            Parser
  (Maybe (HashMap Text Text)
   -> SegmentType -> Text -> Text -> Text -> Text -> SegmentResponse)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (SegmentType -> Text -> Text -> Text -> Text -> SegmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (SegmentType -> Text -> Text -> Text -> Text -> SegmentResponse)
-> Parser SegmentType
-> Parser (Text -> Text -> Text -> Text -> SegmentResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SegmentType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SegmentType")
            Parser (Text -> Text -> Text -> Text -> SegmentResponse)
-> Parser Text -> Parser (Text -> Text -> Text -> SegmentResponse)
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
"CreationDate")
            Parser (Text -> Text -> Text -> SegmentResponse)
-> Parser Text -> Parser (Text -> Text -> SegmentResponse)
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
"Id")
            Parser (Text -> Text -> SegmentResponse)
-> Parser Text -> Parser (Text -> SegmentResponse)
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
"Arn")
            Parser (Text -> SegmentResponse)
-> Parser Text -> Parser SegmentResponse
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
"ApplicationId")
      )

instance Prelude.Hashable SegmentResponse

instance Prelude.NFData SegmentResponse