{-# 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.ElasticBeanstalk.Types.Builder
-- 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.ElasticBeanstalk.Types.Builder 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

-- | The builder used to build the custom platform.
--
-- /See:/ 'newBuilder' smart constructor.
data Builder = Builder'
  { -- | The ARN of the builder.
    Builder -> Maybe Text
arn :: Prelude.Maybe Prelude.Text
  }
  deriving (Builder -> Builder -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Builder -> Builder -> Bool
$c/= :: Builder -> Builder -> Bool
== :: Builder -> Builder -> Bool
$c== :: Builder -> Builder -> Bool
Prelude.Eq, ReadPrec [Builder]
ReadPrec Builder
Int -> ReadS Builder
ReadS [Builder]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Builder]
$creadListPrec :: ReadPrec [Builder]
readPrec :: ReadPrec Builder
$creadPrec :: ReadPrec Builder
readList :: ReadS [Builder]
$creadList :: ReadS [Builder]
readsPrec :: Int -> ReadS Builder
$creadsPrec :: Int -> ReadS Builder
Prelude.Read, Int -> Builder -> ShowS
[Builder] -> ShowS
Builder -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Builder] -> ShowS
$cshowList :: [Builder] -> ShowS
show :: Builder -> String
$cshow :: Builder -> String
showsPrec :: Int -> Builder -> ShowS
$cshowsPrec :: Int -> Builder -> ShowS
Prelude.Show, forall x. Rep Builder x -> Builder
forall x. Builder -> Rep Builder x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Builder x -> Builder
$cfrom :: forall x. Builder -> Rep Builder x
Prelude.Generic)

-- |
-- Create a value of 'Builder' 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:
--
-- 'arn', 'builder_arn' - The ARN of the builder.
newBuilder ::
  Builder
newBuilder :: Builder
newBuilder = Builder' {$sel:arn:Builder' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing}

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

instance Data.FromXML Builder where
  parseXML :: [Node] -> Either String Builder
parseXML [Node]
x = Maybe Text -> Builder
Builder' 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
"ARN")

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

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