{-# 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.GlobalAccelerator.DescribeCustomRoutingAcceleratorAttributes
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describe the attributes of a custom routing accelerator.
module Amazonka.GlobalAccelerator.DescribeCustomRoutingAcceleratorAttributes
  ( -- * Creating a Request
    DescribeCustomRoutingAcceleratorAttributes (..),
    newDescribeCustomRoutingAcceleratorAttributes,

    -- * Request Lenses
    describeCustomRoutingAcceleratorAttributes_acceleratorArn,

    -- * Destructuring the Response
    DescribeCustomRoutingAcceleratorAttributesResponse (..),
    newDescribeCustomRoutingAcceleratorAttributesResponse,

    -- * Response Lenses
    describeCustomRoutingAcceleratorAttributesResponse_acceleratorAttributes,
    describeCustomRoutingAcceleratorAttributesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeCustomRoutingAcceleratorAttributes' smart constructor.
data DescribeCustomRoutingAcceleratorAttributes = DescribeCustomRoutingAcceleratorAttributes'
  { -- | The Amazon Resource Name (ARN) of the custom routing accelerator to
    -- describe the attributes for.
    DescribeCustomRoutingAcceleratorAttributes -> Text
acceleratorArn :: Prelude.Text
  }
  deriving (DescribeCustomRoutingAcceleratorAttributes
-> DescribeCustomRoutingAcceleratorAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomRoutingAcceleratorAttributes
-> DescribeCustomRoutingAcceleratorAttributes -> Bool
$c/= :: DescribeCustomRoutingAcceleratorAttributes
-> DescribeCustomRoutingAcceleratorAttributes -> Bool
== :: DescribeCustomRoutingAcceleratorAttributes
-> DescribeCustomRoutingAcceleratorAttributes -> Bool
$c== :: DescribeCustomRoutingAcceleratorAttributes
-> DescribeCustomRoutingAcceleratorAttributes -> Bool
Prelude.Eq, ReadPrec [DescribeCustomRoutingAcceleratorAttributes]
ReadPrec DescribeCustomRoutingAcceleratorAttributes
Int -> ReadS DescribeCustomRoutingAcceleratorAttributes
ReadS [DescribeCustomRoutingAcceleratorAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomRoutingAcceleratorAttributes]
$creadListPrec :: ReadPrec [DescribeCustomRoutingAcceleratorAttributes]
readPrec :: ReadPrec DescribeCustomRoutingAcceleratorAttributes
$creadPrec :: ReadPrec DescribeCustomRoutingAcceleratorAttributes
readList :: ReadS [DescribeCustomRoutingAcceleratorAttributes]
$creadList :: ReadS [DescribeCustomRoutingAcceleratorAttributes]
readsPrec :: Int -> ReadS DescribeCustomRoutingAcceleratorAttributes
$creadsPrec :: Int -> ReadS DescribeCustomRoutingAcceleratorAttributes
Prelude.Read, Int -> DescribeCustomRoutingAcceleratorAttributes -> ShowS
[DescribeCustomRoutingAcceleratorAttributes] -> ShowS
DescribeCustomRoutingAcceleratorAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomRoutingAcceleratorAttributes] -> ShowS
$cshowList :: [DescribeCustomRoutingAcceleratorAttributes] -> ShowS
show :: DescribeCustomRoutingAcceleratorAttributes -> String
$cshow :: DescribeCustomRoutingAcceleratorAttributes -> String
showsPrec :: Int -> DescribeCustomRoutingAcceleratorAttributes -> ShowS
$cshowsPrec :: Int -> DescribeCustomRoutingAcceleratorAttributes -> ShowS
Prelude.Show, forall x.
Rep DescribeCustomRoutingAcceleratorAttributes x
-> DescribeCustomRoutingAcceleratorAttributes
forall x.
DescribeCustomRoutingAcceleratorAttributes
-> Rep DescribeCustomRoutingAcceleratorAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCustomRoutingAcceleratorAttributes x
-> DescribeCustomRoutingAcceleratorAttributes
$cfrom :: forall x.
DescribeCustomRoutingAcceleratorAttributes
-> Rep DescribeCustomRoutingAcceleratorAttributes x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCustomRoutingAcceleratorAttributes' 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:
--
-- 'acceleratorArn', 'describeCustomRoutingAcceleratorAttributes_acceleratorArn' - The Amazon Resource Name (ARN) of the custom routing accelerator to
-- describe the attributes for.
newDescribeCustomRoutingAcceleratorAttributes ::
  -- | 'acceleratorArn'
  Prelude.Text ->
  DescribeCustomRoutingAcceleratorAttributes
newDescribeCustomRoutingAcceleratorAttributes :: Text -> DescribeCustomRoutingAcceleratorAttributes
newDescribeCustomRoutingAcceleratorAttributes
  Text
pAcceleratorArn_ =
    DescribeCustomRoutingAcceleratorAttributes'
      { $sel:acceleratorArn:DescribeCustomRoutingAcceleratorAttributes' :: Text
acceleratorArn =
          Text
pAcceleratorArn_
      }

-- | The Amazon Resource Name (ARN) of the custom routing accelerator to
-- describe the attributes for.
describeCustomRoutingAcceleratorAttributes_acceleratorArn :: Lens.Lens' DescribeCustomRoutingAcceleratorAttributes Prelude.Text
describeCustomRoutingAcceleratorAttributes_acceleratorArn :: Lens' DescribeCustomRoutingAcceleratorAttributes Text
describeCustomRoutingAcceleratorAttributes_acceleratorArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomRoutingAcceleratorAttributes' {Text
acceleratorArn :: Text
$sel:acceleratorArn:DescribeCustomRoutingAcceleratorAttributes' :: DescribeCustomRoutingAcceleratorAttributes -> Text
acceleratorArn} -> Text
acceleratorArn) (\s :: DescribeCustomRoutingAcceleratorAttributes
s@DescribeCustomRoutingAcceleratorAttributes' {} Text
a -> DescribeCustomRoutingAcceleratorAttributes
s {$sel:acceleratorArn:DescribeCustomRoutingAcceleratorAttributes' :: Text
acceleratorArn = Text
a} :: DescribeCustomRoutingAcceleratorAttributes)

instance
  Core.AWSRequest
    DescribeCustomRoutingAcceleratorAttributes
  where
  type
    AWSResponse
      DescribeCustomRoutingAcceleratorAttributes =
      DescribeCustomRoutingAcceleratorAttributesResponse
  request :: (Service -> Service)
-> DescribeCustomRoutingAcceleratorAttributes
-> Request DescribeCustomRoutingAcceleratorAttributes
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 DescribeCustomRoutingAcceleratorAttributes
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse DescribeCustomRoutingAcceleratorAttributes)))
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 CustomRoutingAcceleratorAttributes
-> Int -> DescribeCustomRoutingAcceleratorAttributesResponse
DescribeCustomRoutingAcceleratorAttributesResponse'
            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
"AcceleratorAttributes")
            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
    DescribeCustomRoutingAcceleratorAttributes
  where
  hashWithSalt :: Int -> DescribeCustomRoutingAcceleratorAttributes -> Int
hashWithSalt
    Int
_salt
    DescribeCustomRoutingAcceleratorAttributes' {Text
acceleratorArn :: Text
$sel:acceleratorArn:DescribeCustomRoutingAcceleratorAttributes' :: DescribeCustomRoutingAcceleratorAttributes -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
acceleratorArn

instance
  Prelude.NFData
    DescribeCustomRoutingAcceleratorAttributes
  where
  rnf :: DescribeCustomRoutingAcceleratorAttributes -> ()
rnf DescribeCustomRoutingAcceleratorAttributes' {Text
acceleratorArn :: Text
$sel:acceleratorArn:DescribeCustomRoutingAcceleratorAttributes' :: DescribeCustomRoutingAcceleratorAttributes -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
acceleratorArn

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

instance
  Data.ToJSON
    DescribeCustomRoutingAcceleratorAttributes
  where
  toJSON :: DescribeCustomRoutingAcceleratorAttributes -> Value
toJSON
    DescribeCustomRoutingAcceleratorAttributes' {Text
acceleratorArn :: Text
$sel:acceleratorArn:DescribeCustomRoutingAcceleratorAttributes' :: DescribeCustomRoutingAcceleratorAttributes -> Text
..} =
      [Pair] -> Value
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ forall a. a -> Maybe a
Prelude.Just
                (Key
"AcceleratorArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
acceleratorArn)
            ]
        )

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

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

-- | /See:/ 'newDescribeCustomRoutingAcceleratorAttributesResponse' smart constructor.
data DescribeCustomRoutingAcceleratorAttributesResponse = DescribeCustomRoutingAcceleratorAttributesResponse'
  { -- | The attributes of the custom routing accelerator.
    DescribeCustomRoutingAcceleratorAttributesResponse
-> Maybe CustomRoutingAcceleratorAttributes
acceleratorAttributes :: Prelude.Maybe CustomRoutingAcceleratorAttributes,
    -- | The response's http status code.
    DescribeCustomRoutingAcceleratorAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeCustomRoutingAcceleratorAttributesResponse
-> DescribeCustomRoutingAcceleratorAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCustomRoutingAcceleratorAttributesResponse
-> DescribeCustomRoutingAcceleratorAttributesResponse -> Bool
$c/= :: DescribeCustomRoutingAcceleratorAttributesResponse
-> DescribeCustomRoutingAcceleratorAttributesResponse -> Bool
== :: DescribeCustomRoutingAcceleratorAttributesResponse
-> DescribeCustomRoutingAcceleratorAttributesResponse -> Bool
$c== :: DescribeCustomRoutingAcceleratorAttributesResponse
-> DescribeCustomRoutingAcceleratorAttributesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCustomRoutingAcceleratorAttributesResponse]
ReadPrec DescribeCustomRoutingAcceleratorAttributesResponse
Int -> ReadS DescribeCustomRoutingAcceleratorAttributesResponse
ReadS [DescribeCustomRoutingAcceleratorAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCustomRoutingAcceleratorAttributesResponse]
$creadListPrec :: ReadPrec [DescribeCustomRoutingAcceleratorAttributesResponse]
readPrec :: ReadPrec DescribeCustomRoutingAcceleratorAttributesResponse
$creadPrec :: ReadPrec DescribeCustomRoutingAcceleratorAttributesResponse
readList :: ReadS [DescribeCustomRoutingAcceleratorAttributesResponse]
$creadList :: ReadS [DescribeCustomRoutingAcceleratorAttributesResponse]
readsPrec :: Int -> ReadS DescribeCustomRoutingAcceleratorAttributesResponse
$creadsPrec :: Int -> ReadS DescribeCustomRoutingAcceleratorAttributesResponse
Prelude.Read, Int -> DescribeCustomRoutingAcceleratorAttributesResponse -> ShowS
[DescribeCustomRoutingAcceleratorAttributesResponse] -> ShowS
DescribeCustomRoutingAcceleratorAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCustomRoutingAcceleratorAttributesResponse] -> ShowS
$cshowList :: [DescribeCustomRoutingAcceleratorAttributesResponse] -> ShowS
show :: DescribeCustomRoutingAcceleratorAttributesResponse -> String
$cshow :: DescribeCustomRoutingAcceleratorAttributesResponse -> String
showsPrec :: Int -> DescribeCustomRoutingAcceleratorAttributesResponse -> ShowS
$cshowsPrec :: Int -> DescribeCustomRoutingAcceleratorAttributesResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeCustomRoutingAcceleratorAttributesResponse x
-> DescribeCustomRoutingAcceleratorAttributesResponse
forall x.
DescribeCustomRoutingAcceleratorAttributesResponse
-> Rep DescribeCustomRoutingAcceleratorAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCustomRoutingAcceleratorAttributesResponse x
-> DescribeCustomRoutingAcceleratorAttributesResponse
$cfrom :: forall x.
DescribeCustomRoutingAcceleratorAttributesResponse
-> Rep DescribeCustomRoutingAcceleratorAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeCustomRoutingAcceleratorAttributesResponse' 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:
--
-- 'acceleratorAttributes', 'describeCustomRoutingAcceleratorAttributesResponse_acceleratorAttributes' - The attributes of the custom routing accelerator.
--
-- 'httpStatus', 'describeCustomRoutingAcceleratorAttributesResponse_httpStatus' - The response's http status code.
newDescribeCustomRoutingAcceleratorAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeCustomRoutingAcceleratorAttributesResponse
newDescribeCustomRoutingAcceleratorAttributesResponse :: Int -> DescribeCustomRoutingAcceleratorAttributesResponse
newDescribeCustomRoutingAcceleratorAttributesResponse
  Int
pHttpStatus_ =
    DescribeCustomRoutingAcceleratorAttributesResponse'
      { $sel:acceleratorAttributes:DescribeCustomRoutingAcceleratorAttributesResponse' :: Maybe CustomRoutingAcceleratorAttributes
acceleratorAttributes =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeCustomRoutingAcceleratorAttributesResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The attributes of the custom routing accelerator.
describeCustomRoutingAcceleratorAttributesResponse_acceleratorAttributes :: Lens.Lens' DescribeCustomRoutingAcceleratorAttributesResponse (Prelude.Maybe CustomRoutingAcceleratorAttributes)
describeCustomRoutingAcceleratorAttributesResponse_acceleratorAttributes :: Lens'
  DescribeCustomRoutingAcceleratorAttributesResponse
  (Maybe CustomRoutingAcceleratorAttributes)
describeCustomRoutingAcceleratorAttributesResponse_acceleratorAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCustomRoutingAcceleratorAttributesResponse' {Maybe CustomRoutingAcceleratorAttributes
acceleratorAttributes :: Maybe CustomRoutingAcceleratorAttributes
$sel:acceleratorAttributes:DescribeCustomRoutingAcceleratorAttributesResponse' :: DescribeCustomRoutingAcceleratorAttributesResponse
-> Maybe CustomRoutingAcceleratorAttributes
acceleratorAttributes} -> Maybe CustomRoutingAcceleratorAttributes
acceleratorAttributes) (\s :: DescribeCustomRoutingAcceleratorAttributesResponse
s@DescribeCustomRoutingAcceleratorAttributesResponse' {} Maybe CustomRoutingAcceleratorAttributes
a -> DescribeCustomRoutingAcceleratorAttributesResponse
s {$sel:acceleratorAttributes:DescribeCustomRoutingAcceleratorAttributesResponse' :: Maybe CustomRoutingAcceleratorAttributes
acceleratorAttributes = Maybe CustomRoutingAcceleratorAttributes
a} :: DescribeCustomRoutingAcceleratorAttributesResponse)

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

instance
  Prelude.NFData
    DescribeCustomRoutingAcceleratorAttributesResponse
  where
  rnf :: DescribeCustomRoutingAcceleratorAttributesResponse -> ()
rnf
    DescribeCustomRoutingAcceleratorAttributesResponse' {Int
Maybe CustomRoutingAcceleratorAttributes
httpStatus :: Int
acceleratorAttributes :: Maybe CustomRoutingAcceleratorAttributes
$sel:httpStatus:DescribeCustomRoutingAcceleratorAttributesResponse' :: DescribeCustomRoutingAcceleratorAttributesResponse -> Int
$sel:acceleratorAttributes:DescribeCustomRoutingAcceleratorAttributesResponse' :: DescribeCustomRoutingAcceleratorAttributesResponse
-> Maybe CustomRoutingAcceleratorAttributes
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomRoutingAcceleratorAttributes
acceleratorAttributes
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus