{-# 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.Location.UpdateTracker
-- 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)
--
-- Updates the specified properties of a given tracker resource.
module Amazonka.Location.UpdateTracker
  ( -- * Creating a Request
    UpdateTracker (..),
    newUpdateTracker,

    -- * Request Lenses
    updateTracker_pricingPlan,
    updateTracker_pricingPlanDataSource,
    updateTracker_description,
    updateTracker_positionFiltering,
    updateTracker_trackerName,

    -- * Destructuring the Response
    UpdateTrackerResponse (..),
    newUpdateTrackerResponse,

    -- * Response Lenses
    updateTrackerResponse_httpStatus,
    updateTrackerResponse_trackerArn,
    updateTrackerResponse_trackerName,
    updateTrackerResponse_updateTime,
  )
where

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

-- | /See:/ 'newUpdateTracker' smart constructor.
data UpdateTracker = UpdateTracker'
  { -- | Updates the pricing plan for the tracker resource.
    --
    -- For more information about each pricing plan option restrictions, see
    -- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
    UpdateTracker -> Maybe PricingPlan
pricingPlan :: Prelude.Maybe PricingPlan,
    -- | Updates the data provider for the tracker resource.
    --
    -- A required value for the following pricing plans: @MobileAssetTracking@|
    -- @MobileAssetManagement@
    --
    -- For more information about
    -- <https://aws.amazon.com/location/data-providers/ data providers> and
    -- <https://aws.amazon.com/location/pricing/ pricing plans>, see the Amazon
    -- Location Service product page
    --
    -- This can only be updated when updating the @PricingPlan@ in the same
    -- request.
    --
    -- Amazon Location Service uses @PricingPlanDataSource@ to calculate
    -- billing for your tracker resource. Your data won\'t be shared with the
    -- data provider, and will remain in your AWS account and Region unless you
    -- move it.
    UpdateTracker -> Maybe Text
pricingPlanDataSource :: Prelude.Maybe Prelude.Text,
    -- | Updates the description for the tracker resource.
    UpdateTracker -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Updates the position filtering for the tracker resource.
    --
    -- Valid values:
    --
    -- -   @TimeBased@ - Location updates are evaluated against linked geofence
    --     collections, but not every location update is stored. If your update
    --     frequency is more often than 30 seconds, only one update per 30
    --     seconds is stored for each unique device ID.
    --
    -- -   @DistanceBased@ - If the device has moved less than 30 m (98.4 ft),
    --     location updates are ignored. Location updates within this distance
    --     are neither evaluated against linked geofence collections, nor
    --     stored. This helps control costs by reducing the number of geofence
    --     evaluations and device positions to retrieve. Distance-based
    --     filtering can also reduce the jitter effect when displaying device
    --     trajectory on a map.
    UpdateTracker -> Maybe PositionFiltering
positionFiltering :: Prelude.Maybe PositionFiltering,
    -- | The name of the tracker resource to update.
    UpdateTracker -> Text
trackerName :: Prelude.Text
  }
  deriving (UpdateTracker -> UpdateTracker -> Bool
(UpdateTracker -> UpdateTracker -> Bool)
-> (UpdateTracker -> UpdateTracker -> Bool) -> Eq UpdateTracker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTracker -> UpdateTracker -> Bool
$c/= :: UpdateTracker -> UpdateTracker -> Bool
== :: UpdateTracker -> UpdateTracker -> Bool
$c== :: UpdateTracker -> UpdateTracker -> Bool
Prelude.Eq, ReadPrec [UpdateTracker]
ReadPrec UpdateTracker
Int -> ReadS UpdateTracker
ReadS [UpdateTracker]
(Int -> ReadS UpdateTracker)
-> ReadS [UpdateTracker]
-> ReadPrec UpdateTracker
-> ReadPrec [UpdateTracker]
-> Read UpdateTracker
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTracker]
$creadListPrec :: ReadPrec [UpdateTracker]
readPrec :: ReadPrec UpdateTracker
$creadPrec :: ReadPrec UpdateTracker
readList :: ReadS [UpdateTracker]
$creadList :: ReadS [UpdateTracker]
readsPrec :: Int -> ReadS UpdateTracker
$creadsPrec :: Int -> ReadS UpdateTracker
Prelude.Read, Int -> UpdateTracker -> ShowS
[UpdateTracker] -> ShowS
UpdateTracker -> String
(Int -> UpdateTracker -> ShowS)
-> (UpdateTracker -> String)
-> ([UpdateTracker] -> ShowS)
-> Show UpdateTracker
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTracker] -> ShowS
$cshowList :: [UpdateTracker] -> ShowS
show :: UpdateTracker -> String
$cshow :: UpdateTracker -> String
showsPrec :: Int -> UpdateTracker -> ShowS
$cshowsPrec :: Int -> UpdateTracker -> ShowS
Prelude.Show, (forall x. UpdateTracker -> Rep UpdateTracker x)
-> (forall x. Rep UpdateTracker x -> UpdateTracker)
-> Generic UpdateTracker
forall x. Rep UpdateTracker x -> UpdateTracker
forall x. UpdateTracker -> Rep UpdateTracker x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTracker x -> UpdateTracker
$cfrom :: forall x. UpdateTracker -> Rep UpdateTracker x
Prelude.Generic)

-- |
-- Create a value of 'UpdateTracker' 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:
--
-- 'pricingPlan', 'updateTracker_pricingPlan' - Updates the pricing plan for the tracker resource.
--
-- For more information about each pricing plan option restrictions, see
-- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
--
-- 'pricingPlanDataSource', 'updateTracker_pricingPlanDataSource' - Updates the data provider for the tracker resource.
--
-- A required value for the following pricing plans: @MobileAssetTracking@|
-- @MobileAssetManagement@
--
-- For more information about
-- <https://aws.amazon.com/location/data-providers/ data providers> and
-- <https://aws.amazon.com/location/pricing/ pricing plans>, see the Amazon
-- Location Service product page
--
-- This can only be updated when updating the @PricingPlan@ in the same
-- request.
--
-- Amazon Location Service uses @PricingPlanDataSource@ to calculate
-- billing for your tracker resource. Your data won\'t be shared with the
-- data provider, and will remain in your AWS account and Region unless you
-- move it.
--
-- 'description', 'updateTracker_description' - Updates the description for the tracker resource.
--
-- 'positionFiltering', 'updateTracker_positionFiltering' - Updates the position filtering for the tracker resource.
--
-- Valid values:
--
-- -   @TimeBased@ - Location updates are evaluated against linked geofence
--     collections, but not every location update is stored. If your update
--     frequency is more often than 30 seconds, only one update per 30
--     seconds is stored for each unique device ID.
--
-- -   @DistanceBased@ - If the device has moved less than 30 m (98.4 ft),
--     location updates are ignored. Location updates within this distance
--     are neither evaluated against linked geofence collections, nor
--     stored. This helps control costs by reducing the number of geofence
--     evaluations and device positions to retrieve. Distance-based
--     filtering can also reduce the jitter effect when displaying device
--     trajectory on a map.
--
-- 'trackerName', 'updateTracker_trackerName' - The name of the tracker resource to update.
newUpdateTracker ::
  -- | 'trackerName'
  Prelude.Text ->
  UpdateTracker
newUpdateTracker :: Text -> UpdateTracker
newUpdateTracker Text
pTrackerName_ =
  UpdateTracker' :: Maybe PricingPlan
-> Maybe Text
-> Maybe Text
-> Maybe PositionFiltering
-> Text
-> UpdateTracker
UpdateTracker'
    { $sel:pricingPlan:UpdateTracker' :: Maybe PricingPlan
pricingPlan = Maybe PricingPlan
forall a. Maybe a
Prelude.Nothing,
      $sel:pricingPlanDataSource:UpdateTracker' :: Maybe Text
pricingPlanDataSource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateTracker' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:positionFiltering:UpdateTracker' :: Maybe PositionFiltering
positionFiltering = Maybe PositionFiltering
forall a. Maybe a
Prelude.Nothing,
      $sel:trackerName:UpdateTracker' :: Text
trackerName = Text
pTrackerName_
    }

-- | Updates the pricing plan for the tracker resource.
--
-- For more information about each pricing plan option restrictions, see
-- <https://aws.amazon.com/location/pricing/ Amazon Location Service pricing>.
updateTracker_pricingPlan :: Lens.Lens' UpdateTracker (Prelude.Maybe PricingPlan)
updateTracker_pricingPlan :: (Maybe PricingPlan -> f (Maybe PricingPlan))
-> UpdateTracker -> f UpdateTracker
updateTracker_pricingPlan = (UpdateTracker -> Maybe PricingPlan)
-> (UpdateTracker -> Maybe PricingPlan -> UpdateTracker)
-> Lens
     UpdateTracker UpdateTracker (Maybe PricingPlan) (Maybe PricingPlan)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTracker' {Maybe PricingPlan
pricingPlan :: Maybe PricingPlan
$sel:pricingPlan:UpdateTracker' :: UpdateTracker -> Maybe PricingPlan
pricingPlan} -> Maybe PricingPlan
pricingPlan) (\s :: UpdateTracker
s@UpdateTracker' {} Maybe PricingPlan
a -> UpdateTracker
s {$sel:pricingPlan:UpdateTracker' :: Maybe PricingPlan
pricingPlan = Maybe PricingPlan
a} :: UpdateTracker)

-- | Updates the data provider for the tracker resource.
--
-- A required value for the following pricing plans: @MobileAssetTracking@|
-- @MobileAssetManagement@
--
-- For more information about
-- <https://aws.amazon.com/location/data-providers/ data providers> and
-- <https://aws.amazon.com/location/pricing/ pricing plans>, see the Amazon
-- Location Service product page
--
-- This can only be updated when updating the @PricingPlan@ in the same
-- request.
--
-- Amazon Location Service uses @PricingPlanDataSource@ to calculate
-- billing for your tracker resource. Your data won\'t be shared with the
-- data provider, and will remain in your AWS account and Region unless you
-- move it.
updateTracker_pricingPlanDataSource :: Lens.Lens' UpdateTracker (Prelude.Maybe Prelude.Text)
updateTracker_pricingPlanDataSource :: (Maybe Text -> f (Maybe Text)) -> UpdateTracker -> f UpdateTracker
updateTracker_pricingPlanDataSource = (UpdateTracker -> Maybe Text)
-> (UpdateTracker -> Maybe Text -> UpdateTracker)
-> Lens UpdateTracker UpdateTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTracker' {Maybe Text
pricingPlanDataSource :: Maybe Text
$sel:pricingPlanDataSource:UpdateTracker' :: UpdateTracker -> Maybe Text
pricingPlanDataSource} -> Maybe Text
pricingPlanDataSource) (\s :: UpdateTracker
s@UpdateTracker' {} Maybe Text
a -> UpdateTracker
s {$sel:pricingPlanDataSource:UpdateTracker' :: Maybe Text
pricingPlanDataSource = Maybe Text
a} :: UpdateTracker)

-- | Updates the description for the tracker resource.
updateTracker_description :: Lens.Lens' UpdateTracker (Prelude.Maybe Prelude.Text)
updateTracker_description :: (Maybe Text -> f (Maybe Text)) -> UpdateTracker -> f UpdateTracker
updateTracker_description = (UpdateTracker -> Maybe Text)
-> (UpdateTracker -> Maybe Text -> UpdateTracker)
-> Lens UpdateTracker UpdateTracker (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTracker' {Maybe Text
description :: Maybe Text
$sel:description:UpdateTracker' :: UpdateTracker -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateTracker
s@UpdateTracker' {} Maybe Text
a -> UpdateTracker
s {$sel:description:UpdateTracker' :: Maybe Text
description = Maybe Text
a} :: UpdateTracker)

-- | Updates the position filtering for the tracker resource.
--
-- Valid values:
--
-- -   @TimeBased@ - Location updates are evaluated against linked geofence
--     collections, but not every location update is stored. If your update
--     frequency is more often than 30 seconds, only one update per 30
--     seconds is stored for each unique device ID.
--
-- -   @DistanceBased@ - If the device has moved less than 30 m (98.4 ft),
--     location updates are ignored. Location updates within this distance
--     are neither evaluated against linked geofence collections, nor
--     stored. This helps control costs by reducing the number of geofence
--     evaluations and device positions to retrieve. Distance-based
--     filtering can also reduce the jitter effect when displaying device
--     trajectory on a map.
updateTracker_positionFiltering :: Lens.Lens' UpdateTracker (Prelude.Maybe PositionFiltering)
updateTracker_positionFiltering :: (Maybe PositionFiltering -> f (Maybe PositionFiltering))
-> UpdateTracker -> f UpdateTracker
updateTracker_positionFiltering = (UpdateTracker -> Maybe PositionFiltering)
-> (UpdateTracker -> Maybe PositionFiltering -> UpdateTracker)
-> Lens
     UpdateTracker
     UpdateTracker
     (Maybe PositionFiltering)
     (Maybe PositionFiltering)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTracker' {Maybe PositionFiltering
positionFiltering :: Maybe PositionFiltering
$sel:positionFiltering:UpdateTracker' :: UpdateTracker -> Maybe PositionFiltering
positionFiltering} -> Maybe PositionFiltering
positionFiltering) (\s :: UpdateTracker
s@UpdateTracker' {} Maybe PositionFiltering
a -> UpdateTracker
s {$sel:positionFiltering:UpdateTracker' :: Maybe PositionFiltering
positionFiltering = Maybe PositionFiltering
a} :: UpdateTracker)

-- | The name of the tracker resource to update.
updateTracker_trackerName :: Lens.Lens' UpdateTracker Prelude.Text
updateTracker_trackerName :: (Text -> f Text) -> UpdateTracker -> f UpdateTracker
updateTracker_trackerName = (UpdateTracker -> Text)
-> (UpdateTracker -> Text -> UpdateTracker)
-> Lens UpdateTracker UpdateTracker Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTracker' {Text
trackerName :: Text
$sel:trackerName:UpdateTracker' :: UpdateTracker -> Text
trackerName} -> Text
trackerName) (\s :: UpdateTracker
s@UpdateTracker' {} Text
a -> UpdateTracker
s {$sel:trackerName:UpdateTracker' :: Text
trackerName = Text
a} :: UpdateTracker)

instance Core.AWSRequest UpdateTracker where
  type
    AWSResponse UpdateTracker =
      UpdateTrackerResponse
  request :: UpdateTracker -> Request UpdateTracker
request = Service -> UpdateTracker -> Request UpdateTracker
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateTracker
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTracker)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateTracker))
-> Logger
-> Service
-> Proxy UpdateTracker
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateTracker)))
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 ->
          Int -> Text -> Text -> POSIX -> UpdateTrackerResponse
UpdateTrackerResponse'
            (Int -> Text -> Text -> POSIX -> UpdateTrackerResponse)
-> Either String Int
-> Either String (Text -> Text -> POSIX -> UpdateTrackerResponse)
forall (f :: * -> *) a b. Functor 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))
            Either String (Text -> Text -> POSIX -> UpdateTrackerResponse)
-> Either String Text
-> Either String (Text -> POSIX -> UpdateTrackerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"TrackerArn")
            Either String (Text -> POSIX -> UpdateTrackerResponse)
-> Either String Text
-> Either String (POSIX -> UpdateTrackerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"TrackerName")
            Either String (POSIX -> UpdateTrackerResponse)
-> Either String POSIX -> Either String UpdateTrackerResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"UpdateTime")
      )

instance Prelude.Hashable UpdateTracker

instance Prelude.NFData UpdateTracker

instance Core.ToHeaders UpdateTracker where
  toHeaders :: UpdateTracker -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateTracker -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 UpdateTracker where
  toJSON :: UpdateTracker -> Value
toJSON UpdateTracker' {Maybe Text
Maybe PositionFiltering
Maybe PricingPlan
Text
trackerName :: Text
positionFiltering :: Maybe PositionFiltering
description :: Maybe Text
pricingPlanDataSource :: Maybe Text
pricingPlan :: Maybe PricingPlan
$sel:trackerName:UpdateTracker' :: UpdateTracker -> Text
$sel:positionFiltering:UpdateTracker' :: UpdateTracker -> Maybe PositionFiltering
$sel:description:UpdateTracker' :: UpdateTracker -> Maybe Text
$sel:pricingPlanDataSource:UpdateTracker' :: UpdateTracker -> Maybe Text
$sel:pricingPlan:UpdateTracker' :: UpdateTracker -> Maybe PricingPlan
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PricingPlan" Text -> PricingPlan -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PricingPlan -> Pair) -> Maybe PricingPlan -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PricingPlan
pricingPlan,
            (Text
"PricingPlanDataSource" 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
pricingPlanDataSource,
            (Text
"Description" 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
description,
            (Text
"PositionFiltering" Text -> PositionFiltering -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (PositionFiltering -> Pair)
-> Maybe PositionFiltering -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PositionFiltering
positionFiltering
          ]
      )

instance Core.ToPath UpdateTracker where
  toPath :: UpdateTracker -> ByteString
toPath UpdateTracker' {Maybe Text
Maybe PositionFiltering
Maybe PricingPlan
Text
trackerName :: Text
positionFiltering :: Maybe PositionFiltering
description :: Maybe Text
pricingPlanDataSource :: Maybe Text
pricingPlan :: Maybe PricingPlan
$sel:trackerName:UpdateTracker' :: UpdateTracker -> Text
$sel:positionFiltering:UpdateTracker' :: UpdateTracker -> Maybe PositionFiltering
$sel:description:UpdateTracker' :: UpdateTracker -> Maybe Text
$sel:pricingPlanDataSource:UpdateTracker' :: UpdateTracker -> Maybe Text
$sel:pricingPlan:UpdateTracker' :: UpdateTracker -> Maybe PricingPlan
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/tracking/v0/trackers/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
trackerName]

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

-- | /See:/ 'newUpdateTrackerResponse' smart constructor.
data UpdateTrackerResponse = UpdateTrackerResponse'
  { -- | The response's http status code.
    UpdateTrackerResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the updated tracker resource. Used to
    -- specify a resource across AWS.
    --
    -- -   Format example:
    --     @arn:aws:geo:region:account-id:tracker\/ExampleTracker@
    UpdateTrackerResponse -> Text
trackerArn :: Prelude.Text,
    -- | The name of the updated tracker resource.
    UpdateTrackerResponse -> Text
trackerName :: Prelude.Text,
    -- | The timestamp for when the tracker resource was last updated in
    -- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
    -- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
    UpdateTrackerResponse -> POSIX
updateTime :: Core.POSIX
  }
  deriving (UpdateTrackerResponse -> UpdateTrackerResponse -> Bool
(UpdateTrackerResponse -> UpdateTrackerResponse -> Bool)
-> (UpdateTrackerResponse -> UpdateTrackerResponse -> Bool)
-> Eq UpdateTrackerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTrackerResponse -> UpdateTrackerResponse -> Bool
$c/= :: UpdateTrackerResponse -> UpdateTrackerResponse -> Bool
== :: UpdateTrackerResponse -> UpdateTrackerResponse -> Bool
$c== :: UpdateTrackerResponse -> UpdateTrackerResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTrackerResponse]
ReadPrec UpdateTrackerResponse
Int -> ReadS UpdateTrackerResponse
ReadS [UpdateTrackerResponse]
(Int -> ReadS UpdateTrackerResponse)
-> ReadS [UpdateTrackerResponse]
-> ReadPrec UpdateTrackerResponse
-> ReadPrec [UpdateTrackerResponse]
-> Read UpdateTrackerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTrackerResponse]
$creadListPrec :: ReadPrec [UpdateTrackerResponse]
readPrec :: ReadPrec UpdateTrackerResponse
$creadPrec :: ReadPrec UpdateTrackerResponse
readList :: ReadS [UpdateTrackerResponse]
$creadList :: ReadS [UpdateTrackerResponse]
readsPrec :: Int -> ReadS UpdateTrackerResponse
$creadsPrec :: Int -> ReadS UpdateTrackerResponse
Prelude.Read, Int -> UpdateTrackerResponse -> ShowS
[UpdateTrackerResponse] -> ShowS
UpdateTrackerResponse -> String
(Int -> UpdateTrackerResponse -> ShowS)
-> (UpdateTrackerResponse -> String)
-> ([UpdateTrackerResponse] -> ShowS)
-> Show UpdateTrackerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTrackerResponse] -> ShowS
$cshowList :: [UpdateTrackerResponse] -> ShowS
show :: UpdateTrackerResponse -> String
$cshow :: UpdateTrackerResponse -> String
showsPrec :: Int -> UpdateTrackerResponse -> ShowS
$cshowsPrec :: Int -> UpdateTrackerResponse -> ShowS
Prelude.Show, (forall x. UpdateTrackerResponse -> Rep UpdateTrackerResponse x)
-> (forall x. Rep UpdateTrackerResponse x -> UpdateTrackerResponse)
-> Generic UpdateTrackerResponse
forall x. Rep UpdateTrackerResponse x -> UpdateTrackerResponse
forall x. UpdateTrackerResponse -> Rep UpdateTrackerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateTrackerResponse x -> UpdateTrackerResponse
$cfrom :: forall x. UpdateTrackerResponse -> Rep UpdateTrackerResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateTrackerResponse' 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:
--
-- 'httpStatus', 'updateTrackerResponse_httpStatus' - The response's http status code.
--
-- 'trackerArn', 'updateTrackerResponse_trackerArn' - The Amazon Resource Name (ARN) of the updated tracker resource. Used to
-- specify a resource across AWS.
--
-- -   Format example:
--     @arn:aws:geo:region:account-id:tracker\/ExampleTracker@
--
-- 'trackerName', 'updateTrackerResponse_trackerName' - The name of the updated tracker resource.
--
-- 'updateTime', 'updateTrackerResponse_updateTime' - The timestamp for when the tracker resource was last updated in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
newUpdateTrackerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'trackerArn'
  Prelude.Text ->
  -- | 'trackerName'
  Prelude.Text ->
  -- | 'updateTime'
  Prelude.UTCTime ->
  UpdateTrackerResponse
newUpdateTrackerResponse :: Int -> Text -> Text -> UTCTime -> UpdateTrackerResponse
newUpdateTrackerResponse
  Int
pHttpStatus_
  Text
pTrackerArn_
  Text
pTrackerName_
  UTCTime
pUpdateTime_ =
    UpdateTrackerResponse' :: Int -> Text -> Text -> POSIX -> UpdateTrackerResponse
UpdateTrackerResponse'
      { $sel:httpStatus:UpdateTrackerResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:trackerArn:UpdateTrackerResponse' :: Text
trackerArn = Text
pTrackerArn_,
        $sel:trackerName:UpdateTrackerResponse' :: Text
trackerName = Text
pTrackerName_,
        $sel:updateTime:UpdateTrackerResponse' :: POSIX
updateTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdateTime_
      }

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

-- | The Amazon Resource Name (ARN) of the updated tracker resource. Used to
-- specify a resource across AWS.
--
-- -   Format example:
--     @arn:aws:geo:region:account-id:tracker\/ExampleTracker@
updateTrackerResponse_trackerArn :: Lens.Lens' UpdateTrackerResponse Prelude.Text
updateTrackerResponse_trackerArn :: (Text -> f Text)
-> UpdateTrackerResponse -> f UpdateTrackerResponse
updateTrackerResponse_trackerArn = (UpdateTrackerResponse -> Text)
-> (UpdateTrackerResponse -> Text -> UpdateTrackerResponse)
-> Lens UpdateTrackerResponse UpdateTrackerResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrackerResponse' {Text
trackerArn :: Text
$sel:trackerArn:UpdateTrackerResponse' :: UpdateTrackerResponse -> Text
trackerArn} -> Text
trackerArn) (\s :: UpdateTrackerResponse
s@UpdateTrackerResponse' {} Text
a -> UpdateTrackerResponse
s {$sel:trackerArn:UpdateTrackerResponse' :: Text
trackerArn = Text
a} :: UpdateTrackerResponse)

-- | The name of the updated tracker resource.
updateTrackerResponse_trackerName :: Lens.Lens' UpdateTrackerResponse Prelude.Text
updateTrackerResponse_trackerName :: (Text -> f Text)
-> UpdateTrackerResponse -> f UpdateTrackerResponse
updateTrackerResponse_trackerName = (UpdateTrackerResponse -> Text)
-> (UpdateTrackerResponse -> Text -> UpdateTrackerResponse)
-> Lens UpdateTrackerResponse UpdateTrackerResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrackerResponse' {Text
trackerName :: Text
$sel:trackerName:UpdateTrackerResponse' :: UpdateTrackerResponse -> Text
trackerName} -> Text
trackerName) (\s :: UpdateTrackerResponse
s@UpdateTrackerResponse' {} Text
a -> UpdateTrackerResponse
s {$sel:trackerName:UpdateTrackerResponse' :: Text
trackerName = Text
a} :: UpdateTrackerResponse)

-- | The timestamp for when the tracker resource was last updated in
-- <https://www.iso.org/iso-8601-date-and-time-format.html ISO 8601>
-- format: @YYYY-MM-DDThh:mm:ss.sssZ@.
updateTrackerResponse_updateTime :: Lens.Lens' UpdateTrackerResponse Prelude.UTCTime
updateTrackerResponse_updateTime :: (UTCTime -> f UTCTime)
-> UpdateTrackerResponse -> f UpdateTrackerResponse
updateTrackerResponse_updateTime = (UpdateTrackerResponse -> POSIX)
-> (UpdateTrackerResponse -> POSIX -> UpdateTrackerResponse)
-> Lens UpdateTrackerResponse UpdateTrackerResponse POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrackerResponse' {POSIX
updateTime :: POSIX
$sel:updateTime:UpdateTrackerResponse' :: UpdateTrackerResponse -> POSIX
updateTime} -> POSIX
updateTime) (\s :: UpdateTrackerResponse
s@UpdateTrackerResponse' {} POSIX
a -> UpdateTrackerResponse
s {$sel:updateTime:UpdateTrackerResponse' :: POSIX
updateTime = POSIX
a} :: UpdateTrackerResponse) ((POSIX -> f POSIX)
 -> UpdateTrackerResponse -> f UpdateTrackerResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> UpdateTrackerResponse
-> f UpdateTrackerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

instance Prelude.NFData UpdateTrackerResponse