{-# 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.IAM.CreateInstanceProfile
-- 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 new instance profile. For information about instance profiles,
-- see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html Using roles for applications on Amazon EC2>
-- in the /IAM User Guide/, and
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#ec2-instance-profile Instance profiles>
-- in the /Amazon EC2 User Guide/.
--
-- For information about the number of instance profiles you can create,
-- see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html IAM object quotas>
-- in the /IAM User Guide/.
module Amazonka.IAM.CreateInstanceProfile
  ( -- * Creating a Request
    CreateInstanceProfile (..),
    newCreateInstanceProfile,

    -- * Request Lenses
    createInstanceProfile_path,
    createInstanceProfile_tags,
    createInstanceProfile_instanceProfileName,

    -- * Destructuring the Response
    CreateInstanceProfileResponse (..),
    newCreateInstanceProfileResponse,

    -- * Response Lenses
    createInstanceProfileResponse_httpStatus,
    createInstanceProfileResponse_instanceProfile,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IAM.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:/ 'newCreateInstanceProfile' smart constructor.
data CreateInstanceProfile = CreateInstanceProfile'
  { -- | The path to the instance profile. For more information about paths, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM Identifiers>
    -- in the /IAM User Guide/.
    --
    -- This parameter is optional. If it is not included, it defaults to a
    -- slash (\/).
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of either a forward slash (\/) by itself or a string that
    -- must begin and end with forward slashes. In addition, it can contain any
    -- ASCII character from the ! (@\\u0021@) through the DEL character
    -- (@\\u007F@), including most punctuation characters, digits, and upper
    -- and lowercased letters.
    CreateInstanceProfile -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | A list of tags that you want to attach to the newly created IAM instance
    -- profile. Each tag consists of a key name and an associated value. For
    -- more information about tagging, see
    -- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
    -- in the /IAM User Guide/.
    --
    -- If any one of the tags is invalid or if you exceed the allowed maximum
    -- number of tags, then the entire request fails and the resource is not
    -- created.
    CreateInstanceProfile -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the instance profile to create.
    --
    -- This parameter allows (through its
    -- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
    -- consisting of upper and lowercase alphanumeric characters with no
    -- spaces. You can also include any of the following characters: _+=,.\@-
    CreateInstanceProfile -> Text
instanceProfileName :: Prelude.Text
  }
  deriving (CreateInstanceProfile -> CreateInstanceProfile -> Bool
(CreateInstanceProfile -> CreateInstanceProfile -> Bool)
-> (CreateInstanceProfile -> CreateInstanceProfile -> Bool)
-> Eq CreateInstanceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
$c/= :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
== :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
$c== :: CreateInstanceProfile -> CreateInstanceProfile -> Bool
Prelude.Eq, ReadPrec [CreateInstanceProfile]
ReadPrec CreateInstanceProfile
Int -> ReadS CreateInstanceProfile
ReadS [CreateInstanceProfile]
(Int -> ReadS CreateInstanceProfile)
-> ReadS [CreateInstanceProfile]
-> ReadPrec CreateInstanceProfile
-> ReadPrec [CreateInstanceProfile]
-> Read CreateInstanceProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInstanceProfile]
$creadListPrec :: ReadPrec [CreateInstanceProfile]
readPrec :: ReadPrec CreateInstanceProfile
$creadPrec :: ReadPrec CreateInstanceProfile
readList :: ReadS [CreateInstanceProfile]
$creadList :: ReadS [CreateInstanceProfile]
readsPrec :: Int -> ReadS CreateInstanceProfile
$creadsPrec :: Int -> ReadS CreateInstanceProfile
Prelude.Read, Int -> CreateInstanceProfile -> ShowS
[CreateInstanceProfile] -> ShowS
CreateInstanceProfile -> String
(Int -> CreateInstanceProfile -> ShowS)
-> (CreateInstanceProfile -> String)
-> ([CreateInstanceProfile] -> ShowS)
-> Show CreateInstanceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstanceProfile] -> ShowS
$cshowList :: [CreateInstanceProfile] -> ShowS
show :: CreateInstanceProfile -> String
$cshow :: CreateInstanceProfile -> String
showsPrec :: Int -> CreateInstanceProfile -> ShowS
$cshowsPrec :: Int -> CreateInstanceProfile -> ShowS
Prelude.Show, (forall x. CreateInstanceProfile -> Rep CreateInstanceProfile x)
-> (forall x. Rep CreateInstanceProfile x -> CreateInstanceProfile)
-> Generic CreateInstanceProfile
forall x. Rep CreateInstanceProfile x -> CreateInstanceProfile
forall x. CreateInstanceProfile -> Rep CreateInstanceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateInstanceProfile x -> CreateInstanceProfile
$cfrom :: forall x. CreateInstanceProfile -> Rep CreateInstanceProfile x
Prelude.Generic)

-- |
-- Create a value of 'CreateInstanceProfile' 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:
--
-- 'path', 'createInstanceProfile_path' - The path to the instance profile. For more information about paths, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM Identifiers>
-- in the /IAM User Guide/.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/).
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of either a forward slash (\/) by itself or a string that
-- must begin and end with forward slashes. In addition, it can contain any
-- ASCII character from the ! (@\\u0021@) through the DEL character
-- (@\\u007F@), including most punctuation characters, digits, and upper
-- and lowercased letters.
--
-- 'tags', 'createInstanceProfile_tags' - A list of tags that you want to attach to the newly created IAM instance
-- profile. Each tag consists of a key name and an associated value. For
-- more information about tagging, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
--
-- If any one of the tags is invalid or if you exceed the allowed maximum
-- number of tags, then the entire request fails and the resource is not
-- created.
--
-- 'instanceProfileName', 'createInstanceProfile_instanceProfileName' - The name of the instance profile to create.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
newCreateInstanceProfile ::
  -- | 'instanceProfileName'
  Prelude.Text ->
  CreateInstanceProfile
newCreateInstanceProfile :: Text -> CreateInstanceProfile
newCreateInstanceProfile Text
pInstanceProfileName_ =
  CreateInstanceProfile' :: Maybe Text -> Maybe [Tag] -> Text -> CreateInstanceProfile
CreateInstanceProfile'
    { $sel:path:CreateInstanceProfile' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateInstanceProfile' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceProfileName:CreateInstanceProfile' :: Text
instanceProfileName = Text
pInstanceProfileName_
    }

-- | The path to the instance profile. For more information about paths, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html IAM Identifiers>
-- in the /IAM User Guide/.
--
-- This parameter is optional. If it is not included, it defaults to a
-- slash (\/).
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of either a forward slash (\/) by itself or a string that
-- must begin and end with forward slashes. In addition, it can contain any
-- ASCII character from the ! (@\\u0021@) through the DEL character
-- (@\\u007F@), including most punctuation characters, digits, and upper
-- and lowercased letters.
createInstanceProfile_path :: Lens.Lens' CreateInstanceProfile (Prelude.Maybe Prelude.Text)
createInstanceProfile_path :: (Maybe Text -> f (Maybe Text))
-> CreateInstanceProfile -> f CreateInstanceProfile
createInstanceProfile_path = (CreateInstanceProfile -> Maybe Text)
-> (CreateInstanceProfile -> Maybe Text -> CreateInstanceProfile)
-> Lens
     CreateInstanceProfile
     CreateInstanceProfile
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfile' {Maybe Text
path :: Maybe Text
$sel:path:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe Text
path} -> Maybe Text
path) (\s :: CreateInstanceProfile
s@CreateInstanceProfile' {} Maybe Text
a -> CreateInstanceProfile
s {$sel:path:CreateInstanceProfile' :: Maybe Text
path = Maybe Text
a} :: CreateInstanceProfile)

-- | A list of tags that you want to attach to the newly created IAM instance
-- profile. Each tag consists of a key name and an associated value. For
-- more information about tagging, see
-- <https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html Tagging IAM resources>
-- in the /IAM User Guide/.
--
-- If any one of the tags is invalid or if you exceed the allowed maximum
-- number of tags, then the entire request fails and the resource is not
-- created.
createInstanceProfile_tags :: Lens.Lens' CreateInstanceProfile (Prelude.Maybe [Tag])
createInstanceProfile_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateInstanceProfile -> f CreateInstanceProfile
createInstanceProfile_tags = (CreateInstanceProfile -> Maybe [Tag])
-> (CreateInstanceProfile -> Maybe [Tag] -> CreateInstanceProfile)
-> Lens
     CreateInstanceProfile
     CreateInstanceProfile
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfile' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateInstanceProfile
s@CreateInstanceProfile' {} Maybe [Tag]
a -> CreateInstanceProfile
s {$sel:tags:CreateInstanceProfile' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateInstanceProfile) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateInstanceProfile -> f CreateInstanceProfile)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateInstanceProfile
-> f CreateInstanceProfile
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 name of the instance profile to create.
--
-- This parameter allows (through its
-- <http://wikipedia.org/wiki/regex regex pattern>) a string of characters
-- consisting of upper and lowercase alphanumeric characters with no
-- spaces. You can also include any of the following characters: _+=,.\@-
createInstanceProfile_instanceProfileName :: Lens.Lens' CreateInstanceProfile Prelude.Text
createInstanceProfile_instanceProfileName :: (Text -> f Text)
-> CreateInstanceProfile -> f CreateInstanceProfile
createInstanceProfile_instanceProfileName = (CreateInstanceProfile -> Text)
-> (CreateInstanceProfile -> Text -> CreateInstanceProfile)
-> Lens CreateInstanceProfile CreateInstanceProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfile' {Text
instanceProfileName :: Text
$sel:instanceProfileName:CreateInstanceProfile' :: CreateInstanceProfile -> Text
instanceProfileName} -> Text
instanceProfileName) (\s :: CreateInstanceProfile
s@CreateInstanceProfile' {} Text
a -> CreateInstanceProfile
s {$sel:instanceProfileName:CreateInstanceProfile' :: Text
instanceProfileName = Text
a} :: CreateInstanceProfile)

instance Core.AWSRequest CreateInstanceProfile where
  type
    AWSResponse CreateInstanceProfile =
      CreateInstanceProfileResponse
  request :: CreateInstanceProfile -> Request CreateInstanceProfile
request = Service -> CreateInstanceProfile -> Request CreateInstanceProfile
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateInstanceProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateInstanceProfile)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse CreateInstanceProfile))
-> Logger
-> Service
-> Proxy CreateInstanceProfile
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateInstanceProfile)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"CreateInstanceProfileResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> InstanceProfile -> CreateInstanceProfileResponse
CreateInstanceProfileResponse'
            (Int -> InstanceProfile -> CreateInstanceProfileResponse)
-> Either String Int
-> Either String (InstanceProfile -> CreateInstanceProfileResponse)
forall (f :: * -> *) a b. Functor 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))
            Either String (InstanceProfile -> CreateInstanceProfileResponse)
-> Either String InstanceProfile
-> Either String CreateInstanceProfileResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String InstanceProfile
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"InstanceProfile")
      )

instance Prelude.Hashable CreateInstanceProfile

instance Prelude.NFData CreateInstanceProfile

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

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

instance Core.ToQuery CreateInstanceProfile where
  toQuery :: CreateInstanceProfile -> QueryString
toQuery CreateInstanceProfile' {Maybe [Tag]
Maybe Text
Text
instanceProfileName :: Text
tags :: Maybe [Tag]
path :: Maybe Text
$sel:instanceProfileName:CreateInstanceProfile' :: CreateInstanceProfile -> Text
$sel:tags:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe [Tag]
$sel:path:CreateInstanceProfile' :: CreateInstanceProfile -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CreateInstanceProfile" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2010-05-08" :: Prelude.ByteString),
        ByteString
"Path" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
path,
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"InstanceProfileName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
instanceProfileName
      ]

-- | Contains the response to a successful CreateInstanceProfile request.
--
-- /See:/ 'newCreateInstanceProfileResponse' smart constructor.
data CreateInstanceProfileResponse = CreateInstanceProfileResponse'
  { -- | The response's http status code.
    CreateInstanceProfileResponse -> Int
httpStatus :: Prelude.Int,
    -- | A structure containing details about the new instance profile.
    CreateInstanceProfileResponse -> InstanceProfile
instanceProfile :: InstanceProfile
  }
  deriving (CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
(CreateInstanceProfileResponse
 -> CreateInstanceProfileResponse -> Bool)
-> (CreateInstanceProfileResponse
    -> CreateInstanceProfileResponse -> Bool)
-> Eq CreateInstanceProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
$c/= :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
== :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
$c== :: CreateInstanceProfileResponse
-> CreateInstanceProfileResponse -> Bool
Prelude.Eq, ReadPrec [CreateInstanceProfileResponse]
ReadPrec CreateInstanceProfileResponse
Int -> ReadS CreateInstanceProfileResponse
ReadS [CreateInstanceProfileResponse]
(Int -> ReadS CreateInstanceProfileResponse)
-> ReadS [CreateInstanceProfileResponse]
-> ReadPrec CreateInstanceProfileResponse
-> ReadPrec [CreateInstanceProfileResponse]
-> Read CreateInstanceProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateInstanceProfileResponse]
$creadListPrec :: ReadPrec [CreateInstanceProfileResponse]
readPrec :: ReadPrec CreateInstanceProfileResponse
$creadPrec :: ReadPrec CreateInstanceProfileResponse
readList :: ReadS [CreateInstanceProfileResponse]
$creadList :: ReadS [CreateInstanceProfileResponse]
readsPrec :: Int -> ReadS CreateInstanceProfileResponse
$creadsPrec :: Int -> ReadS CreateInstanceProfileResponse
Prelude.Read, Int -> CreateInstanceProfileResponse -> ShowS
[CreateInstanceProfileResponse] -> ShowS
CreateInstanceProfileResponse -> String
(Int -> CreateInstanceProfileResponse -> ShowS)
-> (CreateInstanceProfileResponse -> String)
-> ([CreateInstanceProfileResponse] -> ShowS)
-> Show CreateInstanceProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateInstanceProfileResponse] -> ShowS
$cshowList :: [CreateInstanceProfileResponse] -> ShowS
show :: CreateInstanceProfileResponse -> String
$cshow :: CreateInstanceProfileResponse -> String
showsPrec :: Int -> CreateInstanceProfileResponse -> ShowS
$cshowsPrec :: Int -> CreateInstanceProfileResponse -> ShowS
Prelude.Show, (forall x.
 CreateInstanceProfileResponse
 -> Rep CreateInstanceProfileResponse x)
-> (forall x.
    Rep CreateInstanceProfileResponse x
    -> CreateInstanceProfileResponse)
-> Generic CreateInstanceProfileResponse
forall x.
Rep CreateInstanceProfileResponse x
-> CreateInstanceProfileResponse
forall x.
CreateInstanceProfileResponse
-> Rep CreateInstanceProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateInstanceProfileResponse x
-> CreateInstanceProfileResponse
$cfrom :: forall x.
CreateInstanceProfileResponse
-> Rep CreateInstanceProfileResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateInstanceProfileResponse' 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:
--
-- 'httpStatus', 'createInstanceProfileResponse_httpStatus' - The response's http status code.
--
-- 'instanceProfile', 'createInstanceProfileResponse_instanceProfile' - A structure containing details about the new instance profile.
newCreateInstanceProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'instanceProfile'
  InstanceProfile ->
  CreateInstanceProfileResponse
newCreateInstanceProfileResponse :: Int -> InstanceProfile -> CreateInstanceProfileResponse
newCreateInstanceProfileResponse
  Int
pHttpStatus_
  InstanceProfile
pInstanceProfile_ =
    CreateInstanceProfileResponse' :: Int -> InstanceProfile -> CreateInstanceProfileResponse
CreateInstanceProfileResponse'
      { $sel:httpStatus:CreateInstanceProfileResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:instanceProfile:CreateInstanceProfileResponse' :: InstanceProfile
instanceProfile = InstanceProfile
pInstanceProfile_
      }

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

-- | A structure containing details about the new instance profile.
createInstanceProfileResponse_instanceProfile :: Lens.Lens' CreateInstanceProfileResponse InstanceProfile
createInstanceProfileResponse_instanceProfile :: (InstanceProfile -> f InstanceProfile)
-> CreateInstanceProfileResponse -> f CreateInstanceProfileResponse
createInstanceProfileResponse_instanceProfile = (CreateInstanceProfileResponse -> InstanceProfile)
-> (CreateInstanceProfileResponse
    -> InstanceProfile -> CreateInstanceProfileResponse)
-> Lens
     CreateInstanceProfileResponse
     CreateInstanceProfileResponse
     InstanceProfile
     InstanceProfile
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateInstanceProfileResponse' {InstanceProfile
instanceProfile :: InstanceProfile
$sel:instanceProfile:CreateInstanceProfileResponse' :: CreateInstanceProfileResponse -> InstanceProfile
instanceProfile} -> InstanceProfile
instanceProfile) (\s :: CreateInstanceProfileResponse
s@CreateInstanceProfileResponse' {} InstanceProfile
a -> CreateInstanceProfileResponse
s {$sel:instanceProfile:CreateInstanceProfileResponse' :: InstanceProfile
instanceProfile = InstanceProfile
a} :: CreateInstanceProfileResponse)

instance Prelude.NFData CreateInstanceProfileResponse