{-# 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.AppConfig.Types.ConfigurationProfileSummary
-- 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.AppConfig.Types.ConfigurationProfileSummary where

import Amazonka.AppConfig.Types.ValidatorType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A summary of a configuration profile.
--
-- /See:/ 'newConfigurationProfileSummary' smart constructor.
data ConfigurationProfileSummary = ConfigurationProfileSummary'
  { -- | The URI location of the configuration.
    ConfigurationProfileSummary -> Maybe Text
locationUri :: Prelude.Maybe Prelude.Text,
    -- | The application ID.
    ConfigurationProfileSummary -> Maybe Text
applicationId :: Prelude.Maybe Prelude.Text,
    -- | The name of the configuration profile.
    ConfigurationProfileSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the configuration profile.
    ConfigurationProfileSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The types of validators in the configuration profile.
    ConfigurationProfileSummary -> Maybe [ValidatorType]
validatorTypes :: Prelude.Maybe [ValidatorType]
  }
  deriving (ConfigurationProfileSummary -> ConfigurationProfileSummary -> Bool
(ConfigurationProfileSummary
 -> ConfigurationProfileSummary -> Bool)
-> (ConfigurationProfileSummary
    -> ConfigurationProfileSummary -> Bool)
-> Eq ConfigurationProfileSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigurationProfileSummary -> ConfigurationProfileSummary -> Bool
$c/= :: ConfigurationProfileSummary -> ConfigurationProfileSummary -> Bool
== :: ConfigurationProfileSummary -> ConfigurationProfileSummary -> Bool
$c== :: ConfigurationProfileSummary -> ConfigurationProfileSummary -> Bool
Prelude.Eq, ReadPrec [ConfigurationProfileSummary]
ReadPrec ConfigurationProfileSummary
Int -> ReadS ConfigurationProfileSummary
ReadS [ConfigurationProfileSummary]
(Int -> ReadS ConfigurationProfileSummary)
-> ReadS [ConfigurationProfileSummary]
-> ReadPrec ConfigurationProfileSummary
-> ReadPrec [ConfigurationProfileSummary]
-> Read ConfigurationProfileSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigurationProfileSummary]
$creadListPrec :: ReadPrec [ConfigurationProfileSummary]
readPrec :: ReadPrec ConfigurationProfileSummary
$creadPrec :: ReadPrec ConfigurationProfileSummary
readList :: ReadS [ConfigurationProfileSummary]
$creadList :: ReadS [ConfigurationProfileSummary]
readsPrec :: Int -> ReadS ConfigurationProfileSummary
$creadsPrec :: Int -> ReadS ConfigurationProfileSummary
Prelude.Read, Int -> ConfigurationProfileSummary -> ShowS
[ConfigurationProfileSummary] -> ShowS
ConfigurationProfileSummary -> String
(Int -> ConfigurationProfileSummary -> ShowS)
-> (ConfigurationProfileSummary -> String)
-> ([ConfigurationProfileSummary] -> ShowS)
-> Show ConfigurationProfileSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigurationProfileSummary] -> ShowS
$cshowList :: [ConfigurationProfileSummary] -> ShowS
show :: ConfigurationProfileSummary -> String
$cshow :: ConfigurationProfileSummary -> String
showsPrec :: Int -> ConfigurationProfileSummary -> ShowS
$cshowsPrec :: Int -> ConfigurationProfileSummary -> ShowS
Prelude.Show, (forall x.
 ConfigurationProfileSummary -> Rep ConfigurationProfileSummary x)
-> (forall x.
    Rep ConfigurationProfileSummary x -> ConfigurationProfileSummary)
-> Generic ConfigurationProfileSummary
forall x.
Rep ConfigurationProfileSummary x -> ConfigurationProfileSummary
forall x.
ConfigurationProfileSummary -> Rep ConfigurationProfileSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ConfigurationProfileSummary x -> ConfigurationProfileSummary
$cfrom :: forall x.
ConfigurationProfileSummary -> Rep ConfigurationProfileSummary x
Prelude.Generic)

-- |
-- Create a value of 'ConfigurationProfileSummary' 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:
--
-- 'locationUri', 'configurationProfileSummary_locationUri' - The URI location of the configuration.
--
-- 'applicationId', 'configurationProfileSummary_applicationId' - The application ID.
--
-- 'name', 'configurationProfileSummary_name' - The name of the configuration profile.
--
-- 'id', 'configurationProfileSummary_id' - The ID of the configuration profile.
--
-- 'validatorTypes', 'configurationProfileSummary_validatorTypes' - The types of validators in the configuration profile.
newConfigurationProfileSummary ::
  ConfigurationProfileSummary
newConfigurationProfileSummary :: ConfigurationProfileSummary
newConfigurationProfileSummary =
  ConfigurationProfileSummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ValidatorType]
-> ConfigurationProfileSummary
ConfigurationProfileSummary'
    { $sel:locationUri:ConfigurationProfileSummary' :: Maybe Text
locationUri =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applicationId:ConfigurationProfileSummary' :: Maybe Text
applicationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ConfigurationProfileSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ConfigurationProfileSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:validatorTypes:ConfigurationProfileSummary' :: Maybe [ValidatorType]
validatorTypes = Maybe [ValidatorType]
forall a. Maybe a
Prelude.Nothing
    }

-- | The URI location of the configuration.
configurationProfileSummary_locationUri :: Lens.Lens' ConfigurationProfileSummary (Prelude.Maybe Prelude.Text)
configurationProfileSummary_locationUri :: (Maybe Text -> f (Maybe Text))
-> ConfigurationProfileSummary -> f ConfigurationProfileSummary
configurationProfileSummary_locationUri = (ConfigurationProfileSummary -> Maybe Text)
-> (ConfigurationProfileSummary
    -> Maybe Text -> ConfigurationProfileSummary)
-> Lens
     ConfigurationProfileSummary
     ConfigurationProfileSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationProfileSummary' {Maybe Text
locationUri :: Maybe Text
$sel:locationUri:ConfigurationProfileSummary' :: ConfigurationProfileSummary -> Maybe Text
locationUri} -> Maybe Text
locationUri) (\s :: ConfigurationProfileSummary
s@ConfigurationProfileSummary' {} Maybe Text
a -> ConfigurationProfileSummary
s {$sel:locationUri:ConfigurationProfileSummary' :: Maybe Text
locationUri = Maybe Text
a} :: ConfigurationProfileSummary)

-- | The application ID.
configurationProfileSummary_applicationId :: Lens.Lens' ConfigurationProfileSummary (Prelude.Maybe Prelude.Text)
configurationProfileSummary_applicationId :: (Maybe Text -> f (Maybe Text))
-> ConfigurationProfileSummary -> f ConfigurationProfileSummary
configurationProfileSummary_applicationId = (ConfigurationProfileSummary -> Maybe Text)
-> (ConfigurationProfileSummary
    -> Maybe Text -> ConfigurationProfileSummary)
-> Lens
     ConfigurationProfileSummary
     ConfigurationProfileSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationProfileSummary' {Maybe Text
applicationId :: Maybe Text
$sel:applicationId:ConfigurationProfileSummary' :: ConfigurationProfileSummary -> Maybe Text
applicationId} -> Maybe Text
applicationId) (\s :: ConfigurationProfileSummary
s@ConfigurationProfileSummary' {} Maybe Text
a -> ConfigurationProfileSummary
s {$sel:applicationId:ConfigurationProfileSummary' :: Maybe Text
applicationId = Maybe Text
a} :: ConfigurationProfileSummary)

-- | The name of the configuration profile.
configurationProfileSummary_name :: Lens.Lens' ConfigurationProfileSummary (Prelude.Maybe Prelude.Text)
configurationProfileSummary_name :: (Maybe Text -> f (Maybe Text))
-> ConfigurationProfileSummary -> f ConfigurationProfileSummary
configurationProfileSummary_name = (ConfigurationProfileSummary -> Maybe Text)
-> (ConfigurationProfileSummary
    -> Maybe Text -> ConfigurationProfileSummary)
-> Lens
     ConfigurationProfileSummary
     ConfigurationProfileSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationProfileSummary' {Maybe Text
name :: Maybe Text
$sel:name:ConfigurationProfileSummary' :: ConfigurationProfileSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ConfigurationProfileSummary
s@ConfigurationProfileSummary' {} Maybe Text
a -> ConfigurationProfileSummary
s {$sel:name:ConfigurationProfileSummary' :: Maybe Text
name = Maybe Text
a} :: ConfigurationProfileSummary)

-- | The ID of the configuration profile.
configurationProfileSummary_id :: Lens.Lens' ConfigurationProfileSummary (Prelude.Maybe Prelude.Text)
configurationProfileSummary_id :: (Maybe Text -> f (Maybe Text))
-> ConfigurationProfileSummary -> f ConfigurationProfileSummary
configurationProfileSummary_id = (ConfigurationProfileSummary -> Maybe Text)
-> (ConfigurationProfileSummary
    -> Maybe Text -> ConfigurationProfileSummary)
-> Lens
     ConfigurationProfileSummary
     ConfigurationProfileSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationProfileSummary' {Maybe Text
id :: Maybe Text
$sel:id:ConfigurationProfileSummary' :: ConfigurationProfileSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: ConfigurationProfileSummary
s@ConfigurationProfileSummary' {} Maybe Text
a -> ConfigurationProfileSummary
s {$sel:id:ConfigurationProfileSummary' :: Maybe Text
id = Maybe Text
a} :: ConfigurationProfileSummary)

-- | The types of validators in the configuration profile.
configurationProfileSummary_validatorTypes :: Lens.Lens' ConfigurationProfileSummary (Prelude.Maybe [ValidatorType])
configurationProfileSummary_validatorTypes :: (Maybe [ValidatorType] -> f (Maybe [ValidatorType]))
-> ConfigurationProfileSummary -> f ConfigurationProfileSummary
configurationProfileSummary_validatorTypes = (ConfigurationProfileSummary -> Maybe [ValidatorType])
-> (ConfigurationProfileSummary
    -> Maybe [ValidatorType] -> ConfigurationProfileSummary)
-> Lens
     ConfigurationProfileSummary
     ConfigurationProfileSummary
     (Maybe [ValidatorType])
     (Maybe [ValidatorType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigurationProfileSummary' {Maybe [ValidatorType]
validatorTypes :: Maybe [ValidatorType]
$sel:validatorTypes:ConfigurationProfileSummary' :: ConfigurationProfileSummary -> Maybe [ValidatorType]
validatorTypes} -> Maybe [ValidatorType]
validatorTypes) (\s :: ConfigurationProfileSummary
s@ConfigurationProfileSummary' {} Maybe [ValidatorType]
a -> ConfigurationProfileSummary
s {$sel:validatorTypes:ConfigurationProfileSummary' :: Maybe [ValidatorType]
validatorTypes = Maybe [ValidatorType]
a} :: ConfigurationProfileSummary) ((Maybe [ValidatorType] -> f (Maybe [ValidatorType]))
 -> ConfigurationProfileSummary -> f ConfigurationProfileSummary)
-> ((Maybe [ValidatorType] -> f (Maybe [ValidatorType]))
    -> Maybe [ValidatorType] -> f (Maybe [ValidatorType]))
-> (Maybe [ValidatorType] -> f (Maybe [ValidatorType]))
-> ConfigurationProfileSummary
-> f ConfigurationProfileSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ValidatorType] [ValidatorType] [ValidatorType] [ValidatorType]
-> Iso
     (Maybe [ValidatorType])
     (Maybe [ValidatorType])
     (Maybe [ValidatorType])
     (Maybe [ValidatorType])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ValidatorType] [ValidatorType] [ValidatorType] [ValidatorType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ConfigurationProfileSummary where
  parseJSON :: Value -> Parser ConfigurationProfileSummary
parseJSON =
    String
-> (Object -> Parser ConfigurationProfileSummary)
-> Value
-> Parser ConfigurationProfileSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ConfigurationProfileSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ValidatorType]
-> ConfigurationProfileSummary
ConfigurationProfileSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [ValidatorType]
 -> ConfigurationProfileSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ValidatorType]
      -> ConfigurationProfileSummary)
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
"LocationUri")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ValidatorType]
   -> ConfigurationProfileSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [ValidatorType]
      -> ConfigurationProfileSummary)
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
"ApplicationId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [ValidatorType]
   -> ConfigurationProfileSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [ValidatorType] -> ConfigurationProfileSummary)
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
"Name")
            Parser
  (Maybe Text
   -> Maybe [ValidatorType] -> ConfigurationProfileSummary)
-> Parser (Maybe Text)
-> Parser (Maybe [ValidatorType] -> ConfigurationProfileSummary)
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
"Id")
            Parser (Maybe [ValidatorType] -> ConfigurationProfileSummary)
-> Parser (Maybe [ValidatorType])
-> Parser ConfigurationProfileSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ValidatorType]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValidatorTypes"
                            Parser (Maybe (Maybe [ValidatorType]))
-> Maybe [ValidatorType] -> Parser (Maybe [ValidatorType])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ValidatorType]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable ConfigurationProfileSummary

instance Prelude.NFData ConfigurationProfileSummary