{-# 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.Route53.UpdateTrafficPolicyInstance
-- 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 resource record sets in a specified hosted zone that were
-- created based on the settings in a specified traffic policy version.
--
-- When you update a traffic policy instance, Amazon Route 53 continues to
-- respond to DNS queries for the root resource record set name (such as
-- example.com) while it replaces one group of resource record sets with
-- another. Route 53 performs the following operations:
--
-- 1.  Route 53 creates a new group of resource record sets based on the
--     specified traffic policy. This is true regardless of how significant
--     the differences are between the existing resource record sets and
--     the new resource record sets.
--
-- 2.  When all of the new resource record sets have been created, Route 53
--     starts to respond to DNS queries for the root resource record set
--     name (such as example.com) by using the new resource record sets.
--
-- 3.  Route 53 deletes the old group of resource record sets that are
--     associated with the root resource record set name.
module Amazonka.Route53.UpdateTrafficPolicyInstance
  ( -- * Creating a Request
    UpdateTrafficPolicyInstance (..),
    newUpdateTrafficPolicyInstance,

    -- * Request Lenses
    updateTrafficPolicyInstance_id,
    updateTrafficPolicyInstance_ttl,
    updateTrafficPolicyInstance_trafficPolicyId,
    updateTrafficPolicyInstance_trafficPolicyVersion,

    -- * Destructuring the Response
    UpdateTrafficPolicyInstanceResponse (..),
    newUpdateTrafficPolicyInstanceResponse,

    -- * Response Lenses
    updateTrafficPolicyInstanceResponse_httpStatus,
    updateTrafficPolicyInstanceResponse_trafficPolicyInstance,
  )
where

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

-- | A complex type that contains information about the resource record sets
-- that you want to update based on a specified traffic policy instance.
--
-- /See:/ 'newUpdateTrafficPolicyInstance' smart constructor.
data UpdateTrafficPolicyInstance = UpdateTrafficPolicyInstance'
  { -- | The ID of the traffic policy instance that you want to update.
    UpdateTrafficPolicyInstance -> Text
id :: Prelude.Text,
    -- | The TTL that you want Amazon Route 53 to assign to all of the updated
    -- resource record sets.
    UpdateTrafficPolicyInstance -> Natural
ttl :: Prelude.Natural,
    -- | The ID of the traffic policy that you want Amazon Route 53 to use to
    -- update resource record sets for the specified traffic policy instance.
    UpdateTrafficPolicyInstance -> Text
trafficPolicyId :: Prelude.Text,
    -- | The version of the traffic policy that you want Amazon Route 53 to use
    -- to update resource record sets for the specified traffic policy
    -- instance.
    UpdateTrafficPolicyInstance -> Natural
trafficPolicyVersion :: Prelude.Natural
  }
  deriving (UpdateTrafficPolicyInstance -> UpdateTrafficPolicyInstance -> Bool
(UpdateTrafficPolicyInstance
 -> UpdateTrafficPolicyInstance -> Bool)
-> (UpdateTrafficPolicyInstance
    -> UpdateTrafficPolicyInstance -> Bool)
-> Eq UpdateTrafficPolicyInstance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTrafficPolicyInstance -> UpdateTrafficPolicyInstance -> Bool
$c/= :: UpdateTrafficPolicyInstance -> UpdateTrafficPolicyInstance -> Bool
== :: UpdateTrafficPolicyInstance -> UpdateTrafficPolicyInstance -> Bool
$c== :: UpdateTrafficPolicyInstance -> UpdateTrafficPolicyInstance -> Bool
Prelude.Eq, ReadPrec [UpdateTrafficPolicyInstance]
ReadPrec UpdateTrafficPolicyInstance
Int -> ReadS UpdateTrafficPolicyInstance
ReadS [UpdateTrafficPolicyInstance]
(Int -> ReadS UpdateTrafficPolicyInstance)
-> ReadS [UpdateTrafficPolicyInstance]
-> ReadPrec UpdateTrafficPolicyInstance
-> ReadPrec [UpdateTrafficPolicyInstance]
-> Read UpdateTrafficPolicyInstance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTrafficPolicyInstance]
$creadListPrec :: ReadPrec [UpdateTrafficPolicyInstance]
readPrec :: ReadPrec UpdateTrafficPolicyInstance
$creadPrec :: ReadPrec UpdateTrafficPolicyInstance
readList :: ReadS [UpdateTrafficPolicyInstance]
$creadList :: ReadS [UpdateTrafficPolicyInstance]
readsPrec :: Int -> ReadS UpdateTrafficPolicyInstance
$creadsPrec :: Int -> ReadS UpdateTrafficPolicyInstance
Prelude.Read, Int -> UpdateTrafficPolicyInstance -> ShowS
[UpdateTrafficPolicyInstance] -> ShowS
UpdateTrafficPolicyInstance -> String
(Int -> UpdateTrafficPolicyInstance -> ShowS)
-> (UpdateTrafficPolicyInstance -> String)
-> ([UpdateTrafficPolicyInstance] -> ShowS)
-> Show UpdateTrafficPolicyInstance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTrafficPolicyInstance] -> ShowS
$cshowList :: [UpdateTrafficPolicyInstance] -> ShowS
show :: UpdateTrafficPolicyInstance -> String
$cshow :: UpdateTrafficPolicyInstance -> String
showsPrec :: Int -> UpdateTrafficPolicyInstance -> ShowS
$cshowsPrec :: Int -> UpdateTrafficPolicyInstance -> ShowS
Prelude.Show, (forall x.
 UpdateTrafficPolicyInstance -> Rep UpdateTrafficPolicyInstance x)
-> (forall x.
    Rep UpdateTrafficPolicyInstance x -> UpdateTrafficPolicyInstance)
-> Generic UpdateTrafficPolicyInstance
forall x.
Rep UpdateTrafficPolicyInstance x -> UpdateTrafficPolicyInstance
forall x.
UpdateTrafficPolicyInstance -> Rep UpdateTrafficPolicyInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTrafficPolicyInstance x -> UpdateTrafficPolicyInstance
$cfrom :: forall x.
UpdateTrafficPolicyInstance -> Rep UpdateTrafficPolicyInstance x
Prelude.Generic)

-- |
-- Create a value of 'UpdateTrafficPolicyInstance' 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:
--
-- 'id', 'updateTrafficPolicyInstance_id' - The ID of the traffic policy instance that you want to update.
--
-- 'ttl', 'updateTrafficPolicyInstance_ttl' - The TTL that you want Amazon Route 53 to assign to all of the updated
-- resource record sets.
--
-- 'trafficPolicyId', 'updateTrafficPolicyInstance_trafficPolicyId' - The ID of the traffic policy that you want Amazon Route 53 to use to
-- update resource record sets for the specified traffic policy instance.
--
-- 'trafficPolicyVersion', 'updateTrafficPolicyInstance_trafficPolicyVersion' - The version of the traffic policy that you want Amazon Route 53 to use
-- to update resource record sets for the specified traffic policy
-- instance.
newUpdateTrafficPolicyInstance ::
  -- | 'id'
  Prelude.Text ->
  -- | 'ttl'
  Prelude.Natural ->
  -- | 'trafficPolicyId'
  Prelude.Text ->
  -- | 'trafficPolicyVersion'
  Prelude.Natural ->
  UpdateTrafficPolicyInstance
newUpdateTrafficPolicyInstance :: Text -> Natural -> Text -> Natural -> UpdateTrafficPolicyInstance
newUpdateTrafficPolicyInstance
  Text
pId_
  Natural
pTTL_
  Text
pTrafficPolicyId_
  Natural
pTrafficPolicyVersion_ =
    UpdateTrafficPolicyInstance' :: Text -> Natural -> Text -> Natural -> UpdateTrafficPolicyInstance
UpdateTrafficPolicyInstance'
      { $sel:id:UpdateTrafficPolicyInstance' :: Text
id = Text
pId_,
        $sel:ttl:UpdateTrafficPolicyInstance' :: Natural
ttl = Natural
pTTL_,
        $sel:trafficPolicyId:UpdateTrafficPolicyInstance' :: Text
trafficPolicyId = Text
pTrafficPolicyId_,
        $sel:trafficPolicyVersion:UpdateTrafficPolicyInstance' :: Natural
trafficPolicyVersion = Natural
pTrafficPolicyVersion_
      }

-- | The ID of the traffic policy instance that you want to update.
updateTrafficPolicyInstance_id :: Lens.Lens' UpdateTrafficPolicyInstance Prelude.Text
updateTrafficPolicyInstance_id :: (Text -> f Text)
-> UpdateTrafficPolicyInstance -> f UpdateTrafficPolicyInstance
updateTrafficPolicyInstance_id = (UpdateTrafficPolicyInstance -> Text)
-> (UpdateTrafficPolicyInstance
    -> Text -> UpdateTrafficPolicyInstance)
-> Lens
     UpdateTrafficPolicyInstance UpdateTrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficPolicyInstance' {Text
id :: Text
$sel:id:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Text
id} -> Text
id) (\s :: UpdateTrafficPolicyInstance
s@UpdateTrafficPolicyInstance' {} Text
a -> UpdateTrafficPolicyInstance
s {$sel:id:UpdateTrafficPolicyInstance' :: Text
id = Text
a} :: UpdateTrafficPolicyInstance)

-- | The TTL that you want Amazon Route 53 to assign to all of the updated
-- resource record sets.
updateTrafficPolicyInstance_ttl :: Lens.Lens' UpdateTrafficPolicyInstance Prelude.Natural
updateTrafficPolicyInstance_ttl :: (Natural -> f Natural)
-> UpdateTrafficPolicyInstance -> f UpdateTrafficPolicyInstance
updateTrafficPolicyInstance_ttl = (UpdateTrafficPolicyInstance -> Natural)
-> (UpdateTrafficPolicyInstance
    -> Natural -> UpdateTrafficPolicyInstance)
-> Lens
     UpdateTrafficPolicyInstance
     UpdateTrafficPolicyInstance
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficPolicyInstance' {Natural
ttl :: Natural
$sel:ttl:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Natural
ttl} -> Natural
ttl) (\s :: UpdateTrafficPolicyInstance
s@UpdateTrafficPolicyInstance' {} Natural
a -> UpdateTrafficPolicyInstance
s {$sel:ttl:UpdateTrafficPolicyInstance' :: Natural
ttl = Natural
a} :: UpdateTrafficPolicyInstance)

-- | The ID of the traffic policy that you want Amazon Route 53 to use to
-- update resource record sets for the specified traffic policy instance.
updateTrafficPolicyInstance_trafficPolicyId :: Lens.Lens' UpdateTrafficPolicyInstance Prelude.Text
updateTrafficPolicyInstance_trafficPolicyId :: (Text -> f Text)
-> UpdateTrafficPolicyInstance -> f UpdateTrafficPolicyInstance
updateTrafficPolicyInstance_trafficPolicyId = (UpdateTrafficPolicyInstance -> Text)
-> (UpdateTrafficPolicyInstance
    -> Text -> UpdateTrafficPolicyInstance)
-> Lens
     UpdateTrafficPolicyInstance UpdateTrafficPolicyInstance Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficPolicyInstance' {Text
trafficPolicyId :: Text
$sel:trafficPolicyId:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Text
trafficPolicyId} -> Text
trafficPolicyId) (\s :: UpdateTrafficPolicyInstance
s@UpdateTrafficPolicyInstance' {} Text
a -> UpdateTrafficPolicyInstance
s {$sel:trafficPolicyId:UpdateTrafficPolicyInstance' :: Text
trafficPolicyId = Text
a} :: UpdateTrafficPolicyInstance)

-- | The version of the traffic policy that you want Amazon Route 53 to use
-- to update resource record sets for the specified traffic policy
-- instance.
updateTrafficPolicyInstance_trafficPolicyVersion :: Lens.Lens' UpdateTrafficPolicyInstance Prelude.Natural
updateTrafficPolicyInstance_trafficPolicyVersion :: (Natural -> f Natural)
-> UpdateTrafficPolicyInstance -> f UpdateTrafficPolicyInstance
updateTrafficPolicyInstance_trafficPolicyVersion = (UpdateTrafficPolicyInstance -> Natural)
-> (UpdateTrafficPolicyInstance
    -> Natural -> UpdateTrafficPolicyInstance)
-> Lens
     UpdateTrafficPolicyInstance
     UpdateTrafficPolicyInstance
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficPolicyInstance' {Natural
trafficPolicyVersion :: Natural
$sel:trafficPolicyVersion:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Natural
trafficPolicyVersion} -> Natural
trafficPolicyVersion) (\s :: UpdateTrafficPolicyInstance
s@UpdateTrafficPolicyInstance' {} Natural
a -> UpdateTrafficPolicyInstance
s {$sel:trafficPolicyVersion:UpdateTrafficPolicyInstance' :: Natural
trafficPolicyVersion = Natural
a} :: UpdateTrafficPolicyInstance)

instance Core.AWSRequest UpdateTrafficPolicyInstance where
  type
    AWSResponse UpdateTrafficPolicyInstance =
      UpdateTrafficPolicyInstanceResponse
  request :: UpdateTrafficPolicyInstance -> Request UpdateTrafficPolicyInstance
request = Service
-> UpdateTrafficPolicyInstance
-> Request UpdateTrafficPolicyInstance
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.postXML Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateTrafficPolicyInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateTrafficPolicyInstance)))
response =
    (Int
 -> ResponseHeaders
 -> [Node]
 -> Either String (AWSResponse UpdateTrafficPolicyInstance))
-> Logger
-> Service
-> Proxy UpdateTrafficPolicyInstance
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateTrafficPolicyInstance)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Int -> TrafficPolicyInstance -> UpdateTrafficPolicyInstanceResponse
UpdateTrafficPolicyInstanceResponse'
            (Int
 -> TrafficPolicyInstance -> UpdateTrafficPolicyInstanceResponse)
-> Either String Int
-> Either
     String
     (TrafficPolicyInstance -> UpdateTrafficPolicyInstanceResponse)
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
  (TrafficPolicyInstance -> UpdateTrafficPolicyInstanceResponse)
-> Either String TrafficPolicyInstance
-> Either String UpdateTrafficPolicyInstanceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String TrafficPolicyInstance
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TrafficPolicyInstance")
      )

instance Prelude.Hashable UpdateTrafficPolicyInstance

instance Prelude.NFData UpdateTrafficPolicyInstance

instance Core.ToElement UpdateTrafficPolicyInstance where
  toElement :: UpdateTrafficPolicyInstance -> Element
toElement =
    Name -> UpdateTrafficPolicyInstance -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
      Name
"{https://route53.amazonaws.com/doc/2013-04-01/}UpdateTrafficPolicyInstanceRequest"

instance Core.ToHeaders UpdateTrafficPolicyInstance where
  toHeaders :: UpdateTrafficPolicyInstance -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdateTrafficPolicyInstance -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath UpdateTrafficPolicyInstance where
  toPath :: UpdateTrafficPolicyInstance -> ByteString
toPath UpdateTrafficPolicyInstance' {Natural
Text
trafficPolicyVersion :: Natural
trafficPolicyId :: Text
ttl :: Natural
id :: Text
$sel:trafficPolicyVersion:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Natural
$sel:trafficPolicyId:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Text
$sel:ttl:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Natural
$sel:id:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/2013-04-01/trafficpolicyinstance/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]

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

instance Core.ToXML UpdateTrafficPolicyInstance where
  toXML :: UpdateTrafficPolicyInstance -> XML
toXML UpdateTrafficPolicyInstance' {Natural
Text
trafficPolicyVersion :: Natural
trafficPolicyId :: Text
ttl :: Natural
id :: Text
$sel:trafficPolicyVersion:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Natural
$sel:trafficPolicyId:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Text
$sel:ttl:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Natural
$sel:id:UpdateTrafficPolicyInstance' :: UpdateTrafficPolicyInstance -> Text
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"TTL" Name -> Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Natural
ttl,
        Name
"TrafficPolicyId" Name -> Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Text
trafficPolicyId,
        Name
"TrafficPolicyVersion" Name -> Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Natural
trafficPolicyVersion
      ]

-- | A complex type that contains information about the resource record sets
-- that Amazon Route 53 created based on a specified traffic policy.
--
-- /See:/ 'newUpdateTrafficPolicyInstanceResponse' smart constructor.
data UpdateTrafficPolicyInstanceResponse = UpdateTrafficPolicyInstanceResponse'
  { -- | The response's http status code.
    UpdateTrafficPolicyInstanceResponse -> Int
httpStatus :: Prelude.Int,
    -- | A complex type that contains settings for the updated traffic policy
    -- instance.
    UpdateTrafficPolicyInstanceResponse -> TrafficPolicyInstance
trafficPolicyInstance :: TrafficPolicyInstance
  }
  deriving (UpdateTrafficPolicyInstanceResponse
-> UpdateTrafficPolicyInstanceResponse -> Bool
(UpdateTrafficPolicyInstanceResponse
 -> UpdateTrafficPolicyInstanceResponse -> Bool)
-> (UpdateTrafficPolicyInstanceResponse
    -> UpdateTrafficPolicyInstanceResponse -> Bool)
-> Eq UpdateTrafficPolicyInstanceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateTrafficPolicyInstanceResponse
-> UpdateTrafficPolicyInstanceResponse -> Bool
$c/= :: UpdateTrafficPolicyInstanceResponse
-> UpdateTrafficPolicyInstanceResponse -> Bool
== :: UpdateTrafficPolicyInstanceResponse
-> UpdateTrafficPolicyInstanceResponse -> Bool
$c== :: UpdateTrafficPolicyInstanceResponse
-> UpdateTrafficPolicyInstanceResponse -> Bool
Prelude.Eq, ReadPrec [UpdateTrafficPolicyInstanceResponse]
ReadPrec UpdateTrafficPolicyInstanceResponse
Int -> ReadS UpdateTrafficPolicyInstanceResponse
ReadS [UpdateTrafficPolicyInstanceResponse]
(Int -> ReadS UpdateTrafficPolicyInstanceResponse)
-> ReadS [UpdateTrafficPolicyInstanceResponse]
-> ReadPrec UpdateTrafficPolicyInstanceResponse
-> ReadPrec [UpdateTrafficPolicyInstanceResponse]
-> Read UpdateTrafficPolicyInstanceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateTrafficPolicyInstanceResponse]
$creadListPrec :: ReadPrec [UpdateTrafficPolicyInstanceResponse]
readPrec :: ReadPrec UpdateTrafficPolicyInstanceResponse
$creadPrec :: ReadPrec UpdateTrafficPolicyInstanceResponse
readList :: ReadS [UpdateTrafficPolicyInstanceResponse]
$creadList :: ReadS [UpdateTrafficPolicyInstanceResponse]
readsPrec :: Int -> ReadS UpdateTrafficPolicyInstanceResponse
$creadsPrec :: Int -> ReadS UpdateTrafficPolicyInstanceResponse
Prelude.Read, Int -> UpdateTrafficPolicyInstanceResponse -> ShowS
[UpdateTrafficPolicyInstanceResponse] -> ShowS
UpdateTrafficPolicyInstanceResponse -> String
(Int -> UpdateTrafficPolicyInstanceResponse -> ShowS)
-> (UpdateTrafficPolicyInstanceResponse -> String)
-> ([UpdateTrafficPolicyInstanceResponse] -> ShowS)
-> Show UpdateTrafficPolicyInstanceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateTrafficPolicyInstanceResponse] -> ShowS
$cshowList :: [UpdateTrafficPolicyInstanceResponse] -> ShowS
show :: UpdateTrafficPolicyInstanceResponse -> String
$cshow :: UpdateTrafficPolicyInstanceResponse -> String
showsPrec :: Int -> UpdateTrafficPolicyInstanceResponse -> ShowS
$cshowsPrec :: Int -> UpdateTrafficPolicyInstanceResponse -> ShowS
Prelude.Show, (forall x.
 UpdateTrafficPolicyInstanceResponse
 -> Rep UpdateTrafficPolicyInstanceResponse x)
-> (forall x.
    Rep UpdateTrafficPolicyInstanceResponse x
    -> UpdateTrafficPolicyInstanceResponse)
-> Generic UpdateTrafficPolicyInstanceResponse
forall x.
Rep UpdateTrafficPolicyInstanceResponse x
-> UpdateTrafficPolicyInstanceResponse
forall x.
UpdateTrafficPolicyInstanceResponse
-> Rep UpdateTrafficPolicyInstanceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateTrafficPolicyInstanceResponse x
-> UpdateTrafficPolicyInstanceResponse
$cfrom :: forall x.
UpdateTrafficPolicyInstanceResponse
-> Rep UpdateTrafficPolicyInstanceResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateTrafficPolicyInstanceResponse' 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', 'updateTrafficPolicyInstanceResponse_httpStatus' - The response's http status code.
--
-- 'trafficPolicyInstance', 'updateTrafficPolicyInstanceResponse_trafficPolicyInstance' - A complex type that contains settings for the updated traffic policy
-- instance.
newUpdateTrafficPolicyInstanceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'trafficPolicyInstance'
  TrafficPolicyInstance ->
  UpdateTrafficPolicyInstanceResponse
newUpdateTrafficPolicyInstanceResponse :: Int -> TrafficPolicyInstance -> UpdateTrafficPolicyInstanceResponse
newUpdateTrafficPolicyInstanceResponse
  Int
pHttpStatus_
  TrafficPolicyInstance
pTrafficPolicyInstance_ =
    UpdateTrafficPolicyInstanceResponse' :: Int -> TrafficPolicyInstance -> UpdateTrafficPolicyInstanceResponse
UpdateTrafficPolicyInstanceResponse'
      { $sel:httpStatus:UpdateTrafficPolicyInstanceResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:trafficPolicyInstance:UpdateTrafficPolicyInstanceResponse' :: TrafficPolicyInstance
trafficPolicyInstance =
          TrafficPolicyInstance
pTrafficPolicyInstance_
      }

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

-- | A complex type that contains settings for the updated traffic policy
-- instance.
updateTrafficPolicyInstanceResponse_trafficPolicyInstance :: Lens.Lens' UpdateTrafficPolicyInstanceResponse TrafficPolicyInstance
updateTrafficPolicyInstanceResponse_trafficPolicyInstance :: (TrafficPolicyInstance -> f TrafficPolicyInstance)
-> UpdateTrafficPolicyInstanceResponse
-> f UpdateTrafficPolicyInstanceResponse
updateTrafficPolicyInstanceResponse_trafficPolicyInstance = (UpdateTrafficPolicyInstanceResponse -> TrafficPolicyInstance)
-> (UpdateTrafficPolicyInstanceResponse
    -> TrafficPolicyInstance -> UpdateTrafficPolicyInstanceResponse)
-> Lens
     UpdateTrafficPolicyInstanceResponse
     UpdateTrafficPolicyInstanceResponse
     TrafficPolicyInstance
     TrafficPolicyInstance
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateTrafficPolicyInstanceResponse' {TrafficPolicyInstance
trafficPolicyInstance :: TrafficPolicyInstance
$sel:trafficPolicyInstance:UpdateTrafficPolicyInstanceResponse' :: UpdateTrafficPolicyInstanceResponse -> TrafficPolicyInstance
trafficPolicyInstance} -> TrafficPolicyInstance
trafficPolicyInstance) (\s :: UpdateTrafficPolicyInstanceResponse
s@UpdateTrafficPolicyInstanceResponse' {} TrafficPolicyInstance
a -> UpdateTrafficPolicyInstanceResponse
s {$sel:trafficPolicyInstance:UpdateTrafficPolicyInstanceResponse' :: TrafficPolicyInstance
trafficPolicyInstance = TrafficPolicyInstance
a} :: UpdateTrafficPolicyInstanceResponse)

instance
  Prelude.NFData
    UpdateTrafficPolicyInstanceResponse