{-# 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.CodeStarConnections.CreateHost
-- 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 a resource that represents the infrastructure where a
-- third-party provider is installed. The host is used when you create
-- connections to an installed third-party provider type, such as GitHub
-- Enterprise Server. You create one host for all connections to that
-- provider.
--
-- A host created through the CLI or the SDK is in \`PENDING\` status by
-- default. You can make its status \`AVAILABLE\` by setting up the host in
-- the console.
module Amazonka.CodeStarConnections.CreateHost
  ( -- * Creating a Request
    CreateHost (..),
    newCreateHost,

    -- * Request Lenses
    createHost_vpcConfiguration,
    createHost_tags,
    createHost_name,
    createHost_providerType,
    createHost_providerEndpoint,

    -- * Destructuring the Response
    CreateHostResponse (..),
    newCreateHostResponse,

    -- * Response Lenses
    createHostResponse_hostArn,
    createHostResponse_tags,
    createHostResponse_httpStatus,
  )
where

import Amazonka.CodeStarConnections.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:/ 'newCreateHost' smart constructor.
data CreateHost = CreateHost'
  { -- | The VPC configuration to be provisioned for the host. A VPC must be
    -- configured and the infrastructure to be represented by the host must
    -- already be connected to the VPC.
    CreateHost -> Maybe VpcConfiguration
vpcConfiguration :: Prelude.Maybe VpcConfiguration,
    CreateHost -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the host to be created. The name must be unique in the
    -- calling AWS account.
    CreateHost -> Text
name :: Prelude.Text,
    -- | The name of the installed provider to be associated with your
    -- connection. The host resource represents the infrastructure where your
    -- provider type is installed. The valid provider type is GitHub Enterprise
    -- Server.
    CreateHost -> ProviderType
providerType :: ProviderType,
    -- | The endpoint of the infrastructure to be represented by the host after
    -- it is created.
    CreateHost -> Text
providerEndpoint :: Prelude.Text
  }
  deriving (CreateHost -> CreateHost -> Bool
(CreateHost -> CreateHost -> Bool)
-> (CreateHost -> CreateHost -> Bool) -> Eq CreateHost
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHost -> CreateHost -> Bool
$c/= :: CreateHost -> CreateHost -> Bool
== :: CreateHost -> CreateHost -> Bool
$c== :: CreateHost -> CreateHost -> Bool
Prelude.Eq, ReadPrec [CreateHost]
ReadPrec CreateHost
Int -> ReadS CreateHost
ReadS [CreateHost]
(Int -> ReadS CreateHost)
-> ReadS [CreateHost]
-> ReadPrec CreateHost
-> ReadPrec [CreateHost]
-> Read CreateHost
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHost]
$creadListPrec :: ReadPrec [CreateHost]
readPrec :: ReadPrec CreateHost
$creadPrec :: ReadPrec CreateHost
readList :: ReadS [CreateHost]
$creadList :: ReadS [CreateHost]
readsPrec :: Int -> ReadS CreateHost
$creadsPrec :: Int -> ReadS CreateHost
Prelude.Read, Int -> CreateHost -> ShowS
[CreateHost] -> ShowS
CreateHost -> String
(Int -> CreateHost -> ShowS)
-> (CreateHost -> String)
-> ([CreateHost] -> ShowS)
-> Show CreateHost
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHost] -> ShowS
$cshowList :: [CreateHost] -> ShowS
show :: CreateHost -> String
$cshow :: CreateHost -> String
showsPrec :: Int -> CreateHost -> ShowS
$cshowsPrec :: Int -> CreateHost -> ShowS
Prelude.Show, (forall x. CreateHost -> Rep CreateHost x)
-> (forall x. Rep CreateHost x -> CreateHost) -> Generic CreateHost
forall x. Rep CreateHost x -> CreateHost
forall x. CreateHost -> Rep CreateHost x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHost x -> CreateHost
$cfrom :: forall x. CreateHost -> Rep CreateHost x
Prelude.Generic)

-- |
-- Create a value of 'CreateHost' 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:
--
-- 'vpcConfiguration', 'createHost_vpcConfiguration' - The VPC configuration to be provisioned for the host. A VPC must be
-- configured and the infrastructure to be represented by the host must
-- already be connected to the VPC.
--
-- 'tags', 'createHost_tags' - Undocumented member.
--
-- 'name', 'createHost_name' - The name of the host to be created. The name must be unique in the
-- calling AWS account.
--
-- 'providerType', 'createHost_providerType' - The name of the installed provider to be associated with your
-- connection. The host resource represents the infrastructure where your
-- provider type is installed. The valid provider type is GitHub Enterprise
-- Server.
--
-- 'providerEndpoint', 'createHost_providerEndpoint' - The endpoint of the infrastructure to be represented by the host after
-- it is created.
newCreateHost ::
  -- | 'name'
  Prelude.Text ->
  -- | 'providerType'
  ProviderType ->
  -- | 'providerEndpoint'
  Prelude.Text ->
  CreateHost
newCreateHost :: Text -> ProviderType -> Text -> CreateHost
newCreateHost
  Text
pName_
  ProviderType
pProviderType_
  Text
pProviderEndpoint_ =
    CreateHost' :: Maybe VpcConfiguration
-> Maybe [Tag] -> Text -> ProviderType -> Text -> CreateHost
CreateHost'
      { $sel:vpcConfiguration:CreateHost' :: Maybe VpcConfiguration
vpcConfiguration = Maybe VpcConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateHost' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateHost' :: Text
name = Text
pName_,
        $sel:providerType:CreateHost' :: ProviderType
providerType = ProviderType
pProviderType_,
        $sel:providerEndpoint:CreateHost' :: Text
providerEndpoint = Text
pProviderEndpoint_
      }

-- | The VPC configuration to be provisioned for the host. A VPC must be
-- configured and the infrastructure to be represented by the host must
-- already be connected to the VPC.
createHost_vpcConfiguration :: Lens.Lens' CreateHost (Prelude.Maybe VpcConfiguration)
createHost_vpcConfiguration :: (Maybe VpcConfiguration -> f (Maybe VpcConfiguration))
-> CreateHost -> f CreateHost
createHost_vpcConfiguration = (CreateHost -> Maybe VpcConfiguration)
-> (CreateHost -> Maybe VpcConfiguration -> CreateHost)
-> Lens
     CreateHost
     CreateHost
     (Maybe VpcConfiguration)
     (Maybe VpcConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHost' {Maybe VpcConfiguration
vpcConfiguration :: Maybe VpcConfiguration
$sel:vpcConfiguration:CreateHost' :: CreateHost -> Maybe VpcConfiguration
vpcConfiguration} -> Maybe VpcConfiguration
vpcConfiguration) (\s :: CreateHost
s@CreateHost' {} Maybe VpcConfiguration
a -> CreateHost
s {$sel:vpcConfiguration:CreateHost' :: Maybe VpcConfiguration
vpcConfiguration = Maybe VpcConfiguration
a} :: CreateHost)

-- | Undocumented member.
createHost_tags :: Lens.Lens' CreateHost (Prelude.Maybe [Tag])
createHost_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> CreateHost -> f CreateHost
createHost_tags = (CreateHost -> Maybe [Tag])
-> (CreateHost -> Maybe [Tag] -> CreateHost)
-> Lens CreateHost CreateHost (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHost' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateHost' :: CreateHost -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateHost
s@CreateHost' {} Maybe [Tag]
a -> CreateHost
s {$sel:tags:CreateHost' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateHost) ((Maybe [Tag] -> f (Maybe [Tag])) -> CreateHost -> f CreateHost)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateHost
-> f CreateHost
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 name of the host to be created. The name must be unique in the
-- calling AWS account.
createHost_name :: Lens.Lens' CreateHost Prelude.Text
createHost_name :: (Text -> f Text) -> CreateHost -> f CreateHost
createHost_name = (CreateHost -> Text)
-> (CreateHost -> Text -> CreateHost)
-> Lens CreateHost CreateHost Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHost' {Text
name :: Text
$sel:name:CreateHost' :: CreateHost -> Text
name} -> Text
name) (\s :: CreateHost
s@CreateHost' {} Text
a -> CreateHost
s {$sel:name:CreateHost' :: Text
name = Text
a} :: CreateHost)

-- | The name of the installed provider to be associated with your
-- connection. The host resource represents the infrastructure where your
-- provider type is installed. The valid provider type is GitHub Enterprise
-- Server.
createHost_providerType :: Lens.Lens' CreateHost ProviderType
createHost_providerType :: (ProviderType -> f ProviderType) -> CreateHost -> f CreateHost
createHost_providerType = (CreateHost -> ProviderType)
-> (CreateHost -> ProviderType -> CreateHost)
-> Lens CreateHost CreateHost ProviderType ProviderType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHost' {ProviderType
providerType :: ProviderType
$sel:providerType:CreateHost' :: CreateHost -> ProviderType
providerType} -> ProviderType
providerType) (\s :: CreateHost
s@CreateHost' {} ProviderType
a -> CreateHost
s {$sel:providerType:CreateHost' :: ProviderType
providerType = ProviderType
a} :: CreateHost)

-- | The endpoint of the infrastructure to be represented by the host after
-- it is created.
createHost_providerEndpoint :: Lens.Lens' CreateHost Prelude.Text
createHost_providerEndpoint :: (Text -> f Text) -> CreateHost -> f CreateHost
createHost_providerEndpoint = (CreateHost -> Text)
-> (CreateHost -> Text -> CreateHost)
-> Lens CreateHost CreateHost Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHost' {Text
providerEndpoint :: Text
$sel:providerEndpoint:CreateHost' :: CreateHost -> Text
providerEndpoint} -> Text
providerEndpoint) (\s :: CreateHost
s@CreateHost' {} Text
a -> CreateHost
s {$sel:providerEndpoint:CreateHost' :: Text
providerEndpoint = Text
a} :: CreateHost)

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

instance Prelude.NFData CreateHost

instance Core.ToHeaders CreateHost where
  toHeaders :: CreateHost -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateHost -> 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
"com.amazonaws.codestar.connections.CodeStar_connections_20191201.CreateHost" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON CreateHost where
  toJSON :: CreateHost -> Value
toJSON CreateHost' {Maybe [Tag]
Maybe VpcConfiguration
Text
ProviderType
providerEndpoint :: Text
providerType :: ProviderType
name :: Text
tags :: Maybe [Tag]
vpcConfiguration :: Maybe VpcConfiguration
$sel:providerEndpoint:CreateHost' :: CreateHost -> Text
$sel:providerType:CreateHost' :: CreateHost -> ProviderType
$sel:name:CreateHost' :: CreateHost -> Text
$sel:tags:CreateHost' :: CreateHost -> Maybe [Tag]
$sel:vpcConfiguration:CreateHost' :: CreateHost -> Maybe VpcConfiguration
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"VpcConfiguration" Text -> VpcConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (VpcConfiguration -> Pair) -> Maybe VpcConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe VpcConfiguration
vpcConfiguration,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ProviderType" Text -> ProviderType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ProviderType
providerType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ProviderEndpoint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
providerEndpoint)
          ]
      )

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

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

-- | /See:/ 'newCreateHostResponse' smart constructor.
data CreateHostResponse = CreateHostResponse'
  { -- | The Amazon Resource Name (ARN) of the host to be created.
    CreateHostResponse -> Maybe Text
hostArn :: Prelude.Maybe Prelude.Text,
    CreateHostResponse -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The response's http status code.
    CreateHostResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateHostResponse -> CreateHostResponse -> Bool
(CreateHostResponse -> CreateHostResponse -> Bool)
-> (CreateHostResponse -> CreateHostResponse -> Bool)
-> Eq CreateHostResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHostResponse -> CreateHostResponse -> Bool
$c/= :: CreateHostResponse -> CreateHostResponse -> Bool
== :: CreateHostResponse -> CreateHostResponse -> Bool
$c== :: CreateHostResponse -> CreateHostResponse -> Bool
Prelude.Eq, ReadPrec [CreateHostResponse]
ReadPrec CreateHostResponse
Int -> ReadS CreateHostResponse
ReadS [CreateHostResponse]
(Int -> ReadS CreateHostResponse)
-> ReadS [CreateHostResponse]
-> ReadPrec CreateHostResponse
-> ReadPrec [CreateHostResponse]
-> Read CreateHostResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHostResponse]
$creadListPrec :: ReadPrec [CreateHostResponse]
readPrec :: ReadPrec CreateHostResponse
$creadPrec :: ReadPrec CreateHostResponse
readList :: ReadS [CreateHostResponse]
$creadList :: ReadS [CreateHostResponse]
readsPrec :: Int -> ReadS CreateHostResponse
$creadsPrec :: Int -> ReadS CreateHostResponse
Prelude.Read, Int -> CreateHostResponse -> ShowS
[CreateHostResponse] -> ShowS
CreateHostResponse -> String
(Int -> CreateHostResponse -> ShowS)
-> (CreateHostResponse -> String)
-> ([CreateHostResponse] -> ShowS)
-> Show CreateHostResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHostResponse] -> ShowS
$cshowList :: [CreateHostResponse] -> ShowS
show :: CreateHostResponse -> String
$cshow :: CreateHostResponse -> String
showsPrec :: Int -> CreateHostResponse -> ShowS
$cshowsPrec :: Int -> CreateHostResponse -> ShowS
Prelude.Show, (forall x. CreateHostResponse -> Rep CreateHostResponse x)
-> (forall x. Rep CreateHostResponse x -> CreateHostResponse)
-> Generic CreateHostResponse
forall x. Rep CreateHostResponse x -> CreateHostResponse
forall x. CreateHostResponse -> Rep CreateHostResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHostResponse x -> CreateHostResponse
$cfrom :: forall x. CreateHostResponse -> Rep CreateHostResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateHostResponse' 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:
--
-- 'hostArn', 'createHostResponse_hostArn' - The Amazon Resource Name (ARN) of the host to be created.
--
-- 'tags', 'createHostResponse_tags' - Undocumented member.
--
-- 'httpStatus', 'createHostResponse_httpStatus' - The response's http status code.
newCreateHostResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateHostResponse
newCreateHostResponse :: Int -> CreateHostResponse
newCreateHostResponse Int
pHttpStatus_ =
  CreateHostResponse' :: Maybe Text -> Maybe [Tag] -> Int -> CreateHostResponse
CreateHostResponse'
    { $sel:hostArn:CreateHostResponse' :: Maybe Text
hostArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateHostResponse' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateHostResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the host to be created.
createHostResponse_hostArn :: Lens.Lens' CreateHostResponse (Prelude.Maybe Prelude.Text)
createHostResponse_hostArn :: (Maybe Text -> f (Maybe Text))
-> CreateHostResponse -> f CreateHostResponse
createHostResponse_hostArn = (CreateHostResponse -> Maybe Text)
-> (CreateHostResponse -> Maybe Text -> CreateHostResponse)
-> Lens
     CreateHostResponse CreateHostResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostResponse' {Maybe Text
hostArn :: Maybe Text
$sel:hostArn:CreateHostResponse' :: CreateHostResponse -> Maybe Text
hostArn} -> Maybe Text
hostArn) (\s :: CreateHostResponse
s@CreateHostResponse' {} Maybe Text
a -> CreateHostResponse
s {$sel:hostArn:CreateHostResponse' :: Maybe Text
hostArn = Maybe Text
a} :: CreateHostResponse)

-- | Undocumented member.
createHostResponse_tags :: Lens.Lens' CreateHostResponse (Prelude.Maybe [Tag])
createHostResponse_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateHostResponse -> f CreateHostResponse
createHostResponse_tags = (CreateHostResponse -> Maybe [Tag])
-> (CreateHostResponse -> Maybe [Tag] -> CreateHostResponse)
-> Lens
     CreateHostResponse CreateHostResponse (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostResponse' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateHostResponse' :: CreateHostResponse -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateHostResponse
s@CreateHostResponse' {} Maybe [Tag]
a -> CreateHostResponse
s {$sel:tags:CreateHostResponse' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateHostResponse) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateHostResponse -> f CreateHostResponse)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateHostResponse
-> f CreateHostResponse
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.
createHostResponse_httpStatus :: Lens.Lens' CreateHostResponse Prelude.Int
createHostResponse_httpStatus :: (Int -> f Int) -> CreateHostResponse -> f CreateHostResponse
createHostResponse_httpStatus = (CreateHostResponse -> Int)
-> (CreateHostResponse -> Int -> CreateHostResponse)
-> Lens CreateHostResponse CreateHostResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateHostResponse' :: CreateHostResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateHostResponse
s@CreateHostResponse' {} Int
a -> CreateHostResponse
s {$sel:httpStatus:CreateHostResponse' :: Int
httpStatus = Int
a} :: CreateHostResponse)

instance Prelude.NFData CreateHostResponse