{-# 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.OpsWorks.DescribeServiceErrors
-- 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)
--
-- Describes AWS OpsWorks Stacks service errors.
--
-- __Required Permissions__: To use this action, an IAM user must have a
-- Show, Deploy, or Manage permissions level for the stack, or an attached
-- policy that explicitly grants permissions. For more information about
-- user permissions, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html Managing User Permissions>.
--
-- This call accepts only one resource-identifying parameter.
module Amazonka.OpsWorks.DescribeServiceErrors
  ( -- * Creating a Request
    DescribeServiceErrors (..),
    newDescribeServiceErrors,

    -- * Request Lenses
    describeServiceErrors_instanceId,
    describeServiceErrors_stackId,
    describeServiceErrors_serviceErrorIds,

    -- * Destructuring the Response
    DescribeServiceErrorsResponse (..),
    newDescribeServiceErrorsResponse,

    -- * Response Lenses
    describeServiceErrorsResponse_serviceErrors,
    describeServiceErrorsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeServiceErrors' smart constructor.
data DescribeServiceErrors = DescribeServiceErrors'
  { -- | The instance ID. If you use this parameter, @DescribeServiceErrors@
    -- returns descriptions of the errors associated with the specified
    -- instance.
    DescribeServiceErrors -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | The stack ID. If you use this parameter, @DescribeServiceErrors@ returns
    -- descriptions of the errors associated with the specified stack.
    DescribeServiceErrors -> Maybe Text
stackId :: Prelude.Maybe Prelude.Text,
    -- | An array of service error IDs. If you use this parameter,
    -- @DescribeServiceErrors@ returns descriptions of the specified errors.
    -- Otherwise, it returns a description of every error.
    DescribeServiceErrors -> Maybe [Text]
serviceErrorIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (DescribeServiceErrors -> DescribeServiceErrors -> Bool
(DescribeServiceErrors -> DescribeServiceErrors -> Bool)
-> (DescribeServiceErrors -> DescribeServiceErrors -> Bool)
-> Eq DescribeServiceErrors
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeServiceErrors -> DescribeServiceErrors -> Bool
$c/= :: DescribeServiceErrors -> DescribeServiceErrors -> Bool
== :: DescribeServiceErrors -> DescribeServiceErrors -> Bool
$c== :: DescribeServiceErrors -> DescribeServiceErrors -> Bool
Prelude.Eq, ReadPrec [DescribeServiceErrors]
ReadPrec DescribeServiceErrors
Int -> ReadS DescribeServiceErrors
ReadS [DescribeServiceErrors]
(Int -> ReadS DescribeServiceErrors)
-> ReadS [DescribeServiceErrors]
-> ReadPrec DescribeServiceErrors
-> ReadPrec [DescribeServiceErrors]
-> Read DescribeServiceErrors
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeServiceErrors]
$creadListPrec :: ReadPrec [DescribeServiceErrors]
readPrec :: ReadPrec DescribeServiceErrors
$creadPrec :: ReadPrec DescribeServiceErrors
readList :: ReadS [DescribeServiceErrors]
$creadList :: ReadS [DescribeServiceErrors]
readsPrec :: Int -> ReadS DescribeServiceErrors
$creadsPrec :: Int -> ReadS DescribeServiceErrors
Prelude.Read, Int -> DescribeServiceErrors -> ShowS
[DescribeServiceErrors] -> ShowS
DescribeServiceErrors -> String
(Int -> DescribeServiceErrors -> ShowS)
-> (DescribeServiceErrors -> String)
-> ([DescribeServiceErrors] -> ShowS)
-> Show DescribeServiceErrors
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeServiceErrors] -> ShowS
$cshowList :: [DescribeServiceErrors] -> ShowS
show :: DescribeServiceErrors -> String
$cshow :: DescribeServiceErrors -> String
showsPrec :: Int -> DescribeServiceErrors -> ShowS
$cshowsPrec :: Int -> DescribeServiceErrors -> ShowS
Prelude.Show, (forall x. DescribeServiceErrors -> Rep DescribeServiceErrors x)
-> (forall x. Rep DescribeServiceErrors x -> DescribeServiceErrors)
-> Generic DescribeServiceErrors
forall x. Rep DescribeServiceErrors x -> DescribeServiceErrors
forall x. DescribeServiceErrors -> Rep DescribeServiceErrors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeServiceErrors x -> DescribeServiceErrors
$cfrom :: forall x. DescribeServiceErrors -> Rep DescribeServiceErrors x
Prelude.Generic)

-- |
-- Create a value of 'DescribeServiceErrors' 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:
--
-- 'instanceId', 'describeServiceErrors_instanceId' - The instance ID. If you use this parameter, @DescribeServiceErrors@
-- returns descriptions of the errors associated with the specified
-- instance.
--
-- 'stackId', 'describeServiceErrors_stackId' - The stack ID. If you use this parameter, @DescribeServiceErrors@ returns
-- descriptions of the errors associated with the specified stack.
--
-- 'serviceErrorIds', 'describeServiceErrors_serviceErrorIds' - An array of service error IDs. If you use this parameter,
-- @DescribeServiceErrors@ returns descriptions of the specified errors.
-- Otherwise, it returns a description of every error.
newDescribeServiceErrors ::
  DescribeServiceErrors
newDescribeServiceErrors :: DescribeServiceErrors
newDescribeServiceErrors =
  DescribeServiceErrors' :: Maybe Text -> Maybe Text -> Maybe [Text] -> DescribeServiceErrors
DescribeServiceErrors'
    { $sel:instanceId:DescribeServiceErrors' :: Maybe Text
instanceId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:stackId:DescribeServiceErrors' :: Maybe Text
stackId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceErrorIds:DescribeServiceErrors' :: Maybe [Text]
serviceErrorIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | The instance ID. If you use this parameter, @DescribeServiceErrors@
-- returns descriptions of the errors associated with the specified
-- instance.
describeServiceErrors_instanceId :: Lens.Lens' DescribeServiceErrors (Prelude.Maybe Prelude.Text)
describeServiceErrors_instanceId :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceErrors -> f DescribeServiceErrors
describeServiceErrors_instanceId = (DescribeServiceErrors -> Maybe Text)
-> (DescribeServiceErrors -> Maybe Text -> DescribeServiceErrors)
-> Lens
     DescribeServiceErrors
     DescribeServiceErrors
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceErrors' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:DescribeServiceErrors' :: DescribeServiceErrors -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: DescribeServiceErrors
s@DescribeServiceErrors' {} Maybe Text
a -> DescribeServiceErrors
s {$sel:instanceId:DescribeServiceErrors' :: Maybe Text
instanceId = Maybe Text
a} :: DescribeServiceErrors)

-- | The stack ID. If you use this parameter, @DescribeServiceErrors@ returns
-- descriptions of the errors associated with the specified stack.
describeServiceErrors_stackId :: Lens.Lens' DescribeServiceErrors (Prelude.Maybe Prelude.Text)
describeServiceErrors_stackId :: (Maybe Text -> f (Maybe Text))
-> DescribeServiceErrors -> f DescribeServiceErrors
describeServiceErrors_stackId = (DescribeServiceErrors -> Maybe Text)
-> (DescribeServiceErrors -> Maybe Text -> DescribeServiceErrors)
-> Lens
     DescribeServiceErrors
     DescribeServiceErrors
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceErrors' {Maybe Text
stackId :: Maybe Text
$sel:stackId:DescribeServiceErrors' :: DescribeServiceErrors -> Maybe Text
stackId} -> Maybe Text
stackId) (\s :: DescribeServiceErrors
s@DescribeServiceErrors' {} Maybe Text
a -> DescribeServiceErrors
s {$sel:stackId:DescribeServiceErrors' :: Maybe Text
stackId = Maybe Text
a} :: DescribeServiceErrors)

-- | An array of service error IDs. If you use this parameter,
-- @DescribeServiceErrors@ returns descriptions of the specified errors.
-- Otherwise, it returns a description of every error.
describeServiceErrors_serviceErrorIds :: Lens.Lens' DescribeServiceErrors (Prelude.Maybe [Prelude.Text])
describeServiceErrors_serviceErrorIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeServiceErrors -> f DescribeServiceErrors
describeServiceErrors_serviceErrorIds = (DescribeServiceErrors -> Maybe [Text])
-> (DescribeServiceErrors -> Maybe [Text] -> DescribeServiceErrors)
-> Lens
     DescribeServiceErrors
     DescribeServiceErrors
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceErrors' {Maybe [Text]
serviceErrorIds :: Maybe [Text]
$sel:serviceErrorIds:DescribeServiceErrors' :: DescribeServiceErrors -> Maybe [Text]
serviceErrorIds} -> Maybe [Text]
serviceErrorIds) (\s :: DescribeServiceErrors
s@DescribeServiceErrors' {} Maybe [Text]
a -> DescribeServiceErrors
s {$sel:serviceErrorIds:DescribeServiceErrors' :: Maybe [Text]
serviceErrorIds = Maybe [Text]
a} :: DescribeServiceErrors) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeServiceErrors -> f DescribeServiceErrors)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeServiceErrors
-> f DescribeServiceErrors
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest DescribeServiceErrors where
  type
    AWSResponse DescribeServiceErrors =
      DescribeServiceErrorsResponse
  request :: DescribeServiceErrors -> Request DescribeServiceErrors
request = Service -> DescribeServiceErrors -> Request DescribeServiceErrors
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeServiceErrors
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeServiceErrors)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeServiceErrors))
-> Logger
-> Service
-> Proxy DescribeServiceErrors
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeServiceErrors)))
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 [ServiceError] -> Int -> DescribeServiceErrorsResponse
DescribeServiceErrorsResponse'
            (Maybe [ServiceError] -> Int -> DescribeServiceErrorsResponse)
-> Either String (Maybe [ServiceError])
-> Either String (Int -> DescribeServiceErrorsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ServiceError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ServiceErrors" Either String (Maybe (Maybe [ServiceError]))
-> Maybe [ServiceError] -> Either String (Maybe [ServiceError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ServiceError]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DescribeServiceErrorsResponse)
-> Either String Int -> Either String DescribeServiceErrorsResponse
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 DescribeServiceErrors

instance Prelude.NFData DescribeServiceErrors

instance Core.ToHeaders DescribeServiceErrors where
  toHeaders :: DescribeServiceErrors -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeServiceErrors -> 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
"OpsWorks_20130218.DescribeServiceErrors" ::
                          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 DescribeServiceErrors where
  toJSON :: DescribeServiceErrors -> Value
toJSON DescribeServiceErrors' {Maybe [Text]
Maybe Text
serviceErrorIds :: Maybe [Text]
stackId :: Maybe Text
instanceId :: Maybe Text
$sel:serviceErrorIds:DescribeServiceErrors' :: DescribeServiceErrors -> Maybe [Text]
$sel:stackId:DescribeServiceErrors' :: DescribeServiceErrors -> Maybe Text
$sel:instanceId:DescribeServiceErrors' :: DescribeServiceErrors -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"InstanceId" 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
instanceId,
            (Text
"StackId" 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
stackId,
            (Text
"ServiceErrorIds" 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]
serviceErrorIds
          ]
      )

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

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

-- | Contains the response to a @DescribeServiceErrors@ request.
--
-- /See:/ 'newDescribeServiceErrorsResponse' smart constructor.
data DescribeServiceErrorsResponse = DescribeServiceErrorsResponse'
  { -- | An array of @ServiceError@ objects that describe the specified service
    -- errors.
    DescribeServiceErrorsResponse -> Maybe [ServiceError]
serviceErrors :: Prelude.Maybe [ServiceError],
    -- | The response's http status code.
    DescribeServiceErrorsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeServiceErrorsResponse
-> DescribeServiceErrorsResponse -> Bool
(DescribeServiceErrorsResponse
 -> DescribeServiceErrorsResponse -> Bool)
-> (DescribeServiceErrorsResponse
    -> DescribeServiceErrorsResponse -> Bool)
-> Eq DescribeServiceErrorsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeServiceErrorsResponse
-> DescribeServiceErrorsResponse -> Bool
$c/= :: DescribeServiceErrorsResponse
-> DescribeServiceErrorsResponse -> Bool
== :: DescribeServiceErrorsResponse
-> DescribeServiceErrorsResponse -> Bool
$c== :: DescribeServiceErrorsResponse
-> DescribeServiceErrorsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeServiceErrorsResponse]
ReadPrec DescribeServiceErrorsResponse
Int -> ReadS DescribeServiceErrorsResponse
ReadS [DescribeServiceErrorsResponse]
(Int -> ReadS DescribeServiceErrorsResponse)
-> ReadS [DescribeServiceErrorsResponse]
-> ReadPrec DescribeServiceErrorsResponse
-> ReadPrec [DescribeServiceErrorsResponse]
-> Read DescribeServiceErrorsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeServiceErrorsResponse]
$creadListPrec :: ReadPrec [DescribeServiceErrorsResponse]
readPrec :: ReadPrec DescribeServiceErrorsResponse
$creadPrec :: ReadPrec DescribeServiceErrorsResponse
readList :: ReadS [DescribeServiceErrorsResponse]
$creadList :: ReadS [DescribeServiceErrorsResponse]
readsPrec :: Int -> ReadS DescribeServiceErrorsResponse
$creadsPrec :: Int -> ReadS DescribeServiceErrorsResponse
Prelude.Read, Int -> DescribeServiceErrorsResponse -> ShowS
[DescribeServiceErrorsResponse] -> ShowS
DescribeServiceErrorsResponse -> String
(Int -> DescribeServiceErrorsResponse -> ShowS)
-> (DescribeServiceErrorsResponse -> String)
-> ([DescribeServiceErrorsResponse] -> ShowS)
-> Show DescribeServiceErrorsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeServiceErrorsResponse] -> ShowS
$cshowList :: [DescribeServiceErrorsResponse] -> ShowS
show :: DescribeServiceErrorsResponse -> String
$cshow :: DescribeServiceErrorsResponse -> String
showsPrec :: Int -> DescribeServiceErrorsResponse -> ShowS
$cshowsPrec :: Int -> DescribeServiceErrorsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeServiceErrorsResponse
 -> Rep DescribeServiceErrorsResponse x)
-> (forall x.
    Rep DescribeServiceErrorsResponse x
    -> DescribeServiceErrorsResponse)
-> Generic DescribeServiceErrorsResponse
forall x.
Rep DescribeServiceErrorsResponse x
-> DescribeServiceErrorsResponse
forall x.
DescribeServiceErrorsResponse
-> Rep DescribeServiceErrorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeServiceErrorsResponse x
-> DescribeServiceErrorsResponse
$cfrom :: forall x.
DescribeServiceErrorsResponse
-> Rep DescribeServiceErrorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeServiceErrorsResponse' 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:
--
-- 'serviceErrors', 'describeServiceErrorsResponse_serviceErrors' - An array of @ServiceError@ objects that describe the specified service
-- errors.
--
-- 'httpStatus', 'describeServiceErrorsResponse_httpStatus' - The response's http status code.
newDescribeServiceErrorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeServiceErrorsResponse
newDescribeServiceErrorsResponse :: Int -> DescribeServiceErrorsResponse
newDescribeServiceErrorsResponse Int
pHttpStatus_ =
  DescribeServiceErrorsResponse' :: Maybe [ServiceError] -> Int -> DescribeServiceErrorsResponse
DescribeServiceErrorsResponse'
    { $sel:serviceErrors:DescribeServiceErrorsResponse' :: Maybe [ServiceError]
serviceErrors =
        Maybe [ServiceError]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeServiceErrorsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of @ServiceError@ objects that describe the specified service
-- errors.
describeServiceErrorsResponse_serviceErrors :: Lens.Lens' DescribeServiceErrorsResponse (Prelude.Maybe [ServiceError])
describeServiceErrorsResponse_serviceErrors :: (Maybe [ServiceError] -> f (Maybe [ServiceError]))
-> DescribeServiceErrorsResponse -> f DescribeServiceErrorsResponse
describeServiceErrorsResponse_serviceErrors = (DescribeServiceErrorsResponse -> Maybe [ServiceError])
-> (DescribeServiceErrorsResponse
    -> Maybe [ServiceError] -> DescribeServiceErrorsResponse)
-> Lens
     DescribeServiceErrorsResponse
     DescribeServiceErrorsResponse
     (Maybe [ServiceError])
     (Maybe [ServiceError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeServiceErrorsResponse' {Maybe [ServiceError]
serviceErrors :: Maybe [ServiceError]
$sel:serviceErrors:DescribeServiceErrorsResponse' :: DescribeServiceErrorsResponse -> Maybe [ServiceError]
serviceErrors} -> Maybe [ServiceError]
serviceErrors) (\s :: DescribeServiceErrorsResponse
s@DescribeServiceErrorsResponse' {} Maybe [ServiceError]
a -> DescribeServiceErrorsResponse
s {$sel:serviceErrors:DescribeServiceErrorsResponse' :: Maybe [ServiceError]
serviceErrors = Maybe [ServiceError]
a} :: DescribeServiceErrorsResponse) ((Maybe [ServiceError] -> f (Maybe [ServiceError]))
 -> DescribeServiceErrorsResponse
 -> f DescribeServiceErrorsResponse)
-> ((Maybe [ServiceError] -> f (Maybe [ServiceError]))
    -> Maybe [ServiceError] -> f (Maybe [ServiceError]))
-> (Maybe [ServiceError] -> f (Maybe [ServiceError]))
-> DescribeServiceErrorsResponse
-> f DescribeServiceErrorsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ServiceError] [ServiceError] [ServiceError] [ServiceError]
-> Iso
     (Maybe [ServiceError])
     (Maybe [ServiceError])
     (Maybe [ServiceError])
     (Maybe [ServiceError])
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 [ServiceError] [ServiceError] [ServiceError] [ServiceError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeServiceErrorsResponse