{-# 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.IoT.UpdateThingGroupsForThing
-- 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 the groups to which the thing belongs.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions UpdateThingGroupsForThing>
-- action.
module Amazonka.IoT.UpdateThingGroupsForThing
  ( -- * Creating a Request
    UpdateThingGroupsForThing (..),
    newUpdateThingGroupsForThing,

    -- * Request Lenses
    updateThingGroupsForThing_thingGroupsToAdd,
    updateThingGroupsForThing_thingGroupsToRemove,
    updateThingGroupsForThing_overrideDynamicGroups,
    updateThingGroupsForThing_thingName,

    -- * Destructuring the Response
    UpdateThingGroupsForThingResponse (..),
    newUpdateThingGroupsForThingResponse,

    -- * Response Lenses
    updateThingGroupsForThingResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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:/ 'newUpdateThingGroupsForThing' smart constructor.
data UpdateThingGroupsForThing = UpdateThingGroupsForThing'
  { -- | The groups to which the thing will be added.
    UpdateThingGroupsForThing -> Maybe [Text]
thingGroupsToAdd :: Prelude.Maybe [Prelude.Text],
    -- | The groups from which the thing will be removed.
    UpdateThingGroupsForThing -> Maybe [Text]
thingGroupsToRemove :: Prelude.Maybe [Prelude.Text],
    -- | Override dynamic thing groups with static thing groups when 10-group
    -- limit is reached. If a thing belongs to 10 thing groups, and one or more
    -- of those groups are dynamic thing groups, adding a thing to a static
    -- group removes the thing from the last dynamic group.
    UpdateThingGroupsForThing -> Maybe Bool
overrideDynamicGroups :: Prelude.Maybe Prelude.Bool,
    -- | The thing whose group memberships will be updated.
    UpdateThingGroupsForThing -> Maybe Text
thingName :: Prelude.Maybe Prelude.Text
  }
  deriving (UpdateThingGroupsForThing -> UpdateThingGroupsForThing -> Bool
(UpdateThingGroupsForThing -> UpdateThingGroupsForThing -> Bool)
-> (UpdateThingGroupsForThing -> UpdateThingGroupsForThing -> Bool)
-> Eq UpdateThingGroupsForThing
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateThingGroupsForThing -> UpdateThingGroupsForThing -> Bool
$c/= :: UpdateThingGroupsForThing -> UpdateThingGroupsForThing -> Bool
== :: UpdateThingGroupsForThing -> UpdateThingGroupsForThing -> Bool
$c== :: UpdateThingGroupsForThing -> UpdateThingGroupsForThing -> Bool
Prelude.Eq, ReadPrec [UpdateThingGroupsForThing]
ReadPrec UpdateThingGroupsForThing
Int -> ReadS UpdateThingGroupsForThing
ReadS [UpdateThingGroupsForThing]
(Int -> ReadS UpdateThingGroupsForThing)
-> ReadS [UpdateThingGroupsForThing]
-> ReadPrec UpdateThingGroupsForThing
-> ReadPrec [UpdateThingGroupsForThing]
-> Read UpdateThingGroupsForThing
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateThingGroupsForThing]
$creadListPrec :: ReadPrec [UpdateThingGroupsForThing]
readPrec :: ReadPrec UpdateThingGroupsForThing
$creadPrec :: ReadPrec UpdateThingGroupsForThing
readList :: ReadS [UpdateThingGroupsForThing]
$creadList :: ReadS [UpdateThingGroupsForThing]
readsPrec :: Int -> ReadS UpdateThingGroupsForThing
$creadsPrec :: Int -> ReadS UpdateThingGroupsForThing
Prelude.Read, Int -> UpdateThingGroupsForThing -> ShowS
[UpdateThingGroupsForThing] -> ShowS
UpdateThingGroupsForThing -> String
(Int -> UpdateThingGroupsForThing -> ShowS)
-> (UpdateThingGroupsForThing -> String)
-> ([UpdateThingGroupsForThing] -> ShowS)
-> Show UpdateThingGroupsForThing
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateThingGroupsForThing] -> ShowS
$cshowList :: [UpdateThingGroupsForThing] -> ShowS
show :: UpdateThingGroupsForThing -> String
$cshow :: UpdateThingGroupsForThing -> String
showsPrec :: Int -> UpdateThingGroupsForThing -> ShowS
$cshowsPrec :: Int -> UpdateThingGroupsForThing -> ShowS
Prelude.Show, (forall x.
 UpdateThingGroupsForThing -> Rep UpdateThingGroupsForThing x)
-> (forall x.
    Rep UpdateThingGroupsForThing x -> UpdateThingGroupsForThing)
-> Generic UpdateThingGroupsForThing
forall x.
Rep UpdateThingGroupsForThing x -> UpdateThingGroupsForThing
forall x.
UpdateThingGroupsForThing -> Rep UpdateThingGroupsForThing x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateThingGroupsForThing x -> UpdateThingGroupsForThing
$cfrom :: forall x.
UpdateThingGroupsForThing -> Rep UpdateThingGroupsForThing x
Prelude.Generic)

-- |
-- Create a value of 'UpdateThingGroupsForThing' 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:
--
-- 'thingGroupsToAdd', 'updateThingGroupsForThing_thingGroupsToAdd' - The groups to which the thing will be added.
--
-- 'thingGroupsToRemove', 'updateThingGroupsForThing_thingGroupsToRemove' - The groups from which the thing will be removed.
--
-- 'overrideDynamicGroups', 'updateThingGroupsForThing_overrideDynamicGroups' - Override dynamic thing groups with static thing groups when 10-group
-- limit is reached. If a thing belongs to 10 thing groups, and one or more
-- of those groups are dynamic thing groups, adding a thing to a static
-- group removes the thing from the last dynamic group.
--
-- 'thingName', 'updateThingGroupsForThing_thingName' - The thing whose group memberships will be updated.
newUpdateThingGroupsForThing ::
  UpdateThingGroupsForThing
newUpdateThingGroupsForThing :: UpdateThingGroupsForThing
newUpdateThingGroupsForThing =
  UpdateThingGroupsForThing' :: Maybe [Text]
-> Maybe [Text]
-> Maybe Bool
-> Maybe Text
-> UpdateThingGroupsForThing
UpdateThingGroupsForThing'
    { $sel:thingGroupsToAdd:UpdateThingGroupsForThing' :: Maybe [Text]
thingGroupsToAdd =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:thingGroupsToRemove:UpdateThingGroupsForThing' :: Maybe [Text]
thingGroupsToRemove = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:overrideDynamicGroups:UpdateThingGroupsForThing' :: Maybe Bool
overrideDynamicGroups = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:thingName:UpdateThingGroupsForThing' :: Maybe Text
thingName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The groups to which the thing will be added.
updateThingGroupsForThing_thingGroupsToAdd :: Lens.Lens' UpdateThingGroupsForThing (Prelude.Maybe [Prelude.Text])
updateThingGroupsForThing_thingGroupsToAdd :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateThingGroupsForThing -> f UpdateThingGroupsForThing
updateThingGroupsForThing_thingGroupsToAdd = (UpdateThingGroupsForThing -> Maybe [Text])
-> (UpdateThingGroupsForThing
    -> Maybe [Text] -> UpdateThingGroupsForThing)
-> Lens
     UpdateThingGroupsForThing
     UpdateThingGroupsForThing
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThingGroupsForThing' {Maybe [Text]
thingGroupsToAdd :: Maybe [Text]
$sel:thingGroupsToAdd:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe [Text]
thingGroupsToAdd} -> Maybe [Text]
thingGroupsToAdd) (\s :: UpdateThingGroupsForThing
s@UpdateThingGroupsForThing' {} Maybe [Text]
a -> UpdateThingGroupsForThing
s {$sel:thingGroupsToAdd:UpdateThingGroupsForThing' :: Maybe [Text]
thingGroupsToAdd = Maybe [Text]
a} :: UpdateThingGroupsForThing) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateThingGroupsForThing -> f UpdateThingGroupsForThing)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateThingGroupsForThing
-> f UpdateThingGroupsForThing
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 groups from which the thing will be removed.
updateThingGroupsForThing_thingGroupsToRemove :: Lens.Lens' UpdateThingGroupsForThing (Prelude.Maybe [Prelude.Text])
updateThingGroupsForThing_thingGroupsToRemove :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateThingGroupsForThing -> f UpdateThingGroupsForThing
updateThingGroupsForThing_thingGroupsToRemove = (UpdateThingGroupsForThing -> Maybe [Text])
-> (UpdateThingGroupsForThing
    -> Maybe [Text] -> UpdateThingGroupsForThing)
-> Lens
     UpdateThingGroupsForThing
     UpdateThingGroupsForThing
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThingGroupsForThing' {Maybe [Text]
thingGroupsToRemove :: Maybe [Text]
$sel:thingGroupsToRemove:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe [Text]
thingGroupsToRemove} -> Maybe [Text]
thingGroupsToRemove) (\s :: UpdateThingGroupsForThing
s@UpdateThingGroupsForThing' {} Maybe [Text]
a -> UpdateThingGroupsForThing
s {$sel:thingGroupsToRemove:UpdateThingGroupsForThing' :: Maybe [Text]
thingGroupsToRemove = Maybe [Text]
a} :: UpdateThingGroupsForThing) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateThingGroupsForThing -> f UpdateThingGroupsForThing)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateThingGroupsForThing
-> f UpdateThingGroupsForThing
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

-- | Override dynamic thing groups with static thing groups when 10-group
-- limit is reached. If a thing belongs to 10 thing groups, and one or more
-- of those groups are dynamic thing groups, adding a thing to a static
-- group removes the thing from the last dynamic group.
updateThingGroupsForThing_overrideDynamicGroups :: Lens.Lens' UpdateThingGroupsForThing (Prelude.Maybe Prelude.Bool)
updateThingGroupsForThing_overrideDynamicGroups :: (Maybe Bool -> f (Maybe Bool))
-> UpdateThingGroupsForThing -> f UpdateThingGroupsForThing
updateThingGroupsForThing_overrideDynamicGroups = (UpdateThingGroupsForThing -> Maybe Bool)
-> (UpdateThingGroupsForThing
    -> Maybe Bool -> UpdateThingGroupsForThing)
-> Lens
     UpdateThingGroupsForThing
     UpdateThingGroupsForThing
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThingGroupsForThing' {Maybe Bool
overrideDynamicGroups :: Maybe Bool
$sel:overrideDynamicGroups:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe Bool
overrideDynamicGroups} -> Maybe Bool
overrideDynamicGroups) (\s :: UpdateThingGroupsForThing
s@UpdateThingGroupsForThing' {} Maybe Bool
a -> UpdateThingGroupsForThing
s {$sel:overrideDynamicGroups:UpdateThingGroupsForThing' :: Maybe Bool
overrideDynamicGroups = Maybe Bool
a} :: UpdateThingGroupsForThing)

-- | The thing whose group memberships will be updated.
updateThingGroupsForThing_thingName :: Lens.Lens' UpdateThingGroupsForThing (Prelude.Maybe Prelude.Text)
updateThingGroupsForThing_thingName :: (Maybe Text -> f (Maybe Text))
-> UpdateThingGroupsForThing -> f UpdateThingGroupsForThing
updateThingGroupsForThing_thingName = (UpdateThingGroupsForThing -> Maybe Text)
-> (UpdateThingGroupsForThing
    -> Maybe Text -> UpdateThingGroupsForThing)
-> Lens
     UpdateThingGroupsForThing
     UpdateThingGroupsForThing
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateThingGroupsForThing' {Maybe Text
thingName :: Maybe Text
$sel:thingName:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe Text
thingName} -> Maybe Text
thingName) (\s :: UpdateThingGroupsForThing
s@UpdateThingGroupsForThing' {} Maybe Text
a -> UpdateThingGroupsForThing
s {$sel:thingName:UpdateThingGroupsForThing' :: Maybe Text
thingName = Maybe Text
a} :: UpdateThingGroupsForThing)

instance Core.AWSRequest UpdateThingGroupsForThing where
  type
    AWSResponse UpdateThingGroupsForThing =
      UpdateThingGroupsForThingResponse
  request :: UpdateThingGroupsForThing -> Request UpdateThingGroupsForThing
request = Service
-> UpdateThingGroupsForThing -> Request UpdateThingGroupsForThing
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateThingGroupsForThing
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateThingGroupsForThing)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse UpdateThingGroupsForThing))
-> Logger
-> Service
-> Proxy UpdateThingGroupsForThing
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateThingGroupsForThing)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> UpdateThingGroupsForThingResponse
UpdateThingGroupsForThingResponse'
            (Int -> UpdateThingGroupsForThingResponse)
-> Either String Int
-> Either String UpdateThingGroupsForThingResponse
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))
      )

instance Prelude.Hashable UpdateThingGroupsForThing

instance Prelude.NFData UpdateThingGroupsForThing

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

instance Core.ToJSON UpdateThingGroupsForThing where
  toJSON :: UpdateThingGroupsForThing -> Value
toJSON UpdateThingGroupsForThing' {Maybe Bool
Maybe [Text]
Maybe Text
thingName :: Maybe Text
overrideDynamicGroups :: Maybe Bool
thingGroupsToRemove :: Maybe [Text]
thingGroupsToAdd :: Maybe [Text]
$sel:thingName:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe Text
$sel:overrideDynamicGroups:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe Bool
$sel:thingGroupsToRemove:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe [Text]
$sel:thingGroupsToAdd:UpdateThingGroupsForThing' :: UpdateThingGroupsForThing -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"thingGroupsToAdd" 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]
thingGroupsToAdd,
            (Text
"thingGroupsToRemove" 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]
thingGroupsToRemove,
            (Text
"overrideDynamicGroups" 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
overrideDynamicGroups,
            (Text
"thingName" 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
thingName
          ]
      )

instance Core.ToPath UpdateThingGroupsForThing where
  toPath :: UpdateThingGroupsForThing -> ByteString
toPath =
    ByteString -> UpdateThingGroupsForThing -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/thing-groups/updateThingGroupsForThing"

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

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

-- |
-- Create a value of 'UpdateThingGroupsForThingResponse' 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', 'updateThingGroupsForThingResponse_httpStatus' - The response's http status code.
newUpdateThingGroupsForThingResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateThingGroupsForThingResponse
newUpdateThingGroupsForThingResponse :: Int -> UpdateThingGroupsForThingResponse
newUpdateThingGroupsForThingResponse Int
pHttpStatus_ =
  UpdateThingGroupsForThingResponse' :: Int -> UpdateThingGroupsForThingResponse
UpdateThingGroupsForThingResponse'
    { $sel:httpStatus:UpdateThingGroupsForThingResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    UpdateThingGroupsForThingResponse