{-# 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.CreateDestination
-- 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 new destination that maps a device message to an AWS IoT rule.
module Amazonka.IoTWireless.CreateDestination
  ( -- * Creating a Request
    CreateDestination (..),
    newCreateDestination,

    -- * Request Lenses
    createDestination_clientRequestToken,
    createDestination_description,
    createDestination_tags,
    createDestination_name,
    createDestination_expressionType,
    createDestination_expression,
    createDestination_roleArn,

    -- * Destructuring the Response
    CreateDestinationResponse (..),
    newCreateDestinationResponse,

    -- * Response Lenses
    createDestinationResponse_arn,
    createDestinationResponse_name,
    createDestinationResponse_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:/ 'newCreateDestination' smart constructor.
data CreateDestination = CreateDestination'
  { -- | 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.
    CreateDestination -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The description of the new resource.
    CreateDestination -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags to attach to the new destination. Tags are metadata that you
    -- can use to manage a resource.
    CreateDestination -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name of the new resource.
    CreateDestination -> Text
name :: Prelude.Text,
    -- | The type of value in @Expression@.
    CreateDestination -> ExpressionType
expressionType :: ExpressionType,
    -- | The rule name or topic rule to send messages to.
    CreateDestination -> Text
expression :: Prelude.Text,
    -- | The ARN of the IAM Role that authorizes the destination.
    CreateDestination -> Text
roleArn :: Prelude.Text
  }
  deriving (CreateDestination -> CreateDestination -> Bool
(CreateDestination -> CreateDestination -> Bool)
-> (CreateDestination -> CreateDestination -> Bool)
-> Eq CreateDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateDestination -> CreateDestination -> Bool
$c/= :: CreateDestination -> CreateDestination -> Bool
== :: CreateDestination -> CreateDestination -> Bool
$c== :: CreateDestination -> CreateDestination -> Bool
Prelude.Eq, ReadPrec [CreateDestination]
ReadPrec CreateDestination
Int -> ReadS CreateDestination
ReadS [CreateDestination]
(Int -> ReadS CreateDestination)
-> ReadS [CreateDestination]
-> ReadPrec CreateDestination
-> ReadPrec [CreateDestination]
-> Read CreateDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateDestination]
$creadListPrec :: ReadPrec [CreateDestination]
readPrec :: ReadPrec CreateDestination
$creadPrec :: ReadPrec CreateDestination
readList :: ReadS [CreateDestination]
$creadList :: ReadS [CreateDestination]
readsPrec :: Int -> ReadS CreateDestination
$creadsPrec :: Int -> ReadS CreateDestination
Prelude.Read, Int -> CreateDestination -> ShowS
[CreateDestination] -> ShowS
CreateDestination -> String
(Int -> CreateDestination -> ShowS)
-> (CreateDestination -> String)
-> ([CreateDestination] -> ShowS)
-> Show CreateDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateDestination] -> ShowS
$cshowList :: [CreateDestination] -> ShowS
show :: CreateDestination -> String
$cshow :: CreateDestination -> String
showsPrec :: Int -> CreateDestination -> ShowS
$cshowsPrec :: Int -> CreateDestination -> ShowS
Prelude.Show, (forall x. CreateDestination -> Rep CreateDestination x)
-> (forall x. Rep CreateDestination x -> CreateDestination)
-> Generic CreateDestination
forall x. Rep CreateDestination x -> CreateDestination
forall x. CreateDestination -> Rep CreateDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateDestination x -> CreateDestination
$cfrom :: forall x. CreateDestination -> Rep CreateDestination x
Prelude.Generic)

-- |
-- Create a value of 'CreateDestination' 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:
--
-- 'clientRequestToken', 'createDestination_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.
--
-- 'description', 'createDestination_description' - The description of the new resource.
--
-- 'tags', 'createDestination_tags' - The tags to attach to the new destination. Tags are metadata that you
-- can use to manage a resource.
--
-- 'name', 'createDestination_name' - The name of the new resource.
--
-- 'expressionType', 'createDestination_expressionType' - The type of value in @Expression@.
--
-- 'expression', 'createDestination_expression' - The rule name or topic rule to send messages to.
--
-- 'roleArn', 'createDestination_roleArn' - The ARN of the IAM Role that authorizes the destination.
newCreateDestination ::
  -- | 'name'
  Prelude.Text ->
  -- | 'expressionType'
  ExpressionType ->
  -- | 'expression'
  Prelude.Text ->
  -- | 'roleArn'
  Prelude.Text ->
  CreateDestination
newCreateDestination :: Text -> ExpressionType -> Text -> Text -> CreateDestination
newCreateDestination
  Text
pName_
  ExpressionType
pExpressionType_
  Text
pExpression_
  Text
pRoleArn_ =
    CreateDestination' :: Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> ExpressionType
-> Text
-> Text
-> CreateDestination
CreateDestination'
      { $sel:clientRequestToken:CreateDestination' :: Maybe Text
clientRequestToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateDestination' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateDestination' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateDestination' :: Text
name = Text
pName_,
        $sel:expressionType:CreateDestination' :: ExpressionType
expressionType = ExpressionType
pExpressionType_,
        $sel:expression:CreateDestination' :: Text
expression = Text
pExpression_,
        $sel:roleArn:CreateDestination' :: Text
roleArn = Text
pRoleArn_
      }

-- | 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.
createDestination_clientRequestToken :: Lens.Lens' CreateDestination (Prelude.Maybe Prelude.Text)
createDestination_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateDestination -> f CreateDestination
createDestination_clientRequestToken = (CreateDestination -> Maybe Text)
-> (CreateDestination -> Maybe Text -> CreateDestination)
-> Lens
     CreateDestination CreateDestination (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDestination' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateDestination' :: CreateDestination -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateDestination
s@CreateDestination' {} Maybe Text
a -> CreateDestination
s {$sel:clientRequestToken:CreateDestination' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateDestination)

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

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

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

-- | The type of value in @Expression@.
createDestination_expressionType :: Lens.Lens' CreateDestination ExpressionType
createDestination_expressionType :: (ExpressionType -> f ExpressionType)
-> CreateDestination -> f CreateDestination
createDestination_expressionType = (CreateDestination -> ExpressionType)
-> (CreateDestination -> ExpressionType -> CreateDestination)
-> Lens
     CreateDestination CreateDestination ExpressionType ExpressionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDestination' {ExpressionType
expressionType :: ExpressionType
$sel:expressionType:CreateDestination' :: CreateDestination -> ExpressionType
expressionType} -> ExpressionType
expressionType) (\s :: CreateDestination
s@CreateDestination' {} ExpressionType
a -> CreateDestination
s {$sel:expressionType:CreateDestination' :: ExpressionType
expressionType = ExpressionType
a} :: CreateDestination)

-- | The rule name or topic rule to send messages to.
createDestination_expression :: Lens.Lens' CreateDestination Prelude.Text
createDestination_expression :: (Text -> f Text) -> CreateDestination -> f CreateDestination
createDestination_expression = (CreateDestination -> Text)
-> (CreateDestination -> Text -> CreateDestination)
-> Lens CreateDestination CreateDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDestination' {Text
expression :: Text
$sel:expression:CreateDestination' :: CreateDestination -> Text
expression} -> Text
expression) (\s :: CreateDestination
s@CreateDestination' {} Text
a -> CreateDestination
s {$sel:expression:CreateDestination' :: Text
expression = Text
a} :: CreateDestination)

-- | The ARN of the IAM Role that authorizes the destination.
createDestination_roleArn :: Lens.Lens' CreateDestination Prelude.Text
createDestination_roleArn :: (Text -> f Text) -> CreateDestination -> f CreateDestination
createDestination_roleArn = (CreateDestination -> Text)
-> (CreateDestination -> Text -> CreateDestination)
-> Lens CreateDestination CreateDestination Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateDestination' {Text
roleArn :: Text
$sel:roleArn:CreateDestination' :: CreateDestination -> Text
roleArn} -> Text
roleArn) (\s :: CreateDestination
s@CreateDestination' {} Text
a -> CreateDestination
s {$sel:roleArn:CreateDestination' :: Text
roleArn = Text
a} :: CreateDestination)

instance Core.AWSRequest CreateDestination where
  type
    AWSResponse CreateDestination =
      CreateDestinationResponse
  request :: CreateDestination -> Request CreateDestination
request = Service -> CreateDestination -> Request CreateDestination
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateDestination
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDestination)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateDestination))
-> Logger
-> Service
-> Proxy CreateDestination
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateDestination)))
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 -> CreateDestinationResponse
CreateDestinationResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateDestinationResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> CreateDestinationResponse)
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 -> CreateDestinationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateDestinationResponse)
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
"Name")
            Either String (Int -> CreateDestinationResponse)
-> Either String Int -> Either String CreateDestinationResponse
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 CreateDestination

instance Prelude.NFData CreateDestination

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

instance Core.ToJSON CreateDestination where
  toJSON :: CreateDestination -> Value
toJSON CreateDestination' {Maybe [Tag]
Maybe Text
Text
ExpressionType
roleArn :: Text
expression :: Text
expressionType :: ExpressionType
name :: Text
tags :: Maybe [Tag]
description :: Maybe Text
clientRequestToken :: Maybe Text
$sel:roleArn:CreateDestination' :: CreateDestination -> Text
$sel:expression:CreateDestination' :: CreateDestination -> Text
$sel:expressionType:CreateDestination' :: CreateDestination -> ExpressionType
$sel:name:CreateDestination' :: CreateDestination -> Text
$sel:tags:CreateDestination' :: CreateDestination -> Maybe [Tag]
$sel:description:CreateDestination' :: CreateDestination -> Maybe Text
$sel:clientRequestToken:CreateDestination' :: CreateDestination -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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,
            (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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ExpressionType" Text -> ExpressionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ExpressionType
expressionType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Expression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
expression),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RoleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'CreateDestinationResponse' 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', 'createDestinationResponse_arn' - The Amazon Resource Name of the new resource.
--
-- 'name', 'createDestinationResponse_name' - The name of the new resource.
--
-- 'httpStatus', 'createDestinationResponse_httpStatus' - The response's http status code.
newCreateDestinationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateDestinationResponse
newCreateDestinationResponse :: Int -> CreateDestinationResponse
newCreateDestinationResponse Int
pHttpStatus_ =
  CreateDestinationResponse' :: Maybe Text -> Maybe Text -> Int -> CreateDestinationResponse
CreateDestinationResponse'
    { $sel:arn:CreateDestinationResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateDestinationResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateDestinationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

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

instance Prelude.NFData CreateDestinationResponse