{-# 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.SMS.Types.Connector
-- 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.SMS.Types.Connector 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
import Amazonka.SMS.Types.ConnectorCapability
import Amazonka.SMS.Types.ConnectorStatus
import Amazonka.SMS.Types.VmManagerType

-- | Represents a connector.
--
-- /See:/ 'newConnector' smart constructor.
data Connector = Connector'
  { -- | The time the connector was associated.
    Connector -> Maybe POSIX
associatedOn :: Prelude.Maybe Data.POSIX,
    -- | The capabilities of the connector.
    Connector -> Maybe [ConnectorCapability]
capabilityList :: Prelude.Maybe [ConnectorCapability],
    -- | The ID of the connector.
    Connector -> Maybe Text
connectorId :: Prelude.Maybe Prelude.Text,
    -- | The IP address of the connector.
    Connector -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | The MAC address of the connector.
    Connector -> Maybe Text
macAddress :: Prelude.Maybe Prelude.Text,
    -- | The status of the connector.
    Connector -> Maybe ConnectorStatus
status :: Prelude.Maybe ConnectorStatus,
    -- | The connector version.
    Connector -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VM manager.
    Connector -> Maybe Text
vmManagerId :: Prelude.Maybe Prelude.Text,
    -- | The name of the VM manager.
    Connector -> Maybe Text
vmManagerName :: Prelude.Maybe Prelude.Text,
    -- | The VM management product.
    Connector -> Maybe VmManagerType
vmManagerType :: Prelude.Maybe VmManagerType
  }
  deriving (Connector -> Connector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Connector -> Connector -> Bool
$c/= :: Connector -> Connector -> Bool
== :: Connector -> Connector -> Bool
$c== :: Connector -> Connector -> Bool
Prelude.Eq, ReadPrec [Connector]
ReadPrec Connector
Int -> ReadS Connector
ReadS [Connector]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Connector]
$creadListPrec :: ReadPrec [Connector]
readPrec :: ReadPrec Connector
$creadPrec :: ReadPrec Connector
readList :: ReadS [Connector]
$creadList :: ReadS [Connector]
readsPrec :: Int -> ReadS Connector
$creadsPrec :: Int -> ReadS Connector
Prelude.Read, Int -> Connector -> ShowS
[Connector] -> ShowS
Connector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Connector] -> ShowS
$cshowList :: [Connector] -> ShowS
show :: Connector -> String
$cshow :: Connector -> String
showsPrec :: Int -> Connector -> ShowS
$cshowsPrec :: Int -> Connector -> ShowS
Prelude.Show, forall x. Rep Connector x -> Connector
forall x. Connector -> Rep Connector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Connector x -> Connector
$cfrom :: forall x. Connector -> Rep Connector x
Prelude.Generic)

-- |
-- Create a value of 'Connector' 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:
--
-- 'associatedOn', 'connector_associatedOn' - The time the connector was associated.
--
-- 'capabilityList', 'connector_capabilityList' - The capabilities of the connector.
--
-- 'connectorId', 'connector_connectorId' - The ID of the connector.
--
-- 'ipAddress', 'connector_ipAddress' - The IP address of the connector.
--
-- 'macAddress', 'connector_macAddress' - The MAC address of the connector.
--
-- 'status', 'connector_status' - The status of the connector.
--
-- 'version', 'connector_version' - The connector version.
--
-- 'vmManagerId', 'connector_vmManagerId' - The ID of the VM manager.
--
-- 'vmManagerName', 'connector_vmManagerName' - The name of the VM manager.
--
-- 'vmManagerType', 'connector_vmManagerType' - The VM management product.
newConnector ::
  Connector
newConnector :: Connector
newConnector =
  Connector'
    { $sel:associatedOn:Connector' :: Maybe POSIX
associatedOn = forall a. Maybe a
Prelude.Nothing,
      $sel:capabilityList:Connector' :: Maybe [ConnectorCapability]
capabilityList = forall a. Maybe a
Prelude.Nothing,
      $sel:connectorId:Connector' :: Maybe Text
connectorId = forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:Connector' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:macAddress:Connector' :: Maybe Text
macAddress = forall a. Maybe a
Prelude.Nothing,
      $sel:status:Connector' :: Maybe ConnectorStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:version:Connector' :: Maybe Text
version = forall a. Maybe a
Prelude.Nothing,
      $sel:vmManagerId:Connector' :: Maybe Text
vmManagerId = forall a. Maybe a
Prelude.Nothing,
      $sel:vmManagerName:Connector' :: Maybe Text
vmManagerName = forall a. Maybe a
Prelude.Nothing,
      $sel:vmManagerType:Connector' :: Maybe VmManagerType
vmManagerType = forall a. Maybe a
Prelude.Nothing
    }

-- | The time the connector was associated.
connector_associatedOn :: Lens.Lens' Connector (Prelude.Maybe Prelude.UTCTime)
connector_associatedOn :: Lens' Connector (Maybe UTCTime)
connector_associatedOn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe POSIX
associatedOn :: Maybe POSIX
$sel:associatedOn:Connector' :: Connector -> Maybe POSIX
associatedOn} -> Maybe POSIX
associatedOn) (\s :: Connector
s@Connector' {} Maybe POSIX
a -> Connector
s {$sel:associatedOn:Connector' :: Maybe POSIX
associatedOn = Maybe POSIX
a} :: Connector) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The capabilities of the connector.
connector_capabilityList :: Lens.Lens' Connector (Prelude.Maybe [ConnectorCapability])
connector_capabilityList :: Lens' Connector (Maybe [ConnectorCapability])
connector_capabilityList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe [ConnectorCapability]
capabilityList :: Maybe [ConnectorCapability]
$sel:capabilityList:Connector' :: Connector -> Maybe [ConnectorCapability]
capabilityList} -> Maybe [ConnectorCapability]
capabilityList) (\s :: Connector
s@Connector' {} Maybe [ConnectorCapability]
a -> Connector
s {$sel:capabilityList:Connector' :: Maybe [ConnectorCapability]
capabilityList = Maybe [ConnectorCapability]
a} :: Connector) 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

-- | The ID of the connector.
connector_connectorId :: Lens.Lens' Connector (Prelude.Maybe Prelude.Text)
connector_connectorId :: Lens' Connector (Maybe Text)
connector_connectorId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe Text
connectorId :: Maybe Text
$sel:connectorId:Connector' :: Connector -> Maybe Text
connectorId} -> Maybe Text
connectorId) (\s :: Connector
s@Connector' {} Maybe Text
a -> Connector
s {$sel:connectorId:Connector' :: Maybe Text
connectorId = Maybe Text
a} :: Connector)

-- | The IP address of the connector.
connector_ipAddress :: Lens.Lens' Connector (Prelude.Maybe Prelude.Text)
connector_ipAddress :: Lens' Connector (Maybe Text)
connector_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:Connector' :: Connector -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: Connector
s@Connector' {} Maybe Text
a -> Connector
s {$sel:ipAddress:Connector' :: Maybe Text
ipAddress = Maybe Text
a} :: Connector)

-- | The MAC address of the connector.
connector_macAddress :: Lens.Lens' Connector (Prelude.Maybe Prelude.Text)
connector_macAddress :: Lens' Connector (Maybe Text)
connector_macAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe Text
macAddress :: Maybe Text
$sel:macAddress:Connector' :: Connector -> Maybe Text
macAddress} -> Maybe Text
macAddress) (\s :: Connector
s@Connector' {} Maybe Text
a -> Connector
s {$sel:macAddress:Connector' :: Maybe Text
macAddress = Maybe Text
a} :: Connector)

-- | The status of the connector.
connector_status :: Lens.Lens' Connector (Prelude.Maybe ConnectorStatus)
connector_status :: Lens' Connector (Maybe ConnectorStatus)
connector_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe ConnectorStatus
status :: Maybe ConnectorStatus
$sel:status:Connector' :: Connector -> Maybe ConnectorStatus
status} -> Maybe ConnectorStatus
status) (\s :: Connector
s@Connector' {} Maybe ConnectorStatus
a -> Connector
s {$sel:status:Connector' :: Maybe ConnectorStatus
status = Maybe ConnectorStatus
a} :: Connector)

-- | The connector version.
connector_version :: Lens.Lens' Connector (Prelude.Maybe Prelude.Text)
connector_version :: Lens' Connector (Maybe Text)
connector_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe Text
version :: Maybe Text
$sel:version:Connector' :: Connector -> Maybe Text
version} -> Maybe Text
version) (\s :: Connector
s@Connector' {} Maybe Text
a -> Connector
s {$sel:version:Connector' :: Maybe Text
version = Maybe Text
a} :: Connector)

-- | The ID of the VM manager.
connector_vmManagerId :: Lens.Lens' Connector (Prelude.Maybe Prelude.Text)
connector_vmManagerId :: Lens' Connector (Maybe Text)
connector_vmManagerId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe Text
vmManagerId :: Maybe Text
$sel:vmManagerId:Connector' :: Connector -> Maybe Text
vmManagerId} -> Maybe Text
vmManagerId) (\s :: Connector
s@Connector' {} Maybe Text
a -> Connector
s {$sel:vmManagerId:Connector' :: Maybe Text
vmManagerId = Maybe Text
a} :: Connector)

-- | The name of the VM manager.
connector_vmManagerName :: Lens.Lens' Connector (Prelude.Maybe Prelude.Text)
connector_vmManagerName :: Lens' Connector (Maybe Text)
connector_vmManagerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe Text
vmManagerName :: Maybe Text
$sel:vmManagerName:Connector' :: Connector -> Maybe Text
vmManagerName} -> Maybe Text
vmManagerName) (\s :: Connector
s@Connector' {} Maybe Text
a -> Connector
s {$sel:vmManagerName:Connector' :: Maybe Text
vmManagerName = Maybe Text
a} :: Connector)

-- | The VM management product.
connector_vmManagerType :: Lens.Lens' Connector (Prelude.Maybe VmManagerType)
connector_vmManagerType :: Lens' Connector (Maybe VmManagerType)
connector_vmManagerType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connector' {Maybe VmManagerType
vmManagerType :: Maybe VmManagerType
$sel:vmManagerType:Connector' :: Connector -> Maybe VmManagerType
vmManagerType} -> Maybe VmManagerType
vmManagerType) (\s :: Connector
s@Connector' {} Maybe VmManagerType
a -> Connector
s {$sel:vmManagerType:Connector' :: Maybe VmManagerType
vmManagerType = Maybe VmManagerType
a} :: Connector)

instance Data.FromJSON Connector where
  parseJSON :: Value -> Parser Connector
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Connector"
      ( \Object
x ->
          Maybe POSIX
-> Maybe [ConnectorCapability]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConnectorStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe VmManagerType
-> Connector
Connector'
            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
"associatedOn")
            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
"capabilityList" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"connectorId")
            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
"ipAddress")
            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
"macAddress")
            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
"status")
            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
"version")
            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
"vmManagerId")
            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
"vmManagerName")
            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
"vmManagerType")
      )

instance Prelude.Hashable Connector where
  hashWithSalt :: Int -> Connector -> Int
hashWithSalt Int
_salt Connector' {Maybe [ConnectorCapability]
Maybe Text
Maybe POSIX
Maybe ConnectorStatus
Maybe VmManagerType
vmManagerType :: Maybe VmManagerType
vmManagerName :: Maybe Text
vmManagerId :: Maybe Text
version :: Maybe Text
status :: Maybe ConnectorStatus
macAddress :: Maybe Text
ipAddress :: Maybe Text
connectorId :: Maybe Text
capabilityList :: Maybe [ConnectorCapability]
associatedOn :: Maybe POSIX
$sel:vmManagerType:Connector' :: Connector -> Maybe VmManagerType
$sel:vmManagerName:Connector' :: Connector -> Maybe Text
$sel:vmManagerId:Connector' :: Connector -> Maybe Text
$sel:version:Connector' :: Connector -> Maybe Text
$sel:status:Connector' :: Connector -> Maybe ConnectorStatus
$sel:macAddress:Connector' :: Connector -> Maybe Text
$sel:ipAddress:Connector' :: Connector -> Maybe Text
$sel:connectorId:Connector' :: Connector -> Maybe Text
$sel:capabilityList:Connector' :: Connector -> Maybe [ConnectorCapability]
$sel:associatedOn:Connector' :: Connector -> Maybe POSIX
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
associatedOn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [ConnectorCapability]
capabilityList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectorId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
macAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConnectorStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
version
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vmManagerId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vmManagerName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VmManagerType
vmManagerType

instance Prelude.NFData Connector where
  rnf :: Connector -> ()
rnf Connector' {Maybe [ConnectorCapability]
Maybe Text
Maybe POSIX
Maybe ConnectorStatus
Maybe VmManagerType
vmManagerType :: Maybe VmManagerType
vmManagerName :: Maybe Text
vmManagerId :: Maybe Text
version :: Maybe Text
status :: Maybe ConnectorStatus
macAddress :: Maybe Text
ipAddress :: Maybe Text
connectorId :: Maybe Text
capabilityList :: Maybe [ConnectorCapability]
associatedOn :: Maybe POSIX
$sel:vmManagerType:Connector' :: Connector -> Maybe VmManagerType
$sel:vmManagerName:Connector' :: Connector -> Maybe Text
$sel:vmManagerId:Connector' :: Connector -> Maybe Text
$sel:version:Connector' :: Connector -> Maybe Text
$sel:status:Connector' :: Connector -> Maybe ConnectorStatus
$sel:macAddress:Connector' :: Connector -> Maybe Text
$sel:ipAddress:Connector' :: Connector -> Maybe Text
$sel:connectorId:Connector' :: Connector -> Maybe Text
$sel:capabilityList:Connector' :: Connector -> Maybe [ConnectorCapability]
$sel:associatedOn:Connector' :: Connector -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
associatedOn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ConnectorCapability]
capabilityList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectorId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
macAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectorStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
version
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vmManagerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vmManagerName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VmManagerType
vmManagerType