{-# 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.AppConfig.CreateHostedConfigurationVersion
-- 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)
--
-- Create a new configuration in the AppConfig configuration store.
module Amazonka.AppConfig.CreateHostedConfigurationVersion
  ( -- * Creating a Request
    CreateHostedConfigurationVersion (..),
    newCreateHostedConfigurationVersion,

    -- * Request Lenses
    createHostedConfigurationVersion_latestVersionNumber,
    createHostedConfigurationVersion_description,
    createHostedConfigurationVersion_applicationId,
    createHostedConfigurationVersion_configurationProfileId,
    createHostedConfigurationVersion_content,
    createHostedConfigurationVersion_contentType,

    -- * Destructuring the Response
    HostedConfigurationVersion (..),
    newHostedConfigurationVersion,

    -- * Response Lenses
    hostedConfigurationVersion_content,
    hostedConfigurationVersion_versionNumber,
    hostedConfigurationVersion_applicationId,
    hostedConfigurationVersion_description,
    hostedConfigurationVersion_configurationProfileId,
    hostedConfigurationVersion_contentType,
  )
where

import Amazonka.AppConfig.Types
import qualified Amazonka.Core as Core
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:/ 'newCreateHostedConfigurationVersion' smart constructor.
data CreateHostedConfigurationVersion = CreateHostedConfigurationVersion'
  { -- | An optional locking token used to prevent race conditions from
    -- overwriting configuration updates when creating a new version. To ensure
    -- your data is not overwritten when creating multiple hosted configuration
    -- versions in rapid succession, specify the version of the latest hosted
    -- configuration version.
    CreateHostedConfigurationVersion -> Maybe Int
latestVersionNumber :: Prelude.Maybe Prelude.Int,
    -- | A description of the configuration.
    CreateHostedConfigurationVersion -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The application ID.
    CreateHostedConfigurationVersion -> Text
applicationId :: Prelude.Text,
    -- | The configuration profile ID.
    CreateHostedConfigurationVersion -> Text
configurationProfileId :: Prelude.Text,
    -- | The content of the configuration or the configuration data.
    CreateHostedConfigurationVersion -> Sensitive ByteString
content :: Core.Sensitive Prelude.ByteString,
    -- | A standard MIME type describing the format of the configuration content.
    -- For more information, see
    -- <https://docs.aws.amazon.com/https:/www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 Content-Type>.
    CreateHostedConfigurationVersion -> Text
contentType :: Prelude.Text
  }
  deriving (CreateHostedConfigurationVersion
-> CreateHostedConfigurationVersion -> Bool
(CreateHostedConfigurationVersion
 -> CreateHostedConfigurationVersion -> Bool)
-> (CreateHostedConfigurationVersion
    -> CreateHostedConfigurationVersion -> Bool)
-> Eq CreateHostedConfigurationVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHostedConfigurationVersion
-> CreateHostedConfigurationVersion -> Bool
$c/= :: CreateHostedConfigurationVersion
-> CreateHostedConfigurationVersion -> Bool
== :: CreateHostedConfigurationVersion
-> CreateHostedConfigurationVersion -> Bool
$c== :: CreateHostedConfigurationVersion
-> CreateHostedConfigurationVersion -> Bool
Prelude.Eq, Int -> CreateHostedConfigurationVersion -> ShowS
[CreateHostedConfigurationVersion] -> ShowS
CreateHostedConfigurationVersion -> String
(Int -> CreateHostedConfigurationVersion -> ShowS)
-> (CreateHostedConfigurationVersion -> String)
-> ([CreateHostedConfigurationVersion] -> ShowS)
-> Show CreateHostedConfigurationVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHostedConfigurationVersion] -> ShowS
$cshowList :: [CreateHostedConfigurationVersion] -> ShowS
show :: CreateHostedConfigurationVersion -> String
$cshow :: CreateHostedConfigurationVersion -> String
showsPrec :: Int -> CreateHostedConfigurationVersion -> ShowS
$cshowsPrec :: Int -> CreateHostedConfigurationVersion -> ShowS
Prelude.Show, (forall x.
 CreateHostedConfigurationVersion
 -> Rep CreateHostedConfigurationVersion x)
-> (forall x.
    Rep CreateHostedConfigurationVersion x
    -> CreateHostedConfigurationVersion)
-> Generic CreateHostedConfigurationVersion
forall x.
Rep CreateHostedConfigurationVersion x
-> CreateHostedConfigurationVersion
forall x.
CreateHostedConfigurationVersion
-> Rep CreateHostedConfigurationVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateHostedConfigurationVersion x
-> CreateHostedConfigurationVersion
$cfrom :: forall x.
CreateHostedConfigurationVersion
-> Rep CreateHostedConfigurationVersion x
Prelude.Generic)

-- |
-- Create a value of 'CreateHostedConfigurationVersion' 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:
--
-- 'latestVersionNumber', 'createHostedConfigurationVersion_latestVersionNumber' - An optional locking token used to prevent race conditions from
-- overwriting configuration updates when creating a new version. To ensure
-- your data is not overwritten when creating multiple hosted configuration
-- versions in rapid succession, specify the version of the latest hosted
-- configuration version.
--
-- 'description', 'createHostedConfigurationVersion_description' - A description of the configuration.
--
-- 'applicationId', 'createHostedConfigurationVersion_applicationId' - The application ID.
--
-- 'configurationProfileId', 'createHostedConfigurationVersion_configurationProfileId' - The configuration profile ID.
--
-- 'content', 'createHostedConfigurationVersion_content' - The content of the configuration or the configuration data.
--
-- 'contentType', 'createHostedConfigurationVersion_contentType' - A standard MIME type describing the format of the configuration content.
-- For more information, see
-- <https://docs.aws.amazon.com/https:/www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 Content-Type>.
newCreateHostedConfigurationVersion ::
  -- | 'applicationId'
  Prelude.Text ->
  -- | 'configurationProfileId'
  Prelude.Text ->
  -- | 'content'
  Prelude.ByteString ->
  -- | 'contentType'
  Prelude.Text ->
  CreateHostedConfigurationVersion
newCreateHostedConfigurationVersion :: Text
-> Text -> ByteString -> Text -> CreateHostedConfigurationVersion
newCreateHostedConfigurationVersion
  Text
pApplicationId_
  Text
pConfigurationProfileId_
  ByteString
pContent_
  Text
pContentType_ =
    CreateHostedConfigurationVersion' :: Maybe Int
-> Maybe Text
-> Text
-> Text
-> Sensitive ByteString
-> Text
-> CreateHostedConfigurationVersion
CreateHostedConfigurationVersion'
      { $sel:latestVersionNumber:CreateHostedConfigurationVersion' :: Maybe Int
latestVersionNumber =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateHostedConfigurationVersion' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:applicationId:CreateHostedConfigurationVersion' :: Text
applicationId = Text
pApplicationId_,
        $sel:configurationProfileId:CreateHostedConfigurationVersion' :: Text
configurationProfileId =
          Text
pConfigurationProfileId_,
        $sel:content:CreateHostedConfigurationVersion' :: Sensitive ByteString
content =
          Tagged ByteString (Identity ByteString)
-> Tagged (Sensitive ByteString) (Identity (Sensitive ByteString))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged ByteString (Identity ByteString)
 -> Tagged (Sensitive ByteString) (Identity (Sensitive ByteString)))
-> ByteString -> Sensitive ByteString
forall t b. AReview t b -> b -> t
Lens.# ByteString
pContent_,
        $sel:contentType:CreateHostedConfigurationVersion' :: Text
contentType = Text
pContentType_
      }

-- | An optional locking token used to prevent race conditions from
-- overwriting configuration updates when creating a new version. To ensure
-- your data is not overwritten when creating multiple hosted configuration
-- versions in rapid succession, specify the version of the latest hosted
-- configuration version.
createHostedConfigurationVersion_latestVersionNumber :: Lens.Lens' CreateHostedConfigurationVersion (Prelude.Maybe Prelude.Int)
createHostedConfigurationVersion_latestVersionNumber :: (Maybe Int -> f (Maybe Int))
-> CreateHostedConfigurationVersion
-> f CreateHostedConfigurationVersion
createHostedConfigurationVersion_latestVersionNumber = (CreateHostedConfigurationVersion -> Maybe Int)
-> (CreateHostedConfigurationVersion
    -> Maybe Int -> CreateHostedConfigurationVersion)
-> Lens
     CreateHostedConfigurationVersion
     CreateHostedConfigurationVersion
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedConfigurationVersion' {Maybe Int
latestVersionNumber :: Maybe Int
$sel:latestVersionNumber:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Int
latestVersionNumber} -> Maybe Int
latestVersionNumber) (\s :: CreateHostedConfigurationVersion
s@CreateHostedConfigurationVersion' {} Maybe Int
a -> CreateHostedConfigurationVersion
s {$sel:latestVersionNumber:CreateHostedConfigurationVersion' :: Maybe Int
latestVersionNumber = Maybe Int
a} :: CreateHostedConfigurationVersion)

-- | A description of the configuration.
createHostedConfigurationVersion_description :: Lens.Lens' CreateHostedConfigurationVersion (Prelude.Maybe Prelude.Text)
createHostedConfigurationVersion_description :: (Maybe Text -> f (Maybe Text))
-> CreateHostedConfigurationVersion
-> f CreateHostedConfigurationVersion
createHostedConfigurationVersion_description = (CreateHostedConfigurationVersion -> Maybe Text)
-> (CreateHostedConfigurationVersion
    -> Maybe Text -> CreateHostedConfigurationVersion)
-> Lens
     CreateHostedConfigurationVersion
     CreateHostedConfigurationVersion
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedConfigurationVersion' {Maybe Text
description :: Maybe Text
$sel:description:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateHostedConfigurationVersion
s@CreateHostedConfigurationVersion' {} Maybe Text
a -> CreateHostedConfigurationVersion
s {$sel:description:CreateHostedConfigurationVersion' :: Maybe Text
description = Maybe Text
a} :: CreateHostedConfigurationVersion)

-- | The application ID.
createHostedConfigurationVersion_applicationId :: Lens.Lens' CreateHostedConfigurationVersion Prelude.Text
createHostedConfigurationVersion_applicationId :: (Text -> f Text)
-> CreateHostedConfigurationVersion
-> f CreateHostedConfigurationVersion
createHostedConfigurationVersion_applicationId = (CreateHostedConfigurationVersion -> Text)
-> (CreateHostedConfigurationVersion
    -> Text -> CreateHostedConfigurationVersion)
-> Lens
     CreateHostedConfigurationVersion
     CreateHostedConfigurationVersion
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedConfigurationVersion' {Text
applicationId :: Text
$sel:applicationId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
applicationId} -> Text
applicationId) (\s :: CreateHostedConfigurationVersion
s@CreateHostedConfigurationVersion' {} Text
a -> CreateHostedConfigurationVersion
s {$sel:applicationId:CreateHostedConfigurationVersion' :: Text
applicationId = Text
a} :: CreateHostedConfigurationVersion)

-- | The configuration profile ID.
createHostedConfigurationVersion_configurationProfileId :: Lens.Lens' CreateHostedConfigurationVersion Prelude.Text
createHostedConfigurationVersion_configurationProfileId :: (Text -> f Text)
-> CreateHostedConfigurationVersion
-> f CreateHostedConfigurationVersion
createHostedConfigurationVersion_configurationProfileId = (CreateHostedConfigurationVersion -> Text)
-> (CreateHostedConfigurationVersion
    -> Text -> CreateHostedConfigurationVersion)
-> Lens
     CreateHostedConfigurationVersion
     CreateHostedConfigurationVersion
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedConfigurationVersion' {Text
configurationProfileId :: Text
$sel:configurationProfileId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
configurationProfileId} -> Text
configurationProfileId) (\s :: CreateHostedConfigurationVersion
s@CreateHostedConfigurationVersion' {} Text
a -> CreateHostedConfigurationVersion
s {$sel:configurationProfileId:CreateHostedConfigurationVersion' :: Text
configurationProfileId = Text
a} :: CreateHostedConfigurationVersion)

-- | The content of the configuration or the configuration data.
createHostedConfigurationVersion_content :: Lens.Lens' CreateHostedConfigurationVersion Prelude.ByteString
createHostedConfigurationVersion_content :: (ByteString -> f ByteString)
-> CreateHostedConfigurationVersion
-> f CreateHostedConfigurationVersion
createHostedConfigurationVersion_content = (CreateHostedConfigurationVersion -> Sensitive ByteString)
-> (CreateHostedConfigurationVersion
    -> Sensitive ByteString -> CreateHostedConfigurationVersion)
-> Lens
     CreateHostedConfigurationVersion
     CreateHostedConfigurationVersion
     (Sensitive ByteString)
     (Sensitive ByteString)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedConfigurationVersion' {Sensitive ByteString
content :: Sensitive ByteString
$sel:content:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Sensitive ByteString
content} -> Sensitive ByteString
content) (\s :: CreateHostedConfigurationVersion
s@CreateHostedConfigurationVersion' {} Sensitive ByteString
a -> CreateHostedConfigurationVersion
s {$sel:content:CreateHostedConfigurationVersion' :: Sensitive ByteString
content = Sensitive ByteString
a} :: CreateHostedConfigurationVersion) ((Sensitive ByteString -> f (Sensitive ByteString))
 -> CreateHostedConfigurationVersion
 -> f CreateHostedConfigurationVersion)
-> ((ByteString -> f ByteString)
    -> Sensitive ByteString -> f (Sensitive ByteString))
-> (ByteString -> f ByteString)
-> CreateHostedConfigurationVersion
-> f CreateHostedConfigurationVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString)
-> Sensitive ByteString -> f (Sensitive ByteString)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | A standard MIME type describing the format of the configuration content.
-- For more information, see
-- <https://docs.aws.amazon.com/https:/www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 Content-Type>.
createHostedConfigurationVersion_contentType :: Lens.Lens' CreateHostedConfigurationVersion Prelude.Text
createHostedConfigurationVersion_contentType :: (Text -> f Text)
-> CreateHostedConfigurationVersion
-> f CreateHostedConfigurationVersion
createHostedConfigurationVersion_contentType = (CreateHostedConfigurationVersion -> Text)
-> (CreateHostedConfigurationVersion
    -> Text -> CreateHostedConfigurationVersion)
-> Lens
     CreateHostedConfigurationVersion
     CreateHostedConfigurationVersion
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHostedConfigurationVersion' {Text
contentType :: Text
$sel:contentType:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
contentType} -> Text
contentType) (\s :: CreateHostedConfigurationVersion
s@CreateHostedConfigurationVersion' {} Text
a -> CreateHostedConfigurationVersion
s {$sel:contentType:CreateHostedConfigurationVersion' :: Text
contentType = Text
a} :: CreateHostedConfigurationVersion)

instance
  Core.AWSRequest
    CreateHostedConfigurationVersion
  where
  type
    AWSResponse CreateHostedConfigurationVersion =
      HostedConfigurationVersion
  request :: CreateHostedConfigurationVersion
-> Request CreateHostedConfigurationVersion
request = Service
-> CreateHostedConfigurationVersion
-> Request CreateHostedConfigurationVersion
forall a. (ToRequest a, ToBody a) => Service -> a -> Request a
Request.postBody Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateHostedConfigurationVersion
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateHostedConfigurationVersion)))
response =
    (Int
 -> ResponseHeaders
 -> ByteString
 -> Either String (AWSResponse CreateHostedConfigurationVersion))
-> Logger
-> Service
-> Proxy CreateHostedConfigurationVersion
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse CreateHostedConfigurationVersion)))
forall (m :: * -> *) a.
MonadResource m =>
(Int
 -> ResponseHeaders -> ByteString -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveBytes
      ( \Int
s ResponseHeaders
h ByteString
x ->
          Maybe (Sensitive ByteString)
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> HostedConfigurationVersion
HostedConfigurationVersion'
            (Maybe (Sensitive ByteString)
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> HostedConfigurationVersion)
-> Either String (Maybe (Sensitive ByteString))
-> Either
     String
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> HostedConfigurationVersion)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Maybe (Sensitive ByteString)
-> Either String (Maybe (Sensitive ByteString))
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Sensitive ByteString -> Maybe (Sensitive ByteString)
forall a. a -> Maybe a
Prelude.Just (ByteString -> Sensitive ByteString
Prelude.coerce ByteString
x)))
            Either
  String
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> HostedConfigurationVersion)
-> Either String (Maybe Int)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> HostedConfigurationVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Int)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Version-Number")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> HostedConfigurationVersion)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text -> Maybe Text -> HostedConfigurationVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Application-Id")
            Either
  String
  (Maybe Text
   -> Maybe Text -> Maybe Text -> HostedConfigurationVersion)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Maybe Text -> HostedConfigurationVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Description")
            Either
  String (Maybe Text -> Maybe Text -> HostedConfigurationVersion)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> HostedConfigurationVersion)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Configuration-Profile-Id")
            Either String (Maybe Text -> HostedConfigurationVersion)
-> Either String (Maybe Text)
-> Either String HostedConfigurationVersion
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Content-Type")
      )

instance
  Prelude.Hashable
    CreateHostedConfigurationVersion

instance
  Prelude.NFData
    CreateHostedConfigurationVersion

instance Core.ToBody CreateHostedConfigurationVersion where
  toBody :: CreateHostedConfigurationVersion -> RequestBody
toBody CreateHostedConfigurationVersion' {Maybe Int
Maybe Text
Text
Sensitive ByteString
contentType :: Text
content :: Sensitive ByteString
configurationProfileId :: Text
applicationId :: Text
description :: Maybe Text
latestVersionNumber :: Maybe Int
$sel:contentType:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:content:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Sensitive ByteString
$sel:configurationProfileId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:applicationId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:description:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Text
$sel:latestVersionNumber:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Int
..} =
    Sensitive ByteString -> RequestBody
forall a. ToBody a => a -> RequestBody
Core.toBody Sensitive ByteString
content

instance
  Core.ToHeaders
    CreateHostedConfigurationVersion
  where
  toHeaders :: CreateHostedConfigurationVersion -> ResponseHeaders
toHeaders CreateHostedConfigurationVersion' {Maybe Int
Maybe Text
Text
Sensitive ByteString
contentType :: Text
content :: Sensitive ByteString
configurationProfileId :: Text
applicationId :: Text
description :: Maybe Text
latestVersionNumber :: Maybe Int
$sel:contentType:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:content:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Sensitive ByteString
$sel:configurationProfileId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:applicationId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:description:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Text
$sel:latestVersionNumber:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Int
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Latest-Version-Number" HeaderName -> Maybe Int -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Int
latestVersionNumber,
        HeaderName
"Description" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
description,
        HeaderName
"Content-Type" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
contentType
      ]

instance Core.ToPath CreateHostedConfigurationVersion where
  toPath :: CreateHostedConfigurationVersion -> ByteString
toPath CreateHostedConfigurationVersion' {Maybe Int
Maybe Text
Text
Sensitive ByteString
contentType :: Text
content :: Sensitive ByteString
configurationProfileId :: Text
applicationId :: Text
description :: Maybe Text
latestVersionNumber :: Maybe Int
$sel:contentType:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:content:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Sensitive ByteString
$sel:configurationProfileId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:applicationId:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Text
$sel:description:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Text
$sel:latestVersionNumber:CreateHostedConfigurationVersion' :: CreateHostedConfigurationVersion -> Maybe Int
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/applications/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
applicationId,
        ByteString
"/configurationprofiles/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
configurationProfileId,
        ByteString
"/hostedconfigurationversions"
      ]

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