{-# 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.SigningProfileParameter
-- 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.SigningProfileParameter where

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

-- | Describes the code-signing profile.
--
-- /See:/ 'newSigningProfileParameter' smart constructor.
data SigningProfileParameter = SigningProfileParameter'
  { -- | The hardware platform of your device.
    SigningProfileParameter -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
    -- | Certificate ARN.
    SigningProfileParameter -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The location of the code-signing certificate on your device.
    SigningProfileParameter -> Maybe Text
certificatePathOnDevice :: Prelude.Maybe Prelude.Text
  }
  deriving (SigningProfileParameter -> SigningProfileParameter -> Bool
(SigningProfileParameter -> SigningProfileParameter -> Bool)
-> (SigningProfileParameter -> SigningProfileParameter -> Bool)
-> Eq SigningProfileParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SigningProfileParameter -> SigningProfileParameter -> Bool
$c/= :: SigningProfileParameter -> SigningProfileParameter -> Bool
== :: SigningProfileParameter -> SigningProfileParameter -> Bool
$c== :: SigningProfileParameter -> SigningProfileParameter -> Bool
Prelude.Eq, ReadPrec [SigningProfileParameter]
ReadPrec SigningProfileParameter
Int -> ReadS SigningProfileParameter
ReadS [SigningProfileParameter]
(Int -> ReadS SigningProfileParameter)
-> ReadS [SigningProfileParameter]
-> ReadPrec SigningProfileParameter
-> ReadPrec [SigningProfileParameter]
-> Read SigningProfileParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SigningProfileParameter]
$creadListPrec :: ReadPrec [SigningProfileParameter]
readPrec :: ReadPrec SigningProfileParameter
$creadPrec :: ReadPrec SigningProfileParameter
readList :: ReadS [SigningProfileParameter]
$creadList :: ReadS [SigningProfileParameter]
readsPrec :: Int -> ReadS SigningProfileParameter
$creadsPrec :: Int -> ReadS SigningProfileParameter
Prelude.Read, Int -> SigningProfileParameter -> ShowS
[SigningProfileParameter] -> ShowS
SigningProfileParameter -> String
(Int -> SigningProfileParameter -> ShowS)
-> (SigningProfileParameter -> String)
-> ([SigningProfileParameter] -> ShowS)
-> Show SigningProfileParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SigningProfileParameter] -> ShowS
$cshowList :: [SigningProfileParameter] -> ShowS
show :: SigningProfileParameter -> String
$cshow :: SigningProfileParameter -> String
showsPrec :: Int -> SigningProfileParameter -> ShowS
$cshowsPrec :: Int -> SigningProfileParameter -> ShowS
Prelude.Show, (forall x.
 SigningProfileParameter -> Rep SigningProfileParameter x)
-> (forall x.
    Rep SigningProfileParameter x -> SigningProfileParameter)
-> Generic SigningProfileParameter
forall x. Rep SigningProfileParameter x -> SigningProfileParameter
forall x. SigningProfileParameter -> Rep SigningProfileParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SigningProfileParameter x -> SigningProfileParameter
$cfrom :: forall x. SigningProfileParameter -> Rep SigningProfileParameter x
Prelude.Generic)

-- |
-- Create a value of 'SigningProfileParameter' 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:
--
-- 'platform', 'signingProfileParameter_platform' - The hardware platform of your device.
--
-- 'certificateArn', 'signingProfileParameter_certificateArn' - Certificate ARN.
--
-- 'certificatePathOnDevice', 'signingProfileParameter_certificatePathOnDevice' - The location of the code-signing certificate on your device.
newSigningProfileParameter ::
  SigningProfileParameter
newSigningProfileParameter :: SigningProfileParameter
newSigningProfileParameter =
  SigningProfileParameter' :: Maybe Text -> Maybe Text -> Maybe Text -> SigningProfileParameter
SigningProfileParameter'
    { $sel:platform:SigningProfileParameter' :: Maybe Text
platform =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:SigningProfileParameter' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificatePathOnDevice:SigningProfileParameter' :: Maybe Text
certificatePathOnDevice = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The hardware platform of your device.
signingProfileParameter_platform :: Lens.Lens' SigningProfileParameter (Prelude.Maybe Prelude.Text)
signingProfileParameter_platform :: (Maybe Text -> f (Maybe Text))
-> SigningProfileParameter -> f SigningProfileParameter
signingProfileParameter_platform = (SigningProfileParameter -> Maybe Text)
-> (SigningProfileParameter
    -> Maybe Text -> SigningProfileParameter)
-> Lens
     SigningProfileParameter
     SigningProfileParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningProfileParameter' {Maybe Text
platform :: Maybe Text
$sel:platform:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
platform} -> Maybe Text
platform) (\s :: SigningProfileParameter
s@SigningProfileParameter' {} Maybe Text
a -> SigningProfileParameter
s {$sel:platform:SigningProfileParameter' :: Maybe Text
platform = Maybe Text
a} :: SigningProfileParameter)

-- | Certificate ARN.
signingProfileParameter_certificateArn :: Lens.Lens' SigningProfileParameter (Prelude.Maybe Prelude.Text)
signingProfileParameter_certificateArn :: (Maybe Text -> f (Maybe Text))
-> SigningProfileParameter -> f SigningProfileParameter
signingProfileParameter_certificateArn = (SigningProfileParameter -> Maybe Text)
-> (SigningProfileParameter
    -> Maybe Text -> SigningProfileParameter)
-> Lens
     SigningProfileParameter
     SigningProfileParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningProfileParameter' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: SigningProfileParameter
s@SigningProfileParameter' {} Maybe Text
a -> SigningProfileParameter
s {$sel:certificateArn:SigningProfileParameter' :: Maybe Text
certificateArn = Maybe Text
a} :: SigningProfileParameter)

-- | The location of the code-signing certificate on your device.
signingProfileParameter_certificatePathOnDevice :: Lens.Lens' SigningProfileParameter (Prelude.Maybe Prelude.Text)
signingProfileParameter_certificatePathOnDevice :: (Maybe Text -> f (Maybe Text))
-> SigningProfileParameter -> f SigningProfileParameter
signingProfileParameter_certificatePathOnDevice = (SigningProfileParameter -> Maybe Text)
-> (SigningProfileParameter
    -> Maybe Text -> SigningProfileParameter)
-> Lens
     SigningProfileParameter
     SigningProfileParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SigningProfileParameter' {Maybe Text
certificatePathOnDevice :: Maybe Text
$sel:certificatePathOnDevice:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
certificatePathOnDevice} -> Maybe Text
certificatePathOnDevice) (\s :: SigningProfileParameter
s@SigningProfileParameter' {} Maybe Text
a -> SigningProfileParameter
s {$sel:certificatePathOnDevice:SigningProfileParameter' :: Maybe Text
certificatePathOnDevice = Maybe Text
a} :: SigningProfileParameter)

instance Core.FromJSON SigningProfileParameter where
  parseJSON :: Value -> Parser SigningProfileParameter
parseJSON =
    String
-> (Object -> Parser SigningProfileParameter)
-> Value
-> Parser SigningProfileParameter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SigningProfileParameter"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> SigningProfileParameter
SigningProfileParameter'
            (Maybe Text -> Maybe Text -> Maybe Text -> SigningProfileParameter)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> SigningProfileParameter)
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
"platform")
            Parser (Maybe Text -> Maybe Text -> SigningProfileParameter)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> SigningProfileParameter)
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
"certificateArn")
            Parser (Maybe Text -> SigningProfileParameter)
-> Parser (Maybe Text) -> Parser SigningProfileParameter
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
"certificatePathOnDevice")
      )

instance Prelude.Hashable SigningProfileParameter

instance Prelude.NFData SigningProfileParameter

instance Core.ToJSON SigningProfileParameter where
  toJSON :: SigningProfileParameter -> Value
toJSON SigningProfileParameter' {Maybe Text
certificatePathOnDevice :: Maybe Text
certificateArn :: Maybe Text
platform :: Maybe Text
$sel:certificatePathOnDevice:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
$sel:certificateArn:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
$sel:platform:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"platform" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
platform,
            (Text
"certificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateArn,
            (Text
"certificatePathOnDevice" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificatePathOnDevice
          ]
      )