{-# 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.EKS.UpdateAddon
-- 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 an Amazon EKS add-on.
module Amazonka.EKS.UpdateAddon
  ( -- * Creating a Request
    UpdateAddon (..),
    newUpdateAddon,

    -- * Request Lenses
    updateAddon_addonVersion,
    updateAddon_serviceAccountRoleArn,
    updateAddon_resolveConflicts,
    updateAddon_clientRequestToken,
    updateAddon_clusterName,
    updateAddon_addonName,

    -- * Destructuring the Response
    UpdateAddonResponse (..),
    newUpdateAddonResponse,

    -- * Response Lenses
    updateAddonResponse_update,
    updateAddonResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.EKS.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:/ 'newUpdateAddon' smart constructor.
data UpdateAddon = UpdateAddon'
  { -- | The version of the add-on. The version must match one of the versions
    -- returned by
    -- <https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html DescribeAddonVersions>
    -- .
    UpdateAddon -> Maybe Text
addonVersion :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of an existing IAM role to bind to the
    -- add-on\'s service account. The role must be assigned the IAM permissions
    -- required by the add-on. If you don\'t specify an existing IAM role, then
    -- the add-on uses the permissions assigned to the node IAM role. For more
    -- information, see
    -- <https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html Amazon EKS node IAM role>
    -- in the /Amazon EKS User Guide/.
    --
    -- To specify an existing IAM role, you must have an IAM OpenID Connect
    -- (OIDC) provider created for your cluster. For more information, see
    -- <https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html Enabling IAM roles for service accounts on your cluster>
    -- in the /Amazon EKS User Guide/.
    UpdateAddon -> Maybe Text
serviceAccountRoleArn :: Prelude.Maybe Prelude.Text,
    -- | How to resolve parameter value conflicts when applying the new version
    -- of the add-on to the cluster.
    UpdateAddon -> Maybe ResolveConflicts
resolveConflicts :: Prelude.Maybe ResolveConflicts,
    -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    UpdateAddon -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The name of the cluster.
    UpdateAddon -> Text
clusterName :: Prelude.Text,
    -- | The name of the add-on. The name must match one of the names returned by
    -- <https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html ListAddons>
    -- .
    UpdateAddon -> Text
addonName :: Prelude.Text
  }
  deriving (UpdateAddon -> UpdateAddon -> Bool
(UpdateAddon -> UpdateAddon -> Bool)
-> (UpdateAddon -> UpdateAddon -> Bool) -> Eq UpdateAddon
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAddon -> UpdateAddon -> Bool
$c/= :: UpdateAddon -> UpdateAddon -> Bool
== :: UpdateAddon -> UpdateAddon -> Bool
$c== :: UpdateAddon -> UpdateAddon -> Bool
Prelude.Eq, ReadPrec [UpdateAddon]
ReadPrec UpdateAddon
Int -> ReadS UpdateAddon
ReadS [UpdateAddon]
(Int -> ReadS UpdateAddon)
-> ReadS [UpdateAddon]
-> ReadPrec UpdateAddon
-> ReadPrec [UpdateAddon]
-> Read UpdateAddon
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAddon]
$creadListPrec :: ReadPrec [UpdateAddon]
readPrec :: ReadPrec UpdateAddon
$creadPrec :: ReadPrec UpdateAddon
readList :: ReadS [UpdateAddon]
$creadList :: ReadS [UpdateAddon]
readsPrec :: Int -> ReadS UpdateAddon
$creadsPrec :: Int -> ReadS UpdateAddon
Prelude.Read, Int -> UpdateAddon -> ShowS
[UpdateAddon] -> ShowS
UpdateAddon -> String
(Int -> UpdateAddon -> ShowS)
-> (UpdateAddon -> String)
-> ([UpdateAddon] -> ShowS)
-> Show UpdateAddon
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAddon] -> ShowS
$cshowList :: [UpdateAddon] -> ShowS
show :: UpdateAddon -> String
$cshow :: UpdateAddon -> String
showsPrec :: Int -> UpdateAddon -> ShowS
$cshowsPrec :: Int -> UpdateAddon -> ShowS
Prelude.Show, (forall x. UpdateAddon -> Rep UpdateAddon x)
-> (forall x. Rep UpdateAddon x -> UpdateAddon)
-> Generic UpdateAddon
forall x. Rep UpdateAddon x -> UpdateAddon
forall x. UpdateAddon -> Rep UpdateAddon x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAddon x -> UpdateAddon
$cfrom :: forall x. UpdateAddon -> Rep UpdateAddon x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAddon' 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:
--
-- 'addonVersion', 'updateAddon_addonVersion' - The version of the add-on. The version must match one of the versions
-- returned by
-- <https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html DescribeAddonVersions>
-- .
--
-- 'serviceAccountRoleArn', 'updateAddon_serviceAccountRoleArn' - The Amazon Resource Name (ARN) of an existing IAM role to bind to the
-- add-on\'s service account. The role must be assigned the IAM permissions
-- required by the add-on. If you don\'t specify an existing IAM role, then
-- the add-on uses the permissions assigned to the node IAM role. For more
-- information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html Amazon EKS node IAM role>
-- in the /Amazon EKS User Guide/.
--
-- To specify an existing IAM role, you must have an IAM OpenID Connect
-- (OIDC) provider created for your cluster. For more information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html Enabling IAM roles for service accounts on your cluster>
-- in the /Amazon EKS User Guide/.
--
-- 'resolveConflicts', 'updateAddon_resolveConflicts' - How to resolve parameter value conflicts when applying the new version
-- of the add-on to the cluster.
--
-- 'clientRequestToken', 'updateAddon_clientRequestToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'clusterName', 'updateAddon_clusterName' - The name of the cluster.
--
-- 'addonName', 'updateAddon_addonName' - The name of the add-on. The name must match one of the names returned by
-- <https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html ListAddons>
-- .
newUpdateAddon ::
  -- | 'clusterName'
  Prelude.Text ->
  -- | 'addonName'
  Prelude.Text ->
  UpdateAddon
newUpdateAddon :: Text -> Text -> UpdateAddon
newUpdateAddon Text
pClusterName_ Text
pAddonName_ =
  UpdateAddon' :: Maybe Text
-> Maybe Text
-> Maybe ResolveConflicts
-> Maybe Text
-> Text
-> Text
-> UpdateAddon
UpdateAddon'
    { $sel:addonVersion:UpdateAddon' :: Maybe Text
addonVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceAccountRoleArn:UpdateAddon' :: Maybe Text
serviceAccountRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resolveConflicts:UpdateAddon' :: Maybe ResolveConflicts
resolveConflicts = Maybe ResolveConflicts
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:UpdateAddon' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clusterName:UpdateAddon' :: Text
clusterName = Text
pClusterName_,
      $sel:addonName:UpdateAddon' :: Text
addonName = Text
pAddonName_
    }

-- | The version of the add-on. The version must match one of the versions
-- returned by
-- <https://docs.aws.amazon.com/eks/latest/APIReference/API_DescribeAddonVersions.html DescribeAddonVersions>
-- .
updateAddon_addonVersion :: Lens.Lens' UpdateAddon (Prelude.Maybe Prelude.Text)
updateAddon_addonVersion :: (Maybe Text -> f (Maybe Text)) -> UpdateAddon -> f UpdateAddon
updateAddon_addonVersion = (UpdateAddon -> Maybe Text)
-> (UpdateAddon -> Maybe Text -> UpdateAddon)
-> Lens UpdateAddon UpdateAddon (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAddon' {Maybe Text
addonVersion :: Maybe Text
$sel:addonVersion:UpdateAddon' :: UpdateAddon -> Maybe Text
addonVersion} -> Maybe Text
addonVersion) (\s :: UpdateAddon
s@UpdateAddon' {} Maybe Text
a -> UpdateAddon
s {$sel:addonVersion:UpdateAddon' :: Maybe Text
addonVersion = Maybe Text
a} :: UpdateAddon)

-- | The Amazon Resource Name (ARN) of an existing IAM role to bind to the
-- add-on\'s service account. The role must be assigned the IAM permissions
-- required by the add-on. If you don\'t specify an existing IAM role, then
-- the add-on uses the permissions assigned to the node IAM role. For more
-- information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/create-node-role.html Amazon EKS node IAM role>
-- in the /Amazon EKS User Guide/.
--
-- To specify an existing IAM role, you must have an IAM OpenID Connect
-- (OIDC) provider created for your cluster. For more information, see
-- <https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html Enabling IAM roles for service accounts on your cluster>
-- in the /Amazon EKS User Guide/.
updateAddon_serviceAccountRoleArn :: Lens.Lens' UpdateAddon (Prelude.Maybe Prelude.Text)
updateAddon_serviceAccountRoleArn :: (Maybe Text -> f (Maybe Text)) -> UpdateAddon -> f UpdateAddon
updateAddon_serviceAccountRoleArn = (UpdateAddon -> Maybe Text)
-> (UpdateAddon -> Maybe Text -> UpdateAddon)
-> Lens UpdateAddon UpdateAddon (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAddon' {Maybe Text
serviceAccountRoleArn :: Maybe Text
$sel:serviceAccountRoleArn:UpdateAddon' :: UpdateAddon -> Maybe Text
serviceAccountRoleArn} -> Maybe Text
serviceAccountRoleArn) (\s :: UpdateAddon
s@UpdateAddon' {} Maybe Text
a -> UpdateAddon
s {$sel:serviceAccountRoleArn:UpdateAddon' :: Maybe Text
serviceAccountRoleArn = Maybe Text
a} :: UpdateAddon)

-- | How to resolve parameter value conflicts when applying the new version
-- of the add-on to the cluster.
updateAddon_resolveConflicts :: Lens.Lens' UpdateAddon (Prelude.Maybe ResolveConflicts)
updateAddon_resolveConflicts :: (Maybe ResolveConflicts -> f (Maybe ResolveConflicts))
-> UpdateAddon -> f UpdateAddon
updateAddon_resolveConflicts = (UpdateAddon -> Maybe ResolveConflicts)
-> (UpdateAddon -> Maybe ResolveConflicts -> UpdateAddon)
-> Lens
     UpdateAddon
     UpdateAddon
     (Maybe ResolveConflicts)
     (Maybe ResolveConflicts)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAddon' {Maybe ResolveConflicts
resolveConflicts :: Maybe ResolveConflicts
$sel:resolveConflicts:UpdateAddon' :: UpdateAddon -> Maybe ResolveConflicts
resolveConflicts} -> Maybe ResolveConflicts
resolveConflicts) (\s :: UpdateAddon
s@UpdateAddon' {} Maybe ResolveConflicts
a -> UpdateAddon
s {$sel:resolveConflicts:UpdateAddon' :: Maybe ResolveConflicts
resolveConflicts = Maybe ResolveConflicts
a} :: UpdateAddon)

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
updateAddon_clientRequestToken :: Lens.Lens' UpdateAddon (Prelude.Maybe Prelude.Text)
updateAddon_clientRequestToken :: (Maybe Text -> f (Maybe Text)) -> UpdateAddon -> f UpdateAddon
updateAddon_clientRequestToken = (UpdateAddon -> Maybe Text)
-> (UpdateAddon -> Maybe Text -> UpdateAddon)
-> Lens UpdateAddon UpdateAddon (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAddon' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:UpdateAddon' :: UpdateAddon -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: UpdateAddon
s@UpdateAddon' {} Maybe Text
a -> UpdateAddon
s {$sel:clientRequestToken:UpdateAddon' :: Maybe Text
clientRequestToken = Maybe Text
a} :: UpdateAddon)

-- | The name of the cluster.
updateAddon_clusterName :: Lens.Lens' UpdateAddon Prelude.Text
updateAddon_clusterName :: (Text -> f Text) -> UpdateAddon -> f UpdateAddon
updateAddon_clusterName = (UpdateAddon -> Text)
-> (UpdateAddon -> Text -> UpdateAddon)
-> Lens UpdateAddon UpdateAddon Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAddon' {Text
clusterName :: Text
$sel:clusterName:UpdateAddon' :: UpdateAddon -> Text
clusterName} -> Text
clusterName) (\s :: UpdateAddon
s@UpdateAddon' {} Text
a -> UpdateAddon
s {$sel:clusterName:UpdateAddon' :: Text
clusterName = Text
a} :: UpdateAddon)

-- | The name of the add-on. The name must match one of the names returned by
-- <https://docs.aws.amazon.com/eks/latest/APIReference/API_ListAddons.html ListAddons>
-- .
updateAddon_addonName :: Lens.Lens' UpdateAddon Prelude.Text
updateAddon_addonName :: (Text -> f Text) -> UpdateAddon -> f UpdateAddon
updateAddon_addonName = (UpdateAddon -> Text)
-> (UpdateAddon -> Text -> UpdateAddon)
-> Lens UpdateAddon UpdateAddon Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAddon' {Text
addonName :: Text
$sel:addonName:UpdateAddon' :: UpdateAddon -> Text
addonName} -> Text
addonName) (\s :: UpdateAddon
s@UpdateAddon' {} Text
a -> UpdateAddon
s {$sel:addonName:UpdateAddon' :: Text
addonName = Text
a} :: UpdateAddon)

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

instance Prelude.NFData UpdateAddon

instance Core.ToHeaders UpdateAddon where
  toHeaders :: UpdateAddon -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateAddon -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 UpdateAddon where
  toJSON :: UpdateAddon -> Value
toJSON UpdateAddon' {Maybe Text
Maybe ResolveConflicts
Text
addonName :: Text
clusterName :: Text
clientRequestToken :: Maybe Text
resolveConflicts :: Maybe ResolveConflicts
serviceAccountRoleArn :: Maybe Text
addonVersion :: Maybe Text
$sel:addonName:UpdateAddon' :: UpdateAddon -> Text
$sel:clusterName:UpdateAddon' :: UpdateAddon -> Text
$sel:clientRequestToken:UpdateAddon' :: UpdateAddon -> Maybe Text
$sel:resolveConflicts:UpdateAddon' :: UpdateAddon -> Maybe ResolveConflicts
$sel:serviceAccountRoleArn:UpdateAddon' :: UpdateAddon -> Maybe Text
$sel:addonVersion:UpdateAddon' :: UpdateAddon -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"addonVersion" 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
addonVersion,
            (Text
"serviceAccountRoleArn" 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
serviceAccountRoleArn,
            (Text
"resolveConflicts" Text -> ResolveConflicts -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ResolveConflicts -> Pair) -> Maybe ResolveConflicts -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ResolveConflicts
resolveConflicts,
            (Text
"clientRequestToken" 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
clientRequestToken
          ]
      )

instance Core.ToPath UpdateAddon where
  toPath :: UpdateAddon -> ByteString
toPath UpdateAddon' {Maybe Text
Maybe ResolveConflicts
Text
addonName :: Text
clusterName :: Text
clientRequestToken :: Maybe Text
resolveConflicts :: Maybe ResolveConflicts
serviceAccountRoleArn :: Maybe Text
addonVersion :: Maybe Text
$sel:addonName:UpdateAddon' :: UpdateAddon -> Text
$sel:clusterName:UpdateAddon' :: UpdateAddon -> Text
$sel:clientRequestToken:UpdateAddon' :: UpdateAddon -> Maybe Text
$sel:resolveConflicts:UpdateAddon' :: UpdateAddon -> Maybe ResolveConflicts
$sel:serviceAccountRoleArn:UpdateAddon' :: UpdateAddon -> Maybe Text
$sel:addonVersion:UpdateAddon' :: UpdateAddon -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/clusters/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
clusterName,
        ByteString
"/addons/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
addonName,
        ByteString
"/update"
      ]

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

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

-- |
-- Create a value of 'UpdateAddonResponse' 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:
--
-- 'update', 'updateAddonResponse_update' - Undocumented member.
--
-- 'httpStatus', 'updateAddonResponse_httpStatus' - The response's http status code.
newUpdateAddonResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateAddonResponse
newUpdateAddonResponse :: Int -> UpdateAddonResponse
newUpdateAddonResponse Int
pHttpStatus_ =
  UpdateAddonResponse' :: Maybe Update -> Int -> UpdateAddonResponse
UpdateAddonResponse'
    { $sel:update:UpdateAddonResponse' :: Maybe Update
update = Maybe Update
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateAddonResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
updateAddonResponse_update :: Lens.Lens' UpdateAddonResponse (Prelude.Maybe Update)
updateAddonResponse_update :: (Maybe Update -> f (Maybe Update))
-> UpdateAddonResponse -> f UpdateAddonResponse
updateAddonResponse_update = (UpdateAddonResponse -> Maybe Update)
-> (UpdateAddonResponse -> Maybe Update -> UpdateAddonResponse)
-> Lens
     UpdateAddonResponse
     UpdateAddonResponse
     (Maybe Update)
     (Maybe Update)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAddonResponse' {Maybe Update
update :: Maybe Update
$sel:update:UpdateAddonResponse' :: UpdateAddonResponse -> Maybe Update
update} -> Maybe Update
update) (\s :: UpdateAddonResponse
s@UpdateAddonResponse' {} Maybe Update
a -> UpdateAddonResponse
s {$sel:update:UpdateAddonResponse' :: Maybe Update
update = Maybe Update
a} :: UpdateAddonResponse)

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

instance Prelude.NFData UpdateAddonResponse