{-# 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.MarketplaceCatalog.Types.EntitySummary
-- 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.MarketplaceCatalog.Types.EntitySummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | This object is a container for common summary information about the
-- entity. The summary doesn\'t contain the whole entity structure, but it
-- does contain information common across all entities.
--
-- /See:/ 'newEntitySummary' smart constructor.
data EntitySummary = EntitySummary'
  { -- | The last time the entity was published, using ISO 8601 format
    -- (2018-02-27T13:45:22Z).
    EntitySummary -> Maybe Text
lastModifiedDate :: Prelude.Maybe Prelude.Text,
    -- | The type of the entity.
    EntitySummary -> Maybe Text
entityType :: Prelude.Maybe Prelude.Text,
    -- | The visibility status of the entity to buyers. This value can be
    -- @Public@ (everyone can view the entity), @Limited@ (the entity is
    -- visible to limited accounts only), or @Restricted@ (the entity was
    -- published and then unpublished and only existing buyers can view it).
    EntitySummary -> Maybe Text
visibility :: Prelude.Maybe Prelude.Text,
    -- | The name for the entity. This value is not unique. It is defined by the
    -- seller.
    EntitySummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier for the entity.
    EntitySummary -> Maybe Text
entityId :: Prelude.Maybe Prelude.Text,
    -- | The ARN associated with the unique identifier for the entity.
    EntitySummary -> Maybe Text
entityArn :: Prelude.Maybe Prelude.Text
  }
  deriving (EntitySummary -> EntitySummary -> Bool
(EntitySummary -> EntitySummary -> Bool)
-> (EntitySummary -> EntitySummary -> Bool) -> Eq EntitySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntitySummary -> EntitySummary -> Bool
$c/= :: EntitySummary -> EntitySummary -> Bool
== :: EntitySummary -> EntitySummary -> Bool
$c== :: EntitySummary -> EntitySummary -> Bool
Prelude.Eq, ReadPrec [EntitySummary]
ReadPrec EntitySummary
Int -> ReadS EntitySummary
ReadS [EntitySummary]
(Int -> ReadS EntitySummary)
-> ReadS [EntitySummary]
-> ReadPrec EntitySummary
-> ReadPrec [EntitySummary]
-> Read EntitySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntitySummary]
$creadListPrec :: ReadPrec [EntitySummary]
readPrec :: ReadPrec EntitySummary
$creadPrec :: ReadPrec EntitySummary
readList :: ReadS [EntitySummary]
$creadList :: ReadS [EntitySummary]
readsPrec :: Int -> ReadS EntitySummary
$creadsPrec :: Int -> ReadS EntitySummary
Prelude.Read, Int -> EntitySummary -> ShowS
[EntitySummary] -> ShowS
EntitySummary -> String
(Int -> EntitySummary -> ShowS)
-> (EntitySummary -> String)
-> ([EntitySummary] -> ShowS)
-> Show EntitySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntitySummary] -> ShowS
$cshowList :: [EntitySummary] -> ShowS
show :: EntitySummary -> String
$cshow :: EntitySummary -> String
showsPrec :: Int -> EntitySummary -> ShowS
$cshowsPrec :: Int -> EntitySummary -> ShowS
Prelude.Show, (forall x. EntitySummary -> Rep EntitySummary x)
-> (forall x. Rep EntitySummary x -> EntitySummary)
-> Generic EntitySummary
forall x. Rep EntitySummary x -> EntitySummary
forall x. EntitySummary -> Rep EntitySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EntitySummary x -> EntitySummary
$cfrom :: forall x. EntitySummary -> Rep EntitySummary x
Prelude.Generic)

-- |
-- Create a value of 'EntitySummary' 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', 'entitySummary_lastModifiedDate' - The last time the entity was published, using ISO 8601 format
-- (2018-02-27T13:45:22Z).
--
-- 'entityType', 'entitySummary_entityType' - The type of the entity.
--
-- 'visibility', 'entitySummary_visibility' - The visibility status of the entity to buyers. This value can be
-- @Public@ (everyone can view the entity), @Limited@ (the entity is
-- visible to limited accounts only), or @Restricted@ (the entity was
-- published and then unpublished and only existing buyers can view it).
--
-- 'name', 'entitySummary_name' - The name for the entity. This value is not unique. It is defined by the
-- seller.
--
-- 'entityId', 'entitySummary_entityId' - The unique identifier for the entity.
--
-- 'entityArn', 'entitySummary_entityArn' - The ARN associated with the unique identifier for the entity.
newEntitySummary ::
  EntitySummary
newEntitySummary :: EntitySummary
newEntitySummary =
  EntitySummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EntitySummary
EntitySummary'
    { $sel:lastModifiedDate:EntitySummary' :: Maybe Text
lastModifiedDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:entityType:EntitySummary' :: Maybe Text
entityType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:visibility:EntitySummary' :: Maybe Text
visibility = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:EntitySummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:entityId:EntitySummary' :: Maybe Text
entityId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:entityArn:EntitySummary' :: Maybe Text
entityArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The last time the entity was published, using ISO 8601 format
-- (2018-02-27T13:45:22Z).
entitySummary_lastModifiedDate :: Lens.Lens' EntitySummary (Prelude.Maybe Prelude.Text)
entitySummary_lastModifiedDate :: (Maybe Text -> f (Maybe Text)) -> EntitySummary -> f EntitySummary
entitySummary_lastModifiedDate = (EntitySummary -> Maybe Text)
-> (EntitySummary -> Maybe Text -> EntitySummary)
-> Lens EntitySummary EntitySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitySummary' {Maybe Text
lastModifiedDate :: Maybe Text
$sel:lastModifiedDate:EntitySummary' :: EntitySummary -> Maybe Text
lastModifiedDate} -> Maybe Text
lastModifiedDate) (\s :: EntitySummary
s@EntitySummary' {} Maybe Text
a -> EntitySummary
s {$sel:lastModifiedDate:EntitySummary' :: Maybe Text
lastModifiedDate = Maybe Text
a} :: EntitySummary)

-- | The type of the entity.
entitySummary_entityType :: Lens.Lens' EntitySummary (Prelude.Maybe Prelude.Text)
entitySummary_entityType :: (Maybe Text -> f (Maybe Text)) -> EntitySummary -> f EntitySummary
entitySummary_entityType = (EntitySummary -> Maybe Text)
-> (EntitySummary -> Maybe Text -> EntitySummary)
-> Lens EntitySummary EntitySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitySummary' {Maybe Text
entityType :: Maybe Text
$sel:entityType:EntitySummary' :: EntitySummary -> Maybe Text
entityType} -> Maybe Text
entityType) (\s :: EntitySummary
s@EntitySummary' {} Maybe Text
a -> EntitySummary
s {$sel:entityType:EntitySummary' :: Maybe Text
entityType = Maybe Text
a} :: EntitySummary)

-- | The visibility status of the entity to buyers. This value can be
-- @Public@ (everyone can view the entity), @Limited@ (the entity is
-- visible to limited accounts only), or @Restricted@ (the entity was
-- published and then unpublished and only existing buyers can view it).
entitySummary_visibility :: Lens.Lens' EntitySummary (Prelude.Maybe Prelude.Text)
entitySummary_visibility :: (Maybe Text -> f (Maybe Text)) -> EntitySummary -> f EntitySummary
entitySummary_visibility = (EntitySummary -> Maybe Text)
-> (EntitySummary -> Maybe Text -> EntitySummary)
-> Lens EntitySummary EntitySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitySummary' {Maybe Text
visibility :: Maybe Text
$sel:visibility:EntitySummary' :: EntitySummary -> Maybe Text
visibility} -> Maybe Text
visibility) (\s :: EntitySummary
s@EntitySummary' {} Maybe Text
a -> EntitySummary
s {$sel:visibility:EntitySummary' :: Maybe Text
visibility = Maybe Text
a} :: EntitySummary)

-- | The name for the entity. This value is not unique. It is defined by the
-- seller.
entitySummary_name :: Lens.Lens' EntitySummary (Prelude.Maybe Prelude.Text)
entitySummary_name :: (Maybe Text -> f (Maybe Text)) -> EntitySummary -> f EntitySummary
entitySummary_name = (EntitySummary -> Maybe Text)
-> (EntitySummary -> Maybe Text -> EntitySummary)
-> Lens EntitySummary EntitySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitySummary' {Maybe Text
name :: Maybe Text
$sel:name:EntitySummary' :: EntitySummary -> Maybe Text
name} -> Maybe Text
name) (\s :: EntitySummary
s@EntitySummary' {} Maybe Text
a -> EntitySummary
s {$sel:name:EntitySummary' :: Maybe Text
name = Maybe Text
a} :: EntitySummary)

-- | The unique identifier for the entity.
entitySummary_entityId :: Lens.Lens' EntitySummary (Prelude.Maybe Prelude.Text)
entitySummary_entityId :: (Maybe Text -> f (Maybe Text)) -> EntitySummary -> f EntitySummary
entitySummary_entityId = (EntitySummary -> Maybe Text)
-> (EntitySummary -> Maybe Text -> EntitySummary)
-> Lens EntitySummary EntitySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitySummary' {Maybe Text
entityId :: Maybe Text
$sel:entityId:EntitySummary' :: EntitySummary -> Maybe Text
entityId} -> Maybe Text
entityId) (\s :: EntitySummary
s@EntitySummary' {} Maybe Text
a -> EntitySummary
s {$sel:entityId:EntitySummary' :: Maybe Text
entityId = Maybe Text
a} :: EntitySummary)

-- | The ARN associated with the unique identifier for the entity.
entitySummary_entityArn :: Lens.Lens' EntitySummary (Prelude.Maybe Prelude.Text)
entitySummary_entityArn :: (Maybe Text -> f (Maybe Text)) -> EntitySummary -> f EntitySummary
entitySummary_entityArn = (EntitySummary -> Maybe Text)
-> (EntitySummary -> Maybe Text -> EntitySummary)
-> Lens EntitySummary EntitySummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitySummary' {Maybe Text
entityArn :: Maybe Text
$sel:entityArn:EntitySummary' :: EntitySummary -> Maybe Text
entityArn} -> Maybe Text
entityArn) (\s :: EntitySummary
s@EntitySummary' {} Maybe Text
a -> EntitySummary
s {$sel:entityArn:EntitySummary' :: Maybe Text
entityArn = Maybe Text
a} :: EntitySummary)

instance Core.FromJSON EntitySummary where
  parseJSON :: Value -> Parser EntitySummary
parseJSON =
    String
-> (Object -> Parser EntitySummary)
-> Value
-> Parser EntitySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EntitySummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EntitySummary
EntitySummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> EntitySummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> EntitySummary)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> EntitySummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> EntitySummary)
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
"EntityType")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> EntitySummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> EntitySummary)
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
"Visibility")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> EntitySummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> EntitySummary)
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 Text -> Maybe Text -> EntitySummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> EntitySummary)
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
"EntityId")
            Parser (Maybe Text -> EntitySummary)
-> Parser (Maybe Text) -> Parser EntitySummary
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
"EntityArn")
      )

instance Prelude.Hashable EntitySummary

instance Prelude.NFData EntitySummary