{-# 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.Route53Domains.Types.DomainPrice
-- 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.Route53Domains.Types.DomainPrice 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.Route53Domains.Types.PriceWithCurrency

-- | Information about the domain price associated with a TLD.
--
-- /See:/ 'newDomainPrice' smart constructor.
data DomainPrice = DomainPrice'
  { -- | The price for changing domain ownership.
    DomainPrice -> Maybe PriceWithCurrency
changeOwnershipPrice :: Prelude.Maybe PriceWithCurrency,
    -- | The name of the TLD for which the prices apply.
    DomainPrice -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The price for domain registration with Route 53.
    DomainPrice -> Maybe PriceWithCurrency
registrationPrice :: Prelude.Maybe PriceWithCurrency,
    -- | The price for renewing domain registration with Route 53.
    DomainPrice -> Maybe PriceWithCurrency
renewalPrice :: Prelude.Maybe PriceWithCurrency,
    -- | The price for restoring the domain with Route 53.
    DomainPrice -> Maybe PriceWithCurrency
restorationPrice :: Prelude.Maybe PriceWithCurrency,
    -- | The price for transferring the domain registration to Route 53.
    DomainPrice -> Maybe PriceWithCurrency
transferPrice :: Prelude.Maybe PriceWithCurrency
  }
  deriving (DomainPrice -> DomainPrice -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainPrice -> DomainPrice -> Bool
$c/= :: DomainPrice -> DomainPrice -> Bool
== :: DomainPrice -> DomainPrice -> Bool
$c== :: DomainPrice -> DomainPrice -> Bool
Prelude.Eq, ReadPrec [DomainPrice]
ReadPrec DomainPrice
Int -> ReadS DomainPrice
ReadS [DomainPrice]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainPrice]
$creadListPrec :: ReadPrec [DomainPrice]
readPrec :: ReadPrec DomainPrice
$creadPrec :: ReadPrec DomainPrice
readList :: ReadS [DomainPrice]
$creadList :: ReadS [DomainPrice]
readsPrec :: Int -> ReadS DomainPrice
$creadsPrec :: Int -> ReadS DomainPrice
Prelude.Read, Int -> DomainPrice -> ShowS
[DomainPrice] -> ShowS
DomainPrice -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainPrice] -> ShowS
$cshowList :: [DomainPrice] -> ShowS
show :: DomainPrice -> String
$cshow :: DomainPrice -> String
showsPrec :: Int -> DomainPrice -> ShowS
$cshowsPrec :: Int -> DomainPrice -> ShowS
Prelude.Show, forall x. Rep DomainPrice x -> DomainPrice
forall x. DomainPrice -> Rep DomainPrice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DomainPrice x -> DomainPrice
$cfrom :: forall x. DomainPrice -> Rep DomainPrice x
Prelude.Generic)

-- |
-- Create a value of 'DomainPrice' 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:
--
-- 'changeOwnershipPrice', 'domainPrice_changeOwnershipPrice' - The price for changing domain ownership.
--
-- 'name', 'domainPrice_name' - The name of the TLD for which the prices apply.
--
-- 'registrationPrice', 'domainPrice_registrationPrice' - The price for domain registration with Route 53.
--
-- 'renewalPrice', 'domainPrice_renewalPrice' - The price for renewing domain registration with Route 53.
--
-- 'restorationPrice', 'domainPrice_restorationPrice' - The price for restoring the domain with Route 53.
--
-- 'transferPrice', 'domainPrice_transferPrice' - The price for transferring the domain registration to Route 53.
newDomainPrice ::
  DomainPrice
newDomainPrice :: DomainPrice
newDomainPrice =
  DomainPrice'
    { $sel:changeOwnershipPrice:DomainPrice' :: Maybe PriceWithCurrency
changeOwnershipPrice =
        forall a. Maybe a
Prelude.Nothing,
      $sel:name:DomainPrice' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:registrationPrice:DomainPrice' :: Maybe PriceWithCurrency
registrationPrice = forall a. Maybe a
Prelude.Nothing,
      $sel:renewalPrice:DomainPrice' :: Maybe PriceWithCurrency
renewalPrice = forall a. Maybe a
Prelude.Nothing,
      $sel:restorationPrice:DomainPrice' :: Maybe PriceWithCurrency
restorationPrice = forall a. Maybe a
Prelude.Nothing,
      $sel:transferPrice:DomainPrice' :: Maybe PriceWithCurrency
transferPrice = forall a. Maybe a
Prelude.Nothing
    }

-- | The price for changing domain ownership.
domainPrice_changeOwnershipPrice :: Lens.Lens' DomainPrice (Prelude.Maybe PriceWithCurrency)
domainPrice_changeOwnershipPrice :: Lens' DomainPrice (Maybe PriceWithCurrency)
domainPrice_changeOwnershipPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainPrice' {Maybe PriceWithCurrency
changeOwnershipPrice :: Maybe PriceWithCurrency
$sel:changeOwnershipPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
changeOwnershipPrice} -> Maybe PriceWithCurrency
changeOwnershipPrice) (\s :: DomainPrice
s@DomainPrice' {} Maybe PriceWithCurrency
a -> DomainPrice
s {$sel:changeOwnershipPrice:DomainPrice' :: Maybe PriceWithCurrency
changeOwnershipPrice = Maybe PriceWithCurrency
a} :: DomainPrice)

-- | The name of the TLD for which the prices apply.
domainPrice_name :: Lens.Lens' DomainPrice (Prelude.Maybe Prelude.Text)
domainPrice_name :: Lens' DomainPrice (Maybe Text)
domainPrice_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainPrice' {Maybe Text
name :: Maybe Text
$sel:name:DomainPrice' :: DomainPrice -> Maybe Text
name} -> Maybe Text
name) (\s :: DomainPrice
s@DomainPrice' {} Maybe Text
a -> DomainPrice
s {$sel:name:DomainPrice' :: Maybe Text
name = Maybe Text
a} :: DomainPrice)

-- | The price for domain registration with Route 53.
domainPrice_registrationPrice :: Lens.Lens' DomainPrice (Prelude.Maybe PriceWithCurrency)
domainPrice_registrationPrice :: Lens' DomainPrice (Maybe PriceWithCurrency)
domainPrice_registrationPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainPrice' {Maybe PriceWithCurrency
registrationPrice :: Maybe PriceWithCurrency
$sel:registrationPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
registrationPrice} -> Maybe PriceWithCurrency
registrationPrice) (\s :: DomainPrice
s@DomainPrice' {} Maybe PriceWithCurrency
a -> DomainPrice
s {$sel:registrationPrice:DomainPrice' :: Maybe PriceWithCurrency
registrationPrice = Maybe PriceWithCurrency
a} :: DomainPrice)

-- | The price for renewing domain registration with Route 53.
domainPrice_renewalPrice :: Lens.Lens' DomainPrice (Prelude.Maybe PriceWithCurrency)
domainPrice_renewalPrice :: Lens' DomainPrice (Maybe PriceWithCurrency)
domainPrice_renewalPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainPrice' {Maybe PriceWithCurrency
renewalPrice :: Maybe PriceWithCurrency
$sel:renewalPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
renewalPrice} -> Maybe PriceWithCurrency
renewalPrice) (\s :: DomainPrice
s@DomainPrice' {} Maybe PriceWithCurrency
a -> DomainPrice
s {$sel:renewalPrice:DomainPrice' :: Maybe PriceWithCurrency
renewalPrice = Maybe PriceWithCurrency
a} :: DomainPrice)

-- | The price for restoring the domain with Route 53.
domainPrice_restorationPrice :: Lens.Lens' DomainPrice (Prelude.Maybe PriceWithCurrency)
domainPrice_restorationPrice :: Lens' DomainPrice (Maybe PriceWithCurrency)
domainPrice_restorationPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainPrice' {Maybe PriceWithCurrency
restorationPrice :: Maybe PriceWithCurrency
$sel:restorationPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
restorationPrice} -> Maybe PriceWithCurrency
restorationPrice) (\s :: DomainPrice
s@DomainPrice' {} Maybe PriceWithCurrency
a -> DomainPrice
s {$sel:restorationPrice:DomainPrice' :: Maybe PriceWithCurrency
restorationPrice = Maybe PriceWithCurrency
a} :: DomainPrice)

-- | The price for transferring the domain registration to Route 53.
domainPrice_transferPrice :: Lens.Lens' DomainPrice (Prelude.Maybe PriceWithCurrency)
domainPrice_transferPrice :: Lens' DomainPrice (Maybe PriceWithCurrency)
domainPrice_transferPrice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainPrice' {Maybe PriceWithCurrency
transferPrice :: Maybe PriceWithCurrency
$sel:transferPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
transferPrice} -> Maybe PriceWithCurrency
transferPrice) (\s :: DomainPrice
s@DomainPrice' {} Maybe PriceWithCurrency
a -> DomainPrice
s {$sel:transferPrice:DomainPrice' :: Maybe PriceWithCurrency
transferPrice = Maybe PriceWithCurrency
a} :: DomainPrice)

instance Data.FromJSON DomainPrice where
  parseJSON :: Value -> Parser DomainPrice
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DomainPrice"
      ( \Object
x ->
          Maybe PriceWithCurrency
-> Maybe Text
-> Maybe PriceWithCurrency
-> Maybe PriceWithCurrency
-> Maybe PriceWithCurrency
-> Maybe PriceWithCurrency
-> DomainPrice
DomainPrice'
            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
"ChangeOwnershipPrice")
            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
"Name")
            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
"RegistrationPrice")
            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
"RenewalPrice")
            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
"RestorationPrice")
            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
"TransferPrice")
      )

instance Prelude.Hashable DomainPrice where
  hashWithSalt :: Int -> DomainPrice -> Int
hashWithSalt Int
_salt DomainPrice' {Maybe Text
Maybe PriceWithCurrency
transferPrice :: Maybe PriceWithCurrency
restorationPrice :: Maybe PriceWithCurrency
renewalPrice :: Maybe PriceWithCurrency
registrationPrice :: Maybe PriceWithCurrency
name :: Maybe Text
changeOwnershipPrice :: Maybe PriceWithCurrency
$sel:transferPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:restorationPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:renewalPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:registrationPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:name:DomainPrice' :: DomainPrice -> Maybe Text
$sel:changeOwnershipPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PriceWithCurrency
changeOwnershipPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PriceWithCurrency
registrationPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PriceWithCurrency
renewalPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PriceWithCurrency
restorationPrice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PriceWithCurrency
transferPrice

instance Prelude.NFData DomainPrice where
  rnf :: DomainPrice -> ()
rnf DomainPrice' {Maybe Text
Maybe PriceWithCurrency
transferPrice :: Maybe PriceWithCurrency
restorationPrice :: Maybe PriceWithCurrency
renewalPrice :: Maybe PriceWithCurrency
registrationPrice :: Maybe PriceWithCurrency
name :: Maybe Text
changeOwnershipPrice :: Maybe PriceWithCurrency
$sel:transferPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:restorationPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:renewalPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:registrationPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
$sel:name:DomainPrice' :: DomainPrice -> Maybe Text
$sel:changeOwnershipPrice:DomainPrice' :: DomainPrice -> Maybe PriceWithCurrency
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe PriceWithCurrency
changeOwnershipPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PriceWithCurrency
registrationPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PriceWithCurrency
renewalPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PriceWithCurrency
restorationPrice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PriceWithCurrency
transferPrice