{-# 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.EC2.Types.TrafficMirrorPortRange -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) module Amazonka.EC2.Types.TrafficMirrorPortRange where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.EC2.Internal import qualified Amazonka.Prelude as Prelude -- | Describes the Traffic Mirror port range. -- -- /See:/ 'newTrafficMirrorPortRange' smart constructor. data TrafficMirrorPortRange = TrafficMirrorPortRange' { -- | The start of the Traffic Mirror port range. This applies to the TCP and -- UDP protocols. fromPort :: Prelude.Maybe Prelude.Int, -- | The end of the Traffic Mirror port range. This applies to the TCP and -- UDP protocols. toPort :: Prelude.Maybe Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'TrafficMirrorPortRange' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'fromPort', 'trafficMirrorPortRange_fromPort' - The start of the Traffic Mirror port range. This applies to the TCP and -- UDP protocols. -- -- 'toPort', 'trafficMirrorPortRange_toPort' - The end of the Traffic Mirror port range. This applies to the TCP and -- UDP protocols. newTrafficMirrorPortRange :: TrafficMirrorPortRange newTrafficMirrorPortRange = TrafficMirrorPortRange' { fromPort = Prelude.Nothing, toPort = Prelude.Nothing } -- | The start of the Traffic Mirror port range. This applies to the TCP and -- UDP protocols. trafficMirrorPortRange_fromPort :: Lens.Lens' TrafficMirrorPortRange (Prelude.Maybe Prelude.Int) trafficMirrorPortRange_fromPort = Lens.lens (\TrafficMirrorPortRange' {fromPort} -> fromPort) (\s@TrafficMirrorPortRange' {} a -> s {fromPort = a} :: TrafficMirrorPortRange) -- | The end of the Traffic Mirror port range. This applies to the TCP and -- UDP protocols. trafficMirrorPortRange_toPort :: Lens.Lens' TrafficMirrorPortRange (Prelude.Maybe Prelude.Int) trafficMirrorPortRange_toPort = Lens.lens (\TrafficMirrorPortRange' {toPort} -> toPort) (\s@TrafficMirrorPortRange' {} a -> s {toPort = a} :: TrafficMirrorPortRange) instance Data.FromXML TrafficMirrorPortRange where parseXML x = TrafficMirrorPortRange' Prelude.<$> (x Data..@? "fromPort") Prelude.<*> (x Data..@? "toPort") instance Prelude.Hashable TrafficMirrorPortRange where hashWithSalt _salt TrafficMirrorPortRange' {..} = _salt `Prelude.hashWithSalt` fromPort `Prelude.hashWithSalt` toPort instance Prelude.NFData TrafficMirrorPortRange where rnf TrafficMirrorPortRange' {..} = Prelude.rnf fromPort `Prelude.seq` Prelude.rnf toPort