amazonka-greengrass-2.0: gen/Amazonka/Greengrass/UpdateGroup.hs
{-# 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.Greengrass.UpdateGroup
-- Copyright : (c) 2013-2023 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a group.
module Amazonka.Greengrass.UpdateGroup
( -- * Creating a Request
UpdateGroup (..),
newUpdateGroup,
-- * Request Lenses
updateGroup_name,
updateGroup_groupId,
-- * Destructuring the Response
UpdateGroupResponse (..),
newUpdateGroupResponse,
-- * Response Lenses
updateGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Greengrass.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
-- | /See:/ 'newUpdateGroup' smart constructor.
data UpdateGroup = UpdateGroup'
{ -- | The name of the definition.
name :: Prelude.Maybe Prelude.Text,
-- | The ID of the Greengrass group.
groupId :: Prelude.Text
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'UpdateGroup' 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:
--
-- 'name', 'updateGroup_name' - The name of the definition.
--
-- 'groupId', 'updateGroup_groupId' - The ID of the Greengrass group.
newUpdateGroup ::
-- | 'groupId'
Prelude.Text ->
UpdateGroup
newUpdateGroup pGroupId_ =
UpdateGroup'
{ name = Prelude.Nothing,
groupId = pGroupId_
}
-- | The name of the definition.
updateGroup_name :: Lens.Lens' UpdateGroup (Prelude.Maybe Prelude.Text)
updateGroup_name = Lens.lens (\UpdateGroup' {name} -> name) (\s@UpdateGroup' {} a -> s {name = a} :: UpdateGroup)
-- | The ID of the Greengrass group.
updateGroup_groupId :: Lens.Lens' UpdateGroup Prelude.Text
updateGroup_groupId = Lens.lens (\UpdateGroup' {groupId} -> groupId) (\s@UpdateGroup' {} a -> s {groupId = a} :: UpdateGroup)
instance Core.AWSRequest UpdateGroup where
type AWSResponse UpdateGroup = UpdateGroupResponse
request overrides =
Request.putJSON (overrides defaultService)
response =
Response.receiveEmpty
( \s h x ->
UpdateGroupResponse'
Prelude.<$> (Prelude.pure (Prelude.fromEnum s))
)
instance Prelude.Hashable UpdateGroup where
hashWithSalt _salt UpdateGroup' {..} =
_salt
`Prelude.hashWithSalt` name
`Prelude.hashWithSalt` groupId
instance Prelude.NFData UpdateGroup where
rnf UpdateGroup' {..} =
Prelude.rnf name `Prelude.seq` Prelude.rnf groupId
instance Data.ToHeaders UpdateGroup where
toHeaders =
Prelude.const
( Prelude.mconcat
[ "Content-Type"
Data.=# ( "application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateGroup where
toJSON UpdateGroup' {..} =
Data.object
( Prelude.catMaybes
[("Name" Data..=) Prelude.<$> name]
)
instance Data.ToPath UpdateGroup where
toPath UpdateGroup' {..} =
Prelude.mconcat
["/greengrass/groups/", Data.toBS groupId]
instance Data.ToQuery UpdateGroup where
toQuery = Prelude.const Prelude.mempty
-- | /See:/ 'newUpdateGroupResponse' smart constructor.
data UpdateGroupResponse = UpdateGroupResponse'
{ -- | The response's http status code.
httpStatus :: Prelude.Int
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'UpdateGroupResponse' 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', 'updateGroupResponse_httpStatus' - The response's http status code.
newUpdateGroupResponse ::
-- | 'httpStatus'
Prelude.Int ->
UpdateGroupResponse
newUpdateGroupResponse pHttpStatus_ =
UpdateGroupResponse' {httpStatus = pHttpStatus_}
-- | The response's http status code.
updateGroupResponse_httpStatus :: Lens.Lens' UpdateGroupResponse Prelude.Int
updateGroupResponse_httpStatus = Lens.lens (\UpdateGroupResponse' {httpStatus} -> httpStatus) (\s@UpdateGroupResponse' {} a -> s {httpStatus = a} :: UpdateGroupResponse)
instance Prelude.NFData UpdateGroupResponse where
rnf UpdateGroupResponse' {..} = Prelude.rnf httpStatus