{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.PropertyNameQuery 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

-- | 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
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]
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
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. 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'
    { $sel:propertyNameHint:PropertyNameQuery' :: Text
propertyNameHint =
        Text
pPropertyNameHint_
    }

-- | Text that begins a property\'s name.
propertyNameQuery_propertyNameHint :: Lens.Lens' PropertyNameQuery Prelude.Text
propertyNameQuery_propertyNameHint :: Lens' PropertyNameQuery Text
propertyNameQuery_propertyNameHint = 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 where
  hashWithSalt :: Int -> PropertyNameQuery -> Int
hashWithSalt Int
_salt PropertyNameQuery' {Text
propertyNameHint :: Text
$sel:propertyNameHint:PropertyNameQuery' :: PropertyNameQuery -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
propertyNameHint

instance Prelude.NFData PropertyNameQuery where
  rnf :: PropertyNameQuery -> ()
rnf PropertyNameQuery' {Text
propertyNameHint :: Text
$sel:propertyNameHint:PropertyNameQuery' :: PropertyNameQuery -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
propertyNameHint

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