{-# 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.AppRunner.DescribeCustomDomains
-- 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)
--
-- Return a description of custom domain names that are associated with an
-- App Runner service.
module Amazonka.AppRunner.DescribeCustomDomains
  ( -- * Creating a Request
    DescribeCustomDomains (..),
    newDescribeCustomDomains,

    -- * Request Lenses
    describeCustomDomains_nextToken,
    describeCustomDomains_maxResults,
    describeCustomDomains_serviceArn,

    -- * Destructuring the Response
    DescribeCustomDomainsResponse (..),
    newDescribeCustomDomainsResponse,

    -- * Response Lenses
    describeCustomDomainsResponse_nextToken,
    describeCustomDomainsResponse_httpStatus,
    describeCustomDomainsResponse_dNSTarget,
    describeCustomDomainsResponse_serviceArn,
    describeCustomDomainsResponse_customDomains,
  )
where

import Amazonka.AppRunner.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:/ 'newDescribeCustomDomains' smart constructor.
data DescribeCustomDomains = DescribeCustomDomains'
  { -- | A token from a previous result page. It\'s used for a paginated request.
    -- The request retrieves the next result page. All other parameter values
    -- must be identical to the ones that are specified in the initial request.
    --
    -- If you don\'t specify @NextToken@, the request retrieves the first
    -- result page.
    DescribeCustomDomains -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results that each response (result page) can
    -- include. It\'s used for a paginated request.
    --
    -- If you don\'t specify @MaxResults@, the request retrieves all available
    -- results in a single response.
    DescribeCustomDomains -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the App Runner service that you want
    -- associated custom domain names to be described for.
    DescribeCustomDomains -> Text
serviceArn :: Prelude.Text
  }
  deriving (DescribeCustomDomains -> DescribeCustomDomains -> Bool
(DescribeCustomDomains -> DescribeCustomDomains -> Bool)
-> (DescribeCustomDomains -> DescribeCustomDomains -> Bool)
-> Eq DescribeCustomDomains
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomDomains -> DescribeCustomDomains -> Bool
$c/= :: DescribeCustomDomains -> DescribeCustomDomains -> Bool
== :: DescribeCustomDomains -> DescribeCustomDomains -> Bool
$c== :: DescribeCustomDomains -> DescribeCustomDomains -> Bool
Prelude.Eq, ReadPrec [DescribeCustomDomains]
ReadPrec DescribeCustomDomains
Int -> ReadS DescribeCustomDomains
ReadS [DescribeCustomDomains]
(Int -> ReadS DescribeCustomDomains)
-> ReadS [DescribeCustomDomains]
-> ReadPrec DescribeCustomDomains
-> ReadPrec [DescribeCustomDomains]
-> Read DescribeCustomDomains
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomDomains]
$creadListPrec :: ReadPrec [DescribeCustomDomains]
readPrec :: ReadPrec DescribeCustomDomains
$creadPrec :: ReadPrec DescribeCustomDomains
readList :: ReadS [DescribeCustomDomains]
$creadList :: ReadS [DescribeCustomDomains]
readsPrec :: Int -> ReadS DescribeCustomDomains
$creadsPrec :: Int -> ReadS DescribeCustomDomains
Prelude.Read, Int -> DescribeCustomDomains -> ShowS
[DescribeCustomDomains] -> ShowS
DescribeCustomDomains -> String
(Int -> DescribeCustomDomains -> ShowS)
-> (DescribeCustomDomains -> String)
-> ([DescribeCustomDomains] -> ShowS)
-> Show DescribeCustomDomains
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomDomains] -> ShowS
$cshowList :: [DescribeCustomDomains] -> ShowS
show :: DescribeCustomDomains -> String
$cshow :: DescribeCustomDomains -> String
showsPrec :: Int -> DescribeCustomDomains -> ShowS
$cshowsPrec :: Int -> DescribeCustomDomains -> ShowS
Prelude.Show, (forall x. DescribeCustomDomains -> Rep DescribeCustomDomains x)
-> (forall x. Rep DescribeCustomDomains x -> DescribeCustomDomains)
-> Generic DescribeCustomDomains
forall x. Rep DescribeCustomDomains x -> DescribeCustomDomains
forall x. DescribeCustomDomains -> Rep DescribeCustomDomains x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeCustomDomains x -> DescribeCustomDomains
$cfrom :: forall x. DescribeCustomDomains -> Rep DescribeCustomDomains x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCustomDomains' 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:
--
-- 'nextToken', 'describeCustomDomains_nextToken' - A token from a previous result page. It\'s used for a paginated request.
-- The request retrieves the next result page. All other parameter values
-- must be identical to the ones that are specified in the initial request.
--
-- If you don\'t specify @NextToken@, the request retrieves the first
-- result page.
--
-- 'maxResults', 'describeCustomDomains_maxResults' - The maximum number of results that each response (result page) can
-- include. It\'s used for a paginated request.
--
-- If you don\'t specify @MaxResults@, the request retrieves all available
-- results in a single response.
--
-- 'serviceArn', 'describeCustomDomains_serviceArn' - The Amazon Resource Name (ARN) of the App Runner service that you want
-- associated custom domain names to be described for.
newDescribeCustomDomains ::
  -- | 'serviceArn'
  Prelude.Text ->
  DescribeCustomDomains
newDescribeCustomDomains :: Text -> DescribeCustomDomains
newDescribeCustomDomains Text
pServiceArn_ =
  DescribeCustomDomains' :: Maybe Text -> Maybe Natural -> Text -> DescribeCustomDomains
DescribeCustomDomains'
    { $sel:nextToken:DescribeCustomDomains' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeCustomDomains' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceArn:DescribeCustomDomains' :: Text
serviceArn = Text
pServiceArn_
    }

-- | A token from a previous result page. It\'s used for a paginated request.
-- The request retrieves the next result page. All other parameter values
-- must be identical to the ones that are specified in the initial request.
--
-- If you don\'t specify @NextToken@, the request retrieves the first
-- result page.
describeCustomDomains_nextToken :: Lens.Lens' DescribeCustomDomains (Prelude.Maybe Prelude.Text)
describeCustomDomains_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeCustomDomains -> f DescribeCustomDomains
describeCustomDomains_nextToken = (DescribeCustomDomains -> Maybe Text)
-> (DescribeCustomDomains -> Maybe Text -> DescribeCustomDomains)
-> Lens
     DescribeCustomDomains
     DescribeCustomDomains
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomDomains' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeCustomDomains' :: DescribeCustomDomains -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeCustomDomains
s@DescribeCustomDomains' {} Maybe Text
a -> DescribeCustomDomains
s {$sel:nextToken:DescribeCustomDomains' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeCustomDomains)

-- | The maximum number of results that each response (result page) can
-- include. It\'s used for a paginated request.
--
-- If you don\'t specify @MaxResults@, the request retrieves all available
-- results in a single response.
describeCustomDomains_maxResults :: Lens.Lens' DescribeCustomDomains (Prelude.Maybe Prelude.Natural)
describeCustomDomains_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeCustomDomains -> f DescribeCustomDomains
describeCustomDomains_maxResults = (DescribeCustomDomains -> Maybe Natural)
-> (DescribeCustomDomains
    -> Maybe Natural -> DescribeCustomDomains)
-> Lens
     DescribeCustomDomains
     DescribeCustomDomains
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomDomains' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeCustomDomains' :: DescribeCustomDomains -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeCustomDomains
s@DescribeCustomDomains' {} Maybe Natural
a -> DescribeCustomDomains
s {$sel:maxResults:DescribeCustomDomains' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeCustomDomains)

-- | The Amazon Resource Name (ARN) of the App Runner service that you want
-- associated custom domain names to be described for.
describeCustomDomains_serviceArn :: Lens.Lens' DescribeCustomDomains Prelude.Text
describeCustomDomains_serviceArn :: (Text -> f Text)
-> DescribeCustomDomains -> f DescribeCustomDomains
describeCustomDomains_serviceArn = (DescribeCustomDomains -> Text)
-> (DescribeCustomDomains -> Text -> DescribeCustomDomains)
-> Lens DescribeCustomDomains DescribeCustomDomains Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomDomains' {Text
serviceArn :: Text
$sel:serviceArn:DescribeCustomDomains' :: DescribeCustomDomains -> Text
serviceArn} -> Text
serviceArn) (\s :: DescribeCustomDomains
s@DescribeCustomDomains' {} Text
a -> DescribeCustomDomains
s {$sel:serviceArn:DescribeCustomDomains' :: Text
serviceArn = Text
a} :: DescribeCustomDomains)

instance Core.AWSRequest DescribeCustomDomains where
  type
    AWSResponse DescribeCustomDomains =
      DescribeCustomDomainsResponse
  request :: DescribeCustomDomains -> Request DescribeCustomDomains
request = Service -> DescribeCustomDomains -> Request DescribeCustomDomains
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeCustomDomains
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCustomDomains)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeCustomDomains))
-> Logger
-> Service
-> Proxy DescribeCustomDomains
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeCustomDomains)))
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
-> Int
-> Text
-> Text
-> [CustomDomain]
-> DescribeCustomDomainsResponse
DescribeCustomDomainsResponse'
            (Maybe Text
 -> Int
 -> Text
 -> Text
 -> [CustomDomain]
 -> DescribeCustomDomainsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> Text -> Text -> [CustomDomain] -> DescribeCustomDomainsResponse)
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
"NextToken")
            Either
  String
  (Int
   -> Text -> Text -> [CustomDomain] -> DescribeCustomDomainsResponse)
-> Either String Int
-> Either
     String
     (Text -> Text -> [CustomDomain] -> DescribeCustomDomainsResponse)
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))
            Either
  String
  (Text -> Text -> [CustomDomain] -> DescribeCustomDomainsResponse)
-> Either String Text
-> Either
     String (Text -> [CustomDomain] -> DescribeCustomDomainsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DNSTarget")
            Either
  String (Text -> [CustomDomain] -> DescribeCustomDomainsResponse)
-> Either String Text
-> Either String ([CustomDomain] -> DescribeCustomDomainsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"ServiceArn")
            Either String ([CustomDomain] -> DescribeCustomDomainsResponse)
-> Either String [CustomDomain]
-> Either String DescribeCustomDomainsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [CustomDomain])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CustomDomains" Either String (Maybe [CustomDomain])
-> [CustomDomain] -> Either String [CustomDomain]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [CustomDomain]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable DescribeCustomDomains

instance Prelude.NFData DescribeCustomDomains

instance Core.ToHeaders DescribeCustomDomains where
  toHeaders :: DescribeCustomDomains -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeCustomDomains -> 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
"AppRunner.DescribeCustomDomains" ::
                          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 DescribeCustomDomains where
  toJSON :: DescribeCustomDomains -> Value
toJSON DescribeCustomDomains' {Maybe Natural
Maybe Text
Text
serviceArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:serviceArn:DescribeCustomDomains' :: DescribeCustomDomains -> Text
$sel:maxResults:DescribeCustomDomains' :: DescribeCustomDomains -> Maybe Natural
$sel:nextToken:DescribeCustomDomains' :: DescribeCustomDomains -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServiceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serviceArn)
          ]
      )

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

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

-- | /See:/ 'newDescribeCustomDomainsResponse' smart constructor.
data DescribeCustomDomainsResponse = DescribeCustomDomainsResponse'
  { -- | The token that you can pass in a subsequent request to get the next
    -- result page. It\'s returned in a paginated request.
    DescribeCustomDomainsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeCustomDomainsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The App Runner subdomain of the App Runner service. The associated
    -- custom domain names are mapped to this target name.
    DescribeCustomDomainsResponse -> Text
dNSTarget :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the App Runner service whose
    -- associated custom domain names you want to describe.
    DescribeCustomDomainsResponse -> Text
serviceArn :: Prelude.Text,
    -- | A list of descriptions of custom domain names that are associated with
    -- the service. In a paginated request, the request returns up to
    -- @MaxResults@ records per call.
    DescribeCustomDomainsResponse -> [CustomDomain]
customDomains :: [CustomDomain]
  }
  deriving (DescribeCustomDomainsResponse
-> DescribeCustomDomainsResponse -> Bool
(DescribeCustomDomainsResponse
 -> DescribeCustomDomainsResponse -> Bool)
-> (DescribeCustomDomainsResponse
    -> DescribeCustomDomainsResponse -> Bool)
-> Eq DescribeCustomDomainsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomDomainsResponse
-> DescribeCustomDomainsResponse -> Bool
$c/= :: DescribeCustomDomainsResponse
-> DescribeCustomDomainsResponse -> Bool
== :: DescribeCustomDomainsResponse
-> DescribeCustomDomainsResponse -> Bool
$c== :: DescribeCustomDomainsResponse
-> DescribeCustomDomainsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCustomDomainsResponse]
ReadPrec DescribeCustomDomainsResponse
Int -> ReadS DescribeCustomDomainsResponse
ReadS [DescribeCustomDomainsResponse]
(Int -> ReadS DescribeCustomDomainsResponse)
-> ReadS [DescribeCustomDomainsResponse]
-> ReadPrec DescribeCustomDomainsResponse
-> ReadPrec [DescribeCustomDomainsResponse]
-> Read DescribeCustomDomainsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomDomainsResponse]
$creadListPrec :: ReadPrec [DescribeCustomDomainsResponse]
readPrec :: ReadPrec DescribeCustomDomainsResponse
$creadPrec :: ReadPrec DescribeCustomDomainsResponse
readList :: ReadS [DescribeCustomDomainsResponse]
$creadList :: ReadS [DescribeCustomDomainsResponse]
readsPrec :: Int -> ReadS DescribeCustomDomainsResponse
$creadsPrec :: Int -> ReadS DescribeCustomDomainsResponse
Prelude.Read, Int -> DescribeCustomDomainsResponse -> ShowS
[DescribeCustomDomainsResponse] -> ShowS
DescribeCustomDomainsResponse -> String
(Int -> DescribeCustomDomainsResponse -> ShowS)
-> (DescribeCustomDomainsResponse -> String)
-> ([DescribeCustomDomainsResponse] -> ShowS)
-> Show DescribeCustomDomainsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomDomainsResponse] -> ShowS
$cshowList :: [DescribeCustomDomainsResponse] -> ShowS
show :: DescribeCustomDomainsResponse -> String
$cshow :: DescribeCustomDomainsResponse -> String
showsPrec :: Int -> DescribeCustomDomainsResponse -> ShowS
$cshowsPrec :: Int -> DescribeCustomDomainsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeCustomDomainsResponse
 -> Rep DescribeCustomDomainsResponse x)
-> (forall x.
    Rep DescribeCustomDomainsResponse x
    -> DescribeCustomDomainsResponse)
-> Generic DescribeCustomDomainsResponse
forall x.
Rep DescribeCustomDomainsResponse x
-> DescribeCustomDomainsResponse
forall x.
DescribeCustomDomainsResponse
-> Rep DescribeCustomDomainsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCustomDomainsResponse x
-> DescribeCustomDomainsResponse
$cfrom :: forall x.
DescribeCustomDomainsResponse
-> Rep DescribeCustomDomainsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCustomDomainsResponse' 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:
--
-- 'nextToken', 'describeCustomDomainsResponse_nextToken' - The token that you can pass in a subsequent request to get the next
-- result page. It\'s returned in a paginated request.
--
-- 'httpStatus', 'describeCustomDomainsResponse_httpStatus' - The response's http status code.
--
-- 'dNSTarget', 'describeCustomDomainsResponse_dNSTarget' - The App Runner subdomain of the App Runner service. The associated
-- custom domain names are mapped to this target name.
--
-- 'serviceArn', 'describeCustomDomainsResponse_serviceArn' - The Amazon Resource Name (ARN) of the App Runner service whose
-- associated custom domain names you want to describe.
--
-- 'customDomains', 'describeCustomDomainsResponse_customDomains' - A list of descriptions of custom domain names that are associated with
-- the service. In a paginated request, the request returns up to
-- @MaxResults@ records per call.
newDescribeCustomDomainsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'dNSTarget'
  Prelude.Text ->
  -- | 'serviceArn'
  Prelude.Text ->
  DescribeCustomDomainsResponse
newDescribeCustomDomainsResponse :: Int -> Text -> Text -> DescribeCustomDomainsResponse
newDescribeCustomDomainsResponse
  Int
pHttpStatus_
  Text
pDNSTarget_
  Text
pServiceArn_ =
    DescribeCustomDomainsResponse' :: Maybe Text
-> Int
-> Text
-> Text
-> [CustomDomain]
-> DescribeCustomDomainsResponse
DescribeCustomDomainsResponse'
      { $sel:nextToken:DescribeCustomDomainsResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeCustomDomainsResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:dNSTarget:DescribeCustomDomainsResponse' :: Text
dNSTarget = Text
pDNSTarget_,
        $sel:serviceArn:DescribeCustomDomainsResponse' :: Text
serviceArn = Text
pServiceArn_,
        $sel:customDomains:DescribeCustomDomainsResponse' :: [CustomDomain]
customDomains = [CustomDomain]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The token that you can pass in a subsequent request to get the next
-- result page. It\'s returned in a paginated request.
describeCustomDomainsResponse_nextToken :: Lens.Lens' DescribeCustomDomainsResponse (Prelude.Maybe Prelude.Text)
describeCustomDomainsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeCustomDomainsResponse -> f DescribeCustomDomainsResponse
describeCustomDomainsResponse_nextToken = (DescribeCustomDomainsResponse -> Maybe Text)
-> (DescribeCustomDomainsResponse
    -> Maybe Text -> DescribeCustomDomainsResponse)
-> Lens
     DescribeCustomDomainsResponse
     DescribeCustomDomainsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomDomainsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeCustomDomainsResponse' :: DescribeCustomDomainsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeCustomDomainsResponse
s@DescribeCustomDomainsResponse' {} Maybe Text
a -> DescribeCustomDomainsResponse
s {$sel:nextToken:DescribeCustomDomainsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeCustomDomainsResponse)

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

-- | The App Runner subdomain of the App Runner service. The associated
-- custom domain names are mapped to this target name.
describeCustomDomainsResponse_dNSTarget :: Lens.Lens' DescribeCustomDomainsResponse Prelude.Text
describeCustomDomainsResponse_dNSTarget :: (Text -> f Text)
-> DescribeCustomDomainsResponse -> f DescribeCustomDomainsResponse
describeCustomDomainsResponse_dNSTarget = (DescribeCustomDomainsResponse -> Text)
-> (DescribeCustomDomainsResponse
    -> Text -> DescribeCustomDomainsResponse)
-> Lens
     DescribeCustomDomainsResponse
     DescribeCustomDomainsResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomDomainsResponse' {Text
dNSTarget :: Text
$sel:dNSTarget:DescribeCustomDomainsResponse' :: DescribeCustomDomainsResponse -> Text
dNSTarget} -> Text
dNSTarget) (\s :: DescribeCustomDomainsResponse
s@DescribeCustomDomainsResponse' {} Text
a -> DescribeCustomDomainsResponse
s {$sel:dNSTarget:DescribeCustomDomainsResponse' :: Text
dNSTarget = Text
a} :: DescribeCustomDomainsResponse)

-- | The Amazon Resource Name (ARN) of the App Runner service whose
-- associated custom domain names you want to describe.
describeCustomDomainsResponse_serviceArn :: Lens.Lens' DescribeCustomDomainsResponse Prelude.Text
describeCustomDomainsResponse_serviceArn :: (Text -> f Text)
-> DescribeCustomDomainsResponse -> f DescribeCustomDomainsResponse
describeCustomDomainsResponse_serviceArn = (DescribeCustomDomainsResponse -> Text)
-> (DescribeCustomDomainsResponse
    -> Text -> DescribeCustomDomainsResponse)
-> Lens
     DescribeCustomDomainsResponse
     DescribeCustomDomainsResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomDomainsResponse' {Text
serviceArn :: Text
$sel:serviceArn:DescribeCustomDomainsResponse' :: DescribeCustomDomainsResponse -> Text
serviceArn} -> Text
serviceArn) (\s :: DescribeCustomDomainsResponse
s@DescribeCustomDomainsResponse' {} Text
a -> DescribeCustomDomainsResponse
s {$sel:serviceArn:DescribeCustomDomainsResponse' :: Text
serviceArn = Text
a} :: DescribeCustomDomainsResponse)

-- | A list of descriptions of custom domain names that are associated with
-- the service. In a paginated request, the request returns up to
-- @MaxResults@ records per call.
describeCustomDomainsResponse_customDomains :: Lens.Lens' DescribeCustomDomainsResponse [CustomDomain]
describeCustomDomainsResponse_customDomains :: ([CustomDomain] -> f [CustomDomain])
-> DescribeCustomDomainsResponse -> f DescribeCustomDomainsResponse
describeCustomDomainsResponse_customDomains = (DescribeCustomDomainsResponse -> [CustomDomain])
-> (DescribeCustomDomainsResponse
    -> [CustomDomain] -> DescribeCustomDomainsResponse)
-> Lens
     DescribeCustomDomainsResponse
     DescribeCustomDomainsResponse
     [CustomDomain]
     [CustomDomain]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomDomainsResponse' {[CustomDomain]
customDomains :: [CustomDomain]
$sel:customDomains:DescribeCustomDomainsResponse' :: DescribeCustomDomainsResponse -> [CustomDomain]
customDomains} -> [CustomDomain]
customDomains) (\s :: DescribeCustomDomainsResponse
s@DescribeCustomDomainsResponse' {} [CustomDomain]
a -> DescribeCustomDomainsResponse
s {$sel:customDomains:DescribeCustomDomainsResponse' :: [CustomDomain]
customDomains = [CustomDomain]
a} :: DescribeCustomDomainsResponse) (([CustomDomain] -> f [CustomDomain])
 -> DescribeCustomDomainsResponse
 -> f DescribeCustomDomainsResponse)
-> (([CustomDomain] -> f [CustomDomain])
    -> [CustomDomain] -> f [CustomDomain])
-> ([CustomDomain] -> f [CustomDomain])
-> DescribeCustomDomainsResponse
-> f DescribeCustomDomainsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CustomDomain] -> f [CustomDomain])
-> [CustomDomain] -> f [CustomDomain]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData DescribeCustomDomainsResponse