{-# 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.APIGateway.ImportDocumentationParts
-- 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)
--
-- -- | Undocumented operation.
module Amazonka.APIGateway.ImportDocumentationParts
  ( -- * Creating a Request
    ImportDocumentationParts (..),
    newImportDocumentationParts,

    -- * Request Lenses
    importDocumentationParts_mode,
    importDocumentationParts_failOnWarnings,
    importDocumentationParts_restApiId,
    importDocumentationParts_body,

    -- * Destructuring the Response
    ImportDocumentationPartsResponse (..),
    newImportDocumentationPartsResponse,

    -- * Response Lenses
    importDocumentationPartsResponse_ids,
    importDocumentationPartsResponse_warnings,
    importDocumentationPartsResponse_httpStatus,
  )
where

import Amazonka.APIGateway.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

-- | Import documentation parts from an external (e.g., OpenAPI) definition
-- file.
--
-- /See:/ 'newImportDocumentationParts' smart constructor.
data ImportDocumentationParts = ImportDocumentationParts'
  { -- | A query parameter to indicate whether to overwrite (@OVERWRITE@) any
    -- existing DocumentationParts definition or to merge (@MERGE@) the new
    -- definition into the existing one. The default value is @MERGE@.
    ImportDocumentationParts -> Maybe PutMode
mode :: Prelude.Maybe PutMode,
    -- | A query parameter to specify whether to rollback the documentation
    -- importation (@true@) or not (@false@) when a warning is encountered. The
    -- default value is @false@.
    ImportDocumentationParts -> Maybe Bool
failOnWarnings :: Prelude.Maybe Prelude.Bool,
    -- | [Required] The string identifier of the associated RestApi.
    ImportDocumentationParts -> Text
restApiId :: Prelude.Text,
    -- | [Required] Raw byte array representing the to-be-imported documentation
    -- parts. To import from an OpenAPI file, this is a JSON object.
    ImportDocumentationParts -> ByteString
body :: Prelude.ByteString
  }
  deriving (ImportDocumentationParts -> ImportDocumentationParts -> Bool
(ImportDocumentationParts -> ImportDocumentationParts -> Bool)
-> (ImportDocumentationParts -> ImportDocumentationParts -> Bool)
-> Eq ImportDocumentationParts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportDocumentationParts -> ImportDocumentationParts -> Bool
$c/= :: ImportDocumentationParts -> ImportDocumentationParts -> Bool
== :: ImportDocumentationParts -> ImportDocumentationParts -> Bool
$c== :: ImportDocumentationParts -> ImportDocumentationParts -> Bool
Prelude.Eq, Int -> ImportDocumentationParts -> ShowS
[ImportDocumentationParts] -> ShowS
ImportDocumentationParts -> String
(Int -> ImportDocumentationParts -> ShowS)
-> (ImportDocumentationParts -> String)
-> ([ImportDocumentationParts] -> ShowS)
-> Show ImportDocumentationParts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportDocumentationParts] -> ShowS
$cshowList :: [ImportDocumentationParts] -> ShowS
show :: ImportDocumentationParts -> String
$cshow :: ImportDocumentationParts -> String
showsPrec :: Int -> ImportDocumentationParts -> ShowS
$cshowsPrec :: Int -> ImportDocumentationParts -> ShowS
Prelude.Show, (forall x.
 ImportDocumentationParts -> Rep ImportDocumentationParts x)
-> (forall x.
    Rep ImportDocumentationParts x -> ImportDocumentationParts)
-> Generic ImportDocumentationParts
forall x.
Rep ImportDocumentationParts x -> ImportDocumentationParts
forall x.
ImportDocumentationParts -> Rep ImportDocumentationParts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportDocumentationParts x -> ImportDocumentationParts
$cfrom :: forall x.
ImportDocumentationParts -> Rep ImportDocumentationParts x
Prelude.Generic)

-- |
-- Create a value of 'ImportDocumentationParts' 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:
--
-- 'mode', 'importDocumentationParts_mode' - A query parameter to indicate whether to overwrite (@OVERWRITE@) any
-- existing DocumentationParts definition or to merge (@MERGE@) the new
-- definition into the existing one. The default value is @MERGE@.
--
-- 'failOnWarnings', 'importDocumentationParts_failOnWarnings' - A query parameter to specify whether to rollback the documentation
-- importation (@true@) or not (@false@) when a warning is encountered. The
-- default value is @false@.
--
-- 'restApiId', 'importDocumentationParts_restApiId' - [Required] The string identifier of the associated RestApi.
--
-- 'body', 'importDocumentationParts_body' - [Required] Raw byte array representing the to-be-imported documentation
-- parts. To import from an OpenAPI file, this is a JSON object.
newImportDocumentationParts ::
  -- | 'restApiId'
  Prelude.Text ->
  -- | 'body'
  Prelude.ByteString ->
  ImportDocumentationParts
newImportDocumentationParts :: Text -> ByteString -> ImportDocumentationParts
newImportDocumentationParts Text
pRestApiId_ ByteString
pBody_ =
  ImportDocumentationParts' :: Maybe PutMode
-> Maybe Bool -> Text -> ByteString -> ImportDocumentationParts
ImportDocumentationParts'
    { $sel:mode:ImportDocumentationParts' :: Maybe PutMode
mode = Maybe PutMode
forall a. Maybe a
Prelude.Nothing,
      $sel:failOnWarnings:ImportDocumentationParts' :: Maybe Bool
failOnWarnings = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:restApiId:ImportDocumentationParts' :: Text
restApiId = Text
pRestApiId_,
      $sel:body:ImportDocumentationParts' :: ByteString
body = ByteString
pBody_
    }

-- | A query parameter to indicate whether to overwrite (@OVERWRITE@) any
-- existing DocumentationParts definition or to merge (@MERGE@) the new
-- definition into the existing one. The default value is @MERGE@.
importDocumentationParts_mode :: Lens.Lens' ImportDocumentationParts (Prelude.Maybe PutMode)
importDocumentationParts_mode :: (Maybe PutMode -> f (Maybe PutMode))
-> ImportDocumentationParts -> f ImportDocumentationParts
importDocumentationParts_mode = (ImportDocumentationParts -> Maybe PutMode)
-> (ImportDocumentationParts
    -> Maybe PutMode -> ImportDocumentationParts)
-> Lens
     ImportDocumentationParts
     ImportDocumentationParts
     (Maybe PutMode)
     (Maybe PutMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportDocumentationParts' {Maybe PutMode
mode :: Maybe PutMode
$sel:mode:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe PutMode
mode} -> Maybe PutMode
mode) (\s :: ImportDocumentationParts
s@ImportDocumentationParts' {} Maybe PutMode
a -> ImportDocumentationParts
s {$sel:mode:ImportDocumentationParts' :: Maybe PutMode
mode = Maybe PutMode
a} :: ImportDocumentationParts)

-- | A query parameter to specify whether to rollback the documentation
-- importation (@true@) or not (@false@) when a warning is encountered. The
-- default value is @false@.
importDocumentationParts_failOnWarnings :: Lens.Lens' ImportDocumentationParts (Prelude.Maybe Prelude.Bool)
importDocumentationParts_failOnWarnings :: (Maybe Bool -> f (Maybe Bool))
-> ImportDocumentationParts -> f ImportDocumentationParts
importDocumentationParts_failOnWarnings = (ImportDocumentationParts -> Maybe Bool)
-> (ImportDocumentationParts
    -> Maybe Bool -> ImportDocumentationParts)
-> Lens
     ImportDocumentationParts
     ImportDocumentationParts
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportDocumentationParts' {Maybe Bool
failOnWarnings :: Maybe Bool
$sel:failOnWarnings:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe Bool
failOnWarnings} -> Maybe Bool
failOnWarnings) (\s :: ImportDocumentationParts
s@ImportDocumentationParts' {} Maybe Bool
a -> ImportDocumentationParts
s {$sel:failOnWarnings:ImportDocumentationParts' :: Maybe Bool
failOnWarnings = Maybe Bool
a} :: ImportDocumentationParts)

-- | [Required] The string identifier of the associated RestApi.
importDocumentationParts_restApiId :: Lens.Lens' ImportDocumentationParts Prelude.Text
importDocumentationParts_restApiId :: (Text -> f Text)
-> ImportDocumentationParts -> f ImportDocumentationParts
importDocumentationParts_restApiId = (ImportDocumentationParts -> Text)
-> (ImportDocumentationParts -> Text -> ImportDocumentationParts)
-> Lens ImportDocumentationParts ImportDocumentationParts Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportDocumentationParts' {Text
restApiId :: Text
$sel:restApiId:ImportDocumentationParts' :: ImportDocumentationParts -> Text
restApiId} -> Text
restApiId) (\s :: ImportDocumentationParts
s@ImportDocumentationParts' {} Text
a -> ImportDocumentationParts
s {$sel:restApiId:ImportDocumentationParts' :: Text
restApiId = Text
a} :: ImportDocumentationParts)

-- | [Required] Raw byte array representing the to-be-imported documentation
-- parts. To import from an OpenAPI file, this is a JSON object.
importDocumentationParts_body :: Lens.Lens' ImportDocumentationParts Prelude.ByteString
importDocumentationParts_body :: (ByteString -> f ByteString)
-> ImportDocumentationParts -> f ImportDocumentationParts
importDocumentationParts_body = (ImportDocumentationParts -> ByteString)
-> (ImportDocumentationParts
    -> ByteString -> ImportDocumentationParts)
-> Lens
     ImportDocumentationParts
     ImportDocumentationParts
     ByteString
     ByteString
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportDocumentationParts' {ByteString
body :: ByteString
$sel:body:ImportDocumentationParts' :: ImportDocumentationParts -> ByteString
body} -> ByteString
body) (\s :: ImportDocumentationParts
s@ImportDocumentationParts' {} ByteString
a -> ImportDocumentationParts
s {$sel:body:ImportDocumentationParts' :: ByteString
body = ByteString
a} :: ImportDocumentationParts)

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

instance Prelude.NFData ImportDocumentationParts

instance Core.ToBody ImportDocumentationParts where
  toBody :: ImportDocumentationParts -> RequestBody
toBody ImportDocumentationParts' {Maybe Bool
Maybe PutMode
ByteString
Text
body :: ByteString
restApiId :: Text
failOnWarnings :: Maybe Bool
mode :: Maybe PutMode
$sel:body:ImportDocumentationParts' :: ImportDocumentationParts -> ByteString
$sel:restApiId:ImportDocumentationParts' :: ImportDocumentationParts -> Text
$sel:failOnWarnings:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe Bool
$sel:mode:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe PutMode
..} =
    ByteString -> RequestBody
forall a. ToBody a => a -> RequestBody
Core.toBody ByteString
body

instance Core.ToHeaders ImportDocumentationParts where
  toHeaders :: ImportDocumentationParts -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ImportDocumentationParts -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Accept"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
          ]
      )

instance Core.ToPath ImportDocumentationParts where
  toPath :: ImportDocumentationParts -> ByteString
toPath ImportDocumentationParts' {Maybe Bool
Maybe PutMode
ByteString
Text
body :: ByteString
restApiId :: Text
failOnWarnings :: Maybe Bool
mode :: Maybe PutMode
$sel:body:ImportDocumentationParts' :: ImportDocumentationParts -> ByteString
$sel:restApiId:ImportDocumentationParts' :: ImportDocumentationParts -> Text
$sel:failOnWarnings:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe Bool
$sel:mode:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe PutMode
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/restapis/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
restApiId,
        ByteString
"/documentation/parts"
      ]

instance Core.ToQuery ImportDocumentationParts where
  toQuery :: ImportDocumentationParts -> QueryString
toQuery ImportDocumentationParts' {Maybe Bool
Maybe PutMode
ByteString
Text
body :: ByteString
restApiId :: Text
failOnWarnings :: Maybe Bool
mode :: Maybe PutMode
$sel:body:ImportDocumentationParts' :: ImportDocumentationParts -> ByteString
$sel:restApiId:ImportDocumentationParts' :: ImportDocumentationParts -> Text
$sel:failOnWarnings:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe Bool
$sel:mode:ImportDocumentationParts' :: ImportDocumentationParts -> Maybe PutMode
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"mode" ByteString -> Maybe PutMode -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PutMode
mode,
        ByteString
"failonwarnings" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
failOnWarnings
      ]

-- | A collection of the imported DocumentationPart identifiers.
--
-- This is used to return the result when documentation parts in an
-- external (e.g., OpenAPI) file are imported into API Gateway
--
-- <https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-documenting-api.html Documenting an API>,
-- <https://docs.aws.amazon.com/apigateway/api-reference/link-relation/documentationpart-import/ documentationpart:import>,
-- DocumentationPart
--
-- /See:/ 'newImportDocumentationPartsResponse' smart constructor.
data ImportDocumentationPartsResponse = ImportDocumentationPartsResponse'
  { -- | A list of the returned documentation part identifiers.
    ImportDocumentationPartsResponse -> Maybe [Text]
ids :: Prelude.Maybe [Prelude.Text],
    -- | A list of warning messages reported during import of documentation
    -- parts.
    ImportDocumentationPartsResponse -> Maybe [Text]
warnings :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    ImportDocumentationPartsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ImportDocumentationPartsResponse
-> ImportDocumentationPartsResponse -> Bool
(ImportDocumentationPartsResponse
 -> ImportDocumentationPartsResponse -> Bool)
-> (ImportDocumentationPartsResponse
    -> ImportDocumentationPartsResponse -> Bool)
-> Eq ImportDocumentationPartsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportDocumentationPartsResponse
-> ImportDocumentationPartsResponse -> Bool
$c/= :: ImportDocumentationPartsResponse
-> ImportDocumentationPartsResponse -> Bool
== :: ImportDocumentationPartsResponse
-> ImportDocumentationPartsResponse -> Bool
$c== :: ImportDocumentationPartsResponse
-> ImportDocumentationPartsResponse -> Bool
Prelude.Eq, ReadPrec [ImportDocumentationPartsResponse]
ReadPrec ImportDocumentationPartsResponse
Int -> ReadS ImportDocumentationPartsResponse
ReadS [ImportDocumentationPartsResponse]
(Int -> ReadS ImportDocumentationPartsResponse)
-> ReadS [ImportDocumentationPartsResponse]
-> ReadPrec ImportDocumentationPartsResponse
-> ReadPrec [ImportDocumentationPartsResponse]
-> Read ImportDocumentationPartsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportDocumentationPartsResponse]
$creadListPrec :: ReadPrec [ImportDocumentationPartsResponse]
readPrec :: ReadPrec ImportDocumentationPartsResponse
$creadPrec :: ReadPrec ImportDocumentationPartsResponse
readList :: ReadS [ImportDocumentationPartsResponse]
$creadList :: ReadS [ImportDocumentationPartsResponse]
readsPrec :: Int -> ReadS ImportDocumentationPartsResponse
$creadsPrec :: Int -> ReadS ImportDocumentationPartsResponse
Prelude.Read, Int -> ImportDocumentationPartsResponse -> ShowS
[ImportDocumentationPartsResponse] -> ShowS
ImportDocumentationPartsResponse -> String
(Int -> ImportDocumentationPartsResponse -> ShowS)
-> (ImportDocumentationPartsResponse -> String)
-> ([ImportDocumentationPartsResponse] -> ShowS)
-> Show ImportDocumentationPartsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportDocumentationPartsResponse] -> ShowS
$cshowList :: [ImportDocumentationPartsResponse] -> ShowS
show :: ImportDocumentationPartsResponse -> String
$cshow :: ImportDocumentationPartsResponse -> String
showsPrec :: Int -> ImportDocumentationPartsResponse -> ShowS
$cshowsPrec :: Int -> ImportDocumentationPartsResponse -> ShowS
Prelude.Show, (forall x.
 ImportDocumentationPartsResponse
 -> Rep ImportDocumentationPartsResponse x)
-> (forall x.
    Rep ImportDocumentationPartsResponse x
    -> ImportDocumentationPartsResponse)
-> Generic ImportDocumentationPartsResponse
forall x.
Rep ImportDocumentationPartsResponse x
-> ImportDocumentationPartsResponse
forall x.
ImportDocumentationPartsResponse
-> Rep ImportDocumentationPartsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportDocumentationPartsResponse x
-> ImportDocumentationPartsResponse
$cfrom :: forall x.
ImportDocumentationPartsResponse
-> Rep ImportDocumentationPartsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ImportDocumentationPartsResponse' 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:
--
-- 'ids', 'importDocumentationPartsResponse_ids' - A list of the returned documentation part identifiers.
--
-- 'warnings', 'importDocumentationPartsResponse_warnings' - A list of warning messages reported during import of documentation
-- parts.
--
-- 'httpStatus', 'importDocumentationPartsResponse_httpStatus' - The response's http status code.
newImportDocumentationPartsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ImportDocumentationPartsResponse
newImportDocumentationPartsResponse :: Int -> ImportDocumentationPartsResponse
newImportDocumentationPartsResponse Int
pHttpStatus_ =
  ImportDocumentationPartsResponse' :: Maybe [Text]
-> Maybe [Text] -> Int -> ImportDocumentationPartsResponse
ImportDocumentationPartsResponse'
    { $sel:ids:ImportDocumentationPartsResponse' :: Maybe [Text]
ids =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:warnings:ImportDocumentationPartsResponse' :: Maybe [Text]
warnings = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ImportDocumentationPartsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of the returned documentation part identifiers.
importDocumentationPartsResponse_ids :: Lens.Lens' ImportDocumentationPartsResponse (Prelude.Maybe [Prelude.Text])
importDocumentationPartsResponse_ids :: (Maybe [Text] -> f (Maybe [Text]))
-> ImportDocumentationPartsResponse
-> f ImportDocumentationPartsResponse
importDocumentationPartsResponse_ids = (ImportDocumentationPartsResponse -> Maybe [Text])
-> (ImportDocumentationPartsResponse
    -> Maybe [Text] -> ImportDocumentationPartsResponse)
-> Lens
     ImportDocumentationPartsResponse
     ImportDocumentationPartsResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportDocumentationPartsResponse' {Maybe [Text]
ids :: Maybe [Text]
$sel:ids:ImportDocumentationPartsResponse' :: ImportDocumentationPartsResponse -> Maybe [Text]
ids} -> Maybe [Text]
ids) (\s :: ImportDocumentationPartsResponse
s@ImportDocumentationPartsResponse' {} Maybe [Text]
a -> ImportDocumentationPartsResponse
s {$sel:ids:ImportDocumentationPartsResponse' :: Maybe [Text]
ids = Maybe [Text]
a} :: ImportDocumentationPartsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ImportDocumentationPartsResponse
 -> f ImportDocumentationPartsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ImportDocumentationPartsResponse
-> f ImportDocumentationPartsResponse
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

-- | A list of warning messages reported during import of documentation
-- parts.
importDocumentationPartsResponse_warnings :: Lens.Lens' ImportDocumentationPartsResponse (Prelude.Maybe [Prelude.Text])
importDocumentationPartsResponse_warnings :: (Maybe [Text] -> f (Maybe [Text]))
-> ImportDocumentationPartsResponse
-> f ImportDocumentationPartsResponse
importDocumentationPartsResponse_warnings = (ImportDocumentationPartsResponse -> Maybe [Text])
-> (ImportDocumentationPartsResponse
    -> Maybe [Text] -> ImportDocumentationPartsResponse)
-> Lens
     ImportDocumentationPartsResponse
     ImportDocumentationPartsResponse
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportDocumentationPartsResponse' {Maybe [Text]
warnings :: Maybe [Text]
$sel:warnings:ImportDocumentationPartsResponse' :: ImportDocumentationPartsResponse -> Maybe [Text]
warnings} -> Maybe [Text]
warnings) (\s :: ImportDocumentationPartsResponse
s@ImportDocumentationPartsResponse' {} Maybe [Text]
a -> ImportDocumentationPartsResponse
s {$sel:warnings:ImportDocumentationPartsResponse' :: Maybe [Text]
warnings = Maybe [Text]
a} :: ImportDocumentationPartsResponse) ((Maybe [Text] -> f (Maybe [Text]))
 -> ImportDocumentationPartsResponse
 -> f ImportDocumentationPartsResponse)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ImportDocumentationPartsResponse
-> f ImportDocumentationPartsResponse
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

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

instance
  Prelude.NFData
    ImportDocumentationPartsResponse