{-# 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.CertificateManagerPCA.Types.Qualifier
-- 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.CertificateManagerPCA.Types.Qualifier where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Defines a @PolicyInformation@ qualifier. ACM Private CA supports the
-- <https://tools.ietf.org/html/rfc5280#section-4.2.1.4 certification practice statement (CPS) qualifier>
-- defined in RFC 5280.
--
-- /See:/ 'newQualifier' smart constructor.
data Qualifier = Qualifier'
  { -- | Contains a pointer to a certification practice statement (CPS) published
    -- by the CA.
    Qualifier -> Text
cpsUri :: Prelude.Text
  }
  deriving (Qualifier -> Qualifier -> Bool
(Qualifier -> Qualifier -> Bool)
-> (Qualifier -> Qualifier -> Bool) -> Eq Qualifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Qualifier -> Qualifier -> Bool
$c/= :: Qualifier -> Qualifier -> Bool
== :: Qualifier -> Qualifier -> Bool
$c== :: Qualifier -> Qualifier -> Bool
Prelude.Eq, ReadPrec [Qualifier]
ReadPrec Qualifier
Int -> ReadS Qualifier
ReadS [Qualifier]
(Int -> ReadS Qualifier)
-> ReadS [Qualifier]
-> ReadPrec Qualifier
-> ReadPrec [Qualifier]
-> Read Qualifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Qualifier]
$creadListPrec :: ReadPrec [Qualifier]
readPrec :: ReadPrec Qualifier
$creadPrec :: ReadPrec Qualifier
readList :: ReadS [Qualifier]
$creadList :: ReadS [Qualifier]
readsPrec :: Int -> ReadS Qualifier
$creadsPrec :: Int -> ReadS Qualifier
Prelude.Read, Int -> Qualifier -> ShowS
[Qualifier] -> ShowS
Qualifier -> String
(Int -> Qualifier -> ShowS)
-> (Qualifier -> String)
-> ([Qualifier] -> ShowS)
-> Show Qualifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Qualifier] -> ShowS
$cshowList :: [Qualifier] -> ShowS
show :: Qualifier -> String
$cshow :: Qualifier -> String
showsPrec :: Int -> Qualifier -> ShowS
$cshowsPrec :: Int -> Qualifier -> ShowS
Prelude.Show, (forall x. Qualifier -> Rep Qualifier x)
-> (forall x. Rep Qualifier x -> Qualifier) -> Generic Qualifier
forall x. Rep Qualifier x -> Qualifier
forall x. Qualifier -> Rep Qualifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Qualifier x -> Qualifier
$cfrom :: forall x. Qualifier -> Rep Qualifier x
Prelude.Generic)

-- |
-- Create a value of 'Qualifier' 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:
--
-- 'cpsUri', 'qualifier_cpsUri' - Contains a pointer to a certification practice statement (CPS) published
-- by the CA.
newQualifier ::
  -- | 'cpsUri'
  Prelude.Text ->
  Qualifier
newQualifier :: Text -> Qualifier
newQualifier Text
pCpsUri_ = Qualifier' :: Text -> Qualifier
Qualifier' {$sel:cpsUri:Qualifier' :: Text
cpsUri = Text
pCpsUri_}

-- | Contains a pointer to a certification practice statement (CPS) published
-- by the CA.
qualifier_cpsUri :: Lens.Lens' Qualifier Prelude.Text
qualifier_cpsUri :: (Text -> f Text) -> Qualifier -> f Qualifier
qualifier_cpsUri = (Qualifier -> Text)
-> (Qualifier -> Text -> Qualifier)
-> Lens Qualifier Qualifier Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Qualifier' {Text
cpsUri :: Text
$sel:cpsUri:Qualifier' :: Qualifier -> Text
cpsUri} -> Text
cpsUri) (\s :: Qualifier
s@Qualifier' {} Text
a -> Qualifier
s {$sel:cpsUri:Qualifier' :: Text
cpsUri = Text
a} :: Qualifier)

instance Prelude.Hashable Qualifier

instance Prelude.NFData Qualifier

instance Core.ToJSON Qualifier where
  toJSON :: Qualifier -> Value
toJSON Qualifier' {Text
cpsUri :: Text
$sel:cpsUri:Qualifier' :: Qualifier -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"CpsUri" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
cpsUri)]
      )