{-# 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.MigrationHubReFactorSpaces.CreateRoute
-- 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 an Amazon Web Services Migration Hub Refactor Spaces route. The
-- account owner of the service resource is always the environment owner,
-- regardless of which account creates the route. Routes target a service
-- in the application. If an application does not have any routes, then the
-- first route must be created as a @DEFAULT@ @RouteType@.
--
-- When created, the default route defaults to an active state so state is
-- not a required input. However, like all other state values the state of
-- the default route can be updated after creation, but only when all other
-- routes are also inactive. Conversely, no route can be active without the
-- default route also being active.
--
-- When you create a route, Refactor Spaces configures the Amazon API
-- Gateway to send traffic to the target service as follows:
--
-- -   If the service has a URL endpoint, and the endpoint resolves to a
--     private IP address, Refactor Spaces routes traffic using the API
--     Gateway VPC link.
--
-- -   If the service has a URL endpoint, and the endpoint resolves to a
--     public IP address, Refactor Spaces routes traffic over the public
--     internet.
--
-- -   If the service has an Lambda function endpoint, then Refactor Spaces
--     configures the Lambda function\'s resource policy to allow the
--     application\'s API Gateway to invoke the function.
--
-- A one-time health check is performed on the service when either the
-- route is updated from inactive to active, or when it is created with an
-- active state. If the health check fails, the route transitions the route
-- state to @FAILED@, an error code of
-- @SERVICE_ENDPOINT_HEALTH_CHECK_FAILURE@ is provided, and no traffic is
-- sent to the service.
--
-- For Lambda functions, the Lambda function state is checked. If the
-- function is not active, the function configuration is updated so that
-- Lambda resources are provisioned. If the Lambda state is @Failed@, then
-- the route creation fails. For more information, see the
-- <https://docs.aws.amazon.com/lambda/latest/dg/API_GetFunctionConfiguration.html#SSS-GetFunctionConfiguration-response-State GetFunctionConfiguration\'s State response parameter>
-- in the /Lambda Developer Guide/.
--
-- For Lambda endpoints, a check is performed to determine that a Lambda
-- function with the specified ARN exists. If it does not exist, the health
-- check fails. For public URLs, a connection is opened to the public
-- endpoint. If the URL is not reachable, the health check fails.
--
-- Refactor Spaces automatically resolves the public Domain Name System
-- (DNS) names that are set in CreateServiceRequest$UrlEndpoint when you
-- create a service. The DNS names resolve when the DNS time-to-live (TTL)
-- expires, or every 60 seconds for TTLs less than 60 seconds. This
-- periodic DNS resolution ensures that the route configuration remains
-- up-to-date.
--
-- For private URLS, a target group is created on the Elastic Load
-- Balancing and the target group health check is run. The
-- @HealthCheckProtocol@, @HealthCheckPort@, and @HealthCheckPath@ are the
-- same protocol, port, and path specified in the URL or health URL, if
-- used. All other settings use the default values, as described in
-- <https://docs.aws.amazon.com/elasticloadbalancing/latest/application/target-group-health-checks.html Health checks for your target groups>.
-- The health check is considered successful if at least one target within
-- the target group transitions to a healthy state.
--
-- Services can have HTTP or HTTPS URL endpoints. For HTTPS URLs,
-- publicly-signed certificates are supported. Private Certificate
-- Authorities (CAs) are permitted only if the CA\'s domain is also
-- publicly resolvable.
module Amazonka.MigrationHubReFactorSpaces.CreateRoute
  ( -- * Creating a Request
    CreateRoute (..),
    newCreateRoute,

    -- * Request Lenses
    createRoute_clientToken,
    createRoute_defaultRoute,
    createRoute_tags,
    createRoute_uriPathRoute,
    createRoute_applicationIdentifier,
    createRoute_environmentIdentifier,
    createRoute_routeType,
    createRoute_serviceIdentifier,

    -- * Destructuring the Response
    CreateRouteResponse (..),
    newCreateRouteResponse,

    -- * Response Lenses
    createRouteResponse_applicationId,
    createRouteResponse_arn,
    createRouteResponse_createdByAccountId,
    createRouteResponse_createdTime,
    createRouteResponse_lastUpdatedTime,
    createRouteResponse_ownerAccountId,
    createRouteResponse_routeId,
    createRouteResponse_routeType,
    createRouteResponse_serviceId,
    createRouteResponse_state,
    createRouteResponse_tags,
    createRouteResponse_uriPathRoute,
    createRouteResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateRoute' smart constructor.
data CreateRoute = CreateRoute'
  { -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateRoute -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Configuration for the default route type.
    CreateRoute -> Maybe DefaultRouteInput
defaultRoute :: Prelude.Maybe DefaultRouteInput,
    -- | The tags to assign to the route. A tag is a label that you assign to an
    -- Amazon Web Services resource. Each tag consists of a key-value pair..
    CreateRoute -> Maybe (Sensitive (HashMap Text Text))
tags :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | The configuration for the URI path route type.
    CreateRoute -> Maybe UriPathRouteInput
uriPathRoute :: Prelude.Maybe UriPathRouteInput,
    -- | The ID of the application within which the route is being created.
    CreateRoute -> Text
applicationIdentifier :: Prelude.Text,
    -- | The ID of the environment in which the route is created.
    CreateRoute -> Text
environmentIdentifier :: Prelude.Text,
    -- | The route type of the route. @DEFAULT@ indicates that all traffic that
    -- does not match another route is forwarded to the default route.
    -- Applications must have a default route before any other routes can be
    -- created. @URI_PATH@ indicates a route that is based on a URI path.
    CreateRoute -> RouteType
routeType :: RouteType,
    -- | The ID of the service in which the route is created. Traffic that
    -- matches this route is forwarded to this service.
    CreateRoute -> Text
serviceIdentifier :: Prelude.Text
  }
  deriving (CreateRoute -> CreateRoute -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRoute -> CreateRoute -> Bool
$c/= :: CreateRoute -> CreateRoute -> Bool
== :: CreateRoute -> CreateRoute -> Bool
$c== :: CreateRoute -> CreateRoute -> Bool
Prelude.Eq, Int -> CreateRoute -> ShowS
[CreateRoute] -> ShowS
CreateRoute -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRoute] -> ShowS
$cshowList :: [CreateRoute] -> ShowS
show :: CreateRoute -> String
$cshow :: CreateRoute -> String
showsPrec :: Int -> CreateRoute -> ShowS
$cshowsPrec :: Int -> CreateRoute -> ShowS
Prelude.Show, forall x. Rep CreateRoute x -> CreateRoute
forall x. CreateRoute -> Rep CreateRoute x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRoute x -> CreateRoute
$cfrom :: forall x. CreateRoute -> Rep CreateRoute x
Prelude.Generic)

-- |
-- Create a value of 'CreateRoute' 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', 'createRoute_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'defaultRoute', 'createRoute_defaultRoute' - Configuration for the default route type.
--
-- 'tags', 'createRoute_tags' - The tags to assign to the route. A tag is a label that you assign to an
-- Amazon Web Services resource. Each tag consists of a key-value pair..
--
-- 'uriPathRoute', 'createRoute_uriPathRoute' - The configuration for the URI path route type.
--
-- 'applicationIdentifier', 'createRoute_applicationIdentifier' - The ID of the application within which the route is being created.
--
-- 'environmentIdentifier', 'createRoute_environmentIdentifier' - The ID of the environment in which the route is created.
--
-- 'routeType', 'createRoute_routeType' - The route type of the route. @DEFAULT@ indicates that all traffic that
-- does not match another route is forwarded to the default route.
-- Applications must have a default route before any other routes can be
-- created. @URI_PATH@ indicates a route that is based on a URI path.
--
-- 'serviceIdentifier', 'createRoute_serviceIdentifier' - The ID of the service in which the route is created. Traffic that
-- matches this route is forwarded to this service.
newCreateRoute ::
  -- | 'applicationIdentifier'
  Prelude.Text ->
  -- | 'environmentIdentifier'
  Prelude.Text ->
  -- | 'routeType'
  RouteType ->
  -- | 'serviceIdentifier'
  Prelude.Text ->
  CreateRoute
newCreateRoute :: Text -> Text -> RouteType -> Text -> CreateRoute
newCreateRoute
  Text
pApplicationIdentifier_
  Text
pEnvironmentIdentifier_
  RouteType
pRouteType_
  Text
pServiceIdentifier_ =
    CreateRoute'
      { $sel:clientToken:CreateRoute' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultRoute:CreateRoute' :: Maybe DefaultRouteInput
defaultRoute = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateRoute' :: Maybe (Sensitive (HashMap Text Text))
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:uriPathRoute:CreateRoute' :: Maybe UriPathRouteInput
uriPathRoute = forall a. Maybe a
Prelude.Nothing,
        $sel:applicationIdentifier:CreateRoute' :: Text
applicationIdentifier = Text
pApplicationIdentifier_,
        $sel:environmentIdentifier:CreateRoute' :: Text
environmentIdentifier = Text
pEnvironmentIdentifier_,
        $sel:routeType:CreateRoute' :: RouteType
routeType = RouteType
pRouteType_,
        $sel:serviceIdentifier:CreateRoute' :: Text
serviceIdentifier = Text
pServiceIdentifier_
      }

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

-- | Configuration for the default route type.
createRoute_defaultRoute :: Lens.Lens' CreateRoute (Prelude.Maybe DefaultRouteInput)
createRoute_defaultRoute :: Lens' CreateRoute (Maybe DefaultRouteInput)
createRoute_defaultRoute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe DefaultRouteInput
defaultRoute :: Maybe DefaultRouteInput
$sel:defaultRoute:CreateRoute' :: CreateRoute -> Maybe DefaultRouteInput
defaultRoute} -> Maybe DefaultRouteInput
defaultRoute) (\s :: CreateRoute
s@CreateRoute' {} Maybe DefaultRouteInput
a -> CreateRoute
s {$sel:defaultRoute:CreateRoute' :: Maybe DefaultRouteInput
defaultRoute = Maybe DefaultRouteInput
a} :: CreateRoute)

-- | The tags to assign to the route. A tag is a label that you assign to an
-- Amazon Web Services resource. Each tag consists of a key-value pair..
createRoute_tags :: Lens.Lens' CreateRoute (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRoute_tags :: Lens' CreateRoute (Maybe (HashMap Text Text))
createRoute_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe (Sensitive (HashMap Text Text))
tags :: Maybe (Sensitive (HashMap Text Text))
$sel:tags:CreateRoute' :: CreateRoute -> Maybe (Sensitive (HashMap Text Text))
tags} -> Maybe (Sensitive (HashMap Text Text))
tags) (\s :: CreateRoute
s@CreateRoute' {} Maybe (Sensitive (HashMap Text Text))
a -> CreateRoute
s {$sel:tags:CreateRoute' :: Maybe (Sensitive (HashMap Text Text))
tags = Maybe (Sensitive (HashMap Text Text))
a} :: CreateRoute) 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 a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The configuration for the URI path route type.
createRoute_uriPathRoute :: Lens.Lens' CreateRoute (Prelude.Maybe UriPathRouteInput)
createRoute_uriPathRoute :: Lens' CreateRoute (Maybe UriPathRouteInput)
createRoute_uriPathRoute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Maybe UriPathRouteInput
uriPathRoute :: Maybe UriPathRouteInput
$sel:uriPathRoute:CreateRoute' :: CreateRoute -> Maybe UriPathRouteInput
uriPathRoute} -> Maybe UriPathRouteInput
uriPathRoute) (\s :: CreateRoute
s@CreateRoute' {} Maybe UriPathRouteInput
a -> CreateRoute
s {$sel:uriPathRoute:CreateRoute' :: Maybe UriPathRouteInput
uriPathRoute = Maybe UriPathRouteInput
a} :: CreateRoute)

-- | The ID of the application within which the route is being created.
createRoute_applicationIdentifier :: Lens.Lens' CreateRoute Prelude.Text
createRoute_applicationIdentifier :: Lens' CreateRoute Text
createRoute_applicationIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Text
applicationIdentifier :: Text
$sel:applicationIdentifier:CreateRoute' :: CreateRoute -> Text
applicationIdentifier} -> Text
applicationIdentifier) (\s :: CreateRoute
s@CreateRoute' {} Text
a -> CreateRoute
s {$sel:applicationIdentifier:CreateRoute' :: Text
applicationIdentifier = Text
a} :: CreateRoute)

-- | The ID of the environment in which the route is created.
createRoute_environmentIdentifier :: Lens.Lens' CreateRoute Prelude.Text
createRoute_environmentIdentifier :: Lens' CreateRoute Text
createRoute_environmentIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Text
environmentIdentifier :: Text
$sel:environmentIdentifier:CreateRoute' :: CreateRoute -> Text
environmentIdentifier} -> Text
environmentIdentifier) (\s :: CreateRoute
s@CreateRoute' {} Text
a -> CreateRoute
s {$sel:environmentIdentifier:CreateRoute' :: Text
environmentIdentifier = Text
a} :: CreateRoute)

-- | The route type of the route. @DEFAULT@ indicates that all traffic that
-- does not match another route is forwarded to the default route.
-- Applications must have a default route before any other routes can be
-- created. @URI_PATH@ indicates a route that is based on a URI path.
createRoute_routeType :: Lens.Lens' CreateRoute RouteType
createRoute_routeType :: Lens' CreateRoute RouteType
createRoute_routeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {RouteType
routeType :: RouteType
$sel:routeType:CreateRoute' :: CreateRoute -> RouteType
routeType} -> RouteType
routeType) (\s :: CreateRoute
s@CreateRoute' {} RouteType
a -> CreateRoute
s {$sel:routeType:CreateRoute' :: RouteType
routeType = RouteType
a} :: CreateRoute)

-- | The ID of the service in which the route is created. Traffic that
-- matches this route is forwarded to this service.
createRoute_serviceIdentifier :: Lens.Lens' CreateRoute Prelude.Text
createRoute_serviceIdentifier :: Lens' CreateRoute Text
createRoute_serviceIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoute' {Text
serviceIdentifier :: Text
$sel:serviceIdentifier:CreateRoute' :: CreateRoute -> Text
serviceIdentifier} -> Text
serviceIdentifier) (\s :: CreateRoute
s@CreateRoute' {} Text
a -> CreateRoute
s {$sel:serviceIdentifier:CreateRoute' :: Text
serviceIdentifier = Text
a} :: CreateRoute)

instance Core.AWSRequest CreateRoute where
  type AWSResponse CreateRoute = CreateRouteResponse
  request :: (Service -> Service) -> CreateRoute -> Request CreateRoute
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateRoute
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRoute)))
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 ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe RouteType
-> Maybe Text
-> Maybe RouteState
-> Maybe (Sensitive (HashMap Text Text))
-> Maybe UriPathRouteInput
-> Int
-> CreateRouteResponse
CreateRouteResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ApplicationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreatedByAccountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"CreatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LastUpdatedTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"OwnerAccountId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RouteId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RouteType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ServiceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"State")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Tags" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"UriPathRoute")
            forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable CreateRoute where
  hashWithSalt :: Int -> CreateRoute -> Int
hashWithSalt Int
_salt CreateRoute' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe DefaultRouteInput
Maybe UriPathRouteInput
Text
RouteType
serviceIdentifier :: Text
routeType :: RouteType
environmentIdentifier :: Text
applicationIdentifier :: Text
uriPathRoute :: Maybe UriPathRouteInput
tags :: Maybe (Sensitive (HashMap Text Text))
defaultRoute :: Maybe DefaultRouteInput
clientToken :: Maybe Text
$sel:serviceIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:routeType:CreateRoute' :: CreateRoute -> RouteType
$sel:environmentIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:applicationIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:uriPathRoute:CreateRoute' :: CreateRoute -> Maybe UriPathRouteInput
$sel:tags:CreateRoute' :: CreateRoute -> Maybe (Sensitive (HashMap Text Text))
$sel:defaultRoute:CreateRoute' :: CreateRoute -> Maybe DefaultRouteInput
$sel:clientToken:CreateRoute' :: CreateRoute -> 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 DefaultRouteInput
defaultRoute
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (HashMap Text Text))
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe UriPathRouteInput
uriPathRoute
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
applicationIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
environmentIdentifier
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RouteType
routeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceIdentifier

instance Prelude.NFData CreateRoute where
  rnf :: CreateRoute -> ()
rnf CreateRoute' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe DefaultRouteInput
Maybe UriPathRouteInput
Text
RouteType
serviceIdentifier :: Text
routeType :: RouteType
environmentIdentifier :: Text
applicationIdentifier :: Text
uriPathRoute :: Maybe UriPathRouteInput
tags :: Maybe (Sensitive (HashMap Text Text))
defaultRoute :: Maybe DefaultRouteInput
clientToken :: Maybe Text
$sel:serviceIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:routeType:CreateRoute' :: CreateRoute -> RouteType
$sel:environmentIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:applicationIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:uriPathRoute:CreateRoute' :: CreateRoute -> Maybe UriPathRouteInput
$sel:tags:CreateRoute' :: CreateRoute -> Maybe (Sensitive (HashMap Text Text))
$sel:defaultRoute:CreateRoute' :: CreateRoute -> Maybe DefaultRouteInput
$sel:clientToken:CreateRoute' :: CreateRoute -> 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 DefaultRouteInput
defaultRoute
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (HashMap Text Text))
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UriPathRouteInput
uriPathRoute
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
applicationIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
environmentIdentifier
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RouteType
routeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceIdentifier

instance Data.ToHeaders CreateRoute where
  toHeaders :: CreateRoute -> 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 CreateRoute where
  toJSON :: CreateRoute -> Value
toJSON CreateRoute' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe DefaultRouteInput
Maybe UriPathRouteInput
Text
RouteType
serviceIdentifier :: Text
routeType :: RouteType
environmentIdentifier :: Text
applicationIdentifier :: Text
uriPathRoute :: Maybe UriPathRouteInput
tags :: Maybe (Sensitive (HashMap Text Text))
defaultRoute :: Maybe DefaultRouteInput
clientToken :: Maybe Text
$sel:serviceIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:routeType:CreateRoute' :: CreateRoute -> RouteType
$sel:environmentIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:applicationIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:uriPathRoute:CreateRoute' :: CreateRoute -> Maybe UriPathRouteInput
$sel:tags:CreateRoute' :: CreateRoute -> Maybe (Sensitive (HashMap Text Text))
$sel:defaultRoute:CreateRoute' :: CreateRoute -> Maybe DefaultRouteInput
$sel:clientToken:CreateRoute' :: CreateRoute -> 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
"DefaultRoute" 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 DefaultRouteInput
defaultRoute,
            (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 (Sensitive (HashMap Text Text))
tags,
            (Key
"UriPathRoute" 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 UriPathRouteInput
uriPathRoute,
            forall a. a -> Maybe a
Prelude.Just (Key
"RouteType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RouteType
routeType),
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ServiceIdentifier" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceIdentifier)
          ]
      )

instance Data.ToPath CreateRoute where
  toPath :: CreateRoute -> ByteString
toPath CreateRoute' {Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe DefaultRouteInput
Maybe UriPathRouteInput
Text
RouteType
serviceIdentifier :: Text
routeType :: RouteType
environmentIdentifier :: Text
applicationIdentifier :: Text
uriPathRoute :: Maybe UriPathRouteInput
tags :: Maybe (Sensitive (HashMap Text Text))
defaultRoute :: Maybe DefaultRouteInput
clientToken :: Maybe Text
$sel:serviceIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:routeType:CreateRoute' :: CreateRoute -> RouteType
$sel:environmentIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:applicationIdentifier:CreateRoute' :: CreateRoute -> Text
$sel:uriPathRoute:CreateRoute' :: CreateRoute -> Maybe UriPathRouteInput
$sel:tags:CreateRoute' :: CreateRoute -> Maybe (Sensitive (HashMap Text Text))
$sel:defaultRoute:CreateRoute' :: CreateRoute -> Maybe DefaultRouteInput
$sel:clientToken:CreateRoute' :: CreateRoute -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/environments/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
environmentIdentifier,
        ByteString
"/applications/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
applicationIdentifier,
        ByteString
"/routes"
      ]

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

-- | /See:/ 'newCreateRouteResponse' smart constructor.
data CreateRouteResponse = CreateRouteResponse'
  { -- | The ID of the application in which the route is created.
    CreateRouteResponse -> Maybe Text
applicationId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the route. The format for this ARN is
    -- @arn:aws:refactor-spaces:@/@region@/@:@/@account-id@/@:@/@resource-type\/resource-id@/@ @.
    -- For more information about ARNs, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /Amazon Web Services General Reference/.
    CreateRouteResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services account ID of the route creator.
    CreateRouteResponse -> Maybe Text
createdByAccountId :: Prelude.Maybe Prelude.Text,
    -- | A timestamp that indicates when the route is created.
    CreateRouteResponse -> Maybe POSIX
createdTime :: Prelude.Maybe Data.POSIX,
    -- | A timestamp that indicates when the route was last updated.
    CreateRouteResponse -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Web Services account ID of the route owner.
    CreateRouteResponse -> Maybe Text
ownerAccountId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the route.
    CreateRouteResponse -> Maybe Text
routeId :: Prelude.Maybe Prelude.Text,
    -- | The route type of the route.
    CreateRouteResponse -> Maybe RouteType
routeType :: Prelude.Maybe RouteType,
    -- | The ID of service in which the route is created. Traffic that matches
    -- this route is forwarded to this service.
    CreateRouteResponse -> Maybe Text
serviceId :: Prelude.Maybe Prelude.Text,
    -- | The current state of the route. Activation state only allows @ACTIVE@ or
    -- @INACTIVE@ as user inputs. @FAILED@ is a route state that is system
    -- generated.
    CreateRouteResponse -> Maybe RouteState
state :: Prelude.Maybe RouteState,
    -- | The tags assigned to the created route. A tag is a label that you assign
    -- to an Amazon Web Services resource. Each tag consists of a key-value
    -- pair.
    CreateRouteResponse -> Maybe (Sensitive (HashMap Text Text))
tags :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text Prelude.Text)),
    -- | Configuration for the URI path route type.
    CreateRouteResponse -> Maybe UriPathRouteInput
uriPathRoute :: Prelude.Maybe UriPathRouteInput,
    -- | The response's http status code.
    CreateRouteResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateRouteResponse -> CreateRouteResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRouteResponse -> CreateRouteResponse -> Bool
$c/= :: CreateRouteResponse -> CreateRouteResponse -> Bool
== :: CreateRouteResponse -> CreateRouteResponse -> Bool
$c== :: CreateRouteResponse -> CreateRouteResponse -> Bool
Prelude.Eq, Int -> CreateRouteResponse -> ShowS
[CreateRouteResponse] -> ShowS
CreateRouteResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRouteResponse] -> ShowS
$cshowList :: [CreateRouteResponse] -> ShowS
show :: CreateRouteResponse -> String
$cshow :: CreateRouteResponse -> String
showsPrec :: Int -> CreateRouteResponse -> ShowS
$cshowsPrec :: Int -> CreateRouteResponse -> ShowS
Prelude.Show, forall x. Rep CreateRouteResponse x -> CreateRouteResponse
forall x. CreateRouteResponse -> Rep CreateRouteResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRouteResponse x -> CreateRouteResponse
$cfrom :: forall x. CreateRouteResponse -> Rep CreateRouteResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateRouteResponse' 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:
--
-- 'applicationId', 'createRouteResponse_applicationId' - The ID of the application in which the route is created.
--
-- 'arn', 'createRouteResponse_arn' - The Amazon Resource Name (ARN) of the route. The format for this ARN is
-- @arn:aws:refactor-spaces:@/@region@/@:@/@account-id@/@:@/@resource-type\/resource-id@/@ @.
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
--
-- 'createdByAccountId', 'createRouteResponse_createdByAccountId' - The Amazon Web Services account ID of the route creator.
--
-- 'createdTime', 'createRouteResponse_createdTime' - A timestamp that indicates when the route is created.
--
-- 'lastUpdatedTime', 'createRouteResponse_lastUpdatedTime' - A timestamp that indicates when the route was last updated.
--
-- 'ownerAccountId', 'createRouteResponse_ownerAccountId' - The Amazon Web Services account ID of the route owner.
--
-- 'routeId', 'createRouteResponse_routeId' - The unique identifier of the route.
--
-- 'routeType', 'createRouteResponse_routeType' - The route type of the route.
--
-- 'serviceId', 'createRouteResponse_serviceId' - The ID of service in which the route is created. Traffic that matches
-- this route is forwarded to this service.
--
-- 'state', 'createRouteResponse_state' - The current state of the route. Activation state only allows @ACTIVE@ or
-- @INACTIVE@ as user inputs. @FAILED@ is a route state that is system
-- generated.
--
-- 'tags', 'createRouteResponse_tags' - The tags assigned to the created route. A tag is a label that you assign
-- to an Amazon Web Services resource. Each tag consists of a key-value
-- pair.
--
-- 'uriPathRoute', 'createRouteResponse_uriPathRoute' - Configuration for the URI path route type.
--
-- 'httpStatus', 'createRouteResponse_httpStatus' - The response's http status code.
newCreateRouteResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRouteResponse
newCreateRouteResponse :: Int -> CreateRouteResponse
newCreateRouteResponse Int
pHttpStatus_ =
  CreateRouteResponse'
    { $sel:applicationId:CreateRouteResponse' :: Maybe Text
applicationId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:arn:CreateRouteResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:createdByAccountId:CreateRouteResponse' :: Maybe Text
createdByAccountId = forall a. Maybe a
Prelude.Nothing,
      $sel:createdTime:CreateRouteResponse' :: Maybe POSIX
createdTime = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:CreateRouteResponse' :: Maybe POSIX
lastUpdatedTime = forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccountId:CreateRouteResponse' :: Maybe Text
ownerAccountId = forall a. Maybe a
Prelude.Nothing,
      $sel:routeId:CreateRouteResponse' :: Maybe Text
routeId = forall a. Maybe a
Prelude.Nothing,
      $sel:routeType:CreateRouteResponse' :: Maybe RouteType
routeType = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceId:CreateRouteResponse' :: Maybe Text
serviceId = forall a. Maybe a
Prelude.Nothing,
      $sel:state:CreateRouteResponse' :: Maybe RouteState
state = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateRouteResponse' :: Maybe (Sensitive (HashMap Text Text))
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:uriPathRoute:CreateRouteResponse' :: Maybe UriPathRouteInput
uriPathRoute = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateRouteResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The ID of the application in which the route is created.
createRouteResponse_applicationId :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.Text)
createRouteResponse_applicationId :: Lens' CreateRouteResponse (Maybe Text)
createRouteResponse_applicationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe Text
applicationId :: Maybe Text
$sel:applicationId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
applicationId} -> Maybe Text
applicationId) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe Text
a -> CreateRouteResponse
s {$sel:applicationId:CreateRouteResponse' :: Maybe Text
applicationId = Maybe Text
a} :: CreateRouteResponse)

-- | The Amazon Resource Name (ARN) of the route. The format for this ARN is
-- @arn:aws:refactor-spaces:@/@region@/@:@/@account-id@/@:@/@resource-type\/resource-id@/@ @.
-- For more information about ARNs, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
createRouteResponse_arn :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.Text)
createRouteResponse_arn :: Lens' CreateRouteResponse (Maybe Text)
createRouteResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe Text
a -> CreateRouteResponse
s {$sel:arn:CreateRouteResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateRouteResponse)

-- | The Amazon Web Services account ID of the route creator.
createRouteResponse_createdByAccountId :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.Text)
createRouteResponse_createdByAccountId :: Lens' CreateRouteResponse (Maybe Text)
createRouteResponse_createdByAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe Text
createdByAccountId :: Maybe Text
$sel:createdByAccountId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
createdByAccountId} -> Maybe Text
createdByAccountId) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe Text
a -> CreateRouteResponse
s {$sel:createdByAccountId:CreateRouteResponse' :: Maybe Text
createdByAccountId = Maybe Text
a} :: CreateRouteResponse)

-- | A timestamp that indicates when the route is created.
createRouteResponse_createdTime :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.UTCTime)
createRouteResponse_createdTime :: Lens' CreateRouteResponse (Maybe UTCTime)
createRouteResponse_createdTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:CreateRouteResponse' :: CreateRouteResponse -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe POSIX
a -> CreateRouteResponse
s {$sel:createdTime:CreateRouteResponse' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: CreateRouteResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A timestamp that indicates when the route was last updated.
createRouteResponse_lastUpdatedTime :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.UTCTime)
createRouteResponse_lastUpdatedTime :: Lens' CreateRouteResponse (Maybe UTCTime)
createRouteResponse_lastUpdatedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:CreateRouteResponse' :: CreateRouteResponse -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe POSIX
a -> CreateRouteResponse
s {$sel:lastUpdatedTime:CreateRouteResponse' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: CreateRouteResponse) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Web Services account ID of the route owner.
createRouteResponse_ownerAccountId :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.Text)
createRouteResponse_ownerAccountId :: Lens' CreateRouteResponse (Maybe Text)
createRouteResponse_ownerAccountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe Text
ownerAccountId :: Maybe Text
$sel:ownerAccountId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
ownerAccountId} -> Maybe Text
ownerAccountId) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe Text
a -> CreateRouteResponse
s {$sel:ownerAccountId:CreateRouteResponse' :: Maybe Text
ownerAccountId = Maybe Text
a} :: CreateRouteResponse)

-- | The unique identifier of the route.
createRouteResponse_routeId :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.Text)
createRouteResponse_routeId :: Lens' CreateRouteResponse (Maybe Text)
createRouteResponse_routeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe Text
routeId :: Maybe Text
$sel:routeId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
routeId} -> Maybe Text
routeId) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe Text
a -> CreateRouteResponse
s {$sel:routeId:CreateRouteResponse' :: Maybe Text
routeId = Maybe Text
a} :: CreateRouteResponse)

-- | The route type of the route.
createRouteResponse_routeType :: Lens.Lens' CreateRouteResponse (Prelude.Maybe RouteType)
createRouteResponse_routeType :: Lens' CreateRouteResponse (Maybe RouteType)
createRouteResponse_routeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe RouteType
routeType :: Maybe RouteType
$sel:routeType:CreateRouteResponse' :: CreateRouteResponse -> Maybe RouteType
routeType} -> Maybe RouteType
routeType) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe RouteType
a -> CreateRouteResponse
s {$sel:routeType:CreateRouteResponse' :: Maybe RouteType
routeType = Maybe RouteType
a} :: CreateRouteResponse)

-- | The ID of service in which the route is created. Traffic that matches
-- this route is forwarded to this service.
createRouteResponse_serviceId :: Lens.Lens' CreateRouteResponse (Prelude.Maybe Prelude.Text)
createRouteResponse_serviceId :: Lens' CreateRouteResponse (Maybe Text)
createRouteResponse_serviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe Text
serviceId :: Maybe Text
$sel:serviceId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
serviceId} -> Maybe Text
serviceId) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe Text
a -> CreateRouteResponse
s {$sel:serviceId:CreateRouteResponse' :: Maybe Text
serviceId = Maybe Text
a} :: CreateRouteResponse)

-- | The current state of the route. Activation state only allows @ACTIVE@ or
-- @INACTIVE@ as user inputs. @FAILED@ is a route state that is system
-- generated.
createRouteResponse_state :: Lens.Lens' CreateRouteResponse (Prelude.Maybe RouteState)
createRouteResponse_state :: Lens' CreateRouteResponse (Maybe RouteState)
createRouteResponse_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe RouteState
state :: Maybe RouteState
$sel:state:CreateRouteResponse' :: CreateRouteResponse -> Maybe RouteState
state} -> Maybe RouteState
state) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe RouteState
a -> CreateRouteResponse
s {$sel:state:CreateRouteResponse' :: Maybe RouteState
state = Maybe RouteState
a} :: CreateRouteResponse)

-- | The tags assigned to the created route. A tag is a label that you assign
-- to an Amazon Web Services resource. Each tag consists of a key-value
-- pair.
createRouteResponse_tags :: Lens.Lens' CreateRouteResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRouteResponse_tags :: Lens' CreateRouteResponse (Maybe (HashMap Text Text))
createRouteResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe (Sensitive (HashMap Text Text))
tags :: Maybe (Sensitive (HashMap Text Text))
$sel:tags:CreateRouteResponse' :: CreateRouteResponse -> Maybe (Sensitive (HashMap Text Text))
tags} -> Maybe (Sensitive (HashMap Text Text))
tags) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe (Sensitive (HashMap Text Text))
a -> CreateRouteResponse
s {$sel:tags:CreateRouteResponse' :: Maybe (Sensitive (HashMap Text Text))
tags = Maybe (Sensitive (HashMap Text Text))
a} :: CreateRouteResponse) 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 a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | Configuration for the URI path route type.
createRouteResponse_uriPathRoute :: Lens.Lens' CreateRouteResponse (Prelude.Maybe UriPathRouteInput)
createRouteResponse_uriPathRoute :: Lens' CreateRouteResponse (Maybe UriPathRouteInput)
createRouteResponse_uriPathRoute = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRouteResponse' {Maybe UriPathRouteInput
uriPathRoute :: Maybe UriPathRouteInput
$sel:uriPathRoute:CreateRouteResponse' :: CreateRouteResponse -> Maybe UriPathRouteInput
uriPathRoute} -> Maybe UriPathRouteInput
uriPathRoute) (\s :: CreateRouteResponse
s@CreateRouteResponse' {} Maybe UriPathRouteInput
a -> CreateRouteResponse
s {$sel:uriPathRoute:CreateRouteResponse' :: Maybe UriPathRouteInput
uriPathRoute = Maybe UriPathRouteInput
a} :: CreateRouteResponse)

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

instance Prelude.NFData CreateRouteResponse where
  rnf :: CreateRouteResponse -> ()
rnf CreateRouteResponse' {Int
Maybe Text
Maybe (Sensitive (HashMap Text Text))
Maybe POSIX
Maybe RouteState
Maybe RouteType
Maybe UriPathRouteInput
httpStatus :: Int
uriPathRoute :: Maybe UriPathRouteInput
tags :: Maybe (Sensitive (HashMap Text Text))
state :: Maybe RouteState
serviceId :: Maybe Text
routeType :: Maybe RouteType
routeId :: Maybe Text
ownerAccountId :: Maybe Text
lastUpdatedTime :: Maybe POSIX
createdTime :: Maybe POSIX
createdByAccountId :: Maybe Text
arn :: Maybe Text
applicationId :: Maybe Text
$sel:httpStatus:CreateRouteResponse' :: CreateRouteResponse -> Int
$sel:uriPathRoute:CreateRouteResponse' :: CreateRouteResponse -> Maybe UriPathRouteInput
$sel:tags:CreateRouteResponse' :: CreateRouteResponse -> Maybe (Sensitive (HashMap Text Text))
$sel:state:CreateRouteResponse' :: CreateRouteResponse -> Maybe RouteState
$sel:serviceId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
$sel:routeType:CreateRouteResponse' :: CreateRouteResponse -> Maybe RouteType
$sel:routeId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
$sel:ownerAccountId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
$sel:lastUpdatedTime:CreateRouteResponse' :: CreateRouteResponse -> Maybe POSIX
$sel:createdTime:CreateRouteResponse' :: CreateRouteResponse -> Maybe POSIX
$sel:createdByAccountId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
$sel:arn:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
$sel:applicationId:CreateRouteResponse' :: CreateRouteResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
applicationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
createdByAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastUpdatedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAccountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
routeId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RouteType
routeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RouteState
state
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (HashMap Text Text))
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe UriPathRouteInput
uriPathRoute
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus