{-# 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.Signer.Types.SignedObject
-- 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.Signer.Types.SignedObject where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Signer.Types.S3SignedObject

-- | Points to an @S3SignedObject@ object that contains information about
-- your signed code image.
--
-- /See:/ 'newSignedObject' smart constructor.
data SignedObject = SignedObject'
  { -- | The @S3SignedObject@.
    SignedObject -> Maybe S3SignedObject
s3 :: Prelude.Maybe S3SignedObject
  }
  deriving (SignedObject -> SignedObject -> Bool
(SignedObject -> SignedObject -> Bool)
-> (SignedObject -> SignedObject -> Bool) -> Eq SignedObject
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SignedObject -> SignedObject -> Bool
$c/= :: SignedObject -> SignedObject -> Bool
== :: SignedObject -> SignedObject -> Bool
$c== :: SignedObject -> SignedObject -> Bool
Prelude.Eq, ReadPrec [SignedObject]
ReadPrec SignedObject
Int -> ReadS SignedObject
ReadS [SignedObject]
(Int -> ReadS SignedObject)
-> ReadS [SignedObject]
-> ReadPrec SignedObject
-> ReadPrec [SignedObject]
-> Read SignedObject
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SignedObject]
$creadListPrec :: ReadPrec [SignedObject]
readPrec :: ReadPrec SignedObject
$creadPrec :: ReadPrec SignedObject
readList :: ReadS [SignedObject]
$creadList :: ReadS [SignedObject]
readsPrec :: Int -> ReadS SignedObject
$creadsPrec :: Int -> ReadS SignedObject
Prelude.Read, Int -> SignedObject -> ShowS
[SignedObject] -> ShowS
SignedObject -> String
(Int -> SignedObject -> ShowS)
-> (SignedObject -> String)
-> ([SignedObject] -> ShowS)
-> Show SignedObject
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SignedObject] -> ShowS
$cshowList :: [SignedObject] -> ShowS
show :: SignedObject -> String
$cshow :: SignedObject -> String
showsPrec :: Int -> SignedObject -> ShowS
$cshowsPrec :: Int -> SignedObject -> ShowS
Prelude.Show, (forall x. SignedObject -> Rep SignedObject x)
-> (forall x. Rep SignedObject x -> SignedObject)
-> Generic SignedObject
forall x. Rep SignedObject x -> SignedObject
forall x. SignedObject -> Rep SignedObject x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SignedObject x -> SignedObject
$cfrom :: forall x. SignedObject -> Rep SignedObject x
Prelude.Generic)

-- |
-- Create a value of 'SignedObject' 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:
--
-- 's3', 'signedObject_s3' - The @S3SignedObject@.
newSignedObject ::
  SignedObject
newSignedObject :: SignedObject
newSignedObject = SignedObject' :: Maybe S3SignedObject -> SignedObject
SignedObject' {$sel:s3:SignedObject' :: Maybe S3SignedObject
s3 = Maybe S3SignedObject
forall a. Maybe a
Prelude.Nothing}

-- | The @S3SignedObject@.
signedObject_s3 :: Lens.Lens' SignedObject (Prelude.Maybe S3SignedObject)
signedObject_s3 :: (Maybe S3SignedObject -> f (Maybe S3SignedObject))
-> SignedObject -> f SignedObject
signedObject_s3 = (SignedObject -> Maybe S3SignedObject)
-> (SignedObject -> Maybe S3SignedObject -> SignedObject)
-> Lens
     SignedObject
     SignedObject
     (Maybe S3SignedObject)
     (Maybe S3SignedObject)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SignedObject' {Maybe S3SignedObject
s3 :: Maybe S3SignedObject
$sel:s3:SignedObject' :: SignedObject -> Maybe S3SignedObject
s3} -> Maybe S3SignedObject
s3) (\s :: SignedObject
s@SignedObject' {} Maybe S3SignedObject
a -> SignedObject
s {$sel:s3:SignedObject' :: Maybe S3SignedObject
s3 = Maybe S3SignedObject
a} :: SignedObject)

instance Core.FromJSON SignedObject where
  parseJSON :: Value -> Parser SignedObject
parseJSON =
    String
-> (Object -> Parser SignedObject) -> Value -> Parser SignedObject
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SignedObject"
      (\Object
x -> Maybe S3SignedObject -> SignedObject
SignedObject' (Maybe S3SignedObject -> SignedObject)
-> Parser (Maybe S3SignedObject) -> Parser SignedObject
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3SignedObject)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"s3"))

instance Prelude.Hashable SignedObject

instance Prelude.NFData SignedObject