{-# 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.SageMaker.Types.PropertyNameQuery
-- 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.SageMaker.Types.PropertyNameQuery where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Part of the @SuggestionQuery@ type. Specifies a hint for retrieving
-- property names that begin with the specified text.
--
-- /See:/ 'newPropertyNameQuery' smart constructor.
data PropertyNameQuery = PropertyNameQuery'
  { -- | Text that begins a property\'s name.
    PropertyNameQuery -> Text
propertyNameHint :: Prelude.Text
  }
  deriving (PropertyNameQuery -> PropertyNameQuery -> Bool
(PropertyNameQuery -> PropertyNameQuery -> Bool)
-> (PropertyNameQuery -> PropertyNameQuery -> Bool)
-> Eq PropertyNameQuery
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PropertyNameQuery -> PropertyNameQuery -> Bool
$c/= :: PropertyNameQuery -> PropertyNameQuery -> Bool
== :: PropertyNameQuery -> PropertyNameQuery -> Bool
$c== :: PropertyNameQuery -> PropertyNameQuery -> Bool
Prelude.Eq, ReadPrec [PropertyNameQuery]
ReadPrec PropertyNameQuery
Int -> ReadS PropertyNameQuery
ReadS [PropertyNameQuery]
(Int -> ReadS PropertyNameQuery)
-> ReadS [PropertyNameQuery]
-> ReadPrec PropertyNameQuery
-> ReadPrec [PropertyNameQuery]
-> Read PropertyNameQuery
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PropertyNameQuery]
$creadListPrec :: ReadPrec [PropertyNameQuery]
readPrec :: ReadPrec PropertyNameQuery
$creadPrec :: ReadPrec PropertyNameQuery
readList :: ReadS [PropertyNameQuery]
$creadList :: ReadS [PropertyNameQuery]
readsPrec :: Int -> ReadS PropertyNameQuery
$creadsPrec :: Int -> ReadS PropertyNameQuery
Prelude.Read, Int -> PropertyNameQuery -> ShowS
[PropertyNameQuery] -> ShowS
PropertyNameQuery -> String
(Int -> PropertyNameQuery -> ShowS)
-> (PropertyNameQuery -> String)
-> ([PropertyNameQuery] -> ShowS)
-> Show PropertyNameQuery
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PropertyNameQuery] -> ShowS
$cshowList :: [PropertyNameQuery] -> ShowS
show :: PropertyNameQuery -> String
$cshow :: PropertyNameQuery -> String
showsPrec :: Int -> PropertyNameQuery -> ShowS
$cshowsPrec :: Int -> PropertyNameQuery -> ShowS
Prelude.Show, (forall x. PropertyNameQuery -> Rep PropertyNameQuery x)
-> (forall x. Rep PropertyNameQuery x -> PropertyNameQuery)
-> Generic PropertyNameQuery
forall x. Rep PropertyNameQuery x -> PropertyNameQuery
forall x. PropertyNameQuery -> Rep PropertyNameQuery x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PropertyNameQuery x -> PropertyNameQuery
$cfrom :: forall x. PropertyNameQuery -> Rep PropertyNameQuery x
Prelude.Generic)

-- |
-- Create a value of 'PropertyNameQuery' 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:
--
-- 'propertyNameHint', 'propertyNameQuery_propertyNameHint' - Text that begins a property\'s name.
newPropertyNameQuery ::
  -- | 'propertyNameHint'
  Prelude.Text ->
  PropertyNameQuery
newPropertyNameQuery :: Text -> PropertyNameQuery
newPropertyNameQuery Text
pPropertyNameHint_ =
  PropertyNameQuery' :: Text -> PropertyNameQuery
PropertyNameQuery'
    { $sel:propertyNameHint:PropertyNameQuery' :: Text
propertyNameHint =
        Text
pPropertyNameHint_
    }

-- | Text that begins a property\'s name.
propertyNameQuery_propertyNameHint :: Lens.Lens' PropertyNameQuery Prelude.Text
propertyNameQuery_propertyNameHint :: (Text -> f Text) -> PropertyNameQuery -> f PropertyNameQuery
propertyNameQuery_propertyNameHint = (PropertyNameQuery -> Text)
-> (PropertyNameQuery -> Text -> PropertyNameQuery)
-> Lens PropertyNameQuery PropertyNameQuery Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PropertyNameQuery' {Text
propertyNameHint :: Text
$sel:propertyNameHint:PropertyNameQuery' :: PropertyNameQuery -> Text
propertyNameHint} -> Text
propertyNameHint) (\s :: PropertyNameQuery
s@PropertyNameQuery' {} Text
a -> PropertyNameQuery
s {$sel:propertyNameHint:PropertyNameQuery' :: Text
propertyNameHint = Text
a} :: PropertyNameQuery)

instance Prelude.Hashable PropertyNameQuery

instance Prelude.NFData PropertyNameQuery

instance Core.ToJSON PropertyNameQuery where
  toJSON :: PropertyNameQuery -> Value
toJSON PropertyNameQuery' {Text
propertyNameHint :: Text
$sel:propertyNameHint:PropertyNameQuery' :: PropertyNameQuery -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PropertyNameHint" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
propertyNameHint)
          ]
      )