{-# 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.IoTWireless.CreateWirelessGatewayTaskDefinition
-- 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 gateway task definition.
module Amazonka.IoTWireless.CreateWirelessGatewayTaskDefinition
  ( -- * Creating a Request
    CreateWirelessGatewayTaskDefinition (..),
    newCreateWirelessGatewayTaskDefinition,

    -- * Request Lenses
    createWirelessGatewayTaskDefinition_name,
    createWirelessGatewayTaskDefinition_clientRequestToken,
    createWirelessGatewayTaskDefinition_tags,
    createWirelessGatewayTaskDefinition_update,
    createWirelessGatewayTaskDefinition_autoCreateTasks,

    -- * Destructuring the Response
    CreateWirelessGatewayTaskDefinitionResponse (..),
    newCreateWirelessGatewayTaskDefinitionResponse,

    -- * Response Lenses
    createWirelessGatewayTaskDefinitionResponse_arn,
    createWirelessGatewayTaskDefinitionResponse_id,
    createWirelessGatewayTaskDefinitionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.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:/ 'newCreateWirelessGatewayTaskDefinition' smart constructor.
data CreateWirelessGatewayTaskDefinition = CreateWirelessGatewayTaskDefinition'
  { -- | The name of the new resource.
    CreateWirelessGatewayTaskDefinition -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Each resource must have a unique client request token. If you try to
    -- create a new resource with the same token as a resource that already
    -- exists, an exception occurs. If you omit this value, AWS SDKs will
    -- automatically generate a unique client request.
    CreateWirelessGatewayTaskDefinition -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The tags to attach to the specified resource. Tags are metadata that you
    -- can use to manage a resource.
    CreateWirelessGatewayTaskDefinition -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | Information about the gateways to update.
    CreateWirelessGatewayTaskDefinition
-> Maybe UpdateWirelessGatewayTaskCreate
update :: Prelude.Maybe UpdateWirelessGatewayTaskCreate,
    -- | Whether to automatically create tasks using this task definition for all
    -- gateways with the specified current version. If @false@, the task must
    -- me created by calling @CreateWirelessGatewayTask@.
    CreateWirelessGatewayTaskDefinition -> Bool
autoCreateTasks :: Prelude.Bool
  }
  deriving (CreateWirelessGatewayTaskDefinition
-> CreateWirelessGatewayTaskDefinition -> Bool
(CreateWirelessGatewayTaskDefinition
 -> CreateWirelessGatewayTaskDefinition -> Bool)
-> (CreateWirelessGatewayTaskDefinition
    -> CreateWirelessGatewayTaskDefinition -> Bool)
-> Eq CreateWirelessGatewayTaskDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWirelessGatewayTaskDefinition
-> CreateWirelessGatewayTaskDefinition -> Bool
$c/= :: CreateWirelessGatewayTaskDefinition
-> CreateWirelessGatewayTaskDefinition -> Bool
== :: CreateWirelessGatewayTaskDefinition
-> CreateWirelessGatewayTaskDefinition -> Bool
$c== :: CreateWirelessGatewayTaskDefinition
-> CreateWirelessGatewayTaskDefinition -> Bool
Prelude.Eq, ReadPrec [CreateWirelessGatewayTaskDefinition]
ReadPrec CreateWirelessGatewayTaskDefinition
Int -> ReadS CreateWirelessGatewayTaskDefinition
ReadS [CreateWirelessGatewayTaskDefinition]
(Int -> ReadS CreateWirelessGatewayTaskDefinition)
-> ReadS [CreateWirelessGatewayTaskDefinition]
-> ReadPrec CreateWirelessGatewayTaskDefinition
-> ReadPrec [CreateWirelessGatewayTaskDefinition]
-> Read CreateWirelessGatewayTaskDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWirelessGatewayTaskDefinition]
$creadListPrec :: ReadPrec [CreateWirelessGatewayTaskDefinition]
readPrec :: ReadPrec CreateWirelessGatewayTaskDefinition
$creadPrec :: ReadPrec CreateWirelessGatewayTaskDefinition
readList :: ReadS [CreateWirelessGatewayTaskDefinition]
$creadList :: ReadS [CreateWirelessGatewayTaskDefinition]
readsPrec :: Int -> ReadS CreateWirelessGatewayTaskDefinition
$creadsPrec :: Int -> ReadS CreateWirelessGatewayTaskDefinition
Prelude.Read, Int -> CreateWirelessGatewayTaskDefinition -> ShowS
[CreateWirelessGatewayTaskDefinition] -> ShowS
CreateWirelessGatewayTaskDefinition -> String
(Int -> CreateWirelessGatewayTaskDefinition -> ShowS)
-> (CreateWirelessGatewayTaskDefinition -> String)
-> ([CreateWirelessGatewayTaskDefinition] -> ShowS)
-> Show CreateWirelessGatewayTaskDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWirelessGatewayTaskDefinition] -> ShowS
$cshowList :: [CreateWirelessGatewayTaskDefinition] -> ShowS
show :: CreateWirelessGatewayTaskDefinition -> String
$cshow :: CreateWirelessGatewayTaskDefinition -> String
showsPrec :: Int -> CreateWirelessGatewayTaskDefinition -> ShowS
$cshowsPrec :: Int -> CreateWirelessGatewayTaskDefinition -> ShowS
Prelude.Show, (forall x.
 CreateWirelessGatewayTaskDefinition
 -> Rep CreateWirelessGatewayTaskDefinition x)
-> (forall x.
    Rep CreateWirelessGatewayTaskDefinition x
    -> CreateWirelessGatewayTaskDefinition)
-> Generic CreateWirelessGatewayTaskDefinition
forall x.
Rep CreateWirelessGatewayTaskDefinition x
-> CreateWirelessGatewayTaskDefinition
forall x.
CreateWirelessGatewayTaskDefinition
-> Rep CreateWirelessGatewayTaskDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWirelessGatewayTaskDefinition x
-> CreateWirelessGatewayTaskDefinition
$cfrom :: forall x.
CreateWirelessGatewayTaskDefinition
-> Rep CreateWirelessGatewayTaskDefinition x
Prelude.Generic)

-- |
-- Create a value of 'CreateWirelessGatewayTaskDefinition' 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', 'createWirelessGatewayTaskDefinition_name' - The name of the new resource.
--
-- 'clientRequestToken', 'createWirelessGatewayTaskDefinition_clientRequestToken' - Each resource must have a unique client request token. If you try to
-- create a new resource with the same token as a resource that already
-- exists, an exception occurs. If you omit this value, AWS SDKs will
-- automatically generate a unique client request.
--
-- 'tags', 'createWirelessGatewayTaskDefinition_tags' - The tags to attach to the specified resource. Tags are metadata that you
-- can use to manage a resource.
--
-- 'update', 'createWirelessGatewayTaskDefinition_update' - Information about the gateways to update.
--
-- 'autoCreateTasks', 'createWirelessGatewayTaskDefinition_autoCreateTasks' - Whether to automatically create tasks using this task definition for all
-- gateways with the specified current version. If @false@, the task must
-- me created by calling @CreateWirelessGatewayTask@.
newCreateWirelessGatewayTaskDefinition ::
  -- | 'autoCreateTasks'
  Prelude.Bool ->
  CreateWirelessGatewayTaskDefinition
newCreateWirelessGatewayTaskDefinition :: Bool -> CreateWirelessGatewayTaskDefinition
newCreateWirelessGatewayTaskDefinition
  Bool
pAutoCreateTasks_ =
    CreateWirelessGatewayTaskDefinition' :: Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe UpdateWirelessGatewayTaskCreate
-> Bool
-> CreateWirelessGatewayTaskDefinition
CreateWirelessGatewayTaskDefinition'
      { $sel:name:CreateWirelessGatewayTaskDefinition' :: Maybe Text
name =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:CreateWirelessGatewayTaskDefinition' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateWirelessGatewayTaskDefinition' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:update:CreateWirelessGatewayTaskDefinition' :: Maybe UpdateWirelessGatewayTaskCreate
update = Maybe UpdateWirelessGatewayTaskCreate
forall a. Maybe a
Prelude.Nothing,
        $sel:autoCreateTasks:CreateWirelessGatewayTaskDefinition' :: Bool
autoCreateTasks = Bool
pAutoCreateTasks_
      }

-- | The name of the new resource.
createWirelessGatewayTaskDefinition_name :: Lens.Lens' CreateWirelessGatewayTaskDefinition (Prelude.Maybe Prelude.Text)
createWirelessGatewayTaskDefinition_name :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessGatewayTaskDefinition
-> f CreateWirelessGatewayTaskDefinition
createWirelessGatewayTaskDefinition_name = (CreateWirelessGatewayTaskDefinition -> Maybe Text)
-> (CreateWirelessGatewayTaskDefinition
    -> Maybe Text -> CreateWirelessGatewayTaskDefinition)
-> Lens
     CreateWirelessGatewayTaskDefinition
     CreateWirelessGatewayTaskDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessGatewayTaskDefinition' {Maybe Text
name :: Maybe Text
$sel:name:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateWirelessGatewayTaskDefinition
s@CreateWirelessGatewayTaskDefinition' {} Maybe Text
a -> CreateWirelessGatewayTaskDefinition
s {$sel:name:CreateWirelessGatewayTaskDefinition' :: Maybe Text
name = Maybe Text
a} :: CreateWirelessGatewayTaskDefinition)

-- | Each resource must have a unique client request token. If you try to
-- create a new resource with the same token as a resource that already
-- exists, an exception occurs. If you omit this value, AWS SDKs will
-- automatically generate a unique client request.
createWirelessGatewayTaskDefinition_clientRequestToken :: Lens.Lens' CreateWirelessGatewayTaskDefinition (Prelude.Maybe Prelude.Text)
createWirelessGatewayTaskDefinition_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessGatewayTaskDefinition
-> f CreateWirelessGatewayTaskDefinition
createWirelessGatewayTaskDefinition_clientRequestToken = (CreateWirelessGatewayTaskDefinition -> Maybe Text)
-> (CreateWirelessGatewayTaskDefinition
    -> Maybe Text -> CreateWirelessGatewayTaskDefinition)
-> Lens
     CreateWirelessGatewayTaskDefinition
     CreateWirelessGatewayTaskDefinition
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessGatewayTaskDefinition' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateWirelessGatewayTaskDefinition
s@CreateWirelessGatewayTaskDefinition' {} Maybe Text
a -> CreateWirelessGatewayTaskDefinition
s {$sel:clientRequestToken:CreateWirelessGatewayTaskDefinition' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateWirelessGatewayTaskDefinition)

-- | The tags to attach to the specified resource. Tags are metadata that you
-- can use to manage a resource.
createWirelessGatewayTaskDefinition_tags :: Lens.Lens' CreateWirelessGatewayTaskDefinition (Prelude.Maybe [Tag])
createWirelessGatewayTaskDefinition_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWirelessGatewayTaskDefinition
-> f CreateWirelessGatewayTaskDefinition
createWirelessGatewayTaskDefinition_tags = (CreateWirelessGatewayTaskDefinition -> Maybe [Tag])
-> (CreateWirelessGatewayTaskDefinition
    -> Maybe [Tag] -> CreateWirelessGatewayTaskDefinition)
-> Lens
     CreateWirelessGatewayTaskDefinition
     CreateWirelessGatewayTaskDefinition
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessGatewayTaskDefinition' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateWirelessGatewayTaskDefinition
s@CreateWirelessGatewayTaskDefinition' {} Maybe [Tag]
a -> CreateWirelessGatewayTaskDefinition
s {$sel:tags:CreateWirelessGatewayTaskDefinition' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateWirelessGatewayTaskDefinition) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateWirelessGatewayTaskDefinition
 -> f CreateWirelessGatewayTaskDefinition)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWirelessGatewayTaskDefinition
-> f CreateWirelessGatewayTaskDefinition
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

-- | Information about the gateways to update.
createWirelessGatewayTaskDefinition_update :: Lens.Lens' CreateWirelessGatewayTaskDefinition (Prelude.Maybe UpdateWirelessGatewayTaskCreate)
createWirelessGatewayTaskDefinition_update :: (Maybe UpdateWirelessGatewayTaskCreate
 -> f (Maybe UpdateWirelessGatewayTaskCreate))
-> CreateWirelessGatewayTaskDefinition
-> f CreateWirelessGatewayTaskDefinition
createWirelessGatewayTaskDefinition_update = (CreateWirelessGatewayTaskDefinition
 -> Maybe UpdateWirelessGatewayTaskCreate)
-> (CreateWirelessGatewayTaskDefinition
    -> Maybe UpdateWirelessGatewayTaskCreate
    -> CreateWirelessGatewayTaskDefinition)
-> Lens
     CreateWirelessGatewayTaskDefinition
     CreateWirelessGatewayTaskDefinition
     (Maybe UpdateWirelessGatewayTaskCreate)
     (Maybe UpdateWirelessGatewayTaskCreate)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessGatewayTaskDefinition' {Maybe UpdateWirelessGatewayTaskCreate
update :: Maybe UpdateWirelessGatewayTaskCreate
$sel:update:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition
-> Maybe UpdateWirelessGatewayTaskCreate
update} -> Maybe UpdateWirelessGatewayTaskCreate
update) (\s :: CreateWirelessGatewayTaskDefinition
s@CreateWirelessGatewayTaskDefinition' {} Maybe UpdateWirelessGatewayTaskCreate
a -> CreateWirelessGatewayTaskDefinition
s {$sel:update:CreateWirelessGatewayTaskDefinition' :: Maybe UpdateWirelessGatewayTaskCreate
update = Maybe UpdateWirelessGatewayTaskCreate
a} :: CreateWirelessGatewayTaskDefinition)

-- | Whether to automatically create tasks using this task definition for all
-- gateways with the specified current version. If @false@, the task must
-- me created by calling @CreateWirelessGatewayTask@.
createWirelessGatewayTaskDefinition_autoCreateTasks :: Lens.Lens' CreateWirelessGatewayTaskDefinition Prelude.Bool
createWirelessGatewayTaskDefinition_autoCreateTasks :: (Bool -> f Bool)
-> CreateWirelessGatewayTaskDefinition
-> f CreateWirelessGatewayTaskDefinition
createWirelessGatewayTaskDefinition_autoCreateTasks = (CreateWirelessGatewayTaskDefinition -> Bool)
-> (CreateWirelessGatewayTaskDefinition
    -> Bool -> CreateWirelessGatewayTaskDefinition)
-> Lens
     CreateWirelessGatewayTaskDefinition
     CreateWirelessGatewayTaskDefinition
     Bool
     Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessGatewayTaskDefinition' {Bool
autoCreateTasks :: Bool
$sel:autoCreateTasks:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Bool
autoCreateTasks} -> Bool
autoCreateTasks) (\s :: CreateWirelessGatewayTaskDefinition
s@CreateWirelessGatewayTaskDefinition' {} Bool
a -> CreateWirelessGatewayTaskDefinition
s {$sel:autoCreateTasks:CreateWirelessGatewayTaskDefinition' :: Bool
autoCreateTasks = Bool
a} :: CreateWirelessGatewayTaskDefinition)

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

instance
  Prelude.NFData
    CreateWirelessGatewayTaskDefinition

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

instance
  Core.ToJSON
    CreateWirelessGatewayTaskDefinition
  where
  toJSON :: CreateWirelessGatewayTaskDefinition -> Value
toJSON CreateWirelessGatewayTaskDefinition' {Bool
Maybe [Tag]
Maybe Text
Maybe UpdateWirelessGatewayTaskCreate
autoCreateTasks :: Bool
update :: Maybe UpdateWirelessGatewayTaskCreate
tags :: Maybe [Tag]
clientRequestToken :: Maybe Text
name :: Maybe Text
$sel:autoCreateTasks:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Bool
$sel:update:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition
-> Maybe UpdateWirelessGatewayTaskCreate
$sel:tags:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Maybe [Tag]
$sel:clientRequestToken:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Maybe Text
$sel:name:CreateWirelessGatewayTaskDefinition' :: CreateWirelessGatewayTaskDefinition -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            (Text
"Update" Text -> UpdateWirelessGatewayTaskCreate -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (UpdateWirelessGatewayTaskCreate -> Pair)
-> Maybe UpdateWirelessGatewayTaskCreate -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe UpdateWirelessGatewayTaskCreate
update,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AutoCreateTasks" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
autoCreateTasks)
          ]
      )

instance
  Core.ToPath
    CreateWirelessGatewayTaskDefinition
  where
  toPath :: CreateWirelessGatewayTaskDefinition -> ByteString
toPath =
    ByteString -> CreateWirelessGatewayTaskDefinition -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/wireless-gateway-task-definitions"

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

-- | /See:/ 'newCreateWirelessGatewayTaskDefinitionResponse' smart constructor.
data CreateWirelessGatewayTaskDefinitionResponse = CreateWirelessGatewayTaskDefinitionResponse'
  { -- | The Amazon Resource Name of the resource.
    CreateWirelessGatewayTaskDefinitionResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the new wireless gateway task definition.
    CreateWirelessGatewayTaskDefinitionResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWirelessGatewayTaskDefinitionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWirelessGatewayTaskDefinitionResponse
-> CreateWirelessGatewayTaskDefinitionResponse -> Bool
(CreateWirelessGatewayTaskDefinitionResponse
 -> CreateWirelessGatewayTaskDefinitionResponse -> Bool)
-> (CreateWirelessGatewayTaskDefinitionResponse
    -> CreateWirelessGatewayTaskDefinitionResponse -> Bool)
-> Eq CreateWirelessGatewayTaskDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWirelessGatewayTaskDefinitionResponse
-> CreateWirelessGatewayTaskDefinitionResponse -> Bool
$c/= :: CreateWirelessGatewayTaskDefinitionResponse
-> CreateWirelessGatewayTaskDefinitionResponse -> Bool
== :: CreateWirelessGatewayTaskDefinitionResponse
-> CreateWirelessGatewayTaskDefinitionResponse -> Bool
$c== :: CreateWirelessGatewayTaskDefinitionResponse
-> CreateWirelessGatewayTaskDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [CreateWirelessGatewayTaskDefinitionResponse]
ReadPrec CreateWirelessGatewayTaskDefinitionResponse
Int -> ReadS CreateWirelessGatewayTaskDefinitionResponse
ReadS [CreateWirelessGatewayTaskDefinitionResponse]
(Int -> ReadS CreateWirelessGatewayTaskDefinitionResponse)
-> ReadS [CreateWirelessGatewayTaskDefinitionResponse]
-> ReadPrec CreateWirelessGatewayTaskDefinitionResponse
-> ReadPrec [CreateWirelessGatewayTaskDefinitionResponse]
-> Read CreateWirelessGatewayTaskDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWirelessGatewayTaskDefinitionResponse]
$creadListPrec :: ReadPrec [CreateWirelessGatewayTaskDefinitionResponse]
readPrec :: ReadPrec CreateWirelessGatewayTaskDefinitionResponse
$creadPrec :: ReadPrec CreateWirelessGatewayTaskDefinitionResponse
readList :: ReadS [CreateWirelessGatewayTaskDefinitionResponse]
$creadList :: ReadS [CreateWirelessGatewayTaskDefinitionResponse]
readsPrec :: Int -> ReadS CreateWirelessGatewayTaskDefinitionResponse
$creadsPrec :: Int -> ReadS CreateWirelessGatewayTaskDefinitionResponse
Prelude.Read, Int -> CreateWirelessGatewayTaskDefinitionResponse -> ShowS
[CreateWirelessGatewayTaskDefinitionResponse] -> ShowS
CreateWirelessGatewayTaskDefinitionResponse -> String
(Int -> CreateWirelessGatewayTaskDefinitionResponse -> ShowS)
-> (CreateWirelessGatewayTaskDefinitionResponse -> String)
-> ([CreateWirelessGatewayTaskDefinitionResponse] -> ShowS)
-> Show CreateWirelessGatewayTaskDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWirelessGatewayTaskDefinitionResponse] -> ShowS
$cshowList :: [CreateWirelessGatewayTaskDefinitionResponse] -> ShowS
show :: CreateWirelessGatewayTaskDefinitionResponse -> String
$cshow :: CreateWirelessGatewayTaskDefinitionResponse -> String
showsPrec :: Int -> CreateWirelessGatewayTaskDefinitionResponse -> ShowS
$cshowsPrec :: Int -> CreateWirelessGatewayTaskDefinitionResponse -> ShowS
Prelude.Show, (forall x.
 CreateWirelessGatewayTaskDefinitionResponse
 -> Rep CreateWirelessGatewayTaskDefinitionResponse x)
-> (forall x.
    Rep CreateWirelessGatewayTaskDefinitionResponse x
    -> CreateWirelessGatewayTaskDefinitionResponse)
-> Generic CreateWirelessGatewayTaskDefinitionResponse
forall x.
Rep CreateWirelessGatewayTaskDefinitionResponse x
-> CreateWirelessGatewayTaskDefinitionResponse
forall x.
CreateWirelessGatewayTaskDefinitionResponse
-> Rep CreateWirelessGatewayTaskDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWirelessGatewayTaskDefinitionResponse x
-> CreateWirelessGatewayTaskDefinitionResponse
$cfrom :: forall x.
CreateWirelessGatewayTaskDefinitionResponse
-> Rep CreateWirelessGatewayTaskDefinitionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWirelessGatewayTaskDefinitionResponse' 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:
--
-- 'arn', 'createWirelessGatewayTaskDefinitionResponse_arn' - The Amazon Resource Name of the resource.
--
-- 'id', 'createWirelessGatewayTaskDefinitionResponse_id' - The ID of the new wireless gateway task definition.
--
-- 'httpStatus', 'createWirelessGatewayTaskDefinitionResponse_httpStatus' - The response's http status code.
newCreateWirelessGatewayTaskDefinitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWirelessGatewayTaskDefinitionResponse
newCreateWirelessGatewayTaskDefinitionResponse :: Int -> CreateWirelessGatewayTaskDefinitionResponse
newCreateWirelessGatewayTaskDefinitionResponse
  Int
pHttpStatus_ =
    CreateWirelessGatewayTaskDefinitionResponse' :: Maybe Text
-> Maybe Text -> Int -> CreateWirelessGatewayTaskDefinitionResponse
CreateWirelessGatewayTaskDefinitionResponse'
      { $sel:arn:CreateWirelessGatewayTaskDefinitionResponse' :: Maybe Text
arn =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:id:CreateWirelessGatewayTaskDefinitionResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateWirelessGatewayTaskDefinitionResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The Amazon Resource Name of the resource.
createWirelessGatewayTaskDefinitionResponse_arn :: Lens.Lens' CreateWirelessGatewayTaskDefinitionResponse (Prelude.Maybe Prelude.Text)
createWirelessGatewayTaskDefinitionResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessGatewayTaskDefinitionResponse
-> f CreateWirelessGatewayTaskDefinitionResponse
createWirelessGatewayTaskDefinitionResponse_arn = (CreateWirelessGatewayTaskDefinitionResponse -> Maybe Text)
-> (CreateWirelessGatewayTaskDefinitionResponse
    -> Maybe Text -> CreateWirelessGatewayTaskDefinitionResponse)
-> Lens
     CreateWirelessGatewayTaskDefinitionResponse
     CreateWirelessGatewayTaskDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessGatewayTaskDefinitionResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateWirelessGatewayTaskDefinitionResponse' :: CreateWirelessGatewayTaskDefinitionResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateWirelessGatewayTaskDefinitionResponse
s@CreateWirelessGatewayTaskDefinitionResponse' {} Maybe Text
a -> CreateWirelessGatewayTaskDefinitionResponse
s {$sel:arn:CreateWirelessGatewayTaskDefinitionResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateWirelessGatewayTaskDefinitionResponse)

-- | The ID of the new wireless gateway task definition.
createWirelessGatewayTaskDefinitionResponse_id :: Lens.Lens' CreateWirelessGatewayTaskDefinitionResponse (Prelude.Maybe Prelude.Text)
createWirelessGatewayTaskDefinitionResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessGatewayTaskDefinitionResponse
-> f CreateWirelessGatewayTaskDefinitionResponse
createWirelessGatewayTaskDefinitionResponse_id = (CreateWirelessGatewayTaskDefinitionResponse -> Maybe Text)
-> (CreateWirelessGatewayTaskDefinitionResponse
    -> Maybe Text -> CreateWirelessGatewayTaskDefinitionResponse)
-> Lens
     CreateWirelessGatewayTaskDefinitionResponse
     CreateWirelessGatewayTaskDefinitionResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessGatewayTaskDefinitionResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateWirelessGatewayTaskDefinitionResponse' :: CreateWirelessGatewayTaskDefinitionResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateWirelessGatewayTaskDefinitionResponse
s@CreateWirelessGatewayTaskDefinitionResponse' {} Maybe Text
a -> CreateWirelessGatewayTaskDefinitionResponse
s {$sel:id:CreateWirelessGatewayTaskDefinitionResponse' :: Maybe Text
id = Maybe Text
a} :: CreateWirelessGatewayTaskDefinitionResponse)

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

instance
  Prelude.NFData
    CreateWirelessGatewayTaskDefinitionResponse