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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(Builder -> Builder -> Bool)
-> (Builder -> Builder -> Bool) -> Eq Builder
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]
(Int -> ReadS Builder)
-> ReadS [Builder]
-> ReadPrec Builder
-> ReadPrec [Builder]
-> Read 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
(Int -> Builder -> ShowS)
-> (Builder -> String) -> ([Builder] -> ShowS) -> Show Builder
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. Builder -> Rep Builder x)
-> (forall x. Rep Builder x -> Builder) -> Generic Builder
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' :: Maybe Text -> Builder
Builder' {$sel:arn:Builder' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | The ARN of the builder.
builder_arn :: Lens.Lens' Builder (Prelude.Maybe Prelude.Text)
builder_arn :: (Maybe Text -> f (Maybe Text)) -> Builder -> f Builder
builder_arn = (Builder -> Maybe Text)
-> (Builder -> Maybe Text -> Builder)
-> Lens Builder Builder (Maybe Text) (Maybe Text)
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 Core.FromXML Builder where
  parseXML :: [Node] -> Either String Builder
parseXML [Node]
x = Maybe Text -> Builder
Builder' (Maybe Text -> Builder)
-> Either String (Maybe Text) -> Either String Builder
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ARN")

instance Prelude.Hashable Builder

instance Prelude.NFData Builder