{-# 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.IoTRoboRunner.Types.VendorProperties
-- 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.IoTRoboRunner.Types.VendorProperties 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

-- | Properties of the worker that are provided by the vendor FMS.
--
-- /See:/ 'newVendorProperties' smart constructor.
data VendorProperties = VendorProperties'
  { VendorProperties -> Maybe Text
vendorAdditionalFixedProperties :: Prelude.Maybe Prelude.Text,
    VendorProperties -> Maybe Text
vendorAdditionalTransientProperties :: Prelude.Maybe Prelude.Text,
    VendorProperties -> Maybe Text
vendorWorkerIpAddress :: Prelude.Maybe Prelude.Text,
    VendorProperties -> Text
vendorWorkerId :: Prelude.Text
  }
  deriving (VendorProperties -> VendorProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VendorProperties -> VendorProperties -> Bool
$c/= :: VendorProperties -> VendorProperties -> Bool
== :: VendorProperties -> VendorProperties -> Bool
$c== :: VendorProperties -> VendorProperties -> Bool
Prelude.Eq, ReadPrec [VendorProperties]
ReadPrec VendorProperties
Int -> ReadS VendorProperties
ReadS [VendorProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VendorProperties]
$creadListPrec :: ReadPrec [VendorProperties]
readPrec :: ReadPrec VendorProperties
$creadPrec :: ReadPrec VendorProperties
readList :: ReadS [VendorProperties]
$creadList :: ReadS [VendorProperties]
readsPrec :: Int -> ReadS VendorProperties
$creadsPrec :: Int -> ReadS VendorProperties
Prelude.Read, Int -> VendorProperties -> ShowS
[VendorProperties] -> ShowS
VendorProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VendorProperties] -> ShowS
$cshowList :: [VendorProperties] -> ShowS
show :: VendorProperties -> String
$cshow :: VendorProperties -> String
showsPrec :: Int -> VendorProperties -> ShowS
$cshowsPrec :: Int -> VendorProperties -> ShowS
Prelude.Show, forall x. Rep VendorProperties x -> VendorProperties
forall x. VendorProperties -> Rep VendorProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VendorProperties x -> VendorProperties
$cfrom :: forall x. VendorProperties -> Rep VendorProperties x
Prelude.Generic)

-- |
-- Create a value of 'VendorProperties' 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:
--
-- 'vendorAdditionalFixedProperties', 'vendorProperties_vendorAdditionalFixedProperties' - Undocumented member.
--
-- 'vendorAdditionalTransientProperties', 'vendorProperties_vendorAdditionalTransientProperties' - Undocumented member.
--
-- 'vendorWorkerIpAddress', 'vendorProperties_vendorWorkerIpAddress' - Undocumented member.
--
-- 'vendorWorkerId', 'vendorProperties_vendorWorkerId' - Undocumented member.
newVendorProperties ::
  -- | 'vendorWorkerId'
  Prelude.Text ->
  VendorProperties
newVendorProperties :: Text -> VendorProperties
newVendorProperties Text
pVendorWorkerId_ =
  VendorProperties'
    { $sel:vendorAdditionalFixedProperties:VendorProperties' :: Maybe Text
vendorAdditionalFixedProperties =
        forall a. Maybe a
Prelude.Nothing,
      $sel:vendorAdditionalTransientProperties:VendorProperties' :: Maybe Text
vendorAdditionalTransientProperties =
        forall a. Maybe a
Prelude.Nothing,
      $sel:vendorWorkerIpAddress:VendorProperties' :: Maybe Text
vendorWorkerIpAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:vendorWorkerId:VendorProperties' :: Text
vendorWorkerId = Text
pVendorWorkerId_
    }

-- | Undocumented member.
vendorProperties_vendorAdditionalFixedProperties :: Lens.Lens' VendorProperties (Prelude.Maybe Prelude.Text)
vendorProperties_vendorAdditionalFixedProperties :: Lens' VendorProperties (Maybe Text)
vendorProperties_vendorAdditionalFixedProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VendorProperties' {Maybe Text
vendorAdditionalFixedProperties :: Maybe Text
$sel:vendorAdditionalFixedProperties:VendorProperties' :: VendorProperties -> Maybe Text
vendorAdditionalFixedProperties} -> Maybe Text
vendorAdditionalFixedProperties) (\s :: VendorProperties
s@VendorProperties' {} Maybe Text
a -> VendorProperties
s {$sel:vendorAdditionalFixedProperties:VendorProperties' :: Maybe Text
vendorAdditionalFixedProperties = Maybe Text
a} :: VendorProperties)

-- | Undocumented member.
vendorProperties_vendorAdditionalTransientProperties :: Lens.Lens' VendorProperties (Prelude.Maybe Prelude.Text)
vendorProperties_vendorAdditionalTransientProperties :: Lens' VendorProperties (Maybe Text)
vendorProperties_vendorAdditionalTransientProperties = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VendorProperties' {Maybe Text
vendorAdditionalTransientProperties :: Maybe Text
$sel:vendorAdditionalTransientProperties:VendorProperties' :: VendorProperties -> Maybe Text
vendorAdditionalTransientProperties} -> Maybe Text
vendorAdditionalTransientProperties) (\s :: VendorProperties
s@VendorProperties' {} Maybe Text
a -> VendorProperties
s {$sel:vendorAdditionalTransientProperties:VendorProperties' :: Maybe Text
vendorAdditionalTransientProperties = Maybe Text
a} :: VendorProperties)

-- | Undocumented member.
vendorProperties_vendorWorkerIpAddress :: Lens.Lens' VendorProperties (Prelude.Maybe Prelude.Text)
vendorProperties_vendorWorkerIpAddress :: Lens' VendorProperties (Maybe Text)
vendorProperties_vendorWorkerIpAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VendorProperties' {Maybe Text
vendorWorkerIpAddress :: Maybe Text
$sel:vendorWorkerIpAddress:VendorProperties' :: VendorProperties -> Maybe Text
vendorWorkerIpAddress} -> Maybe Text
vendorWorkerIpAddress) (\s :: VendorProperties
s@VendorProperties' {} Maybe Text
a -> VendorProperties
s {$sel:vendorWorkerIpAddress:VendorProperties' :: Maybe Text
vendorWorkerIpAddress = Maybe Text
a} :: VendorProperties)

-- | Undocumented member.
vendorProperties_vendorWorkerId :: Lens.Lens' VendorProperties Prelude.Text
vendorProperties_vendorWorkerId :: Lens' VendorProperties Text
vendorProperties_vendorWorkerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VendorProperties' {Text
vendorWorkerId :: Text
$sel:vendorWorkerId:VendorProperties' :: VendorProperties -> Text
vendorWorkerId} -> Text
vendorWorkerId) (\s :: VendorProperties
s@VendorProperties' {} Text
a -> VendorProperties
s {$sel:vendorWorkerId:VendorProperties' :: Text
vendorWorkerId = Text
a} :: VendorProperties)

instance Data.FromJSON VendorProperties where
  parseJSON :: Value -> Parser VendorProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"VendorProperties"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> Text -> VendorProperties
VendorProperties'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"vendorAdditionalFixedProperties")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"vendorAdditionalTransientProperties")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"vendorWorkerIpAddress")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"vendorWorkerId")
      )

instance Prelude.Hashable VendorProperties where
  hashWithSalt :: Int -> VendorProperties -> Int
hashWithSalt Int
_salt VendorProperties' {Maybe Text
Text
vendorWorkerId :: Text
vendorWorkerIpAddress :: Maybe Text
vendorAdditionalTransientProperties :: Maybe Text
vendorAdditionalFixedProperties :: Maybe Text
$sel:vendorWorkerId:VendorProperties' :: VendorProperties -> Text
$sel:vendorWorkerIpAddress:VendorProperties' :: VendorProperties -> Maybe Text
$sel:vendorAdditionalTransientProperties:VendorProperties' :: VendorProperties -> Maybe Text
$sel:vendorAdditionalFixedProperties:VendorProperties' :: VendorProperties -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vendorAdditionalFixedProperties
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vendorAdditionalTransientProperties
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vendorWorkerIpAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vendorWorkerId

instance Prelude.NFData VendorProperties where
  rnf :: VendorProperties -> ()
rnf VendorProperties' {Maybe Text
Text
vendorWorkerId :: Text
vendorWorkerIpAddress :: Maybe Text
vendorAdditionalTransientProperties :: Maybe Text
vendorAdditionalFixedProperties :: Maybe Text
$sel:vendorWorkerId:VendorProperties' :: VendorProperties -> Text
$sel:vendorWorkerIpAddress:VendorProperties' :: VendorProperties -> Maybe Text
$sel:vendorAdditionalTransientProperties:VendorProperties' :: VendorProperties -> Maybe Text
$sel:vendorAdditionalFixedProperties:VendorProperties' :: VendorProperties -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vendorAdditionalFixedProperties
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vendorAdditionalTransientProperties
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vendorWorkerIpAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vendorWorkerId

instance Data.ToJSON VendorProperties where
  toJSON :: VendorProperties -> Value
toJSON VendorProperties' {Maybe Text
Text
vendorWorkerId :: Text
vendorWorkerIpAddress :: Maybe Text
vendorAdditionalTransientProperties :: Maybe Text
vendorAdditionalFixedProperties :: Maybe Text
$sel:vendorWorkerId:VendorProperties' :: VendorProperties -> Text
$sel:vendorWorkerIpAddress:VendorProperties' :: VendorProperties -> Maybe Text
$sel:vendorAdditionalTransientProperties:VendorProperties' :: VendorProperties -> Maybe Text
$sel:vendorAdditionalFixedProperties:VendorProperties' :: VendorProperties -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"vendorAdditionalFixedProperties" 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
vendorAdditionalFixedProperties,
            (Key
"vendorAdditionalTransientProperties" 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
vendorAdditionalTransientProperties,
            (Key
"vendorWorkerIpAddress" 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
vendorWorkerIpAddress,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"vendorWorkerId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
vendorWorkerId)
          ]
      )