{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Pinpoint.Types.CreateRecommenderConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Pinpoint.Types.CreateRecommenderConfiguration 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

-- | Specifies Amazon Pinpoint configuration settings for retrieving and
-- processing recommendation data from a recommender model.
--
-- /See:/ 'newCreateRecommenderConfiguration' smart constructor.
data CreateRecommenderConfiguration = CreateRecommenderConfiguration'
  { -- | A map of key-value pairs that defines 1-10 custom endpoint or user
    -- attributes, depending on the value for the RecommendationProviderIdType
    -- property. Each of these attributes temporarily stores a recommended item
    -- that\'s retrieved from the recommender model and sent to an AWS Lambda
    -- function for additional processing. Each attribute can be used as a
    -- message variable in a message template.
    --
    -- In the map, the key is the name of a custom attribute and the value is a
    -- custom display name for that attribute. The display name appears in the
    -- __Attribute finder__ of the template editor on the Amazon Pinpoint
    -- console. The following restrictions apply to these names:
    --
    -- -   An attribute name must start with a letter or number and it can
    --     contain up to 50 characters. The characters can be letters, numbers,
    --     underscores (_), or hyphens (-). Attribute names are case sensitive
    --     and must be unique.
    --
    -- -   An attribute display name must start with a letter or number and it
    --     can contain up to 25 characters. The characters can be letters,
    --     numbers, spaces, underscores (_), or hyphens (-).
    --
    -- This object is required if the configuration invokes an AWS Lambda
    -- function (RecommendationTransformerUri) to process recommendation data.
    -- Otherwise, don\'t include this object in your request.
    CreateRecommenderConfiguration -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A custom description of the configuration for the recommender model. The
    -- description can contain up to 128 characters. The characters can be
    -- letters, numbers, spaces, or the following symbols: _ ; () , ‐.
    CreateRecommenderConfiguration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A custom name of the configuration for the recommender model. The name
    -- must start with a letter or number and it can contain up to 128
    -- characters. The characters can be letters, numbers, spaces, underscores
    -- (_), or hyphens (-).
    CreateRecommenderConfiguration -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The type of Amazon Pinpoint ID to associate with unique user IDs in the
    -- recommender model. This value enables the model to use attribute and
    -- event data that’s specific to a particular endpoint or user in an Amazon
    -- Pinpoint application. Valid values are:
    --
    -- -   PINPOINT_ENDPOINT_ID - Associate each user in the model with a
    --     particular endpoint in Amazon Pinpoint. The data is correlated based
    --     on endpoint IDs in Amazon Pinpoint. This is the default value.
    --
    -- -   PINPOINT_USER_ID - Associate each user in the model with a
    --     particular user and endpoint in Amazon Pinpoint. The data is
    --     correlated based on user IDs in Amazon Pinpoint. If you specify this
    --     value, an endpoint definition in Amazon Pinpoint has to specify both
    --     a user ID (UserId) and an endpoint ID. Otherwise, messages won’t be
    --     sent to the user\'s endpoint.
    CreateRecommenderConfiguration -> Maybe Text
recommendationProviderIdType :: Prelude.Maybe Prelude.Text,
    -- | The name or Amazon Resource Name (ARN) of the AWS Lambda function to
    -- invoke for additional processing of recommendation data that\'s
    -- retrieved from the recommender model.
    CreateRecommenderConfiguration -> Maybe Text
recommendationTransformerUri :: Prelude.Maybe Prelude.Text,
    -- | A custom display name for the standard endpoint or user attribute
    -- (RecommendationItems) that temporarily stores recommended items for each
    -- endpoint or user, depending on the value for the
    -- RecommendationProviderIdType property. This value is required if the
    -- configuration doesn\'t invoke an AWS Lambda function
    -- (RecommendationTransformerUri) to perform additional processing of
    -- recommendation data.
    --
    -- This name appears in the __Attribute finder__ of the template editor on
    -- the Amazon Pinpoint console. The name can contain up to 25 characters.
    -- The characters can be letters, numbers, spaces, underscores (_), or
    -- hyphens (-). These restrictions don\'t apply to attribute values.
    CreateRecommenderConfiguration -> Maybe Text
recommendationsDisplayName :: Prelude.Maybe Prelude.Text,
    -- | The number of recommended items to retrieve from the model for each
    -- endpoint or user, depending on the value for the
    -- RecommendationProviderIdType property. This number determines how many
    -- recommended items are available for use in message variables. The
    -- minimum value is 1. The maximum value is 5. The default value is 5.
    --
    -- To use multiple recommended items and custom attributes with message
    -- variables, you have to use an AWS Lambda function
    -- (RecommendationTransformerUri) to perform additional processing of
    -- recommendation data.
    CreateRecommenderConfiguration -> Maybe Int
recommendationsPerMessage :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the recommender model to retrieve
    -- recommendation data from. This value must match the ARN of an Amazon
    -- Personalize campaign.
    CreateRecommenderConfiguration -> Text
recommendationProviderUri :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the AWS Identity and Access Management
    -- (IAM) role that authorizes Amazon Pinpoint to retrieve recommendation
    -- data from the recommender model.
    CreateRecommenderConfiguration -> Text
recommendationProviderRoleArn :: Prelude.Text
  }
  deriving (CreateRecommenderConfiguration
-> CreateRecommenderConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateRecommenderConfiguration
-> CreateRecommenderConfiguration -> Bool
$c/= :: CreateRecommenderConfiguration
-> CreateRecommenderConfiguration -> Bool
== :: CreateRecommenderConfiguration
-> CreateRecommenderConfiguration -> Bool
$c== :: CreateRecommenderConfiguration
-> CreateRecommenderConfiguration -> Bool
Prelude.Eq, ReadPrec [CreateRecommenderConfiguration]
ReadPrec CreateRecommenderConfiguration
Int -> ReadS CreateRecommenderConfiguration
ReadS [CreateRecommenderConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateRecommenderConfiguration]
$creadListPrec :: ReadPrec [CreateRecommenderConfiguration]
readPrec :: ReadPrec CreateRecommenderConfiguration
$creadPrec :: ReadPrec CreateRecommenderConfiguration
readList :: ReadS [CreateRecommenderConfiguration]
$creadList :: ReadS [CreateRecommenderConfiguration]
readsPrec :: Int -> ReadS CreateRecommenderConfiguration
$creadsPrec :: Int -> ReadS CreateRecommenderConfiguration
Prelude.Read, Int -> CreateRecommenderConfiguration -> ShowS
[CreateRecommenderConfiguration] -> ShowS
CreateRecommenderConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateRecommenderConfiguration] -> ShowS
$cshowList :: [CreateRecommenderConfiguration] -> ShowS
show :: CreateRecommenderConfiguration -> String
$cshow :: CreateRecommenderConfiguration -> String
showsPrec :: Int -> CreateRecommenderConfiguration -> ShowS
$cshowsPrec :: Int -> CreateRecommenderConfiguration -> ShowS
Prelude.Show, forall x.
Rep CreateRecommenderConfiguration x
-> CreateRecommenderConfiguration
forall x.
CreateRecommenderConfiguration
-> Rep CreateRecommenderConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateRecommenderConfiguration x
-> CreateRecommenderConfiguration
$cfrom :: forall x.
CreateRecommenderConfiguration
-> Rep CreateRecommenderConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'CreateRecommenderConfiguration' 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:
--
-- 'attributes', 'createRecommenderConfiguration_attributes' - A map of key-value pairs that defines 1-10 custom endpoint or user
-- attributes, depending on the value for the RecommendationProviderIdType
-- property. Each of these attributes temporarily stores a recommended item
-- that\'s retrieved from the recommender model and sent to an AWS Lambda
-- function for additional processing. Each attribute can be used as a
-- message variable in a message template.
--
-- In the map, the key is the name of a custom attribute and the value is a
-- custom display name for that attribute. The display name appears in the
-- __Attribute finder__ of the template editor on the Amazon Pinpoint
-- console. The following restrictions apply to these names:
--
-- -   An attribute name must start with a letter or number and it can
--     contain up to 50 characters. The characters can be letters, numbers,
--     underscores (_), or hyphens (-). Attribute names are case sensitive
--     and must be unique.
--
-- -   An attribute display name must start with a letter or number and it
--     can contain up to 25 characters. The characters can be letters,
--     numbers, spaces, underscores (_), or hyphens (-).
--
-- This object is required if the configuration invokes an AWS Lambda
-- function (RecommendationTransformerUri) to process recommendation data.
-- Otherwise, don\'t include this object in your request.
--
-- 'description', 'createRecommenderConfiguration_description' - A custom description of the configuration for the recommender model. The
-- description can contain up to 128 characters. The characters can be
-- letters, numbers, spaces, or the following symbols: _ ; () , ‐.
--
-- 'name', 'createRecommenderConfiguration_name' - A custom name of the configuration for the recommender model. The name
-- must start with a letter or number and it can contain up to 128
-- characters. The characters can be letters, numbers, spaces, underscores
-- (_), or hyphens (-).
--
-- 'recommendationProviderIdType', 'createRecommenderConfiguration_recommendationProviderIdType' - The type of Amazon Pinpoint ID to associate with unique user IDs in the
-- recommender model. This value enables the model to use attribute and
-- event data that’s specific to a particular endpoint or user in an Amazon
-- Pinpoint application. Valid values are:
--
-- -   PINPOINT_ENDPOINT_ID - Associate each user in the model with a
--     particular endpoint in Amazon Pinpoint. The data is correlated based
--     on endpoint IDs in Amazon Pinpoint. This is the default value.
--
-- -   PINPOINT_USER_ID - Associate each user in the model with a
--     particular user and endpoint in Amazon Pinpoint. The data is
--     correlated based on user IDs in Amazon Pinpoint. If you specify this
--     value, an endpoint definition in Amazon Pinpoint has to specify both
--     a user ID (UserId) and an endpoint ID. Otherwise, messages won’t be
--     sent to the user\'s endpoint.
--
-- 'recommendationTransformerUri', 'createRecommenderConfiguration_recommendationTransformerUri' - The name or Amazon Resource Name (ARN) of the AWS Lambda function to
-- invoke for additional processing of recommendation data that\'s
-- retrieved from the recommender model.
--
-- 'recommendationsDisplayName', 'createRecommenderConfiguration_recommendationsDisplayName' - A custom display name for the standard endpoint or user attribute
-- (RecommendationItems) that temporarily stores recommended items for each
-- endpoint or user, depending on the value for the
-- RecommendationProviderIdType property. This value is required if the
-- configuration doesn\'t invoke an AWS Lambda function
-- (RecommendationTransformerUri) to perform additional processing of
-- recommendation data.
--
-- This name appears in the __Attribute finder__ of the template editor on
-- the Amazon Pinpoint console. The name can contain up to 25 characters.
-- The characters can be letters, numbers, spaces, underscores (_), or
-- hyphens (-). These restrictions don\'t apply to attribute values.
--
-- 'recommendationsPerMessage', 'createRecommenderConfiguration_recommendationsPerMessage' - The number of recommended items to retrieve from the model for each
-- endpoint or user, depending on the value for the
-- RecommendationProviderIdType property. This number determines how many
-- recommended items are available for use in message variables. The
-- minimum value is 1. The maximum value is 5. The default value is 5.
--
-- To use multiple recommended items and custom attributes with message
-- variables, you have to use an AWS Lambda function
-- (RecommendationTransformerUri) to perform additional processing of
-- recommendation data.
--
-- 'recommendationProviderUri', 'createRecommenderConfiguration_recommendationProviderUri' - The Amazon Resource Name (ARN) of the recommender model to retrieve
-- recommendation data from. This value must match the ARN of an Amazon
-- Personalize campaign.
--
-- 'recommendationProviderRoleArn', 'createRecommenderConfiguration_recommendationProviderRoleArn' - The Amazon Resource Name (ARN) of the AWS Identity and Access Management
-- (IAM) role that authorizes Amazon Pinpoint to retrieve recommendation
-- data from the recommender model.
newCreateRecommenderConfiguration ::
  -- | 'recommendationProviderUri'
  Prelude.Text ->
  -- | 'recommendationProviderRoleArn'
  Prelude.Text ->
  CreateRecommenderConfiguration
newCreateRecommenderConfiguration :: Text -> Text -> CreateRecommenderConfiguration
newCreateRecommenderConfiguration
  Text
pRecommendationProviderUri_
  Text
pRecommendationProviderRoleArn_ =
    CreateRecommenderConfiguration'
      { $sel:attributes:CreateRecommenderConfiguration' :: Maybe (HashMap Text Text)
attributes =
          forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateRecommenderConfiguration' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateRecommenderConfiguration' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationProviderIdType:CreateRecommenderConfiguration' :: Maybe Text
recommendationProviderIdType =
          forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationTransformerUri:CreateRecommenderConfiguration' :: Maybe Text
recommendationTransformerUri =
          forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationsDisplayName:CreateRecommenderConfiguration' :: Maybe Text
recommendationsDisplayName =
          forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationsPerMessage:CreateRecommenderConfiguration' :: Maybe Int
recommendationsPerMessage = forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationProviderUri:CreateRecommenderConfiguration' :: Text
recommendationProviderUri =
          Text
pRecommendationProviderUri_,
        $sel:recommendationProviderRoleArn:CreateRecommenderConfiguration' :: Text
recommendationProviderRoleArn =
          Text
pRecommendationProviderRoleArn_
      }

-- | A map of key-value pairs that defines 1-10 custom endpoint or user
-- attributes, depending on the value for the RecommendationProviderIdType
-- property. Each of these attributes temporarily stores a recommended item
-- that\'s retrieved from the recommender model and sent to an AWS Lambda
-- function for additional processing. Each attribute can be used as a
-- message variable in a message template.
--
-- In the map, the key is the name of a custom attribute and the value is a
-- custom display name for that attribute. The display name appears in the
-- __Attribute finder__ of the template editor on the Amazon Pinpoint
-- console. The following restrictions apply to these names:
--
-- -   An attribute name must start with a letter or number and it can
--     contain up to 50 characters. The characters can be letters, numbers,
--     underscores (_), or hyphens (-). Attribute names are case sensitive
--     and must be unique.
--
-- -   An attribute display name must start with a letter or number and it
--     can contain up to 25 characters. The characters can be letters,
--     numbers, spaces, underscores (_), or hyphens (-).
--
-- This object is required if the configuration invokes an AWS Lambda
-- function (RecommendationTransformerUri) to process recommendation data.
-- Otherwise, don\'t include this object in your request.
createRecommenderConfiguration_attributes :: Lens.Lens' CreateRecommenderConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createRecommenderConfiguration_attributes :: Lens' CreateRecommenderConfiguration (Maybe (HashMap Text Text))
createRecommenderConfiguration_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Maybe (HashMap Text Text)
a -> CreateRecommenderConfiguration
s {$sel:attributes:CreateRecommenderConfiguration' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: CreateRecommenderConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A custom description of the configuration for the recommender model. The
-- description can contain up to 128 characters. The characters can be
-- letters, numbers, spaces, or the following symbols: _ ; () , ‐.
createRecommenderConfiguration_description :: Lens.Lens' CreateRecommenderConfiguration (Prelude.Maybe Prelude.Text)
createRecommenderConfiguration_description :: Lens' CreateRecommenderConfiguration (Maybe Text)
createRecommenderConfiguration_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Maybe Text
description :: Maybe Text
$sel:description:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Maybe Text
a -> CreateRecommenderConfiguration
s {$sel:description:CreateRecommenderConfiguration' :: Maybe Text
description = Maybe Text
a} :: CreateRecommenderConfiguration)

-- | A custom name of the configuration for the recommender model. The name
-- must start with a letter or number and it can contain up to 128
-- characters. The characters can be letters, numbers, spaces, underscores
-- (_), or hyphens (-).
createRecommenderConfiguration_name :: Lens.Lens' CreateRecommenderConfiguration (Prelude.Maybe Prelude.Text)
createRecommenderConfiguration_name :: Lens' CreateRecommenderConfiguration (Maybe Text)
createRecommenderConfiguration_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Maybe Text
name :: Maybe Text
$sel:name:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Maybe Text
a -> CreateRecommenderConfiguration
s {$sel:name:CreateRecommenderConfiguration' :: Maybe Text
name = Maybe Text
a} :: CreateRecommenderConfiguration)

-- | The type of Amazon Pinpoint ID to associate with unique user IDs in the
-- recommender model. This value enables the model to use attribute and
-- event data that’s specific to a particular endpoint or user in an Amazon
-- Pinpoint application. Valid values are:
--
-- -   PINPOINT_ENDPOINT_ID - Associate each user in the model with a
--     particular endpoint in Amazon Pinpoint. The data is correlated based
--     on endpoint IDs in Amazon Pinpoint. This is the default value.
--
-- -   PINPOINT_USER_ID - Associate each user in the model with a
--     particular user and endpoint in Amazon Pinpoint. The data is
--     correlated based on user IDs in Amazon Pinpoint. If you specify this
--     value, an endpoint definition in Amazon Pinpoint has to specify both
--     a user ID (UserId) and an endpoint ID. Otherwise, messages won’t be
--     sent to the user\'s endpoint.
createRecommenderConfiguration_recommendationProviderIdType :: Lens.Lens' CreateRecommenderConfiguration (Prelude.Maybe Prelude.Text)
createRecommenderConfiguration_recommendationProviderIdType :: Lens' CreateRecommenderConfiguration (Maybe Text)
createRecommenderConfiguration_recommendationProviderIdType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Maybe Text
recommendationProviderIdType :: Maybe Text
$sel:recommendationProviderIdType:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
recommendationProviderIdType} -> Maybe Text
recommendationProviderIdType) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Maybe Text
a -> CreateRecommenderConfiguration
s {$sel:recommendationProviderIdType:CreateRecommenderConfiguration' :: Maybe Text
recommendationProviderIdType = Maybe Text
a} :: CreateRecommenderConfiguration)

-- | The name or Amazon Resource Name (ARN) of the AWS Lambda function to
-- invoke for additional processing of recommendation data that\'s
-- retrieved from the recommender model.
createRecommenderConfiguration_recommendationTransformerUri :: Lens.Lens' CreateRecommenderConfiguration (Prelude.Maybe Prelude.Text)
createRecommenderConfiguration_recommendationTransformerUri :: Lens' CreateRecommenderConfiguration (Maybe Text)
createRecommenderConfiguration_recommendationTransformerUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Maybe Text
recommendationTransformerUri :: Maybe Text
$sel:recommendationTransformerUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
recommendationTransformerUri} -> Maybe Text
recommendationTransformerUri) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Maybe Text
a -> CreateRecommenderConfiguration
s {$sel:recommendationTransformerUri:CreateRecommenderConfiguration' :: Maybe Text
recommendationTransformerUri = Maybe Text
a} :: CreateRecommenderConfiguration)

-- | A custom display name for the standard endpoint or user attribute
-- (RecommendationItems) that temporarily stores recommended items for each
-- endpoint or user, depending on the value for the
-- RecommendationProviderIdType property. This value is required if the
-- configuration doesn\'t invoke an AWS Lambda function
-- (RecommendationTransformerUri) to perform additional processing of
-- recommendation data.
--
-- This name appears in the __Attribute finder__ of the template editor on
-- the Amazon Pinpoint console. The name can contain up to 25 characters.
-- The characters can be letters, numbers, spaces, underscores (_), or
-- hyphens (-). These restrictions don\'t apply to attribute values.
createRecommenderConfiguration_recommendationsDisplayName :: Lens.Lens' CreateRecommenderConfiguration (Prelude.Maybe Prelude.Text)
createRecommenderConfiguration_recommendationsDisplayName :: Lens' CreateRecommenderConfiguration (Maybe Text)
createRecommenderConfiguration_recommendationsDisplayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Maybe Text
recommendationsDisplayName :: Maybe Text
$sel:recommendationsDisplayName:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
recommendationsDisplayName} -> Maybe Text
recommendationsDisplayName) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Maybe Text
a -> CreateRecommenderConfiguration
s {$sel:recommendationsDisplayName:CreateRecommenderConfiguration' :: Maybe Text
recommendationsDisplayName = Maybe Text
a} :: CreateRecommenderConfiguration)

-- | The number of recommended items to retrieve from the model for each
-- endpoint or user, depending on the value for the
-- RecommendationProviderIdType property. This number determines how many
-- recommended items are available for use in message variables. The
-- minimum value is 1. The maximum value is 5. The default value is 5.
--
-- To use multiple recommended items and custom attributes with message
-- variables, you have to use an AWS Lambda function
-- (RecommendationTransformerUri) to perform additional processing of
-- recommendation data.
createRecommenderConfiguration_recommendationsPerMessage :: Lens.Lens' CreateRecommenderConfiguration (Prelude.Maybe Prelude.Int)
createRecommenderConfiguration_recommendationsPerMessage :: Lens' CreateRecommenderConfiguration (Maybe Int)
createRecommenderConfiguration_recommendationsPerMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Maybe Int
recommendationsPerMessage :: Maybe Int
$sel:recommendationsPerMessage:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Int
recommendationsPerMessage} -> Maybe Int
recommendationsPerMessage) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Maybe Int
a -> CreateRecommenderConfiguration
s {$sel:recommendationsPerMessage:CreateRecommenderConfiguration' :: Maybe Int
recommendationsPerMessage = Maybe Int
a} :: CreateRecommenderConfiguration)

-- | The Amazon Resource Name (ARN) of the recommender model to retrieve
-- recommendation data from. This value must match the ARN of an Amazon
-- Personalize campaign.
createRecommenderConfiguration_recommendationProviderUri :: Lens.Lens' CreateRecommenderConfiguration Prelude.Text
createRecommenderConfiguration_recommendationProviderUri :: Lens' CreateRecommenderConfiguration Text
createRecommenderConfiguration_recommendationProviderUri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Text
recommendationProviderUri :: Text
$sel:recommendationProviderUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
recommendationProviderUri} -> Text
recommendationProviderUri) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Text
a -> CreateRecommenderConfiguration
s {$sel:recommendationProviderUri:CreateRecommenderConfiguration' :: Text
recommendationProviderUri = Text
a} :: CreateRecommenderConfiguration)

-- | The Amazon Resource Name (ARN) of the AWS Identity and Access Management
-- (IAM) role that authorizes Amazon Pinpoint to retrieve recommendation
-- data from the recommender model.
createRecommenderConfiguration_recommendationProviderRoleArn :: Lens.Lens' CreateRecommenderConfiguration Prelude.Text
createRecommenderConfiguration_recommendationProviderRoleArn :: Lens' CreateRecommenderConfiguration Text
createRecommenderConfiguration_recommendationProviderRoleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateRecommenderConfiguration' {Text
recommendationProviderRoleArn :: Text
$sel:recommendationProviderRoleArn:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
recommendationProviderRoleArn} -> Text
recommendationProviderRoleArn) (\s :: CreateRecommenderConfiguration
s@CreateRecommenderConfiguration' {} Text
a -> CreateRecommenderConfiguration
s {$sel:recommendationProviderRoleArn:CreateRecommenderConfiguration' :: Text
recommendationProviderRoleArn = Text
a} :: CreateRecommenderConfiguration)

instance
  Prelude.Hashable
    CreateRecommenderConfiguration
  where
  hashWithSalt :: Int -> CreateRecommenderConfiguration -> Int
hashWithSalt
    Int
_salt
    CreateRecommenderConfiguration' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Text
recommendationProviderRoleArn :: Text
recommendationProviderUri :: Text
recommendationsPerMessage :: Maybe Int
recommendationsDisplayName :: Maybe Text
recommendationTransformerUri :: Maybe Text
recommendationProviderIdType :: Maybe Text
name :: Maybe Text
description :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:recommendationProviderRoleArn:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
$sel:recommendationProviderUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
$sel:recommendationsPerMessage:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Int
$sel:recommendationsDisplayName:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:recommendationTransformerUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:recommendationProviderIdType:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:name:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:description:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:attributes:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe (HashMap Text Text)
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
attributes
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommendationProviderIdType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommendationTransformerUri
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
recommendationsDisplayName
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
recommendationsPerMessage
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recommendationProviderUri
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
recommendationProviderRoleArn

instance
  Prelude.NFData
    CreateRecommenderConfiguration
  where
  rnf :: CreateRecommenderConfiguration -> ()
rnf CreateRecommenderConfiguration' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Text
recommendationProviderRoleArn :: Text
recommendationProviderUri :: Text
recommendationsPerMessage :: Maybe Int
recommendationsDisplayName :: Maybe Text
recommendationTransformerUri :: Maybe Text
recommendationProviderIdType :: Maybe Text
name :: Maybe Text
description :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:recommendationProviderRoleArn:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
$sel:recommendationProviderUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
$sel:recommendationsPerMessage:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Int
$sel:recommendationsDisplayName:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:recommendationTransformerUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:recommendationProviderIdType:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:name:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:description:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:attributes:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommendationProviderIdType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommendationTransformerUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
recommendationsDisplayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
recommendationsPerMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recommendationProviderUri
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
recommendationProviderRoleArn

instance Data.ToJSON CreateRecommenderConfiguration where
  toJSON :: CreateRecommenderConfiguration -> Value
toJSON CreateRecommenderConfiguration' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Text
recommendationProviderRoleArn :: Text
recommendationProviderUri :: Text
recommendationsPerMessage :: Maybe Int
recommendationsDisplayName :: Maybe Text
recommendationTransformerUri :: Maybe Text
recommendationProviderIdType :: Maybe Text
name :: Maybe Text
description :: Maybe Text
attributes :: Maybe (HashMap Text Text)
$sel:recommendationProviderRoleArn:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
$sel:recommendationProviderUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Text
$sel:recommendationsPerMessage:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Int
$sel:recommendationsDisplayName:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:recommendationTransformerUri:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:recommendationProviderIdType:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:name:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:description:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe Text
$sel:attributes:CreateRecommenderConfiguration' :: CreateRecommenderConfiguration -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Attributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
attributes,
            (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Key
"RecommendationProviderIdType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
recommendationProviderIdType,
            (Key
"RecommendationTransformerUri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
recommendationTransformerUri,
            (Key
"RecommendationsDisplayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
recommendationsDisplayName,
            (Key
"RecommendationsPerMessage" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
recommendationsPerMessage,
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"RecommendationProviderUri"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
recommendationProviderUri
              ),
            forall a. a -> Maybe a
Prelude.Just
              ( Key
"RecommendationProviderRoleArn"
                  forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
recommendationProviderRoleArn
              )
          ]
      )