{-# 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.IoT.CreateRoleAlias
-- 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)
--
-- Creates a role alias.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions CreateRoleAlias>
-- action.
module Amazonka.IoT.CreateRoleAlias
  ( -- * Creating a Request
    CreateRoleAlias (..),
    newCreateRoleAlias,

    -- * Request Lenses
    createRoleAlias_credentialDurationSeconds,
    createRoleAlias_tags,
    createRoleAlias_roleAlias,
    createRoleAlias_roleArn,

    -- * Destructuring the Response
    CreateRoleAliasResponse (..),
    newCreateRoleAliasResponse,

    -- * Response Lenses
    createRoleAliasResponse_roleAliasArn,
    createRoleAliasResponse_roleAlias,
    createRoleAliasResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.Types
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:/ 'newCreateRoleAlias' smart constructor.
data CreateRoleAlias = CreateRoleAlias'
  { -- | How long (in seconds) the credentials will be valid. The default value
    -- is 3,600 seconds.
    CreateRoleAlias -> Maybe Natural
credentialDurationSeconds :: Prelude.Maybe Prelude.Natural,
    -- | Metadata which can be used to manage the role alias.
    --
    -- For URI Request parameters use format: ...key1=value1&key2=value2...
    --
    -- For the CLI command-line parameter use format: &&tags
    -- \"key1=value1&key2=value2...\"
    --
    -- For the cli-input-json file use format: \"tags\":
    -- \"key1=value1&key2=value2...\"
    CreateRoleAlias -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The role alias that points to a role ARN. This allows you to change the
    -- role without having to update the device.
    CreateRoleAlias -> Text
roleAlias :: Prelude.Text,
    -- | The role ARN.
    CreateRoleAlias -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateRoleAlias -> CreateRoleAlias -> Bool
(CreateRoleAlias -> CreateRoleAlias -> Bool)
-> (CreateRoleAlias -> CreateRoleAlias -> Bool)
-> Eq CreateRoleAlias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRoleAlias -> CreateRoleAlias -> Bool
$c/= :: CreateRoleAlias -> CreateRoleAlias -> Bool
== :: CreateRoleAlias -> CreateRoleAlias -> Bool
$c== :: CreateRoleAlias -> CreateRoleAlias -> Bool
Prelude.Eq, ReadPrec [CreateRoleAlias]
ReadPrec CreateRoleAlias
Int -> ReadS CreateRoleAlias
ReadS [CreateRoleAlias]
(Int -> ReadS CreateRoleAlias)
-> ReadS [CreateRoleAlias]
-> ReadPrec CreateRoleAlias
-> ReadPrec [CreateRoleAlias]
-> Read CreateRoleAlias
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRoleAlias]
$creadListPrec :: ReadPrec [CreateRoleAlias]
readPrec :: ReadPrec CreateRoleAlias
$creadPrec :: ReadPrec CreateRoleAlias
readList :: ReadS [CreateRoleAlias]
$creadList :: ReadS [CreateRoleAlias]
readsPrec :: Int -> ReadS CreateRoleAlias
$creadsPrec :: Int -> ReadS CreateRoleAlias
Prelude.Read, Int -> CreateRoleAlias -> ShowS
[CreateRoleAlias] -> ShowS
CreateRoleAlias -> String
(Int -> CreateRoleAlias -> ShowS)
-> (CreateRoleAlias -> String)
-> ([CreateRoleAlias] -> ShowS)
-> Show CreateRoleAlias
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRoleAlias] -> ShowS
$cshowList :: [CreateRoleAlias] -> ShowS
show :: CreateRoleAlias -> String
$cshow :: CreateRoleAlias -> String
showsPrec :: Int -> CreateRoleAlias -> ShowS
$cshowsPrec :: Int -> CreateRoleAlias -> ShowS
Prelude.Show, (forall x. CreateRoleAlias -> Rep CreateRoleAlias x)
-> (forall x. Rep CreateRoleAlias x -> CreateRoleAlias)
-> Generic CreateRoleAlias
forall x. Rep CreateRoleAlias x -> CreateRoleAlias
forall x. CreateRoleAlias -> Rep CreateRoleAlias x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateRoleAlias x -> CreateRoleAlias
$cfrom :: forall x. CreateRoleAlias -> Rep CreateRoleAlias x
Prelude.Generic)

-- |
-- Create a value of 'CreateRoleAlias' 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:
--
-- 'credentialDurationSeconds', 'createRoleAlias_credentialDurationSeconds' - How long (in seconds) the credentials will be valid. The default value
-- is 3,600 seconds.
--
-- 'tags', 'createRoleAlias_tags' - Metadata which can be used to manage the role alias.
--
-- For URI Request parameters use format: ...key1=value1&key2=value2...
--
-- For the CLI command-line parameter use format: &&tags
-- \"key1=value1&key2=value2...\"
--
-- For the cli-input-json file use format: \"tags\":
-- \"key1=value1&key2=value2...\"
--
-- 'roleAlias', 'createRoleAlias_roleAlias' - The role alias that points to a role ARN. This allows you to change the
-- role without having to update the device.
--
-- 'roleArn', 'createRoleAlias_roleArn' - The role ARN.
newCreateRoleAlias ::
  -- | 'roleAlias'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateRoleAlias
newCreateRoleAlias :: Text -> Text -> CreateRoleAlias
newCreateRoleAlias Text
pRoleAlias_ Text
pRoleArn_ =
  CreateRoleAlias' :: Maybe Natural -> Maybe [Tag] -> Text -> Text -> CreateRoleAlias
CreateRoleAlias'
    { $sel:credentialDurationSeconds:CreateRoleAlias' :: Maybe Natural
credentialDurationSeconds =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateRoleAlias' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:roleAlias:CreateRoleAlias' :: Text
roleAlias = Text
pRoleAlias_,
      $sel:roleArn:CreateRoleAlias' :: Text
roleArn = Text
pRoleArn_
    }

-- | How long (in seconds) the credentials will be valid. The default value
-- is 3,600 seconds.
createRoleAlias_credentialDurationSeconds :: Lens.Lens' CreateRoleAlias (Prelude.Maybe Prelude.Natural)
createRoleAlias_credentialDurationSeconds :: (Maybe Natural -> f (Maybe Natural))
-> CreateRoleAlias -> f CreateRoleAlias
createRoleAlias_credentialDurationSeconds = (CreateRoleAlias -> Maybe Natural)
-> (CreateRoleAlias -> Maybe Natural -> CreateRoleAlias)
-> Lens
     CreateRoleAlias CreateRoleAlias (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoleAlias' {Maybe Natural
credentialDurationSeconds :: Maybe Natural
$sel:credentialDurationSeconds:CreateRoleAlias' :: CreateRoleAlias -> Maybe Natural
credentialDurationSeconds} -> Maybe Natural
credentialDurationSeconds) (\s :: CreateRoleAlias
s@CreateRoleAlias' {} Maybe Natural
a -> CreateRoleAlias
s {$sel:credentialDurationSeconds:CreateRoleAlias' :: Maybe Natural
credentialDurationSeconds = Maybe Natural
a} :: CreateRoleAlias)

-- | Metadata which can be used to manage the role alias.
--
-- For URI Request parameters use format: ...key1=value1&key2=value2...
--
-- For the CLI command-line parameter use format: &&tags
-- \"key1=value1&key2=value2...\"
--
-- For the cli-input-json file use format: \"tags\":
-- \"key1=value1&key2=value2...\"
createRoleAlias_tags :: Lens.Lens' CreateRoleAlias (Prelude.Maybe [Tag])
createRoleAlias_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRoleAlias -> f CreateRoleAlias
createRoleAlias_tags = (CreateRoleAlias -> Maybe [Tag])
-> (CreateRoleAlias -> Maybe [Tag] -> CreateRoleAlias)
-> Lens CreateRoleAlias CreateRoleAlias (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoleAlias' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateRoleAlias' :: CreateRoleAlias -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateRoleAlias
s@CreateRoleAlias' {} Maybe [Tag]
a -> CreateRoleAlias
s {$sel:tags:CreateRoleAlias' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateRoleAlias) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateRoleAlias -> f CreateRoleAlias)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateRoleAlias
-> f CreateRoleAlias
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The role alias that points to a role ARN. This allows you to change the
-- role without having to update the device.
createRoleAlias_roleAlias :: Lens.Lens' CreateRoleAlias Prelude.Text
createRoleAlias_roleAlias :: (Text -> f Text) -> CreateRoleAlias -> f CreateRoleAlias
createRoleAlias_roleAlias = (CreateRoleAlias -> Text)
-> (CreateRoleAlias -> Text -> CreateRoleAlias)
-> Lens CreateRoleAlias CreateRoleAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoleAlias' {Text
roleAlias :: Text
$sel:roleAlias:CreateRoleAlias' :: CreateRoleAlias -> Text
roleAlias} -> Text
roleAlias) (\s :: CreateRoleAlias
s@CreateRoleAlias' {} Text
a -> CreateRoleAlias
s {$sel:roleAlias:CreateRoleAlias' :: Text
roleAlias = Text
a} :: CreateRoleAlias)

-- | The role ARN.
createRoleAlias_roleArn :: Lens.Lens' CreateRoleAlias Prelude.Text
createRoleAlias_roleArn :: (Text -> f Text) -> CreateRoleAlias -> f CreateRoleAlias
createRoleAlias_roleArn = (CreateRoleAlias -> Text)
-> (CreateRoleAlias -> Text -> CreateRoleAlias)
-> Lens CreateRoleAlias CreateRoleAlias Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoleAlias' {Text
roleArn :: Text
$sel:roleArn:CreateRoleAlias' :: CreateRoleAlias -> Text
roleArn} -> Text
roleArn) (\s :: CreateRoleAlias
s@CreateRoleAlias' {} Text
a -> CreateRoleAlias
s {$sel:roleArn:CreateRoleAlias' :: Text
roleArn = Text
a} :: CreateRoleAlias)

instance Core.AWSRequest CreateRoleAlias where
  type
    AWSResponse CreateRoleAlias =
      CreateRoleAliasResponse
  request :: CreateRoleAlias -> Request CreateRoleAlias
request = Service -> CreateRoleAlias -> Request CreateRoleAlias
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateRoleAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRoleAlias)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateRoleAlias))
-> Logger
-> Service
-> Proxy CreateRoleAlias
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateRoleAlias)))
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 -> CreateRoleAliasResponse
CreateRoleAliasResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateRoleAliasResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateRoleAliasResponse)
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
"roleAliasArn")
            Either String (Maybe Text -> Int -> CreateRoleAliasResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateRoleAliasResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"roleAlias")
            Either String (Int -> CreateRoleAliasResponse)
-> Either String Int -> Either String CreateRoleAliasResponse
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 CreateRoleAlias

instance Prelude.NFData CreateRoleAlias

instance Core.ToHeaders CreateRoleAlias where
  toHeaders :: CreateRoleAlias -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateRoleAlias -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateRoleAlias where
  toJSON :: CreateRoleAlias -> Value
toJSON CreateRoleAlias' {Maybe Natural
Maybe [Tag]
Text
roleArn :: Text
roleAlias :: Text
tags :: Maybe [Tag]
credentialDurationSeconds :: Maybe Natural
$sel:roleArn:CreateRoleAlias' :: CreateRoleAlias -> Text
$sel:roleAlias:CreateRoleAlias' :: CreateRoleAlias -> Text
$sel:tags:CreateRoleAlias' :: CreateRoleAlias -> Maybe [Tag]
$sel:credentialDurationSeconds:CreateRoleAlias' :: CreateRoleAlias -> Maybe Natural
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"credentialDurationSeconds" 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
credentialDurationSeconds,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
          ]
      )

instance Core.ToPath CreateRoleAlias where
  toPath :: CreateRoleAlias -> ByteString
toPath CreateRoleAlias' {Maybe Natural
Maybe [Tag]
Text
roleArn :: Text
roleAlias :: Text
tags :: Maybe [Tag]
credentialDurationSeconds :: Maybe Natural
$sel:roleArn:CreateRoleAlias' :: CreateRoleAlias -> Text
$sel:roleAlias:CreateRoleAlias' :: CreateRoleAlias -> Text
$sel:tags:CreateRoleAlias' :: CreateRoleAlias -> Maybe [Tag]
$sel:credentialDurationSeconds:CreateRoleAlias' :: CreateRoleAlias -> Maybe Natural
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/role-aliases/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
roleAlias]

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

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

-- |
-- Create a value of 'CreateRoleAliasResponse' 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:
--
-- 'roleAliasArn', 'createRoleAliasResponse_roleAliasArn' - The role alias ARN.
--
-- 'roleAlias', 'createRoleAliasResponse_roleAlias' - The role alias.
--
-- 'httpStatus', 'createRoleAliasResponse_httpStatus' - The response's http status code.
newCreateRoleAliasResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateRoleAliasResponse
newCreateRoleAliasResponse :: Int -> CreateRoleAliasResponse
newCreateRoleAliasResponse Int
pHttpStatus_ =
  CreateRoleAliasResponse' :: Maybe Text -> Maybe Text -> Int -> CreateRoleAliasResponse
CreateRoleAliasResponse'
    { $sel:roleAliasArn:CreateRoleAliasResponse' :: Maybe Text
roleAliasArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roleAlias:CreateRoleAliasResponse' :: Maybe Text
roleAlias = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateRoleAliasResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The role alias ARN.
createRoleAliasResponse_roleAliasArn :: Lens.Lens' CreateRoleAliasResponse (Prelude.Maybe Prelude.Text)
createRoleAliasResponse_roleAliasArn :: (Maybe Text -> f (Maybe Text))
-> CreateRoleAliasResponse -> f CreateRoleAliasResponse
createRoleAliasResponse_roleAliasArn = (CreateRoleAliasResponse -> Maybe Text)
-> (CreateRoleAliasResponse
    -> Maybe Text -> CreateRoleAliasResponse)
-> Lens
     CreateRoleAliasResponse
     CreateRoleAliasResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoleAliasResponse' {Maybe Text
roleAliasArn :: Maybe Text
$sel:roleAliasArn:CreateRoleAliasResponse' :: CreateRoleAliasResponse -> Maybe Text
roleAliasArn} -> Maybe Text
roleAliasArn) (\s :: CreateRoleAliasResponse
s@CreateRoleAliasResponse' {} Maybe Text
a -> CreateRoleAliasResponse
s {$sel:roleAliasArn:CreateRoleAliasResponse' :: Maybe Text
roleAliasArn = Maybe Text
a} :: CreateRoleAliasResponse)

-- | The role alias.
createRoleAliasResponse_roleAlias :: Lens.Lens' CreateRoleAliasResponse (Prelude.Maybe Prelude.Text)
createRoleAliasResponse_roleAlias :: (Maybe Text -> f (Maybe Text))
-> CreateRoleAliasResponse -> f CreateRoleAliasResponse
createRoleAliasResponse_roleAlias = (CreateRoleAliasResponse -> Maybe Text)
-> (CreateRoleAliasResponse
    -> Maybe Text -> CreateRoleAliasResponse)
-> Lens
     CreateRoleAliasResponse
     CreateRoleAliasResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRoleAliasResponse' {Maybe Text
roleAlias :: Maybe Text
$sel:roleAlias:CreateRoleAliasResponse' :: CreateRoleAliasResponse -> Maybe Text
roleAlias} -> Maybe Text
roleAlias) (\s :: CreateRoleAliasResponse
s@CreateRoleAliasResponse' {} Maybe Text
a -> CreateRoleAliasResponse
s {$sel:roleAlias:CreateRoleAliasResponse' :: Maybe Text
roleAlias = Maybe Text
a} :: CreateRoleAliasResponse)

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

instance Prelude.NFData CreateRoleAliasResponse