{-# 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.AppMesh.CreateVirtualGateway
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a virtual gateway.
--
-- A virtual gateway allows resources outside your mesh to communicate to
-- resources that are inside your mesh. The virtual gateway represents an
-- Envoy proxy running in an Amazon ECS task, in a Kubernetes service, or
-- on an Amazon EC2 instance. Unlike a virtual node, which represents an
-- Envoy running with an application, a virtual gateway represents Envoy
-- deployed by itself.
--
-- For more information about virtual gateways, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/virtual_gateways.html Virtual gateways>.
module Amazonka.AppMesh.CreateVirtualGateway
  ( -- * Creating a Request
    CreateVirtualGateway (..),
    newCreateVirtualGateway,

    -- * Request Lenses
    createVirtualGateway_clientToken,
    createVirtualGateway_meshOwner,
    createVirtualGateway_tags,
    createVirtualGateway_meshName,
    createVirtualGateway_spec,
    createVirtualGateway_virtualGatewayName,

    -- * Destructuring the Response
    CreateVirtualGatewayResponse (..),
    newCreateVirtualGatewayResponse,

    -- * Response Lenses
    createVirtualGatewayResponse_httpStatus,
    createVirtualGatewayResponse_virtualGateway,
  )
where

import Amazonka.AppMesh.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateVirtualGateway' smart constructor.
data CreateVirtualGateway = CreateVirtualGateway'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. Up to 36 letters, numbers, hyphens, and
    -- underscores are allowed.
    CreateVirtualGateway -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services IAM account ID of the service mesh owner. If the
    -- account ID is not your own, then the account that you specify must share
    -- the mesh with your account before you can create the resource in the
    -- service mesh. For more information about mesh sharing, see
    -- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
    CreateVirtualGateway -> Maybe Text
meshOwner :: Prelude.Maybe Prelude.Text,
    -- | Optional metadata that you can apply to the virtual gateway to assist
    -- with categorization and organization. Each tag consists of a key and an
    -- optional value, both of which you define. Tag keys can have a maximum
    -- character length of 128 characters, and tag values can have a maximum
    -- length of 256 characters.
    CreateVirtualGateway -> Maybe [TagRef]
tags :: Prelude.Maybe [TagRef],
    -- | The name of the service mesh to create the virtual gateway in.
    CreateVirtualGateway -> Text
meshName :: Prelude.Text,
    -- | The virtual gateway specification to apply.
    CreateVirtualGateway -> VirtualGatewaySpec
spec :: VirtualGatewaySpec,
    -- | The name to use for the virtual gateway.
    CreateVirtualGateway -> Text
virtualGatewayName :: Prelude.Text
  }
  deriving (CreateVirtualGateway -> CreateVirtualGateway -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVirtualGateway -> CreateVirtualGateway -> Bool
$c/= :: CreateVirtualGateway -> CreateVirtualGateway -> Bool
== :: CreateVirtualGateway -> CreateVirtualGateway -> Bool
$c== :: CreateVirtualGateway -> CreateVirtualGateway -> Bool
Prelude.Eq, ReadPrec [CreateVirtualGateway]
ReadPrec CreateVirtualGateway
Int -> ReadS CreateVirtualGateway
ReadS [CreateVirtualGateway]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVirtualGateway]
$creadListPrec :: ReadPrec [CreateVirtualGateway]
readPrec :: ReadPrec CreateVirtualGateway
$creadPrec :: ReadPrec CreateVirtualGateway
readList :: ReadS [CreateVirtualGateway]
$creadList :: ReadS [CreateVirtualGateway]
readsPrec :: Int -> ReadS CreateVirtualGateway
$creadsPrec :: Int -> ReadS CreateVirtualGateway
Prelude.Read, Int -> CreateVirtualGateway -> ShowS
[CreateVirtualGateway] -> ShowS
CreateVirtualGateway -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVirtualGateway] -> ShowS
$cshowList :: [CreateVirtualGateway] -> ShowS
show :: CreateVirtualGateway -> String
$cshow :: CreateVirtualGateway -> String
showsPrec :: Int -> CreateVirtualGateway -> ShowS
$cshowsPrec :: Int -> CreateVirtualGateway -> ShowS
Prelude.Show, forall x. Rep CreateVirtualGateway x -> CreateVirtualGateway
forall x. CreateVirtualGateway -> Rep CreateVirtualGateway x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateVirtualGateway x -> CreateVirtualGateway
$cfrom :: forall x. CreateVirtualGateway -> Rep CreateVirtualGateway x
Prelude.Generic)

-- |
-- Create a value of 'CreateVirtualGateway' 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', 'createVirtualGateway_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Up to 36 letters, numbers, hyphens, and
-- underscores are allowed.
--
-- 'meshOwner', 'createVirtualGateway_meshOwner' - The Amazon Web Services IAM account ID of the service mesh owner. If the
-- account ID is not your own, then the account that you specify must share
-- the mesh with your account before you can create the resource in the
-- service mesh. For more information about mesh sharing, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
--
-- 'tags', 'createVirtualGateway_tags' - Optional metadata that you can apply to the virtual gateway to assist
-- with categorization and organization. Each tag consists of a key and an
-- optional value, both of which you define. Tag keys can have a maximum
-- character length of 128 characters, and tag values can have a maximum
-- length of 256 characters.
--
-- 'meshName', 'createVirtualGateway_meshName' - The name of the service mesh to create the virtual gateway in.
--
-- 'spec', 'createVirtualGateway_spec' - The virtual gateway specification to apply.
--
-- 'virtualGatewayName', 'createVirtualGateway_virtualGatewayName' - The name to use for the virtual gateway.
newCreateVirtualGateway ::
  -- | 'meshName'
  Prelude.Text ->
  -- | 'spec'
  VirtualGatewaySpec ->
  -- | 'virtualGatewayName'
  Prelude.Text ->
  CreateVirtualGateway
newCreateVirtualGateway :: Text -> VirtualGatewaySpec -> Text -> CreateVirtualGateway
newCreateVirtualGateway
  Text
pMeshName_
  VirtualGatewaySpec
pSpec_
  Text
pVirtualGatewayName_ =
    CreateVirtualGateway'
      { $sel:clientToken:CreateVirtualGateway' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:meshOwner:CreateVirtualGateway' :: Maybe Text
meshOwner = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateVirtualGateway' :: Maybe [TagRef]
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:meshName:CreateVirtualGateway' :: Text
meshName = Text
pMeshName_,
        $sel:spec:CreateVirtualGateway' :: VirtualGatewaySpec
spec = VirtualGatewaySpec
pSpec_,
        $sel:virtualGatewayName:CreateVirtualGateway' :: Text
virtualGatewayName = Text
pVirtualGatewayName_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. Up to 36 letters, numbers, hyphens, and
-- underscores are allowed.
createVirtualGateway_clientToken :: Lens.Lens' CreateVirtualGateway (Prelude.Maybe Prelude.Text)
createVirtualGateway_clientToken :: Lens' CreateVirtualGateway (Maybe Text)
createVirtualGateway_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualGateway' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateVirtualGateway
s@CreateVirtualGateway' {} Maybe Text
a -> CreateVirtualGateway
s {$sel:clientToken:CreateVirtualGateway' :: Maybe Text
clientToken = Maybe Text
a} :: CreateVirtualGateway)

-- | The Amazon Web Services IAM account ID of the service mesh owner. If the
-- account ID is not your own, then the account that you specify must share
-- the mesh with your account before you can create the resource in the
-- service mesh. For more information about mesh sharing, see
-- <https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html Working with shared meshes>.
createVirtualGateway_meshOwner :: Lens.Lens' CreateVirtualGateway (Prelude.Maybe Prelude.Text)
createVirtualGateway_meshOwner :: Lens' CreateVirtualGateway (Maybe Text)
createVirtualGateway_meshOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualGateway' {Maybe Text
meshOwner :: Maybe Text
$sel:meshOwner:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
meshOwner} -> Maybe Text
meshOwner) (\s :: CreateVirtualGateway
s@CreateVirtualGateway' {} Maybe Text
a -> CreateVirtualGateway
s {$sel:meshOwner:CreateVirtualGateway' :: Maybe Text
meshOwner = Maybe Text
a} :: CreateVirtualGateway)

-- | Optional metadata that you can apply to the virtual gateway to assist
-- with categorization and organization. Each tag consists of a key and an
-- optional value, both of which you define. Tag keys can have a maximum
-- character length of 128 characters, and tag values can have a maximum
-- length of 256 characters.
createVirtualGateway_tags :: Lens.Lens' CreateVirtualGateway (Prelude.Maybe [TagRef])
createVirtualGateway_tags :: Lens' CreateVirtualGateway (Maybe [TagRef])
createVirtualGateway_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualGateway' {Maybe [TagRef]
tags :: Maybe [TagRef]
$sel:tags:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe [TagRef]
tags} -> Maybe [TagRef]
tags) (\s :: CreateVirtualGateway
s@CreateVirtualGateway' {} Maybe [TagRef]
a -> CreateVirtualGateway
s {$sel:tags:CreateVirtualGateway' :: Maybe [TagRef]
tags = Maybe [TagRef]
a} :: CreateVirtualGateway) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the service mesh to create the virtual gateway in.
createVirtualGateway_meshName :: Lens.Lens' CreateVirtualGateway Prelude.Text
createVirtualGateway_meshName :: Lens' CreateVirtualGateway Text
createVirtualGateway_meshName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualGateway' {Text
meshName :: Text
$sel:meshName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
meshName} -> Text
meshName) (\s :: CreateVirtualGateway
s@CreateVirtualGateway' {} Text
a -> CreateVirtualGateway
s {$sel:meshName:CreateVirtualGateway' :: Text
meshName = Text
a} :: CreateVirtualGateway)

-- | The virtual gateway specification to apply.
createVirtualGateway_spec :: Lens.Lens' CreateVirtualGateway VirtualGatewaySpec
createVirtualGateway_spec :: Lens' CreateVirtualGateway VirtualGatewaySpec
createVirtualGateway_spec = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualGateway' {VirtualGatewaySpec
spec :: VirtualGatewaySpec
$sel:spec:CreateVirtualGateway' :: CreateVirtualGateway -> VirtualGatewaySpec
spec} -> VirtualGatewaySpec
spec) (\s :: CreateVirtualGateway
s@CreateVirtualGateway' {} VirtualGatewaySpec
a -> CreateVirtualGateway
s {$sel:spec:CreateVirtualGateway' :: VirtualGatewaySpec
spec = VirtualGatewaySpec
a} :: CreateVirtualGateway)

-- | The name to use for the virtual gateway.
createVirtualGateway_virtualGatewayName :: Lens.Lens' CreateVirtualGateway Prelude.Text
createVirtualGateway_virtualGatewayName :: Lens' CreateVirtualGateway Text
createVirtualGateway_virtualGatewayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualGateway' {Text
virtualGatewayName :: Text
$sel:virtualGatewayName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
virtualGatewayName} -> Text
virtualGatewayName) (\s :: CreateVirtualGateway
s@CreateVirtualGateway' {} Text
a -> CreateVirtualGateway
s {$sel:virtualGatewayName:CreateVirtualGateway' :: Text
virtualGatewayName = Text
a} :: CreateVirtualGateway)

instance Core.AWSRequest CreateVirtualGateway where
  type
    AWSResponse CreateVirtualGateway =
      CreateVirtualGatewayResponse
  request :: (Service -> Service)
-> CreateVirtualGateway -> Request CreateVirtualGateway
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateVirtualGateway
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateVirtualGateway)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int -> VirtualGatewayData -> CreateVirtualGatewayResponse
CreateVirtualGatewayResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromJSON a => Object -> Either String a
Data.eitherParseJSON Object
x)
      )

instance Prelude.Hashable CreateVirtualGateway where
  hashWithSalt :: Int -> CreateVirtualGateway -> Int
hashWithSalt Int
_salt CreateVirtualGateway' {Maybe [TagRef]
Maybe Text
Text
VirtualGatewaySpec
virtualGatewayName :: Text
spec :: VirtualGatewaySpec
meshName :: Text
tags :: Maybe [TagRef]
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:spec:CreateVirtualGateway' :: CreateVirtualGateway -> VirtualGatewaySpec
$sel:meshName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:tags:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe [TagRef]
$sel:meshOwner:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
$sel:clientToken:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
meshOwner
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [TagRef]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
meshName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` VirtualGatewaySpec
spec
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
virtualGatewayName

instance Prelude.NFData CreateVirtualGateway where
  rnf :: CreateVirtualGateway -> ()
rnf CreateVirtualGateway' {Maybe [TagRef]
Maybe Text
Text
VirtualGatewaySpec
virtualGatewayName :: Text
spec :: VirtualGatewaySpec
meshName :: Text
tags :: Maybe [TagRef]
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:spec:CreateVirtualGateway' :: CreateVirtualGateway -> VirtualGatewaySpec
$sel:meshName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:tags:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe [TagRef]
$sel:meshOwner:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
$sel:clientToken:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
meshOwner
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagRef]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
meshName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VirtualGatewaySpec
spec
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
virtualGatewayName

instance Data.ToHeaders CreateVirtualGateway where
  toHeaders :: CreateVirtualGateway -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateVirtualGateway where
  toJSON :: CreateVirtualGateway -> Value
toJSON CreateVirtualGateway' {Maybe [TagRef]
Maybe Text
Text
VirtualGatewaySpec
virtualGatewayName :: Text
spec :: VirtualGatewaySpec
meshName :: Text
tags :: Maybe [TagRef]
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:spec:CreateVirtualGateway' :: CreateVirtualGateway -> VirtualGatewaySpec
$sel:meshName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:tags:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe [TagRef]
$sel:meshOwner:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
$sel:clientToken:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"clientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Key
"tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [TagRef]
tags,
            forall a. a -> Maybe a
Prelude.Just (Key
"spec" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= VirtualGatewaySpec
spec),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"virtualGatewayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
virtualGatewayName)
          ]
      )

instance Data.ToPath CreateVirtualGateway where
  toPath :: CreateVirtualGateway -> ByteString
toPath CreateVirtualGateway' {Maybe [TagRef]
Maybe Text
Text
VirtualGatewaySpec
virtualGatewayName :: Text
spec :: VirtualGatewaySpec
meshName :: Text
tags :: Maybe [TagRef]
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:spec:CreateVirtualGateway' :: CreateVirtualGateway -> VirtualGatewaySpec
$sel:meshName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:tags:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe [TagRef]
$sel:meshOwner:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
$sel:clientToken:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/v20190125/meshes/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
meshName,
        ByteString
"/virtualGateways"
      ]

instance Data.ToQuery CreateVirtualGateway where
  toQuery :: CreateVirtualGateway -> QueryString
toQuery CreateVirtualGateway' {Maybe [TagRef]
Maybe Text
Text
VirtualGatewaySpec
virtualGatewayName :: Text
spec :: VirtualGatewaySpec
meshName :: Text
tags :: Maybe [TagRef]
meshOwner :: Maybe Text
clientToken :: Maybe Text
$sel:virtualGatewayName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:spec:CreateVirtualGateway' :: CreateVirtualGateway -> VirtualGatewaySpec
$sel:meshName:CreateVirtualGateway' :: CreateVirtualGateway -> Text
$sel:tags:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe [TagRef]
$sel:meshOwner:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
$sel:clientToken:CreateVirtualGateway' :: CreateVirtualGateway -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"meshOwner" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
meshOwner]

-- | /See:/ 'newCreateVirtualGatewayResponse' smart constructor.
data CreateVirtualGatewayResponse = CreateVirtualGatewayResponse'
  { -- | The response's http status code.
    CreateVirtualGatewayResponse -> Int
httpStatus :: Prelude.Int,
    -- | The full description of your virtual gateway following the create call.
    CreateVirtualGatewayResponse -> VirtualGatewayData
virtualGateway :: VirtualGatewayData
  }
  deriving (CreateVirtualGatewayResponse
-> CreateVirtualGatewayResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVirtualGatewayResponse
-> CreateVirtualGatewayResponse -> Bool
$c/= :: CreateVirtualGatewayResponse
-> CreateVirtualGatewayResponse -> Bool
== :: CreateVirtualGatewayResponse
-> CreateVirtualGatewayResponse -> Bool
$c== :: CreateVirtualGatewayResponse
-> CreateVirtualGatewayResponse -> Bool
Prelude.Eq, ReadPrec [CreateVirtualGatewayResponse]
ReadPrec CreateVirtualGatewayResponse
Int -> ReadS CreateVirtualGatewayResponse
ReadS [CreateVirtualGatewayResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVirtualGatewayResponse]
$creadListPrec :: ReadPrec [CreateVirtualGatewayResponse]
readPrec :: ReadPrec CreateVirtualGatewayResponse
$creadPrec :: ReadPrec CreateVirtualGatewayResponse
readList :: ReadS [CreateVirtualGatewayResponse]
$creadList :: ReadS [CreateVirtualGatewayResponse]
readsPrec :: Int -> ReadS CreateVirtualGatewayResponse
$creadsPrec :: Int -> ReadS CreateVirtualGatewayResponse
Prelude.Read, Int -> CreateVirtualGatewayResponse -> ShowS
[CreateVirtualGatewayResponse] -> ShowS
CreateVirtualGatewayResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVirtualGatewayResponse] -> ShowS
$cshowList :: [CreateVirtualGatewayResponse] -> ShowS
show :: CreateVirtualGatewayResponse -> String
$cshow :: CreateVirtualGatewayResponse -> String
showsPrec :: Int -> CreateVirtualGatewayResponse -> ShowS
$cshowsPrec :: Int -> CreateVirtualGatewayResponse -> ShowS
Prelude.Show, forall x.
Rep CreateVirtualGatewayResponse x -> CreateVirtualGatewayResponse
forall x.
CreateVirtualGatewayResponse -> Rep CreateVirtualGatewayResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVirtualGatewayResponse x -> CreateVirtualGatewayResponse
$cfrom :: forall x.
CreateVirtualGatewayResponse -> Rep CreateVirtualGatewayResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateVirtualGatewayResponse' 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:
--
-- 'httpStatus', 'createVirtualGatewayResponse_httpStatus' - The response's http status code.
--
-- 'virtualGateway', 'createVirtualGatewayResponse_virtualGateway' - The full description of your virtual gateway following the create call.
newCreateVirtualGatewayResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'virtualGateway'
  VirtualGatewayData ->
  CreateVirtualGatewayResponse
newCreateVirtualGatewayResponse :: Int -> VirtualGatewayData -> CreateVirtualGatewayResponse
newCreateVirtualGatewayResponse
  Int
pHttpStatus_
  VirtualGatewayData
pVirtualGateway_ =
    CreateVirtualGatewayResponse'
      { $sel:httpStatus:CreateVirtualGatewayResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:virtualGateway:CreateVirtualGatewayResponse' :: VirtualGatewayData
virtualGateway = VirtualGatewayData
pVirtualGateway_
      }

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

-- | The full description of your virtual gateway following the create call.
createVirtualGatewayResponse_virtualGateway :: Lens.Lens' CreateVirtualGatewayResponse VirtualGatewayData
createVirtualGatewayResponse_virtualGateway :: Lens' CreateVirtualGatewayResponse VirtualGatewayData
createVirtualGatewayResponse_virtualGateway = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVirtualGatewayResponse' {VirtualGatewayData
virtualGateway :: VirtualGatewayData
$sel:virtualGateway:CreateVirtualGatewayResponse' :: CreateVirtualGatewayResponse -> VirtualGatewayData
virtualGateway} -> VirtualGatewayData
virtualGateway) (\s :: CreateVirtualGatewayResponse
s@CreateVirtualGatewayResponse' {} VirtualGatewayData
a -> CreateVirtualGatewayResponse
s {$sel:virtualGateway:CreateVirtualGatewayResponse' :: VirtualGatewayData
virtualGateway = VirtualGatewayData
a} :: CreateVirtualGatewayResponse)

instance Prelude.NFData CreateVirtualGatewayResponse where
  rnf :: CreateVirtualGatewayResponse -> ()
rnf CreateVirtualGatewayResponse' {Int
VirtualGatewayData
virtualGateway :: VirtualGatewayData
httpStatus :: Int
$sel:virtualGateway:CreateVirtualGatewayResponse' :: CreateVirtualGatewayResponse -> VirtualGatewayData
$sel:httpStatus:CreateVirtualGatewayResponse' :: CreateVirtualGatewayResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf VirtualGatewayData
virtualGateway