{-# 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.Inspector.Types.AssetAttributes
-- 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.Inspector.Types.AssetAttributes where

import qualified Amazonka.Core as Core
import Amazonka.Inspector.Types.NetworkInterface
import Amazonka.Inspector.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A collection of attributes of the host from which the finding is
-- generated.
--
-- /See:/ 'newAssetAttributes' smart constructor.
data AssetAttributes = AssetAttributes'
  { -- | The hostname of the EC2 instance where the finding is generated.
    AssetAttributes -> Maybe Text
hostname :: Prelude.Maybe Prelude.Text,
    -- | The Auto Scaling group of the EC2 instance where the finding is
    -- generated.
    AssetAttributes -> Maybe Text
autoScalingGroup :: Prelude.Maybe Prelude.Text,
    -- | An array of the network interfaces interacting with the EC2 instance
    -- where the finding is generated.
    AssetAttributes -> Maybe [NetworkInterface]
networkInterfaces :: Prelude.Maybe [NetworkInterface],
    -- | The list of IP v4 addresses of the EC2 instance where the finding is
    -- generated.
    AssetAttributes -> Maybe [Text]
ipv4Addresses :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the agent that is installed on the EC2 instance where the
    -- finding is generated.
    AssetAttributes -> Maybe Text
agentId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Machine Image (AMI) that is installed on the EC2
    -- instance where the finding is generated.
    AssetAttributes -> Maybe Text
amiId :: Prelude.Maybe Prelude.Text,
    -- | The tags related to the EC2 instance where the finding is generated.
    AssetAttributes -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The schema version of this data type.
    AssetAttributes -> Natural
schemaVersion :: Prelude.Natural
  }
  deriving (AssetAttributes -> AssetAttributes -> Bool
(AssetAttributes -> AssetAttributes -> Bool)
-> (AssetAttributes -> AssetAttributes -> Bool)
-> Eq AssetAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssetAttributes -> AssetAttributes -> Bool
$c/= :: AssetAttributes -> AssetAttributes -> Bool
== :: AssetAttributes -> AssetAttributes -> Bool
$c== :: AssetAttributes -> AssetAttributes -> Bool
Prelude.Eq, ReadPrec [AssetAttributes]
ReadPrec AssetAttributes
Int -> ReadS AssetAttributes
ReadS [AssetAttributes]
(Int -> ReadS AssetAttributes)
-> ReadS [AssetAttributes]
-> ReadPrec AssetAttributes
-> ReadPrec [AssetAttributes]
-> Read AssetAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssetAttributes]
$creadListPrec :: ReadPrec [AssetAttributes]
readPrec :: ReadPrec AssetAttributes
$creadPrec :: ReadPrec AssetAttributes
readList :: ReadS [AssetAttributes]
$creadList :: ReadS [AssetAttributes]
readsPrec :: Int -> ReadS AssetAttributes
$creadsPrec :: Int -> ReadS AssetAttributes
Prelude.Read, Int -> AssetAttributes -> ShowS
[AssetAttributes] -> ShowS
AssetAttributes -> String
(Int -> AssetAttributes -> ShowS)
-> (AssetAttributes -> String)
-> ([AssetAttributes] -> ShowS)
-> Show AssetAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssetAttributes] -> ShowS
$cshowList :: [AssetAttributes] -> ShowS
show :: AssetAttributes -> String
$cshow :: AssetAttributes -> String
showsPrec :: Int -> AssetAttributes -> ShowS
$cshowsPrec :: Int -> AssetAttributes -> ShowS
Prelude.Show, (forall x. AssetAttributes -> Rep AssetAttributes x)
-> (forall x. Rep AssetAttributes x -> AssetAttributes)
-> Generic AssetAttributes
forall x. Rep AssetAttributes x -> AssetAttributes
forall x. AssetAttributes -> Rep AssetAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssetAttributes x -> AssetAttributes
$cfrom :: forall x. AssetAttributes -> Rep AssetAttributes x
Prelude.Generic)

-- |
-- Create a value of 'AssetAttributes' 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:
--
-- 'hostname', 'assetAttributes_hostname' - The hostname of the EC2 instance where the finding is generated.
--
-- 'autoScalingGroup', 'assetAttributes_autoScalingGroup' - The Auto Scaling group of the EC2 instance where the finding is
-- generated.
--
-- 'networkInterfaces', 'assetAttributes_networkInterfaces' - An array of the network interfaces interacting with the EC2 instance
-- where the finding is generated.
--
-- 'ipv4Addresses', 'assetAttributes_ipv4Addresses' - The list of IP v4 addresses of the EC2 instance where the finding is
-- generated.
--
-- 'agentId', 'assetAttributes_agentId' - The ID of the agent that is installed on the EC2 instance where the
-- finding is generated.
--
-- 'amiId', 'assetAttributes_amiId' - The ID of the Amazon Machine Image (AMI) that is installed on the EC2
-- instance where the finding is generated.
--
-- 'tags', 'assetAttributes_tags' - The tags related to the EC2 instance where the finding is generated.
--
-- 'schemaVersion', 'assetAttributes_schemaVersion' - The schema version of this data type.
newAssetAttributes ::
  -- | 'schemaVersion'
  Prelude.Natural ->
  AssetAttributes
newAssetAttributes :: Natural -> AssetAttributes
newAssetAttributes Natural
pSchemaVersion_ =
  AssetAttributes' :: Maybe Text
-> Maybe Text
-> Maybe [NetworkInterface]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Natural
-> AssetAttributes
AssetAttributes'
    { $sel:hostname:AssetAttributes' :: Maybe Text
hostname = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:autoScalingGroup:AssetAttributes' :: Maybe Text
autoScalingGroup = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaces:AssetAttributes' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
forall a. Maybe a
Prelude.Nothing,
      $sel:ipv4Addresses:AssetAttributes' :: Maybe [Text]
ipv4Addresses = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:agentId:AssetAttributes' :: Maybe Text
agentId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:amiId:AssetAttributes' :: Maybe Text
amiId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:AssetAttributes' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:schemaVersion:AssetAttributes' :: Natural
schemaVersion = Natural
pSchemaVersion_
    }

-- | The hostname of the EC2 instance where the finding is generated.
assetAttributes_hostname :: Lens.Lens' AssetAttributes (Prelude.Maybe Prelude.Text)
assetAttributes_hostname :: (Maybe Text -> f (Maybe Text))
-> AssetAttributes -> f AssetAttributes
assetAttributes_hostname = (AssetAttributes -> Maybe Text)
-> (AssetAttributes -> Maybe Text -> AssetAttributes)
-> Lens AssetAttributes AssetAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Maybe Text
hostname :: Maybe Text
$sel:hostname:AssetAttributes' :: AssetAttributes -> Maybe Text
hostname} -> Maybe Text
hostname) (\s :: AssetAttributes
s@AssetAttributes' {} Maybe Text
a -> AssetAttributes
s {$sel:hostname:AssetAttributes' :: Maybe Text
hostname = Maybe Text
a} :: AssetAttributes)

-- | The Auto Scaling group of the EC2 instance where the finding is
-- generated.
assetAttributes_autoScalingGroup :: Lens.Lens' AssetAttributes (Prelude.Maybe Prelude.Text)
assetAttributes_autoScalingGroup :: (Maybe Text -> f (Maybe Text))
-> AssetAttributes -> f AssetAttributes
assetAttributes_autoScalingGroup = (AssetAttributes -> Maybe Text)
-> (AssetAttributes -> Maybe Text -> AssetAttributes)
-> Lens AssetAttributes AssetAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Maybe Text
autoScalingGroup :: Maybe Text
$sel:autoScalingGroup:AssetAttributes' :: AssetAttributes -> Maybe Text
autoScalingGroup} -> Maybe Text
autoScalingGroup) (\s :: AssetAttributes
s@AssetAttributes' {} Maybe Text
a -> AssetAttributes
s {$sel:autoScalingGroup:AssetAttributes' :: Maybe Text
autoScalingGroup = Maybe Text
a} :: AssetAttributes)

-- | An array of the network interfaces interacting with the EC2 instance
-- where the finding is generated.
assetAttributes_networkInterfaces :: Lens.Lens' AssetAttributes (Prelude.Maybe [NetworkInterface])
assetAttributes_networkInterfaces :: (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> AssetAttributes -> f AssetAttributes
assetAttributes_networkInterfaces = (AssetAttributes -> Maybe [NetworkInterface])
-> (AssetAttributes -> Maybe [NetworkInterface] -> AssetAttributes)
-> Lens
     AssetAttributes
     AssetAttributes
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Maybe [NetworkInterface]
networkInterfaces :: Maybe [NetworkInterface]
$sel:networkInterfaces:AssetAttributes' :: AssetAttributes -> Maybe [NetworkInterface]
networkInterfaces} -> Maybe [NetworkInterface]
networkInterfaces) (\s :: AssetAttributes
s@AssetAttributes' {} Maybe [NetworkInterface]
a -> AssetAttributes
s {$sel:networkInterfaces:AssetAttributes' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
a} :: AssetAttributes) ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
 -> AssetAttributes -> f AssetAttributes)
-> ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
    -> Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> AssetAttributes
-> f AssetAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
-> Iso
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
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
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of IP v4 addresses of the EC2 instance where the finding is
-- generated.
assetAttributes_ipv4Addresses :: Lens.Lens' AssetAttributes (Prelude.Maybe [Prelude.Text])
assetAttributes_ipv4Addresses :: (Maybe [Text] -> f (Maybe [Text]))
-> AssetAttributes -> f AssetAttributes
assetAttributes_ipv4Addresses = (AssetAttributes -> Maybe [Text])
-> (AssetAttributes -> Maybe [Text] -> AssetAttributes)
-> Lens
     AssetAttributes AssetAttributes (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Maybe [Text]
ipv4Addresses :: Maybe [Text]
$sel:ipv4Addresses:AssetAttributes' :: AssetAttributes -> Maybe [Text]
ipv4Addresses} -> Maybe [Text]
ipv4Addresses) (\s :: AssetAttributes
s@AssetAttributes' {} Maybe [Text]
a -> AssetAttributes
s {$sel:ipv4Addresses:AssetAttributes' :: Maybe [Text]
ipv4Addresses = Maybe [Text]
a} :: AssetAttributes) ((Maybe [Text] -> f (Maybe [Text]))
 -> AssetAttributes -> f AssetAttributes)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AssetAttributes
-> f AssetAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the agent that is installed on the EC2 instance where the
-- finding is generated.
assetAttributes_agentId :: Lens.Lens' AssetAttributes (Prelude.Maybe Prelude.Text)
assetAttributes_agentId :: (Maybe Text -> f (Maybe Text))
-> AssetAttributes -> f AssetAttributes
assetAttributes_agentId = (AssetAttributes -> Maybe Text)
-> (AssetAttributes -> Maybe Text -> AssetAttributes)
-> Lens AssetAttributes AssetAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Maybe Text
agentId :: Maybe Text
$sel:agentId:AssetAttributes' :: AssetAttributes -> Maybe Text
agentId} -> Maybe Text
agentId) (\s :: AssetAttributes
s@AssetAttributes' {} Maybe Text
a -> AssetAttributes
s {$sel:agentId:AssetAttributes' :: Maybe Text
agentId = Maybe Text
a} :: AssetAttributes)

-- | The ID of the Amazon Machine Image (AMI) that is installed on the EC2
-- instance where the finding is generated.
assetAttributes_amiId :: Lens.Lens' AssetAttributes (Prelude.Maybe Prelude.Text)
assetAttributes_amiId :: (Maybe Text -> f (Maybe Text))
-> AssetAttributes -> f AssetAttributes
assetAttributes_amiId = (AssetAttributes -> Maybe Text)
-> (AssetAttributes -> Maybe Text -> AssetAttributes)
-> Lens AssetAttributes AssetAttributes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Maybe Text
amiId :: Maybe Text
$sel:amiId:AssetAttributes' :: AssetAttributes -> Maybe Text
amiId} -> Maybe Text
amiId) (\s :: AssetAttributes
s@AssetAttributes' {} Maybe Text
a -> AssetAttributes
s {$sel:amiId:AssetAttributes' :: Maybe Text
amiId = Maybe Text
a} :: AssetAttributes)

-- | The tags related to the EC2 instance where the finding is generated.
assetAttributes_tags :: Lens.Lens' AssetAttributes (Prelude.Maybe [Tag])
assetAttributes_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> AssetAttributes -> f AssetAttributes
assetAttributes_tags = (AssetAttributes -> Maybe [Tag])
-> (AssetAttributes -> Maybe [Tag] -> AssetAttributes)
-> Lens AssetAttributes AssetAttributes (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:AssetAttributes' :: AssetAttributes -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: AssetAttributes
s@AssetAttributes' {} Maybe [Tag]
a -> AssetAttributes
s {$sel:tags:AssetAttributes' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: AssetAttributes) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> AssetAttributes -> f AssetAttributes)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> AssetAttributes
-> f AssetAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The schema version of this data type.
assetAttributes_schemaVersion :: Lens.Lens' AssetAttributes Prelude.Natural
assetAttributes_schemaVersion :: (Natural -> f Natural) -> AssetAttributes -> f AssetAttributes
assetAttributes_schemaVersion = (AssetAttributes -> Natural)
-> (AssetAttributes -> Natural -> AssetAttributes)
-> Lens AssetAttributes AssetAttributes Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssetAttributes' {Natural
schemaVersion :: Natural
$sel:schemaVersion:AssetAttributes' :: AssetAttributes -> Natural
schemaVersion} -> Natural
schemaVersion) (\s :: AssetAttributes
s@AssetAttributes' {} Natural
a -> AssetAttributes
s {$sel:schemaVersion:AssetAttributes' :: Natural
schemaVersion = Natural
a} :: AssetAttributes)

instance Core.FromJSON AssetAttributes where
  parseJSON :: Value -> Parser AssetAttributes
parseJSON =
    String
-> (Object -> Parser AssetAttributes)
-> Value
-> Parser AssetAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AssetAttributes"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [NetworkInterface]
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Natural
-> AssetAttributes
AssetAttributes'
            (Maybe Text
 -> Maybe Text
 -> Maybe [NetworkInterface]
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Tag]
 -> Natural
 -> AssetAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [NetworkInterface]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Natural
      -> AssetAttributes)
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
"hostname")
            Parser
  (Maybe Text
   -> Maybe [NetworkInterface]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Natural
   -> AssetAttributes)
-> Parser (Maybe Text)
-> Parser
     (Maybe [NetworkInterface]
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Natural
      -> AssetAttributes)
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
"autoScalingGroup")
            Parser
  (Maybe [NetworkInterface]
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Natural
   -> AssetAttributes)
-> Parser (Maybe [NetworkInterface])
-> Parser
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Natural
      -> AssetAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [NetworkInterface]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"networkInterfaces"
                            Parser (Maybe (Maybe [NetworkInterface]))
-> Maybe [NetworkInterface] -> Parser (Maybe [NetworkInterface])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [NetworkInterface]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Natural
   -> AssetAttributes)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe [Tag] -> Natural -> AssetAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ipv4Addresses" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe [Tag] -> Natural -> AssetAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> Natural -> AssetAttributes)
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
"agentId")
            Parser (Maybe Text -> Maybe [Tag] -> Natural -> AssetAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe [Tag] -> Natural -> AssetAttributes)
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
"amiId")
            Parser (Maybe [Tag] -> Natural -> AssetAttributes)
-> Parser (Maybe [Tag]) -> Parser (Natural -> AssetAttributes)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Natural -> AssetAttributes)
-> Parser Natural -> Parser AssetAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"schemaVersion")
      )

instance Prelude.Hashable AssetAttributes

instance Prelude.NFData AssetAttributes