{-# 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-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)
module Amazonka.Pinpoint.Types.CreateRecommenderConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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'
  { -- | 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 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,
    -- | 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 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,
    -- | 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,
    -- | 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
(CreateRecommenderConfiguration
 -> CreateRecommenderConfiguration -> Bool)
-> (CreateRecommenderConfiguration
    -> CreateRecommenderConfiguration -> Bool)
-> Eq CreateRecommenderConfiguration
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]
(Int -> ReadS CreateRecommenderConfiguration)
-> ReadS [CreateRecommenderConfiguration]
-> ReadPrec CreateRecommenderConfiguration
-> ReadPrec [CreateRecommenderConfiguration]
-> Read 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
(Int -> CreateRecommenderConfiguration -> ShowS)
-> (CreateRecommenderConfiguration -> String)
-> ([CreateRecommenderConfiguration] -> ShowS)
-> Show CreateRecommenderConfiguration
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.
 CreateRecommenderConfiguration
 -> Rep CreateRecommenderConfiguration x)
-> (forall x.
    Rep CreateRecommenderConfiguration x
    -> CreateRecommenderConfiguration)
-> Generic CreateRecommenderConfiguration
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:
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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 (-).
--
-- '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: _ ; () , ‐.
--
-- '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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> Text
-> CreateRecommenderConfiguration
CreateRecommenderConfiguration'
      { $sel:recommendationTransformerUri:CreateRecommenderConfiguration' :: Maybe Text
recommendationTransformerUri =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationsDisplayName:CreateRecommenderConfiguration' :: Maybe Text
recommendationsDisplayName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationProviderIdType:CreateRecommenderConfiguration' :: Maybe Text
recommendationProviderIdType =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:attributes:CreateRecommenderConfiguration' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateRecommenderConfiguration' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateRecommenderConfiguration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationsPerMessage:CreateRecommenderConfiguration' :: Maybe Int
recommendationsPerMessage = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:recommendationProviderUri:CreateRecommenderConfiguration' :: Text
recommendationProviderUri =
          Text
pRecommendationProviderUri_,
        $sel:recommendationProviderRoleArn:CreateRecommenderConfiguration' :: Text
recommendationProviderRoleArn =
          Text
pRecommendationProviderRoleArn_
      }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_recommendationTransformerUri = (CreateRecommenderConfiguration -> Maybe Text)
-> (CreateRecommenderConfiguration
    -> Maybe Text -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     (Maybe Text)
     (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_recommendationsDisplayName = (CreateRecommenderConfiguration -> Maybe Text)
-> (CreateRecommenderConfiguration
    -> Maybe Text -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     (Maybe Text)
     (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_recommendationProviderIdType = (CreateRecommenderConfiguration -> Maybe Text)
-> (CreateRecommenderConfiguration
    -> Maybe Text -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_attributes = (CreateRecommenderConfiguration -> Maybe (HashMap Text Text))
-> (CreateRecommenderConfiguration
    -> Maybe (HashMap Text Text) -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateRecommenderConfiguration
 -> f CreateRecommenderConfiguration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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 Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_name = (CreateRecommenderConfiguration -> Maybe Text)
-> (CreateRecommenderConfiguration
    -> Maybe Text -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_description = (CreateRecommenderConfiguration -> Maybe Text)
-> (CreateRecommenderConfiguration
    -> Maybe Text -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Int -> f (Maybe Int))
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_recommendationsPerMessage = (CreateRecommenderConfiguration -> Maybe Int)
-> (CreateRecommenderConfiguration
    -> Maybe Int -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     (Maybe Int)
     (Maybe Int)
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 :: (Text -> f Text)
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_recommendationProviderUri = (CreateRecommenderConfiguration -> Text)
-> (CreateRecommenderConfiguration
    -> Text -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     Text
     Text
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 :: (Text -> f Text)
-> CreateRecommenderConfiguration
-> f CreateRecommenderConfiguration
createRecommenderConfiguration_recommendationProviderRoleArn = (CreateRecommenderConfiguration -> Text)
-> (CreateRecommenderConfiguration
    -> Text -> CreateRecommenderConfiguration)
-> Lens
     CreateRecommenderConfiguration
     CreateRecommenderConfiguration
     Text
     Text
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

instance
  Prelude.NFData
    CreateRecommenderConfiguration

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