{-# 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.Proton.Types.AccountSettings
-- 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.Proton.Types.AccountSettings where

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

-- | The AWS Proton pipeline service role data.
--
-- /See:/ 'newAccountSettings' smart constructor.
data AccountSettings = AccountSettings'
  { -- | The Amazon Resource Name (ARN) of the AWS Proton pipeline service role.
    AccountSettings -> Maybe Text
pipelineServiceRoleArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AccountSettings -> AccountSettings -> Bool
(AccountSettings -> AccountSettings -> Bool)
-> (AccountSettings -> AccountSettings -> Bool)
-> Eq AccountSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountSettings -> AccountSettings -> Bool
$c/= :: AccountSettings -> AccountSettings -> Bool
== :: AccountSettings -> AccountSettings -> Bool
$c== :: AccountSettings -> AccountSettings -> Bool
Prelude.Eq, ReadPrec [AccountSettings]
ReadPrec AccountSettings
Int -> ReadS AccountSettings
ReadS [AccountSettings]
(Int -> ReadS AccountSettings)
-> ReadS [AccountSettings]
-> ReadPrec AccountSettings
-> ReadPrec [AccountSettings]
-> Read AccountSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountSettings]
$creadListPrec :: ReadPrec [AccountSettings]
readPrec :: ReadPrec AccountSettings
$creadPrec :: ReadPrec AccountSettings
readList :: ReadS [AccountSettings]
$creadList :: ReadS [AccountSettings]
readsPrec :: Int -> ReadS AccountSettings
$creadsPrec :: Int -> ReadS AccountSettings
Prelude.Read, Int -> AccountSettings -> ShowS
[AccountSettings] -> ShowS
AccountSettings -> String
(Int -> AccountSettings -> ShowS)
-> (AccountSettings -> String)
-> ([AccountSettings] -> ShowS)
-> Show AccountSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountSettings] -> ShowS
$cshowList :: [AccountSettings] -> ShowS
show :: AccountSettings -> String
$cshow :: AccountSettings -> String
showsPrec :: Int -> AccountSettings -> ShowS
$cshowsPrec :: Int -> AccountSettings -> ShowS
Prelude.Show, (forall x. AccountSettings -> Rep AccountSettings x)
-> (forall x. Rep AccountSettings x -> AccountSettings)
-> Generic AccountSettings
forall x. Rep AccountSettings x -> AccountSettings
forall x. AccountSettings -> Rep AccountSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountSettings x -> AccountSettings
$cfrom :: forall x. AccountSettings -> Rep AccountSettings x
Prelude.Generic)

-- |
-- Create a value of 'AccountSettings' 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:
--
-- 'pipelineServiceRoleArn', 'accountSettings_pipelineServiceRoleArn' - The Amazon Resource Name (ARN) of the AWS Proton pipeline service role.
newAccountSettings ::
  AccountSettings
newAccountSettings :: AccountSettings
newAccountSettings =
  AccountSettings' :: Maybe Text -> AccountSettings
AccountSettings'
    { $sel:pipelineServiceRoleArn:AccountSettings' :: Maybe Text
pipelineServiceRoleArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the AWS Proton pipeline service role.
accountSettings_pipelineServiceRoleArn :: Lens.Lens' AccountSettings (Prelude.Maybe Prelude.Text)
accountSettings_pipelineServiceRoleArn :: (Maybe Text -> f (Maybe Text))
-> AccountSettings -> f AccountSettings
accountSettings_pipelineServiceRoleArn = (AccountSettings -> Maybe Text)
-> (AccountSettings -> Maybe Text -> AccountSettings)
-> Lens AccountSettings AccountSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSettings' {Maybe Text
pipelineServiceRoleArn :: Maybe Text
$sel:pipelineServiceRoleArn:AccountSettings' :: AccountSettings -> Maybe Text
pipelineServiceRoleArn} -> Maybe Text
pipelineServiceRoleArn) (\s :: AccountSettings
s@AccountSettings' {} Maybe Text
a -> AccountSettings
s {$sel:pipelineServiceRoleArn:AccountSettings' :: Maybe Text
pipelineServiceRoleArn = Maybe Text
a} :: AccountSettings)

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

instance Prelude.Hashable AccountSettings

instance Prelude.NFData AccountSettings