{-# 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.DeviceFarm.Types.IncompatibilityMessage
-- 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.DeviceFarm.Types.IncompatibilityMessage where

import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types.DeviceAttribute
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Represents information about incompatibility.
--
-- /See:/ 'newIncompatibilityMessage' smart constructor.
data IncompatibilityMessage = IncompatibilityMessage'
  { -- | The type of incompatibility.
    --
    -- Allowed values include:
    --
    -- -   ARN
    --
    -- -   FORM_FACTOR (for example, phone or tablet)
    --
    -- -   MANUFACTURER
    --
    -- -   PLATFORM (for example, Android or iOS)
    --
    -- -   REMOTE_ACCESS_ENABLED
    --
    -- -   APPIUM_VERSION
    IncompatibilityMessage -> Maybe DeviceAttribute
type' :: Prelude.Maybe DeviceAttribute,
    -- | A message about the incompatibility.
    IncompatibilityMessage -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (IncompatibilityMessage -> IncompatibilityMessage -> Bool
(IncompatibilityMessage -> IncompatibilityMessage -> Bool)
-> (IncompatibilityMessage -> IncompatibilityMessage -> Bool)
-> Eq IncompatibilityMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IncompatibilityMessage -> IncompatibilityMessage -> Bool
$c/= :: IncompatibilityMessage -> IncompatibilityMessage -> Bool
== :: IncompatibilityMessage -> IncompatibilityMessage -> Bool
$c== :: IncompatibilityMessage -> IncompatibilityMessage -> Bool
Prelude.Eq, ReadPrec [IncompatibilityMessage]
ReadPrec IncompatibilityMessage
Int -> ReadS IncompatibilityMessage
ReadS [IncompatibilityMessage]
(Int -> ReadS IncompatibilityMessage)
-> ReadS [IncompatibilityMessage]
-> ReadPrec IncompatibilityMessage
-> ReadPrec [IncompatibilityMessage]
-> Read IncompatibilityMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IncompatibilityMessage]
$creadListPrec :: ReadPrec [IncompatibilityMessage]
readPrec :: ReadPrec IncompatibilityMessage
$creadPrec :: ReadPrec IncompatibilityMessage
readList :: ReadS [IncompatibilityMessage]
$creadList :: ReadS [IncompatibilityMessage]
readsPrec :: Int -> ReadS IncompatibilityMessage
$creadsPrec :: Int -> ReadS IncompatibilityMessage
Prelude.Read, Int -> IncompatibilityMessage -> ShowS
[IncompatibilityMessage] -> ShowS
IncompatibilityMessage -> String
(Int -> IncompatibilityMessage -> ShowS)
-> (IncompatibilityMessage -> String)
-> ([IncompatibilityMessage] -> ShowS)
-> Show IncompatibilityMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IncompatibilityMessage] -> ShowS
$cshowList :: [IncompatibilityMessage] -> ShowS
show :: IncompatibilityMessage -> String
$cshow :: IncompatibilityMessage -> String
showsPrec :: Int -> IncompatibilityMessage -> ShowS
$cshowsPrec :: Int -> IncompatibilityMessage -> ShowS
Prelude.Show, (forall x. IncompatibilityMessage -> Rep IncompatibilityMessage x)
-> (forall x.
    Rep IncompatibilityMessage x -> IncompatibilityMessage)
-> Generic IncompatibilityMessage
forall x. Rep IncompatibilityMessage x -> IncompatibilityMessage
forall x. IncompatibilityMessage -> Rep IncompatibilityMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IncompatibilityMessage x -> IncompatibilityMessage
$cfrom :: forall x. IncompatibilityMessage -> Rep IncompatibilityMessage x
Prelude.Generic)

-- |
-- Create a value of 'IncompatibilityMessage' 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:
--
-- 'type'', 'incompatibilityMessage_type' - The type of incompatibility.
--
-- Allowed values include:
--
-- -   ARN
--
-- -   FORM_FACTOR (for example, phone or tablet)
--
-- -   MANUFACTURER
--
-- -   PLATFORM (for example, Android or iOS)
--
-- -   REMOTE_ACCESS_ENABLED
--
-- -   APPIUM_VERSION
--
-- 'message', 'incompatibilityMessage_message' - A message about the incompatibility.
newIncompatibilityMessage ::
  IncompatibilityMessage
newIncompatibilityMessage :: IncompatibilityMessage
newIncompatibilityMessage =
  IncompatibilityMessage' :: Maybe DeviceAttribute -> Maybe Text -> IncompatibilityMessage
IncompatibilityMessage'
    { $sel:type':IncompatibilityMessage' :: Maybe DeviceAttribute
type' = Maybe DeviceAttribute
forall a. Maybe a
Prelude.Nothing,
      $sel:message:IncompatibilityMessage' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The type of incompatibility.
--
-- Allowed values include:
--
-- -   ARN
--
-- -   FORM_FACTOR (for example, phone or tablet)
--
-- -   MANUFACTURER
--
-- -   PLATFORM (for example, Android or iOS)
--
-- -   REMOTE_ACCESS_ENABLED
--
-- -   APPIUM_VERSION
incompatibilityMessage_type :: Lens.Lens' IncompatibilityMessage (Prelude.Maybe DeviceAttribute)
incompatibilityMessage_type :: (Maybe DeviceAttribute -> f (Maybe DeviceAttribute))
-> IncompatibilityMessage -> f IncompatibilityMessage
incompatibilityMessage_type = (IncompatibilityMessage -> Maybe DeviceAttribute)
-> (IncompatibilityMessage
    -> Maybe DeviceAttribute -> IncompatibilityMessage)
-> Lens
     IncompatibilityMessage
     IncompatibilityMessage
     (Maybe DeviceAttribute)
     (Maybe DeviceAttribute)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncompatibilityMessage' {Maybe DeviceAttribute
type' :: Maybe DeviceAttribute
$sel:type':IncompatibilityMessage' :: IncompatibilityMessage -> Maybe DeviceAttribute
type'} -> Maybe DeviceAttribute
type') (\s :: IncompatibilityMessage
s@IncompatibilityMessage' {} Maybe DeviceAttribute
a -> IncompatibilityMessage
s {$sel:type':IncompatibilityMessage' :: Maybe DeviceAttribute
type' = Maybe DeviceAttribute
a} :: IncompatibilityMessage)

-- | A message about the incompatibility.
incompatibilityMessage_message :: Lens.Lens' IncompatibilityMessage (Prelude.Maybe Prelude.Text)
incompatibilityMessage_message :: (Maybe Text -> f (Maybe Text))
-> IncompatibilityMessage -> f IncompatibilityMessage
incompatibilityMessage_message = (IncompatibilityMessage -> Maybe Text)
-> (IncompatibilityMessage -> Maybe Text -> IncompatibilityMessage)
-> Lens
     IncompatibilityMessage
     IncompatibilityMessage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IncompatibilityMessage' {Maybe Text
message :: Maybe Text
$sel:message:IncompatibilityMessage' :: IncompatibilityMessage -> Maybe Text
message} -> Maybe Text
message) (\s :: IncompatibilityMessage
s@IncompatibilityMessage' {} Maybe Text
a -> IncompatibilityMessage
s {$sel:message:IncompatibilityMessage' :: Maybe Text
message = Maybe Text
a} :: IncompatibilityMessage)

instance Core.FromJSON IncompatibilityMessage where
  parseJSON :: Value -> Parser IncompatibilityMessage
parseJSON =
    String
-> (Object -> Parser IncompatibilityMessage)
-> Value
-> Parser IncompatibilityMessage
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"IncompatibilityMessage"
      ( \Object
x ->
          Maybe DeviceAttribute -> Maybe Text -> IncompatibilityMessage
IncompatibilityMessage'
            (Maybe DeviceAttribute -> Maybe Text -> IncompatibilityMessage)
-> Parser (Maybe DeviceAttribute)
-> Parser (Maybe Text -> IncompatibilityMessage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe DeviceAttribute)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Text -> IncompatibilityMessage)
-> Parser (Maybe Text) -> Parser IncompatibilityMessage
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
"message")
      )

instance Prelude.Hashable IncompatibilityMessage

instance Prelude.NFData IncompatibilityMessage