{-# 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.DeviceFarm.UpdateInstanceProfile
-- 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)
--
-- Updates information about an existing private device instance profile.
module Amazonka.DeviceFarm.UpdateInstanceProfile
  ( -- * Creating a Request
    UpdateInstanceProfile (..),
    newUpdateInstanceProfile,

    -- * Request Lenses
    updateInstanceProfile_rebootAfterUse,
    updateInstanceProfile_name,
    updateInstanceProfile_packageCleanup,
    updateInstanceProfile_excludeAppPackagesFromCleanup,
    updateInstanceProfile_description,
    updateInstanceProfile_arn,

    -- * Destructuring the Response
    UpdateInstanceProfileResponse (..),
    newUpdateInstanceProfileResponse,

    -- * Response Lenses
    updateInstanceProfileResponse_instanceProfile,
    updateInstanceProfileResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.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:/ 'newUpdateInstanceProfile' smart constructor.
data UpdateInstanceProfile = UpdateInstanceProfile'
  { -- | The updated choice for whether you want to reboot the device after use.
    -- The default value is @true@.
    UpdateInstanceProfile -> Maybe Bool
rebootAfterUse :: Prelude.Maybe Prelude.Bool,
    -- | The updated name for your instance profile.
    UpdateInstanceProfile -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The updated choice for whether you want to specify package cleanup. The
    -- default value is @false@ for private devices.
    UpdateInstanceProfile -> Maybe Bool
packageCleanup :: Prelude.Maybe Prelude.Bool,
    -- | An array of strings that specifies the list of app packages that should
    -- not be cleaned up from the device after a test run is over.
    --
    -- The list of packages is only considered if you set @packageCleanup@ to
    -- @true@.
    UpdateInstanceProfile -> Maybe [Text]
excludeAppPackagesFromCleanup :: Prelude.Maybe [Prelude.Text],
    -- | The updated description for your instance profile.
    UpdateInstanceProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the instance profile.
    UpdateInstanceProfile -> Text
arn :: Prelude.Text
  }
  deriving (UpdateInstanceProfile -> UpdateInstanceProfile -> Bool
(UpdateInstanceProfile -> UpdateInstanceProfile -> Bool)
-> (UpdateInstanceProfile -> UpdateInstanceProfile -> Bool)
-> Eq UpdateInstanceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateInstanceProfile -> UpdateInstanceProfile -> Bool
$c/= :: UpdateInstanceProfile -> UpdateInstanceProfile -> Bool
== :: UpdateInstanceProfile -> UpdateInstanceProfile -> Bool
$c== :: UpdateInstanceProfile -> UpdateInstanceProfile -> Bool
Prelude.Eq, ReadPrec [UpdateInstanceProfile]
ReadPrec UpdateInstanceProfile
Int -> ReadS UpdateInstanceProfile
ReadS [UpdateInstanceProfile]
(Int -> ReadS UpdateInstanceProfile)
-> ReadS [UpdateInstanceProfile]
-> ReadPrec UpdateInstanceProfile
-> ReadPrec [UpdateInstanceProfile]
-> Read UpdateInstanceProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateInstanceProfile]
$creadListPrec :: ReadPrec [UpdateInstanceProfile]
readPrec :: ReadPrec UpdateInstanceProfile
$creadPrec :: ReadPrec UpdateInstanceProfile
readList :: ReadS [UpdateInstanceProfile]
$creadList :: ReadS [UpdateInstanceProfile]
readsPrec :: Int -> ReadS UpdateInstanceProfile
$creadsPrec :: Int -> ReadS UpdateInstanceProfile
Prelude.Read, Int -> UpdateInstanceProfile -> ShowS
[UpdateInstanceProfile] -> ShowS
UpdateInstanceProfile -> String
(Int -> UpdateInstanceProfile -> ShowS)
-> (UpdateInstanceProfile -> String)
-> ([UpdateInstanceProfile] -> ShowS)
-> Show UpdateInstanceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateInstanceProfile] -> ShowS
$cshowList :: [UpdateInstanceProfile] -> ShowS
show :: UpdateInstanceProfile -> String
$cshow :: UpdateInstanceProfile -> String
showsPrec :: Int -> UpdateInstanceProfile -> ShowS
$cshowsPrec :: Int -> UpdateInstanceProfile -> ShowS
Prelude.Show, (forall x. UpdateInstanceProfile -> Rep UpdateInstanceProfile x)
-> (forall x. Rep UpdateInstanceProfile x -> UpdateInstanceProfile)
-> Generic UpdateInstanceProfile
forall x. Rep UpdateInstanceProfile x -> UpdateInstanceProfile
forall x. UpdateInstanceProfile -> Rep UpdateInstanceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateInstanceProfile x -> UpdateInstanceProfile
$cfrom :: forall x. UpdateInstanceProfile -> Rep UpdateInstanceProfile x
Prelude.Generic)

-- |
-- Create a value of 'UpdateInstanceProfile' 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:
--
-- 'rebootAfterUse', 'updateInstanceProfile_rebootAfterUse' - The updated choice for whether you want to reboot the device after use.
-- The default value is @true@.
--
-- 'name', 'updateInstanceProfile_name' - The updated name for your instance profile.
--
-- 'packageCleanup', 'updateInstanceProfile_packageCleanup' - The updated choice for whether you want to specify package cleanup. The
-- default value is @false@ for private devices.
--
-- 'excludeAppPackagesFromCleanup', 'updateInstanceProfile_excludeAppPackagesFromCleanup' - An array of strings that specifies the list of app packages that should
-- not be cleaned up from the device after a test run is over.
--
-- The list of packages is only considered if you set @packageCleanup@ to
-- @true@.
--
-- 'description', 'updateInstanceProfile_description' - The updated description for your instance profile.
--
-- 'arn', 'updateInstanceProfile_arn' - The Amazon Resource Name (ARN) of the instance profile.
newUpdateInstanceProfile ::
  -- | 'arn'
  Prelude.Text ->
  UpdateInstanceProfile
newUpdateInstanceProfile :: Text -> UpdateInstanceProfile
newUpdateInstanceProfile Text
pArn_ =
  UpdateInstanceProfile' :: Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Text
-> UpdateInstanceProfile
UpdateInstanceProfile'
    { $sel:rebootAfterUse:UpdateInstanceProfile' :: Maybe Bool
rebootAfterUse =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateInstanceProfile' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:packageCleanup:UpdateInstanceProfile' :: Maybe Bool
packageCleanup = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:excludeAppPackagesFromCleanup:UpdateInstanceProfile' :: Maybe [Text]
excludeAppPackagesFromCleanup = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateInstanceProfile' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:UpdateInstanceProfile' :: Text
arn = Text
pArn_
    }

-- | The updated choice for whether you want to reboot the device after use.
-- The default value is @true@.
updateInstanceProfile_rebootAfterUse :: Lens.Lens' UpdateInstanceProfile (Prelude.Maybe Prelude.Bool)
updateInstanceProfile_rebootAfterUse :: (Maybe Bool -> f (Maybe Bool))
-> UpdateInstanceProfile -> f UpdateInstanceProfile
updateInstanceProfile_rebootAfterUse = (UpdateInstanceProfile -> Maybe Bool)
-> (UpdateInstanceProfile -> Maybe Bool -> UpdateInstanceProfile)
-> Lens
     UpdateInstanceProfile
     UpdateInstanceProfile
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstanceProfile' {Maybe Bool
rebootAfterUse :: Maybe Bool
$sel:rebootAfterUse:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Bool
rebootAfterUse} -> Maybe Bool
rebootAfterUse) (\s :: UpdateInstanceProfile
s@UpdateInstanceProfile' {} Maybe Bool
a -> UpdateInstanceProfile
s {$sel:rebootAfterUse:UpdateInstanceProfile' :: Maybe Bool
rebootAfterUse = Maybe Bool
a} :: UpdateInstanceProfile)

-- | The updated name for your instance profile.
updateInstanceProfile_name :: Lens.Lens' UpdateInstanceProfile (Prelude.Maybe Prelude.Text)
updateInstanceProfile_name :: (Maybe Text -> f (Maybe Text))
-> UpdateInstanceProfile -> f UpdateInstanceProfile
updateInstanceProfile_name = (UpdateInstanceProfile -> Maybe Text)
-> (UpdateInstanceProfile -> Maybe Text -> UpdateInstanceProfile)
-> Lens
     UpdateInstanceProfile
     UpdateInstanceProfile
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstanceProfile' {Maybe Text
name :: Maybe Text
$sel:name:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateInstanceProfile
s@UpdateInstanceProfile' {} Maybe Text
a -> UpdateInstanceProfile
s {$sel:name:UpdateInstanceProfile' :: Maybe Text
name = Maybe Text
a} :: UpdateInstanceProfile)

-- | The updated choice for whether you want to specify package cleanup. The
-- default value is @false@ for private devices.
updateInstanceProfile_packageCleanup :: Lens.Lens' UpdateInstanceProfile (Prelude.Maybe Prelude.Bool)
updateInstanceProfile_packageCleanup :: (Maybe Bool -> f (Maybe Bool))
-> UpdateInstanceProfile -> f UpdateInstanceProfile
updateInstanceProfile_packageCleanup = (UpdateInstanceProfile -> Maybe Bool)
-> (UpdateInstanceProfile -> Maybe Bool -> UpdateInstanceProfile)
-> Lens
     UpdateInstanceProfile
     UpdateInstanceProfile
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstanceProfile' {Maybe Bool
packageCleanup :: Maybe Bool
$sel:packageCleanup:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Bool
packageCleanup} -> Maybe Bool
packageCleanup) (\s :: UpdateInstanceProfile
s@UpdateInstanceProfile' {} Maybe Bool
a -> UpdateInstanceProfile
s {$sel:packageCleanup:UpdateInstanceProfile' :: Maybe Bool
packageCleanup = Maybe Bool
a} :: UpdateInstanceProfile)

-- | An array of strings that specifies the list of app packages that should
-- not be cleaned up from the device after a test run is over.
--
-- The list of packages is only considered if you set @packageCleanup@ to
-- @true@.
updateInstanceProfile_excludeAppPackagesFromCleanup :: Lens.Lens' UpdateInstanceProfile (Prelude.Maybe [Prelude.Text])
updateInstanceProfile_excludeAppPackagesFromCleanup :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateInstanceProfile -> f UpdateInstanceProfile
updateInstanceProfile_excludeAppPackagesFromCleanup = (UpdateInstanceProfile -> Maybe [Text])
-> (UpdateInstanceProfile -> Maybe [Text] -> UpdateInstanceProfile)
-> Lens
     UpdateInstanceProfile
     UpdateInstanceProfile
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstanceProfile' {Maybe [Text]
excludeAppPackagesFromCleanup :: Maybe [Text]
$sel:excludeAppPackagesFromCleanup:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe [Text]
excludeAppPackagesFromCleanup} -> Maybe [Text]
excludeAppPackagesFromCleanup) (\s :: UpdateInstanceProfile
s@UpdateInstanceProfile' {} Maybe [Text]
a -> UpdateInstanceProfile
s {$sel:excludeAppPackagesFromCleanup:UpdateInstanceProfile' :: Maybe [Text]
excludeAppPackagesFromCleanup = Maybe [Text]
a} :: UpdateInstanceProfile) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateInstanceProfile -> f UpdateInstanceProfile)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateInstanceProfile
-> f UpdateInstanceProfile
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 updated description for your instance profile.
updateInstanceProfile_description :: Lens.Lens' UpdateInstanceProfile (Prelude.Maybe Prelude.Text)
updateInstanceProfile_description :: (Maybe Text -> f (Maybe Text))
-> UpdateInstanceProfile -> f UpdateInstanceProfile
updateInstanceProfile_description = (UpdateInstanceProfile -> Maybe Text)
-> (UpdateInstanceProfile -> Maybe Text -> UpdateInstanceProfile)
-> Lens
     UpdateInstanceProfile
     UpdateInstanceProfile
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstanceProfile' {Maybe Text
description :: Maybe Text
$sel:description:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateInstanceProfile
s@UpdateInstanceProfile' {} Maybe Text
a -> UpdateInstanceProfile
s {$sel:description:UpdateInstanceProfile' :: Maybe Text
description = Maybe Text
a} :: UpdateInstanceProfile)

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

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

instance Prelude.NFData UpdateInstanceProfile

instance Core.ToHeaders UpdateInstanceProfile where
  toHeaders :: UpdateInstanceProfile -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateInstanceProfile -> 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
"DeviceFarm_20150623.UpdateInstanceProfile" ::
                          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 UpdateInstanceProfile where
  toJSON :: UpdateInstanceProfile -> Value
toJSON UpdateInstanceProfile' {Maybe Bool
Maybe [Text]
Maybe Text
Text
arn :: Text
description :: Maybe Text
excludeAppPackagesFromCleanup :: Maybe [Text]
packageCleanup :: Maybe Bool
name :: Maybe Text
rebootAfterUse :: Maybe Bool
$sel:arn:UpdateInstanceProfile' :: UpdateInstanceProfile -> Text
$sel:description:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Text
$sel:excludeAppPackagesFromCleanup:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe [Text]
$sel:packageCleanup:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Bool
$sel:name:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Text
$sel:rebootAfterUse:UpdateInstanceProfile' :: UpdateInstanceProfile -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"rebootAfterUse" 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
rebootAfterUse,
            (Text
"name" 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
name,
            (Text
"packageCleanup" 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
packageCleanup,
            (Text
"excludeAppPackagesFromCleanup" 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]
excludeAppPackagesFromCleanup,
            (Text
"description" 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
description,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)
          ]
      )

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

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

-- | /See:/ 'newUpdateInstanceProfileResponse' smart constructor.
data UpdateInstanceProfileResponse = UpdateInstanceProfileResponse'
  { -- | An object that contains information about your instance profile.
    UpdateInstanceProfileResponse -> Maybe InstanceProfile
instanceProfile :: Prelude.Maybe InstanceProfile,
    -- | The response's http status code.
    UpdateInstanceProfileResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateInstanceProfileResponse
-> UpdateInstanceProfileResponse -> Bool
(UpdateInstanceProfileResponse
 -> UpdateInstanceProfileResponse -> Bool)
-> (UpdateInstanceProfileResponse
    -> UpdateInstanceProfileResponse -> Bool)
-> Eq UpdateInstanceProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateInstanceProfileResponse
-> UpdateInstanceProfileResponse -> Bool
$c/= :: UpdateInstanceProfileResponse
-> UpdateInstanceProfileResponse -> Bool
== :: UpdateInstanceProfileResponse
-> UpdateInstanceProfileResponse -> Bool
$c== :: UpdateInstanceProfileResponse
-> UpdateInstanceProfileResponse -> Bool
Prelude.Eq, ReadPrec [UpdateInstanceProfileResponse]
ReadPrec UpdateInstanceProfileResponse
Int -> ReadS UpdateInstanceProfileResponse
ReadS [UpdateInstanceProfileResponse]
(Int -> ReadS UpdateInstanceProfileResponse)
-> ReadS [UpdateInstanceProfileResponse]
-> ReadPrec UpdateInstanceProfileResponse
-> ReadPrec [UpdateInstanceProfileResponse]
-> Read UpdateInstanceProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateInstanceProfileResponse]
$creadListPrec :: ReadPrec [UpdateInstanceProfileResponse]
readPrec :: ReadPrec UpdateInstanceProfileResponse
$creadPrec :: ReadPrec UpdateInstanceProfileResponse
readList :: ReadS [UpdateInstanceProfileResponse]
$creadList :: ReadS [UpdateInstanceProfileResponse]
readsPrec :: Int -> ReadS UpdateInstanceProfileResponse
$creadsPrec :: Int -> ReadS UpdateInstanceProfileResponse
Prelude.Read, Int -> UpdateInstanceProfileResponse -> ShowS
[UpdateInstanceProfileResponse] -> ShowS
UpdateInstanceProfileResponse -> String
(Int -> UpdateInstanceProfileResponse -> ShowS)
-> (UpdateInstanceProfileResponse -> String)
-> ([UpdateInstanceProfileResponse] -> ShowS)
-> Show UpdateInstanceProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateInstanceProfileResponse] -> ShowS
$cshowList :: [UpdateInstanceProfileResponse] -> ShowS
show :: UpdateInstanceProfileResponse -> String
$cshow :: UpdateInstanceProfileResponse -> String
showsPrec :: Int -> UpdateInstanceProfileResponse -> ShowS
$cshowsPrec :: Int -> UpdateInstanceProfileResponse -> ShowS
Prelude.Show, (forall x.
 UpdateInstanceProfileResponse
 -> Rep UpdateInstanceProfileResponse x)
-> (forall x.
    Rep UpdateInstanceProfileResponse x
    -> UpdateInstanceProfileResponse)
-> Generic UpdateInstanceProfileResponse
forall x.
Rep UpdateInstanceProfileResponse x
-> UpdateInstanceProfileResponse
forall x.
UpdateInstanceProfileResponse
-> Rep UpdateInstanceProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateInstanceProfileResponse x
-> UpdateInstanceProfileResponse
$cfrom :: forall x.
UpdateInstanceProfileResponse
-> Rep UpdateInstanceProfileResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateInstanceProfileResponse' 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:
--
-- 'instanceProfile', 'updateInstanceProfileResponse_instanceProfile' - An object that contains information about your instance profile.
--
-- 'httpStatus', 'updateInstanceProfileResponse_httpStatus' - The response's http status code.
newUpdateInstanceProfileResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateInstanceProfileResponse
newUpdateInstanceProfileResponse :: Int -> UpdateInstanceProfileResponse
newUpdateInstanceProfileResponse Int
pHttpStatus_ =
  UpdateInstanceProfileResponse' :: Maybe InstanceProfile -> Int -> UpdateInstanceProfileResponse
UpdateInstanceProfileResponse'
    { $sel:instanceProfile:UpdateInstanceProfileResponse' :: Maybe InstanceProfile
instanceProfile =
        Maybe InstanceProfile
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateInstanceProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An object that contains information about your instance profile.
updateInstanceProfileResponse_instanceProfile :: Lens.Lens' UpdateInstanceProfileResponse (Prelude.Maybe InstanceProfile)
updateInstanceProfileResponse_instanceProfile :: (Maybe InstanceProfile -> f (Maybe InstanceProfile))
-> UpdateInstanceProfileResponse -> f UpdateInstanceProfileResponse
updateInstanceProfileResponse_instanceProfile = (UpdateInstanceProfileResponse -> Maybe InstanceProfile)
-> (UpdateInstanceProfileResponse
    -> Maybe InstanceProfile -> UpdateInstanceProfileResponse)
-> Lens
     UpdateInstanceProfileResponse
     UpdateInstanceProfileResponse
     (Maybe InstanceProfile)
     (Maybe InstanceProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateInstanceProfileResponse' {Maybe InstanceProfile
instanceProfile :: Maybe InstanceProfile
$sel:instanceProfile:UpdateInstanceProfileResponse' :: UpdateInstanceProfileResponse -> Maybe InstanceProfile
instanceProfile} -> Maybe InstanceProfile
instanceProfile) (\s :: UpdateInstanceProfileResponse
s@UpdateInstanceProfileResponse' {} Maybe InstanceProfile
a -> UpdateInstanceProfileResponse
s {$sel:instanceProfile:UpdateInstanceProfileResponse' :: Maybe InstanceProfile
instanceProfile = Maybe InstanceProfile
a} :: UpdateInstanceProfileResponse)

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

instance Prelude.NFData UpdateInstanceProfileResponse