{-# 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.SSOAdmin.Types.InstanceMetadata
-- 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.SSOAdmin.Types.InstanceMetadata 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

-- | Provides information about the IAM Identity Center instance.
--
-- /See:/ 'newInstanceMetadata' smart constructor.
data InstanceMetadata = InstanceMetadata'
  { -- | The identifier of the identity store that is connected to the IAM
    -- Identity Center instance.
    InstanceMetadata -> Maybe Text
identityStoreId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the IAM Identity Center instance under which the operation
    -- will be executed. For more information about ARNs, see
    -- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>
    -- in the /AWS General Reference/.
    InstanceMetadata -> Maybe Text
instanceArn :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceMetadata -> InstanceMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceMetadata -> InstanceMetadata -> Bool
$c/= :: InstanceMetadata -> InstanceMetadata -> Bool
== :: InstanceMetadata -> InstanceMetadata -> Bool
$c== :: InstanceMetadata -> InstanceMetadata -> Bool
Prelude.Eq, ReadPrec [InstanceMetadata]
ReadPrec InstanceMetadata
Int -> ReadS InstanceMetadata
ReadS [InstanceMetadata]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceMetadata]
$creadListPrec :: ReadPrec [InstanceMetadata]
readPrec :: ReadPrec InstanceMetadata
$creadPrec :: ReadPrec InstanceMetadata
readList :: ReadS [InstanceMetadata]
$creadList :: ReadS [InstanceMetadata]
readsPrec :: Int -> ReadS InstanceMetadata
$creadsPrec :: Int -> ReadS InstanceMetadata
Prelude.Read, Int -> InstanceMetadata -> ShowS
[InstanceMetadata] -> ShowS
InstanceMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceMetadata] -> ShowS
$cshowList :: [InstanceMetadata] -> ShowS
show :: InstanceMetadata -> String
$cshow :: InstanceMetadata -> String
showsPrec :: Int -> InstanceMetadata -> ShowS
$cshowsPrec :: Int -> InstanceMetadata -> ShowS
Prelude.Show, forall x. Rep InstanceMetadata x -> InstanceMetadata
forall x. InstanceMetadata -> Rep InstanceMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceMetadata x -> InstanceMetadata
$cfrom :: forall x. InstanceMetadata -> Rep InstanceMetadata x
Prelude.Generic)

-- |
-- Create a value of 'InstanceMetadata' 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:
--
-- 'identityStoreId', 'instanceMetadata_identityStoreId' - The identifier of the identity store that is connected to the IAM
-- Identity Center instance.
--
-- 'instanceArn', 'instanceMetadata_instanceArn' - The ARN of the IAM Identity Center instance under which the operation
-- will be executed. For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>
-- in the /AWS General Reference/.
newInstanceMetadata ::
  InstanceMetadata
newInstanceMetadata :: InstanceMetadata
newInstanceMetadata =
  InstanceMetadata'
    { $sel:identityStoreId:InstanceMetadata' :: Maybe Text
identityStoreId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:instanceArn:InstanceMetadata' :: Maybe Text
instanceArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The identifier of the identity store that is connected to the IAM
-- Identity Center instance.
instanceMetadata_identityStoreId :: Lens.Lens' InstanceMetadata (Prelude.Maybe Prelude.Text)
instanceMetadata_identityStoreId :: Lens' InstanceMetadata (Maybe Text)
instanceMetadata_identityStoreId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadata' {Maybe Text
identityStoreId :: Maybe Text
$sel:identityStoreId:InstanceMetadata' :: InstanceMetadata -> Maybe Text
identityStoreId} -> Maybe Text
identityStoreId) (\s :: InstanceMetadata
s@InstanceMetadata' {} Maybe Text
a -> InstanceMetadata
s {$sel:identityStoreId:InstanceMetadata' :: Maybe Text
identityStoreId = Maybe Text
a} :: InstanceMetadata)

-- | The ARN of the IAM Identity Center instance under which the operation
-- will be executed. For more information about ARNs, see
-- </general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs) and AWS Service Namespaces>
-- in the /AWS General Reference/.
instanceMetadata_instanceArn :: Lens.Lens' InstanceMetadata (Prelude.Maybe Prelude.Text)
instanceMetadata_instanceArn :: Lens' InstanceMetadata (Maybe Text)
instanceMetadata_instanceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceMetadata' {Maybe Text
instanceArn :: Maybe Text
$sel:instanceArn:InstanceMetadata' :: InstanceMetadata -> Maybe Text
instanceArn} -> Maybe Text
instanceArn) (\s :: InstanceMetadata
s@InstanceMetadata' {} Maybe Text
a -> InstanceMetadata
s {$sel:instanceArn:InstanceMetadata' :: Maybe Text
instanceArn = Maybe Text
a} :: InstanceMetadata)

instance Data.FromJSON InstanceMetadata where
  parseJSON :: Value -> Parser InstanceMetadata
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"InstanceMetadata"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> InstanceMetadata
InstanceMetadata'
            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
"IdentityStoreId")
            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
"InstanceArn")
      )

instance Prelude.Hashable InstanceMetadata where
  hashWithSalt :: Int -> InstanceMetadata -> Int
hashWithSalt Int
_salt InstanceMetadata' {Maybe Text
instanceArn :: Maybe Text
identityStoreId :: Maybe Text
$sel:instanceArn:InstanceMetadata' :: InstanceMetadata -> Maybe Text
$sel:identityStoreId:InstanceMetadata' :: InstanceMetadata -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
identityStoreId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceArn

instance Prelude.NFData InstanceMetadata where
  rnf :: InstanceMetadata -> ()
rnf InstanceMetadata' {Maybe Text
instanceArn :: Maybe Text
identityStoreId :: Maybe Text
$sel:instanceArn:InstanceMetadata' :: InstanceMetadata -> Maybe Text
$sel:identityStoreId:InstanceMetadata' :: InstanceMetadata -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
identityStoreId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceArn