{-# 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.CustomerProfiles.GetProfileObjectTypeTemplate
-- 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)
--
-- Returns the template information for a specific object type.
--
-- A template is a predefined ProfileObjectType, such as
-- “Salesforce-Account” or “Salesforce-Contact.” When a user sends a
-- ProfileObject, using the PutProfileObject API, with an ObjectTypeName
-- that matches one of the TemplateIds, it uses the mappings from the
-- template.
module Amazonka.CustomerProfiles.GetProfileObjectTypeTemplate
  ( -- * Creating a Request
    GetProfileObjectTypeTemplate (..),
    newGetProfileObjectTypeTemplate,

    -- * Request Lenses
    getProfileObjectTypeTemplate_templateId,

    -- * Destructuring the Response
    GetProfileObjectTypeTemplateResponse (..),
    newGetProfileObjectTypeTemplateResponse,

    -- * Response Lenses
    getProfileObjectTypeTemplateResponse_sourceName,
    getProfileObjectTypeTemplateResponse_templateId,
    getProfileObjectTypeTemplateResponse_sourceObject,
    getProfileObjectTypeTemplateResponse_keys,
    getProfileObjectTypeTemplateResponse_allowProfileCreation,
    getProfileObjectTypeTemplateResponse_fields,
    getProfileObjectTypeTemplateResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.CustomerProfiles.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:/ 'newGetProfileObjectTypeTemplate' smart constructor.
data GetProfileObjectTypeTemplate = GetProfileObjectTypeTemplate'
  { -- | A unique identifier for the object template.
    GetProfileObjectTypeTemplate -> Text
templateId :: Prelude.Text
  }
  deriving (GetProfileObjectTypeTemplate
-> GetProfileObjectTypeTemplate -> Bool
(GetProfileObjectTypeTemplate
 -> GetProfileObjectTypeTemplate -> Bool)
-> (GetProfileObjectTypeTemplate
    -> GetProfileObjectTypeTemplate -> Bool)
-> Eq GetProfileObjectTypeTemplate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetProfileObjectTypeTemplate
-> GetProfileObjectTypeTemplate -> Bool
$c/= :: GetProfileObjectTypeTemplate
-> GetProfileObjectTypeTemplate -> Bool
== :: GetProfileObjectTypeTemplate
-> GetProfileObjectTypeTemplate -> Bool
$c== :: GetProfileObjectTypeTemplate
-> GetProfileObjectTypeTemplate -> Bool
Prelude.Eq, ReadPrec [GetProfileObjectTypeTemplate]
ReadPrec GetProfileObjectTypeTemplate
Int -> ReadS GetProfileObjectTypeTemplate
ReadS [GetProfileObjectTypeTemplate]
(Int -> ReadS GetProfileObjectTypeTemplate)
-> ReadS [GetProfileObjectTypeTemplate]
-> ReadPrec GetProfileObjectTypeTemplate
-> ReadPrec [GetProfileObjectTypeTemplate]
-> Read GetProfileObjectTypeTemplate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetProfileObjectTypeTemplate]
$creadListPrec :: ReadPrec [GetProfileObjectTypeTemplate]
readPrec :: ReadPrec GetProfileObjectTypeTemplate
$creadPrec :: ReadPrec GetProfileObjectTypeTemplate
readList :: ReadS [GetProfileObjectTypeTemplate]
$creadList :: ReadS [GetProfileObjectTypeTemplate]
readsPrec :: Int -> ReadS GetProfileObjectTypeTemplate
$creadsPrec :: Int -> ReadS GetProfileObjectTypeTemplate
Prelude.Read, Int -> GetProfileObjectTypeTemplate -> ShowS
[GetProfileObjectTypeTemplate] -> ShowS
GetProfileObjectTypeTemplate -> String
(Int -> GetProfileObjectTypeTemplate -> ShowS)
-> (GetProfileObjectTypeTemplate -> String)
-> ([GetProfileObjectTypeTemplate] -> ShowS)
-> Show GetProfileObjectTypeTemplate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetProfileObjectTypeTemplate] -> ShowS
$cshowList :: [GetProfileObjectTypeTemplate] -> ShowS
show :: GetProfileObjectTypeTemplate -> String
$cshow :: GetProfileObjectTypeTemplate -> String
showsPrec :: Int -> GetProfileObjectTypeTemplate -> ShowS
$cshowsPrec :: Int -> GetProfileObjectTypeTemplate -> ShowS
Prelude.Show, (forall x.
 GetProfileObjectTypeTemplate -> Rep GetProfileObjectTypeTemplate x)
-> (forall x.
    Rep GetProfileObjectTypeTemplate x -> GetProfileObjectTypeTemplate)
-> Generic GetProfileObjectTypeTemplate
forall x.
Rep GetProfileObjectTypeTemplate x -> GetProfileObjectTypeTemplate
forall x.
GetProfileObjectTypeTemplate -> Rep GetProfileObjectTypeTemplate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetProfileObjectTypeTemplate x -> GetProfileObjectTypeTemplate
$cfrom :: forall x.
GetProfileObjectTypeTemplate -> Rep GetProfileObjectTypeTemplate x
Prelude.Generic)

-- |
-- Create a value of 'GetProfileObjectTypeTemplate' 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:
--
-- 'templateId', 'getProfileObjectTypeTemplate_templateId' - A unique identifier for the object template.
newGetProfileObjectTypeTemplate ::
  -- | 'templateId'
  Prelude.Text ->
  GetProfileObjectTypeTemplate
newGetProfileObjectTypeTemplate :: Text -> GetProfileObjectTypeTemplate
newGetProfileObjectTypeTemplate Text
pTemplateId_ =
  GetProfileObjectTypeTemplate' :: Text -> GetProfileObjectTypeTemplate
GetProfileObjectTypeTemplate'
    { $sel:templateId:GetProfileObjectTypeTemplate' :: Text
templateId =
        Text
pTemplateId_
    }

-- | A unique identifier for the object template.
getProfileObjectTypeTemplate_templateId :: Lens.Lens' GetProfileObjectTypeTemplate Prelude.Text
getProfileObjectTypeTemplate_templateId :: (Text -> f Text)
-> GetProfileObjectTypeTemplate -> f GetProfileObjectTypeTemplate
getProfileObjectTypeTemplate_templateId = (GetProfileObjectTypeTemplate -> Text)
-> (GetProfileObjectTypeTemplate
    -> Text -> GetProfileObjectTypeTemplate)
-> Lens
     GetProfileObjectTypeTemplate GetProfileObjectTypeTemplate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProfileObjectTypeTemplate' {Text
templateId :: Text
$sel:templateId:GetProfileObjectTypeTemplate' :: GetProfileObjectTypeTemplate -> Text
templateId} -> Text
templateId) (\s :: GetProfileObjectTypeTemplate
s@GetProfileObjectTypeTemplate' {} Text
a -> GetProfileObjectTypeTemplate
s {$sel:templateId:GetProfileObjectTypeTemplate' :: Text
templateId = Text
a} :: GetProfileObjectTypeTemplate)

instance Core.AWSRequest GetProfileObjectTypeTemplate where
  type
    AWSResponse GetProfileObjectTypeTemplate =
      GetProfileObjectTypeTemplateResponse
  request :: GetProfileObjectTypeTemplate
-> Request GetProfileObjectTypeTemplate
request = Service
-> GetProfileObjectTypeTemplate
-> Request GetProfileObjectTypeTemplate
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetProfileObjectTypeTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetProfileObjectTypeTemplate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetProfileObjectTypeTemplate))
-> Logger
-> Service
-> Proxy GetProfileObjectTypeTemplate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetProfileObjectTypeTemplate)))
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
-> Maybe Text
-> Maybe (HashMap Text [ObjectTypeKey])
-> Maybe Bool
-> Maybe (HashMap Text ObjectTypeField)
-> Int
-> GetProfileObjectTypeTemplateResponse
GetProfileObjectTypeTemplateResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (HashMap Text [ObjectTypeKey])
 -> Maybe Bool
 -> Maybe (HashMap Text ObjectTypeField)
 -> Int
 -> GetProfileObjectTypeTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe (HashMap Text [ObjectTypeKey])
      -> Maybe Bool
      -> Maybe (HashMap Text ObjectTypeField)
      -> Int
      -> GetProfileObjectTypeTemplateResponse)
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
"SourceName")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe (HashMap Text [ObjectTypeKey])
   -> Maybe Bool
   -> Maybe (HashMap Text ObjectTypeField)
   -> Int
   -> GetProfileObjectTypeTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe (HashMap Text [ObjectTypeKey])
      -> Maybe Bool
      -> Maybe (HashMap Text ObjectTypeField)
      -> Int
      -> GetProfileObjectTypeTemplateResponse)
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
"TemplateId")
            Either
  String
  (Maybe Text
   -> Maybe (HashMap Text [ObjectTypeKey])
   -> Maybe Bool
   -> Maybe (HashMap Text ObjectTypeField)
   -> Int
   -> GetProfileObjectTypeTemplateResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (HashMap Text [ObjectTypeKey])
      -> Maybe Bool
      -> Maybe (HashMap Text ObjectTypeField)
      -> Int
      -> GetProfileObjectTypeTemplateResponse)
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
"SourceObject")
            Either
  String
  (Maybe (HashMap Text [ObjectTypeKey])
   -> Maybe Bool
   -> Maybe (HashMap Text ObjectTypeField)
   -> Int
   -> GetProfileObjectTypeTemplateResponse)
-> Either String (Maybe (HashMap Text [ObjectTypeKey]))
-> Either
     String
     (Maybe Bool
      -> Maybe (HashMap Text ObjectTypeField)
      -> Int
      -> GetProfileObjectTypeTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text [ObjectTypeKey])))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Keys" Either String (Maybe (Maybe (HashMap Text [ObjectTypeKey])))
-> Maybe (HashMap Text [ObjectTypeKey])
-> Either String (Maybe (HashMap Text [ObjectTypeKey]))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text [ObjectTypeKey])
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe Bool
   -> Maybe (HashMap Text ObjectTypeField)
   -> Int
   -> GetProfileObjectTypeTemplateResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe (HashMap Text ObjectTypeField)
      -> Int -> GetProfileObjectTypeTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AllowProfileCreation")
            Either
  String
  (Maybe (HashMap Text ObjectTypeField)
   -> Int -> GetProfileObjectTypeTemplateResponse)
-> Either String (Maybe (HashMap Text ObjectTypeField))
-> Either String (Int -> GetProfileObjectTypeTemplateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text ObjectTypeField)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Fields" Either String (Maybe (Maybe (HashMap Text ObjectTypeField)))
-> Maybe (HashMap Text ObjectTypeField)
-> Either String (Maybe (HashMap Text ObjectTypeField))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text ObjectTypeField)
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetProfileObjectTypeTemplateResponse)
-> Either String Int
-> Either String GetProfileObjectTypeTemplateResponse
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
    GetProfileObjectTypeTemplate

instance Prelude.NFData GetProfileObjectTypeTemplate

instance Core.ToHeaders GetProfileObjectTypeTemplate where
  toHeaders :: GetProfileObjectTypeTemplate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetProfileObjectTypeTemplate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath GetProfileObjectTypeTemplate where
  toPath :: GetProfileObjectTypeTemplate -> ByteString
toPath GetProfileObjectTypeTemplate' {Text
templateId :: Text
$sel:templateId:GetProfileObjectTypeTemplate' :: GetProfileObjectTypeTemplate -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/templates/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
templateId]

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

-- | /See:/ 'newGetProfileObjectTypeTemplateResponse' smart constructor.
data GetProfileObjectTypeTemplateResponse = GetProfileObjectTypeTemplateResponse'
  { -- | The name of the source of the object template.
    GetProfileObjectTypeTemplateResponse -> Maybe Text
sourceName :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the object template.
    GetProfileObjectTypeTemplateResponse -> Maybe Text
templateId :: Prelude.Maybe Prelude.Text,
    -- | The source of the object template.
    GetProfileObjectTypeTemplateResponse -> Maybe Text
sourceObject :: Prelude.Maybe Prelude.Text,
    -- | A list of unique keys that can be used to map data to the profile.
    GetProfileObjectTypeTemplateResponse
-> Maybe (HashMap Text [ObjectTypeKey])
keys :: Prelude.Maybe (Prelude.HashMap Prelude.Text [ObjectTypeKey]),
    -- | Indicates whether a profile should be created when data is received if
    -- one doesn’t exist for an object of this type. The default is @FALSE@. If
    -- the AllowProfileCreation flag is set to @FALSE@, then the service tries
    -- to fetch a standard profile and associate this object with the profile.
    -- If it is set to @TRUE@, and if no match is found, then the service
    -- creates a new standard profile.
    GetProfileObjectTypeTemplateResponse -> Maybe Bool
allowProfileCreation :: Prelude.Maybe Prelude.Bool,
    -- | A map of the name and ObjectType field.
    GetProfileObjectTypeTemplateResponse
-> Maybe (HashMap Text ObjectTypeField)
fields :: Prelude.Maybe (Prelude.HashMap Prelude.Text ObjectTypeField),
    -- | The response's http status code.
    GetProfileObjectTypeTemplateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetProfileObjectTypeTemplateResponse
-> GetProfileObjectTypeTemplateResponse -> Bool
(GetProfileObjectTypeTemplateResponse
 -> GetProfileObjectTypeTemplateResponse -> Bool)
-> (GetProfileObjectTypeTemplateResponse
    -> GetProfileObjectTypeTemplateResponse -> Bool)
-> Eq GetProfileObjectTypeTemplateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetProfileObjectTypeTemplateResponse
-> GetProfileObjectTypeTemplateResponse -> Bool
$c/= :: GetProfileObjectTypeTemplateResponse
-> GetProfileObjectTypeTemplateResponse -> Bool
== :: GetProfileObjectTypeTemplateResponse
-> GetProfileObjectTypeTemplateResponse -> Bool
$c== :: GetProfileObjectTypeTemplateResponse
-> GetProfileObjectTypeTemplateResponse -> Bool
Prelude.Eq, ReadPrec [GetProfileObjectTypeTemplateResponse]
ReadPrec GetProfileObjectTypeTemplateResponse
Int -> ReadS GetProfileObjectTypeTemplateResponse
ReadS [GetProfileObjectTypeTemplateResponse]
(Int -> ReadS GetProfileObjectTypeTemplateResponse)
-> ReadS [GetProfileObjectTypeTemplateResponse]
-> ReadPrec GetProfileObjectTypeTemplateResponse
-> ReadPrec [GetProfileObjectTypeTemplateResponse]
-> Read GetProfileObjectTypeTemplateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetProfileObjectTypeTemplateResponse]
$creadListPrec :: ReadPrec [GetProfileObjectTypeTemplateResponse]
readPrec :: ReadPrec GetProfileObjectTypeTemplateResponse
$creadPrec :: ReadPrec GetProfileObjectTypeTemplateResponse
readList :: ReadS [GetProfileObjectTypeTemplateResponse]
$creadList :: ReadS [GetProfileObjectTypeTemplateResponse]
readsPrec :: Int -> ReadS GetProfileObjectTypeTemplateResponse
$creadsPrec :: Int -> ReadS GetProfileObjectTypeTemplateResponse
Prelude.Read, Int -> GetProfileObjectTypeTemplateResponse -> ShowS
[GetProfileObjectTypeTemplateResponse] -> ShowS
GetProfileObjectTypeTemplateResponse -> String
(Int -> GetProfileObjectTypeTemplateResponse -> ShowS)
-> (GetProfileObjectTypeTemplateResponse -> String)
-> ([GetProfileObjectTypeTemplateResponse] -> ShowS)
-> Show GetProfileObjectTypeTemplateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetProfileObjectTypeTemplateResponse] -> ShowS
$cshowList :: [GetProfileObjectTypeTemplateResponse] -> ShowS
show :: GetProfileObjectTypeTemplateResponse -> String
$cshow :: GetProfileObjectTypeTemplateResponse -> String
showsPrec :: Int -> GetProfileObjectTypeTemplateResponse -> ShowS
$cshowsPrec :: Int -> GetProfileObjectTypeTemplateResponse -> ShowS
Prelude.Show, (forall x.
 GetProfileObjectTypeTemplateResponse
 -> Rep GetProfileObjectTypeTemplateResponse x)
-> (forall x.
    Rep GetProfileObjectTypeTemplateResponse x
    -> GetProfileObjectTypeTemplateResponse)
-> Generic GetProfileObjectTypeTemplateResponse
forall x.
Rep GetProfileObjectTypeTemplateResponse x
-> GetProfileObjectTypeTemplateResponse
forall x.
GetProfileObjectTypeTemplateResponse
-> Rep GetProfileObjectTypeTemplateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetProfileObjectTypeTemplateResponse x
-> GetProfileObjectTypeTemplateResponse
$cfrom :: forall x.
GetProfileObjectTypeTemplateResponse
-> Rep GetProfileObjectTypeTemplateResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetProfileObjectTypeTemplateResponse' 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:
--
-- 'sourceName', 'getProfileObjectTypeTemplateResponse_sourceName' - The name of the source of the object template.
--
-- 'templateId', 'getProfileObjectTypeTemplateResponse_templateId' - A unique identifier for the object template.
--
-- 'sourceObject', 'getProfileObjectTypeTemplateResponse_sourceObject' - The source of the object template.
--
-- 'keys', 'getProfileObjectTypeTemplateResponse_keys' - A list of unique keys that can be used to map data to the profile.
--
-- 'allowProfileCreation', 'getProfileObjectTypeTemplateResponse_allowProfileCreation' - Indicates whether a profile should be created when data is received if
-- one doesn’t exist for an object of this type. The default is @FALSE@. If
-- the AllowProfileCreation flag is set to @FALSE@, then the service tries
-- to fetch a standard profile and associate this object with the profile.
-- If it is set to @TRUE@, and if no match is found, then the service
-- creates a new standard profile.
--
-- 'fields', 'getProfileObjectTypeTemplateResponse_fields' - A map of the name and ObjectType field.
--
-- 'httpStatus', 'getProfileObjectTypeTemplateResponse_httpStatus' - The response's http status code.
newGetProfileObjectTypeTemplateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetProfileObjectTypeTemplateResponse
newGetProfileObjectTypeTemplateResponse :: Int -> GetProfileObjectTypeTemplateResponse
newGetProfileObjectTypeTemplateResponse Int
pHttpStatus_ =
  GetProfileObjectTypeTemplateResponse' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text [ObjectTypeKey])
-> Maybe Bool
-> Maybe (HashMap Text ObjectTypeField)
-> Int
-> GetProfileObjectTypeTemplateResponse
GetProfileObjectTypeTemplateResponse'
    { $sel:sourceName:GetProfileObjectTypeTemplateResponse' :: Maybe Text
sourceName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:templateId:GetProfileObjectTypeTemplateResponse' :: Maybe Text
templateId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sourceObject:GetProfileObjectTypeTemplateResponse' :: Maybe Text
sourceObject = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:keys:GetProfileObjectTypeTemplateResponse' :: Maybe (HashMap Text [ObjectTypeKey])
keys = Maybe (HashMap Text [ObjectTypeKey])
forall a. Maybe a
Prelude.Nothing,
      $sel:allowProfileCreation:GetProfileObjectTypeTemplateResponse' :: Maybe Bool
allowProfileCreation =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:fields:GetProfileObjectTypeTemplateResponse' :: Maybe (HashMap Text ObjectTypeField)
fields = Maybe (HashMap Text ObjectTypeField)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetProfileObjectTypeTemplateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the source of the object template.
getProfileObjectTypeTemplateResponse_sourceName :: Lens.Lens' GetProfileObjectTypeTemplateResponse (Prelude.Maybe Prelude.Text)
getProfileObjectTypeTemplateResponse_sourceName :: (Maybe Text -> f (Maybe Text))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
getProfileObjectTypeTemplateResponse_sourceName = (GetProfileObjectTypeTemplateResponse -> Maybe Text)
-> (GetProfileObjectTypeTemplateResponse
    -> Maybe Text -> GetProfileObjectTypeTemplateResponse)
-> Lens
     GetProfileObjectTypeTemplateResponse
     GetProfileObjectTypeTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProfileObjectTypeTemplateResponse' {Maybe Text
sourceName :: Maybe Text
$sel:sourceName:GetProfileObjectTypeTemplateResponse' :: GetProfileObjectTypeTemplateResponse -> Maybe Text
sourceName} -> Maybe Text
sourceName) (\s :: GetProfileObjectTypeTemplateResponse
s@GetProfileObjectTypeTemplateResponse' {} Maybe Text
a -> GetProfileObjectTypeTemplateResponse
s {$sel:sourceName:GetProfileObjectTypeTemplateResponse' :: Maybe Text
sourceName = Maybe Text
a} :: GetProfileObjectTypeTemplateResponse)

-- | A unique identifier for the object template.
getProfileObjectTypeTemplateResponse_templateId :: Lens.Lens' GetProfileObjectTypeTemplateResponse (Prelude.Maybe Prelude.Text)
getProfileObjectTypeTemplateResponse_templateId :: (Maybe Text -> f (Maybe Text))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
getProfileObjectTypeTemplateResponse_templateId = (GetProfileObjectTypeTemplateResponse -> Maybe Text)
-> (GetProfileObjectTypeTemplateResponse
    -> Maybe Text -> GetProfileObjectTypeTemplateResponse)
-> Lens
     GetProfileObjectTypeTemplateResponse
     GetProfileObjectTypeTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProfileObjectTypeTemplateResponse' {Maybe Text
templateId :: Maybe Text
$sel:templateId:GetProfileObjectTypeTemplateResponse' :: GetProfileObjectTypeTemplateResponse -> Maybe Text
templateId} -> Maybe Text
templateId) (\s :: GetProfileObjectTypeTemplateResponse
s@GetProfileObjectTypeTemplateResponse' {} Maybe Text
a -> GetProfileObjectTypeTemplateResponse
s {$sel:templateId:GetProfileObjectTypeTemplateResponse' :: Maybe Text
templateId = Maybe Text
a} :: GetProfileObjectTypeTemplateResponse)

-- | The source of the object template.
getProfileObjectTypeTemplateResponse_sourceObject :: Lens.Lens' GetProfileObjectTypeTemplateResponse (Prelude.Maybe Prelude.Text)
getProfileObjectTypeTemplateResponse_sourceObject :: (Maybe Text -> f (Maybe Text))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
getProfileObjectTypeTemplateResponse_sourceObject = (GetProfileObjectTypeTemplateResponse -> Maybe Text)
-> (GetProfileObjectTypeTemplateResponse
    -> Maybe Text -> GetProfileObjectTypeTemplateResponse)
-> Lens
     GetProfileObjectTypeTemplateResponse
     GetProfileObjectTypeTemplateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProfileObjectTypeTemplateResponse' {Maybe Text
sourceObject :: Maybe Text
$sel:sourceObject:GetProfileObjectTypeTemplateResponse' :: GetProfileObjectTypeTemplateResponse -> Maybe Text
sourceObject} -> Maybe Text
sourceObject) (\s :: GetProfileObjectTypeTemplateResponse
s@GetProfileObjectTypeTemplateResponse' {} Maybe Text
a -> GetProfileObjectTypeTemplateResponse
s {$sel:sourceObject:GetProfileObjectTypeTemplateResponse' :: Maybe Text
sourceObject = Maybe Text
a} :: GetProfileObjectTypeTemplateResponse)

-- | A list of unique keys that can be used to map data to the profile.
getProfileObjectTypeTemplateResponse_keys :: Lens.Lens' GetProfileObjectTypeTemplateResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text [ObjectTypeKey]))
getProfileObjectTypeTemplateResponse_keys :: (Maybe (HashMap Text [ObjectTypeKey])
 -> f (Maybe (HashMap Text [ObjectTypeKey])))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
getProfileObjectTypeTemplateResponse_keys = (GetProfileObjectTypeTemplateResponse
 -> Maybe (HashMap Text [ObjectTypeKey]))
-> (GetProfileObjectTypeTemplateResponse
    -> Maybe (HashMap Text [ObjectTypeKey])
    -> GetProfileObjectTypeTemplateResponse)
-> Lens
     GetProfileObjectTypeTemplateResponse
     GetProfileObjectTypeTemplateResponse
     (Maybe (HashMap Text [ObjectTypeKey]))
     (Maybe (HashMap Text [ObjectTypeKey]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProfileObjectTypeTemplateResponse' {Maybe (HashMap Text [ObjectTypeKey])
keys :: Maybe (HashMap Text [ObjectTypeKey])
$sel:keys:GetProfileObjectTypeTemplateResponse' :: GetProfileObjectTypeTemplateResponse
-> Maybe (HashMap Text [ObjectTypeKey])
keys} -> Maybe (HashMap Text [ObjectTypeKey])
keys) (\s :: GetProfileObjectTypeTemplateResponse
s@GetProfileObjectTypeTemplateResponse' {} Maybe (HashMap Text [ObjectTypeKey])
a -> GetProfileObjectTypeTemplateResponse
s {$sel:keys:GetProfileObjectTypeTemplateResponse' :: Maybe (HashMap Text [ObjectTypeKey])
keys = Maybe (HashMap Text [ObjectTypeKey])
a} :: GetProfileObjectTypeTemplateResponse) ((Maybe (HashMap Text [ObjectTypeKey])
  -> f (Maybe (HashMap Text [ObjectTypeKey])))
 -> GetProfileObjectTypeTemplateResponse
 -> f GetProfileObjectTypeTemplateResponse)
-> ((Maybe (HashMap Text [ObjectTypeKey])
     -> f (Maybe (HashMap Text [ObjectTypeKey])))
    -> Maybe (HashMap Text [ObjectTypeKey])
    -> f (Maybe (HashMap Text [ObjectTypeKey])))
-> (Maybe (HashMap Text [ObjectTypeKey])
    -> f (Maybe (HashMap Text [ObjectTypeKey])))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text [ObjectTypeKey])
  (HashMap Text [ObjectTypeKey])
  (HashMap Text [ObjectTypeKey])
  (HashMap Text [ObjectTypeKey])
-> Iso
     (Maybe (HashMap Text [ObjectTypeKey]))
     (Maybe (HashMap Text [ObjectTypeKey]))
     (Maybe (HashMap Text [ObjectTypeKey]))
     (Maybe (HashMap Text [ObjectTypeKey]))
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
  (HashMap Text [ObjectTypeKey])
  (HashMap Text [ObjectTypeKey])
  (HashMap Text [ObjectTypeKey])
  (HashMap Text [ObjectTypeKey])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether a profile should be created when data is received if
-- one doesn’t exist for an object of this type. The default is @FALSE@. If
-- the AllowProfileCreation flag is set to @FALSE@, then the service tries
-- to fetch a standard profile and associate this object with the profile.
-- If it is set to @TRUE@, and if no match is found, then the service
-- creates a new standard profile.
getProfileObjectTypeTemplateResponse_allowProfileCreation :: Lens.Lens' GetProfileObjectTypeTemplateResponse (Prelude.Maybe Prelude.Bool)
getProfileObjectTypeTemplateResponse_allowProfileCreation :: (Maybe Bool -> f (Maybe Bool))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
getProfileObjectTypeTemplateResponse_allowProfileCreation = (GetProfileObjectTypeTemplateResponse -> Maybe Bool)
-> (GetProfileObjectTypeTemplateResponse
    -> Maybe Bool -> GetProfileObjectTypeTemplateResponse)
-> Lens
     GetProfileObjectTypeTemplateResponse
     GetProfileObjectTypeTemplateResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProfileObjectTypeTemplateResponse' {Maybe Bool
allowProfileCreation :: Maybe Bool
$sel:allowProfileCreation:GetProfileObjectTypeTemplateResponse' :: GetProfileObjectTypeTemplateResponse -> Maybe Bool
allowProfileCreation} -> Maybe Bool
allowProfileCreation) (\s :: GetProfileObjectTypeTemplateResponse
s@GetProfileObjectTypeTemplateResponse' {} Maybe Bool
a -> GetProfileObjectTypeTemplateResponse
s {$sel:allowProfileCreation:GetProfileObjectTypeTemplateResponse' :: Maybe Bool
allowProfileCreation = Maybe Bool
a} :: GetProfileObjectTypeTemplateResponse)

-- | A map of the name and ObjectType field.
getProfileObjectTypeTemplateResponse_fields :: Lens.Lens' GetProfileObjectTypeTemplateResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text ObjectTypeField))
getProfileObjectTypeTemplateResponse_fields :: (Maybe (HashMap Text ObjectTypeField)
 -> f (Maybe (HashMap Text ObjectTypeField)))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
getProfileObjectTypeTemplateResponse_fields = (GetProfileObjectTypeTemplateResponse
 -> Maybe (HashMap Text ObjectTypeField))
-> (GetProfileObjectTypeTemplateResponse
    -> Maybe (HashMap Text ObjectTypeField)
    -> GetProfileObjectTypeTemplateResponse)
-> Lens
     GetProfileObjectTypeTemplateResponse
     GetProfileObjectTypeTemplateResponse
     (Maybe (HashMap Text ObjectTypeField))
     (Maybe (HashMap Text ObjectTypeField))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetProfileObjectTypeTemplateResponse' {Maybe (HashMap Text ObjectTypeField)
fields :: Maybe (HashMap Text ObjectTypeField)
$sel:fields:GetProfileObjectTypeTemplateResponse' :: GetProfileObjectTypeTemplateResponse
-> Maybe (HashMap Text ObjectTypeField)
fields} -> Maybe (HashMap Text ObjectTypeField)
fields) (\s :: GetProfileObjectTypeTemplateResponse
s@GetProfileObjectTypeTemplateResponse' {} Maybe (HashMap Text ObjectTypeField)
a -> GetProfileObjectTypeTemplateResponse
s {$sel:fields:GetProfileObjectTypeTemplateResponse' :: Maybe (HashMap Text ObjectTypeField)
fields = Maybe (HashMap Text ObjectTypeField)
a} :: GetProfileObjectTypeTemplateResponse) ((Maybe (HashMap Text ObjectTypeField)
  -> f (Maybe (HashMap Text ObjectTypeField)))
 -> GetProfileObjectTypeTemplateResponse
 -> f GetProfileObjectTypeTemplateResponse)
-> ((Maybe (HashMap Text ObjectTypeField)
     -> f (Maybe (HashMap Text ObjectTypeField)))
    -> Maybe (HashMap Text ObjectTypeField)
    -> f (Maybe (HashMap Text ObjectTypeField)))
-> (Maybe (HashMap Text ObjectTypeField)
    -> f (Maybe (HashMap Text ObjectTypeField)))
-> GetProfileObjectTypeTemplateResponse
-> f GetProfileObjectTypeTemplateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text ObjectTypeField)
  (HashMap Text ObjectTypeField)
  (HashMap Text ObjectTypeField)
  (HashMap Text ObjectTypeField)
-> Iso
     (Maybe (HashMap Text ObjectTypeField))
     (Maybe (HashMap Text ObjectTypeField))
     (Maybe (HashMap Text ObjectTypeField))
     (Maybe (HashMap Text ObjectTypeField))
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
  (HashMap Text ObjectTypeField)
  (HashMap Text ObjectTypeField)
  (HashMap Text ObjectTypeField)
  (HashMap Text ObjectTypeField)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetProfileObjectTypeTemplateResponse