{-# 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.AccessAnalyzer.Types.Substring where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Substring = Substring'
{
Substring -> Int
length :: Prelude.Int,
Substring -> Int
start :: Prelude.Int
}
deriving (Substring -> Substring -> Bool
(Substring -> Substring -> Bool)
-> (Substring -> Substring -> Bool) -> Eq Substring
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Substring -> Substring -> Bool
$c/= :: Substring -> Substring -> Bool
== :: Substring -> Substring -> Bool
$c== :: Substring -> Substring -> Bool
Prelude.Eq, ReadPrec [Substring]
ReadPrec Substring
Int -> ReadS Substring
ReadS [Substring]
(Int -> ReadS Substring)
-> ReadS [Substring]
-> ReadPrec Substring
-> ReadPrec [Substring]
-> Read Substring
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Substring]
$creadListPrec :: ReadPrec [Substring]
readPrec :: ReadPrec Substring
$creadPrec :: ReadPrec Substring
readList :: ReadS [Substring]
$creadList :: ReadS [Substring]
readsPrec :: Int -> ReadS Substring
$creadsPrec :: Int -> ReadS Substring
Prelude.Read, Int -> Substring -> ShowS
[Substring] -> ShowS
Substring -> String
(Int -> Substring -> ShowS)
-> (Substring -> String)
-> ([Substring] -> ShowS)
-> Show Substring
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Substring] -> ShowS
$cshowList :: [Substring] -> ShowS
show :: Substring -> String
$cshow :: Substring -> String
showsPrec :: Int -> Substring -> ShowS
$cshowsPrec :: Int -> Substring -> ShowS
Prelude.Show, (forall x. Substring -> Rep Substring x)
-> (forall x. Rep Substring x -> Substring) -> Generic Substring
forall x. Rep Substring x -> Substring
forall x. Substring -> Rep Substring x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Substring x -> Substring
$cfrom :: forall x. Substring -> Rep Substring x
Prelude.Generic)
newSubstring ::
Prelude.Int ->
Prelude.Int ->
Substring
newSubstring :: Int -> Int -> Substring
newSubstring Int
pLength_ Int
pStart_ =
Substring' :: Int -> Int -> Substring
Substring' {$sel:length:Substring' :: Int
length = Int
pLength_, $sel:start:Substring' :: Int
start = Int
pStart_}
substring_length :: Lens.Lens' Substring Prelude.Int
substring_length :: (Int -> f Int) -> Substring -> f Substring
substring_length = (Substring -> Int)
-> (Substring -> Int -> Substring)
-> Lens Substring Substring Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Substring' {Int
length :: Int
$sel:length:Substring' :: Substring -> Int
length} -> Int
length) (\s :: Substring
s@Substring' {} Int
a -> Substring
s {$sel:length:Substring' :: Int
length = Int
a} :: Substring)
substring_start :: Lens.Lens' Substring Prelude.Int
substring_start :: (Int -> f Int) -> Substring -> f Substring
substring_start = (Substring -> Int)
-> (Substring -> Int -> Substring)
-> Lens Substring Substring Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Substring' {Int
start :: Int
$sel:start:Substring' :: Substring -> Int
start} -> Int
start) (\s :: Substring
s@Substring' {} Int
a -> Substring
s {$sel:start:Substring' :: Int
start = Int
a} :: Substring)
instance Core.FromJSON Substring where
parseJSON :: Value -> Parser Substring
parseJSON =
String -> (Object -> Parser Substring) -> Value -> Parser Substring
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Substring"
( \Object
x ->
Int -> Int -> Substring
Substring'
(Int -> Int -> Substring)
-> Parser Int -> Parser (Int -> Substring)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"length") Parser (Int -> Substring) -> Parser Int -> Parser Substring
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"start")
)
instance Prelude.Hashable Substring
instance Prelude.NFData Substring