{-# 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.Forecast.ResumeResource
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Resumes a stopped monitor resource.
module Amazonka.Forecast.ResumeResource
  ( -- * Creating a Request
    ResumeResource (..),
    newResumeResource,

    -- * Request Lenses
    resumeResource_resourceArn,

    -- * Destructuring the Response
    ResumeResourceResponse (..),
    newResumeResourceResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Forecast.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newResumeResource' smart constructor.
data ResumeResource = ResumeResource'
  { -- | The Amazon Resource Name (ARN) of the monitor resource to resume.
    ResumeResource -> Text
resourceArn :: Prelude.Text
  }
  deriving (ResumeResource -> ResumeResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeResource -> ResumeResource -> Bool
$c/= :: ResumeResource -> ResumeResource -> Bool
== :: ResumeResource -> ResumeResource -> Bool
$c== :: ResumeResource -> ResumeResource -> Bool
Prelude.Eq, ReadPrec [ResumeResource]
ReadPrec ResumeResource
Int -> ReadS ResumeResource
ReadS [ResumeResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeResource]
$creadListPrec :: ReadPrec [ResumeResource]
readPrec :: ReadPrec ResumeResource
$creadPrec :: ReadPrec ResumeResource
readList :: ReadS [ResumeResource]
$creadList :: ReadS [ResumeResource]
readsPrec :: Int -> ReadS ResumeResource
$creadsPrec :: Int -> ReadS ResumeResource
Prelude.Read, Int -> ResumeResource -> ShowS
[ResumeResource] -> ShowS
ResumeResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeResource] -> ShowS
$cshowList :: [ResumeResource] -> ShowS
show :: ResumeResource -> String
$cshow :: ResumeResource -> String
showsPrec :: Int -> ResumeResource -> ShowS
$cshowsPrec :: Int -> ResumeResource -> ShowS
Prelude.Show, forall x. Rep ResumeResource x -> ResumeResource
forall x. ResumeResource -> Rep ResumeResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResumeResource x -> ResumeResource
$cfrom :: forall x. ResumeResource -> Rep ResumeResource x
Prelude.Generic)

-- |
-- Create a value of 'ResumeResource' 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:
--
-- 'resourceArn', 'resumeResource_resourceArn' - The Amazon Resource Name (ARN) of the monitor resource to resume.
newResumeResource ::
  -- | 'resourceArn'
  Prelude.Text ->
  ResumeResource
newResumeResource :: Text -> ResumeResource
newResumeResource Text
pResourceArn_ =
  ResumeResource' {$sel:resourceArn:ResumeResource' :: Text
resourceArn = Text
pResourceArn_}

-- | The Amazon Resource Name (ARN) of the monitor resource to resume.
resumeResource_resourceArn :: Lens.Lens' ResumeResource Prelude.Text
resumeResource_resourceArn :: Lens' ResumeResource Text
resumeResource_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResumeResource' {Text
resourceArn :: Text
$sel:resourceArn:ResumeResource' :: ResumeResource -> Text
resourceArn} -> Text
resourceArn) (\s :: ResumeResource
s@ResumeResource' {} Text
a -> ResumeResource
s {$sel:resourceArn:ResumeResource' :: Text
resourceArn = Text
a} :: ResumeResource)

instance Core.AWSRequest ResumeResource where
  type
    AWSResponse ResumeResource =
      ResumeResourceResponse
  request :: (Service -> Service) -> ResumeResource -> Request ResumeResource
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ResumeResource
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ResumeResource)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull ResumeResourceResponse
ResumeResourceResponse'

instance Prelude.Hashable ResumeResource where
  hashWithSalt :: Int -> ResumeResource -> Int
hashWithSalt Int
_salt ResumeResource' {Text
resourceArn :: Text
$sel:resourceArn:ResumeResource' :: ResumeResource -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn

instance Prelude.NFData ResumeResource where
  rnf :: ResumeResource -> ()
rnf ResumeResource' {Text
resourceArn :: Text
$sel:resourceArn:ResumeResource' :: ResumeResource -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn

instance Data.ToHeaders ResumeResource where
  toHeaders :: ResumeResource -> [Header]
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"AmazonForecast.ResumeResource" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ResumeResource where
  toJSON :: ResumeResource -> Value
toJSON ResumeResource' {Text
resourceArn :: Text
$sel:resourceArn:ResumeResource' :: ResumeResource -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"ResourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceArn)]
      )

instance Data.ToPath ResumeResource where
  toPath :: ResumeResource -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newResumeResourceResponse' smart constructor.
data ResumeResourceResponse = ResumeResourceResponse'
  {
  }
  deriving (ResumeResourceResponse -> ResumeResourceResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResumeResourceResponse -> ResumeResourceResponse -> Bool
$c/= :: ResumeResourceResponse -> ResumeResourceResponse -> Bool
== :: ResumeResourceResponse -> ResumeResourceResponse -> Bool
$c== :: ResumeResourceResponse -> ResumeResourceResponse -> Bool
Prelude.Eq, ReadPrec [ResumeResourceResponse]
ReadPrec ResumeResourceResponse
Int -> ReadS ResumeResourceResponse
ReadS [ResumeResourceResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResumeResourceResponse]
$creadListPrec :: ReadPrec [ResumeResourceResponse]
readPrec :: ReadPrec ResumeResourceResponse
$creadPrec :: ReadPrec ResumeResourceResponse
readList :: ReadS [ResumeResourceResponse]
$creadList :: ReadS [ResumeResourceResponse]
readsPrec :: Int -> ReadS ResumeResourceResponse
$creadsPrec :: Int -> ReadS ResumeResourceResponse
Prelude.Read, Int -> ResumeResourceResponse -> ShowS
[ResumeResourceResponse] -> ShowS
ResumeResourceResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResumeResourceResponse] -> ShowS
$cshowList :: [ResumeResourceResponse] -> ShowS
show :: ResumeResourceResponse -> String
$cshow :: ResumeResourceResponse -> String
showsPrec :: Int -> ResumeResourceResponse -> ShowS
$cshowsPrec :: Int -> ResumeResourceResponse -> ShowS
Prelude.Show, forall x. Rep ResumeResourceResponse x -> ResumeResourceResponse
forall x. ResumeResourceResponse -> Rep ResumeResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResumeResourceResponse x -> ResumeResourceResponse
$cfrom :: forall x. ResumeResourceResponse -> Rep ResumeResourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'ResumeResourceResponse' 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.
newResumeResourceResponse ::
  ResumeResourceResponse
newResumeResourceResponse :: ResumeResourceResponse
newResumeResourceResponse = ResumeResourceResponse
ResumeResourceResponse'

instance Prelude.NFData ResumeResourceResponse where
  rnf :: ResumeResourceResponse -> ()
rnf ResumeResourceResponse
_ = ()