{-# 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.AppConfig.GetConfiguration
-- 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)
--
-- Receive information about a configuration.
--
-- AWS AppConfig uses the value of the @ClientConfigurationVersion@
-- parameter to identify the configuration version on your clients. If you
-- don’t send @ClientConfigurationVersion@ with each call to
-- @GetConfiguration@, your clients receive the current configuration. You
-- are charged each time your clients receive a configuration.
--
-- To avoid excess charges, we recommend that you include the
-- @ClientConfigurationVersion@ value with every call to
-- @GetConfiguration@. This value must be saved on your client. Subsequent
-- calls to @GetConfiguration@ must pass this value by using the
-- @ClientConfigurationVersion@ parameter.
module Amazonka.AppConfig.GetConfiguration
  ( -- * Creating a Request
    GetConfiguration (..),
    newGetConfiguration,

    -- * Request Lenses
    getConfiguration_clientConfigurationVersion,
    getConfiguration_application,
    getConfiguration_environment,
    getConfiguration_configuration,
    getConfiguration_clientId,

    -- * Destructuring the Response
    GetConfigurationResponse (..),
    newGetConfigurationResponse,

    -- * Response Lenses
    getConfigurationResponse_configurationVersion,
    getConfigurationResponse_content,
    getConfigurationResponse_contentType,
    getConfigurationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetConfiguration' smart constructor.
data GetConfiguration = GetConfiguration'
  { -- | The configuration version returned in the most recent @GetConfiguration@
    -- response.
    --
    -- AWS AppConfig uses the value of the @ClientConfigurationVersion@
    -- parameter to identify the configuration version on your clients. If you
    -- don’t send @ClientConfigurationVersion@ with each call to
    -- @GetConfiguration@, your clients receive the current configuration. You
    -- are charged each time your clients receive a configuration.
    --
    -- To avoid excess charges, we recommend that you include the
    -- @ClientConfigurationVersion@ value with every call to
    -- @GetConfiguration@. This value must be saved on your client. Subsequent
    -- calls to @GetConfiguration@ must pass this value by using the
    -- @ClientConfigurationVersion@ parameter.
    --
    -- For more information about working with configurations, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig-retrieving-the-configuration.html Retrieving the Configuration>
    -- in the /AWS AppConfig User Guide/.
    GetConfiguration -> Maybe Text
clientConfigurationVersion :: Prelude.Maybe Prelude.Text,
    -- | The application to get. Specify either the application name or the
    -- application ID.
    GetConfiguration -> Text
application :: Prelude.Text,
    -- | The environment to get. Specify either the environment name or the
    -- environment ID.
    GetConfiguration -> Text
environment :: Prelude.Text,
    -- | The configuration to get. Specify either the configuration name or the
    -- configuration ID.
    GetConfiguration -> Text
configuration :: Prelude.Text,
    -- | A unique ID to identify the client for the configuration. This ID
    -- enables AppConfig to deploy the configuration in intervals, as defined
    -- in the deployment strategy.
    GetConfiguration -> Text
clientId :: Prelude.Text
  }
  deriving (GetConfiguration -> GetConfiguration -> Bool
(GetConfiguration -> GetConfiguration -> Bool)
-> (GetConfiguration -> GetConfiguration -> Bool)
-> Eq GetConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetConfiguration -> GetConfiguration -> Bool
$c/= :: GetConfiguration -> GetConfiguration -> Bool
== :: GetConfiguration -> GetConfiguration -> Bool
$c== :: GetConfiguration -> GetConfiguration -> Bool
Prelude.Eq, ReadPrec [GetConfiguration]
ReadPrec GetConfiguration
Int -> ReadS GetConfiguration
ReadS [GetConfiguration]
(Int -> ReadS GetConfiguration)
-> ReadS [GetConfiguration]
-> ReadPrec GetConfiguration
-> ReadPrec [GetConfiguration]
-> Read GetConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetConfiguration]
$creadListPrec :: ReadPrec [GetConfiguration]
readPrec :: ReadPrec GetConfiguration
$creadPrec :: ReadPrec GetConfiguration
readList :: ReadS [GetConfiguration]
$creadList :: ReadS [GetConfiguration]
readsPrec :: Int -> ReadS GetConfiguration
$creadsPrec :: Int -> ReadS GetConfiguration
Prelude.Read, Int -> GetConfiguration -> ShowS
[GetConfiguration] -> ShowS
GetConfiguration -> String
(Int -> GetConfiguration -> ShowS)
-> (GetConfiguration -> String)
-> ([GetConfiguration] -> ShowS)
-> Show GetConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetConfiguration] -> ShowS
$cshowList :: [GetConfiguration] -> ShowS
show :: GetConfiguration -> String
$cshow :: GetConfiguration -> String
showsPrec :: Int -> GetConfiguration -> ShowS
$cshowsPrec :: Int -> GetConfiguration -> ShowS
Prelude.Show, (forall x. GetConfiguration -> Rep GetConfiguration x)
-> (forall x. Rep GetConfiguration x -> GetConfiguration)
-> Generic GetConfiguration
forall x. Rep GetConfiguration x -> GetConfiguration
forall x. GetConfiguration -> Rep GetConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetConfiguration x -> GetConfiguration
$cfrom :: forall x. GetConfiguration -> Rep GetConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'GetConfiguration' 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:
--
-- 'clientConfigurationVersion', 'getConfiguration_clientConfigurationVersion' - The configuration version returned in the most recent @GetConfiguration@
-- response.
--
-- AWS AppConfig uses the value of the @ClientConfigurationVersion@
-- parameter to identify the configuration version on your clients. If you
-- don’t send @ClientConfigurationVersion@ with each call to
-- @GetConfiguration@, your clients receive the current configuration. You
-- are charged each time your clients receive a configuration.
--
-- To avoid excess charges, we recommend that you include the
-- @ClientConfigurationVersion@ value with every call to
-- @GetConfiguration@. This value must be saved on your client. Subsequent
-- calls to @GetConfiguration@ must pass this value by using the
-- @ClientConfigurationVersion@ parameter.
--
-- For more information about working with configurations, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig-retrieving-the-configuration.html Retrieving the Configuration>
-- in the /AWS AppConfig User Guide/.
--
-- 'application', 'getConfiguration_application' - The application to get. Specify either the application name or the
-- application ID.
--
-- 'environment', 'getConfiguration_environment' - The environment to get. Specify either the environment name or the
-- environment ID.
--
-- 'configuration', 'getConfiguration_configuration' - The configuration to get. Specify either the configuration name or the
-- configuration ID.
--
-- 'clientId', 'getConfiguration_clientId' - A unique ID to identify the client for the configuration. This ID
-- enables AppConfig to deploy the configuration in intervals, as defined
-- in the deployment strategy.
newGetConfiguration ::
  -- | 'application'
  Prelude.Text ->
  -- | 'environment'
  Prelude.Text ->
  -- | 'configuration'
  Prelude.Text ->
  -- | 'clientId'
  Prelude.Text ->
  GetConfiguration
newGetConfiguration :: Text -> Text -> Text -> Text -> GetConfiguration
newGetConfiguration
  Text
pApplication_
  Text
pEnvironment_
  Text
pConfiguration_
  Text
pClientId_ =
    GetConfiguration' :: Maybe Text -> Text -> Text -> Text -> Text -> GetConfiguration
GetConfiguration'
      { $sel:clientConfigurationVersion:GetConfiguration' :: Maybe Text
clientConfigurationVersion =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:application:GetConfiguration' :: Text
application = Text
pApplication_,
        $sel:environment:GetConfiguration' :: Text
environment = Text
pEnvironment_,
        $sel:configuration:GetConfiguration' :: Text
configuration = Text
pConfiguration_,
        $sel:clientId:GetConfiguration' :: Text
clientId = Text
pClientId_
      }

-- | The configuration version returned in the most recent @GetConfiguration@
-- response.
--
-- AWS AppConfig uses the value of the @ClientConfigurationVersion@
-- parameter to identify the configuration version on your clients. If you
-- don’t send @ClientConfigurationVersion@ with each call to
-- @GetConfiguration@, your clients receive the current configuration. You
-- are charged each time your clients receive a configuration.
--
-- To avoid excess charges, we recommend that you include the
-- @ClientConfigurationVersion@ value with every call to
-- @GetConfiguration@. This value must be saved on your client. Subsequent
-- calls to @GetConfiguration@ must pass this value by using the
-- @ClientConfigurationVersion@ parameter.
--
-- For more information about working with configurations, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/appconfig-retrieving-the-configuration.html Retrieving the Configuration>
-- in the /AWS AppConfig User Guide/.
getConfiguration_clientConfigurationVersion :: Lens.Lens' GetConfiguration (Prelude.Maybe Prelude.Text)
getConfiguration_clientConfigurationVersion :: (Maybe Text -> f (Maybe Text))
-> GetConfiguration -> f GetConfiguration
getConfiguration_clientConfigurationVersion = (GetConfiguration -> Maybe Text)
-> (GetConfiguration -> Maybe Text -> GetConfiguration)
-> Lens GetConfiguration GetConfiguration (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfiguration' {Maybe Text
clientConfigurationVersion :: Maybe Text
$sel:clientConfigurationVersion:GetConfiguration' :: GetConfiguration -> Maybe Text
clientConfigurationVersion} -> Maybe Text
clientConfigurationVersion) (\s :: GetConfiguration
s@GetConfiguration' {} Maybe Text
a -> GetConfiguration
s {$sel:clientConfigurationVersion:GetConfiguration' :: Maybe Text
clientConfigurationVersion = Maybe Text
a} :: GetConfiguration)

-- | The application to get. Specify either the application name or the
-- application ID.
getConfiguration_application :: Lens.Lens' GetConfiguration Prelude.Text
getConfiguration_application :: (Text -> f Text) -> GetConfiguration -> f GetConfiguration
getConfiguration_application = (GetConfiguration -> Text)
-> (GetConfiguration -> Text -> GetConfiguration)
-> Lens GetConfiguration GetConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfiguration' {Text
application :: Text
$sel:application:GetConfiguration' :: GetConfiguration -> Text
application} -> Text
application) (\s :: GetConfiguration
s@GetConfiguration' {} Text
a -> GetConfiguration
s {$sel:application:GetConfiguration' :: Text
application = Text
a} :: GetConfiguration)

-- | The environment to get. Specify either the environment name or the
-- environment ID.
getConfiguration_environment :: Lens.Lens' GetConfiguration Prelude.Text
getConfiguration_environment :: (Text -> f Text) -> GetConfiguration -> f GetConfiguration
getConfiguration_environment = (GetConfiguration -> Text)
-> (GetConfiguration -> Text -> GetConfiguration)
-> Lens GetConfiguration GetConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfiguration' {Text
environment :: Text
$sel:environment:GetConfiguration' :: GetConfiguration -> Text
environment} -> Text
environment) (\s :: GetConfiguration
s@GetConfiguration' {} Text
a -> GetConfiguration
s {$sel:environment:GetConfiguration' :: Text
environment = Text
a} :: GetConfiguration)

-- | The configuration to get. Specify either the configuration name or the
-- configuration ID.
getConfiguration_configuration :: Lens.Lens' GetConfiguration Prelude.Text
getConfiguration_configuration :: (Text -> f Text) -> GetConfiguration -> f GetConfiguration
getConfiguration_configuration = (GetConfiguration -> Text)
-> (GetConfiguration -> Text -> GetConfiguration)
-> Lens GetConfiguration GetConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfiguration' {Text
configuration :: Text
$sel:configuration:GetConfiguration' :: GetConfiguration -> Text
configuration} -> Text
configuration) (\s :: GetConfiguration
s@GetConfiguration' {} Text
a -> GetConfiguration
s {$sel:configuration:GetConfiguration' :: Text
configuration = Text
a} :: GetConfiguration)

-- | A unique ID to identify the client for the configuration. This ID
-- enables AppConfig to deploy the configuration in intervals, as defined
-- in the deployment strategy.
getConfiguration_clientId :: Lens.Lens' GetConfiguration Prelude.Text
getConfiguration_clientId :: (Text -> f Text) -> GetConfiguration -> f GetConfiguration
getConfiguration_clientId = (GetConfiguration -> Text)
-> (GetConfiguration -> Text -> GetConfiguration)
-> Lens GetConfiguration GetConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfiguration' {Text
clientId :: Text
$sel:clientId:GetConfiguration' :: GetConfiguration -> Text
clientId} -> Text
clientId) (\s :: GetConfiguration
s@GetConfiguration' {} Text
a -> GetConfiguration
s {$sel:clientId:GetConfiguration' :: Text
clientId = Text
a} :: GetConfiguration)

instance Core.AWSRequest GetConfiguration where
  type
    AWSResponse GetConfiguration =
      GetConfigurationResponse
  request :: GetConfiguration -> Request GetConfiguration
request = Service -> GetConfiguration -> Request GetConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetConfiguration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> ByteString
 -> Either String (AWSResponse GetConfiguration))
-> Logger
-> Service
-> Proxy GetConfiguration
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
 -> ResponseHeaders -> ByteString -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBytes
      ( \Int
s ResponseHeaders
h ByteString
x ->
          Maybe Text
-> Maybe (Sensitive ByteString)
-> Maybe Text
-> Int
-> GetConfigurationResponse
GetConfigurationResponse'
            (Maybe Text
 -> Maybe (Sensitive ByteString)
 -> Maybe Text
 -> Int
 -> GetConfigurationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (Sensitive ByteString)
      -> Maybe Text -> Int -> GetConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Configuration-Version")
            Either
  String
  (Maybe (Sensitive ByteString)
   -> Maybe Text -> Int -> GetConfigurationResponse)
-> Either String (Maybe (Sensitive ByteString))
-> Either String (Maybe Text -> Int -> GetConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Maybe (Sensitive ByteString)
-> Either String (Maybe (Sensitive ByteString))
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Sensitive ByteString -> Maybe (Sensitive ByteString)
forall a. a -> Maybe a
Prelude.Just (ByteString -> Sensitive ByteString
Prelude.coerce ByteString
x)))
            Either String (Maybe Text -> Int -> GetConfigurationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
            Either String (Int -> GetConfigurationResponse)
-> Either String Int -> Either String GetConfigurationResponse
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 GetConfiguration

instance Prelude.NFData GetConfiguration

instance Core.ToHeaders GetConfiguration where
  toHeaders :: GetConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath GetConfiguration where
  toPath :: GetConfiguration -> ByteString
toPath GetConfiguration' {Maybe Text
Text
clientId :: Text
configuration :: Text
environment :: Text
application :: Text
clientConfigurationVersion :: Maybe Text
$sel:clientId:GetConfiguration' :: GetConfiguration -> Text
$sel:configuration:GetConfiguration' :: GetConfiguration -> Text
$sel:environment:GetConfiguration' :: GetConfiguration -> Text
$sel:application:GetConfiguration' :: GetConfiguration -> Text
$sel:clientConfigurationVersion:GetConfiguration' :: GetConfiguration -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/applications/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
application,
        ByteString
"/environments/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
environment,
        ByteString
"/configurations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
configuration
      ]

instance Core.ToQuery GetConfiguration where
  toQuery :: GetConfiguration -> QueryString
toQuery GetConfiguration' {Maybe Text
Text
clientId :: Text
configuration :: Text
environment :: Text
application :: Text
clientConfigurationVersion :: Maybe Text
$sel:clientId:GetConfiguration' :: GetConfiguration -> Text
$sel:configuration:GetConfiguration' :: GetConfiguration -> Text
$sel:environment:GetConfiguration' :: GetConfiguration -> Text
$sel:application:GetConfiguration' :: GetConfiguration -> Text
$sel:clientConfigurationVersion:GetConfiguration' :: GetConfiguration -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"client_configuration_version"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
clientConfigurationVersion,
        ByteString
"client_id" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clientId
      ]

-- | /See:/ 'newGetConfigurationResponse' smart constructor.
data GetConfigurationResponse = GetConfigurationResponse'
  { -- | The configuration version.
    GetConfigurationResponse -> Maybe Text
configurationVersion :: Prelude.Maybe Prelude.Text,
    -- | The content of the configuration or the configuration data.
    GetConfigurationResponse -> Maybe (Sensitive ByteString)
content :: Prelude.Maybe (Core.Sensitive Prelude.ByteString),
    -- | A standard MIME type describing the format of the configuration content.
    -- For more information, see
    -- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 Content-Type>.
    GetConfigurationResponse -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetConfigurationResponse -> GetConfigurationResponse -> Bool
(GetConfigurationResponse -> GetConfigurationResponse -> Bool)
-> (GetConfigurationResponse -> GetConfigurationResponse -> Bool)
-> Eq GetConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
$c/= :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
== :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
$c== :: GetConfigurationResponse -> GetConfigurationResponse -> Bool
Prelude.Eq, Int -> GetConfigurationResponse -> ShowS
[GetConfigurationResponse] -> ShowS
GetConfigurationResponse -> String
(Int -> GetConfigurationResponse -> ShowS)
-> (GetConfigurationResponse -> String)
-> ([GetConfigurationResponse] -> ShowS)
-> Show GetConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetConfigurationResponse] -> ShowS
$cshowList :: [GetConfigurationResponse] -> ShowS
show :: GetConfigurationResponse -> String
$cshow :: GetConfigurationResponse -> String
showsPrec :: Int -> GetConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 GetConfigurationResponse -> Rep GetConfigurationResponse x)
-> (forall x.
    Rep GetConfigurationResponse x -> GetConfigurationResponse)
-> Generic GetConfigurationResponse
forall x.
Rep GetConfigurationResponse x -> GetConfigurationResponse
forall x.
GetConfigurationResponse -> Rep GetConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetConfigurationResponse x -> GetConfigurationResponse
$cfrom :: forall x.
GetConfigurationResponse -> Rep GetConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetConfigurationResponse' 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:
--
-- 'configurationVersion', 'getConfigurationResponse_configurationVersion' - The configuration version.
--
-- 'content', 'getConfigurationResponse_content' - The content of the configuration or the configuration data.
--
-- 'contentType', 'getConfigurationResponse_contentType' - A standard MIME type describing the format of the configuration content.
-- For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 Content-Type>.
--
-- 'httpStatus', 'getConfigurationResponse_httpStatus' - The response's http status code.
newGetConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetConfigurationResponse
newGetConfigurationResponse :: Int -> GetConfigurationResponse
newGetConfigurationResponse Int
pHttpStatus_ =
  GetConfigurationResponse' :: Maybe Text
-> Maybe (Sensitive ByteString)
-> Maybe Text
-> Int
-> GetConfigurationResponse
GetConfigurationResponse'
    { $sel:configurationVersion:GetConfigurationResponse' :: Maybe Text
configurationVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:content:GetConfigurationResponse' :: Maybe (Sensitive ByteString)
content = Maybe (Sensitive ByteString)
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:GetConfigurationResponse' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The configuration version.
getConfigurationResponse_configurationVersion :: Lens.Lens' GetConfigurationResponse (Prelude.Maybe Prelude.Text)
getConfigurationResponse_configurationVersion :: (Maybe Text -> f (Maybe Text))
-> GetConfigurationResponse -> f GetConfigurationResponse
getConfigurationResponse_configurationVersion = (GetConfigurationResponse -> Maybe Text)
-> (GetConfigurationResponse
    -> Maybe Text -> GetConfigurationResponse)
-> Lens
     GetConfigurationResponse
     GetConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfigurationResponse' {Maybe Text
configurationVersion :: Maybe Text
$sel:configurationVersion:GetConfigurationResponse' :: GetConfigurationResponse -> Maybe Text
configurationVersion} -> Maybe Text
configurationVersion) (\s :: GetConfigurationResponse
s@GetConfigurationResponse' {} Maybe Text
a -> GetConfigurationResponse
s {$sel:configurationVersion:GetConfigurationResponse' :: Maybe Text
configurationVersion = Maybe Text
a} :: GetConfigurationResponse)

-- | The content of the configuration or the configuration data.
getConfigurationResponse_content :: Lens.Lens' GetConfigurationResponse (Prelude.Maybe Prelude.ByteString)
getConfigurationResponse_content :: (Maybe ByteString -> f (Maybe ByteString))
-> GetConfigurationResponse -> f GetConfigurationResponse
getConfigurationResponse_content = (GetConfigurationResponse -> Maybe (Sensitive ByteString))
-> (GetConfigurationResponse
    -> Maybe (Sensitive ByteString) -> GetConfigurationResponse)
-> Lens
     GetConfigurationResponse
     GetConfigurationResponse
     (Maybe (Sensitive ByteString))
     (Maybe (Sensitive ByteString))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfigurationResponse' {Maybe (Sensitive ByteString)
content :: Maybe (Sensitive ByteString)
$sel:content:GetConfigurationResponse' :: GetConfigurationResponse -> Maybe (Sensitive ByteString)
content} -> Maybe (Sensitive ByteString)
content) (\s :: GetConfigurationResponse
s@GetConfigurationResponse' {} Maybe (Sensitive ByteString)
a -> GetConfigurationResponse
s {$sel:content:GetConfigurationResponse' :: Maybe (Sensitive ByteString)
content = Maybe (Sensitive ByteString)
a} :: GetConfigurationResponse) ((Maybe (Sensitive ByteString) -> f (Maybe (Sensitive ByteString)))
 -> GetConfigurationResponse -> f GetConfigurationResponse)
-> ((Maybe ByteString -> f (Maybe ByteString))
    -> Maybe (Sensitive ByteString)
    -> f (Maybe (Sensitive ByteString)))
-> (Maybe ByteString -> f (Maybe ByteString))
-> GetConfigurationResponse
-> f GetConfigurationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (Sensitive ByteString) (Sensitive ByteString) ByteString ByteString
-> Iso
     (Maybe (Sensitive ByteString))
     (Maybe (Sensitive ByteString))
     (Maybe ByteString)
     (Maybe ByteString)
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
  (Sensitive ByteString) (Sensitive ByteString) ByteString ByteString
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | A standard MIME type describing the format of the configuration content.
-- For more information, see
-- <http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 Content-Type>.
getConfigurationResponse_contentType :: Lens.Lens' GetConfigurationResponse (Prelude.Maybe Prelude.Text)
getConfigurationResponse_contentType :: (Maybe Text -> f (Maybe Text))
-> GetConfigurationResponse -> f GetConfigurationResponse
getConfigurationResponse_contentType = (GetConfigurationResponse -> Maybe Text)
-> (GetConfigurationResponse
    -> Maybe Text -> GetConfigurationResponse)
-> Lens
     GetConfigurationResponse
     GetConfigurationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConfigurationResponse' {Maybe Text
contentType :: Maybe Text
$sel:contentType:GetConfigurationResponse' :: GetConfigurationResponse -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: GetConfigurationResponse
s@GetConfigurationResponse' {} Maybe Text
a -> GetConfigurationResponse
s {$sel:contentType:GetConfigurationResponse' :: Maybe Text
contentType = Maybe Text
a} :: GetConfigurationResponse)

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

instance Prelude.NFData GetConfigurationResponse