{-# 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.IoTWireless.Types.ServiceProfile
-- 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.IoTWireless.Types.ServiceProfile where

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

-- | Information about a service profile.
--
-- /See:/ 'newServiceProfile' smart constructor.
data ServiceProfile = ServiceProfile'
  { -- | The Amazon Resource Name of the resource.
    ServiceProfile -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the resource.
    ServiceProfile -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the service profile.
    ServiceProfile -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceProfile -> ServiceProfile -> Bool
(ServiceProfile -> ServiceProfile -> Bool)
-> (ServiceProfile -> ServiceProfile -> Bool) -> Eq ServiceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceProfile -> ServiceProfile -> Bool
$c/= :: ServiceProfile -> ServiceProfile -> Bool
== :: ServiceProfile -> ServiceProfile -> Bool
$c== :: ServiceProfile -> ServiceProfile -> Bool
Prelude.Eq, ReadPrec [ServiceProfile]
ReadPrec ServiceProfile
Int -> ReadS ServiceProfile
ReadS [ServiceProfile]
(Int -> ReadS ServiceProfile)
-> ReadS [ServiceProfile]
-> ReadPrec ServiceProfile
-> ReadPrec [ServiceProfile]
-> Read ServiceProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceProfile]
$creadListPrec :: ReadPrec [ServiceProfile]
readPrec :: ReadPrec ServiceProfile
$creadPrec :: ReadPrec ServiceProfile
readList :: ReadS [ServiceProfile]
$creadList :: ReadS [ServiceProfile]
readsPrec :: Int -> ReadS ServiceProfile
$creadsPrec :: Int -> ReadS ServiceProfile
Prelude.Read, Int -> ServiceProfile -> ShowS
[ServiceProfile] -> ShowS
ServiceProfile -> String
(Int -> ServiceProfile -> ShowS)
-> (ServiceProfile -> String)
-> ([ServiceProfile] -> ShowS)
-> Show ServiceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceProfile] -> ShowS
$cshowList :: [ServiceProfile] -> ShowS
show :: ServiceProfile -> String
$cshow :: ServiceProfile -> String
showsPrec :: Int -> ServiceProfile -> ShowS
$cshowsPrec :: Int -> ServiceProfile -> ShowS
Prelude.Show, (forall x. ServiceProfile -> Rep ServiceProfile x)
-> (forall x. Rep ServiceProfile x -> ServiceProfile)
-> Generic ServiceProfile
forall x. Rep ServiceProfile x -> ServiceProfile
forall x. ServiceProfile -> Rep ServiceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceProfile x -> ServiceProfile
$cfrom :: forall x. ServiceProfile -> Rep ServiceProfile x
Prelude.Generic)

-- |
-- Create a value of 'ServiceProfile' 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:
--
-- 'arn', 'serviceProfile_arn' - The Amazon Resource Name of the resource.
--
-- 'name', 'serviceProfile_name' - The name of the resource.
--
-- 'id', 'serviceProfile_id' - The ID of the service profile.
newServiceProfile ::
  ServiceProfile
newServiceProfile :: ServiceProfile
newServiceProfile =
  ServiceProfile' :: Maybe Text -> Maybe Text -> Maybe Text -> ServiceProfile
ServiceProfile'
    { $sel:arn:ServiceProfile' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ServiceProfile' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ServiceProfile' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name of the resource.
serviceProfile_arn :: Lens.Lens' ServiceProfile (Prelude.Maybe Prelude.Text)
serviceProfile_arn :: (Maybe Text -> f (Maybe Text))
-> ServiceProfile -> f ServiceProfile
serviceProfile_arn = (ServiceProfile -> Maybe Text)
-> (ServiceProfile -> Maybe Text -> ServiceProfile)
-> Lens ServiceProfile ServiceProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceProfile' {Maybe Text
arn :: Maybe Text
$sel:arn:ServiceProfile' :: ServiceProfile -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ServiceProfile
s@ServiceProfile' {} Maybe Text
a -> ServiceProfile
s {$sel:arn:ServiceProfile' :: Maybe Text
arn = Maybe Text
a} :: ServiceProfile)

-- | The name of the resource.
serviceProfile_name :: Lens.Lens' ServiceProfile (Prelude.Maybe Prelude.Text)
serviceProfile_name :: (Maybe Text -> f (Maybe Text))
-> ServiceProfile -> f ServiceProfile
serviceProfile_name = (ServiceProfile -> Maybe Text)
-> (ServiceProfile -> Maybe Text -> ServiceProfile)
-> Lens ServiceProfile ServiceProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceProfile' {Maybe Text
name :: Maybe Text
$sel:name:ServiceProfile' :: ServiceProfile -> Maybe Text
name} -> Maybe Text
name) (\s :: ServiceProfile
s@ServiceProfile' {} Maybe Text
a -> ServiceProfile
s {$sel:name:ServiceProfile' :: Maybe Text
name = Maybe Text
a} :: ServiceProfile)

-- | The ID of the service profile.
serviceProfile_id :: Lens.Lens' ServiceProfile (Prelude.Maybe Prelude.Text)
serviceProfile_id :: (Maybe Text -> f (Maybe Text))
-> ServiceProfile -> f ServiceProfile
serviceProfile_id = (ServiceProfile -> Maybe Text)
-> (ServiceProfile -> Maybe Text -> ServiceProfile)
-> Lens ServiceProfile ServiceProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceProfile' {Maybe Text
id :: Maybe Text
$sel:id:ServiceProfile' :: ServiceProfile -> Maybe Text
id} -> Maybe Text
id) (\s :: ServiceProfile
s@ServiceProfile' {} Maybe Text
a -> ServiceProfile
s {$sel:id:ServiceProfile' :: Maybe Text
id = Maybe Text
a} :: ServiceProfile)

instance Core.FromJSON ServiceProfile where
  parseJSON :: Value -> Parser ServiceProfile
parseJSON =
    String
-> (Object -> Parser ServiceProfile)
-> Value
-> Parser ServiceProfile
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ServiceProfile"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ServiceProfile
ServiceProfile'
            (Maybe Text -> Maybe Text -> Maybe Text -> ServiceProfile)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ServiceProfile)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser (Maybe Text -> Maybe Text -> ServiceProfile)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ServiceProfile)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> ServiceProfile)
-> Parser (Maybe Text) -> Parser ServiceProfile
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
      )

instance Prelude.Hashable ServiceProfile

instance Prelude.NFData ServiceProfile