{-# 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.LicenseManager.CreateLicenseManagerReportGenerator
-- 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 report generator.
module Amazonka.LicenseManager.CreateLicenseManagerReportGenerator
  ( -- * Creating a Request
    CreateLicenseManagerReportGenerator (..),
    newCreateLicenseManagerReportGenerator,

    -- * Request Lenses
    createLicenseManagerReportGenerator_description,
    createLicenseManagerReportGenerator_tags,
    createLicenseManagerReportGenerator_reportGeneratorName,
    createLicenseManagerReportGenerator_type,
    createLicenseManagerReportGenerator_reportContext,
    createLicenseManagerReportGenerator_reportFrequency,
    createLicenseManagerReportGenerator_clientToken,

    -- * Destructuring the Response
    CreateLicenseManagerReportGeneratorResponse (..),
    newCreateLicenseManagerReportGeneratorResponse,

    -- * Response Lenses
    createLicenseManagerReportGeneratorResponse_licenseManagerReportGeneratorArn,
    createLicenseManagerReportGeneratorResponse_httpStatus,
  )
where

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

-- | /See:/ 'newCreateLicenseManagerReportGenerator' smart constructor.
data CreateLicenseManagerReportGenerator = CreateLicenseManagerReportGenerator'
  { -- | Description of the report generator.
    CreateLicenseManagerReportGenerator -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Tags to add to the report generator.
    CreateLicenseManagerReportGenerator -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Name of the report generator.
    CreateLicenseManagerReportGenerator -> Text
reportGeneratorName :: Prelude.Text,
    -- | Type of reports to generate. The following report types an be generated:
    --
    -- -   License configuration report - Reports the number and details of
    --     consumed licenses for a license configuration.
    --
    -- -   Resource report - Reports the tracked licenses and resource
    --     consumption for a license configuration.
    CreateLicenseManagerReportGenerator -> [ReportType]
type' :: [ReportType],
    -- | Defines the type of license configuration the report generator tracks.
    CreateLicenseManagerReportGenerator -> ReportContext
reportContext :: ReportContext,
    -- | Frequency by which reports are generated. Reports can be generated
    -- daily, monthly, or weekly.
    CreateLicenseManagerReportGenerator -> ReportFrequency
reportFrequency :: ReportFrequency,
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateLicenseManagerReportGenerator -> Text
clientToken :: Prelude.Text
  }
  deriving (CreateLicenseManagerReportGenerator
-> CreateLicenseManagerReportGenerator -> Bool
(CreateLicenseManagerReportGenerator
 -> CreateLicenseManagerReportGenerator -> Bool)
-> (CreateLicenseManagerReportGenerator
    -> CreateLicenseManagerReportGenerator -> Bool)
-> Eq CreateLicenseManagerReportGenerator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLicenseManagerReportGenerator
-> CreateLicenseManagerReportGenerator -> Bool
$c/= :: CreateLicenseManagerReportGenerator
-> CreateLicenseManagerReportGenerator -> Bool
== :: CreateLicenseManagerReportGenerator
-> CreateLicenseManagerReportGenerator -> Bool
$c== :: CreateLicenseManagerReportGenerator
-> CreateLicenseManagerReportGenerator -> Bool
Prelude.Eq, ReadPrec [CreateLicenseManagerReportGenerator]
ReadPrec CreateLicenseManagerReportGenerator
Int -> ReadS CreateLicenseManagerReportGenerator
ReadS [CreateLicenseManagerReportGenerator]
(Int -> ReadS CreateLicenseManagerReportGenerator)
-> ReadS [CreateLicenseManagerReportGenerator]
-> ReadPrec CreateLicenseManagerReportGenerator
-> ReadPrec [CreateLicenseManagerReportGenerator]
-> Read CreateLicenseManagerReportGenerator
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLicenseManagerReportGenerator]
$creadListPrec :: ReadPrec [CreateLicenseManagerReportGenerator]
readPrec :: ReadPrec CreateLicenseManagerReportGenerator
$creadPrec :: ReadPrec CreateLicenseManagerReportGenerator
readList :: ReadS [CreateLicenseManagerReportGenerator]
$creadList :: ReadS [CreateLicenseManagerReportGenerator]
readsPrec :: Int -> ReadS CreateLicenseManagerReportGenerator
$creadsPrec :: Int -> ReadS CreateLicenseManagerReportGenerator
Prelude.Read, Int -> CreateLicenseManagerReportGenerator -> ShowS
[CreateLicenseManagerReportGenerator] -> ShowS
CreateLicenseManagerReportGenerator -> String
(Int -> CreateLicenseManagerReportGenerator -> ShowS)
-> (CreateLicenseManagerReportGenerator -> String)
-> ([CreateLicenseManagerReportGenerator] -> ShowS)
-> Show CreateLicenseManagerReportGenerator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLicenseManagerReportGenerator] -> ShowS
$cshowList :: [CreateLicenseManagerReportGenerator] -> ShowS
show :: CreateLicenseManagerReportGenerator -> String
$cshow :: CreateLicenseManagerReportGenerator -> String
showsPrec :: Int -> CreateLicenseManagerReportGenerator -> ShowS
$cshowsPrec :: Int -> CreateLicenseManagerReportGenerator -> ShowS
Prelude.Show, (forall x.
 CreateLicenseManagerReportGenerator
 -> Rep CreateLicenseManagerReportGenerator x)
-> (forall x.
    Rep CreateLicenseManagerReportGenerator x
    -> CreateLicenseManagerReportGenerator)
-> Generic CreateLicenseManagerReportGenerator
forall x.
Rep CreateLicenseManagerReportGenerator x
-> CreateLicenseManagerReportGenerator
forall x.
CreateLicenseManagerReportGenerator
-> Rep CreateLicenseManagerReportGenerator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLicenseManagerReportGenerator x
-> CreateLicenseManagerReportGenerator
$cfrom :: forall x.
CreateLicenseManagerReportGenerator
-> Rep CreateLicenseManagerReportGenerator x
Prelude.Generic)

-- |
-- Create a value of 'CreateLicenseManagerReportGenerator' 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:
--
-- 'description', 'createLicenseManagerReportGenerator_description' - Description of the report generator.
--
-- 'tags', 'createLicenseManagerReportGenerator_tags' - Tags to add to the report generator.
--
-- 'reportGeneratorName', 'createLicenseManagerReportGenerator_reportGeneratorName' - Name of the report generator.
--
-- 'type'', 'createLicenseManagerReportGenerator_type' - Type of reports to generate. The following report types an be generated:
--
-- -   License configuration report - Reports the number and details of
--     consumed licenses for a license configuration.
--
-- -   Resource report - Reports the tracked licenses and resource
--     consumption for a license configuration.
--
-- 'reportContext', 'createLicenseManagerReportGenerator_reportContext' - Defines the type of license configuration the report generator tracks.
--
-- 'reportFrequency', 'createLicenseManagerReportGenerator_reportFrequency' - Frequency by which reports are generated. Reports can be generated
-- daily, monthly, or weekly.
--
-- 'clientToken', 'createLicenseManagerReportGenerator_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
newCreateLicenseManagerReportGenerator ::
  -- | 'reportGeneratorName'
  Prelude.Text ->
  -- | 'reportContext'
  ReportContext ->
  -- | 'reportFrequency'
  ReportFrequency ->
  -- | 'clientToken'
  Prelude.Text ->
  CreateLicenseManagerReportGenerator
newCreateLicenseManagerReportGenerator :: Text
-> ReportContext
-> ReportFrequency
-> Text
-> CreateLicenseManagerReportGenerator
newCreateLicenseManagerReportGenerator
  Text
pReportGeneratorName_
  ReportContext
pReportContext_
  ReportFrequency
pReportFrequency_
  Text
pClientToken_ =
    CreateLicenseManagerReportGenerator' :: Maybe Text
-> Maybe [Tag]
-> Text
-> [ReportType]
-> ReportContext
-> ReportFrequency
-> Text
-> CreateLicenseManagerReportGenerator
CreateLicenseManagerReportGenerator'
      { $sel:description:CreateLicenseManagerReportGenerator' :: Maybe Text
description =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateLicenseManagerReportGenerator' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:reportGeneratorName:CreateLicenseManagerReportGenerator' :: Text
reportGeneratorName =
          Text
pReportGeneratorName_,
        $sel:type':CreateLicenseManagerReportGenerator' :: [ReportType]
type' = [ReportType]
forall a. Monoid a => a
Prelude.mempty,
        $sel:reportContext:CreateLicenseManagerReportGenerator' :: ReportContext
reportContext = ReportContext
pReportContext_,
        $sel:reportFrequency:CreateLicenseManagerReportGenerator' :: ReportFrequency
reportFrequency = ReportFrequency
pReportFrequency_,
        $sel:clientToken:CreateLicenseManagerReportGenerator' :: Text
clientToken = Text
pClientToken_
      }

-- | Description of the report generator.
createLicenseManagerReportGenerator_description :: Lens.Lens' CreateLicenseManagerReportGenerator (Prelude.Maybe Prelude.Text)
createLicenseManagerReportGenerator_description :: (Maybe Text -> f (Maybe Text))
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
createLicenseManagerReportGenerator_description = (CreateLicenseManagerReportGenerator -> Maybe Text)
-> (CreateLicenseManagerReportGenerator
    -> Maybe Text -> CreateLicenseManagerReportGenerator)
-> Lens
     CreateLicenseManagerReportGenerator
     CreateLicenseManagerReportGenerator
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGenerator' {Maybe Text
description :: Maybe Text
$sel:description:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateLicenseManagerReportGenerator
s@CreateLicenseManagerReportGenerator' {} Maybe Text
a -> CreateLicenseManagerReportGenerator
s {$sel:description:CreateLicenseManagerReportGenerator' :: Maybe Text
description = Maybe Text
a} :: CreateLicenseManagerReportGenerator)

-- | Tags to add to the report generator.
createLicenseManagerReportGenerator_tags :: Lens.Lens' CreateLicenseManagerReportGenerator (Prelude.Maybe [Tag])
createLicenseManagerReportGenerator_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
createLicenseManagerReportGenerator_tags = (CreateLicenseManagerReportGenerator -> Maybe [Tag])
-> (CreateLicenseManagerReportGenerator
    -> Maybe [Tag] -> CreateLicenseManagerReportGenerator)
-> Lens
     CreateLicenseManagerReportGenerator
     CreateLicenseManagerReportGenerator
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGenerator' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateLicenseManagerReportGenerator
s@CreateLicenseManagerReportGenerator' {} Maybe [Tag]
a -> CreateLicenseManagerReportGenerator
s {$sel:tags:CreateLicenseManagerReportGenerator' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateLicenseManagerReportGenerator) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateLicenseManagerReportGenerator
 -> f CreateLicenseManagerReportGenerator)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Name of the report generator.
createLicenseManagerReportGenerator_reportGeneratorName :: Lens.Lens' CreateLicenseManagerReportGenerator Prelude.Text
createLicenseManagerReportGenerator_reportGeneratorName :: (Text -> f Text)
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
createLicenseManagerReportGenerator_reportGeneratorName = (CreateLicenseManagerReportGenerator -> Text)
-> (CreateLicenseManagerReportGenerator
    -> Text -> CreateLicenseManagerReportGenerator)
-> Lens
     CreateLicenseManagerReportGenerator
     CreateLicenseManagerReportGenerator
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGenerator' {Text
reportGeneratorName :: Text
$sel:reportGeneratorName:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Text
reportGeneratorName} -> Text
reportGeneratorName) (\s :: CreateLicenseManagerReportGenerator
s@CreateLicenseManagerReportGenerator' {} Text
a -> CreateLicenseManagerReportGenerator
s {$sel:reportGeneratorName:CreateLicenseManagerReportGenerator' :: Text
reportGeneratorName = Text
a} :: CreateLicenseManagerReportGenerator)

-- | Type of reports to generate. The following report types an be generated:
--
-- -   License configuration report - Reports the number and details of
--     consumed licenses for a license configuration.
--
-- -   Resource report - Reports the tracked licenses and resource
--     consumption for a license configuration.
createLicenseManagerReportGenerator_type :: Lens.Lens' CreateLicenseManagerReportGenerator [ReportType]
createLicenseManagerReportGenerator_type :: ([ReportType] -> f [ReportType])
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
createLicenseManagerReportGenerator_type = (CreateLicenseManagerReportGenerator -> [ReportType])
-> (CreateLicenseManagerReportGenerator
    -> [ReportType] -> CreateLicenseManagerReportGenerator)
-> Lens
     CreateLicenseManagerReportGenerator
     CreateLicenseManagerReportGenerator
     [ReportType]
     [ReportType]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGenerator' {[ReportType]
type' :: [ReportType]
$sel:type':CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> [ReportType]
type'} -> [ReportType]
type') (\s :: CreateLicenseManagerReportGenerator
s@CreateLicenseManagerReportGenerator' {} [ReportType]
a -> CreateLicenseManagerReportGenerator
s {$sel:type':CreateLicenseManagerReportGenerator' :: [ReportType]
type' = [ReportType]
a} :: CreateLicenseManagerReportGenerator) (([ReportType] -> f [ReportType])
 -> CreateLicenseManagerReportGenerator
 -> f CreateLicenseManagerReportGenerator)
-> (([ReportType] -> f [ReportType])
    -> [ReportType] -> f [ReportType])
-> ([ReportType] -> f [ReportType])
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReportType] -> f [ReportType]) -> [ReportType] -> f [ReportType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Defines the type of license configuration the report generator tracks.
createLicenseManagerReportGenerator_reportContext :: Lens.Lens' CreateLicenseManagerReportGenerator ReportContext
createLicenseManagerReportGenerator_reportContext :: (ReportContext -> f ReportContext)
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
createLicenseManagerReportGenerator_reportContext = (CreateLicenseManagerReportGenerator -> ReportContext)
-> (CreateLicenseManagerReportGenerator
    -> ReportContext -> CreateLicenseManagerReportGenerator)
-> Lens
     CreateLicenseManagerReportGenerator
     CreateLicenseManagerReportGenerator
     ReportContext
     ReportContext
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGenerator' {ReportContext
reportContext :: ReportContext
$sel:reportContext:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> ReportContext
reportContext} -> ReportContext
reportContext) (\s :: CreateLicenseManagerReportGenerator
s@CreateLicenseManagerReportGenerator' {} ReportContext
a -> CreateLicenseManagerReportGenerator
s {$sel:reportContext:CreateLicenseManagerReportGenerator' :: ReportContext
reportContext = ReportContext
a} :: CreateLicenseManagerReportGenerator)

-- | Frequency by which reports are generated. Reports can be generated
-- daily, monthly, or weekly.
createLicenseManagerReportGenerator_reportFrequency :: Lens.Lens' CreateLicenseManagerReportGenerator ReportFrequency
createLicenseManagerReportGenerator_reportFrequency :: (ReportFrequency -> f ReportFrequency)
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
createLicenseManagerReportGenerator_reportFrequency = (CreateLicenseManagerReportGenerator -> ReportFrequency)
-> (CreateLicenseManagerReportGenerator
    -> ReportFrequency -> CreateLicenseManagerReportGenerator)
-> Lens
     CreateLicenseManagerReportGenerator
     CreateLicenseManagerReportGenerator
     ReportFrequency
     ReportFrequency
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGenerator' {ReportFrequency
reportFrequency :: ReportFrequency
$sel:reportFrequency:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> ReportFrequency
reportFrequency} -> ReportFrequency
reportFrequency) (\s :: CreateLicenseManagerReportGenerator
s@CreateLicenseManagerReportGenerator' {} ReportFrequency
a -> CreateLicenseManagerReportGenerator
s {$sel:reportFrequency:CreateLicenseManagerReportGenerator' :: ReportFrequency
reportFrequency = ReportFrequency
a} :: CreateLicenseManagerReportGenerator)

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
createLicenseManagerReportGenerator_clientToken :: Lens.Lens' CreateLicenseManagerReportGenerator Prelude.Text
createLicenseManagerReportGenerator_clientToken :: (Text -> f Text)
-> CreateLicenseManagerReportGenerator
-> f CreateLicenseManagerReportGenerator
createLicenseManagerReportGenerator_clientToken = (CreateLicenseManagerReportGenerator -> Text)
-> (CreateLicenseManagerReportGenerator
    -> Text -> CreateLicenseManagerReportGenerator)
-> Lens
     CreateLicenseManagerReportGenerator
     CreateLicenseManagerReportGenerator
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGenerator' {Text
clientToken :: Text
$sel:clientToken:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Text
clientToken} -> Text
clientToken) (\s :: CreateLicenseManagerReportGenerator
s@CreateLicenseManagerReportGenerator' {} Text
a -> CreateLicenseManagerReportGenerator
s {$sel:clientToken:CreateLicenseManagerReportGenerator' :: Text
clientToken = Text
a} :: CreateLicenseManagerReportGenerator)

instance
  Core.AWSRequest
    CreateLicenseManagerReportGenerator
  where
  type
    AWSResponse CreateLicenseManagerReportGenerator =
      CreateLicenseManagerReportGeneratorResponse
  request :: CreateLicenseManagerReportGenerator
-> Request CreateLicenseManagerReportGenerator
request = Service
-> CreateLicenseManagerReportGenerator
-> Request CreateLicenseManagerReportGenerator
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateLicenseManagerReportGenerator
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateLicenseManagerReportGenerator)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateLicenseManagerReportGenerator))
-> Logger
-> Service
-> Proxy CreateLicenseManagerReportGenerator
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateLicenseManagerReportGenerator)))
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 Text -> Int -> CreateLicenseManagerReportGeneratorResponse
CreateLicenseManagerReportGeneratorResponse'
            (Maybe Text -> Int -> CreateLicenseManagerReportGeneratorResponse)
-> Either String (Maybe Text)
-> Either
     String (Int -> CreateLicenseManagerReportGeneratorResponse)
forall (f :: * -> *) a b. Functor 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
"LicenseManagerReportGeneratorArn")
              Either String (Int -> CreateLicenseManagerReportGeneratorResponse)
-> Either String Int
-> Either String CreateLicenseManagerReportGeneratorResponse
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
    CreateLicenseManagerReportGenerator

instance
  Prelude.NFData
    CreateLicenseManagerReportGenerator

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

instance
  Core.ToJSON
    CreateLicenseManagerReportGenerator
  where
  toJSON :: CreateLicenseManagerReportGenerator -> Value
toJSON CreateLicenseManagerReportGenerator' {[ReportType]
Maybe [Tag]
Maybe Text
Text
ReportContext
ReportFrequency
clientToken :: Text
reportFrequency :: ReportFrequency
reportContext :: ReportContext
type' :: [ReportType]
reportGeneratorName :: Text
tags :: Maybe [Tag]
description :: Maybe Text
$sel:clientToken:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Text
$sel:reportFrequency:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> ReportFrequency
$sel:reportContext:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> ReportContext
$sel:type':CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> [ReportType]
$sel:reportGeneratorName:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Text
$sel:tags:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Maybe [Tag]
$sel:description:CreateLicenseManagerReportGenerator' :: CreateLicenseManagerReportGenerator -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Description" 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
description,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ReportGeneratorName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
reportGeneratorName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> [ReportType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [ReportType]
type'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ReportContext" Text -> ReportContext -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ReportContext
reportContext),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ReportFrequency" Text -> ReportFrequency -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ReportFrequency
reportFrequency),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientToken)
          ]
      )

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

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

-- | /See:/ 'newCreateLicenseManagerReportGeneratorResponse' smart constructor.
data CreateLicenseManagerReportGeneratorResponse = CreateLicenseManagerReportGeneratorResponse'
  { -- | The Amazon Resource Name (ARN) of the new report generator.
    CreateLicenseManagerReportGeneratorResponse -> Maybe Text
licenseManagerReportGeneratorArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateLicenseManagerReportGeneratorResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateLicenseManagerReportGeneratorResponse
-> CreateLicenseManagerReportGeneratorResponse -> Bool
(CreateLicenseManagerReportGeneratorResponse
 -> CreateLicenseManagerReportGeneratorResponse -> Bool)
-> (CreateLicenseManagerReportGeneratorResponse
    -> CreateLicenseManagerReportGeneratorResponse -> Bool)
-> Eq CreateLicenseManagerReportGeneratorResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLicenseManagerReportGeneratorResponse
-> CreateLicenseManagerReportGeneratorResponse -> Bool
$c/= :: CreateLicenseManagerReportGeneratorResponse
-> CreateLicenseManagerReportGeneratorResponse -> Bool
== :: CreateLicenseManagerReportGeneratorResponse
-> CreateLicenseManagerReportGeneratorResponse -> Bool
$c== :: CreateLicenseManagerReportGeneratorResponse
-> CreateLicenseManagerReportGeneratorResponse -> Bool
Prelude.Eq, ReadPrec [CreateLicenseManagerReportGeneratorResponse]
ReadPrec CreateLicenseManagerReportGeneratorResponse
Int -> ReadS CreateLicenseManagerReportGeneratorResponse
ReadS [CreateLicenseManagerReportGeneratorResponse]
(Int -> ReadS CreateLicenseManagerReportGeneratorResponse)
-> ReadS [CreateLicenseManagerReportGeneratorResponse]
-> ReadPrec CreateLicenseManagerReportGeneratorResponse
-> ReadPrec [CreateLicenseManagerReportGeneratorResponse]
-> Read CreateLicenseManagerReportGeneratorResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLicenseManagerReportGeneratorResponse]
$creadListPrec :: ReadPrec [CreateLicenseManagerReportGeneratorResponse]
readPrec :: ReadPrec CreateLicenseManagerReportGeneratorResponse
$creadPrec :: ReadPrec CreateLicenseManagerReportGeneratorResponse
readList :: ReadS [CreateLicenseManagerReportGeneratorResponse]
$creadList :: ReadS [CreateLicenseManagerReportGeneratorResponse]
readsPrec :: Int -> ReadS CreateLicenseManagerReportGeneratorResponse
$creadsPrec :: Int -> ReadS CreateLicenseManagerReportGeneratorResponse
Prelude.Read, Int -> CreateLicenseManagerReportGeneratorResponse -> ShowS
[CreateLicenseManagerReportGeneratorResponse] -> ShowS
CreateLicenseManagerReportGeneratorResponse -> String
(Int -> CreateLicenseManagerReportGeneratorResponse -> ShowS)
-> (CreateLicenseManagerReportGeneratorResponse -> String)
-> ([CreateLicenseManagerReportGeneratorResponse] -> ShowS)
-> Show CreateLicenseManagerReportGeneratorResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLicenseManagerReportGeneratorResponse] -> ShowS
$cshowList :: [CreateLicenseManagerReportGeneratorResponse] -> ShowS
show :: CreateLicenseManagerReportGeneratorResponse -> String
$cshow :: CreateLicenseManagerReportGeneratorResponse -> String
showsPrec :: Int -> CreateLicenseManagerReportGeneratorResponse -> ShowS
$cshowsPrec :: Int -> CreateLicenseManagerReportGeneratorResponse -> ShowS
Prelude.Show, (forall x.
 CreateLicenseManagerReportGeneratorResponse
 -> Rep CreateLicenseManagerReportGeneratorResponse x)
-> (forall x.
    Rep CreateLicenseManagerReportGeneratorResponse x
    -> CreateLicenseManagerReportGeneratorResponse)
-> Generic CreateLicenseManagerReportGeneratorResponse
forall x.
Rep CreateLicenseManagerReportGeneratorResponse x
-> CreateLicenseManagerReportGeneratorResponse
forall x.
CreateLicenseManagerReportGeneratorResponse
-> Rep CreateLicenseManagerReportGeneratorResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateLicenseManagerReportGeneratorResponse x
-> CreateLicenseManagerReportGeneratorResponse
$cfrom :: forall x.
CreateLicenseManagerReportGeneratorResponse
-> Rep CreateLicenseManagerReportGeneratorResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateLicenseManagerReportGeneratorResponse' 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:
--
-- 'licenseManagerReportGeneratorArn', 'createLicenseManagerReportGeneratorResponse_licenseManagerReportGeneratorArn' - The Amazon Resource Name (ARN) of the new report generator.
--
-- 'httpStatus', 'createLicenseManagerReportGeneratorResponse_httpStatus' - The response's http status code.
newCreateLicenseManagerReportGeneratorResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateLicenseManagerReportGeneratorResponse
newCreateLicenseManagerReportGeneratorResponse :: Int -> CreateLicenseManagerReportGeneratorResponse
newCreateLicenseManagerReportGeneratorResponse
  Int
pHttpStatus_ =
    CreateLicenseManagerReportGeneratorResponse' :: Maybe Text -> Int -> CreateLicenseManagerReportGeneratorResponse
CreateLicenseManagerReportGeneratorResponse'
      { $sel:licenseManagerReportGeneratorArn:CreateLicenseManagerReportGeneratorResponse' :: Maybe Text
licenseManagerReportGeneratorArn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateLicenseManagerReportGeneratorResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The Amazon Resource Name (ARN) of the new report generator.
createLicenseManagerReportGeneratorResponse_licenseManagerReportGeneratorArn :: Lens.Lens' CreateLicenseManagerReportGeneratorResponse (Prelude.Maybe Prelude.Text)
createLicenseManagerReportGeneratorResponse_licenseManagerReportGeneratorArn :: (Maybe Text -> f (Maybe Text))
-> CreateLicenseManagerReportGeneratorResponse
-> f CreateLicenseManagerReportGeneratorResponse
createLicenseManagerReportGeneratorResponse_licenseManagerReportGeneratorArn = (CreateLicenseManagerReportGeneratorResponse -> Maybe Text)
-> (CreateLicenseManagerReportGeneratorResponse
    -> Maybe Text -> CreateLicenseManagerReportGeneratorResponse)
-> Lens
     CreateLicenseManagerReportGeneratorResponse
     CreateLicenseManagerReportGeneratorResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLicenseManagerReportGeneratorResponse' {Maybe Text
licenseManagerReportGeneratorArn :: Maybe Text
$sel:licenseManagerReportGeneratorArn:CreateLicenseManagerReportGeneratorResponse' :: CreateLicenseManagerReportGeneratorResponse -> Maybe Text
licenseManagerReportGeneratorArn} -> Maybe Text
licenseManagerReportGeneratorArn) (\s :: CreateLicenseManagerReportGeneratorResponse
s@CreateLicenseManagerReportGeneratorResponse' {} Maybe Text
a -> CreateLicenseManagerReportGeneratorResponse
s {$sel:licenseManagerReportGeneratorArn:CreateLicenseManagerReportGeneratorResponse' :: Maybe Text
licenseManagerReportGeneratorArn = Maybe Text
a} :: CreateLicenseManagerReportGeneratorResponse)

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

instance
  Prelude.NFData
    CreateLicenseManagerReportGeneratorResponse