{-# 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.OpsWorks.Types.App
-- 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.OpsWorks.Types.App where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorks.Types.AppAttributesKeys
import Amazonka.OpsWorks.Types.AppType
import Amazonka.OpsWorks.Types.DataSource
import Amazonka.OpsWorks.Types.EnvironmentVariable
import Amazonka.OpsWorks.Types.Source
import Amazonka.OpsWorks.Types.SslConfiguration
import qualified Amazonka.Prelude as Prelude

-- | A description of the app.
--
-- /See:/ 'newApp' smart constructor.
data App = App'
  { -- | An @SslConfiguration@ object with the SSL configuration.
    App -> 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
    -- variable names, values, and protected flag values - cannot exceed 20 KB.
    -- This limit should accommodate most if not all use cases, but if you do
    -- exceed it, you will cause an exception (API) with an \"Environment: is
    -- too large (maximum is 20 KB)\" message.
    App -> Maybe [EnvironmentVariable]
environment :: Prelude.Maybe [EnvironmentVariable],
    -- | Whether to enable SSL for the app.
    App -> Maybe Bool
enableSsl :: Prelude.Maybe Prelude.Bool,
    -- | When the app was created.
    App -> Maybe Text
createdAt :: Prelude.Maybe Prelude.Text,
    -- | The app\'s short name.
    App -> Maybe Text
shortname :: Prelude.Maybe Prelude.Text,
    -- | The app\'s data sources.
    App -> Maybe [DataSource]
dataSources :: Prelude.Maybe [DataSource],
    -- | A @Source@ object that describes the app repository.
    App -> Maybe Source
appSource :: Prelude.Maybe Source,
    -- | The app ID.
    App -> Maybe Text
appId :: Prelude.Maybe Prelude.Text,
    -- | The stack attributes.
    App -> Maybe (HashMap AppAttributesKeys Text)
attributes :: Prelude.Maybe (Prelude.HashMap AppAttributesKeys Prelude.Text),
    -- | The app name.
    App -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The app type.
    App -> Maybe AppType
type' :: Prelude.Maybe AppType,
    -- | The app stack ID.
    App -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | The app vhost settings with multiple domains separated by commas. For
    -- example: @\'www.example.com, example.com\'@
    App -> Maybe [Text]
domains :: Prelude.Maybe [Prelude.Text],
    -- | A description of the app.
    App -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (App -> App -> Bool
(App -> App -> Bool) -> (App -> App -> Bool) -> Eq App
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: App -> App -> Bool
$c/= :: App -> App -> Bool
== :: App -> App -> Bool
$c== :: App -> App -> Bool
Prelude.Eq, ReadPrec [App]
ReadPrec App
Int -> ReadS App
ReadS [App]
(Int -> ReadS App)
-> ReadS [App] -> ReadPrec App -> ReadPrec [App] -> Read App
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [App]
$creadListPrec :: ReadPrec [App]
readPrec :: ReadPrec App
$creadPrec :: ReadPrec App
readList :: ReadS [App]
$creadList :: ReadS [App]
readsPrec :: Int -> ReadS App
$creadsPrec :: Int -> ReadS App
Prelude.Read, Int -> App -> ShowS
[App] -> ShowS
App -> String
(Int -> App -> ShowS)
-> (App -> String) -> ([App] -> ShowS) -> Show App
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [App] -> ShowS
$cshowList :: [App] -> ShowS
show :: App -> String
$cshow :: App -> String
showsPrec :: Int -> App -> ShowS
$cshowsPrec :: Int -> App -> ShowS
Prelude.Show, (forall x. App -> Rep App x)
-> (forall x. Rep App x -> App) -> Generic App
forall x. Rep App x -> App
forall x. App -> Rep App x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep App x -> App
$cfrom :: forall x. App -> Rep App x
Prelude.Generic)

-- |
-- Create a value of 'App' 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', 'app_sslConfiguration' - An @SslConfiguration@ object with the SSL configuration.
--
-- 'environment', 'app_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
-- variable names, values, and protected flag values - cannot exceed 20 KB.
-- This limit should accommodate most if not all use cases, but if you do
-- exceed it, you will cause an exception (API) with an \"Environment: is
-- too large (maximum is 20 KB)\" message.
--
-- 'enableSsl', 'app_enableSsl' - Whether to enable SSL for the app.
--
-- 'createdAt', 'app_createdAt' - When the app was created.
--
-- 'shortname', 'app_shortname' - The app\'s short name.
--
-- 'dataSources', 'app_dataSources' - The app\'s data sources.
--
-- 'appSource', 'app_appSource' - A @Source@ object that describes the app repository.
--
-- 'appId', 'app_appId' - The app ID.
--
-- 'attributes', 'app_attributes' - The stack attributes.
--
-- 'name', 'app_name' - The app name.
--
-- 'type'', 'app_type' - The app type.
--
-- 'stackId', 'app_stackId' - The app stack ID.
--
-- 'domains', 'app_domains' - The app vhost settings with multiple domains separated by commas. For
-- example: @\'www.example.com, example.com\'@
--
-- 'description', 'app_description' - A description of the app.
newApp ::
  App
newApp :: App
newApp =
  App' :: Maybe SslConfiguration
-> Maybe [EnvironmentVariable]
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [DataSource]
-> Maybe Source
-> Maybe Text
-> Maybe (HashMap AppAttributesKeys Text)
-> Maybe Text
-> Maybe AppType
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> App
App'
    { $sel:sslConfiguration:App' :: Maybe SslConfiguration
sslConfiguration = Maybe SslConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:environment:App' :: Maybe [EnvironmentVariable]
environment = Maybe [EnvironmentVariable]
forall a. Maybe a
Prelude.Nothing,
      $sel:enableSsl:App' :: Maybe Bool
enableSsl = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:App' :: Maybe Text
createdAt = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shortname:App' :: Maybe Text
shortname = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSources:App' :: Maybe [DataSource]
dataSources = Maybe [DataSource]
forall a. Maybe a
Prelude.Nothing,
      $sel:appSource:App' :: Maybe Source
appSource = Maybe Source
forall a. Maybe a
Prelude.Nothing,
      $sel:appId:App' :: Maybe Text
appId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:attributes:App' :: Maybe (HashMap AppAttributesKeys Text)
attributes = Maybe (HashMap AppAttributesKeys Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:name:App' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':App' :: Maybe AppType
type' = Maybe AppType
forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:App' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domains:App' :: Maybe [Text]
domains = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:App' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | 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
-- variable names, values, and protected flag values - cannot exceed 20 KB.
-- This limit should accommodate most if not all use cases, but if you do
-- exceed it, you will cause an exception (API) with an \"Environment: is
-- too large (maximum is 20 KB)\" message.
app_environment :: Lens.Lens' App (Prelude.Maybe [EnvironmentVariable])
app_environment :: (Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
-> App -> f App
app_environment = (App -> Maybe [EnvironmentVariable])
-> (App -> Maybe [EnvironmentVariable] -> App)
-> Lens
     App App (Maybe [EnvironmentVariable]) (Maybe [EnvironmentVariable])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe [EnvironmentVariable]
environment :: Maybe [EnvironmentVariable]
$sel:environment:App' :: App -> Maybe [EnvironmentVariable]
environment} -> Maybe [EnvironmentVariable]
environment) (\s :: App
s@App' {} Maybe [EnvironmentVariable]
a -> App
s {$sel:environment:App' :: Maybe [EnvironmentVariable]
environment = Maybe [EnvironmentVariable]
a} :: App) ((Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
 -> App -> f App)
-> ((Maybe [EnvironmentVariable]
     -> f (Maybe [EnvironmentVariable]))
    -> Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
-> (Maybe [EnvironmentVariable] -> f (Maybe [EnvironmentVariable]))
-> App
-> f App
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 to enable SSL for the app.
app_enableSsl :: Lens.Lens' App (Prelude.Maybe Prelude.Bool)
app_enableSsl :: (Maybe Bool -> f (Maybe Bool)) -> App -> f App
app_enableSsl = (App -> Maybe Bool)
-> (App -> Maybe Bool -> App)
-> Lens App App (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe Bool
enableSsl :: Maybe Bool
$sel:enableSsl:App' :: App -> Maybe Bool
enableSsl} -> Maybe Bool
enableSsl) (\s :: App
s@App' {} Maybe Bool
a -> App
s {$sel:enableSsl:App' :: Maybe Bool
enableSsl = Maybe Bool
a} :: App)

-- | When the app was created.
app_createdAt :: Lens.Lens' App (Prelude.Maybe Prelude.Text)
app_createdAt :: (Maybe Text -> f (Maybe Text)) -> App -> f App
app_createdAt = (App -> Maybe Text)
-> (App -> Maybe Text -> App)
-> Lens App App (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe Text
createdAt :: Maybe Text
$sel:createdAt:App' :: App -> Maybe Text
createdAt} -> Maybe Text
createdAt) (\s :: App
s@App' {} Maybe Text
a -> App
s {$sel:createdAt:App' :: Maybe Text
createdAt = Maybe Text
a} :: App)

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

-- | The app\'s data sources.
app_dataSources :: Lens.Lens' App (Prelude.Maybe [DataSource])
app_dataSources :: (Maybe [DataSource] -> f (Maybe [DataSource])) -> App -> f App
app_dataSources = (App -> Maybe [DataSource])
-> (App -> Maybe [DataSource] -> App)
-> Lens App App (Maybe [DataSource]) (Maybe [DataSource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe [DataSource]
dataSources :: Maybe [DataSource]
$sel:dataSources:App' :: App -> Maybe [DataSource]
dataSources} -> Maybe [DataSource]
dataSources) (\s :: App
s@App' {} Maybe [DataSource]
a -> App
s {$sel:dataSources:App' :: Maybe [DataSource]
dataSources = Maybe [DataSource]
a} :: App) ((Maybe [DataSource] -> f (Maybe [DataSource])) -> App -> f App)
-> ((Maybe [DataSource] -> f (Maybe [DataSource]))
    -> Maybe [DataSource] -> f (Maybe [DataSource]))
-> (Maybe [DataSource] -> f (Maybe [DataSource]))
-> App
-> f App
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 describes the app repository.
app_appSource :: Lens.Lens' App (Prelude.Maybe Source)
app_appSource :: (Maybe Source -> f (Maybe Source)) -> App -> f App
app_appSource = (App -> Maybe Source)
-> (App -> Maybe Source -> App)
-> Lens App App (Maybe Source) (Maybe Source)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe Source
appSource :: Maybe Source
$sel:appSource:App' :: App -> Maybe Source
appSource} -> Maybe Source
appSource) (\s :: App
s@App' {} Maybe Source
a -> App
s {$sel:appSource:App' :: Maybe Source
appSource = Maybe Source
a} :: App)

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

-- | The stack attributes.
app_attributes :: Lens.Lens' App (Prelude.Maybe (Prelude.HashMap AppAttributesKeys Prelude.Text))
app_attributes :: (Maybe (HashMap AppAttributesKeys Text)
 -> f (Maybe (HashMap AppAttributesKeys Text)))
-> App -> f App
app_attributes = (App -> Maybe (HashMap AppAttributesKeys Text))
-> (App -> Maybe (HashMap AppAttributesKeys Text) -> App)
-> Lens
     App
     App
     (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 (\App' {Maybe (HashMap AppAttributesKeys Text)
attributes :: Maybe (HashMap AppAttributesKeys Text)
$sel:attributes:App' :: App -> Maybe (HashMap AppAttributesKeys Text)
attributes} -> Maybe (HashMap AppAttributesKeys Text)
attributes) (\s :: App
s@App' {} Maybe (HashMap AppAttributesKeys Text)
a -> App
s {$sel:attributes:App' :: Maybe (HashMap AppAttributesKeys Text)
attributes = Maybe (HashMap AppAttributesKeys Text)
a} :: App) ((Maybe (HashMap AppAttributesKeys Text)
  -> f (Maybe (HashMap AppAttributesKeys Text)))
 -> App -> f App)
-> ((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)))
-> App
-> f App
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.
app_name :: Lens.Lens' App (Prelude.Maybe Prelude.Text)
app_name :: (Maybe Text -> f (Maybe Text)) -> App -> f App
app_name = (App -> Maybe Text)
-> (App -> Maybe Text -> App)
-> Lens App App (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe Text
name :: Maybe Text
$sel:name:App' :: App -> Maybe Text
name} -> Maybe Text
name) (\s :: App
s@App' {} Maybe Text
a -> App
s {$sel:name:App' :: Maybe Text
name = Maybe Text
a} :: App)

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

-- | The app stack ID.
app_stackId :: Lens.Lens' App (Prelude.Maybe Prelude.Text)
app_stackId :: (Maybe Text -> f (Maybe Text)) -> App -> f App
app_stackId = (App -> Maybe Text)
-> (App -> Maybe Text -> App)
-> Lens App App (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe Text
stackId :: Maybe Text
$sel:stackId:App' :: App -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: App
s@App' {} Maybe Text
a -> App
s {$sel:stackId:App' :: Maybe Text
stackId = Maybe Text
a} :: App)

-- | The app vhost settings with multiple domains separated by commas. For
-- example: @\'www.example.com, example.com\'@
app_domains :: Lens.Lens' App (Prelude.Maybe [Prelude.Text])
app_domains :: (Maybe [Text] -> f (Maybe [Text])) -> App -> f App
app_domains = (App -> Maybe [Text])
-> (App -> Maybe [Text] -> App)
-> Lens App App (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe [Text]
domains :: Maybe [Text]
$sel:domains:App' :: App -> Maybe [Text]
domains} -> Maybe [Text]
domains) (\s :: App
s@App' {} Maybe [Text]
a -> App
s {$sel:domains:App' :: Maybe [Text]
domains = Maybe [Text]
a} :: App) ((Maybe [Text] -> f (Maybe [Text])) -> App -> f App)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> App
-> f App
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.
app_description :: Lens.Lens' App (Prelude.Maybe Prelude.Text)
app_description :: (Maybe Text -> f (Maybe Text)) -> App -> f App
app_description = (App -> Maybe Text)
-> (App -> Maybe Text -> App)
-> Lens App App (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\App' {Maybe Text
description :: Maybe Text
$sel:description:App' :: App -> Maybe Text
description} -> Maybe Text
description) (\s :: App
s@App' {} Maybe Text
a -> App
s {$sel:description:App' :: Maybe Text
description = Maybe Text
a} :: App)

instance Core.FromJSON App where
  parseJSON :: Value -> Parser App
parseJSON =
    String -> (Object -> Parser App) -> Value -> Parser App
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"App"
      ( \Object
x ->
          Maybe SslConfiguration
-> Maybe [EnvironmentVariable]
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [DataSource]
-> Maybe Source
-> Maybe Text
-> Maybe (HashMap AppAttributesKeys Text)
-> Maybe Text
-> Maybe AppType
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> App
App'
            (Maybe SslConfiguration
 -> Maybe [EnvironmentVariable]
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe [DataSource]
 -> Maybe Source
 -> Maybe Text
 -> Maybe (HashMap AppAttributesKeys Text)
 -> Maybe Text
 -> Maybe AppType
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> App)
-> Parser (Maybe SslConfiguration)
-> Parser
     (Maybe [EnvironmentVariable]
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [DataSource]
      -> Maybe Source
      -> Maybe Text
      -> Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SslConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SslConfiguration")
            Parser
  (Maybe [EnvironmentVariable]
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [DataSource]
   -> Maybe Source
   -> Maybe Text
   -> Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe [EnvironmentVariable])
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [DataSource]
      -> Maybe Source
      -> Maybe Text
      -> Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [EnvironmentVariable]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Environment" Parser (Maybe (Maybe [EnvironmentVariable]))
-> Maybe [EnvironmentVariable]
-> Parser (Maybe [EnvironmentVariable])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [EnvironmentVariable]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [DataSource]
   -> Maybe Source
   -> Maybe Text
   -> Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [DataSource]
      -> Maybe Source
      -> Maybe Text
      -> Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EnableSsl")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [DataSource]
   -> Maybe Source
   -> Maybe Text
   -> Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [DataSource]
      -> Maybe Source
      -> Maybe Text
      -> Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
            Parser
  (Maybe Text
   -> Maybe [DataSource]
   -> Maybe Source
   -> Maybe Text
   -> Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe Text)
-> Parser
     (Maybe [DataSource]
      -> Maybe Source
      -> Maybe Text
      -> Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Shortname")
            Parser
  (Maybe [DataSource]
   -> Maybe Source
   -> Maybe Text
   -> Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe [DataSource])
-> Parser
     (Maybe Source
      -> Maybe Text
      -> Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [DataSource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DataSources" Parser (Maybe (Maybe [DataSource]))
-> Maybe [DataSource] -> Parser (Maybe [DataSource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DataSource]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Source
   -> Maybe Text
   -> Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe Source)
-> Parser
     (Maybe Text
      -> Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Source)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AppSource")
            Parser
  (Maybe Text
   -> Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap AppAttributesKeys Text)
      -> Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AppId")
            Parser
  (Maybe (HashMap AppAttributesKeys Text)
   -> Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe (HashMap AppAttributesKeys Text))
-> Parser
     (Maybe Text
      -> Maybe AppType
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap AppAttributesKeys Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Attributes" Parser (Maybe (Maybe (HashMap AppAttributesKeys Text)))
-> Maybe (HashMap AppAttributesKeys Text)
-> Parser (Maybe (HashMap AppAttributesKeys Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap AppAttributesKeys Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe AppType
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> App)
-> Parser (Maybe Text)
-> Parser
     (Maybe AppType -> Maybe Text -> Maybe [Text] -> Maybe Text -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe AppType -> Maybe Text -> Maybe [Text] -> Maybe Text -> App)
-> Parser (Maybe AppType)
-> Parser (Maybe Text -> Maybe [Text] -> Maybe Text -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AppType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
            Parser (Maybe Text -> Maybe [Text] -> Maybe Text -> App)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> Maybe Text -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StackId")
            Parser (Maybe [Text] -> Maybe Text -> App)
-> Parser (Maybe [Text]) -> Parser (Maybe Text -> App)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Domains" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser (Maybe Text -> App) -> Parser (Maybe Text) -> Parser App
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
      )

instance Prelude.Hashable App

instance Prelude.NFData App