{-# 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.OpsWorks.UpdateApp
-- 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)
--
-- Updates a specified app.
--
-- __Required Permissions__: To use this action, an IAM user must have a
-- Deploy or Manage permissions level for the stack, or an attached policy
-- that explicitly grants permissions. For more information on user
-- permissions, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html Managing User Permissions>.
module Amazonka.OpsWorks.UpdateApp
  ( -- * Creating a Request
    UpdateApp (..),
    newUpdateApp,

    -- * Request Lenses
    updateApp_sslConfiguration,
    updateApp_environment,
    updateApp_enableSsl,
    updateApp_dataSources,
    updateApp_appSource,
    updateApp_attributes,
    updateApp_name,
    updateApp_type,
    updateApp_domains,
    updateApp_description,
    updateApp_appId,

    -- * Destructuring the Response
    UpdateAppResponse (..),
    newUpdateAppResponse,
  )
where

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

-- | /See:/ 'newUpdateApp' smart constructor.
data UpdateApp = UpdateApp'
  { -- | An @SslConfiguration@ object with the SSL configuration.
    UpdateApp -> Maybe SslConfiguration
sslConfiguration :: Prelude.Maybe SslConfiguration,
    -- | An array of @EnvironmentVariable@ objects that specify environment
    -- variables to be associated with the app. After you deploy the app, these
    -- variables are defined on the associated app server instances.For more
    -- information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment Environment Variables>.
    --
    -- There is no specific limit on the number of environment variables.
    -- However, the size of the associated data structure - which includes the
    -- variables\' names, values, and protected flag values - cannot exceed 20
    -- KB. This limit should accommodate most if not all use cases. Exceeding
    -- it will cause an exception with the message, \"Environment: is too large
    -- (maximum is 20 KB).\"
    --
    -- If you have specified one or more environment variables, you cannot
    -- modify the stack\'s Chef version.
    UpdateApp -> Maybe [EnvironmentVariable]
environment :: Prelude.Maybe [EnvironmentVariable],
    -- | Whether SSL is enabled for the app.
    UpdateApp -> Maybe Bool
enableSsl :: Prelude.Maybe Prelude.Bool,
    -- | The app\'s data sources.
    UpdateApp -> Maybe [DataSource]
dataSources :: Prelude.Maybe [DataSource],
    -- | A @Source@ object that specifies the app repository.
    UpdateApp -> Maybe Source
appSource :: Prelude.Maybe Source,
    -- | One or more user-defined key\/value pairs to be added to the stack
    -- attributes.
    UpdateApp -> Maybe (HashMap AppAttributesKeys Text)
attributes :: Prelude.Maybe (Prelude.HashMap AppAttributesKeys Prelude.Text),
    -- | The app name.
    UpdateApp -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The app type.
    UpdateApp -> Maybe AppType
type' :: Prelude.Maybe AppType,
    -- | The app\'s virtual host settings, with multiple domains separated by
    -- commas. For example: @\'www.example.com, example.com\'@
    UpdateApp -> Maybe [Text]
domains :: Prelude.Maybe [Prelude.Text],
    -- | A description of the app.
    UpdateApp -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The app ID.
    UpdateApp -> Text
appId :: Prelude.Text
  }
  deriving (UpdateApp -> UpdateApp -> Bool
(UpdateApp -> UpdateApp -> Bool)
-> (UpdateApp -> UpdateApp -> Bool) -> Eq UpdateApp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateApp -> UpdateApp -> Bool
$c/= :: UpdateApp -> UpdateApp -> Bool
== :: UpdateApp -> UpdateApp -> Bool
$c== :: UpdateApp -> UpdateApp -> Bool
Prelude.Eq, ReadPrec [UpdateApp]
ReadPrec UpdateApp
Int -> ReadS UpdateApp
ReadS [UpdateApp]
(Int -> ReadS UpdateApp)
-> ReadS [UpdateApp]
-> ReadPrec UpdateApp
-> ReadPrec [UpdateApp]
-> Read UpdateApp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateApp]
$creadListPrec :: ReadPrec [UpdateApp]
readPrec :: ReadPrec UpdateApp
$creadPrec :: ReadPrec UpdateApp
readList :: ReadS [UpdateApp]
$creadList :: ReadS [UpdateApp]
readsPrec :: Int -> ReadS UpdateApp
$creadsPrec :: Int -> ReadS UpdateApp
Prelude.Read, Int -> UpdateApp -> ShowS
[UpdateApp] -> ShowS
UpdateApp -> String
(Int -> UpdateApp -> ShowS)
-> (UpdateApp -> String)
-> ([UpdateApp] -> ShowS)
-> Show UpdateApp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateApp] -> ShowS
$cshowList :: [UpdateApp] -> ShowS
show :: UpdateApp -> String
$cshow :: UpdateApp -> String
showsPrec :: Int -> UpdateApp -> ShowS
$cshowsPrec :: Int -> UpdateApp -> ShowS
Prelude.Show, (forall x. UpdateApp -> Rep UpdateApp x)
-> (forall x. Rep UpdateApp x -> UpdateApp) -> Generic UpdateApp
forall x. Rep UpdateApp x -> UpdateApp
forall x. UpdateApp -> Rep UpdateApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateApp x -> UpdateApp
$cfrom :: forall x. UpdateApp -> Rep UpdateApp x
Prelude.Generic)

-- |
-- Create a value of 'UpdateApp' 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:
--
-- 'sslConfiguration', 'updateApp_sslConfiguration' - An @SslConfiguration@ object with the SSL configuration.
--
-- 'environment', 'updateApp_environment' - An array of @EnvironmentVariable@ objects that specify environment
-- variables to be associated with the app. After you deploy the app, these
-- variables are defined on the associated app server instances.For more
-- information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment Environment Variables>.
--
-- There is no specific limit on the number of environment variables.
-- However, the size of the associated data structure - which includes the
-- variables\' names, values, and protected flag values - cannot exceed 20
-- KB. This limit should accommodate most if not all use cases. Exceeding
-- it will cause an exception with the message, \"Environment: is too large
-- (maximum is 20 KB).\"
--
-- If you have specified one or more environment variables, you cannot
-- modify the stack\'s Chef version.
--
-- 'enableSsl', 'updateApp_enableSsl' - Whether SSL is enabled for the app.
--
-- 'dataSources', 'updateApp_dataSources' - The app\'s data sources.
--
-- 'appSource', 'updateApp_appSource' - A @Source@ object that specifies the app repository.
--
-- 'attributes', 'updateApp_attributes' - One or more user-defined key\/value pairs to be added to the stack
-- attributes.
--
-- 'name', 'updateApp_name' - The app name.
--
-- 'type'', 'updateApp_type' - The app type.
--
-- 'domains', 'updateApp_domains' - The app\'s virtual host settings, with multiple domains separated by
-- commas. For example: @\'www.example.com, example.com\'@
--
-- 'description', 'updateApp_description' - A description of the app.
--
-- 'appId', 'updateApp_appId' - The app ID.
newUpdateApp ::
  -- | 'appId'
  Prelude.Text ->
  UpdateApp
newUpdateApp :: Text -> UpdateApp
newUpdateApp Text
pAppId_ =
  UpdateApp' :: Maybe SslConfiguration
-> Maybe [EnvironmentVariable]
-> Maybe Bool
-> Maybe [DataSource]
-> Maybe Source
-> Maybe (HashMap AppAttributesKeys Text)
-> Maybe Text
-> Maybe AppType
-> Maybe [Text]
-> Maybe Text
-> Text
-> UpdateApp
UpdateApp'
    { $sel:sslConfiguration:UpdateApp' :: Maybe SslConfiguration
sslConfiguration = Maybe SslConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:environment:UpdateApp' :: Maybe [EnvironmentVariable]
environment = Maybe [EnvironmentVariable]
forall a. Maybe a
Prelude.Nothing,
      $sel:enableSsl:UpdateApp' :: Maybe Bool
enableSsl = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSources:UpdateApp' :: Maybe [DataSource]
dataSources = Maybe [DataSource]
forall a. Maybe a
Prelude.Nothing,
      $sel:appSource:UpdateApp' :: Maybe Source
appSource = Maybe Source
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:UpdateApp' :: Maybe (HashMap AppAttributesKeys Text)
attributes = Maybe (HashMap AppAttributesKeys Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateApp' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':UpdateApp' :: Maybe AppType
type' = Maybe AppType
forall a. Maybe a
Prelude.Nothing,
      $sel:domains:UpdateApp' :: Maybe [Text]
domains = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateApp' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:UpdateApp' :: Text
appId = Text
pAppId_
    }

-- | An @SslConfiguration@ object with the SSL configuration.
updateApp_sslConfiguration :: Lens.Lens' UpdateApp (Prelude.Maybe SslConfiguration)
updateApp_sslConfiguration :: (Maybe SslConfiguration -> f (Maybe SslConfiguration))
-> UpdateApp -> f UpdateApp
updateApp_sslConfiguration = (UpdateApp -> Maybe SslConfiguration)
-> (UpdateApp -> Maybe SslConfiguration -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (Maybe SslConfiguration)
     (Maybe SslConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe SslConfiguration
sslConfiguration :: Maybe SslConfiguration
$sel:sslConfiguration:UpdateApp' :: UpdateApp -> Maybe SslConfiguration
sslConfiguration} -> Maybe SslConfiguration
sslConfiguration) (\s :: UpdateApp
s@UpdateApp' {} Maybe SslConfiguration
a -> UpdateApp
s {$sel:sslConfiguration:UpdateApp' :: Maybe SslConfiguration
sslConfiguration = Maybe SslConfiguration
a} :: UpdateApp)

-- | An array of @EnvironmentVariable@ objects that specify environment
-- variables to be associated with the app. After you deploy the app, these
-- variables are defined on the associated app server instances.For more
-- information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment Environment Variables>.
--
-- There is no specific limit on the number of environment variables.
-- However, the size of the associated data structure - which includes the
-- variables\' names, values, and protected flag values - cannot exceed 20
-- KB. This limit should accommodate most if not all use cases. Exceeding
-- it will cause an exception with the message, \"Environment: is too large
-- (maximum is 20 KB).\"
--
-- If you have specified one or more environment variables, you cannot
-- modify the stack\'s Chef version.
updateApp_environment :: Lens.Lens' UpdateApp (Prelude.Maybe [EnvironmentVariable])
updateApp_environment :: (Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
-> UpdateApp -> f UpdateApp
updateApp_environment = (UpdateApp -> Maybe [EnvironmentVariable])
-> (UpdateApp -> Maybe [EnvironmentVariable] -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (Maybe [EnvironmentVariable])
     (Maybe [EnvironmentVariable])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe [EnvironmentVariable]
environment :: Maybe [EnvironmentVariable]
$sel:environment:UpdateApp' :: UpdateApp -> Maybe [EnvironmentVariable]
environment} -> Maybe [EnvironmentVariable]
environment) (\s :: UpdateApp
s@UpdateApp' {} Maybe [EnvironmentVariable]
a -> UpdateApp
s {$sel:environment:UpdateApp' :: Maybe [EnvironmentVariable]
environment = Maybe [EnvironmentVariable]
a} :: UpdateApp) ((Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
 -> UpdateApp -> f UpdateApp)
-> ((Maybe [EnvironmentVariable]
     -> f (Maybe [EnvironmentVariable]))
    -> Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
-> (Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
-> UpdateApp
-> f UpdateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [EnvironmentVariable]
  [EnvironmentVariable]
  [EnvironmentVariable]
  [EnvironmentVariable]
-> Iso
     (Maybe [EnvironmentVariable])
     (Maybe [EnvironmentVariable])
     (Maybe [EnvironmentVariable])
     (Maybe [EnvironmentVariable])
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
  [EnvironmentVariable]
  [EnvironmentVariable]
  [EnvironmentVariable]
  [EnvironmentVariable]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Whether SSL is enabled for the app.
updateApp_enableSsl :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Bool)
updateApp_enableSsl :: (Maybe Bool -> f (Maybe Bool)) -> UpdateApp -> f UpdateApp
updateApp_enableSsl = (UpdateApp -> Maybe Bool)
-> (UpdateApp -> Maybe Bool -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Bool
enableSsl :: Maybe Bool
$sel:enableSsl:UpdateApp' :: UpdateApp -> Maybe Bool
enableSsl} -> Maybe Bool
enableSsl) (\s :: UpdateApp
s@UpdateApp' {} Maybe Bool
a -> UpdateApp
s {$sel:enableSsl:UpdateApp' :: Maybe Bool
enableSsl = Maybe Bool
a} :: UpdateApp)

-- | The app\'s data sources.
updateApp_dataSources :: Lens.Lens' UpdateApp (Prelude.Maybe [DataSource])
updateApp_dataSources :: (Maybe [DataSource] -> f (Maybe [DataSource]))
-> UpdateApp -> f UpdateApp
updateApp_dataSources = (UpdateApp -> Maybe [DataSource])
-> (UpdateApp -> Maybe [DataSource] -> UpdateApp)
-> Lens
     UpdateApp UpdateApp (Maybe [DataSource]) (Maybe [DataSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe [DataSource]
dataSources :: Maybe [DataSource]
$sel:dataSources:UpdateApp' :: UpdateApp -> Maybe [DataSource]
dataSources} -> Maybe [DataSource]
dataSources) (\s :: UpdateApp
s@UpdateApp' {} Maybe [DataSource]
a -> UpdateApp
s {$sel:dataSources:UpdateApp' :: Maybe [DataSource]
dataSources = Maybe [DataSource]
a} :: UpdateApp) ((Maybe [DataSource] -> f (Maybe [DataSource]))
 -> UpdateApp -> f UpdateApp)
-> ((Maybe [DataSource] -> f (Maybe [DataSource]))
    -> Maybe [DataSource] -> f (Maybe [DataSource]))
-> (Maybe [DataSource] -> f (Maybe [DataSource]))
-> UpdateApp
-> f UpdateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [DataSource] [DataSource] [DataSource] [DataSource]
-> Iso
     (Maybe [DataSource])
     (Maybe [DataSource])
     (Maybe [DataSource])
     (Maybe [DataSource])
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 [DataSource] [DataSource] [DataSource] [DataSource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A @Source@ object that specifies the app repository.
updateApp_appSource :: Lens.Lens' UpdateApp (Prelude.Maybe Source)
updateApp_appSource :: (Maybe Source -> f (Maybe Source)) -> UpdateApp -> f UpdateApp
updateApp_appSource = (UpdateApp -> Maybe Source)
-> (UpdateApp -> Maybe Source -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Source) (Maybe Source)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Source
appSource :: Maybe Source
$sel:appSource:UpdateApp' :: UpdateApp -> Maybe Source
appSource} -> Maybe Source
appSource) (\s :: UpdateApp
s@UpdateApp' {} Maybe Source
a -> UpdateApp
s {$sel:appSource:UpdateApp' :: Maybe Source
appSource = Maybe Source
a} :: UpdateApp)

-- | One or more user-defined key\/value pairs to be added to the stack
-- attributes.
updateApp_attributes :: Lens.Lens' UpdateApp (Prelude.Maybe (Prelude.HashMap AppAttributesKeys Prelude.Text))
updateApp_attributes :: (Maybe (HashMap AppAttributesKeys Text)
 -> f (Maybe (HashMap AppAttributesKeys Text)))
-> UpdateApp -> f UpdateApp
updateApp_attributes = (UpdateApp -> Maybe (HashMap AppAttributesKeys Text))
-> (UpdateApp
    -> Maybe (HashMap AppAttributesKeys Text) -> UpdateApp)
-> Lens
     UpdateApp
     UpdateApp
     (Maybe (HashMap AppAttributesKeys Text))
     (Maybe (HashMap AppAttributesKeys Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe (HashMap AppAttributesKeys Text)
attributes :: Maybe (HashMap AppAttributesKeys Text)
$sel:attributes:UpdateApp' :: UpdateApp -> Maybe (HashMap AppAttributesKeys Text)
attributes} -> Maybe (HashMap AppAttributesKeys Text)
attributes) (\s :: UpdateApp
s@UpdateApp' {} Maybe (HashMap AppAttributesKeys Text)
a -> UpdateApp
s {$sel:attributes:UpdateApp' :: Maybe (HashMap AppAttributesKeys Text)
attributes = Maybe (HashMap AppAttributesKeys Text)
a} :: UpdateApp) ((Maybe (HashMap AppAttributesKeys Text)
  -> f (Maybe (HashMap AppAttributesKeys Text)))
 -> UpdateApp -> f UpdateApp)
-> ((Maybe (HashMap AppAttributesKeys Text)
     -> f (Maybe (HashMap AppAttributesKeys Text)))
    -> Maybe (HashMap AppAttributesKeys Text)
    -> f (Maybe (HashMap AppAttributesKeys Text)))
-> (Maybe (HashMap AppAttributesKeys Text)
    -> f (Maybe (HashMap AppAttributesKeys Text)))
-> UpdateApp
-> f UpdateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap AppAttributesKeys Text)
  (HashMap AppAttributesKeys Text)
  (HashMap AppAttributesKeys Text)
  (HashMap AppAttributesKeys Text)
-> Iso
     (Maybe (HashMap AppAttributesKeys Text))
     (Maybe (HashMap AppAttributesKeys Text))
     (Maybe (HashMap AppAttributesKeys Text))
     (Maybe (HashMap AppAttributesKeys Text))
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
  (HashMap AppAttributesKeys Text)
  (HashMap AppAttributesKeys Text)
  (HashMap AppAttributesKeys Text)
  (HashMap AppAttributesKeys Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The app name.
updateApp_name :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_name :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_name = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
name :: Maybe Text
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:name:UpdateApp' :: Maybe Text
name = Maybe Text
a} :: UpdateApp)

-- | The app type.
updateApp_type :: Lens.Lens' UpdateApp (Prelude.Maybe AppType)
updateApp_type :: (Maybe AppType -> f (Maybe AppType)) -> UpdateApp -> f UpdateApp
updateApp_type = (UpdateApp -> Maybe AppType)
-> (UpdateApp -> Maybe AppType -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe AppType) (Maybe AppType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe AppType
type' :: Maybe AppType
$sel:type':UpdateApp' :: UpdateApp -> Maybe AppType
type'} -> Maybe AppType
type') (\s :: UpdateApp
s@UpdateApp' {} Maybe AppType
a -> UpdateApp
s {$sel:type':UpdateApp' :: Maybe AppType
type' = Maybe AppType
a} :: UpdateApp)

-- | The app\'s virtual host settings, with multiple domains separated by
-- commas. For example: @\'www.example.com, example.com\'@
updateApp_domains :: Lens.Lens' UpdateApp (Prelude.Maybe [Prelude.Text])
updateApp_domains :: (Maybe [Text] -> f (Maybe [Text])) -> UpdateApp -> f UpdateApp
updateApp_domains = (UpdateApp -> Maybe [Text])
-> (UpdateApp -> Maybe [Text] -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe [Text]
domains :: Maybe [Text]
$sel:domains:UpdateApp' :: UpdateApp -> Maybe [Text]
domains} -> Maybe [Text]
domains) (\s :: UpdateApp
s@UpdateApp' {} Maybe [Text]
a -> UpdateApp
s {$sel:domains:UpdateApp' :: Maybe [Text]
domains = Maybe [Text]
a} :: UpdateApp) ((Maybe [Text] -> f (Maybe [Text])) -> UpdateApp -> f UpdateApp)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateApp
-> f UpdateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A description of the app.
updateApp_description :: Lens.Lens' UpdateApp (Prelude.Maybe Prelude.Text)
updateApp_description :: (Maybe Text -> f (Maybe Text)) -> UpdateApp -> f UpdateApp
updateApp_description = (UpdateApp -> Maybe Text)
-> (UpdateApp -> Maybe Text -> UpdateApp)
-> Lens UpdateApp UpdateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Maybe Text
description :: Maybe Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateApp
s@UpdateApp' {} Maybe Text
a -> UpdateApp
s {$sel:description:UpdateApp' :: Maybe Text
description = Maybe Text
a} :: UpdateApp)

-- | The app ID.
updateApp_appId :: Lens.Lens' UpdateApp Prelude.Text
updateApp_appId :: (Text -> f Text) -> UpdateApp -> f UpdateApp
updateApp_appId = (UpdateApp -> Text)
-> (UpdateApp -> Text -> UpdateApp)
-> Lens UpdateApp UpdateApp Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateApp' {Text
appId :: Text
$sel:appId:UpdateApp' :: UpdateApp -> Text
appId} -> Text
appId) (\s :: UpdateApp
s@UpdateApp' {} Text
a -> UpdateApp
s {$sel:appId:UpdateApp' :: Text
appId = Text
a} :: UpdateApp)

instance Core.AWSRequest UpdateApp where
  type AWSResponse UpdateApp = UpdateAppResponse
  request :: UpdateApp -> Request UpdateApp
request = Service -> UpdateApp -> Request UpdateApp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApp)))
response = AWSResponse UpdateApp
-> Logger
-> Service
-> Proxy UpdateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateApp)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateApp
UpdateAppResponse
UpdateAppResponse'

instance Prelude.Hashable UpdateApp

instance Prelude.NFData UpdateApp

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

instance Core.ToJSON UpdateApp where
  toJSON :: UpdateApp -> Value
toJSON UpdateApp' {Maybe Bool
Maybe [Text]
Maybe [DataSource]
Maybe [EnvironmentVariable]
Maybe Text
Maybe (HashMap AppAttributesKeys Text)
Maybe AppType
Maybe Source
Maybe SslConfiguration
Text
appId :: Text
description :: Maybe Text
domains :: Maybe [Text]
type' :: Maybe AppType
name :: Maybe Text
attributes :: Maybe (HashMap AppAttributesKeys Text)
appSource :: Maybe Source
dataSources :: Maybe [DataSource]
enableSsl :: Maybe Bool
environment :: Maybe [EnvironmentVariable]
sslConfiguration :: Maybe SslConfiguration
$sel:appId:UpdateApp' :: UpdateApp -> Text
$sel:description:UpdateApp' :: UpdateApp -> Maybe Text
$sel:domains:UpdateApp' :: UpdateApp -> Maybe [Text]
$sel:type':UpdateApp' :: UpdateApp -> Maybe AppType
$sel:name:UpdateApp' :: UpdateApp -> Maybe Text
$sel:attributes:UpdateApp' :: UpdateApp -> Maybe (HashMap AppAttributesKeys Text)
$sel:appSource:UpdateApp' :: UpdateApp -> Maybe Source
$sel:dataSources:UpdateApp' :: UpdateApp -> Maybe [DataSource]
$sel:enableSsl:UpdateApp' :: UpdateApp -> Maybe Bool
$sel:environment:UpdateApp' :: UpdateApp -> Maybe [EnvironmentVariable]
$sel:sslConfiguration:UpdateApp' :: UpdateApp -> Maybe SslConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SslConfiguration" Text -> SslConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SslConfiguration -> Pair) -> Maybe SslConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SslConfiguration
sslConfiguration,
            (Text
"Environment" Text -> [EnvironmentVariable] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([EnvironmentVariable] -> Pair)
-> Maybe [EnvironmentVariable] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [EnvironmentVariable]
environment,
            (Text
"EnableSsl" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enableSsl,
            (Text
"DataSources" Text -> [DataSource] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([DataSource] -> Pair) -> Maybe [DataSource] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DataSource]
dataSources,
            (Text
"AppSource" Text -> Source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Source -> Pair) -> Maybe Source -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Source
appSource,
            (Text
"Attributes" Text -> HashMap AppAttributesKeys Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap AppAttributesKeys Text -> Pair)
-> Maybe (HashMap AppAttributesKeys Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap AppAttributesKeys Text)
attributes,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"Type" Text -> AppType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AppType -> Pair) -> Maybe AppType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AppType
type',
            (Text
"Domains" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
domains,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AppId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appId)
          ]
      )

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

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

-- | /See:/ 'newUpdateAppResponse' smart constructor.
data UpdateAppResponse = UpdateAppResponse'
  {
  }
  deriving (UpdateAppResponse -> UpdateAppResponse -> Bool
(UpdateAppResponse -> UpdateAppResponse -> Bool)
-> (UpdateAppResponse -> UpdateAppResponse -> Bool)
-> Eq UpdateAppResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAppResponse -> UpdateAppResponse -> Bool
$c/= :: UpdateAppResponse -> UpdateAppResponse -> Bool
== :: UpdateAppResponse -> UpdateAppResponse -> Bool
$c== :: UpdateAppResponse -> UpdateAppResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAppResponse]
ReadPrec UpdateAppResponse
Int -> ReadS UpdateAppResponse
ReadS [UpdateAppResponse]
(Int -> ReadS UpdateAppResponse)
-> ReadS [UpdateAppResponse]
-> ReadPrec UpdateAppResponse
-> ReadPrec [UpdateAppResponse]
-> Read UpdateAppResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAppResponse]
$creadListPrec :: ReadPrec [UpdateAppResponse]
readPrec :: ReadPrec UpdateAppResponse
$creadPrec :: ReadPrec UpdateAppResponse
readList :: ReadS [UpdateAppResponse]
$creadList :: ReadS [UpdateAppResponse]
readsPrec :: Int -> ReadS UpdateAppResponse
$creadsPrec :: Int -> ReadS UpdateAppResponse
Prelude.Read, Int -> UpdateAppResponse -> ShowS
[UpdateAppResponse] -> ShowS
UpdateAppResponse -> String
(Int -> UpdateAppResponse -> ShowS)
-> (UpdateAppResponse -> String)
-> ([UpdateAppResponse] -> ShowS)
-> Show UpdateAppResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAppResponse] -> ShowS
$cshowList :: [UpdateAppResponse] -> ShowS
show :: UpdateAppResponse -> String
$cshow :: UpdateAppResponse -> String
showsPrec :: Int -> UpdateAppResponse -> ShowS
$cshowsPrec :: Int -> UpdateAppResponse -> ShowS
Prelude.Show, (forall x. UpdateAppResponse -> Rep UpdateAppResponse x)
-> (forall x. Rep UpdateAppResponse x -> UpdateAppResponse)
-> Generic UpdateAppResponse
forall x. Rep UpdateAppResponse x -> UpdateAppResponse
forall x. UpdateAppResponse -> Rep UpdateAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAppResponse x -> UpdateAppResponse
$cfrom :: forall x. UpdateAppResponse -> Rep UpdateAppResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAppResponse' 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.
newUpdateAppResponse ::
  UpdateAppResponse
newUpdateAppResponse :: UpdateAppResponse
newUpdateAppResponse = UpdateAppResponse
UpdateAppResponse'

instance Prelude.NFData UpdateAppResponse