{-# 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.UpdateLicenseConfiguration
-- 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)
--
-- Modifies the attributes of an existing license configuration.
module Amazonka.LicenseManager.UpdateLicenseConfiguration
  ( -- * Creating a Request
    UpdateLicenseConfiguration (..),
    newUpdateLicenseConfiguration,

    -- * Request Lenses
    updateLicenseConfiguration_licenseCount,
    updateLicenseConfiguration_name,
    updateLicenseConfiguration_licenseConfigurationStatus,
    updateLicenseConfiguration_licenseCountHardLimit,
    updateLicenseConfiguration_disassociateWhenNotFound,
    updateLicenseConfiguration_productInformationList,
    updateLicenseConfiguration_licenseRules,
    updateLicenseConfiguration_description,
    updateLicenseConfiguration_licenseConfigurationArn,

    -- * Destructuring the Response
    UpdateLicenseConfigurationResponse (..),
    newUpdateLicenseConfigurationResponse,

    -- * Response Lenses
    updateLicenseConfigurationResponse_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:/ 'newUpdateLicenseConfiguration' smart constructor.
data UpdateLicenseConfiguration = UpdateLicenseConfiguration'
  { -- | New number of licenses managed by the license configuration.
    UpdateLicenseConfiguration -> Maybe Integer
licenseCount :: Prelude.Maybe Prelude.Integer,
    -- | New name of the license configuration.
    UpdateLicenseConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | New status of the license configuration.
    UpdateLicenseConfiguration -> Maybe LicenseConfigurationStatus
licenseConfigurationStatus :: Prelude.Maybe LicenseConfigurationStatus,
    -- | New hard limit of the number of available licenses.
    UpdateLicenseConfiguration -> Maybe Bool
licenseCountHardLimit :: Prelude.Maybe Prelude.Bool,
    -- | When true, disassociates a resource when software is uninstalled.
    UpdateLicenseConfiguration -> Maybe Bool
disassociateWhenNotFound :: Prelude.Maybe Prelude.Bool,
    -- | New product information.
    UpdateLicenseConfiguration -> Maybe [ProductInformation]
productInformationList :: Prelude.Maybe [ProductInformation],
    -- | New license rule. The only rule that you can add after you create a
    -- license configuration is licenseAffinityToHost.
    UpdateLicenseConfiguration -> Maybe [Text]
licenseRules :: Prelude.Maybe [Prelude.Text],
    -- | New description of the license configuration.
    UpdateLicenseConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Amazon Resource Name (ARN) of the license configuration.
    UpdateLicenseConfiguration -> Text
licenseConfigurationArn :: Prelude.Text
  }
  deriving (UpdateLicenseConfiguration -> UpdateLicenseConfiguration -> Bool
(UpdateLicenseConfiguration -> UpdateLicenseConfiguration -> Bool)
-> (UpdateLicenseConfiguration
    -> UpdateLicenseConfiguration -> Bool)
-> Eq UpdateLicenseConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLicenseConfiguration -> UpdateLicenseConfiguration -> Bool
$c/= :: UpdateLicenseConfiguration -> UpdateLicenseConfiguration -> Bool
== :: UpdateLicenseConfiguration -> UpdateLicenseConfiguration -> Bool
$c== :: UpdateLicenseConfiguration -> UpdateLicenseConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateLicenseConfiguration]
ReadPrec UpdateLicenseConfiguration
Int -> ReadS UpdateLicenseConfiguration
ReadS [UpdateLicenseConfiguration]
(Int -> ReadS UpdateLicenseConfiguration)
-> ReadS [UpdateLicenseConfiguration]
-> ReadPrec UpdateLicenseConfiguration
-> ReadPrec [UpdateLicenseConfiguration]
-> Read UpdateLicenseConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLicenseConfiguration]
$creadListPrec :: ReadPrec [UpdateLicenseConfiguration]
readPrec :: ReadPrec UpdateLicenseConfiguration
$creadPrec :: ReadPrec UpdateLicenseConfiguration
readList :: ReadS [UpdateLicenseConfiguration]
$creadList :: ReadS [UpdateLicenseConfiguration]
readsPrec :: Int -> ReadS UpdateLicenseConfiguration
$creadsPrec :: Int -> ReadS UpdateLicenseConfiguration
Prelude.Read, Int -> UpdateLicenseConfiguration -> ShowS
[UpdateLicenseConfiguration] -> ShowS
UpdateLicenseConfiguration -> String
(Int -> UpdateLicenseConfiguration -> ShowS)
-> (UpdateLicenseConfiguration -> String)
-> ([UpdateLicenseConfiguration] -> ShowS)
-> Show UpdateLicenseConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLicenseConfiguration] -> ShowS
$cshowList :: [UpdateLicenseConfiguration] -> ShowS
show :: UpdateLicenseConfiguration -> String
$cshow :: UpdateLicenseConfiguration -> String
showsPrec :: Int -> UpdateLicenseConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateLicenseConfiguration -> ShowS
Prelude.Show, (forall x.
 UpdateLicenseConfiguration -> Rep UpdateLicenseConfiguration x)
-> (forall x.
    Rep UpdateLicenseConfiguration x -> UpdateLicenseConfiguration)
-> Generic UpdateLicenseConfiguration
forall x.
Rep UpdateLicenseConfiguration x -> UpdateLicenseConfiguration
forall x.
UpdateLicenseConfiguration -> Rep UpdateLicenseConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLicenseConfiguration x -> UpdateLicenseConfiguration
$cfrom :: forall x.
UpdateLicenseConfiguration -> Rep UpdateLicenseConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLicenseConfiguration' 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:
--
-- 'licenseCount', 'updateLicenseConfiguration_licenseCount' - New number of licenses managed by the license configuration.
--
-- 'name', 'updateLicenseConfiguration_name' - New name of the license configuration.
--
-- 'licenseConfigurationStatus', 'updateLicenseConfiguration_licenseConfigurationStatus' - New status of the license configuration.
--
-- 'licenseCountHardLimit', 'updateLicenseConfiguration_licenseCountHardLimit' - New hard limit of the number of available licenses.
--
-- 'disassociateWhenNotFound', 'updateLicenseConfiguration_disassociateWhenNotFound' - When true, disassociates a resource when software is uninstalled.
--
-- 'productInformationList', 'updateLicenseConfiguration_productInformationList' - New product information.
--
-- 'licenseRules', 'updateLicenseConfiguration_licenseRules' - New license rule. The only rule that you can add after you create a
-- license configuration is licenseAffinityToHost.
--
-- 'description', 'updateLicenseConfiguration_description' - New description of the license configuration.
--
-- 'licenseConfigurationArn', 'updateLicenseConfiguration_licenseConfigurationArn' - Amazon Resource Name (ARN) of the license configuration.
newUpdateLicenseConfiguration ::
  -- | 'licenseConfigurationArn'
  Prelude.Text ->
  UpdateLicenseConfiguration
newUpdateLicenseConfiguration :: Text -> UpdateLicenseConfiguration
newUpdateLicenseConfiguration
  Text
pLicenseConfigurationArn_ =
    UpdateLicenseConfiguration' :: Maybe Integer
-> Maybe Text
-> Maybe LicenseConfigurationStatus
-> Maybe Bool
-> Maybe Bool
-> Maybe [ProductInformation]
-> Maybe [Text]
-> Maybe Text
-> Text
-> UpdateLicenseConfiguration
UpdateLicenseConfiguration'
      { $sel:licenseCount:UpdateLicenseConfiguration' :: Maybe Integer
licenseCount =
          Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:name:UpdateLicenseConfiguration' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:licenseConfigurationStatus:UpdateLicenseConfiguration' :: Maybe LicenseConfigurationStatus
licenseConfigurationStatus = Maybe LicenseConfigurationStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:licenseCountHardLimit:UpdateLicenseConfiguration' :: Maybe Bool
licenseCountHardLimit = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:disassociateWhenNotFound:UpdateLicenseConfiguration' :: Maybe Bool
disassociateWhenNotFound = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:productInformationList:UpdateLicenseConfiguration' :: Maybe [ProductInformation]
productInformationList = Maybe [ProductInformation]
forall a. Maybe a
Prelude.Nothing,
        $sel:licenseRules:UpdateLicenseConfiguration' :: Maybe [Text]
licenseRules = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:description:UpdateLicenseConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:licenseConfigurationArn:UpdateLicenseConfiguration' :: Text
licenseConfigurationArn =
          Text
pLicenseConfigurationArn_
      }

-- | New number of licenses managed by the license configuration.
updateLicenseConfiguration_licenseCount :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Integer)
updateLicenseConfiguration_licenseCount :: (Maybe Integer -> f (Maybe Integer))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_licenseCount = (UpdateLicenseConfiguration -> Maybe Integer)
-> (UpdateLicenseConfiguration
    -> Maybe Integer -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe Integer
licenseCount :: Maybe Integer
$sel:licenseCount:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Integer
licenseCount} -> Maybe Integer
licenseCount) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe Integer
a -> UpdateLicenseConfiguration
s {$sel:licenseCount:UpdateLicenseConfiguration' :: Maybe Integer
licenseCount = Maybe Integer
a} :: UpdateLicenseConfiguration)

-- | New name of the license configuration.
updateLicenseConfiguration_name :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Text)
updateLicenseConfiguration_name :: (Maybe Text -> f (Maybe Text))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_name = (UpdateLicenseConfiguration -> Maybe Text)
-> (UpdateLicenseConfiguration
    -> Maybe Text -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe Text
a -> UpdateLicenseConfiguration
s {$sel:name:UpdateLicenseConfiguration' :: Maybe Text
name = Maybe Text
a} :: UpdateLicenseConfiguration)

-- | New status of the license configuration.
updateLicenseConfiguration_licenseConfigurationStatus :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe LicenseConfigurationStatus)
updateLicenseConfiguration_licenseConfigurationStatus :: (Maybe LicenseConfigurationStatus
 -> f (Maybe LicenseConfigurationStatus))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_licenseConfigurationStatus = (UpdateLicenseConfiguration -> Maybe LicenseConfigurationStatus)
-> (UpdateLicenseConfiguration
    -> Maybe LicenseConfigurationStatus -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe LicenseConfigurationStatus)
     (Maybe LicenseConfigurationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe LicenseConfigurationStatus
licenseConfigurationStatus :: Maybe LicenseConfigurationStatus
$sel:licenseConfigurationStatus:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe LicenseConfigurationStatus
licenseConfigurationStatus} -> Maybe LicenseConfigurationStatus
licenseConfigurationStatus) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe LicenseConfigurationStatus
a -> UpdateLicenseConfiguration
s {$sel:licenseConfigurationStatus:UpdateLicenseConfiguration' :: Maybe LicenseConfigurationStatus
licenseConfigurationStatus = Maybe LicenseConfigurationStatus
a} :: UpdateLicenseConfiguration)

-- | New hard limit of the number of available licenses.
updateLicenseConfiguration_licenseCountHardLimit :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Bool)
updateLicenseConfiguration_licenseCountHardLimit :: (Maybe Bool -> f (Maybe Bool))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_licenseCountHardLimit = (UpdateLicenseConfiguration -> Maybe Bool)
-> (UpdateLicenseConfiguration
    -> Maybe Bool -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe Bool
licenseCountHardLimit :: Maybe Bool
$sel:licenseCountHardLimit:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
licenseCountHardLimit} -> Maybe Bool
licenseCountHardLimit) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe Bool
a -> UpdateLicenseConfiguration
s {$sel:licenseCountHardLimit:UpdateLicenseConfiguration' :: Maybe Bool
licenseCountHardLimit = Maybe Bool
a} :: UpdateLicenseConfiguration)

-- | When true, disassociates a resource when software is uninstalled.
updateLicenseConfiguration_disassociateWhenNotFound :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Bool)
updateLicenseConfiguration_disassociateWhenNotFound :: (Maybe Bool -> f (Maybe Bool))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_disassociateWhenNotFound = (UpdateLicenseConfiguration -> Maybe Bool)
-> (UpdateLicenseConfiguration
    -> Maybe Bool -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe Bool
disassociateWhenNotFound :: Maybe Bool
$sel:disassociateWhenNotFound:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
disassociateWhenNotFound} -> Maybe Bool
disassociateWhenNotFound) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe Bool
a -> UpdateLicenseConfiguration
s {$sel:disassociateWhenNotFound:UpdateLicenseConfiguration' :: Maybe Bool
disassociateWhenNotFound = Maybe Bool
a} :: UpdateLicenseConfiguration)

-- | New product information.
updateLicenseConfiguration_productInformationList :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe [ProductInformation])
updateLicenseConfiguration_productInformationList :: (Maybe [ProductInformation] -> f (Maybe [ProductInformation]))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_productInformationList = (UpdateLicenseConfiguration -> Maybe [ProductInformation])
-> (UpdateLicenseConfiguration
    -> Maybe [ProductInformation] -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe [ProductInformation])
     (Maybe [ProductInformation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe [ProductInformation]
productInformationList :: Maybe [ProductInformation]
$sel:productInformationList:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [ProductInformation]
productInformationList} -> Maybe [ProductInformation]
productInformationList) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe [ProductInformation]
a -> UpdateLicenseConfiguration
s {$sel:productInformationList:UpdateLicenseConfiguration' :: Maybe [ProductInformation]
productInformationList = Maybe [ProductInformation]
a} :: UpdateLicenseConfiguration) ((Maybe [ProductInformation] -> f (Maybe [ProductInformation]))
 -> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration)
-> ((Maybe [ProductInformation] -> f (Maybe [ProductInformation]))
    -> Maybe [ProductInformation] -> f (Maybe [ProductInformation]))
-> (Maybe [ProductInformation] -> f (Maybe [ProductInformation]))
-> UpdateLicenseConfiguration
-> f UpdateLicenseConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProductInformation]
  [ProductInformation]
  [ProductInformation]
  [ProductInformation]
-> Iso
     (Maybe [ProductInformation])
     (Maybe [ProductInformation])
     (Maybe [ProductInformation])
     (Maybe [ProductInformation])
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
  [ProductInformation]
  [ProductInformation]
  [ProductInformation]
  [ProductInformation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | New license rule. The only rule that you can add after you create a
-- license configuration is licenseAffinityToHost.
updateLicenseConfiguration_licenseRules :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe [Prelude.Text])
updateLicenseConfiguration_licenseRules :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_licenseRules = (UpdateLicenseConfiguration -> Maybe [Text])
-> (UpdateLicenseConfiguration
    -> Maybe [Text] -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe [Text]
licenseRules :: Maybe [Text]
$sel:licenseRules:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [Text]
licenseRules} -> Maybe [Text]
licenseRules) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe [Text]
a -> UpdateLicenseConfiguration
s {$sel:licenseRules:UpdateLicenseConfiguration' :: Maybe [Text]
licenseRules = Maybe [Text]
a} :: UpdateLicenseConfiguration) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateLicenseConfiguration
-> f UpdateLicenseConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | New description of the license configuration.
updateLicenseConfiguration_description :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Text)
updateLicenseConfiguration_description :: (Maybe Text -> f (Maybe Text))
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_description = (UpdateLicenseConfiguration -> Maybe Text)
-> (UpdateLicenseConfiguration
    -> Maybe Text -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration
     UpdateLicenseConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Maybe Text
a -> UpdateLicenseConfiguration
s {$sel:description:UpdateLicenseConfiguration' :: Maybe Text
description = Maybe Text
a} :: UpdateLicenseConfiguration)

-- | Amazon Resource Name (ARN) of the license configuration.
updateLicenseConfiguration_licenseConfigurationArn :: Lens.Lens' UpdateLicenseConfiguration Prelude.Text
updateLicenseConfiguration_licenseConfigurationArn :: (Text -> f Text)
-> UpdateLicenseConfiguration -> f UpdateLicenseConfiguration
updateLicenseConfiguration_licenseConfigurationArn = (UpdateLicenseConfiguration -> Text)
-> (UpdateLicenseConfiguration
    -> Text -> UpdateLicenseConfiguration)
-> Lens
     UpdateLicenseConfiguration UpdateLicenseConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLicenseConfiguration' {Text
licenseConfigurationArn :: Text
$sel:licenseConfigurationArn:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Text
licenseConfigurationArn} -> Text
licenseConfigurationArn) (\s :: UpdateLicenseConfiguration
s@UpdateLicenseConfiguration' {} Text
a -> UpdateLicenseConfiguration
s {$sel:licenseConfigurationArn:UpdateLicenseConfiguration' :: Text
licenseConfigurationArn = Text
a} :: UpdateLicenseConfiguration)

instance Core.AWSRequest UpdateLicenseConfiguration where
  type
    AWSResponse UpdateLicenseConfiguration =
      UpdateLicenseConfigurationResponse
  request :: UpdateLicenseConfiguration -> Request UpdateLicenseConfiguration
request = Service
-> UpdateLicenseConfiguration -> Request UpdateLicenseConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateLicenseConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLicenseConfiguration)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateLicenseConfiguration))
-> Logger
-> Service
-> Proxy UpdateLicenseConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLicenseConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateLicenseConfigurationResponse
UpdateLicenseConfigurationResponse'
            (Int -> UpdateLicenseConfigurationResponse)
-> Either String Int
-> Either String UpdateLicenseConfigurationResponse
forall (f :: * -> *) a b. Functor 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 UpdateLicenseConfiguration

instance Prelude.NFData UpdateLicenseConfiguration

instance Core.ToHeaders UpdateLicenseConfiguration where
  toHeaders :: UpdateLicenseConfiguration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateLicenseConfiguration -> 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.UpdateLicenseConfiguration" ::
                          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 UpdateLicenseConfiguration where
  toJSON :: UpdateLicenseConfiguration -> Value
toJSON UpdateLicenseConfiguration' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [ProductInformation]
Maybe Text
Maybe LicenseConfigurationStatus
Text
licenseConfigurationArn :: Text
description :: Maybe Text
licenseRules :: Maybe [Text]
productInformationList :: Maybe [ProductInformation]
disassociateWhenNotFound :: Maybe Bool
licenseCountHardLimit :: Maybe Bool
licenseConfigurationStatus :: Maybe LicenseConfigurationStatus
name :: Maybe Text
licenseCount :: Maybe Integer
$sel:licenseConfigurationArn:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Text
$sel:description:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
$sel:licenseRules:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [Text]
$sel:productInformationList:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [ProductInformation]
$sel:disassociateWhenNotFound:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
$sel:licenseCountHardLimit:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
$sel:licenseConfigurationStatus:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe LicenseConfigurationStatus
$sel:name:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
$sel:licenseCount:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Integer
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LicenseCount" Text -> Integer -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Integer -> Pair) -> Maybe Integer -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
licenseCount,
            (Text
"Name" 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
name,
            (Text
"LicenseConfigurationStatus" Text -> LicenseConfigurationStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LicenseConfigurationStatus -> Pair)
-> Maybe LicenseConfigurationStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LicenseConfigurationStatus
licenseConfigurationStatus,
            (Text
"LicenseCountHardLimit" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
licenseCountHardLimit,
            (Text
"DisassociateWhenNotFound" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disassociateWhenNotFound,
            (Text
"ProductInformationList" Text -> [ProductInformation] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([ProductInformation] -> Pair)
-> Maybe [ProductInformation] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ProductInformation]
productInformationList,
            (Text
"LicenseRules" 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]
licenseRules,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"LicenseConfigurationArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
licenseConfigurationArn
              )
          ]
      )

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

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

-- | /See:/ 'newUpdateLicenseConfigurationResponse' smart constructor.
data UpdateLicenseConfigurationResponse = UpdateLicenseConfigurationResponse'
  { -- | The response's http status code.
    UpdateLicenseConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateLicenseConfigurationResponse
-> UpdateLicenseConfigurationResponse -> Bool
(UpdateLicenseConfigurationResponse
 -> UpdateLicenseConfigurationResponse -> Bool)
-> (UpdateLicenseConfigurationResponse
    -> UpdateLicenseConfigurationResponse -> Bool)
-> Eq UpdateLicenseConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLicenseConfigurationResponse
-> UpdateLicenseConfigurationResponse -> Bool
$c/= :: UpdateLicenseConfigurationResponse
-> UpdateLicenseConfigurationResponse -> Bool
== :: UpdateLicenseConfigurationResponse
-> UpdateLicenseConfigurationResponse -> Bool
$c== :: UpdateLicenseConfigurationResponse
-> UpdateLicenseConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLicenseConfigurationResponse]
ReadPrec UpdateLicenseConfigurationResponse
Int -> ReadS UpdateLicenseConfigurationResponse
ReadS [UpdateLicenseConfigurationResponse]
(Int -> ReadS UpdateLicenseConfigurationResponse)
-> ReadS [UpdateLicenseConfigurationResponse]
-> ReadPrec UpdateLicenseConfigurationResponse
-> ReadPrec [UpdateLicenseConfigurationResponse]
-> Read UpdateLicenseConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLicenseConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateLicenseConfigurationResponse]
readPrec :: ReadPrec UpdateLicenseConfigurationResponse
$creadPrec :: ReadPrec UpdateLicenseConfigurationResponse
readList :: ReadS [UpdateLicenseConfigurationResponse]
$creadList :: ReadS [UpdateLicenseConfigurationResponse]
readsPrec :: Int -> ReadS UpdateLicenseConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateLicenseConfigurationResponse
Prelude.Read, Int -> UpdateLicenseConfigurationResponse -> ShowS
[UpdateLicenseConfigurationResponse] -> ShowS
UpdateLicenseConfigurationResponse -> String
(Int -> UpdateLicenseConfigurationResponse -> ShowS)
-> (UpdateLicenseConfigurationResponse -> String)
-> ([UpdateLicenseConfigurationResponse] -> ShowS)
-> Show UpdateLicenseConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLicenseConfigurationResponse] -> ShowS
$cshowList :: [UpdateLicenseConfigurationResponse] -> ShowS
show :: UpdateLicenseConfigurationResponse -> String
$cshow :: UpdateLicenseConfigurationResponse -> String
showsPrec :: Int -> UpdateLicenseConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateLicenseConfigurationResponse -> ShowS
Prelude.Show, (forall x.
 UpdateLicenseConfigurationResponse
 -> Rep UpdateLicenseConfigurationResponse x)
-> (forall x.
    Rep UpdateLicenseConfigurationResponse x
    -> UpdateLicenseConfigurationResponse)
-> Generic UpdateLicenseConfigurationResponse
forall x.
Rep UpdateLicenseConfigurationResponse x
-> UpdateLicenseConfigurationResponse
forall x.
UpdateLicenseConfigurationResponse
-> Rep UpdateLicenseConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLicenseConfigurationResponse x
-> UpdateLicenseConfigurationResponse
$cfrom :: forall x.
UpdateLicenseConfigurationResponse
-> Rep UpdateLicenseConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLicenseConfigurationResponse' 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:
--
-- 'httpStatus', 'updateLicenseConfigurationResponse_httpStatus' - The response's http status code.
newUpdateLicenseConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateLicenseConfigurationResponse
newUpdateLicenseConfigurationResponse :: Int -> UpdateLicenseConfigurationResponse
newUpdateLicenseConfigurationResponse Int
pHttpStatus_ =
  UpdateLicenseConfigurationResponse' :: Int -> UpdateLicenseConfigurationResponse
UpdateLicenseConfigurationResponse'
    { $sel:httpStatus:UpdateLicenseConfigurationResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    UpdateLicenseConfigurationResponse