{-# 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.WellArchitected.Types.Lens
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.WellArchitected.Types.Lens where

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

-- | A lens return object.
--
-- /See:/ 'newLens' smart constructor.
data Lens = Lens'
  { Lens -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ARN of a lens.
    Lens -> Maybe Text
lensArn :: Prelude.Maybe Prelude.Text,
    -- | The version of a lens.
    Lens -> Maybe Text
lensVersion :: Prelude.Maybe Prelude.Text,
    Lens -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account ID that owns the lens.
    Lens -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
    -- | The ID assigned to the share invitation.
    Lens -> Maybe Text
shareInvitationId :: Prelude.Maybe Prelude.Text,
    -- | The tags assigned to the lens.
    Lens -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (Lens -> Lens -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Lens -> Lens -> Bool
$c/= :: Lens -> Lens -> Bool
== :: Lens -> Lens -> Bool
$c== :: Lens -> Lens -> Bool
Prelude.Eq, ReadPrec [Lens]
ReadPrec Lens
Int -> ReadS Lens
ReadS [Lens]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Lens]
$creadListPrec :: ReadPrec [Lens]
readPrec :: ReadPrec Lens
$creadPrec :: ReadPrec Lens
readList :: ReadS [Lens]
$creadList :: ReadS [Lens]
readsPrec :: Int -> ReadS Lens
$creadsPrec :: Int -> ReadS Lens
Prelude.Read, Int -> Lens -> ShowS
[Lens] -> ShowS
Lens -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Lens] -> ShowS
$cshowList :: [Lens] -> ShowS
show :: Lens -> String
$cshow :: Lens -> String
showsPrec :: Int -> Lens -> ShowS
$cshowsPrec :: Int -> Lens -> ShowS
Prelude.Show, forall x. Rep Lens x -> Lens
forall x. Lens -> Rep Lens x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Lens x -> Lens
$cfrom :: forall x. Lens -> Rep Lens x
Prelude.Generic)

-- |
-- Create a value of 'Lens' 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:
--
-- 'description', 'lens_description' - Undocumented member.
--
-- 'lensArn', 'lens_lensArn' - The ARN of a lens.
--
-- 'lensVersion', 'lens_lensVersion' - The version of a lens.
--
-- 'name', 'lens_name' - Undocumented member.
--
-- 'owner', 'lens_owner' - The Amazon Web Services account ID that owns the lens.
--
-- 'shareInvitationId', 'lens_shareInvitationId' - The ID assigned to the share invitation.
--
-- 'tags', 'lens_tags' - The tags assigned to the lens.
newLens ::
  Lens
newLens :: Lens
newLens =
  Lens'
    { $sel:description:Lens' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:lensArn:Lens' :: Maybe Text
lensArn = forall a. Maybe a
Prelude.Nothing,
      $sel:lensVersion:Lens' :: Maybe Text
lensVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:name:Lens' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:owner:Lens' :: Maybe Text
owner = forall a. Maybe a
Prelude.Nothing,
      $sel:shareInvitationId:Lens' :: Maybe Text
shareInvitationId = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Lens' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
lens_description :: Lens.Lens' Lens (Prelude.Maybe Prelude.Text)
lens_description :: Lens' Lens (Maybe Text)
lens_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lens' {Maybe Text
description :: Maybe Text
$sel:description:Lens' :: Lens -> Maybe Text
description} -> Maybe Text
description) (\s :: Lens
s@Lens' {} Maybe Text
a -> Lens
s {$sel:description:Lens' :: Maybe Text
description = Maybe Text
a} :: Lens)

-- | The ARN of a lens.
lens_lensArn :: Lens.Lens' Lens (Prelude.Maybe Prelude.Text)
lens_lensArn :: Lens' Lens (Maybe Text)
lens_lensArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lens' {Maybe Text
lensArn :: Maybe Text
$sel:lensArn:Lens' :: Lens -> Maybe Text
lensArn} -> Maybe Text
lensArn) (\s :: Lens
s@Lens' {} Maybe Text
a -> Lens
s {$sel:lensArn:Lens' :: Maybe Text
lensArn = Maybe Text
a} :: Lens)

-- | The version of a lens.
lens_lensVersion :: Lens.Lens' Lens (Prelude.Maybe Prelude.Text)
lens_lensVersion :: Lens' Lens (Maybe Text)
lens_lensVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lens' {Maybe Text
lensVersion :: Maybe Text
$sel:lensVersion:Lens' :: Lens -> Maybe Text
lensVersion} -> Maybe Text
lensVersion) (\s :: Lens
s@Lens' {} Maybe Text
a -> Lens
s {$sel:lensVersion:Lens' :: Maybe Text
lensVersion = Maybe Text
a} :: Lens)

-- | Undocumented member.
lens_name :: Lens.Lens' Lens (Prelude.Maybe Prelude.Text)
lens_name :: Lens' Lens (Maybe Text)
lens_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lens' {Maybe Text
name :: Maybe Text
$sel:name:Lens' :: Lens -> Maybe Text
name} -> Maybe Text
name) (\s :: Lens
s@Lens' {} Maybe Text
a -> Lens
s {$sel:name:Lens' :: Maybe Text
name = Maybe Text
a} :: Lens)

-- | The Amazon Web Services account ID that owns the lens.
lens_owner :: Lens.Lens' Lens (Prelude.Maybe Prelude.Text)
lens_owner :: Lens' Lens (Maybe Text)
lens_owner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lens' {Maybe Text
owner :: Maybe Text
$sel:owner:Lens' :: Lens -> Maybe Text
owner} -> Maybe Text
owner) (\s :: Lens
s@Lens' {} Maybe Text
a -> Lens
s {$sel:owner:Lens' :: Maybe Text
owner = Maybe Text
a} :: Lens)

-- | The ID assigned to the share invitation.
lens_shareInvitationId :: Lens.Lens' Lens (Prelude.Maybe Prelude.Text)
lens_shareInvitationId :: Lens' Lens (Maybe Text)
lens_shareInvitationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lens' {Maybe Text
shareInvitationId :: Maybe Text
$sel:shareInvitationId:Lens' :: Lens -> Maybe Text
shareInvitationId} -> Maybe Text
shareInvitationId) (\s :: Lens
s@Lens' {} Maybe Text
a -> Lens
s {$sel:shareInvitationId:Lens' :: Maybe Text
shareInvitationId = Maybe Text
a} :: Lens)

-- | The tags assigned to the lens.
lens_tags :: Lens.Lens' Lens (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
lens_tags :: Lens' Lens (Maybe (HashMap Text Text))
lens_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lens' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Lens' :: Lens -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Lens
s@Lens' {} Maybe (HashMap Text Text)
a -> Lens
s {$sel:tags:Lens' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Lens) 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

instance Data.FromJSON Lens where
  parseJSON :: Value -> Parser Lens
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Lens"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Lens
Lens'
            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
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LensArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"LensVersion")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Owner")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ShareInvitationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Lens where
  hashWithSalt :: Int -> Lens -> Int
hashWithSalt Int
_salt Lens' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
shareInvitationId :: Maybe Text
owner :: Maybe Text
name :: Maybe Text
lensVersion :: Maybe Text
lensArn :: Maybe Text
description :: Maybe Text
$sel:tags:Lens' :: Lens -> Maybe (HashMap Text Text)
$sel:shareInvitationId:Lens' :: Lens -> Maybe Text
$sel:owner:Lens' :: Lens -> Maybe Text
$sel:name:Lens' :: Lens -> Maybe Text
$sel:lensVersion:Lens' :: Lens -> Maybe Text
$sel:lensArn:Lens' :: Lens -> Maybe Text
$sel:description:Lens' :: Lens -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lensArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lensVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
owner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
shareInvitationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData Lens where
  rnf :: Lens -> ()
rnf Lens' {Maybe Text
Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
shareInvitationId :: Maybe Text
owner :: Maybe Text
name :: Maybe Text
lensVersion :: Maybe Text
lensArn :: Maybe Text
description :: Maybe Text
$sel:tags:Lens' :: Lens -> Maybe (HashMap Text Text)
$sel:shareInvitationId:Lens' :: Lens -> Maybe Text
$sel:owner:Lens' :: Lens -> Maybe Text
$sel:name:Lens' :: Lens -> Maybe Text
$sel:lensVersion:Lens' :: Lens -> Maybe Text
$sel:lensArn:Lens' :: Lens -> Maybe Text
$sel:description:Lens' :: Lens -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lensArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lensVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
owner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
shareInvitationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags