{-# 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.SMS.CreateApp
-- 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)
--
-- Creates an application. An application consists of one or more server
-- groups. Each server group contain one or more servers.
module Amazonka.SMS.CreateApp
  ( -- * Creating a Request
    CreateApp (..),
    newCreateApp,

    -- * Request Lenses
    createApp_clientToken,
    createApp_roleName,
    createApp_name,
    createApp_description,
    createApp_serverGroups,
    createApp_tags,

    -- * Destructuring the Response
    CreateAppResponse (..),
    newCreateAppResponse,

    -- * Response Lenses
    createAppResponse_appSummary,
    createAppResponse_serverGroups,
    createAppResponse_tags,
    createAppResponse_httpStatus,
  )
where

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
import Amazonka.SMS.Types

-- | /See:/ 'newCreateApp' smart constructor.
data CreateApp = CreateApp'
  { -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of application creation.
    CreateApp -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the service role in the customer\'s account to be used by
    -- AWS SMS.
    CreateApp -> Maybe Text
roleName :: Prelude.Maybe Prelude.Text,
    -- | The name of the new application.
    CreateApp -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The description of the new application
    CreateApp -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The server groups to include in the application.
    CreateApp -> Maybe [ServerGroup]
serverGroups :: Prelude.Maybe [ServerGroup],
    -- | The tags to be associated with the application.
    CreateApp -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (CreateApp -> CreateApp -> Bool
(CreateApp -> CreateApp -> Bool)
-> (CreateApp -> CreateApp -> Bool) -> Eq CreateApp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateApp -> CreateApp -> Bool
$c/= :: CreateApp -> CreateApp -> Bool
== :: CreateApp -> CreateApp -> Bool
$c== :: CreateApp -> CreateApp -> Bool
Prelude.Eq, ReadPrec [CreateApp]
ReadPrec CreateApp
Int -> ReadS CreateApp
ReadS [CreateApp]
(Int -> ReadS CreateApp)
-> ReadS [CreateApp]
-> ReadPrec CreateApp
-> ReadPrec [CreateApp]
-> Read CreateApp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateApp]
$creadListPrec :: ReadPrec [CreateApp]
readPrec :: ReadPrec CreateApp
$creadPrec :: ReadPrec CreateApp
readList :: ReadS [CreateApp]
$creadList :: ReadS [CreateApp]
readsPrec :: Int -> ReadS CreateApp
$creadsPrec :: Int -> ReadS CreateApp
Prelude.Read, Int -> CreateApp -> ShowS
[CreateApp] -> ShowS
CreateApp -> String
(Int -> CreateApp -> ShowS)
-> (CreateApp -> String)
-> ([CreateApp] -> ShowS)
-> Show CreateApp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateApp] -> ShowS
$cshowList :: [CreateApp] -> ShowS
show :: CreateApp -> String
$cshow :: CreateApp -> String
showsPrec :: Int -> CreateApp -> ShowS
$cshowsPrec :: Int -> CreateApp -> ShowS
Prelude.Show, (forall x. CreateApp -> Rep CreateApp x)
-> (forall x. Rep CreateApp x -> CreateApp) -> Generic CreateApp
forall x. Rep CreateApp x -> CreateApp
forall x. CreateApp -> Rep CreateApp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateApp x -> CreateApp
$cfrom :: forall x. CreateApp -> Rep CreateApp x
Prelude.Generic)

-- |
-- Create a value of 'CreateApp' 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:
--
-- 'clientToken', 'createApp_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of application creation.
--
-- 'roleName', 'createApp_roleName' - The name of the service role in the customer\'s account to be used by
-- AWS SMS.
--
-- 'name', 'createApp_name' - The name of the new application.
--
-- 'description', 'createApp_description' - The description of the new application
--
-- 'serverGroups', 'createApp_serverGroups' - The server groups to include in the application.
--
-- 'tags', 'createApp_tags' - The tags to be associated with the application.
newCreateApp ::
  CreateApp
newCreateApp :: CreateApp
newCreateApp =
  CreateApp' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ServerGroup]
-> Maybe [Tag]
-> CreateApp
CreateApp'
    { $sel:clientToken:CreateApp' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleName:CreateApp' :: Maybe Text
roleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateApp' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateApp' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serverGroups:CreateApp' :: Maybe [ServerGroup]
serverGroups = Maybe [ServerGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateApp' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of application creation.
createApp_clientToken :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_clientToken :: (Maybe Text -> f (Maybe Text)) -> CreateApp -> f CreateApp
createApp_clientToken = (CreateApp -> Maybe Text)
-> (CreateApp -> Maybe Text -> CreateApp)
-> Lens CreateApp CreateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateApp' :: CreateApp -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateApp
s@CreateApp' {} Maybe Text
a -> CreateApp
s {$sel:clientToken:CreateApp' :: Maybe Text
clientToken = Maybe Text
a} :: CreateApp)

-- | The name of the service role in the customer\'s account to be used by
-- AWS SMS.
createApp_roleName :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_roleName :: (Maybe Text -> f (Maybe Text)) -> CreateApp -> f CreateApp
createApp_roleName = (CreateApp -> Maybe Text)
-> (CreateApp -> Maybe Text -> CreateApp)
-> Lens CreateApp CreateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Text
roleName :: Maybe Text
$sel:roleName:CreateApp' :: CreateApp -> Maybe Text
roleName} -> Maybe Text
roleName) (\s :: CreateApp
s@CreateApp' {} Maybe Text
a -> CreateApp
s {$sel:roleName:CreateApp' :: Maybe Text
roleName = Maybe Text
a} :: CreateApp)

-- | The name of the new application.
createApp_name :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_name :: (Maybe Text -> f (Maybe Text)) -> CreateApp -> f CreateApp
createApp_name = (CreateApp -> Maybe Text)
-> (CreateApp -> Maybe Text -> CreateApp)
-> Lens CreateApp CreateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Text
name :: Maybe Text
$sel:name:CreateApp' :: CreateApp -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateApp
s@CreateApp' {} Maybe Text
a -> CreateApp
s {$sel:name:CreateApp' :: Maybe Text
name = Maybe Text
a} :: CreateApp)

-- | The description of the new application
createApp_description :: Lens.Lens' CreateApp (Prelude.Maybe Prelude.Text)
createApp_description :: (Maybe Text -> f (Maybe Text)) -> CreateApp -> f CreateApp
createApp_description = (CreateApp -> Maybe Text)
-> (CreateApp -> Maybe Text -> CreateApp)
-> Lens CreateApp CreateApp (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe Text
description :: Maybe Text
$sel:description:CreateApp' :: CreateApp -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateApp
s@CreateApp' {} Maybe Text
a -> CreateApp
s {$sel:description:CreateApp' :: Maybe Text
description = Maybe Text
a} :: CreateApp)

-- | The server groups to include in the application.
createApp_serverGroups :: Lens.Lens' CreateApp (Prelude.Maybe [ServerGroup])
createApp_serverGroups :: (Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
-> CreateApp -> f CreateApp
createApp_serverGroups = (CreateApp -> Maybe [ServerGroup])
-> (CreateApp -> Maybe [ServerGroup] -> CreateApp)
-> Lens
     CreateApp CreateApp (Maybe [ServerGroup]) (Maybe [ServerGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe [ServerGroup]
serverGroups :: Maybe [ServerGroup]
$sel:serverGroups:CreateApp' :: CreateApp -> Maybe [ServerGroup]
serverGroups} -> Maybe [ServerGroup]
serverGroups) (\s :: CreateApp
s@CreateApp' {} Maybe [ServerGroup]
a -> CreateApp
s {$sel:serverGroups:CreateApp' :: Maybe [ServerGroup]
serverGroups = Maybe [ServerGroup]
a} :: CreateApp) ((Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
 -> CreateApp -> f CreateApp)
-> ((Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
    -> Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
-> (Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
-> CreateApp
-> f CreateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ServerGroup] [ServerGroup] [ServerGroup] [ServerGroup]
-> Iso
     (Maybe [ServerGroup])
     (Maybe [ServerGroup])
     (Maybe [ServerGroup])
     (Maybe [ServerGroup])
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 [ServerGroup] [ServerGroup] [ServerGroup] [ServerGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tags to be associated with the application.
createApp_tags :: Lens.Lens' CreateApp (Prelude.Maybe [Tag])
createApp_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateApp -> f CreateApp
createApp_tags = (CreateApp -> Maybe [Tag])
-> (CreateApp -> Maybe [Tag] -> CreateApp)
-> Lens CreateApp CreateApp (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateApp' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateApp' :: CreateApp -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateApp
s@CreateApp' {} Maybe [Tag]
a -> CreateApp
s {$sel:tags:CreateApp' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateApp) ((Maybe [Tag] -> f (Maybe [Tag])) -> CreateApp -> f CreateApp)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateApp
-> f CreateApp
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateApp where
  type AWSResponse CreateApp = CreateAppResponse
  request :: CreateApp -> Request CreateApp
request = Service -> CreateApp -> Request CreateApp
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApp)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateApp))
-> Logger
-> Service
-> Proxy CreateApp
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateApp)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe AppSummary
-> Maybe [ServerGroup] -> Maybe [Tag] -> Int -> CreateAppResponse
CreateAppResponse'
            (Maybe AppSummary
 -> Maybe [ServerGroup] -> Maybe [Tag] -> Int -> CreateAppResponse)
-> Either String (Maybe AppSummary)
-> Either
     String
     (Maybe [ServerGroup] -> Maybe [Tag] -> Int -> CreateAppResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe AppSummary)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"appSummary")
            Either
  String
  (Maybe [ServerGroup] -> Maybe [Tag] -> Int -> CreateAppResponse)
-> Either String (Maybe [ServerGroup])
-> Either String (Maybe [Tag] -> Int -> CreateAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [ServerGroup]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"serverGroups" Either String (Maybe (Maybe [ServerGroup]))
-> Maybe [ServerGroup] -> Either String (Maybe [ServerGroup])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ServerGroup]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe [Tag] -> Int -> CreateAppResponse)
-> Either String (Maybe [Tag])
-> Either String (Int -> CreateAppResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe [Tag]))
-> Maybe [Tag] -> Either String (Maybe [Tag])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> CreateAppResponse)
-> Either String Int -> Either String CreateAppResponse
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 CreateApp

instance Prelude.NFData CreateApp

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

instance Core.ToJSON CreateApp where
  toJSON :: CreateApp -> Value
toJSON CreateApp' {Maybe [Tag]
Maybe [ServerGroup]
Maybe Text
tags :: Maybe [Tag]
serverGroups :: Maybe [ServerGroup]
description :: Maybe Text
name :: Maybe Text
roleName :: Maybe Text
clientToken :: Maybe Text
$sel:tags:CreateApp' :: CreateApp -> Maybe [Tag]
$sel:serverGroups:CreateApp' :: CreateApp -> Maybe [ServerGroup]
$sel:description:CreateApp' :: CreateApp -> Maybe Text
$sel:name:CreateApp' :: CreateApp -> Maybe Text
$sel:roleName:CreateApp' :: CreateApp -> Maybe Text
$sel:clientToken:CreateApp' :: CreateApp -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" 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
clientToken,
            (Text
"roleName" 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
roleName,
            (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
"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,
            (Text
"serverGroups" Text -> [ServerGroup] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ServerGroup] -> Pair) -> Maybe [ServerGroup] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ServerGroup]
serverGroups,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags
          ]
      )

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

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

-- | /See:/ 'newCreateAppResponse' smart constructor.
data CreateAppResponse = CreateAppResponse'
  { -- | A summary description of the application.
    CreateAppResponse -> Maybe AppSummary
appSummary :: Prelude.Maybe AppSummary,
    -- | The server groups included in the application.
    CreateAppResponse -> Maybe [ServerGroup]
serverGroups :: Prelude.Maybe [ServerGroup],
    -- | The tags associated with the application.
    CreateAppResponse -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The response's http status code.
    CreateAppResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateAppResponse -> CreateAppResponse -> Bool
(CreateAppResponse -> CreateAppResponse -> Bool)
-> (CreateAppResponse -> CreateAppResponse -> Bool)
-> Eq CreateAppResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAppResponse -> CreateAppResponse -> Bool
$c/= :: CreateAppResponse -> CreateAppResponse -> Bool
== :: CreateAppResponse -> CreateAppResponse -> Bool
$c== :: CreateAppResponse -> CreateAppResponse -> Bool
Prelude.Eq, ReadPrec [CreateAppResponse]
ReadPrec CreateAppResponse
Int -> ReadS CreateAppResponse
ReadS [CreateAppResponse]
(Int -> ReadS CreateAppResponse)
-> ReadS [CreateAppResponse]
-> ReadPrec CreateAppResponse
-> ReadPrec [CreateAppResponse]
-> Read CreateAppResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAppResponse]
$creadListPrec :: ReadPrec [CreateAppResponse]
readPrec :: ReadPrec CreateAppResponse
$creadPrec :: ReadPrec CreateAppResponse
readList :: ReadS [CreateAppResponse]
$creadList :: ReadS [CreateAppResponse]
readsPrec :: Int -> ReadS CreateAppResponse
$creadsPrec :: Int -> ReadS CreateAppResponse
Prelude.Read, Int -> CreateAppResponse -> ShowS
[CreateAppResponse] -> ShowS
CreateAppResponse -> String
(Int -> CreateAppResponse -> ShowS)
-> (CreateAppResponse -> String)
-> ([CreateAppResponse] -> ShowS)
-> Show CreateAppResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAppResponse] -> ShowS
$cshowList :: [CreateAppResponse] -> ShowS
show :: CreateAppResponse -> String
$cshow :: CreateAppResponse -> String
showsPrec :: Int -> CreateAppResponse -> ShowS
$cshowsPrec :: Int -> CreateAppResponse -> ShowS
Prelude.Show, (forall x. CreateAppResponse -> Rep CreateAppResponse x)
-> (forall x. Rep CreateAppResponse x -> CreateAppResponse)
-> Generic CreateAppResponse
forall x. Rep CreateAppResponse x -> CreateAppResponse
forall x. CreateAppResponse -> Rep CreateAppResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateAppResponse x -> CreateAppResponse
$cfrom :: forall x. CreateAppResponse -> Rep CreateAppResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAppResponse' 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:
--
-- 'appSummary', 'createAppResponse_appSummary' - A summary description of the application.
--
-- 'serverGroups', 'createAppResponse_serverGroups' - The server groups included in the application.
--
-- 'tags', 'createAppResponse_tags' - The tags associated with the application.
--
-- 'httpStatus', 'createAppResponse_httpStatus' - The response's http status code.
newCreateAppResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateAppResponse
newCreateAppResponse :: Int -> CreateAppResponse
newCreateAppResponse Int
pHttpStatus_ =
  CreateAppResponse' :: Maybe AppSummary
-> Maybe [ServerGroup] -> Maybe [Tag] -> Int -> CreateAppResponse
CreateAppResponse'
    { $sel:appSummary:CreateAppResponse' :: Maybe AppSummary
appSummary = Maybe AppSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:serverGroups:CreateAppResponse' :: Maybe [ServerGroup]
serverGroups = Maybe [ServerGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateAppResponse' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateAppResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A summary description of the application.
createAppResponse_appSummary :: Lens.Lens' CreateAppResponse (Prelude.Maybe AppSummary)
createAppResponse_appSummary :: (Maybe AppSummary -> f (Maybe AppSummary))
-> CreateAppResponse -> f CreateAppResponse
createAppResponse_appSummary = (CreateAppResponse -> Maybe AppSummary)
-> (CreateAppResponse -> Maybe AppSummary -> CreateAppResponse)
-> Lens
     CreateAppResponse
     CreateAppResponse
     (Maybe AppSummary)
     (Maybe AppSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppResponse' {Maybe AppSummary
appSummary :: Maybe AppSummary
$sel:appSummary:CreateAppResponse' :: CreateAppResponse -> Maybe AppSummary
appSummary} -> Maybe AppSummary
appSummary) (\s :: CreateAppResponse
s@CreateAppResponse' {} Maybe AppSummary
a -> CreateAppResponse
s {$sel:appSummary:CreateAppResponse' :: Maybe AppSummary
appSummary = Maybe AppSummary
a} :: CreateAppResponse)

-- | The server groups included in the application.
createAppResponse_serverGroups :: Lens.Lens' CreateAppResponse (Prelude.Maybe [ServerGroup])
createAppResponse_serverGroups :: (Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
-> CreateAppResponse -> f CreateAppResponse
createAppResponse_serverGroups = (CreateAppResponse -> Maybe [ServerGroup])
-> (CreateAppResponse -> Maybe [ServerGroup] -> CreateAppResponse)
-> Lens
     CreateAppResponse
     CreateAppResponse
     (Maybe [ServerGroup])
     (Maybe [ServerGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppResponse' {Maybe [ServerGroup]
serverGroups :: Maybe [ServerGroup]
$sel:serverGroups:CreateAppResponse' :: CreateAppResponse -> Maybe [ServerGroup]
serverGroups} -> Maybe [ServerGroup]
serverGroups) (\s :: CreateAppResponse
s@CreateAppResponse' {} Maybe [ServerGroup]
a -> CreateAppResponse
s {$sel:serverGroups:CreateAppResponse' :: Maybe [ServerGroup]
serverGroups = Maybe [ServerGroup]
a} :: CreateAppResponse) ((Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
 -> CreateAppResponse -> f CreateAppResponse)
-> ((Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
    -> Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
-> (Maybe [ServerGroup] -> f (Maybe [ServerGroup]))
-> CreateAppResponse
-> f CreateAppResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ServerGroup] [ServerGroup] [ServerGroup] [ServerGroup]
-> Iso
     (Maybe [ServerGroup])
     (Maybe [ServerGroup])
     (Maybe [ServerGroup])
     (Maybe [ServerGroup])
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 [ServerGroup] [ServerGroup] [ServerGroup] [ServerGroup]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tags associated with the application.
createAppResponse_tags :: Lens.Lens' CreateAppResponse (Prelude.Maybe [Tag])
createAppResponse_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAppResponse -> f CreateAppResponse
createAppResponse_tags = (CreateAppResponse -> Maybe [Tag])
-> (CreateAppResponse -> Maybe [Tag] -> CreateAppResponse)
-> Lens
     CreateAppResponse CreateAppResponse (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAppResponse' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateAppResponse' :: CreateAppResponse -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateAppResponse
s@CreateAppResponse' {} Maybe [Tag]
a -> CreateAppResponse
s {$sel:tags:CreateAppResponse' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateAppResponse) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateAppResponse -> f CreateAppResponse)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateAppResponse
-> f CreateAppResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateAppResponse