{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetDevicePoolCompatibility
-- 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)
--
-- Gets information about compatibility with a device pool.
module Amazonka.DeviceFarm.GetDevicePoolCompatibility
  ( -- * Creating a Request
    GetDevicePoolCompatibility (..),
    newGetDevicePoolCompatibility,

    -- * Request Lenses
    getDevicePoolCompatibility_test,
    getDevicePoolCompatibility_appArn,
    getDevicePoolCompatibility_configuration,
    getDevicePoolCompatibility_testType,
    getDevicePoolCompatibility_devicePoolArn,

    -- * Destructuring the Response
    GetDevicePoolCompatibilityResponse (..),
    newGetDevicePoolCompatibilityResponse,

    -- * Response Lenses
    getDevicePoolCompatibilityResponse_incompatibleDevices,
    getDevicePoolCompatibilityResponse_compatibleDevices,
    getDevicePoolCompatibilityResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents a request to the get device pool compatibility operation.
--
-- /See:/ 'newGetDevicePoolCompatibility' smart constructor.
data GetDevicePoolCompatibility = GetDevicePoolCompatibility'
  { -- | Information about the uploaded test to be run against the device pool.
    GetDevicePoolCompatibility -> Maybe ScheduleRunTest
test :: Prelude.Maybe ScheduleRunTest,
    -- | The ARN of the app that is associated with the specified device pool.
    GetDevicePoolCompatibility -> Maybe Text
appArn :: Prelude.Maybe Prelude.Text,
    -- | An object that contains information about the settings for a run.
    GetDevicePoolCompatibility -> Maybe ScheduleRunConfiguration
configuration :: Prelude.Maybe ScheduleRunConfiguration,
    -- | The test type for the specified device pool.
    --
    -- Allowed values include the following:
    --
    -- -   BUILTIN_FUZZ.
    --
    -- -   BUILTIN_EXPLORER. For Android, an app explorer that traverses an
    --     Android app, interacting with it and capturing screenshots at the
    --     same time.
    --
    -- -   APPIUM_JAVA_JUNIT.
    --
    -- -   APPIUM_JAVA_TESTNG.
    --
    -- -   APPIUM_PYTHON.
    --
    -- -   APPIUM_NODE.
    --
    -- -   APPIUM_RUBY.
    --
    -- -   APPIUM_WEB_JAVA_JUNIT.
    --
    -- -   APPIUM_WEB_JAVA_TESTNG.
    --
    -- -   APPIUM_WEB_PYTHON.
    --
    -- -   APPIUM_WEB_NODE.
    --
    -- -   APPIUM_WEB_RUBY.
    --
    -- -   CALABASH.
    --
    -- -   INSTRUMENTATION.
    --
    -- -   UIAUTOMATION.
    --
    -- -   UIAUTOMATOR.
    --
    -- -   XCTEST.
    --
    -- -   XCTEST_UI.
    GetDevicePoolCompatibility -> Maybe TestType
testType :: Prelude.Maybe TestType,
    -- | The device pool\'s ARN.
    GetDevicePoolCompatibility -> Text
devicePoolArn :: Prelude.Text
  }
  deriving (GetDevicePoolCompatibility -> GetDevicePoolCompatibility -> Bool
(GetDevicePoolCompatibility -> GetDevicePoolCompatibility -> Bool)
-> (GetDevicePoolCompatibility
    -> GetDevicePoolCompatibility -> Bool)
-> Eq GetDevicePoolCompatibility
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDevicePoolCompatibility -> GetDevicePoolCompatibility -> Bool
$c/= :: GetDevicePoolCompatibility -> GetDevicePoolCompatibility -> Bool
== :: GetDevicePoolCompatibility -> GetDevicePoolCompatibility -> Bool
$c== :: GetDevicePoolCompatibility -> GetDevicePoolCompatibility -> Bool
Prelude.Eq, ReadPrec [GetDevicePoolCompatibility]
ReadPrec GetDevicePoolCompatibility
Int -> ReadS GetDevicePoolCompatibility
ReadS [GetDevicePoolCompatibility]
(Int -> ReadS GetDevicePoolCompatibility)
-> ReadS [GetDevicePoolCompatibility]
-> ReadPrec GetDevicePoolCompatibility
-> ReadPrec [GetDevicePoolCompatibility]
-> Read GetDevicePoolCompatibility
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDevicePoolCompatibility]
$creadListPrec :: ReadPrec [GetDevicePoolCompatibility]
readPrec :: ReadPrec GetDevicePoolCompatibility
$creadPrec :: ReadPrec GetDevicePoolCompatibility
readList :: ReadS [GetDevicePoolCompatibility]
$creadList :: ReadS [GetDevicePoolCompatibility]
readsPrec :: Int -> ReadS GetDevicePoolCompatibility
$creadsPrec :: Int -> ReadS GetDevicePoolCompatibility
Prelude.Read, Int -> GetDevicePoolCompatibility -> ShowS
[GetDevicePoolCompatibility] -> ShowS
GetDevicePoolCompatibility -> String
(Int -> GetDevicePoolCompatibility -> ShowS)
-> (GetDevicePoolCompatibility -> String)
-> ([GetDevicePoolCompatibility] -> ShowS)
-> Show GetDevicePoolCompatibility
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDevicePoolCompatibility] -> ShowS
$cshowList :: [GetDevicePoolCompatibility] -> ShowS
show :: GetDevicePoolCompatibility -> String
$cshow :: GetDevicePoolCompatibility -> String
showsPrec :: Int -> GetDevicePoolCompatibility -> ShowS
$cshowsPrec :: Int -> GetDevicePoolCompatibility -> ShowS
Prelude.Show, (forall x.
 GetDevicePoolCompatibility -> Rep GetDevicePoolCompatibility x)
-> (forall x.
    Rep GetDevicePoolCompatibility x -> GetDevicePoolCompatibility)
-> Generic GetDevicePoolCompatibility
forall x.
Rep GetDevicePoolCompatibility x -> GetDevicePoolCompatibility
forall x.
GetDevicePoolCompatibility -> Rep GetDevicePoolCompatibility x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDevicePoolCompatibility x -> GetDevicePoolCompatibility
$cfrom :: forall x.
GetDevicePoolCompatibility -> Rep GetDevicePoolCompatibility x
Prelude.Generic)

-- |
-- Create a value of 'GetDevicePoolCompatibility' 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:
--
-- 'test', 'getDevicePoolCompatibility_test' - Information about the uploaded test to be run against the device pool.
--
-- 'appArn', 'getDevicePoolCompatibility_appArn' - The ARN of the app that is associated with the specified device pool.
--
-- 'configuration', 'getDevicePoolCompatibility_configuration' - An object that contains information about the settings for a run.
--
-- 'testType', 'getDevicePoolCompatibility_testType' - The test type for the specified device pool.
--
-- Allowed values include the following:
--
-- -   BUILTIN_FUZZ.
--
-- -   BUILTIN_EXPLORER. For Android, an app explorer that traverses an
--     Android app, interacting with it and capturing screenshots at the
--     same time.
--
-- -   APPIUM_JAVA_JUNIT.
--
-- -   APPIUM_JAVA_TESTNG.
--
-- -   APPIUM_PYTHON.
--
-- -   APPIUM_NODE.
--
-- -   APPIUM_RUBY.
--
-- -   APPIUM_WEB_JAVA_JUNIT.
--
-- -   APPIUM_WEB_JAVA_TESTNG.
--
-- -   APPIUM_WEB_PYTHON.
--
-- -   APPIUM_WEB_NODE.
--
-- -   APPIUM_WEB_RUBY.
--
-- -   CALABASH.
--
-- -   INSTRUMENTATION.
--
-- -   UIAUTOMATION.
--
-- -   UIAUTOMATOR.
--
-- -   XCTEST.
--
-- -   XCTEST_UI.
--
-- 'devicePoolArn', 'getDevicePoolCompatibility_devicePoolArn' - The device pool\'s ARN.
newGetDevicePoolCompatibility ::
  -- | 'devicePoolArn'
  Prelude.Text ->
  GetDevicePoolCompatibility
newGetDevicePoolCompatibility :: Text -> GetDevicePoolCompatibility
newGetDevicePoolCompatibility Text
pDevicePoolArn_ =
  GetDevicePoolCompatibility' :: Maybe ScheduleRunTest
-> Maybe Text
-> Maybe ScheduleRunConfiguration
-> Maybe TestType
-> Text
-> GetDevicePoolCompatibility
GetDevicePoolCompatibility'
    { $sel:test:GetDevicePoolCompatibility' :: Maybe ScheduleRunTest
test = Maybe ScheduleRunTest
forall a. Maybe a
Prelude.Nothing,
      $sel:appArn:GetDevicePoolCompatibility' :: Maybe Text
appArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configuration:GetDevicePoolCompatibility' :: Maybe ScheduleRunConfiguration
configuration = Maybe ScheduleRunConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:testType:GetDevicePoolCompatibility' :: Maybe TestType
testType = Maybe TestType
forall a. Maybe a
Prelude.Nothing,
      $sel:devicePoolArn:GetDevicePoolCompatibility' :: Text
devicePoolArn = Text
pDevicePoolArn_
    }

-- | Information about the uploaded test to be run against the device pool.
getDevicePoolCompatibility_test :: Lens.Lens' GetDevicePoolCompatibility (Prelude.Maybe ScheduleRunTest)
getDevicePoolCompatibility_test :: (Maybe ScheduleRunTest -> f (Maybe ScheduleRunTest))
-> GetDevicePoolCompatibility -> f GetDevicePoolCompatibility
getDevicePoolCompatibility_test = (GetDevicePoolCompatibility -> Maybe ScheduleRunTest)
-> (GetDevicePoolCompatibility
    -> Maybe ScheduleRunTest -> GetDevicePoolCompatibility)
-> Lens
     GetDevicePoolCompatibility
     GetDevicePoolCompatibility
     (Maybe ScheduleRunTest)
     (Maybe ScheduleRunTest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibility' {Maybe ScheduleRunTest
test :: Maybe ScheduleRunTest
$sel:test:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe ScheduleRunTest
test} -> Maybe ScheduleRunTest
test) (\s :: GetDevicePoolCompatibility
s@GetDevicePoolCompatibility' {} Maybe ScheduleRunTest
a -> GetDevicePoolCompatibility
s {$sel:test:GetDevicePoolCompatibility' :: Maybe ScheduleRunTest
test = Maybe ScheduleRunTest
a} :: GetDevicePoolCompatibility)

-- | The ARN of the app that is associated with the specified device pool.
getDevicePoolCompatibility_appArn :: Lens.Lens' GetDevicePoolCompatibility (Prelude.Maybe Prelude.Text)
getDevicePoolCompatibility_appArn :: (Maybe Text -> f (Maybe Text))
-> GetDevicePoolCompatibility -> f GetDevicePoolCompatibility
getDevicePoolCompatibility_appArn = (GetDevicePoolCompatibility -> Maybe Text)
-> (GetDevicePoolCompatibility
    -> Maybe Text -> GetDevicePoolCompatibility)
-> Lens
     GetDevicePoolCompatibility
     GetDevicePoolCompatibility
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibility' {Maybe Text
appArn :: Maybe Text
$sel:appArn:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe Text
appArn} -> Maybe Text
appArn) (\s :: GetDevicePoolCompatibility
s@GetDevicePoolCompatibility' {} Maybe Text
a -> GetDevicePoolCompatibility
s {$sel:appArn:GetDevicePoolCompatibility' :: Maybe Text
appArn = Maybe Text
a} :: GetDevicePoolCompatibility)

-- | An object that contains information about the settings for a run.
getDevicePoolCompatibility_configuration :: Lens.Lens' GetDevicePoolCompatibility (Prelude.Maybe ScheduleRunConfiguration)
getDevicePoolCompatibility_configuration :: (Maybe ScheduleRunConfiguration
 -> f (Maybe ScheduleRunConfiguration))
-> GetDevicePoolCompatibility -> f GetDevicePoolCompatibility
getDevicePoolCompatibility_configuration = (GetDevicePoolCompatibility -> Maybe ScheduleRunConfiguration)
-> (GetDevicePoolCompatibility
    -> Maybe ScheduleRunConfiguration -> GetDevicePoolCompatibility)
-> Lens
     GetDevicePoolCompatibility
     GetDevicePoolCompatibility
     (Maybe ScheduleRunConfiguration)
     (Maybe ScheduleRunConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibility' {Maybe ScheduleRunConfiguration
configuration :: Maybe ScheduleRunConfiguration
$sel:configuration:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe ScheduleRunConfiguration
configuration} -> Maybe ScheduleRunConfiguration
configuration) (\s :: GetDevicePoolCompatibility
s@GetDevicePoolCompatibility' {} Maybe ScheduleRunConfiguration
a -> GetDevicePoolCompatibility
s {$sel:configuration:GetDevicePoolCompatibility' :: Maybe ScheduleRunConfiguration
configuration = Maybe ScheduleRunConfiguration
a} :: GetDevicePoolCompatibility)

-- | The test type for the specified device pool.
--
-- Allowed values include the following:
--
-- -   BUILTIN_FUZZ.
--
-- -   BUILTIN_EXPLORER. For Android, an app explorer that traverses an
--     Android app, interacting with it and capturing screenshots at the
--     same time.
--
-- -   APPIUM_JAVA_JUNIT.
--
-- -   APPIUM_JAVA_TESTNG.
--
-- -   APPIUM_PYTHON.
--
-- -   APPIUM_NODE.
--
-- -   APPIUM_RUBY.
--
-- -   APPIUM_WEB_JAVA_JUNIT.
--
-- -   APPIUM_WEB_JAVA_TESTNG.
--
-- -   APPIUM_WEB_PYTHON.
--
-- -   APPIUM_WEB_NODE.
--
-- -   APPIUM_WEB_RUBY.
--
-- -   CALABASH.
--
-- -   INSTRUMENTATION.
--
-- -   UIAUTOMATION.
--
-- -   UIAUTOMATOR.
--
-- -   XCTEST.
--
-- -   XCTEST_UI.
getDevicePoolCompatibility_testType :: Lens.Lens' GetDevicePoolCompatibility (Prelude.Maybe TestType)
getDevicePoolCompatibility_testType :: (Maybe TestType -> f (Maybe TestType))
-> GetDevicePoolCompatibility -> f GetDevicePoolCompatibility
getDevicePoolCompatibility_testType = (GetDevicePoolCompatibility -> Maybe TestType)
-> (GetDevicePoolCompatibility
    -> Maybe TestType -> GetDevicePoolCompatibility)
-> Lens
     GetDevicePoolCompatibility
     GetDevicePoolCompatibility
     (Maybe TestType)
     (Maybe TestType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibility' {Maybe TestType
testType :: Maybe TestType
$sel:testType:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe TestType
testType} -> Maybe TestType
testType) (\s :: GetDevicePoolCompatibility
s@GetDevicePoolCompatibility' {} Maybe TestType
a -> GetDevicePoolCompatibility
s {$sel:testType:GetDevicePoolCompatibility' :: Maybe TestType
testType = Maybe TestType
a} :: GetDevicePoolCompatibility)

-- | The device pool\'s ARN.
getDevicePoolCompatibility_devicePoolArn :: Lens.Lens' GetDevicePoolCompatibility Prelude.Text
getDevicePoolCompatibility_devicePoolArn :: (Text -> f Text)
-> GetDevicePoolCompatibility -> f GetDevicePoolCompatibility
getDevicePoolCompatibility_devicePoolArn = (GetDevicePoolCompatibility -> Text)
-> (GetDevicePoolCompatibility
    -> Text -> GetDevicePoolCompatibility)
-> Lens
     GetDevicePoolCompatibility GetDevicePoolCompatibility Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibility' {Text
devicePoolArn :: Text
$sel:devicePoolArn:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Text
devicePoolArn} -> Text
devicePoolArn) (\s :: GetDevicePoolCompatibility
s@GetDevicePoolCompatibility' {} Text
a -> GetDevicePoolCompatibility
s {$sel:devicePoolArn:GetDevicePoolCompatibility' :: Text
devicePoolArn = Text
a} :: GetDevicePoolCompatibility)

instance Core.AWSRequest GetDevicePoolCompatibility where
  type
    AWSResponse GetDevicePoolCompatibility =
      GetDevicePoolCompatibilityResponse
  request :: GetDevicePoolCompatibility -> Request GetDevicePoolCompatibility
request = Service
-> GetDevicePoolCompatibility -> Request GetDevicePoolCompatibility
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetDevicePoolCompatibility
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDevicePoolCompatibility)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetDevicePoolCompatibility))
-> Logger
-> Service
-> Proxy GetDevicePoolCompatibility
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetDevicePoolCompatibility)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [DevicePoolCompatibilityResult]
-> Maybe [DevicePoolCompatibilityResult]
-> Int
-> GetDevicePoolCompatibilityResponse
GetDevicePoolCompatibilityResponse'
            (Maybe [DevicePoolCompatibilityResult]
 -> Maybe [DevicePoolCompatibilityResult]
 -> Int
 -> GetDevicePoolCompatibilityResponse)
-> Either String (Maybe [DevicePoolCompatibilityResult])
-> Either
     String
     (Maybe [DevicePoolCompatibilityResult]
      -> Int -> GetDevicePoolCompatibilityResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [DevicePoolCompatibilityResult]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"incompatibleDevices"
                            Either String (Maybe (Maybe [DevicePoolCompatibilityResult]))
-> Maybe [DevicePoolCompatibilityResult]
-> Either String (Maybe [DevicePoolCompatibilityResult])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DevicePoolCompatibilityResult]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe [DevicePoolCompatibilityResult]
   -> Int -> GetDevicePoolCompatibilityResponse)
-> Either String (Maybe [DevicePoolCompatibilityResult])
-> Either String (Int -> GetDevicePoolCompatibilityResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [DevicePoolCompatibilityResult]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"compatibleDevices"
                            Either String (Maybe (Maybe [DevicePoolCompatibilityResult]))
-> Maybe [DevicePoolCompatibilityResult]
-> Either String (Maybe [DevicePoolCompatibilityResult])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DevicePoolCompatibilityResult]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> GetDevicePoolCompatibilityResponse)
-> Either String Int
-> Either String GetDevicePoolCompatibilityResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetDevicePoolCompatibility

instance Prelude.NFData GetDevicePoolCompatibility

instance Core.ToHeaders GetDevicePoolCompatibility where
  toHeaders :: GetDevicePoolCompatibility -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetDevicePoolCompatibility -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DeviceFarm_20150623.GetDevicePoolCompatibility" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetDevicePoolCompatibility where
  toJSON :: GetDevicePoolCompatibility -> Value
toJSON GetDevicePoolCompatibility' {Maybe Text
Maybe ScheduleRunConfiguration
Maybe TestType
Maybe ScheduleRunTest
Text
devicePoolArn :: Text
testType :: Maybe TestType
configuration :: Maybe ScheduleRunConfiguration
appArn :: Maybe Text
test :: Maybe ScheduleRunTest
$sel:devicePoolArn:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Text
$sel:testType:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe TestType
$sel:configuration:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe ScheduleRunConfiguration
$sel:appArn:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe Text
$sel:test:GetDevicePoolCompatibility' :: GetDevicePoolCompatibility -> Maybe ScheduleRunTest
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"test" Text -> ScheduleRunTest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ScheduleRunTest -> Pair) -> Maybe ScheduleRunTest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScheduleRunTest
test,
            (Text
"appArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appArn,
            (Text
"configuration" Text -> ScheduleRunConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ScheduleRunConfiguration -> Pair)
-> Maybe ScheduleRunConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScheduleRunConfiguration
configuration,
            (Text
"testType" Text -> TestType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TestType -> Pair) -> Maybe TestType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TestType
testType,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"devicePoolArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
devicePoolArn)
          ]
      )

instance Core.ToPath GetDevicePoolCompatibility where
  toPath :: GetDevicePoolCompatibility -> ByteString
toPath = ByteString -> GetDevicePoolCompatibility -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery GetDevicePoolCompatibility where
  toQuery :: GetDevicePoolCompatibility -> QueryString
toQuery = QueryString -> GetDevicePoolCompatibility -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | Represents the result of describe device pool compatibility request.
--
-- /See:/ 'newGetDevicePoolCompatibilityResponse' smart constructor.
data GetDevicePoolCompatibilityResponse = GetDevicePoolCompatibilityResponse'
  { -- | Information about incompatible devices.
    GetDevicePoolCompatibilityResponse
-> Maybe [DevicePoolCompatibilityResult]
incompatibleDevices :: Prelude.Maybe [DevicePoolCompatibilityResult],
    -- | Information about compatible devices.
    GetDevicePoolCompatibilityResponse
-> Maybe [DevicePoolCompatibilityResult]
compatibleDevices :: Prelude.Maybe [DevicePoolCompatibilityResult],
    -- | The response's http status code.
    GetDevicePoolCompatibilityResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetDevicePoolCompatibilityResponse
-> GetDevicePoolCompatibilityResponse -> Bool
(GetDevicePoolCompatibilityResponse
 -> GetDevicePoolCompatibilityResponse -> Bool)
-> (GetDevicePoolCompatibilityResponse
    -> GetDevicePoolCompatibilityResponse -> Bool)
-> Eq GetDevicePoolCompatibilityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDevicePoolCompatibilityResponse
-> GetDevicePoolCompatibilityResponse -> Bool
$c/= :: GetDevicePoolCompatibilityResponse
-> GetDevicePoolCompatibilityResponse -> Bool
== :: GetDevicePoolCompatibilityResponse
-> GetDevicePoolCompatibilityResponse -> Bool
$c== :: GetDevicePoolCompatibilityResponse
-> GetDevicePoolCompatibilityResponse -> Bool
Prelude.Eq, ReadPrec [GetDevicePoolCompatibilityResponse]
ReadPrec GetDevicePoolCompatibilityResponse
Int -> ReadS GetDevicePoolCompatibilityResponse
ReadS [GetDevicePoolCompatibilityResponse]
(Int -> ReadS GetDevicePoolCompatibilityResponse)
-> ReadS [GetDevicePoolCompatibilityResponse]
-> ReadPrec GetDevicePoolCompatibilityResponse
-> ReadPrec [GetDevicePoolCompatibilityResponse]
-> Read GetDevicePoolCompatibilityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDevicePoolCompatibilityResponse]
$creadListPrec :: ReadPrec [GetDevicePoolCompatibilityResponse]
readPrec :: ReadPrec GetDevicePoolCompatibilityResponse
$creadPrec :: ReadPrec GetDevicePoolCompatibilityResponse
readList :: ReadS [GetDevicePoolCompatibilityResponse]
$creadList :: ReadS [GetDevicePoolCompatibilityResponse]
readsPrec :: Int -> ReadS GetDevicePoolCompatibilityResponse
$creadsPrec :: Int -> ReadS GetDevicePoolCompatibilityResponse
Prelude.Read, Int -> GetDevicePoolCompatibilityResponse -> ShowS
[GetDevicePoolCompatibilityResponse] -> ShowS
GetDevicePoolCompatibilityResponse -> String
(Int -> GetDevicePoolCompatibilityResponse -> ShowS)
-> (GetDevicePoolCompatibilityResponse -> String)
-> ([GetDevicePoolCompatibilityResponse] -> ShowS)
-> Show GetDevicePoolCompatibilityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDevicePoolCompatibilityResponse] -> ShowS
$cshowList :: [GetDevicePoolCompatibilityResponse] -> ShowS
show :: GetDevicePoolCompatibilityResponse -> String
$cshow :: GetDevicePoolCompatibilityResponse -> String
showsPrec :: Int -> GetDevicePoolCompatibilityResponse -> ShowS
$cshowsPrec :: Int -> GetDevicePoolCompatibilityResponse -> ShowS
Prelude.Show, (forall x.
 GetDevicePoolCompatibilityResponse
 -> Rep GetDevicePoolCompatibilityResponse x)
-> (forall x.
    Rep GetDevicePoolCompatibilityResponse x
    -> GetDevicePoolCompatibilityResponse)
-> Generic GetDevicePoolCompatibilityResponse
forall x.
Rep GetDevicePoolCompatibilityResponse x
-> GetDevicePoolCompatibilityResponse
forall x.
GetDevicePoolCompatibilityResponse
-> Rep GetDevicePoolCompatibilityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDevicePoolCompatibilityResponse x
-> GetDevicePoolCompatibilityResponse
$cfrom :: forall x.
GetDevicePoolCompatibilityResponse
-> Rep GetDevicePoolCompatibilityResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetDevicePoolCompatibilityResponse' 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:
--
-- 'incompatibleDevices', 'getDevicePoolCompatibilityResponse_incompatibleDevices' - Information about incompatible devices.
--
-- 'compatibleDevices', 'getDevicePoolCompatibilityResponse_compatibleDevices' - Information about compatible devices.
--
-- 'httpStatus', 'getDevicePoolCompatibilityResponse_httpStatus' - The response's http status code.
newGetDevicePoolCompatibilityResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetDevicePoolCompatibilityResponse
newGetDevicePoolCompatibilityResponse :: Int -> GetDevicePoolCompatibilityResponse
newGetDevicePoolCompatibilityResponse Int
pHttpStatus_ =
  GetDevicePoolCompatibilityResponse' :: Maybe [DevicePoolCompatibilityResult]
-> Maybe [DevicePoolCompatibilityResult]
-> Int
-> GetDevicePoolCompatibilityResponse
GetDevicePoolCompatibilityResponse'
    { $sel:incompatibleDevices:GetDevicePoolCompatibilityResponse' :: Maybe [DevicePoolCompatibilityResult]
incompatibleDevices =
        Maybe [DevicePoolCompatibilityResult]
forall a. Maybe a
Prelude.Nothing,
      $sel:compatibleDevices:GetDevicePoolCompatibilityResponse' :: Maybe [DevicePoolCompatibilityResult]
compatibleDevices = Maybe [DevicePoolCompatibilityResult]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetDevicePoolCompatibilityResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about incompatible devices.
getDevicePoolCompatibilityResponse_incompatibleDevices :: Lens.Lens' GetDevicePoolCompatibilityResponse (Prelude.Maybe [DevicePoolCompatibilityResult])
getDevicePoolCompatibilityResponse_incompatibleDevices :: (Maybe [DevicePoolCompatibilityResult]
 -> f (Maybe [DevicePoolCompatibilityResult]))
-> GetDevicePoolCompatibilityResponse
-> f GetDevicePoolCompatibilityResponse
getDevicePoolCompatibilityResponse_incompatibleDevices = (GetDevicePoolCompatibilityResponse
 -> Maybe [DevicePoolCompatibilityResult])
-> (GetDevicePoolCompatibilityResponse
    -> Maybe [DevicePoolCompatibilityResult]
    -> GetDevicePoolCompatibilityResponse)
-> Lens
     GetDevicePoolCompatibilityResponse
     GetDevicePoolCompatibilityResponse
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibilityResponse' {Maybe [DevicePoolCompatibilityResult]
incompatibleDevices :: Maybe [DevicePoolCompatibilityResult]
$sel:incompatibleDevices:GetDevicePoolCompatibilityResponse' :: GetDevicePoolCompatibilityResponse
-> Maybe [DevicePoolCompatibilityResult]
incompatibleDevices} -> Maybe [DevicePoolCompatibilityResult]
incompatibleDevices) (\s :: GetDevicePoolCompatibilityResponse
s@GetDevicePoolCompatibilityResponse' {} Maybe [DevicePoolCompatibilityResult]
a -> GetDevicePoolCompatibilityResponse
s {$sel:incompatibleDevices:GetDevicePoolCompatibilityResponse' :: Maybe [DevicePoolCompatibilityResult]
incompatibleDevices = Maybe [DevicePoolCompatibilityResult]
a} :: GetDevicePoolCompatibilityResponse) ((Maybe [DevicePoolCompatibilityResult]
  -> f (Maybe [DevicePoolCompatibilityResult]))
 -> GetDevicePoolCompatibilityResponse
 -> f GetDevicePoolCompatibilityResponse)
-> ((Maybe [DevicePoolCompatibilityResult]
     -> f (Maybe [DevicePoolCompatibilityResult]))
    -> Maybe [DevicePoolCompatibilityResult]
    -> f (Maybe [DevicePoolCompatibilityResult]))
-> (Maybe [DevicePoolCompatibilityResult]
    -> f (Maybe [DevicePoolCompatibilityResult]))
-> GetDevicePoolCompatibilityResponse
-> f GetDevicePoolCompatibilityResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
-> Iso
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
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 AnIso
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about compatible devices.
getDevicePoolCompatibilityResponse_compatibleDevices :: Lens.Lens' GetDevicePoolCompatibilityResponse (Prelude.Maybe [DevicePoolCompatibilityResult])
getDevicePoolCompatibilityResponse_compatibleDevices :: (Maybe [DevicePoolCompatibilityResult]
 -> f (Maybe [DevicePoolCompatibilityResult]))
-> GetDevicePoolCompatibilityResponse
-> f GetDevicePoolCompatibilityResponse
getDevicePoolCompatibilityResponse_compatibleDevices = (GetDevicePoolCompatibilityResponse
 -> Maybe [DevicePoolCompatibilityResult])
-> (GetDevicePoolCompatibilityResponse
    -> Maybe [DevicePoolCompatibilityResult]
    -> GetDevicePoolCompatibilityResponse)
-> Lens
     GetDevicePoolCompatibilityResponse
     GetDevicePoolCompatibilityResponse
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibilityResponse' {Maybe [DevicePoolCompatibilityResult]
compatibleDevices :: Maybe [DevicePoolCompatibilityResult]
$sel:compatibleDevices:GetDevicePoolCompatibilityResponse' :: GetDevicePoolCompatibilityResponse
-> Maybe [DevicePoolCompatibilityResult]
compatibleDevices} -> Maybe [DevicePoolCompatibilityResult]
compatibleDevices) (\s :: GetDevicePoolCompatibilityResponse
s@GetDevicePoolCompatibilityResponse' {} Maybe [DevicePoolCompatibilityResult]
a -> GetDevicePoolCompatibilityResponse
s {$sel:compatibleDevices:GetDevicePoolCompatibilityResponse' :: Maybe [DevicePoolCompatibilityResult]
compatibleDevices = Maybe [DevicePoolCompatibilityResult]
a} :: GetDevicePoolCompatibilityResponse) ((Maybe [DevicePoolCompatibilityResult]
  -> f (Maybe [DevicePoolCompatibilityResult]))
 -> GetDevicePoolCompatibilityResponse
 -> f GetDevicePoolCompatibilityResponse)
-> ((Maybe [DevicePoolCompatibilityResult]
     -> f (Maybe [DevicePoolCompatibilityResult]))
    -> Maybe [DevicePoolCompatibilityResult]
    -> f (Maybe [DevicePoolCompatibilityResult]))
-> (Maybe [DevicePoolCompatibilityResult]
    -> f (Maybe [DevicePoolCompatibilityResult]))
-> GetDevicePoolCompatibilityResponse
-> f GetDevicePoolCompatibilityResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
-> Iso
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
     (Maybe [DevicePoolCompatibilityResult])
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 AnIso
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
  [DevicePoolCompatibilityResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
getDevicePoolCompatibilityResponse_httpStatus :: Lens.Lens' GetDevicePoolCompatibilityResponse Prelude.Int
getDevicePoolCompatibilityResponse_httpStatus :: (Int -> f Int)
-> GetDevicePoolCompatibilityResponse
-> f GetDevicePoolCompatibilityResponse
getDevicePoolCompatibilityResponse_httpStatus = (GetDevicePoolCompatibilityResponse -> Int)
-> (GetDevicePoolCompatibilityResponse
    -> Int -> GetDevicePoolCompatibilityResponse)
-> Lens
     GetDevicePoolCompatibilityResponse
     GetDevicePoolCompatibilityResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevicePoolCompatibilityResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDevicePoolCompatibilityResponse' :: GetDevicePoolCompatibilityResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDevicePoolCompatibilityResponse
s@GetDevicePoolCompatibilityResponse' {} Int
a -> GetDevicePoolCompatibilityResponse
s {$sel:httpStatus:GetDevicePoolCompatibilityResponse' :: Int
httpStatus = Int
a} :: GetDevicePoolCompatibilityResponse)

instance
  Prelude.NFData
    GetDevicePoolCompatibilityResponse