{-# 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.CodeBuild.ImportSourceCredentials
-- 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)
--
-- Imports the source repository credentials for an CodeBuild project that
-- has its source code stored in a GitHub, GitHub Enterprise, or Bitbucket
-- repository.
module Amazonka.CodeBuild.ImportSourceCredentials
  ( -- * Creating a Request
    ImportSourceCredentials (..),
    newImportSourceCredentials,

    -- * Request Lenses
    importSourceCredentials_username,
    importSourceCredentials_shouldOverwrite,
    importSourceCredentials_token,
    importSourceCredentials_serverType,
    importSourceCredentials_authType,

    -- * Destructuring the Response
    ImportSourceCredentialsResponse (..),
    newImportSourceCredentialsResponse,

    -- * Response Lenses
    importSourceCredentialsResponse_arn,
    importSourceCredentialsResponse_httpStatus,
  )
where

import Amazonka.CodeBuild.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:/ 'newImportSourceCredentials' smart constructor.
data ImportSourceCredentials = ImportSourceCredentials'
  { -- | The Bitbucket username when the @authType@ is BASIC_AUTH. This parameter
    -- is not valid for other types of source providers or connections.
    ImportSourceCredentials -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | Set to @false@ to prevent overwriting the repository source credentials.
    -- Set to @true@ to overwrite the repository source credentials. The
    -- default value is @true@.
    ImportSourceCredentials -> Maybe Bool
shouldOverwrite :: Prelude.Maybe Prelude.Bool,
    -- | For GitHub or GitHub Enterprise, this is the personal access token. For
    -- Bitbucket, this is the app password.
    ImportSourceCredentials -> Sensitive Text
token :: Core.Sensitive Prelude.Text,
    -- | The source provider used for this project.
    ImportSourceCredentials -> ServerType
serverType :: ServerType,
    -- | The type of authentication used to connect to a GitHub, GitHub
    -- Enterprise, or Bitbucket repository. An OAUTH connection is not
    -- supported by the API and must be created using the CodeBuild console.
    ImportSourceCredentials -> AuthType
authType :: AuthType
  }
  deriving (ImportSourceCredentials -> ImportSourceCredentials -> Bool
(ImportSourceCredentials -> ImportSourceCredentials -> Bool)
-> (ImportSourceCredentials -> ImportSourceCredentials -> Bool)
-> Eq ImportSourceCredentials
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportSourceCredentials -> ImportSourceCredentials -> Bool
$c/= :: ImportSourceCredentials -> ImportSourceCredentials -> Bool
== :: ImportSourceCredentials -> ImportSourceCredentials -> Bool
$c== :: ImportSourceCredentials -> ImportSourceCredentials -> Bool
Prelude.Eq, Int -> ImportSourceCredentials -> ShowS
[ImportSourceCredentials] -> ShowS
ImportSourceCredentials -> String
(Int -> ImportSourceCredentials -> ShowS)
-> (ImportSourceCredentials -> String)
-> ([ImportSourceCredentials] -> ShowS)
-> Show ImportSourceCredentials
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportSourceCredentials] -> ShowS
$cshowList :: [ImportSourceCredentials] -> ShowS
show :: ImportSourceCredentials -> String
$cshow :: ImportSourceCredentials -> String
showsPrec :: Int -> ImportSourceCredentials -> ShowS
$cshowsPrec :: Int -> ImportSourceCredentials -> ShowS
Prelude.Show, (forall x.
 ImportSourceCredentials -> Rep ImportSourceCredentials x)
-> (forall x.
    Rep ImportSourceCredentials x -> ImportSourceCredentials)
-> Generic ImportSourceCredentials
forall x. Rep ImportSourceCredentials x -> ImportSourceCredentials
forall x. ImportSourceCredentials -> Rep ImportSourceCredentials x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ImportSourceCredentials x -> ImportSourceCredentials
$cfrom :: forall x. ImportSourceCredentials -> Rep ImportSourceCredentials x
Prelude.Generic)

-- |
-- Create a value of 'ImportSourceCredentials' 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:
--
-- 'username', 'importSourceCredentials_username' - The Bitbucket username when the @authType@ is BASIC_AUTH. This parameter
-- is not valid for other types of source providers or connections.
--
-- 'shouldOverwrite', 'importSourceCredentials_shouldOverwrite' - Set to @false@ to prevent overwriting the repository source credentials.
-- Set to @true@ to overwrite the repository source credentials. The
-- default value is @true@.
--
-- 'token', 'importSourceCredentials_token' - For GitHub or GitHub Enterprise, this is the personal access token. For
-- Bitbucket, this is the app password.
--
-- 'serverType', 'importSourceCredentials_serverType' - The source provider used for this project.
--
-- 'authType', 'importSourceCredentials_authType' - The type of authentication used to connect to a GitHub, GitHub
-- Enterprise, or Bitbucket repository. An OAUTH connection is not
-- supported by the API and must be created using the CodeBuild console.
newImportSourceCredentials ::
  -- | 'token'
  Prelude.Text ->
  -- | 'serverType'
  ServerType ->
  -- | 'authType'
  AuthType ->
  ImportSourceCredentials
newImportSourceCredentials :: Text -> ServerType -> AuthType -> ImportSourceCredentials
newImportSourceCredentials
  Text
pToken_
  ServerType
pServerType_
  AuthType
pAuthType_ =
    ImportSourceCredentials' :: Maybe Text
-> Maybe Bool
-> Sensitive Text
-> ServerType
-> AuthType
-> ImportSourceCredentials
ImportSourceCredentials'
      { $sel:username:ImportSourceCredentials' :: Maybe Text
username =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:shouldOverwrite:ImportSourceCredentials' :: Maybe Bool
shouldOverwrite = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:token:ImportSourceCredentials' :: Sensitive Text
token = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pToken_,
        $sel:serverType:ImportSourceCredentials' :: ServerType
serverType = ServerType
pServerType_,
        $sel:authType:ImportSourceCredentials' :: AuthType
authType = AuthType
pAuthType_
      }

-- | The Bitbucket username when the @authType@ is BASIC_AUTH. This parameter
-- is not valid for other types of source providers or connections.
importSourceCredentials_username :: Lens.Lens' ImportSourceCredentials (Prelude.Maybe Prelude.Text)
importSourceCredentials_username :: (Maybe Text -> f (Maybe Text))
-> ImportSourceCredentials -> f ImportSourceCredentials
importSourceCredentials_username = (ImportSourceCredentials -> Maybe Text)
-> (ImportSourceCredentials
    -> Maybe Text -> ImportSourceCredentials)
-> Lens
     ImportSourceCredentials
     ImportSourceCredentials
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSourceCredentials' {Maybe Text
username :: Maybe Text
$sel:username:ImportSourceCredentials' :: ImportSourceCredentials -> Maybe Text
username} -> Maybe Text
username) (\s :: ImportSourceCredentials
s@ImportSourceCredentials' {} Maybe Text
a -> ImportSourceCredentials
s {$sel:username:ImportSourceCredentials' :: Maybe Text
username = Maybe Text
a} :: ImportSourceCredentials)

-- | Set to @false@ to prevent overwriting the repository source credentials.
-- Set to @true@ to overwrite the repository source credentials. The
-- default value is @true@.
importSourceCredentials_shouldOverwrite :: Lens.Lens' ImportSourceCredentials (Prelude.Maybe Prelude.Bool)
importSourceCredentials_shouldOverwrite :: (Maybe Bool -> f (Maybe Bool))
-> ImportSourceCredentials -> f ImportSourceCredentials
importSourceCredentials_shouldOverwrite = (ImportSourceCredentials -> Maybe Bool)
-> (ImportSourceCredentials
    -> Maybe Bool -> ImportSourceCredentials)
-> Lens
     ImportSourceCredentials
     ImportSourceCredentials
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSourceCredentials' {Maybe Bool
shouldOverwrite :: Maybe Bool
$sel:shouldOverwrite:ImportSourceCredentials' :: ImportSourceCredentials -> Maybe Bool
shouldOverwrite} -> Maybe Bool
shouldOverwrite) (\s :: ImportSourceCredentials
s@ImportSourceCredentials' {} Maybe Bool
a -> ImportSourceCredentials
s {$sel:shouldOverwrite:ImportSourceCredentials' :: Maybe Bool
shouldOverwrite = Maybe Bool
a} :: ImportSourceCredentials)

-- | For GitHub or GitHub Enterprise, this is the personal access token. For
-- Bitbucket, this is the app password.
importSourceCredentials_token :: Lens.Lens' ImportSourceCredentials Prelude.Text
importSourceCredentials_token :: (Text -> f Text)
-> ImportSourceCredentials -> f ImportSourceCredentials
importSourceCredentials_token = (ImportSourceCredentials -> Sensitive Text)
-> (ImportSourceCredentials
    -> Sensitive Text -> ImportSourceCredentials)
-> Lens
     ImportSourceCredentials
     ImportSourceCredentials
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSourceCredentials' {Sensitive Text
token :: Sensitive Text
$sel:token:ImportSourceCredentials' :: ImportSourceCredentials -> Sensitive Text
token} -> Sensitive Text
token) (\s :: ImportSourceCredentials
s@ImportSourceCredentials' {} Sensitive Text
a -> ImportSourceCredentials
s {$sel:token:ImportSourceCredentials' :: Sensitive Text
token = Sensitive Text
a} :: ImportSourceCredentials) ((Sensitive Text -> f (Sensitive Text))
 -> ImportSourceCredentials -> f ImportSourceCredentials)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> ImportSourceCredentials
-> f ImportSourceCredentials
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The source provider used for this project.
importSourceCredentials_serverType :: Lens.Lens' ImportSourceCredentials ServerType
importSourceCredentials_serverType :: (ServerType -> f ServerType)
-> ImportSourceCredentials -> f ImportSourceCredentials
importSourceCredentials_serverType = (ImportSourceCredentials -> ServerType)
-> (ImportSourceCredentials
    -> ServerType -> ImportSourceCredentials)
-> Lens
     ImportSourceCredentials
     ImportSourceCredentials
     ServerType
     ServerType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSourceCredentials' {ServerType
serverType :: ServerType
$sel:serverType:ImportSourceCredentials' :: ImportSourceCredentials -> ServerType
serverType} -> ServerType
serverType) (\s :: ImportSourceCredentials
s@ImportSourceCredentials' {} ServerType
a -> ImportSourceCredentials
s {$sel:serverType:ImportSourceCredentials' :: ServerType
serverType = ServerType
a} :: ImportSourceCredentials)

-- | The type of authentication used to connect to a GitHub, GitHub
-- Enterprise, or Bitbucket repository. An OAUTH connection is not
-- supported by the API and must be created using the CodeBuild console.
importSourceCredentials_authType :: Lens.Lens' ImportSourceCredentials AuthType
importSourceCredentials_authType :: (AuthType -> f AuthType)
-> ImportSourceCredentials -> f ImportSourceCredentials
importSourceCredentials_authType = (ImportSourceCredentials -> AuthType)
-> (ImportSourceCredentials -> AuthType -> ImportSourceCredentials)
-> Lens
     ImportSourceCredentials ImportSourceCredentials AuthType AuthType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSourceCredentials' {AuthType
authType :: AuthType
$sel:authType:ImportSourceCredentials' :: ImportSourceCredentials -> AuthType
authType} -> AuthType
authType) (\s :: ImportSourceCredentials
s@ImportSourceCredentials' {} AuthType
a -> ImportSourceCredentials
s {$sel:authType:ImportSourceCredentials' :: AuthType
authType = AuthType
a} :: ImportSourceCredentials)

instance Core.AWSRequest ImportSourceCredentials where
  type
    AWSResponse ImportSourceCredentials =
      ImportSourceCredentialsResponse
  request :: ImportSourceCredentials -> Request ImportSourceCredentials
request = Service
-> ImportSourceCredentials -> Request ImportSourceCredentials
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ImportSourceCredentials
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportSourceCredentials)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ImportSourceCredentials))
-> Logger
-> Service
-> Proxy ImportSourceCredentials
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ImportSourceCredentials)))
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 -> Int -> ImportSourceCredentialsResponse
ImportSourceCredentialsResponse'
            (Maybe Text -> Int -> ImportSourceCredentialsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ImportSourceCredentialsResponse)
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
"arn")
            Either String (Int -> ImportSourceCredentialsResponse)
-> Either String Int
-> Either String ImportSourceCredentialsResponse
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 ImportSourceCredentials

instance Prelude.NFData ImportSourceCredentials

instance Core.ToHeaders ImportSourceCredentials where
  toHeaders :: ImportSourceCredentials -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ImportSourceCredentials -> 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
"CodeBuild_20161006.ImportSourceCredentials" ::
                          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 ImportSourceCredentials where
  toJSON :: ImportSourceCredentials -> Value
toJSON ImportSourceCredentials' {Maybe Bool
Maybe Text
Sensitive Text
AuthType
ServerType
authType :: AuthType
serverType :: ServerType
token :: Sensitive Text
shouldOverwrite :: Maybe Bool
username :: Maybe Text
$sel:authType:ImportSourceCredentials' :: ImportSourceCredentials -> AuthType
$sel:serverType:ImportSourceCredentials' :: ImportSourceCredentials -> ServerType
$sel:token:ImportSourceCredentials' :: ImportSourceCredentials -> Sensitive Text
$sel:shouldOverwrite:ImportSourceCredentials' :: ImportSourceCredentials -> Maybe Bool
$sel:username:ImportSourceCredentials' :: ImportSourceCredentials -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"username" 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
username,
            (Text
"shouldOverwrite" 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
shouldOverwrite,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"token" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
token),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"serverType" Text -> ServerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ServerType
serverType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"authType" Text -> AuthType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AuthType
authType)
          ]
      )

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

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

-- | /See:/ 'newImportSourceCredentialsResponse' smart constructor.
data ImportSourceCredentialsResponse = ImportSourceCredentialsResponse'
  { -- | The Amazon Resource Name (ARN) of the token.
    ImportSourceCredentialsResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ImportSourceCredentialsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ImportSourceCredentialsResponse
-> ImportSourceCredentialsResponse -> Bool
(ImportSourceCredentialsResponse
 -> ImportSourceCredentialsResponse -> Bool)
-> (ImportSourceCredentialsResponse
    -> ImportSourceCredentialsResponse -> Bool)
-> Eq ImportSourceCredentialsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportSourceCredentialsResponse
-> ImportSourceCredentialsResponse -> Bool
$c/= :: ImportSourceCredentialsResponse
-> ImportSourceCredentialsResponse -> Bool
== :: ImportSourceCredentialsResponse
-> ImportSourceCredentialsResponse -> Bool
$c== :: ImportSourceCredentialsResponse
-> ImportSourceCredentialsResponse -> Bool
Prelude.Eq, ReadPrec [ImportSourceCredentialsResponse]
ReadPrec ImportSourceCredentialsResponse
Int -> ReadS ImportSourceCredentialsResponse
ReadS [ImportSourceCredentialsResponse]
(Int -> ReadS ImportSourceCredentialsResponse)
-> ReadS [ImportSourceCredentialsResponse]
-> ReadPrec ImportSourceCredentialsResponse
-> ReadPrec [ImportSourceCredentialsResponse]
-> Read ImportSourceCredentialsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportSourceCredentialsResponse]
$creadListPrec :: ReadPrec [ImportSourceCredentialsResponse]
readPrec :: ReadPrec ImportSourceCredentialsResponse
$creadPrec :: ReadPrec ImportSourceCredentialsResponse
readList :: ReadS [ImportSourceCredentialsResponse]
$creadList :: ReadS [ImportSourceCredentialsResponse]
readsPrec :: Int -> ReadS ImportSourceCredentialsResponse
$creadsPrec :: Int -> ReadS ImportSourceCredentialsResponse
Prelude.Read, Int -> ImportSourceCredentialsResponse -> ShowS
[ImportSourceCredentialsResponse] -> ShowS
ImportSourceCredentialsResponse -> String
(Int -> ImportSourceCredentialsResponse -> ShowS)
-> (ImportSourceCredentialsResponse -> String)
-> ([ImportSourceCredentialsResponse] -> ShowS)
-> Show ImportSourceCredentialsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportSourceCredentialsResponse] -> ShowS
$cshowList :: [ImportSourceCredentialsResponse] -> ShowS
show :: ImportSourceCredentialsResponse -> String
$cshow :: ImportSourceCredentialsResponse -> String
showsPrec :: Int -> ImportSourceCredentialsResponse -> ShowS
$cshowsPrec :: Int -> ImportSourceCredentialsResponse -> ShowS
Prelude.Show, (forall x.
 ImportSourceCredentialsResponse
 -> Rep ImportSourceCredentialsResponse x)
-> (forall x.
    Rep ImportSourceCredentialsResponse x
    -> ImportSourceCredentialsResponse)
-> Generic ImportSourceCredentialsResponse
forall x.
Rep ImportSourceCredentialsResponse x
-> ImportSourceCredentialsResponse
forall x.
ImportSourceCredentialsResponse
-> Rep ImportSourceCredentialsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportSourceCredentialsResponse x
-> ImportSourceCredentialsResponse
$cfrom :: forall x.
ImportSourceCredentialsResponse
-> Rep ImportSourceCredentialsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ImportSourceCredentialsResponse' 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:
--
-- 'arn', 'importSourceCredentialsResponse_arn' - The Amazon Resource Name (ARN) of the token.
--
-- 'httpStatus', 'importSourceCredentialsResponse_httpStatus' - The response's http status code.
newImportSourceCredentialsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ImportSourceCredentialsResponse
newImportSourceCredentialsResponse :: Int -> ImportSourceCredentialsResponse
newImportSourceCredentialsResponse Int
pHttpStatus_ =
  ImportSourceCredentialsResponse' :: Maybe Text -> Int -> ImportSourceCredentialsResponse
ImportSourceCredentialsResponse'
    { $sel:arn:ImportSourceCredentialsResponse' :: Maybe Text
arn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ImportSourceCredentialsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the token.
importSourceCredentialsResponse_arn :: Lens.Lens' ImportSourceCredentialsResponse (Prelude.Maybe Prelude.Text)
importSourceCredentialsResponse_arn :: (Maybe Text -> f (Maybe Text))
-> ImportSourceCredentialsResponse
-> f ImportSourceCredentialsResponse
importSourceCredentialsResponse_arn = (ImportSourceCredentialsResponse -> Maybe Text)
-> (ImportSourceCredentialsResponse
    -> Maybe Text -> ImportSourceCredentialsResponse)
-> Lens
     ImportSourceCredentialsResponse
     ImportSourceCredentialsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportSourceCredentialsResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:ImportSourceCredentialsResponse' :: ImportSourceCredentialsResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ImportSourceCredentialsResponse
s@ImportSourceCredentialsResponse' {} Maybe Text
a -> ImportSourceCredentialsResponse
s {$sel:arn:ImportSourceCredentialsResponse' :: Maybe Text
arn = Maybe Text
a} :: ImportSourceCredentialsResponse)

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

instance
  Prelude.NFData
    ImportSourceCredentialsResponse