{-# 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.ComputeOptimizer.UpdateEnrollmentStatus
-- 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)
--
-- Updates the enrollment (opt in and opt out) status of an account to the
-- Compute Optimizer service.
--
-- If the account is a management account of an organization, this action
-- can also be used to enroll member accounts of the organization.
--
-- You must have the appropriate permissions to opt in to Compute
-- Optimizer, to view its recommendations, and to opt out. For more
-- information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/security-iam.html Controlling access with Amazon Web Services Identity and Access Management>
-- in the /Compute Optimizer User Guide/.
--
-- When you opt in, Compute Optimizer automatically creates a
-- service-linked role in your account to access its data. For more
-- information, see
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/using-service-linked-roles.html Using Service-Linked Roles for Compute Optimizer>
-- in the /Compute Optimizer User Guide/.
module Amazonka.ComputeOptimizer.UpdateEnrollmentStatus
  ( -- * Creating a Request
    UpdateEnrollmentStatus (..),
    newUpdateEnrollmentStatus,

    -- * Request Lenses
    updateEnrollmentStatus_includeMemberAccounts,
    updateEnrollmentStatus_status,

    -- * Destructuring the Response
    UpdateEnrollmentStatusResponse (..),
    newUpdateEnrollmentStatusResponse,

    -- * Response Lenses
    updateEnrollmentStatusResponse_status,
    updateEnrollmentStatusResponse_statusReason,
    updateEnrollmentStatusResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateEnrollmentStatus' smart constructor.
data UpdateEnrollmentStatus = UpdateEnrollmentStatus'
  { -- | Indicates whether to enroll member accounts of the organization if the
    -- account is the management account of an organization.
    UpdateEnrollmentStatus -> Maybe Bool
includeMemberAccounts :: Prelude.Maybe Prelude.Bool,
    -- | The new enrollment status of the account.
    --
    -- The following status options are available:
    --
    -- -   @Active@ - Opts in your account to the Compute Optimizer service.
    --     Compute Optimizer begins analyzing the configuration and utilization
    --     metrics of your Amazon Web Services resources after you opt in. For
    --     more information, see
    --     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html Metrics analyzed by Compute Optimizer>
    --     in the /Compute Optimizer User Guide/.
    --
    -- -   @Inactive@ - Opts out your account from the Compute Optimizer
    --     service. Your account\'s recommendations and related metrics data
    --     will be deleted from Compute Optimizer after you opt out.
    --
    -- The @Pending@ and @Failed@ options cannot be used to update the
    -- enrollment status of an account. They are returned in the response of a
    -- request to update the enrollment status of an account.
    UpdateEnrollmentStatus -> Status
status :: Status
  }
  deriving (UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
(UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool)
-> (UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool)
-> Eq UpdateEnrollmentStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
$c/= :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
== :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
$c== :: UpdateEnrollmentStatus -> UpdateEnrollmentStatus -> Bool
Prelude.Eq, ReadPrec [UpdateEnrollmentStatus]
ReadPrec UpdateEnrollmentStatus
Int -> ReadS UpdateEnrollmentStatus
ReadS [UpdateEnrollmentStatus]
(Int -> ReadS UpdateEnrollmentStatus)
-> ReadS [UpdateEnrollmentStatus]
-> ReadPrec UpdateEnrollmentStatus
-> ReadPrec [UpdateEnrollmentStatus]
-> Read UpdateEnrollmentStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnrollmentStatus]
$creadListPrec :: ReadPrec [UpdateEnrollmentStatus]
readPrec :: ReadPrec UpdateEnrollmentStatus
$creadPrec :: ReadPrec UpdateEnrollmentStatus
readList :: ReadS [UpdateEnrollmentStatus]
$creadList :: ReadS [UpdateEnrollmentStatus]
readsPrec :: Int -> ReadS UpdateEnrollmentStatus
$creadsPrec :: Int -> ReadS UpdateEnrollmentStatus
Prelude.Read, Int -> UpdateEnrollmentStatus -> ShowS
[UpdateEnrollmentStatus] -> ShowS
UpdateEnrollmentStatus -> String
(Int -> UpdateEnrollmentStatus -> ShowS)
-> (UpdateEnrollmentStatus -> String)
-> ([UpdateEnrollmentStatus] -> ShowS)
-> Show UpdateEnrollmentStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnrollmentStatus] -> ShowS
$cshowList :: [UpdateEnrollmentStatus] -> ShowS
show :: UpdateEnrollmentStatus -> String
$cshow :: UpdateEnrollmentStatus -> String
showsPrec :: Int -> UpdateEnrollmentStatus -> ShowS
$cshowsPrec :: Int -> UpdateEnrollmentStatus -> ShowS
Prelude.Show, (forall x. UpdateEnrollmentStatus -> Rep UpdateEnrollmentStatus x)
-> (forall x.
    Rep UpdateEnrollmentStatus x -> UpdateEnrollmentStatus)
-> Generic UpdateEnrollmentStatus
forall x. Rep UpdateEnrollmentStatus x -> UpdateEnrollmentStatus
forall x. UpdateEnrollmentStatus -> Rep UpdateEnrollmentStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateEnrollmentStatus x -> UpdateEnrollmentStatus
$cfrom :: forall x. UpdateEnrollmentStatus -> Rep UpdateEnrollmentStatus x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEnrollmentStatus' 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:
--
-- 'includeMemberAccounts', 'updateEnrollmentStatus_includeMemberAccounts' - Indicates whether to enroll member accounts of the organization if the
-- account is the management account of an organization.
--
-- 'status', 'updateEnrollmentStatus_status' - The new enrollment status of the account.
--
-- The following status options are available:
--
-- -   @Active@ - Opts in your account to the Compute Optimizer service.
--     Compute Optimizer begins analyzing the configuration and utilization
--     metrics of your Amazon Web Services resources after you opt in. For
--     more information, see
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html Metrics analyzed by Compute Optimizer>
--     in the /Compute Optimizer User Guide/.
--
-- -   @Inactive@ - Opts out your account from the Compute Optimizer
--     service. Your account\'s recommendations and related metrics data
--     will be deleted from Compute Optimizer after you opt out.
--
-- The @Pending@ and @Failed@ options cannot be used to update the
-- enrollment status of an account. They are returned in the response of a
-- request to update the enrollment status of an account.
newUpdateEnrollmentStatus ::
  -- | 'status'
  Status ->
  UpdateEnrollmentStatus
newUpdateEnrollmentStatus :: Status -> UpdateEnrollmentStatus
newUpdateEnrollmentStatus Status
pStatus_ =
  UpdateEnrollmentStatus' :: Maybe Bool -> Status -> UpdateEnrollmentStatus
UpdateEnrollmentStatus'
    { $sel:includeMemberAccounts:UpdateEnrollmentStatus' :: Maybe Bool
includeMemberAccounts =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:status:UpdateEnrollmentStatus' :: Status
status = Status
pStatus_
    }

-- | Indicates whether to enroll member accounts of the organization if the
-- account is the management account of an organization.
updateEnrollmentStatus_includeMemberAccounts :: Lens.Lens' UpdateEnrollmentStatus (Prelude.Maybe Prelude.Bool)
updateEnrollmentStatus_includeMemberAccounts :: (Maybe Bool -> f (Maybe Bool))
-> UpdateEnrollmentStatus -> f UpdateEnrollmentStatus
updateEnrollmentStatus_includeMemberAccounts = (UpdateEnrollmentStatus -> Maybe Bool)
-> (UpdateEnrollmentStatus -> Maybe Bool -> UpdateEnrollmentStatus)
-> Lens
     UpdateEnrollmentStatus
     UpdateEnrollmentStatus
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatus' {Maybe Bool
includeMemberAccounts :: Maybe Bool
$sel:includeMemberAccounts:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Maybe Bool
includeMemberAccounts} -> Maybe Bool
includeMemberAccounts) (\s :: UpdateEnrollmentStatus
s@UpdateEnrollmentStatus' {} Maybe Bool
a -> UpdateEnrollmentStatus
s {$sel:includeMemberAccounts:UpdateEnrollmentStatus' :: Maybe Bool
includeMemberAccounts = Maybe Bool
a} :: UpdateEnrollmentStatus)

-- | The new enrollment status of the account.
--
-- The following status options are available:
--
-- -   @Active@ - Opts in your account to the Compute Optimizer service.
--     Compute Optimizer begins analyzing the configuration and utilization
--     metrics of your Amazon Web Services resources after you opt in. For
--     more information, see
--     <https://docs.aws.amazon.com/compute-optimizer/latest/ug/metrics.html Metrics analyzed by Compute Optimizer>
--     in the /Compute Optimizer User Guide/.
--
-- -   @Inactive@ - Opts out your account from the Compute Optimizer
--     service. Your account\'s recommendations and related metrics data
--     will be deleted from Compute Optimizer after you opt out.
--
-- The @Pending@ and @Failed@ options cannot be used to update the
-- enrollment status of an account. They are returned in the response of a
-- request to update the enrollment status of an account.
updateEnrollmentStatus_status :: Lens.Lens' UpdateEnrollmentStatus Status
updateEnrollmentStatus_status :: (Status -> f Status)
-> UpdateEnrollmentStatus -> f UpdateEnrollmentStatus
updateEnrollmentStatus_status = (UpdateEnrollmentStatus -> Status)
-> (UpdateEnrollmentStatus -> Status -> UpdateEnrollmentStatus)
-> Lens UpdateEnrollmentStatus UpdateEnrollmentStatus Status Status
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatus' {Status
status :: Status
$sel:status:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Status
status} -> Status
status) (\s :: UpdateEnrollmentStatus
s@UpdateEnrollmentStatus' {} Status
a -> UpdateEnrollmentStatus
s {$sel:status:UpdateEnrollmentStatus' :: Status
status = Status
a} :: UpdateEnrollmentStatus)

instance Core.AWSRequest UpdateEnrollmentStatus where
  type
    AWSResponse UpdateEnrollmentStatus =
      UpdateEnrollmentStatusResponse
  request :: UpdateEnrollmentStatus -> Request UpdateEnrollmentStatus
request = Service -> UpdateEnrollmentStatus -> Request UpdateEnrollmentStatus
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateEnrollmentStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateEnrollmentStatus)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateEnrollmentStatus))
-> Logger
-> Service
-> Proxy UpdateEnrollmentStatus
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateEnrollmentStatus)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Status -> Maybe Text -> Int -> UpdateEnrollmentStatusResponse
UpdateEnrollmentStatusResponse'
            (Maybe Status
 -> Maybe Text -> Int -> UpdateEnrollmentStatusResponse)
-> Either String (Maybe Status)
-> Either
     String (Maybe Text -> Int -> UpdateEnrollmentStatusResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Status)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"status")
            Either String (Maybe Text -> Int -> UpdateEnrollmentStatusResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateEnrollmentStatusResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"statusReason")
            Either String (Int -> UpdateEnrollmentStatusResponse)
-> Either String Int
-> Either String UpdateEnrollmentStatusResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateEnrollmentStatus

instance Prelude.NFData UpdateEnrollmentStatus

instance Core.ToHeaders UpdateEnrollmentStatus where
  toHeaders :: UpdateEnrollmentStatus -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateEnrollmentStatus -> 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
"ComputeOptimizerService.UpdateEnrollmentStatus" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateEnrollmentStatus where
  toJSON :: UpdateEnrollmentStatus -> Value
toJSON UpdateEnrollmentStatus' {Maybe Bool
Status
status :: Status
includeMemberAccounts :: Maybe Bool
$sel:status:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Status
$sel:includeMemberAccounts:UpdateEnrollmentStatus' :: UpdateEnrollmentStatus -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"includeMemberAccounts" 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
includeMemberAccounts,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"status" Text -> Status -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Status
status)
          ]
      )

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

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

-- | /See:/ 'newUpdateEnrollmentStatusResponse' smart constructor.
data UpdateEnrollmentStatusResponse = UpdateEnrollmentStatusResponse'
  { -- | The enrollment status of the account.
    UpdateEnrollmentStatusResponse -> Maybe Status
status :: Prelude.Maybe Status,
    -- | The reason for the enrollment status of the account. For example, an
    -- account might show a status of @Pending@ because member accounts of an
    -- organization require more time to be enrolled in the service.
    UpdateEnrollmentStatusResponse -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateEnrollmentStatusResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
(UpdateEnrollmentStatusResponse
 -> UpdateEnrollmentStatusResponse -> Bool)
-> (UpdateEnrollmentStatusResponse
    -> UpdateEnrollmentStatusResponse -> Bool)
-> Eq UpdateEnrollmentStatusResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
$c/= :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
== :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
$c== :: UpdateEnrollmentStatusResponse
-> UpdateEnrollmentStatusResponse -> Bool
Prelude.Eq, ReadPrec [UpdateEnrollmentStatusResponse]
ReadPrec UpdateEnrollmentStatusResponse
Int -> ReadS UpdateEnrollmentStatusResponse
ReadS [UpdateEnrollmentStatusResponse]
(Int -> ReadS UpdateEnrollmentStatusResponse)
-> ReadS [UpdateEnrollmentStatusResponse]
-> ReadPrec UpdateEnrollmentStatusResponse
-> ReadPrec [UpdateEnrollmentStatusResponse]
-> Read UpdateEnrollmentStatusResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateEnrollmentStatusResponse]
$creadListPrec :: ReadPrec [UpdateEnrollmentStatusResponse]
readPrec :: ReadPrec UpdateEnrollmentStatusResponse
$creadPrec :: ReadPrec UpdateEnrollmentStatusResponse
readList :: ReadS [UpdateEnrollmentStatusResponse]
$creadList :: ReadS [UpdateEnrollmentStatusResponse]
readsPrec :: Int -> ReadS UpdateEnrollmentStatusResponse
$creadsPrec :: Int -> ReadS UpdateEnrollmentStatusResponse
Prelude.Read, Int -> UpdateEnrollmentStatusResponse -> ShowS
[UpdateEnrollmentStatusResponse] -> ShowS
UpdateEnrollmentStatusResponse -> String
(Int -> UpdateEnrollmentStatusResponse -> ShowS)
-> (UpdateEnrollmentStatusResponse -> String)
-> ([UpdateEnrollmentStatusResponse] -> ShowS)
-> Show UpdateEnrollmentStatusResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateEnrollmentStatusResponse] -> ShowS
$cshowList :: [UpdateEnrollmentStatusResponse] -> ShowS
show :: UpdateEnrollmentStatusResponse -> String
$cshow :: UpdateEnrollmentStatusResponse -> String
showsPrec :: Int -> UpdateEnrollmentStatusResponse -> ShowS
$cshowsPrec :: Int -> UpdateEnrollmentStatusResponse -> ShowS
Prelude.Show, (forall x.
 UpdateEnrollmentStatusResponse
 -> Rep UpdateEnrollmentStatusResponse x)
-> (forall x.
    Rep UpdateEnrollmentStatusResponse x
    -> UpdateEnrollmentStatusResponse)
-> Generic UpdateEnrollmentStatusResponse
forall x.
Rep UpdateEnrollmentStatusResponse x
-> UpdateEnrollmentStatusResponse
forall x.
UpdateEnrollmentStatusResponse
-> Rep UpdateEnrollmentStatusResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateEnrollmentStatusResponse x
-> UpdateEnrollmentStatusResponse
$cfrom :: forall x.
UpdateEnrollmentStatusResponse
-> Rep UpdateEnrollmentStatusResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateEnrollmentStatusResponse' 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:
--
-- 'status', 'updateEnrollmentStatusResponse_status' - The enrollment status of the account.
--
-- 'statusReason', 'updateEnrollmentStatusResponse_statusReason' - The reason for the enrollment status of the account. For example, an
-- account might show a status of @Pending@ because member accounts of an
-- organization require more time to be enrolled in the service.
--
-- 'httpStatus', 'updateEnrollmentStatusResponse_httpStatus' - The response's http status code.
newUpdateEnrollmentStatusResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateEnrollmentStatusResponse
newUpdateEnrollmentStatusResponse :: Int -> UpdateEnrollmentStatusResponse
newUpdateEnrollmentStatusResponse Int
pHttpStatus_ =
  UpdateEnrollmentStatusResponse' :: Maybe Status -> Maybe Text -> Int -> UpdateEnrollmentStatusResponse
UpdateEnrollmentStatusResponse'
    { $sel:status:UpdateEnrollmentStatusResponse' :: Maybe Status
status =
        Maybe Status
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:UpdateEnrollmentStatusResponse' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateEnrollmentStatusResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The enrollment status of the account.
updateEnrollmentStatusResponse_status :: Lens.Lens' UpdateEnrollmentStatusResponse (Prelude.Maybe Status)
updateEnrollmentStatusResponse_status :: (Maybe Status -> f (Maybe Status))
-> UpdateEnrollmentStatusResponse
-> f UpdateEnrollmentStatusResponse
updateEnrollmentStatusResponse_status = (UpdateEnrollmentStatusResponse -> Maybe Status)
-> (UpdateEnrollmentStatusResponse
    -> Maybe Status -> UpdateEnrollmentStatusResponse)
-> Lens
     UpdateEnrollmentStatusResponse
     UpdateEnrollmentStatusResponse
     (Maybe Status)
     (Maybe Status)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatusResponse' {Maybe Status
status :: Maybe Status
$sel:status:UpdateEnrollmentStatusResponse' :: UpdateEnrollmentStatusResponse -> Maybe Status
status} -> Maybe Status
status) (\s :: UpdateEnrollmentStatusResponse
s@UpdateEnrollmentStatusResponse' {} Maybe Status
a -> UpdateEnrollmentStatusResponse
s {$sel:status:UpdateEnrollmentStatusResponse' :: Maybe Status
status = Maybe Status
a} :: UpdateEnrollmentStatusResponse)

-- | The reason for the enrollment status of the account. For example, an
-- account might show a status of @Pending@ because member accounts of an
-- organization require more time to be enrolled in the service.
updateEnrollmentStatusResponse_statusReason :: Lens.Lens' UpdateEnrollmentStatusResponse (Prelude.Maybe Prelude.Text)
updateEnrollmentStatusResponse_statusReason :: (Maybe Text -> f (Maybe Text))
-> UpdateEnrollmentStatusResponse
-> f UpdateEnrollmentStatusResponse
updateEnrollmentStatusResponse_statusReason = (UpdateEnrollmentStatusResponse -> Maybe Text)
-> (UpdateEnrollmentStatusResponse
    -> Maybe Text -> UpdateEnrollmentStatusResponse)
-> Lens
     UpdateEnrollmentStatusResponse
     UpdateEnrollmentStatusResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateEnrollmentStatusResponse' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:UpdateEnrollmentStatusResponse' :: UpdateEnrollmentStatusResponse -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: UpdateEnrollmentStatusResponse
s@UpdateEnrollmentStatusResponse' {} Maybe Text
a -> UpdateEnrollmentStatusResponse
s {$sel:statusReason:UpdateEnrollmentStatusResponse' :: Maybe Text
statusReason = Maybe Text
a} :: UpdateEnrollmentStatusResponse)

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

instance
  Prelude.NFData
    UpdateEnrollmentStatusResponse