{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.OpsWorksCM.ExportServerEngineAttribute
-- 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)
--
-- Exports a specified server engine attribute as a base64-encoded string.
-- For example, you can export user data that you can use in EC2 to
-- associate nodes with a server.
--
-- This operation is synchronous.
--
-- A @ValidationException@ is raised when parameters of the request are not
-- valid. A @ResourceNotFoundException@ is thrown when the server does not
-- exist. An @InvalidStateException@ is thrown when the server is in any of
-- the following states: CREATING, TERMINATED, FAILED or DELETING.
module Amazonka.OpsWorksCM.ExportServerEngineAttribute
  ( -- * Creating a Request
    ExportServerEngineAttribute (..),
    newExportServerEngineAttribute,

    -- * Request Lenses
    exportServerEngineAttribute_inputAttributes,
    exportServerEngineAttribute_exportAttributeName,
    exportServerEngineAttribute_serverName,

    -- * Destructuring the Response
    ExportServerEngineAttributeResponse (..),
    newExportServerEngineAttributeResponse,

    -- * Response Lenses
    exportServerEngineAttributeResponse_serverName,
    exportServerEngineAttributeResponse_engineAttribute,
    exportServerEngineAttributeResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorksCM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newExportServerEngineAttribute' smart constructor.
data ExportServerEngineAttribute = ExportServerEngineAttribute'
  { -- | The list of engine attributes. The list type is @EngineAttribute@. An
    -- @EngineAttribute@ list item is a pair that includes an attribute name
    -- and its value. For the @Userdata@ ExportAttributeName, the following are
    -- supported engine attribute names.
    --
    -- -   __RunList__ In Chef, a list of roles or recipes that are run in the
    --     specified order. In Puppet, this parameter is ignored.
    --
    -- -   __OrganizationName__ In Chef, an organization name. AWS OpsWorks for
    --     Chef Automate always creates the organization @default@. In Puppet,
    --     this parameter is ignored.
    --
    -- -   __NodeEnvironment__ In Chef, a node environment (for example,
    --     development, staging, or one-box). In Puppet, this parameter is
    --     ignored.
    --
    -- -   __NodeClientVersion__ In Chef, the version of the Chef engine (three
    --     numbers separated by dots, such as 13.8.5). If this attribute is
    --     empty, OpsWorks for Chef Automate uses the most current version. In
    --     Puppet, this parameter is ignored.
    ExportServerEngineAttribute -> Maybe [EngineAttribute]
inputAttributes :: Prelude.Maybe [EngineAttribute],
    -- | The name of the export attribute. Currently, the supported export
    -- attribute is @Userdata@. This exports a user data script that includes
    -- parameters and values provided in the @InputAttributes@ list.
    ExportServerEngineAttribute -> Text
exportAttributeName :: Prelude.Text,
    -- | The name of the server from which you are exporting the attribute.
    ExportServerEngineAttribute -> Text
serverName :: Prelude.Text
  }
  deriving (ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
(ExportServerEngineAttribute
 -> ExportServerEngineAttribute -> Bool)
-> (ExportServerEngineAttribute
    -> ExportServerEngineAttribute -> Bool)
-> Eq ExportServerEngineAttribute
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
$c/= :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
== :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
$c== :: ExportServerEngineAttribute -> ExportServerEngineAttribute -> Bool
Prelude.Eq, Int -> ExportServerEngineAttribute -> ShowS
[ExportServerEngineAttribute] -> ShowS
ExportServerEngineAttribute -> String
(Int -> ExportServerEngineAttribute -> ShowS)
-> (ExportServerEngineAttribute -> String)
-> ([ExportServerEngineAttribute] -> ShowS)
-> Show ExportServerEngineAttribute
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportServerEngineAttribute] -> ShowS
$cshowList :: [ExportServerEngineAttribute] -> ShowS
show :: ExportServerEngineAttribute -> String
$cshow :: ExportServerEngineAttribute -> String
showsPrec :: Int -> ExportServerEngineAttribute -> ShowS
$cshowsPrec :: Int -> ExportServerEngineAttribute -> ShowS
Prelude.Show, (forall x.
 ExportServerEngineAttribute -> Rep ExportServerEngineAttribute x)
-> (forall x.
    Rep ExportServerEngineAttribute x -> ExportServerEngineAttribute)
-> Generic ExportServerEngineAttribute
forall x.
Rep ExportServerEngineAttribute x -> ExportServerEngineAttribute
forall x.
ExportServerEngineAttribute -> Rep ExportServerEngineAttribute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportServerEngineAttribute x -> ExportServerEngineAttribute
$cfrom :: forall x.
ExportServerEngineAttribute -> Rep ExportServerEngineAttribute x
Prelude.Generic)

-- |
-- Create a value of 'ExportServerEngineAttribute' 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:
--
-- 'inputAttributes', 'exportServerEngineAttribute_inputAttributes' - The list of engine attributes. The list type is @EngineAttribute@. An
-- @EngineAttribute@ list item is a pair that includes an attribute name
-- and its value. For the @Userdata@ ExportAttributeName, the following are
-- supported engine attribute names.
--
-- -   __RunList__ In Chef, a list of roles or recipes that are run in the
--     specified order. In Puppet, this parameter is ignored.
--
-- -   __OrganizationName__ In Chef, an organization name. AWS OpsWorks for
--     Chef Automate always creates the organization @default@. In Puppet,
--     this parameter is ignored.
--
-- -   __NodeEnvironment__ In Chef, a node environment (for example,
--     development, staging, or one-box). In Puppet, this parameter is
--     ignored.
--
-- -   __NodeClientVersion__ In Chef, the version of the Chef engine (three
--     numbers separated by dots, such as 13.8.5). If this attribute is
--     empty, OpsWorks for Chef Automate uses the most current version. In
--     Puppet, this parameter is ignored.
--
-- 'exportAttributeName', 'exportServerEngineAttribute_exportAttributeName' - The name of the export attribute. Currently, the supported export
-- attribute is @Userdata@. This exports a user data script that includes
-- parameters and values provided in the @InputAttributes@ list.
--
-- 'serverName', 'exportServerEngineAttribute_serverName' - The name of the server from which you are exporting the attribute.
newExportServerEngineAttribute ::
  -- | 'exportAttributeName'
  Prelude.Text ->
  -- | 'serverName'
  Prelude.Text ->
  ExportServerEngineAttribute
newExportServerEngineAttribute :: Text -> Text -> ExportServerEngineAttribute
newExportServerEngineAttribute
  Text
pExportAttributeName_
  Text
pServerName_ =
    ExportServerEngineAttribute' :: Maybe [EngineAttribute]
-> Text -> Text -> ExportServerEngineAttribute
ExportServerEngineAttribute'
      { $sel:inputAttributes:ExportServerEngineAttribute' :: Maybe [EngineAttribute]
inputAttributes =
          Maybe [EngineAttribute]
forall a. Maybe a
Prelude.Nothing,
        $sel:exportAttributeName:ExportServerEngineAttribute' :: Text
exportAttributeName = Text
pExportAttributeName_,
        $sel:serverName:ExportServerEngineAttribute' :: Text
serverName = Text
pServerName_
      }

-- | The list of engine attributes. The list type is @EngineAttribute@. An
-- @EngineAttribute@ list item is a pair that includes an attribute name
-- and its value. For the @Userdata@ ExportAttributeName, the following are
-- supported engine attribute names.
--
-- -   __RunList__ In Chef, a list of roles or recipes that are run in the
--     specified order. In Puppet, this parameter is ignored.
--
-- -   __OrganizationName__ In Chef, an organization name. AWS OpsWorks for
--     Chef Automate always creates the organization @default@. In Puppet,
--     this parameter is ignored.
--
-- -   __NodeEnvironment__ In Chef, a node environment (for example,
--     development, staging, or one-box). In Puppet, this parameter is
--     ignored.
--
-- -   __NodeClientVersion__ In Chef, the version of the Chef engine (three
--     numbers separated by dots, such as 13.8.5). If this attribute is
--     empty, OpsWorks for Chef Automate uses the most current version. In
--     Puppet, this parameter is ignored.
exportServerEngineAttribute_inputAttributes :: Lens.Lens' ExportServerEngineAttribute (Prelude.Maybe [EngineAttribute])
exportServerEngineAttribute_inputAttributes :: (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> ExportServerEngineAttribute -> f ExportServerEngineAttribute
exportServerEngineAttribute_inputAttributes = (ExportServerEngineAttribute -> Maybe [EngineAttribute])
-> (ExportServerEngineAttribute
    -> Maybe [EngineAttribute] -> ExportServerEngineAttribute)
-> Lens
     ExportServerEngineAttribute
     ExportServerEngineAttribute
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttribute' {Maybe [EngineAttribute]
inputAttributes :: Maybe [EngineAttribute]
$sel:inputAttributes:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Maybe [EngineAttribute]
inputAttributes} -> Maybe [EngineAttribute]
inputAttributes) (\s :: ExportServerEngineAttribute
s@ExportServerEngineAttribute' {} Maybe [EngineAttribute]
a -> ExportServerEngineAttribute
s {$sel:inputAttributes:ExportServerEngineAttribute' :: Maybe [EngineAttribute]
inputAttributes = Maybe [EngineAttribute]
a} :: ExportServerEngineAttribute) ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
 -> ExportServerEngineAttribute -> f ExportServerEngineAttribute)
-> ((Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
    -> Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> (Maybe [EngineAttribute] -> f (Maybe [EngineAttribute]))
-> ExportServerEngineAttribute
-> f ExportServerEngineAttribute
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
-> Iso
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
     (Maybe [EngineAttribute])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
  [EngineAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the export attribute. Currently, the supported export
-- attribute is @Userdata@. This exports a user data script that includes
-- parameters and values provided in the @InputAttributes@ list.
exportServerEngineAttribute_exportAttributeName :: Lens.Lens' ExportServerEngineAttribute Prelude.Text
exportServerEngineAttribute_exportAttributeName :: (Text -> f Text)
-> ExportServerEngineAttribute -> f ExportServerEngineAttribute
exportServerEngineAttribute_exportAttributeName = (ExportServerEngineAttribute -> Text)
-> (ExportServerEngineAttribute
    -> Text -> ExportServerEngineAttribute)
-> Lens
     ExportServerEngineAttribute ExportServerEngineAttribute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttribute' {Text
exportAttributeName :: Text
$sel:exportAttributeName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
exportAttributeName} -> Text
exportAttributeName) (\s :: ExportServerEngineAttribute
s@ExportServerEngineAttribute' {} Text
a -> ExportServerEngineAttribute
s {$sel:exportAttributeName:ExportServerEngineAttribute' :: Text
exportAttributeName = Text
a} :: ExportServerEngineAttribute)

-- | The name of the server from which you are exporting the attribute.
exportServerEngineAttribute_serverName :: Lens.Lens' ExportServerEngineAttribute Prelude.Text
exportServerEngineAttribute_serverName :: (Text -> f Text)
-> ExportServerEngineAttribute -> f ExportServerEngineAttribute
exportServerEngineAttribute_serverName = (ExportServerEngineAttribute -> Text)
-> (ExportServerEngineAttribute
    -> Text -> ExportServerEngineAttribute)
-> Lens
     ExportServerEngineAttribute ExportServerEngineAttribute Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttribute' {Text
serverName :: Text
$sel:serverName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
serverName} -> Text
serverName) (\s :: ExportServerEngineAttribute
s@ExportServerEngineAttribute' {} Text
a -> ExportServerEngineAttribute
s {$sel:serverName:ExportServerEngineAttribute' :: Text
serverName = Text
a} :: ExportServerEngineAttribute)

instance Core.AWSRequest ExportServerEngineAttribute where
  type
    AWSResponse ExportServerEngineAttribute =
      ExportServerEngineAttributeResponse
  request :: ExportServerEngineAttribute -> Request ExportServerEngineAttribute
request = Service
-> ExportServerEngineAttribute
-> Request ExportServerEngineAttribute
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ExportServerEngineAttribute
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ExportServerEngineAttribute)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ExportServerEngineAttribute))
-> Logger
-> Service
-> Proxy ExportServerEngineAttribute
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ExportServerEngineAttribute)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe EngineAttribute
-> Int
-> ExportServerEngineAttributeResponse
ExportServerEngineAttributeResponse'
            (Maybe Text
 -> Maybe EngineAttribute
 -> Int
 -> ExportServerEngineAttributeResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe EngineAttribute
      -> Int -> ExportServerEngineAttributeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ServerName")
            Either
  String
  (Maybe EngineAttribute
   -> Int -> ExportServerEngineAttributeResponse)
-> Either String (Maybe EngineAttribute)
-> Either String (Int -> ExportServerEngineAttributeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe EngineAttribute)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EngineAttribute")
            Either String (Int -> ExportServerEngineAttributeResponse)
-> Either String Int
-> Either String ExportServerEngineAttributeResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ExportServerEngineAttribute

instance Prelude.NFData ExportServerEngineAttribute

instance Core.ToHeaders ExportServerEngineAttribute where
  toHeaders :: ExportServerEngineAttribute -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ExportServerEngineAttribute -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OpsWorksCM_V2016_11_01.ExportServerEngineAttribute" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ExportServerEngineAttribute where
  toJSON :: ExportServerEngineAttribute -> Value
toJSON ExportServerEngineAttribute' {Maybe [EngineAttribute]
Text
serverName :: Text
exportAttributeName :: Text
inputAttributes :: Maybe [EngineAttribute]
$sel:serverName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
$sel:exportAttributeName:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Text
$sel:inputAttributes:ExportServerEngineAttribute' :: ExportServerEngineAttribute -> Maybe [EngineAttribute]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"InputAttributes" Text -> [EngineAttribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([EngineAttribute] -> Pair)
-> Maybe [EngineAttribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EngineAttribute]
inputAttributes,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ExportAttributeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
exportAttributeName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverName)
          ]
      )

instance Core.ToPath ExportServerEngineAttribute where
  toPath :: ExportServerEngineAttribute -> ByteString
toPath = ByteString -> ExportServerEngineAttribute -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ExportServerEngineAttribute where
  toQuery :: ExportServerEngineAttribute -> QueryString
toQuery = QueryString -> ExportServerEngineAttribute -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newExportServerEngineAttributeResponse' smart constructor.
data ExportServerEngineAttributeResponse = ExportServerEngineAttributeResponse'
  { -- | The server name used in the request.
    ExportServerEngineAttributeResponse -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
    -- | The requested engine attribute pair with attribute name and value.
    ExportServerEngineAttributeResponse -> Maybe EngineAttribute
engineAttribute :: Prelude.Maybe EngineAttribute,
    -- | The response's http status code.
    ExportServerEngineAttributeResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
(ExportServerEngineAttributeResponse
 -> ExportServerEngineAttributeResponse -> Bool)
-> (ExportServerEngineAttributeResponse
    -> ExportServerEngineAttributeResponse -> Bool)
-> Eq ExportServerEngineAttributeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
$c/= :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
== :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
$c== :: ExportServerEngineAttributeResponse
-> ExportServerEngineAttributeResponse -> Bool
Prelude.Eq, Int -> ExportServerEngineAttributeResponse -> ShowS
[ExportServerEngineAttributeResponse] -> ShowS
ExportServerEngineAttributeResponse -> String
(Int -> ExportServerEngineAttributeResponse -> ShowS)
-> (ExportServerEngineAttributeResponse -> String)
-> ([ExportServerEngineAttributeResponse] -> ShowS)
-> Show ExportServerEngineAttributeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportServerEngineAttributeResponse] -> ShowS
$cshowList :: [ExportServerEngineAttributeResponse] -> ShowS
show :: ExportServerEngineAttributeResponse -> String
$cshow :: ExportServerEngineAttributeResponse -> String
showsPrec :: Int -> ExportServerEngineAttributeResponse -> ShowS
$cshowsPrec :: Int -> ExportServerEngineAttributeResponse -> ShowS
Prelude.Show, (forall x.
 ExportServerEngineAttributeResponse
 -> Rep ExportServerEngineAttributeResponse x)
-> (forall x.
    Rep ExportServerEngineAttributeResponse x
    -> ExportServerEngineAttributeResponse)
-> Generic ExportServerEngineAttributeResponse
forall x.
Rep ExportServerEngineAttributeResponse x
-> ExportServerEngineAttributeResponse
forall x.
ExportServerEngineAttributeResponse
-> Rep ExportServerEngineAttributeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportServerEngineAttributeResponse x
-> ExportServerEngineAttributeResponse
$cfrom :: forall x.
ExportServerEngineAttributeResponse
-> Rep ExportServerEngineAttributeResponse x
Prelude.Generic)

-- |
-- Create a value of 'ExportServerEngineAttributeResponse' 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:
--
-- 'serverName', 'exportServerEngineAttributeResponse_serverName' - The server name used in the request.
--
-- 'engineAttribute', 'exportServerEngineAttributeResponse_engineAttribute' - The requested engine attribute pair with attribute name and value.
--
-- 'httpStatus', 'exportServerEngineAttributeResponse_httpStatus' - The response's http status code.
newExportServerEngineAttributeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ExportServerEngineAttributeResponse
newExportServerEngineAttributeResponse :: Int -> ExportServerEngineAttributeResponse
newExportServerEngineAttributeResponse Int
pHttpStatus_ =
  ExportServerEngineAttributeResponse' :: Maybe Text
-> Maybe EngineAttribute
-> Int
-> ExportServerEngineAttributeResponse
ExportServerEngineAttributeResponse'
    { $sel:serverName:ExportServerEngineAttributeResponse' :: Maybe Text
serverName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engineAttribute:ExportServerEngineAttributeResponse' :: Maybe EngineAttribute
engineAttribute = Maybe EngineAttribute
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ExportServerEngineAttributeResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The server name used in the request.
exportServerEngineAttributeResponse_serverName :: Lens.Lens' ExportServerEngineAttributeResponse (Prelude.Maybe Prelude.Text)
exportServerEngineAttributeResponse_serverName :: (Maybe Text -> f (Maybe Text))
-> ExportServerEngineAttributeResponse
-> f ExportServerEngineAttributeResponse
exportServerEngineAttributeResponse_serverName = (ExportServerEngineAttributeResponse -> Maybe Text)
-> (ExportServerEngineAttributeResponse
    -> Maybe Text -> ExportServerEngineAttributeResponse)
-> Lens
     ExportServerEngineAttributeResponse
     ExportServerEngineAttributeResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttributeResponse' {Maybe Text
serverName :: Maybe Text
$sel:serverName:ExportServerEngineAttributeResponse' :: ExportServerEngineAttributeResponse -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: ExportServerEngineAttributeResponse
s@ExportServerEngineAttributeResponse' {} Maybe Text
a -> ExportServerEngineAttributeResponse
s {$sel:serverName:ExportServerEngineAttributeResponse' :: Maybe Text
serverName = Maybe Text
a} :: ExportServerEngineAttributeResponse)

-- | The requested engine attribute pair with attribute name and value.
exportServerEngineAttributeResponse_engineAttribute :: Lens.Lens' ExportServerEngineAttributeResponse (Prelude.Maybe EngineAttribute)
exportServerEngineAttributeResponse_engineAttribute :: (Maybe EngineAttribute -> f (Maybe EngineAttribute))
-> ExportServerEngineAttributeResponse
-> f ExportServerEngineAttributeResponse
exportServerEngineAttributeResponse_engineAttribute = (ExportServerEngineAttributeResponse -> Maybe EngineAttribute)
-> (ExportServerEngineAttributeResponse
    -> Maybe EngineAttribute -> ExportServerEngineAttributeResponse)
-> Lens
     ExportServerEngineAttributeResponse
     ExportServerEngineAttributeResponse
     (Maybe EngineAttribute)
     (Maybe EngineAttribute)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttributeResponse' {Maybe EngineAttribute
engineAttribute :: Maybe EngineAttribute
$sel:engineAttribute:ExportServerEngineAttributeResponse' :: ExportServerEngineAttributeResponse -> Maybe EngineAttribute
engineAttribute} -> Maybe EngineAttribute
engineAttribute) (\s :: ExportServerEngineAttributeResponse
s@ExportServerEngineAttributeResponse' {} Maybe EngineAttribute
a -> ExportServerEngineAttributeResponse
s {$sel:engineAttribute:ExportServerEngineAttributeResponse' :: Maybe EngineAttribute
engineAttribute = Maybe EngineAttribute
a} :: ExportServerEngineAttributeResponse)

-- | The response's http status code.
exportServerEngineAttributeResponse_httpStatus :: Lens.Lens' ExportServerEngineAttributeResponse Prelude.Int
exportServerEngineAttributeResponse_httpStatus :: (Int -> f Int)
-> ExportServerEngineAttributeResponse
-> f ExportServerEngineAttributeResponse
exportServerEngineAttributeResponse_httpStatus = (ExportServerEngineAttributeResponse -> Int)
-> (ExportServerEngineAttributeResponse
    -> Int -> ExportServerEngineAttributeResponse)
-> Lens
     ExportServerEngineAttributeResponse
     ExportServerEngineAttributeResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportServerEngineAttributeResponse' {Int
httpStatus :: Int
$sel:httpStatus:ExportServerEngineAttributeResponse' :: ExportServerEngineAttributeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ExportServerEngineAttributeResponse
s@ExportServerEngineAttributeResponse' {} Int
a -> ExportServerEngineAttributeResponse
s {$sel:httpStatus:ExportServerEngineAttributeResponse' :: Int
httpStatus = Int
a} :: ExportServerEngineAttributeResponse)

instance
  Prelude.NFData
    ExportServerEngineAttributeResponse