amazonka-sms-voice-2.0: gen/Amazonka/SmsVoice/CreateConfigurationSet.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.SmsVoice.CreateConfigurationSet
-- Copyright : (c) 2013-2023 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Create a new configuration set. After you create the configuration set,
-- you can add one or more event destinations to it.
module Amazonka.SmsVoice.CreateConfigurationSet
( -- * Creating a Request
CreateConfigurationSet (..),
newCreateConfigurationSet,
-- * Request Lenses
createConfigurationSet_configurationSetName,
-- * Destructuring the Response
CreateConfigurationSetResponse (..),
newCreateConfigurationSetResponse,
-- * Response Lenses
createConfigurationSetResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SmsVoice.Types
-- | A request to create a new configuration set.
--
-- /See:/ 'newCreateConfigurationSet' smart constructor.
data CreateConfigurationSet = CreateConfigurationSet'
{ -- | The name that you want to give the configuration set.
configurationSetName :: Prelude.Maybe Prelude.Text
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'CreateConfigurationSet' 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:
--
-- 'configurationSetName', 'createConfigurationSet_configurationSetName' - The name that you want to give the configuration set.
newCreateConfigurationSet ::
CreateConfigurationSet
newCreateConfigurationSet =
CreateConfigurationSet'
{ configurationSetName =
Prelude.Nothing
}
-- | The name that you want to give the configuration set.
createConfigurationSet_configurationSetName :: Lens.Lens' CreateConfigurationSet (Prelude.Maybe Prelude.Text)
createConfigurationSet_configurationSetName = Lens.lens (\CreateConfigurationSet' {configurationSetName} -> configurationSetName) (\s@CreateConfigurationSet' {} a -> s {configurationSetName = a} :: CreateConfigurationSet)
instance Core.AWSRequest CreateConfigurationSet where
type
AWSResponse CreateConfigurationSet =
CreateConfigurationSetResponse
request overrides =
Request.postJSON (overrides defaultService)
response =
Response.receiveEmpty
( \s h x ->
CreateConfigurationSetResponse'
Prelude.<$> (Prelude.pure (Prelude.fromEnum s))
)
instance Prelude.Hashable CreateConfigurationSet where
hashWithSalt _salt CreateConfigurationSet' {..} =
_salt `Prelude.hashWithSalt` configurationSetName
instance Prelude.NFData CreateConfigurationSet where
rnf CreateConfigurationSet' {..} =
Prelude.rnf configurationSetName
instance Data.ToHeaders CreateConfigurationSet where
toHeaders =
Prelude.const
( Prelude.mconcat
[ "Content-Type"
Data.=# ( "application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON CreateConfigurationSet where
toJSON CreateConfigurationSet' {..} =
Data.object
( Prelude.catMaybes
[ ("ConfigurationSetName" Data..=)
Prelude.<$> configurationSetName
]
)
instance Data.ToPath CreateConfigurationSet where
toPath =
Prelude.const "/v1/sms-voice/configuration-sets"
instance Data.ToQuery CreateConfigurationSet where
toQuery = Prelude.const Prelude.mempty
-- | An empty object that indicates that the configuration set was
-- successfully created.
--
-- /See:/ 'newCreateConfigurationSetResponse' smart constructor.
data CreateConfigurationSetResponse = CreateConfigurationSetResponse'
{ -- | The response's http status code.
httpStatus :: Prelude.Int
}
deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)
-- |
-- Create a value of 'CreateConfigurationSetResponse' 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', 'createConfigurationSetResponse_httpStatus' - The response's http status code.
newCreateConfigurationSetResponse ::
-- | 'httpStatus'
Prelude.Int ->
CreateConfigurationSetResponse
newCreateConfigurationSetResponse pHttpStatus_ =
CreateConfigurationSetResponse'
{ httpStatus =
pHttpStatus_
}
-- | The response's http status code.
createConfigurationSetResponse_httpStatus :: Lens.Lens' CreateConfigurationSetResponse Prelude.Int
createConfigurationSetResponse_httpStatus = Lens.lens (\CreateConfigurationSetResponse' {httpStatus} -> httpStatus) (\s@CreateConfigurationSetResponse' {} a -> s {httpStatus = a} :: CreateConfigurationSetResponse)
instance
Prelude.NFData
CreateConfigurationSetResponse
where
rnf CreateConfigurationSetResponse' {..} =
Prelude.rnf httpStatus