{-# 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 #-}
module Amazonka.DeviceFarm.Types.Sample where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types.SampleType
import qualified Amazonka.Prelude as Prelude
data Sample = Sample'
{
Sample -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Sample -> Maybe SampleType
type' :: Prelude.Maybe SampleType,
Sample -> Maybe Text
url :: Prelude.Maybe Prelude.Text
}
deriving (Sample -> Sample -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Sample -> Sample -> Bool
$c/= :: Sample -> Sample -> Bool
== :: Sample -> Sample -> Bool
$c== :: Sample -> Sample -> Bool
Prelude.Eq, ReadPrec [Sample]
ReadPrec Sample
Int -> ReadS Sample
ReadS [Sample]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Sample]
$creadListPrec :: ReadPrec [Sample]
readPrec :: ReadPrec Sample
$creadPrec :: ReadPrec Sample
readList :: ReadS [Sample]
$creadList :: ReadS [Sample]
readsPrec :: Int -> ReadS Sample
$creadsPrec :: Int -> ReadS Sample
Prelude.Read, Int -> Sample -> ShowS
[Sample] -> ShowS
Sample -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Sample] -> ShowS
$cshowList :: [Sample] -> ShowS
show :: Sample -> String
$cshow :: Sample -> String
showsPrec :: Int -> Sample -> ShowS
$cshowsPrec :: Int -> Sample -> ShowS
Prelude.Show, forall x. Rep Sample x -> Sample
forall x. Sample -> Rep Sample x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Sample x -> Sample
$cfrom :: forall x. Sample -> Rep Sample x
Prelude.Generic)
newSample ::
Sample
newSample :: Sample
newSample =
Sample'
{ $sel:arn:Sample' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:type':Sample' :: Maybe SampleType
type' = forall a. Maybe a
Prelude.Nothing,
$sel:url:Sample' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing
}
sample_arn :: Lens.Lens' Sample (Prelude.Maybe Prelude.Text)
sample_arn :: Lens' Sample (Maybe Text)
sample_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Sample' {Maybe Text
arn :: Maybe Text
$sel:arn:Sample' :: Sample -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Sample
s@Sample' {} Maybe Text
a -> Sample
s {$sel:arn:Sample' :: Maybe Text
arn = Maybe Text
a} :: Sample)
sample_type :: Lens.Lens' Sample (Prelude.Maybe SampleType)
sample_type :: Lens' Sample (Maybe SampleType)
sample_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Sample' {Maybe SampleType
type' :: Maybe SampleType
$sel:type':Sample' :: Sample -> Maybe SampleType
type'} -> Maybe SampleType
type') (\s :: Sample
s@Sample' {} Maybe SampleType
a -> Sample
s {$sel:type':Sample' :: Maybe SampleType
type' = Maybe SampleType
a} :: Sample)
sample_url :: Lens.Lens' Sample (Prelude.Maybe Prelude.Text)
sample_url :: Lens' Sample (Maybe Text)
sample_url = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Sample' {Maybe Text
url :: Maybe Text
$sel:url:Sample' :: Sample -> Maybe Text
url} -> Maybe Text
url) (\s :: Sample
s@Sample' {} Maybe Text
a -> Sample
s {$sel:url:Sample' :: Maybe Text
url = Maybe Text
a} :: Sample)
instance Data.FromJSON Sample where
parseJSON :: Value -> Parser Sample
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Sample"
( \Object
x ->
Maybe Text -> Maybe SampleType -> Maybe Text -> Sample
Sample'
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
"arn")
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
"type")
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
"url")
)
instance Prelude.Hashable Sample where
hashWithSalt :: Int -> Sample -> Int
hashWithSalt Int
_salt Sample' {Maybe Text
Maybe SampleType
url :: Maybe Text
type' :: Maybe SampleType
arn :: Maybe Text
$sel:url:Sample' :: Sample -> Maybe Text
$sel:type':Sample' :: Sample -> Maybe SampleType
$sel:arn:Sample' :: Sample -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SampleType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url
instance Prelude.NFData Sample where
rnf :: Sample -> ()
rnf Sample' {Maybe Text
Maybe SampleType
url :: Maybe Text
type' :: Maybe SampleType
arn :: Maybe Text
$sel:url:Sample' :: Sample -> Maybe Text
$sel:type':Sample' :: Sample -> Maybe SampleType
$sel:arn:Sample' :: Sample -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SampleType
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url