{-# 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.EC2.Types.DeviceOptions
-- 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.EC2.Types.DeviceOptions where

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

-- | Options for an Amazon Web Services Verified Access device-identity based
-- trust provider.
--
-- /See:/ 'newDeviceOptions' smart constructor.
data DeviceOptions = DeviceOptions'
  { -- | The ID of the tenant application with the device-identity provider.
    DeviceOptions -> Maybe Text
tenantId :: Prelude.Maybe Prelude.Text
  }
  deriving (DeviceOptions -> DeviceOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceOptions -> DeviceOptions -> Bool
$c/= :: DeviceOptions -> DeviceOptions -> Bool
== :: DeviceOptions -> DeviceOptions -> Bool
$c== :: DeviceOptions -> DeviceOptions -> Bool
Prelude.Eq, ReadPrec [DeviceOptions]
ReadPrec DeviceOptions
Int -> ReadS DeviceOptions
ReadS [DeviceOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceOptions]
$creadListPrec :: ReadPrec [DeviceOptions]
readPrec :: ReadPrec DeviceOptions
$creadPrec :: ReadPrec DeviceOptions
readList :: ReadS [DeviceOptions]
$creadList :: ReadS [DeviceOptions]
readsPrec :: Int -> ReadS DeviceOptions
$creadsPrec :: Int -> ReadS DeviceOptions
Prelude.Read, Int -> DeviceOptions -> ShowS
[DeviceOptions] -> ShowS
DeviceOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceOptions] -> ShowS
$cshowList :: [DeviceOptions] -> ShowS
show :: DeviceOptions -> String
$cshow :: DeviceOptions -> String
showsPrec :: Int -> DeviceOptions -> ShowS
$cshowsPrec :: Int -> DeviceOptions -> ShowS
Prelude.Show, forall x. Rep DeviceOptions x -> DeviceOptions
forall x. DeviceOptions -> Rep DeviceOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceOptions x -> DeviceOptions
$cfrom :: forall x. DeviceOptions -> Rep DeviceOptions x
Prelude.Generic)

-- |
-- Create a value of 'DeviceOptions' 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:
--
-- 'tenantId', 'deviceOptions_tenantId' - The ID of the tenant application with the device-identity provider.
newDeviceOptions ::
  DeviceOptions
newDeviceOptions :: DeviceOptions
newDeviceOptions =
  DeviceOptions' {$sel:tenantId:DeviceOptions' :: Maybe Text
tenantId = forall a. Maybe a
Prelude.Nothing}

-- | The ID of the tenant application with the device-identity provider.
deviceOptions_tenantId :: Lens.Lens' DeviceOptions (Prelude.Maybe Prelude.Text)
deviceOptions_tenantId :: Lens' DeviceOptions (Maybe Text)
deviceOptions_tenantId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceOptions' {Maybe Text
tenantId :: Maybe Text
$sel:tenantId:DeviceOptions' :: DeviceOptions -> Maybe Text
tenantId} -> Maybe Text
tenantId) (\s :: DeviceOptions
s@DeviceOptions' {} Maybe Text
a -> DeviceOptions
s {$sel:tenantId:DeviceOptions' :: Maybe Text
tenantId = Maybe Text
a} :: DeviceOptions)

instance Data.FromXML DeviceOptions where
  parseXML :: [Node] -> Either String DeviceOptions
parseXML [Node]
x =
    Maybe Text -> DeviceOptions
DeviceOptions' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"tenantId")

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

instance Prelude.NFData DeviceOptions where
  rnf :: DeviceOptions -> ()
rnf DeviceOptions' {Maybe Text
tenantId :: Maybe Text
$sel:tenantId:DeviceOptions' :: DeviceOptions -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
tenantId