{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53Resolver.Types.IpAddressResponse
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53Resolver.Types.IpAddressResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Resolver.Types.IpAddressStatus

-- | In the response to a
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_route53resolver_GetResolverEndpoint.html GetResolverEndpoint>
-- request, information about the IP addresses that the Resolver endpoint
-- uses for DNS queries.
--
-- /See:/ 'newIpAddressResponse' smart constructor.
data IpAddressResponse = IpAddressResponse'
  { -- | The date and time that the IP address was created, in Unix time format
    -- and Coordinated Universal Time (UTC).
    IpAddressResponse -> Maybe Text
creationTime :: Prelude.Maybe Prelude.Text,
    -- | One IP address that the Resolver endpoint uses for DNS queries.
    IpAddressResponse -> Maybe Text
ip :: Prelude.Maybe Prelude.Text,
    -- | The ID of one IP address.
    IpAddressResponse -> Maybe Text
ipId :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the IP address was last modified, in Unix time
    -- format and Coordinated Universal Time (UTC).
    IpAddressResponse -> Maybe Text
modificationTime :: Prelude.Maybe Prelude.Text,
    -- | A status code that gives the current status of the request.
    IpAddressResponse -> Maybe IpAddressStatus
status :: Prelude.Maybe IpAddressStatus,
    -- | A message that provides additional information about the status of the
    -- request.
    IpAddressResponse -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The ID of one subnet.
    IpAddressResponse -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text
  }
  deriving (IpAddressResponse -> IpAddressResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IpAddressResponse -> IpAddressResponse -> Bool
$c/= :: IpAddressResponse -> IpAddressResponse -> Bool
== :: IpAddressResponse -> IpAddressResponse -> Bool
$c== :: IpAddressResponse -> IpAddressResponse -> Bool
Prelude.Eq, ReadPrec [IpAddressResponse]
ReadPrec IpAddressResponse
Int -> ReadS IpAddressResponse
ReadS [IpAddressResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IpAddressResponse]
$creadListPrec :: ReadPrec [IpAddressResponse]
readPrec :: ReadPrec IpAddressResponse
$creadPrec :: ReadPrec IpAddressResponse
readList :: ReadS [IpAddressResponse]
$creadList :: ReadS [IpAddressResponse]
readsPrec :: Int -> ReadS IpAddressResponse
$creadsPrec :: Int -> ReadS IpAddressResponse
Prelude.Read, Int -> IpAddressResponse -> ShowS
[IpAddressResponse] -> ShowS
IpAddressResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IpAddressResponse] -> ShowS
$cshowList :: [IpAddressResponse] -> ShowS
show :: IpAddressResponse -> String
$cshow :: IpAddressResponse -> String
showsPrec :: Int -> IpAddressResponse -> ShowS
$cshowsPrec :: Int -> IpAddressResponse -> ShowS
Prelude.Show, forall x. Rep IpAddressResponse x -> IpAddressResponse
forall x. IpAddressResponse -> Rep IpAddressResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IpAddressResponse x -> IpAddressResponse
$cfrom :: forall x. IpAddressResponse -> Rep IpAddressResponse x
Prelude.Generic)

-- |
-- Create a value of 'IpAddressResponse' 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:
--
-- 'creationTime', 'ipAddressResponse_creationTime' - The date and time that the IP address was created, in Unix time format
-- and Coordinated Universal Time (UTC).
--
-- 'ip', 'ipAddressResponse_ip' - One IP address that the Resolver endpoint uses for DNS queries.
--
-- 'ipId', 'ipAddressResponse_ipId' - The ID of one IP address.
--
-- 'modificationTime', 'ipAddressResponse_modificationTime' - The date and time that the IP address was last modified, in Unix time
-- format and Coordinated Universal Time (UTC).
--
-- 'status', 'ipAddressResponse_status' - A status code that gives the current status of the request.
--
-- 'statusMessage', 'ipAddressResponse_statusMessage' - A message that provides additional information about the status of the
-- request.
--
-- 'subnetId', 'ipAddressResponse_subnetId' - The ID of one subnet.
newIpAddressResponse ::
  IpAddressResponse
newIpAddressResponse :: IpAddressResponse
newIpAddressResponse =
  IpAddressResponse'
    { $sel:creationTime:IpAddressResponse' :: Maybe Text
creationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:ip:IpAddressResponse' :: Maybe Text
ip = forall a. Maybe a
Prelude.Nothing,
      $sel:ipId:IpAddressResponse' :: Maybe Text
ipId = forall a. Maybe a
Prelude.Nothing,
      $sel:modificationTime:IpAddressResponse' :: Maybe Text
modificationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:status:IpAddressResponse' :: Maybe IpAddressStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:IpAddressResponse' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetId:IpAddressResponse' :: Maybe Text
subnetId = forall a. Maybe a
Prelude.Nothing
    }

-- | The date and time that the IP address was created, in Unix time format
-- and Coordinated Universal Time (UTC).
ipAddressResponse_creationTime :: Lens.Lens' IpAddressResponse (Prelude.Maybe Prelude.Text)
ipAddressResponse_creationTime :: Lens' IpAddressResponse (Maybe Text)
ipAddressResponse_creationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressResponse' {Maybe Text
creationTime :: Maybe Text
$sel:creationTime:IpAddressResponse' :: IpAddressResponse -> Maybe Text
creationTime} -> Maybe Text
creationTime) (\s :: IpAddressResponse
s@IpAddressResponse' {} Maybe Text
a -> IpAddressResponse
s {$sel:creationTime:IpAddressResponse' :: Maybe Text
creationTime = Maybe Text
a} :: IpAddressResponse)

-- | One IP address that the Resolver endpoint uses for DNS queries.
ipAddressResponse_ip :: Lens.Lens' IpAddressResponse (Prelude.Maybe Prelude.Text)
ipAddressResponse_ip :: Lens' IpAddressResponse (Maybe Text)
ipAddressResponse_ip = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressResponse' {Maybe Text
ip :: Maybe Text
$sel:ip:IpAddressResponse' :: IpAddressResponse -> Maybe Text
ip} -> Maybe Text
ip) (\s :: IpAddressResponse
s@IpAddressResponse' {} Maybe Text
a -> IpAddressResponse
s {$sel:ip:IpAddressResponse' :: Maybe Text
ip = Maybe Text
a} :: IpAddressResponse)

-- | The ID of one IP address.
ipAddressResponse_ipId :: Lens.Lens' IpAddressResponse (Prelude.Maybe Prelude.Text)
ipAddressResponse_ipId :: Lens' IpAddressResponse (Maybe Text)
ipAddressResponse_ipId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressResponse' {Maybe Text
ipId :: Maybe Text
$sel:ipId:IpAddressResponse' :: IpAddressResponse -> Maybe Text
ipId} -> Maybe Text
ipId) (\s :: IpAddressResponse
s@IpAddressResponse' {} Maybe Text
a -> IpAddressResponse
s {$sel:ipId:IpAddressResponse' :: Maybe Text
ipId = Maybe Text
a} :: IpAddressResponse)

-- | The date and time that the IP address was last modified, in Unix time
-- format and Coordinated Universal Time (UTC).
ipAddressResponse_modificationTime :: Lens.Lens' IpAddressResponse (Prelude.Maybe Prelude.Text)
ipAddressResponse_modificationTime :: Lens' IpAddressResponse (Maybe Text)
ipAddressResponse_modificationTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressResponse' {Maybe Text
modificationTime :: Maybe Text
$sel:modificationTime:IpAddressResponse' :: IpAddressResponse -> Maybe Text
modificationTime} -> Maybe Text
modificationTime) (\s :: IpAddressResponse
s@IpAddressResponse' {} Maybe Text
a -> IpAddressResponse
s {$sel:modificationTime:IpAddressResponse' :: Maybe Text
modificationTime = Maybe Text
a} :: IpAddressResponse)

-- | A status code that gives the current status of the request.
ipAddressResponse_status :: Lens.Lens' IpAddressResponse (Prelude.Maybe IpAddressStatus)
ipAddressResponse_status :: Lens' IpAddressResponse (Maybe IpAddressStatus)
ipAddressResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressResponse' {Maybe IpAddressStatus
status :: Maybe IpAddressStatus
$sel:status:IpAddressResponse' :: IpAddressResponse -> Maybe IpAddressStatus
status} -> Maybe IpAddressStatus
status) (\s :: IpAddressResponse
s@IpAddressResponse' {} Maybe IpAddressStatus
a -> IpAddressResponse
s {$sel:status:IpAddressResponse' :: Maybe IpAddressStatus
status = Maybe IpAddressStatus
a} :: IpAddressResponse)

-- | A message that provides additional information about the status of the
-- request.
ipAddressResponse_statusMessage :: Lens.Lens' IpAddressResponse (Prelude.Maybe Prelude.Text)
ipAddressResponse_statusMessage :: Lens' IpAddressResponse (Maybe Text)
ipAddressResponse_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressResponse' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:IpAddressResponse' :: IpAddressResponse -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: IpAddressResponse
s@IpAddressResponse' {} Maybe Text
a -> IpAddressResponse
s {$sel:statusMessage:IpAddressResponse' :: Maybe Text
statusMessage = Maybe Text
a} :: IpAddressResponse)

-- | The ID of one subnet.
ipAddressResponse_subnetId :: Lens.Lens' IpAddressResponse (Prelude.Maybe Prelude.Text)
ipAddressResponse_subnetId :: Lens' IpAddressResponse (Maybe Text)
ipAddressResponse_subnetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressResponse' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:IpAddressResponse' :: IpAddressResponse -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: IpAddressResponse
s@IpAddressResponse' {} Maybe Text
a -> IpAddressResponse
s {$sel:subnetId:IpAddressResponse' :: Maybe Text
subnetId = Maybe Text
a} :: IpAddressResponse)

instance Data.FromJSON IpAddressResponse where
  parseJSON :: Value -> Parser IpAddressResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"IpAddressResponse"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe IpAddressStatus
-> Maybe Text
-> Maybe Text
-> IpAddressResponse
IpAddressResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"CreationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Ip")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IpId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ModificationTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StatusMessage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SubnetId")
      )

instance Prelude.Hashable IpAddressResponse where
  hashWithSalt :: Int -> IpAddressResponse -> Int
hashWithSalt Int
_salt IpAddressResponse' {Maybe Text
Maybe IpAddressStatus
subnetId :: Maybe Text
statusMessage :: Maybe Text
status :: Maybe IpAddressStatus
modificationTime :: Maybe Text
ipId :: Maybe Text
ip :: Maybe Text
creationTime :: Maybe Text
$sel:subnetId:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:statusMessage:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:status:IpAddressResponse' :: IpAddressResponse -> Maybe IpAddressStatus
$sel:modificationTime:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:ipId:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:ip:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:creationTime:IpAddressResponse' :: IpAddressResponse -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
creationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ip
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modificationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpAddressStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
subnetId

instance Prelude.NFData IpAddressResponse where
  rnf :: IpAddressResponse -> ()
rnf IpAddressResponse' {Maybe Text
Maybe IpAddressStatus
subnetId :: Maybe Text
statusMessage :: Maybe Text
status :: Maybe IpAddressStatus
modificationTime :: Maybe Text
ipId :: Maybe Text
ip :: Maybe Text
creationTime :: Maybe Text
$sel:subnetId:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:statusMessage:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:status:IpAddressResponse' :: IpAddressResponse -> Maybe IpAddressStatus
$sel:modificationTime:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:ipId:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:ip:IpAddressResponse' :: IpAddressResponse -> Maybe Text
$sel:creationTime:IpAddressResponse' :: IpAddressResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
creationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ip
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modificationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpAddressStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
subnetId