{-# 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.DataBrew.CreateSchedule
-- 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)
--
-- Creates a new schedule for one or more DataBrew jobs. Jobs can be run at
-- a specific date and time, or at regular intervals.
module Amazonka.DataBrew.CreateSchedule
  ( -- * Creating a Request
    CreateSchedule (..),
    newCreateSchedule,

    -- * Request Lenses
    createSchedule_jobNames,
    createSchedule_tags,
    createSchedule_cronExpression,
    createSchedule_name,

    -- * Destructuring the Response
    CreateScheduleResponse (..),
    newCreateScheduleResponse,

    -- * Response Lenses
    createScheduleResponse_httpStatus,
    createScheduleResponse_name,
  )
where

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

-- | /See:/ 'newCreateSchedule' smart constructor.
data CreateSchedule = CreateSchedule'
  { -- | The name or names of one or more jobs to be run.
    CreateSchedule -> Maybe [Text]
jobNames :: Prelude.Maybe [Prelude.Text],
    -- | Metadata tags to apply to this schedule.
    CreateSchedule -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The date or dates and time or times when the jobs are to be run. For
    -- more information, see
    -- <https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html Cron expressions>
    -- in the /Glue DataBrew Developer Guide/.
    CreateSchedule -> Text
cronExpression :: Prelude.Text,
    -- | A unique name for the schedule. Valid characters are alphanumeric (A-Z,
    -- a-z, 0-9), hyphen (-), period (.), and space.
    CreateSchedule -> Text
name :: Prelude.Text
  }
  deriving (CreateSchedule -> CreateSchedule -> Bool
(CreateSchedule -> CreateSchedule -> Bool)
-> (CreateSchedule -> CreateSchedule -> Bool) -> Eq CreateSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateSchedule -> CreateSchedule -> Bool
$c/= :: CreateSchedule -> CreateSchedule -> Bool
== :: CreateSchedule -> CreateSchedule -> Bool
$c== :: CreateSchedule -> CreateSchedule -> Bool
Prelude.Eq, ReadPrec [CreateSchedule]
ReadPrec CreateSchedule
Int -> ReadS CreateSchedule
ReadS [CreateSchedule]
(Int -> ReadS CreateSchedule)
-> ReadS [CreateSchedule]
-> ReadPrec CreateSchedule
-> ReadPrec [CreateSchedule]
-> Read CreateSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateSchedule]
$creadListPrec :: ReadPrec [CreateSchedule]
readPrec :: ReadPrec CreateSchedule
$creadPrec :: ReadPrec CreateSchedule
readList :: ReadS [CreateSchedule]
$creadList :: ReadS [CreateSchedule]
readsPrec :: Int -> ReadS CreateSchedule
$creadsPrec :: Int -> ReadS CreateSchedule
Prelude.Read, Int -> CreateSchedule -> ShowS
[CreateSchedule] -> ShowS
CreateSchedule -> String
(Int -> CreateSchedule -> ShowS)
-> (CreateSchedule -> String)
-> ([CreateSchedule] -> ShowS)
-> Show CreateSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateSchedule] -> ShowS
$cshowList :: [CreateSchedule] -> ShowS
show :: CreateSchedule -> String
$cshow :: CreateSchedule -> String
showsPrec :: Int -> CreateSchedule -> ShowS
$cshowsPrec :: Int -> CreateSchedule -> ShowS
Prelude.Show, (forall x. CreateSchedule -> Rep CreateSchedule x)
-> (forall x. Rep CreateSchedule x -> CreateSchedule)
-> Generic CreateSchedule
forall x. Rep CreateSchedule x -> CreateSchedule
forall x. CreateSchedule -> Rep CreateSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateSchedule x -> CreateSchedule
$cfrom :: forall x. CreateSchedule -> Rep CreateSchedule x
Prelude.Generic)

-- |
-- Create a value of 'CreateSchedule' 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:
--
-- 'jobNames', 'createSchedule_jobNames' - The name or names of one or more jobs to be run.
--
-- 'tags', 'createSchedule_tags' - Metadata tags to apply to this schedule.
--
-- 'cronExpression', 'createSchedule_cronExpression' - The date or dates and time or times when the jobs are to be run. For
-- more information, see
-- <https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html Cron expressions>
-- in the /Glue DataBrew Developer Guide/.
--
-- 'name', 'createSchedule_name' - A unique name for the schedule. Valid characters are alphanumeric (A-Z,
-- a-z, 0-9), hyphen (-), period (.), and space.
newCreateSchedule ::
  -- | 'cronExpression'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  CreateSchedule
newCreateSchedule :: Text -> Text -> CreateSchedule
newCreateSchedule Text
pCronExpression_ Text
pName_ =
  CreateSchedule' :: Maybe [Text]
-> Maybe (HashMap Text Text) -> Text -> Text -> CreateSchedule
CreateSchedule'
    { $sel:jobNames:CreateSchedule' :: Maybe [Text]
jobNames = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateSchedule' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:cronExpression:CreateSchedule' :: Text
cronExpression = Text
pCronExpression_,
      $sel:name:CreateSchedule' :: Text
name = Text
pName_
    }

-- | The name or names of one or more jobs to be run.
createSchedule_jobNames :: Lens.Lens' CreateSchedule (Prelude.Maybe [Prelude.Text])
createSchedule_jobNames :: (Maybe [Text] -> f (Maybe [Text]))
-> CreateSchedule -> f CreateSchedule
createSchedule_jobNames = (CreateSchedule -> Maybe [Text])
-> (CreateSchedule -> Maybe [Text] -> CreateSchedule)
-> Lens CreateSchedule CreateSchedule (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSchedule' {Maybe [Text]
jobNames :: Maybe [Text]
$sel:jobNames:CreateSchedule' :: CreateSchedule -> Maybe [Text]
jobNames} -> Maybe [Text]
jobNames) (\s :: CreateSchedule
s@CreateSchedule' {} Maybe [Text]
a -> CreateSchedule
s {$sel:jobNames:CreateSchedule' :: Maybe [Text]
jobNames = Maybe [Text]
a} :: CreateSchedule) ((Maybe [Text] -> f (Maybe [Text]))
 -> CreateSchedule -> f CreateSchedule)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> CreateSchedule
-> f CreateSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Metadata tags to apply to this schedule.
createSchedule_tags :: Lens.Lens' CreateSchedule (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createSchedule_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateSchedule -> f CreateSchedule
createSchedule_tags = (CreateSchedule -> Maybe (HashMap Text Text))
-> (CreateSchedule -> Maybe (HashMap Text Text) -> CreateSchedule)
-> Lens
     CreateSchedule
     CreateSchedule
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSchedule' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateSchedule' :: CreateSchedule -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateSchedule
s@CreateSchedule' {} Maybe (HashMap Text Text)
a -> CreateSchedule
s {$sel:tags:CreateSchedule' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateSchedule) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateSchedule -> f CreateSchedule)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateSchedule
-> f CreateSchedule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The date or dates and time or times when the jobs are to be run. For
-- more information, see
-- <https://docs.aws.amazon.com/databrew/latest/dg/jobs.cron.html Cron expressions>
-- in the /Glue DataBrew Developer Guide/.
createSchedule_cronExpression :: Lens.Lens' CreateSchedule Prelude.Text
createSchedule_cronExpression :: (Text -> f Text) -> CreateSchedule -> f CreateSchedule
createSchedule_cronExpression = (CreateSchedule -> Text)
-> (CreateSchedule -> Text -> CreateSchedule)
-> Lens CreateSchedule CreateSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSchedule' {Text
cronExpression :: Text
$sel:cronExpression:CreateSchedule' :: CreateSchedule -> Text
cronExpression} -> Text
cronExpression) (\s :: CreateSchedule
s@CreateSchedule' {} Text
a -> CreateSchedule
s {$sel:cronExpression:CreateSchedule' :: Text
cronExpression = Text
a} :: CreateSchedule)

-- | A unique name for the schedule. Valid characters are alphanumeric (A-Z,
-- a-z, 0-9), hyphen (-), period (.), and space.
createSchedule_name :: Lens.Lens' CreateSchedule Prelude.Text
createSchedule_name :: (Text -> f Text) -> CreateSchedule -> f CreateSchedule
createSchedule_name = (CreateSchedule -> Text)
-> (CreateSchedule -> Text -> CreateSchedule)
-> Lens CreateSchedule CreateSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateSchedule' {Text
name :: Text
$sel:name:CreateSchedule' :: CreateSchedule -> Text
name} -> Text
name) (\s :: CreateSchedule
s@CreateSchedule' {} Text
a -> CreateSchedule
s {$sel:name:CreateSchedule' :: Text
name = Text
a} :: CreateSchedule)

instance Core.AWSRequest CreateSchedule where
  type
    AWSResponse CreateSchedule =
      CreateScheduleResponse
  request :: CreateSchedule -> Request CreateSchedule
request = Service -> CreateSchedule -> Request CreateSchedule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateSchedule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateSchedule)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateSchedule))
-> Logger
-> Service
-> Proxy CreateSchedule
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateSchedule)))
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 -> CreateScheduleResponse
CreateScheduleResponse'
            (Int -> Text -> CreateScheduleResponse)
-> Either String Int
-> Either String (Text -> CreateScheduleResponse)
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 -> CreateScheduleResponse)
-> Either String Text -> Either String CreateScheduleResponse
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
"Name")
      )

instance Prelude.Hashable CreateSchedule

instance Prelude.NFData CreateSchedule

instance Core.ToHeaders CreateSchedule where
  toHeaders :: CreateSchedule -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateSchedule -> 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 CreateSchedule where
  toJSON :: CreateSchedule -> Value
toJSON CreateSchedule' {Maybe [Text]
Maybe (HashMap Text Text)
Text
name :: Text
cronExpression :: Text
tags :: Maybe (HashMap Text Text)
jobNames :: Maybe [Text]
$sel:name:CreateSchedule' :: CreateSchedule -> Text
$sel:cronExpression:CreateSchedule' :: CreateSchedule -> Text
$sel:tags:CreateSchedule' :: CreateSchedule -> Maybe (HashMap Text Text)
$sel:jobNames:CreateSchedule' :: CreateSchedule -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"JobNames" 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]
jobNames,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"CronExpression" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
cronExpression),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name)
          ]
      )

instance Core.ToPath CreateSchedule where
  toPath :: CreateSchedule -> ByteString
toPath = ByteString -> CreateSchedule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/schedules"

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

-- | /See:/ 'newCreateScheduleResponse' smart constructor.
data CreateScheduleResponse = CreateScheduleResponse'
  { -- | The response's http status code.
    CreateScheduleResponse -> Int
httpStatus :: Prelude.Int,
    -- | The name of the schedule that was created.
    CreateScheduleResponse -> Text
name :: Prelude.Text
  }
  deriving (CreateScheduleResponse -> CreateScheduleResponse -> Bool
(CreateScheduleResponse -> CreateScheduleResponse -> Bool)
-> (CreateScheduleResponse -> CreateScheduleResponse -> Bool)
-> Eq CreateScheduleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateScheduleResponse -> CreateScheduleResponse -> Bool
$c/= :: CreateScheduleResponse -> CreateScheduleResponse -> Bool
== :: CreateScheduleResponse -> CreateScheduleResponse -> Bool
$c== :: CreateScheduleResponse -> CreateScheduleResponse -> Bool
Prelude.Eq, ReadPrec [CreateScheduleResponse]
ReadPrec CreateScheduleResponse
Int -> ReadS CreateScheduleResponse
ReadS [CreateScheduleResponse]
(Int -> ReadS CreateScheduleResponse)
-> ReadS [CreateScheduleResponse]
-> ReadPrec CreateScheduleResponse
-> ReadPrec [CreateScheduleResponse]
-> Read CreateScheduleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateScheduleResponse]
$creadListPrec :: ReadPrec [CreateScheduleResponse]
readPrec :: ReadPrec CreateScheduleResponse
$creadPrec :: ReadPrec CreateScheduleResponse
readList :: ReadS [CreateScheduleResponse]
$creadList :: ReadS [CreateScheduleResponse]
readsPrec :: Int -> ReadS CreateScheduleResponse
$creadsPrec :: Int -> ReadS CreateScheduleResponse
Prelude.Read, Int -> CreateScheduleResponse -> ShowS
[CreateScheduleResponse] -> ShowS
CreateScheduleResponse -> String
(Int -> CreateScheduleResponse -> ShowS)
-> (CreateScheduleResponse -> String)
-> ([CreateScheduleResponse] -> ShowS)
-> Show CreateScheduleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateScheduleResponse] -> ShowS
$cshowList :: [CreateScheduleResponse] -> ShowS
show :: CreateScheduleResponse -> String
$cshow :: CreateScheduleResponse -> String
showsPrec :: Int -> CreateScheduleResponse -> ShowS
$cshowsPrec :: Int -> CreateScheduleResponse -> ShowS
Prelude.Show, (forall x. CreateScheduleResponse -> Rep CreateScheduleResponse x)
-> (forall x.
    Rep CreateScheduleResponse x -> CreateScheduleResponse)
-> Generic CreateScheduleResponse
forall x. Rep CreateScheduleResponse x -> CreateScheduleResponse
forall x. CreateScheduleResponse -> Rep CreateScheduleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateScheduleResponse x -> CreateScheduleResponse
$cfrom :: forall x. CreateScheduleResponse -> Rep CreateScheduleResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateScheduleResponse' 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', 'createScheduleResponse_httpStatus' - The response's http status code.
--
-- 'name', 'createScheduleResponse_name' - The name of the schedule that was created.
newCreateScheduleResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'name'
  Prelude.Text ->
  CreateScheduleResponse
newCreateScheduleResponse :: Int -> Text -> CreateScheduleResponse
newCreateScheduleResponse Int
pHttpStatus_ Text
pName_ =
  CreateScheduleResponse' :: Int -> Text -> CreateScheduleResponse
CreateScheduleResponse'
    { $sel:httpStatus:CreateScheduleResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:name:CreateScheduleResponse' :: Text
name = Text
pName_
    }

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

-- | The name of the schedule that was created.
createScheduleResponse_name :: Lens.Lens' CreateScheduleResponse Prelude.Text
createScheduleResponse_name :: (Text -> f Text)
-> CreateScheduleResponse -> f CreateScheduleResponse
createScheduleResponse_name = (CreateScheduleResponse -> Text)
-> (CreateScheduleResponse -> Text -> CreateScheduleResponse)
-> Lens CreateScheduleResponse CreateScheduleResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateScheduleResponse' {Text
name :: Text
$sel:name:CreateScheduleResponse' :: CreateScheduleResponse -> Text
name} -> Text
name) (\s :: CreateScheduleResponse
s@CreateScheduleResponse' {} Text
a -> CreateScheduleResponse
s {$sel:name:CreateScheduleResponse' :: Text
name = Text
a} :: CreateScheduleResponse)

instance Prelude.NFData CreateScheduleResponse