{-# 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.LicenseManagerLinuxSubscriptions.UpdateServiceSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates the service settings for Linux subscriptions.
module Amazonka.LicenseManagerLinuxSubscriptions.UpdateServiceSettings
  ( -- * Creating a Request
    UpdateServiceSettings (..),
    newUpdateServiceSettings,

    -- * Request Lenses
    updateServiceSettings_allowUpdate,
    updateServiceSettings_linuxSubscriptionsDiscovery,
    updateServiceSettings_linuxSubscriptionsDiscoverySettings,

    -- * Destructuring the Response
    UpdateServiceSettingsResponse (..),
    newUpdateServiceSettingsResponse,

    -- * Response Lenses
    updateServiceSettingsResponse_homeRegions,
    updateServiceSettingsResponse_linuxSubscriptionsDiscovery,
    updateServiceSettingsResponse_linuxSubscriptionsDiscoverySettings,
    updateServiceSettingsResponse_status,
    updateServiceSettingsResponse_statusMessage,
    updateServiceSettingsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateServiceSettings' smart constructor.
data UpdateServiceSettings = UpdateServiceSettings'
  { -- | Describes if updates are allowed to the service settings for Linux
    -- subscriptions. If you allow updates, you can aggregate Linux
    -- subscription data in more than one home Region.
    UpdateServiceSettings -> Maybe Bool
allowUpdate :: Prelude.Maybe Prelude.Bool,
    -- | Describes if the discovery of Linux subscriptions is enabled.
    UpdateServiceSettings -> LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery :: LinuxSubscriptionsDiscovery,
    -- | The settings defined for Linux subscriptions discovery. The settings
    -- include if Organizations integration has been enabled, and which Regions
    -- data will be aggregated from.
    UpdateServiceSettings -> LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings :: LinuxSubscriptionsDiscoverySettings
  }
  deriving (UpdateServiceSettings -> UpdateServiceSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
$c/= :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
== :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
$c== :: UpdateServiceSettings -> UpdateServiceSettings -> Bool
Prelude.Eq, ReadPrec [UpdateServiceSettings]
ReadPrec UpdateServiceSettings
Int -> ReadS UpdateServiceSettings
ReadS [UpdateServiceSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceSettings]
$creadListPrec :: ReadPrec [UpdateServiceSettings]
readPrec :: ReadPrec UpdateServiceSettings
$creadPrec :: ReadPrec UpdateServiceSettings
readList :: ReadS [UpdateServiceSettings]
$creadList :: ReadS [UpdateServiceSettings]
readsPrec :: Int -> ReadS UpdateServiceSettings
$creadsPrec :: Int -> ReadS UpdateServiceSettings
Prelude.Read, Int -> UpdateServiceSettings -> ShowS
[UpdateServiceSettings] -> ShowS
UpdateServiceSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceSettings] -> ShowS
$cshowList :: [UpdateServiceSettings] -> ShowS
show :: UpdateServiceSettings -> String
$cshow :: UpdateServiceSettings -> String
showsPrec :: Int -> UpdateServiceSettings -> ShowS
$cshowsPrec :: Int -> UpdateServiceSettings -> ShowS
Prelude.Show, forall x. Rep UpdateServiceSettings x -> UpdateServiceSettings
forall x. UpdateServiceSettings -> Rep UpdateServiceSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServiceSettings x -> UpdateServiceSettings
$cfrom :: forall x. UpdateServiceSettings -> Rep UpdateServiceSettings x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServiceSettings' 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:
--
-- 'allowUpdate', 'updateServiceSettings_allowUpdate' - Describes if updates are allowed to the service settings for Linux
-- subscriptions. If you allow updates, you can aggregate Linux
-- subscription data in more than one home Region.
--
-- 'linuxSubscriptionsDiscovery', 'updateServiceSettings_linuxSubscriptionsDiscovery' - Describes if the discovery of Linux subscriptions is enabled.
--
-- 'linuxSubscriptionsDiscoverySettings', 'updateServiceSettings_linuxSubscriptionsDiscoverySettings' - The settings defined for Linux subscriptions discovery. The settings
-- include if Organizations integration has been enabled, and which Regions
-- data will be aggregated from.
newUpdateServiceSettings ::
  -- | 'linuxSubscriptionsDiscovery'
  LinuxSubscriptionsDiscovery ->
  -- | 'linuxSubscriptionsDiscoverySettings'
  LinuxSubscriptionsDiscoverySettings ->
  UpdateServiceSettings
newUpdateServiceSettings :: LinuxSubscriptionsDiscovery
-> LinuxSubscriptionsDiscoverySettings -> UpdateServiceSettings
newUpdateServiceSettings
  LinuxSubscriptionsDiscovery
pLinuxSubscriptionsDiscovery_
  LinuxSubscriptionsDiscoverySettings
pLinuxSubscriptionsDiscoverySettings_ =
    UpdateServiceSettings'
      { $sel:allowUpdate:UpdateServiceSettings' :: Maybe Bool
allowUpdate =
          forall a. Maybe a
Prelude.Nothing,
        $sel:linuxSubscriptionsDiscovery:UpdateServiceSettings' :: LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery =
          LinuxSubscriptionsDiscovery
pLinuxSubscriptionsDiscovery_,
        $sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettings' :: LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings =
          LinuxSubscriptionsDiscoverySettings
pLinuxSubscriptionsDiscoverySettings_
      }

-- | Describes if updates are allowed to the service settings for Linux
-- subscriptions. If you allow updates, you can aggregate Linux
-- subscription data in more than one home Region.
updateServiceSettings_allowUpdate :: Lens.Lens' UpdateServiceSettings (Prelude.Maybe Prelude.Bool)
updateServiceSettings_allowUpdate :: Lens' UpdateServiceSettings (Maybe Bool)
updateServiceSettings_allowUpdate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettings' {Maybe Bool
allowUpdate :: Maybe Bool
$sel:allowUpdate:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Bool
allowUpdate} -> Maybe Bool
allowUpdate) (\s :: UpdateServiceSettings
s@UpdateServiceSettings' {} Maybe Bool
a -> UpdateServiceSettings
s {$sel:allowUpdate:UpdateServiceSettings' :: Maybe Bool
allowUpdate = Maybe Bool
a} :: UpdateServiceSettings)

-- | Describes if the discovery of Linux subscriptions is enabled.
updateServiceSettings_linuxSubscriptionsDiscovery :: Lens.Lens' UpdateServiceSettings LinuxSubscriptionsDiscovery
updateServiceSettings_linuxSubscriptionsDiscovery :: Lens' UpdateServiceSettings LinuxSubscriptionsDiscovery
updateServiceSettings_linuxSubscriptionsDiscovery = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettings' {LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery :: LinuxSubscriptionsDiscovery
$sel:linuxSubscriptionsDiscovery:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery} -> LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery) (\s :: UpdateServiceSettings
s@UpdateServiceSettings' {} LinuxSubscriptionsDiscovery
a -> UpdateServiceSettings
s {$sel:linuxSubscriptionsDiscovery:UpdateServiceSettings' :: LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery = LinuxSubscriptionsDiscovery
a} :: UpdateServiceSettings)

-- | The settings defined for Linux subscriptions discovery. The settings
-- include if Organizations integration has been enabled, and which Regions
-- data will be aggregated from.
updateServiceSettings_linuxSubscriptionsDiscoverySettings :: Lens.Lens' UpdateServiceSettings LinuxSubscriptionsDiscoverySettings
updateServiceSettings_linuxSubscriptionsDiscoverySettings :: Lens' UpdateServiceSettings LinuxSubscriptionsDiscoverySettings
updateServiceSettings_linuxSubscriptionsDiscoverySettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettings' {LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings :: LinuxSubscriptionsDiscoverySettings
$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings} -> LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings) (\s :: UpdateServiceSettings
s@UpdateServiceSettings' {} LinuxSubscriptionsDiscoverySettings
a -> UpdateServiceSettings
s {$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettings' :: LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings = LinuxSubscriptionsDiscoverySettings
a} :: UpdateServiceSettings)

instance Core.AWSRequest UpdateServiceSettings where
  type
    AWSResponse UpdateServiceSettings =
      UpdateServiceSettingsResponse
  request :: (Service -> Service)
-> UpdateServiceSettings -> Request UpdateServiceSettings
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 UpdateServiceSettings
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateServiceSettings)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (NonEmpty Text)
-> Maybe LinuxSubscriptionsDiscovery
-> Maybe LinuxSubscriptionsDiscoverySettings
-> Maybe Status
-> Maybe (HashMap Text Text)
-> Int
-> UpdateServiceSettingsResponse
UpdateServiceSettingsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"HomeRegions")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LinuxSubscriptionsDiscovery")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"LinuxSubscriptionsDiscoverySettings")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"StatusMessage" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateServiceSettings where
  hashWithSalt :: Int -> UpdateServiceSettings -> Int
hashWithSalt Int
_salt UpdateServiceSettings' {Maybe Bool
LinuxSubscriptionsDiscovery
LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings :: LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscovery :: LinuxSubscriptionsDiscovery
allowUpdate :: Maybe Bool
$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscoverySettings
$sel:linuxSubscriptionsDiscovery:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscovery
$sel:allowUpdate:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowUpdate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings

instance Prelude.NFData UpdateServiceSettings where
  rnf :: UpdateServiceSettings -> ()
rnf UpdateServiceSettings' {Maybe Bool
LinuxSubscriptionsDiscovery
LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings :: LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscovery :: LinuxSubscriptionsDiscovery
allowUpdate :: Maybe Bool
$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscoverySettings
$sel:linuxSubscriptionsDiscovery:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscovery
$sel:allowUpdate:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowUpdate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings

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

instance Data.ToJSON UpdateServiceSettings where
  toJSON :: UpdateServiceSettings -> Value
toJSON UpdateServiceSettings' {Maybe Bool
LinuxSubscriptionsDiscovery
LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings :: LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscovery :: LinuxSubscriptionsDiscovery
allowUpdate :: Maybe Bool
$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscoverySettings
$sel:linuxSubscriptionsDiscovery:UpdateServiceSettings' :: UpdateServiceSettings -> LinuxSubscriptionsDiscovery
$sel:allowUpdate:UpdateServiceSettings' :: UpdateServiceSettings -> Maybe Bool
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AllowUpdate" 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
allowUpdate,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"LinuxSubscriptionsDiscovery"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery
              ),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"LinuxSubscriptionsDiscoverySettings"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings
              )
          ]
      )

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

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

-- | /See:/ 'newUpdateServiceSettingsResponse' smart constructor.
data UpdateServiceSettingsResponse = UpdateServiceSettingsResponse'
  { -- | The Region in which License Manager displays the aggregated data for
    -- Linux subscriptions.
    UpdateServiceSettingsResponse -> Maybe (NonEmpty Text)
homeRegions :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | Lists if discovery has been enabled for Linux subscriptions.
    UpdateServiceSettingsResponse -> Maybe LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery :: Prelude.Maybe LinuxSubscriptionsDiscovery,
    -- | The settings defined for Linux subscriptions discovery. The settings
    -- include if Organizations integration has been enabled, and which Regions
    -- data will be aggregated from.
    UpdateServiceSettingsResponse
-> Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings :: Prelude.Maybe LinuxSubscriptionsDiscoverySettings,
    -- | Indicates the status of Linux subscriptions settings being applied.
    UpdateServiceSettingsResponse -> Maybe Status
status :: Prelude.Maybe Status,
    -- | A message which details the Linux subscriptions service settings current
    -- status.
    UpdateServiceSettingsResponse -> Maybe (HashMap Text Text)
statusMessage :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    UpdateServiceSettingsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
$c/= :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
== :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
$c== :: UpdateServiceSettingsResponse
-> UpdateServiceSettingsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateServiceSettingsResponse]
ReadPrec UpdateServiceSettingsResponse
Int -> ReadS UpdateServiceSettingsResponse
ReadS [UpdateServiceSettingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServiceSettingsResponse]
$creadListPrec :: ReadPrec [UpdateServiceSettingsResponse]
readPrec :: ReadPrec UpdateServiceSettingsResponse
$creadPrec :: ReadPrec UpdateServiceSettingsResponse
readList :: ReadS [UpdateServiceSettingsResponse]
$creadList :: ReadS [UpdateServiceSettingsResponse]
readsPrec :: Int -> ReadS UpdateServiceSettingsResponse
$creadsPrec :: Int -> ReadS UpdateServiceSettingsResponse
Prelude.Read, Int -> UpdateServiceSettingsResponse -> ShowS
[UpdateServiceSettingsResponse] -> ShowS
UpdateServiceSettingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServiceSettingsResponse] -> ShowS
$cshowList :: [UpdateServiceSettingsResponse] -> ShowS
show :: UpdateServiceSettingsResponse -> String
$cshow :: UpdateServiceSettingsResponse -> String
showsPrec :: Int -> UpdateServiceSettingsResponse -> ShowS
$cshowsPrec :: Int -> UpdateServiceSettingsResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateServiceSettingsResponse x
-> UpdateServiceSettingsResponse
forall x.
UpdateServiceSettingsResponse
-> Rep UpdateServiceSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateServiceSettingsResponse x
-> UpdateServiceSettingsResponse
$cfrom :: forall x.
UpdateServiceSettingsResponse
-> Rep UpdateServiceSettingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServiceSettingsResponse' 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:
--
-- 'homeRegions', 'updateServiceSettingsResponse_homeRegions' - The Region in which License Manager displays the aggregated data for
-- Linux subscriptions.
--
-- 'linuxSubscriptionsDiscovery', 'updateServiceSettingsResponse_linuxSubscriptionsDiscovery' - Lists if discovery has been enabled for Linux subscriptions.
--
-- 'linuxSubscriptionsDiscoverySettings', 'updateServiceSettingsResponse_linuxSubscriptionsDiscoverySettings' - The settings defined for Linux subscriptions discovery. The settings
-- include if Organizations integration has been enabled, and which Regions
-- data will be aggregated from.
--
-- 'status', 'updateServiceSettingsResponse_status' - Indicates the status of Linux subscriptions settings being applied.
--
-- 'statusMessage', 'updateServiceSettingsResponse_statusMessage' - A message which details the Linux subscriptions service settings current
-- status.
--
-- 'httpStatus', 'updateServiceSettingsResponse_httpStatus' - The response's http status code.
newUpdateServiceSettingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateServiceSettingsResponse
newUpdateServiceSettingsResponse :: Int -> UpdateServiceSettingsResponse
newUpdateServiceSettingsResponse Int
pHttpStatus_ =
  UpdateServiceSettingsResponse'
    { $sel:homeRegions:UpdateServiceSettingsResponse' :: Maybe (NonEmpty Text)
homeRegions =
        forall a. Maybe a
Prelude.Nothing,
      $sel:linuxSubscriptionsDiscovery:UpdateServiceSettingsResponse' :: Maybe LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery =
        forall a. Maybe a
Prelude.Nothing,
      $sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettingsResponse' :: Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings =
        forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateServiceSettingsResponse' :: Maybe Status
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:UpdateServiceSettingsResponse' :: Maybe (HashMap Text Text)
statusMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateServiceSettingsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Region in which License Manager displays the aggregated data for
-- Linux subscriptions.
updateServiceSettingsResponse_homeRegions :: Lens.Lens' UpdateServiceSettingsResponse (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
updateServiceSettingsResponse_homeRegions :: Lens' UpdateServiceSettingsResponse (Maybe (NonEmpty Text))
updateServiceSettingsResponse_homeRegions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettingsResponse' {Maybe (NonEmpty Text)
homeRegions :: Maybe (NonEmpty Text)
$sel:homeRegions:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe (NonEmpty Text)
homeRegions} -> Maybe (NonEmpty Text)
homeRegions) (\s :: UpdateServiceSettingsResponse
s@UpdateServiceSettingsResponse' {} Maybe (NonEmpty Text)
a -> UpdateServiceSettingsResponse
s {$sel:homeRegions:UpdateServiceSettingsResponse' :: Maybe (NonEmpty Text)
homeRegions = Maybe (NonEmpty Text)
a} :: UpdateServiceSettingsResponse) 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

-- | Lists if discovery has been enabled for Linux subscriptions.
updateServiceSettingsResponse_linuxSubscriptionsDiscovery :: Lens.Lens' UpdateServiceSettingsResponse (Prelude.Maybe LinuxSubscriptionsDiscovery)
updateServiceSettingsResponse_linuxSubscriptionsDiscovery :: Lens'
  UpdateServiceSettingsResponse (Maybe LinuxSubscriptionsDiscovery)
updateServiceSettingsResponse_linuxSubscriptionsDiscovery = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettingsResponse' {Maybe LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery :: Maybe LinuxSubscriptionsDiscovery
$sel:linuxSubscriptionsDiscovery:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery} -> Maybe LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery) (\s :: UpdateServiceSettingsResponse
s@UpdateServiceSettingsResponse' {} Maybe LinuxSubscriptionsDiscovery
a -> UpdateServiceSettingsResponse
s {$sel:linuxSubscriptionsDiscovery:UpdateServiceSettingsResponse' :: Maybe LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery = Maybe LinuxSubscriptionsDiscovery
a} :: UpdateServiceSettingsResponse)

-- | The settings defined for Linux subscriptions discovery. The settings
-- include if Organizations integration has been enabled, and which Regions
-- data will be aggregated from.
updateServiceSettingsResponse_linuxSubscriptionsDiscoverySettings :: Lens.Lens' UpdateServiceSettingsResponse (Prelude.Maybe LinuxSubscriptionsDiscoverySettings)
updateServiceSettingsResponse_linuxSubscriptionsDiscoverySettings :: Lens'
  UpdateServiceSettingsResponse
  (Maybe LinuxSubscriptionsDiscoverySettings)
updateServiceSettingsResponse_linuxSubscriptionsDiscoverySettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettingsResponse' {Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings :: Maybe LinuxSubscriptionsDiscoverySettings
$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse
-> Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings} -> Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings) (\s :: UpdateServiceSettingsResponse
s@UpdateServiceSettingsResponse' {} Maybe LinuxSubscriptionsDiscoverySettings
a -> UpdateServiceSettingsResponse
s {$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettingsResponse' :: Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings = Maybe LinuxSubscriptionsDiscoverySettings
a} :: UpdateServiceSettingsResponse)

-- | Indicates the status of Linux subscriptions settings being applied.
updateServiceSettingsResponse_status :: Lens.Lens' UpdateServiceSettingsResponse (Prelude.Maybe Status)
updateServiceSettingsResponse_status :: Lens' UpdateServiceSettingsResponse (Maybe Status)
updateServiceSettingsResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettingsResponse' {Maybe Status
status :: Maybe Status
$sel:status:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe Status
status} -> Maybe Status
status) (\s :: UpdateServiceSettingsResponse
s@UpdateServiceSettingsResponse' {} Maybe Status
a -> UpdateServiceSettingsResponse
s {$sel:status:UpdateServiceSettingsResponse' :: Maybe Status
status = Maybe Status
a} :: UpdateServiceSettingsResponse)

-- | A message which details the Linux subscriptions service settings current
-- status.
updateServiceSettingsResponse_statusMessage :: Lens.Lens' UpdateServiceSettingsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
updateServiceSettingsResponse_statusMessage :: Lens' UpdateServiceSettingsResponse (Maybe (HashMap Text Text))
updateServiceSettingsResponse_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServiceSettingsResponse' {Maybe (HashMap Text Text)
statusMessage :: Maybe (HashMap Text Text)
$sel:statusMessage:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe (HashMap Text Text)
statusMessage} -> Maybe (HashMap Text Text)
statusMessage) (\s :: UpdateServiceSettingsResponse
s@UpdateServiceSettingsResponse' {} Maybe (HashMap Text Text)
a -> UpdateServiceSettingsResponse
s {$sel:statusMessage:UpdateServiceSettingsResponse' :: Maybe (HashMap Text Text)
statusMessage = Maybe (HashMap Text Text)
a} :: UpdateServiceSettingsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData UpdateServiceSettingsResponse where
  rnf :: UpdateServiceSettingsResponse -> ()
rnf UpdateServiceSettingsResponse' {Int
Maybe (NonEmpty Text)
Maybe (HashMap Text Text)
Maybe LinuxSubscriptionsDiscovery
Maybe LinuxSubscriptionsDiscoverySettings
Maybe Status
httpStatus :: Int
statusMessage :: Maybe (HashMap Text Text)
status :: Maybe Status
linuxSubscriptionsDiscoverySettings :: Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscovery :: Maybe LinuxSubscriptionsDiscovery
homeRegions :: Maybe (NonEmpty Text)
$sel:httpStatus:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Int
$sel:statusMessage:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe (HashMap Text Text)
$sel:status:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe Status
$sel:linuxSubscriptionsDiscoverySettings:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse
-> Maybe LinuxSubscriptionsDiscoverySettings
$sel:linuxSubscriptionsDiscovery:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe LinuxSubscriptionsDiscovery
$sel:homeRegions:UpdateServiceSettingsResponse' :: UpdateServiceSettingsResponse -> Maybe (NonEmpty Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
homeRegions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LinuxSubscriptionsDiscovery
linuxSubscriptionsDiscovery
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LinuxSubscriptionsDiscoverySettings
linuxSubscriptionsDiscoverySettings
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Status
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
statusMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus