{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.Types.LaunchTemplateIamInstanceProfileSpecificationRequest
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.EC2.Types.LaunchTemplateIamInstanceProfileSpecificationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | An IAM instance profile.
--
-- /See:/ 'newLaunchTemplateIamInstanceProfileSpecificationRequest' smart constructor.
data LaunchTemplateIamInstanceProfileSpecificationRequest = LaunchTemplateIamInstanceProfileSpecificationRequest'
  { -- | The Amazon Resource Name (ARN) of the instance profile.
    LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the instance profile.
    LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (LaunchTemplateIamInstanceProfileSpecificationRequest
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LaunchTemplateIamInstanceProfileSpecificationRequest
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> Bool
$c/= :: LaunchTemplateIamInstanceProfileSpecificationRequest
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> Bool
== :: LaunchTemplateIamInstanceProfileSpecificationRequest
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> Bool
$c== :: LaunchTemplateIamInstanceProfileSpecificationRequest
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> Bool
Prelude.Eq, ReadPrec [LaunchTemplateIamInstanceProfileSpecificationRequest]
ReadPrec LaunchTemplateIamInstanceProfileSpecificationRequest
Int -> ReadS LaunchTemplateIamInstanceProfileSpecificationRequest
ReadS [LaunchTemplateIamInstanceProfileSpecificationRequest]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LaunchTemplateIamInstanceProfileSpecificationRequest]
$creadListPrec :: ReadPrec [LaunchTemplateIamInstanceProfileSpecificationRequest]
readPrec :: ReadPrec LaunchTemplateIamInstanceProfileSpecificationRequest
$creadPrec :: ReadPrec LaunchTemplateIamInstanceProfileSpecificationRequest
readList :: ReadS [LaunchTemplateIamInstanceProfileSpecificationRequest]
$creadList :: ReadS [LaunchTemplateIamInstanceProfileSpecificationRequest]
readsPrec :: Int -> ReadS LaunchTemplateIamInstanceProfileSpecificationRequest
$creadsPrec :: Int -> ReadS LaunchTemplateIamInstanceProfileSpecificationRequest
Prelude.Read, Int
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> ShowS
[LaunchTemplateIamInstanceProfileSpecificationRequest] -> ShowS
LaunchTemplateIamInstanceProfileSpecificationRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LaunchTemplateIamInstanceProfileSpecificationRequest] -> ShowS
$cshowList :: [LaunchTemplateIamInstanceProfileSpecificationRequest] -> ShowS
show :: LaunchTemplateIamInstanceProfileSpecificationRequest -> String
$cshow :: LaunchTemplateIamInstanceProfileSpecificationRequest -> String
showsPrec :: Int
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> ShowS
$cshowsPrec :: Int
-> LaunchTemplateIamInstanceProfileSpecificationRequest -> ShowS
Prelude.Show, forall x.
Rep LaunchTemplateIamInstanceProfileSpecificationRequest x
-> LaunchTemplateIamInstanceProfileSpecificationRequest
forall x.
LaunchTemplateIamInstanceProfileSpecificationRequest
-> Rep LaunchTemplateIamInstanceProfileSpecificationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LaunchTemplateIamInstanceProfileSpecificationRequest x
-> LaunchTemplateIamInstanceProfileSpecificationRequest
$cfrom :: forall x.
LaunchTemplateIamInstanceProfileSpecificationRequest
-> Rep LaunchTemplateIamInstanceProfileSpecificationRequest x
Prelude.Generic)

-- |
-- Create a value of 'LaunchTemplateIamInstanceProfileSpecificationRequest' 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', 'launchTemplateIamInstanceProfileSpecificationRequest_arn' - The Amazon Resource Name (ARN) of the instance profile.
--
-- 'name', 'launchTemplateIamInstanceProfileSpecificationRequest_name' - The name of the instance profile.
newLaunchTemplateIamInstanceProfileSpecificationRequest ::
  LaunchTemplateIamInstanceProfileSpecificationRequest
newLaunchTemplateIamInstanceProfileSpecificationRequest :: LaunchTemplateIamInstanceProfileSpecificationRequest
newLaunchTemplateIamInstanceProfileSpecificationRequest =
  LaunchTemplateIamInstanceProfileSpecificationRequest'
    { $sel:arn:LaunchTemplateIamInstanceProfileSpecificationRequest' :: Maybe Text
arn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:name:LaunchTemplateIamInstanceProfileSpecificationRequest' :: Maybe Text
name =
        forall a. Maybe a
Prelude.Nothing
    }

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

-- | The name of the instance profile.
launchTemplateIamInstanceProfileSpecificationRequest_name :: Lens.Lens' LaunchTemplateIamInstanceProfileSpecificationRequest (Prelude.Maybe Prelude.Text)
launchTemplateIamInstanceProfileSpecificationRequest_name :: Lens'
  LaunchTemplateIamInstanceProfileSpecificationRequest (Maybe Text)
launchTemplateIamInstanceProfileSpecificationRequest_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LaunchTemplateIamInstanceProfileSpecificationRequest' {Maybe Text
name :: Maybe Text
$sel:name:LaunchTemplateIamInstanceProfileSpecificationRequest' :: LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
name} -> Maybe Text
name) (\s :: LaunchTemplateIamInstanceProfileSpecificationRequest
s@LaunchTemplateIamInstanceProfileSpecificationRequest' {} Maybe Text
a -> LaunchTemplateIamInstanceProfileSpecificationRequest
s {$sel:name:LaunchTemplateIamInstanceProfileSpecificationRequest' :: Maybe Text
name = Maybe Text
a} :: LaunchTemplateIamInstanceProfileSpecificationRequest)

instance
  Prelude.Hashable
    LaunchTemplateIamInstanceProfileSpecificationRequest
  where
  hashWithSalt :: Int -> LaunchTemplateIamInstanceProfileSpecificationRequest -> Int
hashWithSalt
    Int
_salt
    LaunchTemplateIamInstanceProfileSpecificationRequest' {Maybe Text
name :: Maybe Text
arn :: Maybe Text
$sel:name:LaunchTemplateIamInstanceProfileSpecificationRequest' :: LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
$sel:arn:LaunchTemplateIamInstanceProfileSpecificationRequest' :: LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance
  Prelude.NFData
    LaunchTemplateIamInstanceProfileSpecificationRequest
  where
  rnf :: LaunchTemplateIamInstanceProfileSpecificationRequest -> ()
rnf
    LaunchTemplateIamInstanceProfileSpecificationRequest' {Maybe Text
name :: Maybe Text
arn :: Maybe Text
$sel:name:LaunchTemplateIamInstanceProfileSpecificationRequest' :: LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
$sel:arn:LaunchTemplateIamInstanceProfileSpecificationRequest' :: LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name

instance
  Data.ToQuery
    LaunchTemplateIamInstanceProfileSpecificationRequest
  where
  toQuery :: LaunchTemplateIamInstanceProfileSpecificationRequest -> QueryString
toQuery
    LaunchTemplateIamInstanceProfileSpecificationRequest' {Maybe Text
name :: Maybe Text
arn :: Maybe Text
$sel:name:LaunchTemplateIamInstanceProfileSpecificationRequest' :: LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
$sel:arn:LaunchTemplateIamInstanceProfileSpecificationRequest' :: LaunchTemplateIamInstanceProfileSpecificationRequest -> Maybe Text
..} =
      forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ByteString
"Arn" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
arn, ByteString
"Name" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
name]