{-# 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.Lightsail.CreateCertificate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an SSL\/TLS certificate for an Amazon Lightsail content delivery
-- network (CDN) distribution and a container service.
--
-- After the certificate is valid, use the
-- @AttachCertificateToDistribution@ action to use the certificate and its
-- domains with your distribution. Or use the @UpdateContainerService@
-- action to use the certificate and its domains with your container
-- service.
--
-- Only certificates created in the @us-east-1@ Amazon Web Services Region
-- can be attached to Lightsail distributions. Lightsail distributions are
-- global resources that can reference an origin in any Amazon Web Services
-- Region, and distribute its content globally. However, all distributions
-- are located in the @us-east-1@ Region.
module Amazonka.Lightsail.CreateCertificate
  ( -- * Creating a Request
    CreateCertificate (..),
    newCreateCertificate,

    -- * Request Lenses
    createCertificate_subjectAlternativeNames,
    createCertificate_tags,
    createCertificate_certificateName,
    createCertificate_domainName,

    -- * Destructuring the Response
    CreateCertificateResponse (..),
    newCreateCertificateResponse,

    -- * Response Lenses
    createCertificateResponse_certificate,
    createCertificateResponse_operations,
    createCertificateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateCertificate' smart constructor.
data CreateCertificate = CreateCertificate'
  { -- | An array of strings that specify the alternate domains (e.g.,
    -- @example2.com@) and subdomains (e.g., @blog.example.com@) for the
    -- certificate.
    --
    -- You can specify a maximum of nine alternate domains (in addition to the
    -- primary domain name).
    --
    -- Wildcard domain entries (e.g., @*.example.com@) are not supported.
    CreateCertificate -> Maybe [Text]
subjectAlternativeNames :: Prelude.Maybe [Prelude.Text],
    -- | The tag keys and optional values to add to the certificate during
    -- create.
    --
    -- Use the @TagResource@ action to tag a resource after it\'s created.
    CreateCertificate -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name for the certificate.
    CreateCertificate -> Text
certificateName :: Prelude.Text,
    -- | The domain name (e.g., @example.com@) for the certificate.
    CreateCertificate -> Text
domainName :: Prelude.Text
  }
  deriving (CreateCertificate -> CreateCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCertificate -> CreateCertificate -> Bool
$c/= :: CreateCertificate -> CreateCertificate -> Bool
== :: CreateCertificate -> CreateCertificate -> Bool
$c== :: CreateCertificate -> CreateCertificate -> Bool
Prelude.Eq, ReadPrec [CreateCertificate]
ReadPrec CreateCertificate
Int -> ReadS CreateCertificate
ReadS [CreateCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCertificate]
$creadListPrec :: ReadPrec [CreateCertificate]
readPrec :: ReadPrec CreateCertificate
$creadPrec :: ReadPrec CreateCertificate
readList :: ReadS [CreateCertificate]
$creadList :: ReadS [CreateCertificate]
readsPrec :: Int -> ReadS CreateCertificate
$creadsPrec :: Int -> ReadS CreateCertificate
Prelude.Read, Int -> CreateCertificate -> ShowS
[CreateCertificate] -> ShowS
CreateCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCertificate] -> ShowS
$cshowList :: [CreateCertificate] -> ShowS
show :: CreateCertificate -> String
$cshow :: CreateCertificate -> String
showsPrec :: Int -> CreateCertificate -> ShowS
$cshowsPrec :: Int -> CreateCertificate -> ShowS
Prelude.Show, forall x. Rep CreateCertificate x -> CreateCertificate
forall x. CreateCertificate -> Rep CreateCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateCertificate x -> CreateCertificate
$cfrom :: forall x. CreateCertificate -> Rep CreateCertificate x
Prelude.Generic)

-- |
-- Create a value of 'CreateCertificate' 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:
--
-- 'subjectAlternativeNames', 'createCertificate_subjectAlternativeNames' - An array of strings that specify the alternate domains (e.g.,
-- @example2.com@) and subdomains (e.g., @blog.example.com@) for the
-- certificate.
--
-- You can specify a maximum of nine alternate domains (in addition to the
-- primary domain name).
--
-- Wildcard domain entries (e.g., @*.example.com@) are not supported.
--
-- 'tags', 'createCertificate_tags' - The tag keys and optional values to add to the certificate during
-- create.
--
-- Use the @TagResource@ action to tag a resource after it\'s created.
--
-- 'certificateName', 'createCertificate_certificateName' - The name for the certificate.
--
-- 'domainName', 'createCertificate_domainName' - The domain name (e.g., @example.com@) for the certificate.
newCreateCertificate ::
  -- | 'certificateName'
  Prelude.Text ->
  -- | 'domainName'
  Prelude.Text ->
  CreateCertificate
newCreateCertificate :: Text -> Text -> CreateCertificate
newCreateCertificate Text
pCertificateName_ Text
pDomainName_ =
  CreateCertificate'
    { $sel:subjectAlternativeNames:CreateCertificate' :: Maybe [Text]
subjectAlternativeNames =
        forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateCertificate' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:certificateName:CreateCertificate' :: Text
certificateName = Text
pCertificateName_,
      $sel:domainName:CreateCertificate' :: Text
domainName = Text
pDomainName_
    }

-- | An array of strings that specify the alternate domains (e.g.,
-- @example2.com@) and subdomains (e.g., @blog.example.com@) for the
-- certificate.
--
-- You can specify a maximum of nine alternate domains (in addition to the
-- primary domain name).
--
-- Wildcard domain entries (e.g., @*.example.com@) are not supported.
createCertificate_subjectAlternativeNames :: Lens.Lens' CreateCertificate (Prelude.Maybe [Prelude.Text])
createCertificate_subjectAlternativeNames :: Lens' CreateCertificate (Maybe [Text])
createCertificate_subjectAlternativeNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificate' {Maybe [Text]
subjectAlternativeNames :: Maybe [Text]
$sel:subjectAlternativeNames:CreateCertificate' :: CreateCertificate -> Maybe [Text]
subjectAlternativeNames} -> Maybe [Text]
subjectAlternativeNames) (\s :: CreateCertificate
s@CreateCertificate' {} Maybe [Text]
a -> CreateCertificate
s {$sel:subjectAlternativeNames:CreateCertificate' :: Maybe [Text]
subjectAlternativeNames = Maybe [Text]
a} :: CreateCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tag keys and optional values to add to the certificate during
-- create.
--
-- Use the @TagResource@ action to tag a resource after it\'s created.
createCertificate_tags :: Lens.Lens' CreateCertificate (Prelude.Maybe [Tag])
createCertificate_tags :: Lens' CreateCertificate (Maybe [Tag])
createCertificate_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificate' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateCertificate' :: CreateCertificate -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateCertificate
s@CreateCertificate' {} Maybe [Tag]
a -> CreateCertificate
s {$sel:tags:CreateCertificate' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateCertificate) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name for the certificate.
createCertificate_certificateName :: Lens.Lens' CreateCertificate Prelude.Text
createCertificate_certificateName :: Lens' CreateCertificate Text
createCertificate_certificateName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificate' {Text
certificateName :: Text
$sel:certificateName:CreateCertificate' :: CreateCertificate -> Text
certificateName} -> Text
certificateName) (\s :: CreateCertificate
s@CreateCertificate' {} Text
a -> CreateCertificate
s {$sel:certificateName:CreateCertificate' :: Text
certificateName = Text
a} :: CreateCertificate)

-- | The domain name (e.g., @example.com@) for the certificate.
createCertificate_domainName :: Lens.Lens' CreateCertificate Prelude.Text
createCertificate_domainName :: Lens' CreateCertificate Text
createCertificate_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificate' {Text
domainName :: Text
$sel:domainName:CreateCertificate' :: CreateCertificate -> Text
domainName} -> Text
domainName) (\s :: CreateCertificate
s@CreateCertificate' {} Text
a -> CreateCertificate
s {$sel:domainName:CreateCertificate' :: Text
domainName = Text
a} :: CreateCertificate)

instance Core.AWSRequest CreateCertificate where
  type
    AWSResponse CreateCertificate =
      CreateCertificateResponse
  request :: (Service -> Service)
-> CreateCertificate -> Request CreateCertificate
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateCertificate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateCertificate)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe CertificateSummary
-> Maybe [Operation] -> Int -> CreateCertificateResponse
CreateCertificateResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"certificate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"operations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateCertificate where
  hashWithSalt :: Int -> CreateCertificate -> Int
hashWithSalt Int
_salt CreateCertificate' {Maybe [Text]
Maybe [Tag]
Text
domainName :: Text
certificateName :: Text
tags :: Maybe [Tag]
subjectAlternativeNames :: Maybe [Text]
$sel:domainName:CreateCertificate' :: CreateCertificate -> Text
$sel:certificateName:CreateCertificate' :: CreateCertificate -> Text
$sel:tags:CreateCertificate' :: CreateCertificate -> Maybe [Tag]
$sel:subjectAlternativeNames:CreateCertificate' :: CreateCertificate -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subjectAlternativeNames
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
domainName

instance Prelude.NFData CreateCertificate where
  rnf :: CreateCertificate -> ()
rnf CreateCertificate' {Maybe [Text]
Maybe [Tag]
Text
domainName :: Text
certificateName :: Text
tags :: Maybe [Tag]
subjectAlternativeNames :: Maybe [Text]
$sel:domainName:CreateCertificate' :: CreateCertificate -> Text
$sel:certificateName:CreateCertificate' :: CreateCertificate -> Text
$sel:tags:CreateCertificate' :: CreateCertificate -> Maybe [Tag]
$sel:subjectAlternativeNames:CreateCertificate' :: CreateCertificate -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subjectAlternativeNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
certificateName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
domainName

instance Data.ToHeaders CreateCertificate where
  toHeaders :: CreateCertificate -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.CreateCertificate" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON CreateCertificate where
  toJSON :: CreateCertificate -> Value
toJSON CreateCertificate' {Maybe [Text]
Maybe [Tag]
Text
domainName :: Text
certificateName :: Text
tags :: Maybe [Tag]
subjectAlternativeNames :: Maybe [Text]
$sel:domainName:CreateCertificate' :: CreateCertificate -> Text
$sel:certificateName:CreateCertificate' :: CreateCertificate -> Text
$sel:tags:CreateCertificate' :: CreateCertificate -> Maybe [Tag]
$sel:subjectAlternativeNames:CreateCertificate' :: CreateCertificate -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"subjectAlternativeNames" 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]
subjectAlternativeNames,
            (Key
"tags" 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 [Tag]
tags,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"certificateName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificateName),
            forall a. a -> Maybe a
Prelude.Just (Key
"domainName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
domainName)
          ]
      )

instance Data.ToPath CreateCertificate where
  toPath :: CreateCertificate -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery CreateCertificate where
  toQuery :: CreateCertificate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateCertificateResponse' smart constructor.
data CreateCertificateResponse = CreateCertificateResponse'
  { -- | An object that describes the certificate created.
    CreateCertificateResponse -> Maybe CertificateSummary
certificate :: Prelude.Maybe CertificateSummary,
    -- | An array of objects that describe the result of the action, such as the
    -- status of the request, the timestamp of the request, and the resources
    -- affected by the request.
    CreateCertificateResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
    -- | The response's http status code.
    CreateCertificateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateCertificateResponse -> CreateCertificateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateCertificateResponse -> CreateCertificateResponse -> Bool
$c/= :: CreateCertificateResponse -> CreateCertificateResponse -> Bool
== :: CreateCertificateResponse -> CreateCertificateResponse -> Bool
$c== :: CreateCertificateResponse -> CreateCertificateResponse -> Bool
Prelude.Eq, ReadPrec [CreateCertificateResponse]
ReadPrec CreateCertificateResponse
Int -> ReadS CreateCertificateResponse
ReadS [CreateCertificateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateCertificateResponse]
$creadListPrec :: ReadPrec [CreateCertificateResponse]
readPrec :: ReadPrec CreateCertificateResponse
$creadPrec :: ReadPrec CreateCertificateResponse
readList :: ReadS [CreateCertificateResponse]
$creadList :: ReadS [CreateCertificateResponse]
readsPrec :: Int -> ReadS CreateCertificateResponse
$creadsPrec :: Int -> ReadS CreateCertificateResponse
Prelude.Read, Int -> CreateCertificateResponse -> ShowS
[CreateCertificateResponse] -> ShowS
CreateCertificateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateCertificateResponse] -> ShowS
$cshowList :: [CreateCertificateResponse] -> ShowS
show :: CreateCertificateResponse -> String
$cshow :: CreateCertificateResponse -> String
showsPrec :: Int -> CreateCertificateResponse -> ShowS
$cshowsPrec :: Int -> CreateCertificateResponse -> ShowS
Prelude.Show, forall x.
Rep CreateCertificateResponse x -> CreateCertificateResponse
forall x.
CreateCertificateResponse -> Rep CreateCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateCertificateResponse x -> CreateCertificateResponse
$cfrom :: forall x.
CreateCertificateResponse -> Rep CreateCertificateResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateCertificateResponse' 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:
--
-- 'certificate', 'createCertificateResponse_certificate' - An object that describes the certificate created.
--
-- 'operations', 'createCertificateResponse_operations' - An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
--
-- 'httpStatus', 'createCertificateResponse_httpStatus' - The response's http status code.
newCreateCertificateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateCertificateResponse
newCreateCertificateResponse :: Int -> CreateCertificateResponse
newCreateCertificateResponse Int
pHttpStatus_ =
  CreateCertificateResponse'
    { $sel:certificate:CreateCertificateResponse' :: Maybe CertificateSummary
certificate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:operations:CreateCertificateResponse' :: Maybe [Operation]
operations = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An object that describes the certificate created.
createCertificateResponse_certificate :: Lens.Lens' CreateCertificateResponse (Prelude.Maybe CertificateSummary)
createCertificateResponse_certificate :: Lens' CreateCertificateResponse (Maybe CertificateSummary)
createCertificateResponse_certificate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateResponse' {Maybe CertificateSummary
certificate :: Maybe CertificateSummary
$sel:certificate:CreateCertificateResponse' :: CreateCertificateResponse -> Maybe CertificateSummary
certificate} -> Maybe CertificateSummary
certificate) (\s :: CreateCertificateResponse
s@CreateCertificateResponse' {} Maybe CertificateSummary
a -> CreateCertificateResponse
s {$sel:certificate:CreateCertificateResponse' :: Maybe CertificateSummary
certificate = Maybe CertificateSummary
a} :: CreateCertificateResponse)

-- | An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
createCertificateResponse_operations :: Lens.Lens' CreateCertificateResponse (Prelude.Maybe [Operation])
createCertificateResponse_operations :: Lens' CreateCertificateResponse (Maybe [Operation])
createCertificateResponse_operations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateCertificateResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:CreateCertificateResponse' :: CreateCertificateResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: CreateCertificateResponse
s@CreateCertificateResponse' {} Maybe [Operation]
a -> CreateCertificateResponse
s {$sel:operations:CreateCertificateResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: CreateCertificateResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData CreateCertificateResponse where
  rnf :: CreateCertificateResponse -> ()
rnf CreateCertificateResponse' {Int
Maybe [Operation]
Maybe CertificateSummary
httpStatus :: Int
operations :: Maybe [Operation]
certificate :: Maybe CertificateSummary
$sel:httpStatus:CreateCertificateResponse' :: CreateCertificateResponse -> Int
$sel:operations:CreateCertificateResponse' :: CreateCertificateResponse -> Maybe [Operation]
$sel:certificate:CreateCertificateResponse' :: CreateCertificateResponse -> Maybe CertificateSummary
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe CertificateSummary
certificate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Operation]
operations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus