{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.CreateKeysAndCertificate
-- 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)
--
-- Creates a 2048-bit RSA key pair and issues an X.509 certificate using
-- the issued public key. You can also call @CreateKeysAndCertificate@ over
-- MQTT from a device, for more information, see
-- <https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api Provisioning MQTT API>.
--
-- __Note__ This is the only time IoT issues the private key for this
-- certificate, so it is important to keep it in a secure location.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions CreateKeysAndCertificate>
-- action.
module Amazonka.IoT.CreateKeysAndCertificate
  ( -- * Creating a Request
    CreateKeysAndCertificate (..),
    newCreateKeysAndCertificate,

    -- * Request Lenses
    createKeysAndCertificate_setAsActive,

    -- * Destructuring the Response
    CreateKeysAndCertificateResponse (..),
    newCreateKeysAndCertificateResponse,

    -- * Response Lenses
    createKeysAndCertificateResponse_keyPair,
    createKeysAndCertificateResponse_certificatePem,
    createKeysAndCertificateResponse_certificateArn,
    createKeysAndCertificateResponse_certificateId,
    createKeysAndCertificateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | The input for the CreateKeysAndCertificate operation.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions CreateKeysAndCertificateRequest>
-- action.
--
-- /See:/ 'newCreateKeysAndCertificate' smart constructor.
data CreateKeysAndCertificate = CreateKeysAndCertificate'
  { -- | Specifies whether the certificate is active.
    CreateKeysAndCertificate -> Maybe Bool
setAsActive :: Prelude.Maybe Prelude.Bool
  }
  deriving (CreateKeysAndCertificate -> CreateKeysAndCertificate -> Bool
(CreateKeysAndCertificate -> CreateKeysAndCertificate -> Bool)
-> (CreateKeysAndCertificate -> CreateKeysAndCertificate -> Bool)
-> Eq CreateKeysAndCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateKeysAndCertificate -> CreateKeysAndCertificate -> Bool
$c/= :: CreateKeysAndCertificate -> CreateKeysAndCertificate -> Bool
== :: CreateKeysAndCertificate -> CreateKeysAndCertificate -> Bool
$c== :: CreateKeysAndCertificate -> CreateKeysAndCertificate -> Bool
Prelude.Eq, ReadPrec [CreateKeysAndCertificate]
ReadPrec CreateKeysAndCertificate
Int -> ReadS CreateKeysAndCertificate
ReadS [CreateKeysAndCertificate]
(Int -> ReadS CreateKeysAndCertificate)
-> ReadS [CreateKeysAndCertificate]
-> ReadPrec CreateKeysAndCertificate
-> ReadPrec [CreateKeysAndCertificate]
-> Read CreateKeysAndCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateKeysAndCertificate]
$creadListPrec :: ReadPrec [CreateKeysAndCertificate]
readPrec :: ReadPrec CreateKeysAndCertificate
$creadPrec :: ReadPrec CreateKeysAndCertificate
readList :: ReadS [CreateKeysAndCertificate]
$creadList :: ReadS [CreateKeysAndCertificate]
readsPrec :: Int -> ReadS CreateKeysAndCertificate
$creadsPrec :: Int -> ReadS CreateKeysAndCertificate
Prelude.Read, Int -> CreateKeysAndCertificate -> ShowS
[CreateKeysAndCertificate] -> ShowS
CreateKeysAndCertificate -> String
(Int -> CreateKeysAndCertificate -> ShowS)
-> (CreateKeysAndCertificate -> String)
-> ([CreateKeysAndCertificate] -> ShowS)
-> Show CreateKeysAndCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateKeysAndCertificate] -> ShowS
$cshowList :: [CreateKeysAndCertificate] -> ShowS
show :: CreateKeysAndCertificate -> String
$cshow :: CreateKeysAndCertificate -> String
showsPrec :: Int -> CreateKeysAndCertificate -> ShowS
$cshowsPrec :: Int -> CreateKeysAndCertificate -> ShowS
Prelude.Show, (forall x.
 CreateKeysAndCertificate -> Rep CreateKeysAndCertificate x)
-> (forall x.
    Rep CreateKeysAndCertificate x -> CreateKeysAndCertificate)
-> Generic CreateKeysAndCertificate
forall x.
Rep CreateKeysAndCertificate x -> CreateKeysAndCertificate
forall x.
CreateKeysAndCertificate -> Rep CreateKeysAndCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateKeysAndCertificate x -> CreateKeysAndCertificate
$cfrom :: forall x.
CreateKeysAndCertificate -> Rep CreateKeysAndCertificate x
Prelude.Generic)

-- |
-- Create a value of 'CreateKeysAndCertificate' 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:
--
-- 'setAsActive', 'createKeysAndCertificate_setAsActive' - Specifies whether the certificate is active.
newCreateKeysAndCertificate ::
  CreateKeysAndCertificate
newCreateKeysAndCertificate :: CreateKeysAndCertificate
newCreateKeysAndCertificate =
  CreateKeysAndCertificate' :: Maybe Bool -> CreateKeysAndCertificate
CreateKeysAndCertificate'
    { $sel:setAsActive:CreateKeysAndCertificate' :: Maybe Bool
setAsActive =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies whether the certificate is active.
createKeysAndCertificate_setAsActive :: Lens.Lens' CreateKeysAndCertificate (Prelude.Maybe Prelude.Bool)
createKeysAndCertificate_setAsActive :: (Maybe Bool -> f (Maybe Bool))
-> CreateKeysAndCertificate -> f CreateKeysAndCertificate
createKeysAndCertificate_setAsActive = (CreateKeysAndCertificate -> Maybe Bool)
-> (CreateKeysAndCertificate
    -> Maybe Bool -> CreateKeysAndCertificate)
-> Lens
     CreateKeysAndCertificate
     CreateKeysAndCertificate
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateKeysAndCertificate' {Maybe Bool
setAsActive :: Maybe Bool
$sel:setAsActive:CreateKeysAndCertificate' :: CreateKeysAndCertificate -> Maybe Bool
setAsActive} -> Maybe Bool
setAsActive) (\s :: CreateKeysAndCertificate
s@CreateKeysAndCertificate' {} Maybe Bool
a -> CreateKeysAndCertificate
s {$sel:setAsActive:CreateKeysAndCertificate' :: Maybe Bool
setAsActive = Maybe Bool
a} :: CreateKeysAndCertificate)

instance Core.AWSRequest CreateKeysAndCertificate where
  type
    AWSResponse CreateKeysAndCertificate =
      CreateKeysAndCertificateResponse
  request :: CreateKeysAndCertificate -> Request CreateKeysAndCertificate
request = Service
-> CreateKeysAndCertificate -> Request CreateKeysAndCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateKeysAndCertificate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateKeysAndCertificate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateKeysAndCertificate))
-> Logger
-> Service
-> Proxy CreateKeysAndCertificate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateKeysAndCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe KeyPair
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateKeysAndCertificateResponse
CreateKeysAndCertificateResponse'
            (Maybe KeyPair
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Int
 -> CreateKeysAndCertificateResponse)
-> Either String (Maybe KeyPair)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Int
      -> CreateKeysAndCertificateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe KeyPair)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"keyPair")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Int
   -> CreateKeysAndCertificateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Int -> CreateKeysAndCertificateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"certificatePem")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Int -> CreateKeysAndCertificateResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateKeysAndCertificateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"certificateArn")
            Either
  String (Maybe Text -> Int -> CreateKeysAndCertificateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateKeysAndCertificateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"certificateId")
            Either String (Int -> CreateKeysAndCertificateResponse)
-> Either String Int
-> Either String CreateKeysAndCertificateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateKeysAndCertificate

instance Prelude.NFData CreateKeysAndCertificate

instance Core.ToHeaders CreateKeysAndCertificate where
  toHeaders :: CreateKeysAndCertificate -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateKeysAndCertificate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateKeysAndCertificate where
  toJSON :: CreateKeysAndCertificate -> Value
toJSON = Value -> CreateKeysAndCertificate -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)

instance Core.ToPath CreateKeysAndCertificate where
  toPath :: CreateKeysAndCertificate -> ByteString
toPath = ByteString -> CreateKeysAndCertificate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/keys-and-certificate"

instance Core.ToQuery CreateKeysAndCertificate where
  toQuery :: CreateKeysAndCertificate -> QueryString
toQuery CreateKeysAndCertificate' {Maybe Bool
setAsActive :: Maybe Bool
$sel:setAsActive:CreateKeysAndCertificate' :: CreateKeysAndCertificate -> Maybe Bool
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"setAsActive" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
setAsActive]

-- | The output of the CreateKeysAndCertificate operation.
--
-- /See:/ 'newCreateKeysAndCertificateResponse' smart constructor.
data CreateKeysAndCertificateResponse = CreateKeysAndCertificateResponse'
  { -- | The generated key pair.
    CreateKeysAndCertificateResponse -> Maybe KeyPair
keyPair :: Prelude.Maybe KeyPair,
    -- | The certificate data, in PEM format.
    CreateKeysAndCertificateResponse -> Maybe Text
certificatePem :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the certificate.
    CreateKeysAndCertificateResponse -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the certificate. IoT issues a default subject name for the
    -- certificate (for example, IoT Certificate).
    CreateKeysAndCertificateResponse -> Maybe Text
certificateId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateKeysAndCertificateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateKeysAndCertificateResponse
-> CreateKeysAndCertificateResponse -> Bool
(CreateKeysAndCertificateResponse
 -> CreateKeysAndCertificateResponse -> Bool)
-> (CreateKeysAndCertificateResponse
    -> CreateKeysAndCertificateResponse -> Bool)
-> Eq CreateKeysAndCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateKeysAndCertificateResponse
-> CreateKeysAndCertificateResponse -> Bool
$c/= :: CreateKeysAndCertificateResponse
-> CreateKeysAndCertificateResponse -> Bool
== :: CreateKeysAndCertificateResponse
-> CreateKeysAndCertificateResponse -> Bool
$c== :: CreateKeysAndCertificateResponse
-> CreateKeysAndCertificateResponse -> Bool
Prelude.Eq, Int -> CreateKeysAndCertificateResponse -> ShowS
[CreateKeysAndCertificateResponse] -> ShowS
CreateKeysAndCertificateResponse -> String
(Int -> CreateKeysAndCertificateResponse -> ShowS)
-> (CreateKeysAndCertificateResponse -> String)
-> ([CreateKeysAndCertificateResponse] -> ShowS)
-> Show CreateKeysAndCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateKeysAndCertificateResponse] -> ShowS
$cshowList :: [CreateKeysAndCertificateResponse] -> ShowS
show :: CreateKeysAndCertificateResponse -> String
$cshow :: CreateKeysAndCertificateResponse -> String
showsPrec :: Int -> CreateKeysAndCertificateResponse -> ShowS
$cshowsPrec :: Int -> CreateKeysAndCertificateResponse -> ShowS
Prelude.Show, (forall x.
 CreateKeysAndCertificateResponse
 -> Rep CreateKeysAndCertificateResponse x)
-> (forall x.
    Rep CreateKeysAndCertificateResponse x
    -> CreateKeysAndCertificateResponse)
-> Generic CreateKeysAndCertificateResponse
forall x.
Rep CreateKeysAndCertificateResponse x
-> CreateKeysAndCertificateResponse
forall x.
CreateKeysAndCertificateResponse
-> Rep CreateKeysAndCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateKeysAndCertificateResponse x
-> CreateKeysAndCertificateResponse
$cfrom :: forall x.
CreateKeysAndCertificateResponse
-> Rep CreateKeysAndCertificateResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateKeysAndCertificateResponse' 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:
--
-- 'keyPair', 'createKeysAndCertificateResponse_keyPair' - The generated key pair.
--
-- 'certificatePem', 'createKeysAndCertificateResponse_certificatePem' - The certificate data, in PEM format.
--
-- 'certificateArn', 'createKeysAndCertificateResponse_certificateArn' - The ARN of the certificate.
--
-- 'certificateId', 'createKeysAndCertificateResponse_certificateId' - The ID of the certificate. IoT issues a default subject name for the
-- certificate (for example, IoT Certificate).
--
-- 'httpStatus', 'createKeysAndCertificateResponse_httpStatus' - The response's http status code.
newCreateKeysAndCertificateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateKeysAndCertificateResponse
newCreateKeysAndCertificateResponse :: Int -> CreateKeysAndCertificateResponse
newCreateKeysAndCertificateResponse Int
pHttpStatus_ =
  CreateKeysAndCertificateResponse' :: Maybe KeyPair
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Int
-> CreateKeysAndCertificateResponse
CreateKeysAndCertificateResponse'
    { $sel:keyPair:CreateKeysAndCertificateResponse' :: Maybe KeyPair
keyPair =
        Maybe KeyPair
forall a. Maybe a
Prelude.Nothing,
      $sel:certificatePem:CreateKeysAndCertificateResponse' :: Maybe Text
certificatePem = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateArn:CreateKeysAndCertificateResponse' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateId:CreateKeysAndCertificateResponse' :: Maybe Text
certificateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateKeysAndCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The generated key pair.
createKeysAndCertificateResponse_keyPair :: Lens.Lens' CreateKeysAndCertificateResponse (Prelude.Maybe KeyPair)
createKeysAndCertificateResponse_keyPair :: (Maybe KeyPair -> f (Maybe KeyPair))
-> CreateKeysAndCertificateResponse
-> f CreateKeysAndCertificateResponse
createKeysAndCertificateResponse_keyPair = (CreateKeysAndCertificateResponse -> Maybe KeyPair)
-> (CreateKeysAndCertificateResponse
    -> Maybe KeyPair -> CreateKeysAndCertificateResponse)
-> Lens
     CreateKeysAndCertificateResponse
     CreateKeysAndCertificateResponse
     (Maybe KeyPair)
     (Maybe KeyPair)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateKeysAndCertificateResponse' {Maybe KeyPair
keyPair :: Maybe KeyPair
$sel:keyPair:CreateKeysAndCertificateResponse' :: CreateKeysAndCertificateResponse -> Maybe KeyPair
keyPair} -> Maybe KeyPair
keyPair) (\s :: CreateKeysAndCertificateResponse
s@CreateKeysAndCertificateResponse' {} Maybe KeyPair
a -> CreateKeysAndCertificateResponse
s {$sel:keyPair:CreateKeysAndCertificateResponse' :: Maybe KeyPair
keyPair = Maybe KeyPair
a} :: CreateKeysAndCertificateResponse)

-- | The certificate data, in PEM format.
createKeysAndCertificateResponse_certificatePem :: Lens.Lens' CreateKeysAndCertificateResponse (Prelude.Maybe Prelude.Text)
createKeysAndCertificateResponse_certificatePem :: (Maybe Text -> f (Maybe Text))
-> CreateKeysAndCertificateResponse
-> f CreateKeysAndCertificateResponse
createKeysAndCertificateResponse_certificatePem = (CreateKeysAndCertificateResponse -> Maybe Text)
-> (CreateKeysAndCertificateResponse
    -> Maybe Text -> CreateKeysAndCertificateResponse)
-> Lens
     CreateKeysAndCertificateResponse
     CreateKeysAndCertificateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateKeysAndCertificateResponse' {Maybe Text
certificatePem :: Maybe Text
$sel:certificatePem:CreateKeysAndCertificateResponse' :: CreateKeysAndCertificateResponse -> Maybe Text
certificatePem} -> Maybe Text
certificatePem) (\s :: CreateKeysAndCertificateResponse
s@CreateKeysAndCertificateResponse' {} Maybe Text
a -> CreateKeysAndCertificateResponse
s {$sel:certificatePem:CreateKeysAndCertificateResponse' :: Maybe Text
certificatePem = Maybe Text
a} :: CreateKeysAndCertificateResponse)

-- | The ARN of the certificate.
createKeysAndCertificateResponse_certificateArn :: Lens.Lens' CreateKeysAndCertificateResponse (Prelude.Maybe Prelude.Text)
createKeysAndCertificateResponse_certificateArn :: (Maybe Text -> f (Maybe Text))
-> CreateKeysAndCertificateResponse
-> f CreateKeysAndCertificateResponse
createKeysAndCertificateResponse_certificateArn = (CreateKeysAndCertificateResponse -> Maybe Text)
-> (CreateKeysAndCertificateResponse
    -> Maybe Text -> CreateKeysAndCertificateResponse)
-> Lens
     CreateKeysAndCertificateResponse
     CreateKeysAndCertificateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateKeysAndCertificateResponse' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:CreateKeysAndCertificateResponse' :: CreateKeysAndCertificateResponse -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: CreateKeysAndCertificateResponse
s@CreateKeysAndCertificateResponse' {} Maybe Text
a -> CreateKeysAndCertificateResponse
s {$sel:certificateArn:CreateKeysAndCertificateResponse' :: Maybe Text
certificateArn = Maybe Text
a} :: CreateKeysAndCertificateResponse)

-- | The ID of the certificate. IoT issues a default subject name for the
-- certificate (for example, IoT Certificate).
createKeysAndCertificateResponse_certificateId :: Lens.Lens' CreateKeysAndCertificateResponse (Prelude.Maybe Prelude.Text)
createKeysAndCertificateResponse_certificateId :: (Maybe Text -> f (Maybe Text))
-> CreateKeysAndCertificateResponse
-> f CreateKeysAndCertificateResponse
createKeysAndCertificateResponse_certificateId = (CreateKeysAndCertificateResponse -> Maybe Text)
-> (CreateKeysAndCertificateResponse
    -> Maybe Text -> CreateKeysAndCertificateResponse)
-> Lens
     CreateKeysAndCertificateResponse
     CreateKeysAndCertificateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateKeysAndCertificateResponse' {Maybe Text
certificateId :: Maybe Text
$sel:certificateId:CreateKeysAndCertificateResponse' :: CreateKeysAndCertificateResponse -> Maybe Text
certificateId} -> Maybe Text
certificateId) (\s :: CreateKeysAndCertificateResponse
s@CreateKeysAndCertificateResponse' {} Maybe Text
a -> CreateKeysAndCertificateResponse
s {$sel:certificateId:CreateKeysAndCertificateResponse' :: Maybe Text
certificateId = Maybe Text
a} :: CreateKeysAndCertificateResponse)

-- | The response's http status code.
createKeysAndCertificateResponse_httpStatus :: Lens.Lens' CreateKeysAndCertificateResponse Prelude.Int
createKeysAndCertificateResponse_httpStatus :: (Int -> f Int)
-> CreateKeysAndCertificateResponse
-> f CreateKeysAndCertificateResponse
createKeysAndCertificateResponse_httpStatus = (CreateKeysAndCertificateResponse -> Int)
-> (CreateKeysAndCertificateResponse
    -> Int -> CreateKeysAndCertificateResponse)
-> Lens
     CreateKeysAndCertificateResponse
     CreateKeysAndCertificateResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateKeysAndCertificateResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateKeysAndCertificateResponse' :: CreateKeysAndCertificateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateKeysAndCertificateResponse
s@CreateKeysAndCertificateResponse' {} Int
a -> CreateKeysAndCertificateResponse
s {$sel:httpStatus:CreateKeysAndCertificateResponse' :: Int
httpStatus = Int
a} :: CreateKeysAndCertificateResponse)

instance
  Prelude.NFData
    CreateKeysAndCertificateResponse