{-# 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.Connect.CreateHoursOfOperation
-- 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 hours of operation.
module Amazonka.Connect.CreateHoursOfOperation
  ( -- * Creating a Request
    CreateHoursOfOperation (..),
    newCreateHoursOfOperation,

    -- * Request Lenses
    createHoursOfOperation_description,
    createHoursOfOperation_tags,
    createHoursOfOperation_instanceId,
    createHoursOfOperation_name,
    createHoursOfOperation_timeZone,
    createHoursOfOperation_config,

    -- * Destructuring the Response
    CreateHoursOfOperationResponse (..),
    newCreateHoursOfOperationResponse,

    -- * Response Lenses
    createHoursOfOperationResponse_hoursOfOperationArn,
    createHoursOfOperationResponse_hoursOfOperationId,
    createHoursOfOperationResponse_httpStatus,
  )
where

import Amazonka.Connect.Types
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

-- | /See:/ 'newCreateHoursOfOperation' smart constructor.
data CreateHoursOfOperation = CreateHoursOfOperation'
  { -- | The description of the hours of operation.
    CreateHoursOfOperation -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | One or more tags.
    CreateHoursOfOperation -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    CreateHoursOfOperation -> Text
instanceId :: Prelude.Text,
    -- | The name of the hours of operation.
    CreateHoursOfOperation -> Text
name :: Prelude.Text,
    -- | The time zone of the hours of operation.
    CreateHoursOfOperation -> Text
timeZone :: Prelude.Text,
    -- | Configuration information for the hours of operation: day, start time,
    -- and end time.
    CreateHoursOfOperation -> [HoursOfOperationConfig]
config :: [HoursOfOperationConfig]
  }
  deriving (CreateHoursOfOperation -> CreateHoursOfOperation -> Bool
(CreateHoursOfOperation -> CreateHoursOfOperation -> Bool)
-> (CreateHoursOfOperation -> CreateHoursOfOperation -> Bool)
-> Eq CreateHoursOfOperation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHoursOfOperation -> CreateHoursOfOperation -> Bool
$c/= :: CreateHoursOfOperation -> CreateHoursOfOperation -> Bool
== :: CreateHoursOfOperation -> CreateHoursOfOperation -> Bool
$c== :: CreateHoursOfOperation -> CreateHoursOfOperation -> Bool
Prelude.Eq, ReadPrec [CreateHoursOfOperation]
ReadPrec CreateHoursOfOperation
Int -> ReadS CreateHoursOfOperation
ReadS [CreateHoursOfOperation]
(Int -> ReadS CreateHoursOfOperation)
-> ReadS [CreateHoursOfOperation]
-> ReadPrec CreateHoursOfOperation
-> ReadPrec [CreateHoursOfOperation]
-> Read CreateHoursOfOperation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHoursOfOperation]
$creadListPrec :: ReadPrec [CreateHoursOfOperation]
readPrec :: ReadPrec CreateHoursOfOperation
$creadPrec :: ReadPrec CreateHoursOfOperation
readList :: ReadS [CreateHoursOfOperation]
$creadList :: ReadS [CreateHoursOfOperation]
readsPrec :: Int -> ReadS CreateHoursOfOperation
$creadsPrec :: Int -> ReadS CreateHoursOfOperation
Prelude.Read, Int -> CreateHoursOfOperation -> ShowS
[CreateHoursOfOperation] -> ShowS
CreateHoursOfOperation -> String
(Int -> CreateHoursOfOperation -> ShowS)
-> (CreateHoursOfOperation -> String)
-> ([CreateHoursOfOperation] -> ShowS)
-> Show CreateHoursOfOperation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHoursOfOperation] -> ShowS
$cshowList :: [CreateHoursOfOperation] -> ShowS
show :: CreateHoursOfOperation -> String
$cshow :: CreateHoursOfOperation -> String
showsPrec :: Int -> CreateHoursOfOperation -> ShowS
$cshowsPrec :: Int -> CreateHoursOfOperation -> ShowS
Prelude.Show, (forall x. CreateHoursOfOperation -> Rep CreateHoursOfOperation x)
-> (forall x.
    Rep CreateHoursOfOperation x -> CreateHoursOfOperation)
-> Generic CreateHoursOfOperation
forall x. Rep CreateHoursOfOperation x -> CreateHoursOfOperation
forall x. CreateHoursOfOperation -> Rep CreateHoursOfOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateHoursOfOperation x -> CreateHoursOfOperation
$cfrom :: forall x. CreateHoursOfOperation -> Rep CreateHoursOfOperation x
Prelude.Generic)

-- |
-- Create a value of 'CreateHoursOfOperation' 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:
--
-- 'description', 'createHoursOfOperation_description' - The description of the hours of operation.
--
-- 'tags', 'createHoursOfOperation_tags' - One or more tags.
--
-- 'instanceId', 'createHoursOfOperation_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'name', 'createHoursOfOperation_name' - The name of the hours of operation.
--
-- 'timeZone', 'createHoursOfOperation_timeZone' - The time zone of the hours of operation.
--
-- 'config', 'createHoursOfOperation_config' - Configuration information for the hours of operation: day, start time,
-- and end time.
newCreateHoursOfOperation ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'timeZone'
  Prelude.Text ->
  CreateHoursOfOperation
newCreateHoursOfOperation :: Text -> Text -> Text -> CreateHoursOfOperation
newCreateHoursOfOperation
  Text
pInstanceId_
  Text
pName_
  Text
pTimeZone_ =
    CreateHoursOfOperation' :: Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> [HoursOfOperationConfig]
-> CreateHoursOfOperation
CreateHoursOfOperation'
      { $sel:description:CreateHoursOfOperation' :: Maybe Text
description =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateHoursOfOperation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:instanceId:CreateHoursOfOperation' :: Text
instanceId = Text
pInstanceId_,
        $sel:name:CreateHoursOfOperation' :: Text
name = Text
pName_,
        $sel:timeZone:CreateHoursOfOperation' :: Text
timeZone = Text
pTimeZone_,
        $sel:config:CreateHoursOfOperation' :: [HoursOfOperationConfig]
config = [HoursOfOperationConfig]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The description of the hours of operation.
createHoursOfOperation_description :: Lens.Lens' CreateHoursOfOperation (Prelude.Maybe Prelude.Text)
createHoursOfOperation_description :: (Maybe Text -> f (Maybe Text))
-> CreateHoursOfOperation -> f CreateHoursOfOperation
createHoursOfOperation_description = (CreateHoursOfOperation -> Maybe Text)
-> (CreateHoursOfOperation -> Maybe Text -> CreateHoursOfOperation)
-> Lens
     CreateHoursOfOperation
     CreateHoursOfOperation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHoursOfOperation' {Maybe Text
description :: Maybe Text
$sel:description:CreateHoursOfOperation' :: CreateHoursOfOperation -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateHoursOfOperation
s@CreateHoursOfOperation' {} Maybe Text
a -> CreateHoursOfOperation
s {$sel:description:CreateHoursOfOperation' :: Maybe Text
description = Maybe Text
a} :: CreateHoursOfOperation)

-- | One or more tags.
createHoursOfOperation_tags :: Lens.Lens' CreateHoursOfOperation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createHoursOfOperation_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateHoursOfOperation -> f CreateHoursOfOperation
createHoursOfOperation_tags = (CreateHoursOfOperation -> Maybe (HashMap Text Text))
-> (CreateHoursOfOperation
    -> Maybe (HashMap Text Text) -> CreateHoursOfOperation)
-> Lens
     CreateHoursOfOperation
     CreateHoursOfOperation
     (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 (\CreateHoursOfOperation' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateHoursOfOperation' :: CreateHoursOfOperation -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateHoursOfOperation
s@CreateHoursOfOperation' {} Maybe (HashMap Text Text)
a -> CreateHoursOfOperation
s {$sel:tags:CreateHoursOfOperation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateHoursOfOperation) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateHoursOfOperation -> f CreateHoursOfOperation)
-> ((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)))
-> CreateHoursOfOperation
-> f CreateHoursOfOperation
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 identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
createHoursOfOperation_instanceId :: Lens.Lens' CreateHoursOfOperation Prelude.Text
createHoursOfOperation_instanceId :: (Text -> f Text)
-> CreateHoursOfOperation -> f CreateHoursOfOperation
createHoursOfOperation_instanceId = (CreateHoursOfOperation -> Text)
-> (CreateHoursOfOperation -> Text -> CreateHoursOfOperation)
-> Lens CreateHoursOfOperation CreateHoursOfOperation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHoursOfOperation' {Text
instanceId :: Text
$sel:instanceId:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
instanceId} -> Text
instanceId) (\s :: CreateHoursOfOperation
s@CreateHoursOfOperation' {} Text
a -> CreateHoursOfOperation
s {$sel:instanceId:CreateHoursOfOperation' :: Text
instanceId = Text
a} :: CreateHoursOfOperation)

-- | The name of the hours of operation.
createHoursOfOperation_name :: Lens.Lens' CreateHoursOfOperation Prelude.Text
createHoursOfOperation_name :: (Text -> f Text)
-> CreateHoursOfOperation -> f CreateHoursOfOperation
createHoursOfOperation_name = (CreateHoursOfOperation -> Text)
-> (CreateHoursOfOperation -> Text -> CreateHoursOfOperation)
-> Lens CreateHoursOfOperation CreateHoursOfOperation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHoursOfOperation' {Text
name :: Text
$sel:name:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
name} -> Text
name) (\s :: CreateHoursOfOperation
s@CreateHoursOfOperation' {} Text
a -> CreateHoursOfOperation
s {$sel:name:CreateHoursOfOperation' :: Text
name = Text
a} :: CreateHoursOfOperation)

-- | The time zone of the hours of operation.
createHoursOfOperation_timeZone :: Lens.Lens' CreateHoursOfOperation Prelude.Text
createHoursOfOperation_timeZone :: (Text -> f Text)
-> CreateHoursOfOperation -> f CreateHoursOfOperation
createHoursOfOperation_timeZone = (CreateHoursOfOperation -> Text)
-> (CreateHoursOfOperation -> Text -> CreateHoursOfOperation)
-> Lens CreateHoursOfOperation CreateHoursOfOperation Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHoursOfOperation' {Text
timeZone :: Text
$sel:timeZone:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
timeZone} -> Text
timeZone) (\s :: CreateHoursOfOperation
s@CreateHoursOfOperation' {} Text
a -> CreateHoursOfOperation
s {$sel:timeZone:CreateHoursOfOperation' :: Text
timeZone = Text
a} :: CreateHoursOfOperation)

-- | Configuration information for the hours of operation: day, start time,
-- and end time.
createHoursOfOperation_config :: Lens.Lens' CreateHoursOfOperation [HoursOfOperationConfig]
createHoursOfOperation_config :: ([HoursOfOperationConfig] -> f [HoursOfOperationConfig])
-> CreateHoursOfOperation -> f CreateHoursOfOperation
createHoursOfOperation_config = (CreateHoursOfOperation -> [HoursOfOperationConfig])
-> (CreateHoursOfOperation
    -> [HoursOfOperationConfig] -> CreateHoursOfOperation)
-> Lens
     CreateHoursOfOperation
     CreateHoursOfOperation
     [HoursOfOperationConfig]
     [HoursOfOperationConfig]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHoursOfOperation' {[HoursOfOperationConfig]
config :: [HoursOfOperationConfig]
$sel:config:CreateHoursOfOperation' :: CreateHoursOfOperation -> [HoursOfOperationConfig]
config} -> [HoursOfOperationConfig]
config) (\s :: CreateHoursOfOperation
s@CreateHoursOfOperation' {} [HoursOfOperationConfig]
a -> CreateHoursOfOperation
s {$sel:config:CreateHoursOfOperation' :: [HoursOfOperationConfig]
config = [HoursOfOperationConfig]
a} :: CreateHoursOfOperation) (([HoursOfOperationConfig] -> f [HoursOfOperationConfig])
 -> CreateHoursOfOperation -> f CreateHoursOfOperation)
-> (([HoursOfOperationConfig] -> f [HoursOfOperationConfig])
    -> [HoursOfOperationConfig] -> f [HoursOfOperationConfig])
-> ([HoursOfOperationConfig] -> f [HoursOfOperationConfig])
-> CreateHoursOfOperation
-> f CreateHoursOfOperation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HoursOfOperationConfig] -> f [HoursOfOperationConfig])
-> [HoursOfOperationConfig] -> f [HoursOfOperationConfig]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest CreateHoursOfOperation where
  type
    AWSResponse CreateHoursOfOperation =
      CreateHoursOfOperationResponse
  request :: CreateHoursOfOperation -> Request CreateHoursOfOperation
request = Service -> CreateHoursOfOperation -> Request CreateHoursOfOperation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateHoursOfOperation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateHoursOfOperation)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateHoursOfOperation))
-> Logger
-> Service
-> Proxy CreateHoursOfOperation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateHoursOfOperation)))
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 ->
          Maybe Text -> Maybe Text -> Int -> CreateHoursOfOperationResponse
CreateHoursOfOperationResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateHoursOfOperationResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateHoursOfOperationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HoursOfOperationArn")
            Either String (Maybe Text -> Int -> CreateHoursOfOperationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateHoursOfOperationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"HoursOfOperationId")
            Either String (Int -> CreateHoursOfOperationResponse)
-> Either String Int
-> Either String CreateHoursOfOperationResponse
forall (f :: * -> *) a b. Applicative f => 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))
      )

instance Prelude.Hashable CreateHoursOfOperation

instance Prelude.NFData CreateHoursOfOperation

instance Core.ToHeaders CreateHoursOfOperation where
  toHeaders :: CreateHoursOfOperation -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateHoursOfOperation -> 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 CreateHoursOfOperation where
  toJSON :: CreateHoursOfOperation -> Value
toJSON CreateHoursOfOperation' {[HoursOfOperationConfig]
Maybe Text
Maybe (HashMap Text Text)
Text
config :: [HoursOfOperationConfig]
timeZone :: Text
name :: Text
instanceId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:config:CreateHoursOfOperation' :: CreateHoursOfOperation -> [HoursOfOperationConfig]
$sel:timeZone:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
$sel:name:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
$sel:instanceId:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
$sel:tags:CreateHoursOfOperation' :: CreateHoursOfOperation -> Maybe (HashMap Text Text)
$sel:description:CreateHoursOfOperation' :: CreateHoursOfOperation -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TimeZone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
timeZone),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Config" Text -> [HoursOfOperationConfig] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [HoursOfOperationConfig]
config)
          ]
      )

instance Core.ToPath CreateHoursOfOperation where
  toPath :: CreateHoursOfOperation -> ByteString
toPath CreateHoursOfOperation' {[HoursOfOperationConfig]
Maybe Text
Maybe (HashMap Text Text)
Text
config :: [HoursOfOperationConfig]
timeZone :: Text
name :: Text
instanceId :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:config:CreateHoursOfOperation' :: CreateHoursOfOperation -> [HoursOfOperationConfig]
$sel:timeZone:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
$sel:name:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
$sel:instanceId:CreateHoursOfOperation' :: CreateHoursOfOperation -> Text
$sel:tags:CreateHoursOfOperation' :: CreateHoursOfOperation -> Maybe (HashMap Text Text)
$sel:description:CreateHoursOfOperation' :: CreateHoursOfOperation -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/hours-of-operations/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId]

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

-- | /See:/ 'newCreateHoursOfOperationResponse' smart constructor.
data CreateHoursOfOperationResponse = CreateHoursOfOperationResponse'
  { -- | The Amazon Resource Name (ARN) for the hours of operation.
    CreateHoursOfOperationResponse -> Maybe Text
hoursOfOperationArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the hours of operation.
    CreateHoursOfOperationResponse -> Maybe Text
hoursOfOperationId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateHoursOfOperationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateHoursOfOperationResponse
-> CreateHoursOfOperationResponse -> Bool
(CreateHoursOfOperationResponse
 -> CreateHoursOfOperationResponse -> Bool)
-> (CreateHoursOfOperationResponse
    -> CreateHoursOfOperationResponse -> Bool)
-> Eq CreateHoursOfOperationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateHoursOfOperationResponse
-> CreateHoursOfOperationResponse -> Bool
$c/= :: CreateHoursOfOperationResponse
-> CreateHoursOfOperationResponse -> Bool
== :: CreateHoursOfOperationResponse
-> CreateHoursOfOperationResponse -> Bool
$c== :: CreateHoursOfOperationResponse
-> CreateHoursOfOperationResponse -> Bool
Prelude.Eq, ReadPrec [CreateHoursOfOperationResponse]
ReadPrec CreateHoursOfOperationResponse
Int -> ReadS CreateHoursOfOperationResponse
ReadS [CreateHoursOfOperationResponse]
(Int -> ReadS CreateHoursOfOperationResponse)
-> ReadS [CreateHoursOfOperationResponse]
-> ReadPrec CreateHoursOfOperationResponse
-> ReadPrec [CreateHoursOfOperationResponse]
-> Read CreateHoursOfOperationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateHoursOfOperationResponse]
$creadListPrec :: ReadPrec [CreateHoursOfOperationResponse]
readPrec :: ReadPrec CreateHoursOfOperationResponse
$creadPrec :: ReadPrec CreateHoursOfOperationResponse
readList :: ReadS [CreateHoursOfOperationResponse]
$creadList :: ReadS [CreateHoursOfOperationResponse]
readsPrec :: Int -> ReadS CreateHoursOfOperationResponse
$creadsPrec :: Int -> ReadS CreateHoursOfOperationResponse
Prelude.Read, Int -> CreateHoursOfOperationResponse -> ShowS
[CreateHoursOfOperationResponse] -> ShowS
CreateHoursOfOperationResponse -> String
(Int -> CreateHoursOfOperationResponse -> ShowS)
-> (CreateHoursOfOperationResponse -> String)
-> ([CreateHoursOfOperationResponse] -> ShowS)
-> Show CreateHoursOfOperationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateHoursOfOperationResponse] -> ShowS
$cshowList :: [CreateHoursOfOperationResponse] -> ShowS
show :: CreateHoursOfOperationResponse -> String
$cshow :: CreateHoursOfOperationResponse -> String
showsPrec :: Int -> CreateHoursOfOperationResponse -> ShowS
$cshowsPrec :: Int -> CreateHoursOfOperationResponse -> ShowS
Prelude.Show, (forall x.
 CreateHoursOfOperationResponse
 -> Rep CreateHoursOfOperationResponse x)
-> (forall x.
    Rep CreateHoursOfOperationResponse x
    -> CreateHoursOfOperationResponse)
-> Generic CreateHoursOfOperationResponse
forall x.
Rep CreateHoursOfOperationResponse x
-> CreateHoursOfOperationResponse
forall x.
CreateHoursOfOperationResponse
-> Rep CreateHoursOfOperationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateHoursOfOperationResponse x
-> CreateHoursOfOperationResponse
$cfrom :: forall x.
CreateHoursOfOperationResponse
-> Rep CreateHoursOfOperationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateHoursOfOperationResponse' 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:
--
-- 'hoursOfOperationArn', 'createHoursOfOperationResponse_hoursOfOperationArn' - The Amazon Resource Name (ARN) for the hours of operation.
--
-- 'hoursOfOperationId', 'createHoursOfOperationResponse_hoursOfOperationId' - The identifier for the hours of operation.
--
-- 'httpStatus', 'createHoursOfOperationResponse_httpStatus' - The response's http status code.
newCreateHoursOfOperationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateHoursOfOperationResponse
newCreateHoursOfOperationResponse :: Int -> CreateHoursOfOperationResponse
newCreateHoursOfOperationResponse Int
pHttpStatus_ =
  CreateHoursOfOperationResponse' :: Maybe Text -> Maybe Text -> Int -> CreateHoursOfOperationResponse
CreateHoursOfOperationResponse'
    { $sel:hoursOfOperationArn:CreateHoursOfOperationResponse' :: Maybe Text
hoursOfOperationArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hoursOfOperationId:CreateHoursOfOperationResponse' :: Maybe Text
hoursOfOperationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateHoursOfOperationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) for the hours of operation.
createHoursOfOperationResponse_hoursOfOperationArn :: Lens.Lens' CreateHoursOfOperationResponse (Prelude.Maybe Prelude.Text)
createHoursOfOperationResponse_hoursOfOperationArn :: (Maybe Text -> f (Maybe Text))
-> CreateHoursOfOperationResponse
-> f CreateHoursOfOperationResponse
createHoursOfOperationResponse_hoursOfOperationArn = (CreateHoursOfOperationResponse -> Maybe Text)
-> (CreateHoursOfOperationResponse
    -> Maybe Text -> CreateHoursOfOperationResponse)
-> Lens
     CreateHoursOfOperationResponse
     CreateHoursOfOperationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHoursOfOperationResponse' {Maybe Text
hoursOfOperationArn :: Maybe Text
$sel:hoursOfOperationArn:CreateHoursOfOperationResponse' :: CreateHoursOfOperationResponse -> Maybe Text
hoursOfOperationArn} -> Maybe Text
hoursOfOperationArn) (\s :: CreateHoursOfOperationResponse
s@CreateHoursOfOperationResponse' {} Maybe Text
a -> CreateHoursOfOperationResponse
s {$sel:hoursOfOperationArn:CreateHoursOfOperationResponse' :: Maybe Text
hoursOfOperationArn = Maybe Text
a} :: CreateHoursOfOperationResponse)

-- | The identifier for the hours of operation.
createHoursOfOperationResponse_hoursOfOperationId :: Lens.Lens' CreateHoursOfOperationResponse (Prelude.Maybe Prelude.Text)
createHoursOfOperationResponse_hoursOfOperationId :: (Maybe Text -> f (Maybe Text))
-> CreateHoursOfOperationResponse
-> f CreateHoursOfOperationResponse
createHoursOfOperationResponse_hoursOfOperationId = (CreateHoursOfOperationResponse -> Maybe Text)
-> (CreateHoursOfOperationResponse
    -> Maybe Text -> CreateHoursOfOperationResponse)
-> Lens
     CreateHoursOfOperationResponse
     CreateHoursOfOperationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateHoursOfOperationResponse' {Maybe Text
hoursOfOperationId :: Maybe Text
$sel:hoursOfOperationId:CreateHoursOfOperationResponse' :: CreateHoursOfOperationResponse -> Maybe Text
hoursOfOperationId} -> Maybe Text
hoursOfOperationId) (\s :: CreateHoursOfOperationResponse
s@CreateHoursOfOperationResponse' {} Maybe Text
a -> CreateHoursOfOperationResponse
s {$sel:hoursOfOperationId:CreateHoursOfOperationResponse' :: Maybe Text
hoursOfOperationId = Maybe Text
a} :: CreateHoursOfOperationResponse)

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

instance
  Prelude.NFData
    CreateHoursOfOperationResponse