{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoT.Types.SigningProfileParameter 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

-- | Describes the code-signing profile.
--
-- /See:/ 'newSigningProfileParameter' smart constructor.
data SigningProfileParameter = SigningProfileParameter'
  { -- | 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,
    -- | The hardware platform of your device.
    SigningProfileParameter -> Maybe Text
platform :: Prelude.Maybe Prelude.Text
  }
  deriving (SigningProfileParameter -> SigningProfileParameter -> Bool
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]
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
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. 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:
--
-- 'certificateArn', 'signingProfileParameter_certificateArn' - Certificate ARN.
--
-- 'certificatePathOnDevice', 'signingProfileParameter_certificatePathOnDevice' - The location of the code-signing certificate on your device.
--
-- 'platform', 'signingProfileParameter_platform' - The hardware platform of your device.
newSigningProfileParameter ::
  SigningProfileParameter
newSigningProfileParameter :: SigningProfileParameter
newSigningProfileParameter =
  SigningProfileParameter'
    { $sel:certificateArn:SigningProfileParameter' :: Maybe Text
certificateArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:certificatePathOnDevice:SigningProfileParameter' :: Maybe Text
certificatePathOnDevice = forall a. Maybe a
Prelude.Nothing,
      $sel:platform:SigningProfileParameter' :: Maybe Text
platform = forall a. Maybe a
Prelude.Nothing
    }

-- | Certificate ARN.
signingProfileParameter_certificateArn :: Lens.Lens' SigningProfileParameter (Prelude.Maybe Prelude.Text)
signingProfileParameter_certificateArn :: Lens' SigningProfileParameter (Maybe Text)
signingProfileParameter_certificateArn = 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 :: Lens' SigningProfileParameter (Maybe Text)
signingProfileParameter_certificatePathOnDevice = 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)

-- | The hardware platform of your device.
signingProfileParameter_platform :: Lens.Lens' SigningProfileParameter (Prelude.Maybe Prelude.Text)
signingProfileParameter_platform :: Lens' SigningProfileParameter (Maybe Text)
signingProfileParameter_platform = 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)

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

instance Prelude.Hashable SigningProfileParameter where
  hashWithSalt :: Int -> SigningProfileParameter -> Int
hashWithSalt Int
_salt SigningProfileParameter' {Maybe Text
platform :: Maybe Text
certificatePathOnDevice :: Maybe Text
certificateArn :: Maybe Text
$sel:platform:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
$sel:certificatePathOnDevice:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
$sel:certificateArn:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
certificatePathOnDevice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platform

instance Prelude.NFData SigningProfileParameter where
  rnf :: SigningProfileParameter -> ()
rnf SigningProfileParameter' {Maybe Text
platform :: Maybe Text
certificatePathOnDevice :: Maybe Text
certificateArn :: Maybe Text
$sel:platform:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
$sel:certificatePathOnDevice:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
$sel:certificateArn:SigningProfileParameter' :: SigningProfileParameter -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
certificatePathOnDevice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platform

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