{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- 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_description,
    updateLicenseConfiguration_disassociateWhenNotFound,
    updateLicenseConfiguration_licenseConfigurationStatus,
    updateLicenseConfiguration_licenseCount,
    updateLicenseConfiguration_licenseCountHardLimit,
    updateLicenseConfiguration_licenseRules,
    updateLicenseConfiguration_name,
    updateLicenseConfiguration_productInformationList,
    updateLicenseConfiguration_licenseConfigurationArn,

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

    -- * Response Lenses
    updateLicenseConfigurationResponse_httpStatus,
  )
where

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

-- | New description of the license configuration.
updateLicenseConfiguration_description :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Text)
updateLicenseConfiguration_description :: Lens' UpdateLicenseConfiguration (Maybe Text)
updateLicenseConfiguration_description = 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)

-- | When true, disassociates a resource when software is uninstalled.
updateLicenseConfiguration_disassociateWhenNotFound :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Bool)
updateLicenseConfiguration_disassociateWhenNotFound :: Lens' UpdateLicenseConfiguration (Maybe Bool)
updateLicenseConfiguration_disassociateWhenNotFound = 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 status of the license configuration.
updateLicenseConfiguration_licenseConfigurationStatus :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe LicenseConfigurationStatus)
updateLicenseConfiguration_licenseConfigurationStatus :: Lens' UpdateLicenseConfiguration (Maybe LicenseConfigurationStatus)
updateLicenseConfiguration_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 number of licenses managed by the license configuration.
updateLicenseConfiguration_licenseCount :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Integer)
updateLicenseConfiguration_licenseCount :: Lens' UpdateLicenseConfiguration (Maybe Integer)
updateLicenseConfiguration_licenseCount = 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 hard limit of the number of available licenses.
updateLicenseConfiguration_licenseCountHardLimit :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Bool)
updateLicenseConfiguration_licenseCountHardLimit :: Lens' UpdateLicenseConfiguration (Maybe Bool)
updateLicenseConfiguration_licenseCountHardLimit = 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)

-- | 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 :: Lens' UpdateLicenseConfiguration (Maybe [Text])
updateLicenseConfiguration_licenseRules = 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) 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

-- | New name of the license configuration.
updateLicenseConfiguration_name :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe Prelude.Text)
updateLicenseConfiguration_name :: Lens' UpdateLicenseConfiguration (Maybe Text)
updateLicenseConfiguration_name = 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 product information.
updateLicenseConfiguration_productInformationList :: Lens.Lens' UpdateLicenseConfiguration (Prelude.Maybe [ProductInformation])
updateLicenseConfiguration_productInformationList :: Lens' UpdateLicenseConfiguration (Maybe [ProductInformation])
updateLicenseConfiguration_productInformationList = 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) 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

-- | Amazon Resource Name (ARN) of the license configuration.
updateLicenseConfiguration_licenseConfigurationArn :: Lens.Lens' UpdateLicenseConfiguration Prelude.Text
updateLicenseConfiguration_licenseConfigurationArn :: Lens' UpdateLicenseConfiguration Text
updateLicenseConfiguration_licenseConfigurationArn = 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 :: (Service -> Service)
-> UpdateLicenseConfiguration -> Request UpdateLicenseConfiguration
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 UpdateLicenseConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLicenseConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateLicenseConfigurationResponse
UpdateLicenseConfigurationResponse'
            forall (f :: * -> *) a b. Functor 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 UpdateLicenseConfiguration where
  hashWithSalt :: Int -> UpdateLicenseConfiguration -> Int
hashWithSalt Int
_salt UpdateLicenseConfiguration' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [ProductInformation]
Maybe Text
Maybe LicenseConfigurationStatus
Text
licenseConfigurationArn :: Text
productInformationList :: Maybe [ProductInformation]
name :: Maybe Text
licenseRules :: Maybe [Text]
licenseCountHardLimit :: Maybe Bool
licenseCount :: Maybe Integer
licenseConfigurationStatus :: Maybe LicenseConfigurationStatus
disassociateWhenNotFound :: Maybe Bool
description :: Maybe Text
$sel:licenseConfigurationArn:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Text
$sel:productInformationList:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [ProductInformation]
$sel:name:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
$sel:licenseRules:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [Text]
$sel:licenseCountHardLimit:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
$sel:licenseCount:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Integer
$sel:licenseConfigurationStatus:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe LicenseConfigurationStatus
$sel:disassociateWhenNotFound:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
$sel:description:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disassociateWhenNotFound
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LicenseConfigurationStatus
licenseConfigurationStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
licenseCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
licenseCountHardLimit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
licenseRules
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ProductInformation]
productInformationList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
licenseConfigurationArn

instance Prelude.NFData UpdateLicenseConfiguration where
  rnf :: UpdateLicenseConfiguration -> ()
rnf UpdateLicenseConfiguration' {Maybe Bool
Maybe Integer
Maybe [Text]
Maybe [ProductInformation]
Maybe Text
Maybe LicenseConfigurationStatus
Text
licenseConfigurationArn :: Text
productInformationList :: Maybe [ProductInformation]
name :: Maybe Text
licenseRules :: Maybe [Text]
licenseCountHardLimit :: Maybe Bool
licenseCount :: Maybe Integer
licenseConfigurationStatus :: Maybe LicenseConfigurationStatus
disassociateWhenNotFound :: Maybe Bool
description :: Maybe Text
$sel:licenseConfigurationArn:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Text
$sel:productInformationList:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [ProductInformation]
$sel:name:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
$sel:licenseRules:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe [Text]
$sel:licenseCountHardLimit:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
$sel:licenseCount:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Integer
$sel:licenseConfigurationStatus:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe LicenseConfigurationStatus
$sel:disassociateWhenNotFound:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Bool
$sel:description:UpdateLicenseConfiguration' :: UpdateLicenseConfiguration -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disassociateWhenNotFound
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LicenseConfigurationStatus
licenseConfigurationStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
licenseCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
licenseCountHardLimit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
licenseRules
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProductInformation]
productInformationList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
licenseConfigurationArn

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

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

instance Data.ToQuery UpdateLicenseConfiguration where
  toQuery :: UpdateLicenseConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const 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
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]
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
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.
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'
    { $sel:httpStatus:UpdateLicenseConfigurationResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
updateLicenseConfigurationResponse_httpStatus :: Lens.Lens' UpdateLicenseConfigurationResponse Prelude.Int
updateLicenseConfigurationResponse_httpStatus :: Lens' UpdateLicenseConfigurationResponse Int
updateLicenseConfigurationResponse_httpStatus = 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
  where
  rnf :: UpdateLicenseConfigurationResponse -> ()
rnf UpdateLicenseConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateLicenseConfigurationResponse' :: UpdateLicenseConfigurationResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus