{-# 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.IoT.Types.DomainConfigurationSummary
-- 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)
module Amazonka.IoT.Types.DomainConfigurationSummary where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.ServiceType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The summary of a domain configuration. A domain configuration specifies
-- custom IoT-specific information about a domain. A domain configuration
-- can be associated with an Amazon Web Services-managed domain (for
-- example, dbc123defghijk.iot.us-west-2.amazonaws.com), a customer managed
-- domain, or a default endpoint.
--
-- -   Data
--
-- -   Jobs
--
-- -   CredentialProvider
--
-- /See:/ 'newDomainConfigurationSummary' smart constructor.
data DomainConfigurationSummary = DomainConfigurationSummary'
  { -- | The name of the domain configuration. This value must be unique to a
    -- region.
    DomainConfigurationSummary -> Maybe Text
domainConfigurationName :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the domain configuration.
    DomainConfigurationSummary -> Maybe Text
domainConfigurationArn :: Prelude.Maybe Prelude.Text,
    -- | The type of service delivered by the endpoint.
    DomainConfigurationSummary -> Maybe ServiceType
serviceType :: Prelude.Maybe ServiceType
  }
  deriving (DomainConfigurationSummary -> DomainConfigurationSummary -> Bool
(DomainConfigurationSummary -> DomainConfigurationSummary -> Bool)
-> (DomainConfigurationSummary
    -> DomainConfigurationSummary -> Bool)
-> Eq DomainConfigurationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DomainConfigurationSummary -> DomainConfigurationSummary -> Bool
$c/= :: DomainConfigurationSummary -> DomainConfigurationSummary -> Bool
== :: DomainConfigurationSummary -> DomainConfigurationSummary -> Bool
$c== :: DomainConfigurationSummary -> DomainConfigurationSummary -> Bool
Prelude.Eq, ReadPrec [DomainConfigurationSummary]
ReadPrec DomainConfigurationSummary
Int -> ReadS DomainConfigurationSummary
ReadS [DomainConfigurationSummary]
(Int -> ReadS DomainConfigurationSummary)
-> ReadS [DomainConfigurationSummary]
-> ReadPrec DomainConfigurationSummary
-> ReadPrec [DomainConfigurationSummary]
-> Read DomainConfigurationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DomainConfigurationSummary]
$creadListPrec :: ReadPrec [DomainConfigurationSummary]
readPrec :: ReadPrec DomainConfigurationSummary
$creadPrec :: ReadPrec DomainConfigurationSummary
readList :: ReadS [DomainConfigurationSummary]
$creadList :: ReadS [DomainConfigurationSummary]
readsPrec :: Int -> ReadS DomainConfigurationSummary
$creadsPrec :: Int -> ReadS DomainConfigurationSummary
Prelude.Read, Int -> DomainConfigurationSummary -> ShowS
[DomainConfigurationSummary] -> ShowS
DomainConfigurationSummary -> String
(Int -> DomainConfigurationSummary -> ShowS)
-> (DomainConfigurationSummary -> String)
-> ([DomainConfigurationSummary] -> ShowS)
-> Show DomainConfigurationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DomainConfigurationSummary] -> ShowS
$cshowList :: [DomainConfigurationSummary] -> ShowS
show :: DomainConfigurationSummary -> String
$cshow :: DomainConfigurationSummary -> String
showsPrec :: Int -> DomainConfigurationSummary -> ShowS
$cshowsPrec :: Int -> DomainConfigurationSummary -> ShowS
Prelude.Show, (forall x.
 DomainConfigurationSummary -> Rep DomainConfigurationSummary x)
-> (forall x.
    Rep DomainConfigurationSummary x -> DomainConfigurationSummary)
-> Generic DomainConfigurationSummary
forall x.
Rep DomainConfigurationSummary x -> DomainConfigurationSummary
forall x.
DomainConfigurationSummary -> Rep DomainConfigurationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DomainConfigurationSummary x -> DomainConfigurationSummary
$cfrom :: forall x.
DomainConfigurationSummary -> Rep DomainConfigurationSummary x
Prelude.Generic)

-- |
-- Create a value of 'DomainConfigurationSummary' 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:
--
-- 'domainConfigurationName', 'domainConfigurationSummary_domainConfigurationName' - The name of the domain configuration. This value must be unique to a
-- region.
--
-- 'domainConfigurationArn', 'domainConfigurationSummary_domainConfigurationArn' - The ARN of the domain configuration.
--
-- 'serviceType', 'domainConfigurationSummary_serviceType' - The type of service delivered by the endpoint.
newDomainConfigurationSummary ::
  DomainConfigurationSummary
newDomainConfigurationSummary :: DomainConfigurationSummary
newDomainConfigurationSummary =
  DomainConfigurationSummary' :: Maybe Text
-> Maybe Text -> Maybe ServiceType -> DomainConfigurationSummary
DomainConfigurationSummary'
    { $sel:domainConfigurationName:DomainConfigurationSummary' :: Maybe Text
domainConfigurationName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:domainConfigurationArn:DomainConfigurationSummary' :: Maybe Text
domainConfigurationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceType:DomainConfigurationSummary' :: Maybe ServiceType
serviceType = Maybe ServiceType
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the domain configuration. This value must be unique to a
-- region.
domainConfigurationSummary_domainConfigurationName :: Lens.Lens' DomainConfigurationSummary (Prelude.Maybe Prelude.Text)
domainConfigurationSummary_domainConfigurationName :: (Maybe Text -> f (Maybe Text))
-> DomainConfigurationSummary -> f DomainConfigurationSummary
domainConfigurationSummary_domainConfigurationName = (DomainConfigurationSummary -> Maybe Text)
-> (DomainConfigurationSummary
    -> Maybe Text -> DomainConfigurationSummary)
-> Lens
     DomainConfigurationSummary
     DomainConfigurationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainConfigurationSummary' {Maybe Text
domainConfigurationName :: Maybe Text
$sel:domainConfigurationName:DomainConfigurationSummary' :: DomainConfigurationSummary -> Maybe Text
domainConfigurationName} -> Maybe Text
domainConfigurationName) (\s :: DomainConfigurationSummary
s@DomainConfigurationSummary' {} Maybe Text
a -> DomainConfigurationSummary
s {$sel:domainConfigurationName:DomainConfigurationSummary' :: Maybe Text
domainConfigurationName = Maybe Text
a} :: DomainConfigurationSummary)

-- | The ARN of the domain configuration.
domainConfigurationSummary_domainConfigurationArn :: Lens.Lens' DomainConfigurationSummary (Prelude.Maybe Prelude.Text)
domainConfigurationSummary_domainConfigurationArn :: (Maybe Text -> f (Maybe Text))
-> DomainConfigurationSummary -> f DomainConfigurationSummary
domainConfigurationSummary_domainConfigurationArn = (DomainConfigurationSummary -> Maybe Text)
-> (DomainConfigurationSummary
    -> Maybe Text -> DomainConfigurationSummary)
-> Lens
     DomainConfigurationSummary
     DomainConfigurationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainConfigurationSummary' {Maybe Text
domainConfigurationArn :: Maybe Text
$sel:domainConfigurationArn:DomainConfigurationSummary' :: DomainConfigurationSummary -> Maybe Text
domainConfigurationArn} -> Maybe Text
domainConfigurationArn) (\s :: DomainConfigurationSummary
s@DomainConfigurationSummary' {} Maybe Text
a -> DomainConfigurationSummary
s {$sel:domainConfigurationArn:DomainConfigurationSummary' :: Maybe Text
domainConfigurationArn = Maybe Text
a} :: DomainConfigurationSummary)

-- | The type of service delivered by the endpoint.
domainConfigurationSummary_serviceType :: Lens.Lens' DomainConfigurationSummary (Prelude.Maybe ServiceType)
domainConfigurationSummary_serviceType :: (Maybe ServiceType -> f (Maybe ServiceType))
-> DomainConfigurationSummary -> f DomainConfigurationSummary
domainConfigurationSummary_serviceType = (DomainConfigurationSummary -> Maybe ServiceType)
-> (DomainConfigurationSummary
    -> Maybe ServiceType -> DomainConfigurationSummary)
-> Lens
     DomainConfigurationSummary
     DomainConfigurationSummary
     (Maybe ServiceType)
     (Maybe ServiceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DomainConfigurationSummary' {Maybe ServiceType
serviceType :: Maybe ServiceType
$sel:serviceType:DomainConfigurationSummary' :: DomainConfigurationSummary -> Maybe ServiceType
serviceType} -> Maybe ServiceType
serviceType) (\s :: DomainConfigurationSummary
s@DomainConfigurationSummary' {} Maybe ServiceType
a -> DomainConfigurationSummary
s {$sel:serviceType:DomainConfigurationSummary' :: Maybe ServiceType
serviceType = Maybe ServiceType
a} :: DomainConfigurationSummary)

instance Core.FromJSON DomainConfigurationSummary where
  parseJSON :: Value -> Parser DomainConfigurationSummary
parseJSON =
    String
-> (Object -> Parser DomainConfigurationSummary)
-> Value
-> Parser DomainConfigurationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DomainConfigurationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe ServiceType -> DomainConfigurationSummary
DomainConfigurationSummary'
            (Maybe Text
 -> Maybe Text -> Maybe ServiceType -> DomainConfigurationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe ServiceType -> DomainConfigurationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"domainConfigurationName")
            Parser
  (Maybe Text -> Maybe ServiceType -> DomainConfigurationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe ServiceType -> DomainConfigurationSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"domainConfigurationArn")
            Parser (Maybe ServiceType -> DomainConfigurationSummary)
-> Parser (Maybe ServiceType) -> Parser DomainConfigurationSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ServiceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceType")
      )

instance Prelude.Hashable DomainConfigurationSummary

instance Prelude.NFData DomainConfigurationSummary