{-# 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.MigrationHubConfig.DescribeHomeRegionControls
-- 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)
--
-- This API permits filtering on the @ControlId@ and @HomeRegion@ fields.
module Amazonka.MigrationHubConfig.DescribeHomeRegionControls
  ( -- * Creating a Request
    DescribeHomeRegionControls (..),
    newDescribeHomeRegionControls,

    -- * Request Lenses
    describeHomeRegionControls_nextToken,
    describeHomeRegionControls_homeRegion,
    describeHomeRegionControls_controlId,
    describeHomeRegionControls_maxResults,
    describeHomeRegionControls_target,

    -- * Destructuring the Response
    DescribeHomeRegionControlsResponse (..),
    newDescribeHomeRegionControlsResponse,

    -- * Response Lenses
    describeHomeRegionControlsResponse_nextToken,
    describeHomeRegionControlsResponse_homeRegionControls,
    describeHomeRegionControlsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeHomeRegionControls' smart constructor.
data DescribeHomeRegionControls = DescribeHomeRegionControls'
  { -- | If a @NextToken@ was returned by a previous call, more results are
    -- available. To retrieve the next page of results, make the call again
    -- using the returned token in @NextToken@.
    DescribeHomeRegionControls -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the home region you\'d like to view.
    DescribeHomeRegionControls -> Maybe Text
homeRegion :: Prelude.Maybe Prelude.Text,
    -- | The @ControlID@ is a unique identifier string of your
    -- @HomeRegionControl@ object.
    DescribeHomeRegionControls -> Maybe Text
controlId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of filtering results to display per page.
    DescribeHomeRegionControls -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The target parameter specifies the identifier to which the home region
    -- is applied, which is always of type @ACCOUNT@. It applies the home
    -- region to the current @ACCOUNT@.
    DescribeHomeRegionControls -> Maybe Target
target :: Prelude.Maybe Target
  }
  deriving (DescribeHomeRegionControls -> DescribeHomeRegionControls -> Bool
(DescribeHomeRegionControls -> DescribeHomeRegionControls -> Bool)
-> (DescribeHomeRegionControls
    -> DescribeHomeRegionControls -> Bool)
-> Eq DescribeHomeRegionControls
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHomeRegionControls -> DescribeHomeRegionControls -> Bool
$c/= :: DescribeHomeRegionControls -> DescribeHomeRegionControls -> Bool
== :: DescribeHomeRegionControls -> DescribeHomeRegionControls -> Bool
$c== :: DescribeHomeRegionControls -> DescribeHomeRegionControls -> Bool
Prelude.Eq, ReadPrec [DescribeHomeRegionControls]
ReadPrec DescribeHomeRegionControls
Int -> ReadS DescribeHomeRegionControls
ReadS [DescribeHomeRegionControls]
(Int -> ReadS DescribeHomeRegionControls)
-> ReadS [DescribeHomeRegionControls]
-> ReadPrec DescribeHomeRegionControls
-> ReadPrec [DescribeHomeRegionControls]
-> Read DescribeHomeRegionControls
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHomeRegionControls]
$creadListPrec :: ReadPrec [DescribeHomeRegionControls]
readPrec :: ReadPrec DescribeHomeRegionControls
$creadPrec :: ReadPrec DescribeHomeRegionControls
readList :: ReadS [DescribeHomeRegionControls]
$creadList :: ReadS [DescribeHomeRegionControls]
readsPrec :: Int -> ReadS DescribeHomeRegionControls
$creadsPrec :: Int -> ReadS DescribeHomeRegionControls
Prelude.Read, Int -> DescribeHomeRegionControls -> ShowS
[DescribeHomeRegionControls] -> ShowS
DescribeHomeRegionControls -> String
(Int -> DescribeHomeRegionControls -> ShowS)
-> (DescribeHomeRegionControls -> String)
-> ([DescribeHomeRegionControls] -> ShowS)
-> Show DescribeHomeRegionControls
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHomeRegionControls] -> ShowS
$cshowList :: [DescribeHomeRegionControls] -> ShowS
show :: DescribeHomeRegionControls -> String
$cshow :: DescribeHomeRegionControls -> String
showsPrec :: Int -> DescribeHomeRegionControls -> ShowS
$cshowsPrec :: Int -> DescribeHomeRegionControls -> ShowS
Prelude.Show, (forall x.
 DescribeHomeRegionControls -> Rep DescribeHomeRegionControls x)
-> (forall x.
    Rep DescribeHomeRegionControls x -> DescribeHomeRegionControls)
-> Generic DescribeHomeRegionControls
forall x.
Rep DescribeHomeRegionControls x -> DescribeHomeRegionControls
forall x.
DescribeHomeRegionControls -> Rep DescribeHomeRegionControls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHomeRegionControls x -> DescribeHomeRegionControls
$cfrom :: forall x.
DescribeHomeRegionControls -> Rep DescribeHomeRegionControls x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHomeRegionControls' 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:
--
-- 'nextToken', 'describeHomeRegionControls_nextToken' - If a @NextToken@ was returned by a previous call, more results are
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
--
-- 'homeRegion', 'describeHomeRegionControls_homeRegion' - The name of the home region you\'d like to view.
--
-- 'controlId', 'describeHomeRegionControls_controlId' - The @ControlID@ is a unique identifier string of your
-- @HomeRegionControl@ object.
--
-- 'maxResults', 'describeHomeRegionControls_maxResults' - The maximum number of filtering results to display per page.
--
-- 'target', 'describeHomeRegionControls_target' - The target parameter specifies the identifier to which the home region
-- is applied, which is always of type @ACCOUNT@. It applies the home
-- region to the current @ACCOUNT@.
newDescribeHomeRegionControls ::
  DescribeHomeRegionControls
newDescribeHomeRegionControls :: DescribeHomeRegionControls
newDescribeHomeRegionControls =
  DescribeHomeRegionControls' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Target
-> DescribeHomeRegionControls
DescribeHomeRegionControls'
    { $sel:nextToken:DescribeHomeRegionControls' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:homeRegion:DescribeHomeRegionControls' :: Maybe Text
homeRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:controlId:DescribeHomeRegionControls' :: Maybe Text
controlId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeHomeRegionControls' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:target:DescribeHomeRegionControls' :: Maybe Target
target = Maybe Target
forall a. Maybe a
Prelude.Nothing
    }

-- | If a @NextToken@ was returned by a previous call, more results are
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
describeHomeRegionControls_nextToken :: Lens.Lens' DescribeHomeRegionControls (Prelude.Maybe Prelude.Text)
describeHomeRegionControls_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeHomeRegionControls -> f DescribeHomeRegionControls
describeHomeRegionControls_nextToken = (DescribeHomeRegionControls -> Maybe Text)
-> (DescribeHomeRegionControls
    -> Maybe Text -> DescribeHomeRegionControls)
-> Lens
     DescribeHomeRegionControls
     DescribeHomeRegionControls
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHomeRegionControls' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeHomeRegionControls
s@DescribeHomeRegionControls' {} Maybe Text
a -> DescribeHomeRegionControls
s {$sel:nextToken:DescribeHomeRegionControls' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeHomeRegionControls)

-- | The name of the home region you\'d like to view.
describeHomeRegionControls_homeRegion :: Lens.Lens' DescribeHomeRegionControls (Prelude.Maybe Prelude.Text)
describeHomeRegionControls_homeRegion :: (Maybe Text -> f (Maybe Text))
-> DescribeHomeRegionControls -> f DescribeHomeRegionControls
describeHomeRegionControls_homeRegion = (DescribeHomeRegionControls -> Maybe Text)
-> (DescribeHomeRegionControls
    -> Maybe Text -> DescribeHomeRegionControls)
-> Lens
     DescribeHomeRegionControls
     DescribeHomeRegionControls
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHomeRegionControls' {Maybe Text
homeRegion :: Maybe Text
$sel:homeRegion:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Text
homeRegion} -> Maybe Text
homeRegion) (\s :: DescribeHomeRegionControls
s@DescribeHomeRegionControls' {} Maybe Text
a -> DescribeHomeRegionControls
s {$sel:homeRegion:DescribeHomeRegionControls' :: Maybe Text
homeRegion = Maybe Text
a} :: DescribeHomeRegionControls)

-- | The @ControlID@ is a unique identifier string of your
-- @HomeRegionControl@ object.
describeHomeRegionControls_controlId :: Lens.Lens' DescribeHomeRegionControls (Prelude.Maybe Prelude.Text)
describeHomeRegionControls_controlId :: (Maybe Text -> f (Maybe Text))
-> DescribeHomeRegionControls -> f DescribeHomeRegionControls
describeHomeRegionControls_controlId = (DescribeHomeRegionControls -> Maybe Text)
-> (DescribeHomeRegionControls
    -> Maybe Text -> DescribeHomeRegionControls)
-> Lens
     DescribeHomeRegionControls
     DescribeHomeRegionControls
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHomeRegionControls' {Maybe Text
controlId :: Maybe Text
$sel:controlId:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Text
controlId} -> Maybe Text
controlId) (\s :: DescribeHomeRegionControls
s@DescribeHomeRegionControls' {} Maybe Text
a -> DescribeHomeRegionControls
s {$sel:controlId:DescribeHomeRegionControls' :: Maybe Text
controlId = Maybe Text
a} :: DescribeHomeRegionControls)

-- | The maximum number of filtering results to display per page.
describeHomeRegionControls_maxResults :: Lens.Lens' DescribeHomeRegionControls (Prelude.Maybe Prelude.Natural)
describeHomeRegionControls_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeHomeRegionControls -> f DescribeHomeRegionControls
describeHomeRegionControls_maxResults = (DescribeHomeRegionControls -> Maybe Natural)
-> (DescribeHomeRegionControls
    -> Maybe Natural -> DescribeHomeRegionControls)
-> Lens
     DescribeHomeRegionControls
     DescribeHomeRegionControls
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHomeRegionControls' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeHomeRegionControls
s@DescribeHomeRegionControls' {} Maybe Natural
a -> DescribeHomeRegionControls
s {$sel:maxResults:DescribeHomeRegionControls' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeHomeRegionControls)

-- | The target parameter specifies the identifier to which the home region
-- is applied, which is always of type @ACCOUNT@. It applies the home
-- region to the current @ACCOUNT@.
describeHomeRegionControls_target :: Lens.Lens' DescribeHomeRegionControls (Prelude.Maybe Target)
describeHomeRegionControls_target :: (Maybe Target -> f (Maybe Target))
-> DescribeHomeRegionControls -> f DescribeHomeRegionControls
describeHomeRegionControls_target = (DescribeHomeRegionControls -> Maybe Target)
-> (DescribeHomeRegionControls
    -> Maybe Target -> DescribeHomeRegionControls)
-> Lens
     DescribeHomeRegionControls
     DescribeHomeRegionControls
     (Maybe Target)
     (Maybe Target)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHomeRegionControls' {Maybe Target
target :: Maybe Target
$sel:target:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Target
target} -> Maybe Target
target) (\s :: DescribeHomeRegionControls
s@DescribeHomeRegionControls' {} Maybe Target
a -> DescribeHomeRegionControls
s {$sel:target:DescribeHomeRegionControls' :: Maybe Target
target = Maybe Target
a} :: DescribeHomeRegionControls)

instance Core.AWSRequest DescribeHomeRegionControls where
  type
    AWSResponse DescribeHomeRegionControls =
      DescribeHomeRegionControlsResponse
  request :: DescribeHomeRegionControls -> Request DescribeHomeRegionControls
request = Service
-> DescribeHomeRegionControls -> Request DescribeHomeRegionControls
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeHomeRegionControls
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeHomeRegionControls)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeHomeRegionControls))
-> Logger
-> Service
-> Proxy DescribeHomeRegionControls
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeHomeRegionControls)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [HomeRegionControl]
-> Int
-> DescribeHomeRegionControlsResponse
DescribeHomeRegionControlsResponse'
            (Maybe Text
 -> Maybe [HomeRegionControl]
 -> Int
 -> DescribeHomeRegionControlsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [HomeRegionControl]
      -> Int -> DescribeHomeRegionControlsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Maybe [HomeRegionControl]
   -> Int -> DescribeHomeRegionControlsResponse)
-> Either String (Maybe [HomeRegionControl])
-> Either String (Int -> DescribeHomeRegionControlsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [HomeRegionControl]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HomeRegionControls"
                            Either String (Maybe (Maybe [HomeRegionControl]))
-> Maybe [HomeRegionControl]
-> Either String (Maybe [HomeRegionControl])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [HomeRegionControl]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeHomeRegionControlsResponse)
-> Either String Int
-> Either String DescribeHomeRegionControlsResponse
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 DescribeHomeRegionControls

instance Prelude.NFData DescribeHomeRegionControls

instance Core.ToHeaders DescribeHomeRegionControls where
  toHeaders :: DescribeHomeRegionControls -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeHomeRegionControls -> 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
"AWSMigrationHubMultiAccountService.DescribeHomeRegionControls" ::
                          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 DescribeHomeRegionControls where
  toJSON :: DescribeHomeRegionControls -> Value
toJSON DescribeHomeRegionControls' {Maybe Natural
Maybe Text
Maybe Target
target :: Maybe Target
maxResults :: Maybe Natural
controlId :: Maybe Text
homeRegion :: Maybe Text
nextToken :: Maybe Text
$sel:target:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Target
$sel:maxResults:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Natural
$sel:controlId:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Text
$sel:homeRegion:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Text
$sel:nextToken:DescribeHomeRegionControls' :: DescribeHomeRegionControls -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" 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
nextToken,
            (Text
"HomeRegion" 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
homeRegion,
            (Text
"ControlId" 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
controlId,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Text
"Target" Text -> Target -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Target -> Pair) -> Maybe Target -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Target
target
          ]
      )

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

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

-- | /See:/ 'newDescribeHomeRegionControlsResponse' smart constructor.
data DescribeHomeRegionControlsResponse = DescribeHomeRegionControlsResponse'
  { -- | If a @NextToken@ was returned by a previous call, more results are
    -- available. To retrieve the next page of results, make the call again
    -- using the returned token in @NextToken@.
    DescribeHomeRegionControlsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array that contains your @HomeRegionControl@ objects.
    DescribeHomeRegionControlsResponse -> Maybe [HomeRegionControl]
homeRegionControls :: Prelude.Maybe [HomeRegionControl],
    -- | The response's http status code.
    DescribeHomeRegionControlsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeHomeRegionControlsResponse
-> DescribeHomeRegionControlsResponse -> Bool
(DescribeHomeRegionControlsResponse
 -> DescribeHomeRegionControlsResponse -> Bool)
-> (DescribeHomeRegionControlsResponse
    -> DescribeHomeRegionControlsResponse -> Bool)
-> Eq DescribeHomeRegionControlsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeHomeRegionControlsResponse
-> DescribeHomeRegionControlsResponse -> Bool
$c/= :: DescribeHomeRegionControlsResponse
-> DescribeHomeRegionControlsResponse -> Bool
== :: DescribeHomeRegionControlsResponse
-> DescribeHomeRegionControlsResponse -> Bool
$c== :: DescribeHomeRegionControlsResponse
-> DescribeHomeRegionControlsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeHomeRegionControlsResponse]
ReadPrec DescribeHomeRegionControlsResponse
Int -> ReadS DescribeHomeRegionControlsResponse
ReadS [DescribeHomeRegionControlsResponse]
(Int -> ReadS DescribeHomeRegionControlsResponse)
-> ReadS [DescribeHomeRegionControlsResponse]
-> ReadPrec DescribeHomeRegionControlsResponse
-> ReadPrec [DescribeHomeRegionControlsResponse]
-> Read DescribeHomeRegionControlsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeHomeRegionControlsResponse]
$creadListPrec :: ReadPrec [DescribeHomeRegionControlsResponse]
readPrec :: ReadPrec DescribeHomeRegionControlsResponse
$creadPrec :: ReadPrec DescribeHomeRegionControlsResponse
readList :: ReadS [DescribeHomeRegionControlsResponse]
$creadList :: ReadS [DescribeHomeRegionControlsResponse]
readsPrec :: Int -> ReadS DescribeHomeRegionControlsResponse
$creadsPrec :: Int -> ReadS DescribeHomeRegionControlsResponse
Prelude.Read, Int -> DescribeHomeRegionControlsResponse -> ShowS
[DescribeHomeRegionControlsResponse] -> ShowS
DescribeHomeRegionControlsResponse -> String
(Int -> DescribeHomeRegionControlsResponse -> ShowS)
-> (DescribeHomeRegionControlsResponse -> String)
-> ([DescribeHomeRegionControlsResponse] -> ShowS)
-> Show DescribeHomeRegionControlsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeHomeRegionControlsResponse] -> ShowS
$cshowList :: [DescribeHomeRegionControlsResponse] -> ShowS
show :: DescribeHomeRegionControlsResponse -> String
$cshow :: DescribeHomeRegionControlsResponse -> String
showsPrec :: Int -> DescribeHomeRegionControlsResponse -> ShowS
$cshowsPrec :: Int -> DescribeHomeRegionControlsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeHomeRegionControlsResponse
 -> Rep DescribeHomeRegionControlsResponse x)
-> (forall x.
    Rep DescribeHomeRegionControlsResponse x
    -> DescribeHomeRegionControlsResponse)
-> Generic DescribeHomeRegionControlsResponse
forall x.
Rep DescribeHomeRegionControlsResponse x
-> DescribeHomeRegionControlsResponse
forall x.
DescribeHomeRegionControlsResponse
-> Rep DescribeHomeRegionControlsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeHomeRegionControlsResponse x
-> DescribeHomeRegionControlsResponse
$cfrom :: forall x.
DescribeHomeRegionControlsResponse
-> Rep DescribeHomeRegionControlsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeHomeRegionControlsResponse' 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:
--
-- 'nextToken', 'describeHomeRegionControlsResponse_nextToken' - If a @NextToken@ was returned by a previous call, more results are
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
--
-- 'homeRegionControls', 'describeHomeRegionControlsResponse_homeRegionControls' - An array that contains your @HomeRegionControl@ objects.
--
-- 'httpStatus', 'describeHomeRegionControlsResponse_httpStatus' - The response's http status code.
newDescribeHomeRegionControlsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeHomeRegionControlsResponse
newDescribeHomeRegionControlsResponse :: Int -> DescribeHomeRegionControlsResponse
newDescribeHomeRegionControlsResponse Int
pHttpStatus_ =
  DescribeHomeRegionControlsResponse' :: Maybe Text
-> Maybe [HomeRegionControl]
-> Int
-> DescribeHomeRegionControlsResponse
DescribeHomeRegionControlsResponse'
    { $sel:nextToken:DescribeHomeRegionControlsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:homeRegionControls:DescribeHomeRegionControlsResponse' :: Maybe [HomeRegionControl]
homeRegionControls = Maybe [HomeRegionControl]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeHomeRegionControlsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If a @NextToken@ was returned by a previous call, more results are
-- available. To retrieve the next page of results, make the call again
-- using the returned token in @NextToken@.
describeHomeRegionControlsResponse_nextToken :: Lens.Lens' DescribeHomeRegionControlsResponse (Prelude.Maybe Prelude.Text)
describeHomeRegionControlsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeHomeRegionControlsResponse
-> f DescribeHomeRegionControlsResponse
describeHomeRegionControlsResponse_nextToken = (DescribeHomeRegionControlsResponse -> Maybe Text)
-> (DescribeHomeRegionControlsResponse
    -> Maybe Text -> DescribeHomeRegionControlsResponse)
-> Lens
     DescribeHomeRegionControlsResponse
     DescribeHomeRegionControlsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHomeRegionControlsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeHomeRegionControlsResponse' :: DescribeHomeRegionControlsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeHomeRegionControlsResponse
s@DescribeHomeRegionControlsResponse' {} Maybe Text
a -> DescribeHomeRegionControlsResponse
s {$sel:nextToken:DescribeHomeRegionControlsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeHomeRegionControlsResponse)

-- | An array that contains your @HomeRegionControl@ objects.
describeHomeRegionControlsResponse_homeRegionControls :: Lens.Lens' DescribeHomeRegionControlsResponse (Prelude.Maybe [HomeRegionControl])
describeHomeRegionControlsResponse_homeRegionControls :: (Maybe [HomeRegionControl] -> f (Maybe [HomeRegionControl]))
-> DescribeHomeRegionControlsResponse
-> f DescribeHomeRegionControlsResponse
describeHomeRegionControlsResponse_homeRegionControls = (DescribeHomeRegionControlsResponse -> Maybe [HomeRegionControl])
-> (DescribeHomeRegionControlsResponse
    -> Maybe [HomeRegionControl] -> DescribeHomeRegionControlsResponse)
-> Lens
     DescribeHomeRegionControlsResponse
     DescribeHomeRegionControlsResponse
     (Maybe [HomeRegionControl])
     (Maybe [HomeRegionControl])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeHomeRegionControlsResponse' {Maybe [HomeRegionControl]
homeRegionControls :: Maybe [HomeRegionControl]
$sel:homeRegionControls:DescribeHomeRegionControlsResponse' :: DescribeHomeRegionControlsResponse -> Maybe [HomeRegionControl]
homeRegionControls} -> Maybe [HomeRegionControl]
homeRegionControls) (\s :: DescribeHomeRegionControlsResponse
s@DescribeHomeRegionControlsResponse' {} Maybe [HomeRegionControl]
a -> DescribeHomeRegionControlsResponse
s {$sel:homeRegionControls:DescribeHomeRegionControlsResponse' :: Maybe [HomeRegionControl]
homeRegionControls = Maybe [HomeRegionControl]
a} :: DescribeHomeRegionControlsResponse) ((Maybe [HomeRegionControl] -> f (Maybe [HomeRegionControl]))
 -> DescribeHomeRegionControlsResponse
 -> f DescribeHomeRegionControlsResponse)
-> ((Maybe [HomeRegionControl] -> f (Maybe [HomeRegionControl]))
    -> Maybe [HomeRegionControl] -> f (Maybe [HomeRegionControl]))
-> (Maybe [HomeRegionControl] -> f (Maybe [HomeRegionControl]))
-> DescribeHomeRegionControlsResponse
-> f DescribeHomeRegionControlsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [HomeRegionControl]
  [HomeRegionControl]
  [HomeRegionControl]
  [HomeRegionControl]
-> Iso
     (Maybe [HomeRegionControl])
     (Maybe [HomeRegionControl])
     (Maybe [HomeRegionControl])
     (Maybe [HomeRegionControl])
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
  [HomeRegionControl]
  [HomeRegionControl]
  [HomeRegionControl]
  [HomeRegionControl]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeHomeRegionControlsResponse