{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.HoursOfOperation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Connect.Types.HoursOfOperation where

import Amazonka.Connect.Types.HoursOfOperationConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Information about of the hours of operation.
--
-- /See:/ 'newHoursOfOperation' smart constructor.
data HoursOfOperation = HoursOfOperation'
  { -- | Configuration information for the hours of operation.
    HoursOfOperation -> Maybe [HoursOfOperationConfig]
config :: Prelude.Maybe [HoursOfOperationConfig],
    -- | The description for the hours of operation.
    HoursOfOperation -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the hours of operation.
    HoursOfOperation -> Maybe Text
hoursOfOperationArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the hours of operation.
    HoursOfOperation -> Maybe Text
hoursOfOperationId :: Prelude.Maybe Prelude.Text,
    -- | The name for the hours of operation.
    HoursOfOperation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The tags used to organize, track, or control access for this resource.
    -- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
    HoursOfOperation -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The time zone for the hours of operation.
    HoursOfOperation -> Maybe Text
timeZone :: Prelude.Maybe Prelude.Text
  }
  deriving (HoursOfOperation -> HoursOfOperation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HoursOfOperation -> HoursOfOperation -> Bool
$c/= :: HoursOfOperation -> HoursOfOperation -> Bool
== :: HoursOfOperation -> HoursOfOperation -> Bool
$c== :: HoursOfOperation -> HoursOfOperation -> Bool
Prelude.Eq, ReadPrec [HoursOfOperation]
ReadPrec HoursOfOperation
Int -> ReadS HoursOfOperation
ReadS [HoursOfOperation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HoursOfOperation]
$creadListPrec :: ReadPrec [HoursOfOperation]
readPrec :: ReadPrec HoursOfOperation
$creadPrec :: ReadPrec HoursOfOperation
readList :: ReadS [HoursOfOperation]
$creadList :: ReadS [HoursOfOperation]
readsPrec :: Int -> ReadS HoursOfOperation
$creadsPrec :: Int -> ReadS HoursOfOperation
Prelude.Read, Int -> HoursOfOperation -> ShowS
[HoursOfOperation] -> ShowS
HoursOfOperation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HoursOfOperation] -> ShowS
$cshowList :: [HoursOfOperation] -> ShowS
show :: HoursOfOperation -> String
$cshow :: HoursOfOperation -> String
showsPrec :: Int -> HoursOfOperation -> ShowS
$cshowsPrec :: Int -> HoursOfOperation -> ShowS
Prelude.Show, forall x. Rep HoursOfOperation x -> HoursOfOperation
forall x. HoursOfOperation -> Rep HoursOfOperation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HoursOfOperation x -> HoursOfOperation
$cfrom :: forall x. HoursOfOperation -> Rep HoursOfOperation x
Prelude.Generic)

-- |
-- Create a value of 'HoursOfOperation' 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:
--
-- 'config', 'hoursOfOperation_config' - Configuration information for the hours of operation.
--
-- 'description', 'hoursOfOperation_description' - The description for the hours of operation.
--
-- 'hoursOfOperationArn', 'hoursOfOperation_hoursOfOperationArn' - The Amazon Resource Name (ARN) for the hours of operation.
--
-- 'hoursOfOperationId', 'hoursOfOperation_hoursOfOperationId' - The identifier for the hours of operation.
--
-- 'name', 'hoursOfOperation_name' - The name for the hours of operation.
--
-- 'tags', 'hoursOfOperation_tags' - The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
--
-- 'timeZone', 'hoursOfOperation_timeZone' - The time zone for the hours of operation.
newHoursOfOperation ::
  HoursOfOperation
newHoursOfOperation :: HoursOfOperation
newHoursOfOperation =
  HoursOfOperation'
    { $sel:config:HoursOfOperation' :: Maybe [HoursOfOperationConfig]
config = forall a. Maybe a
Prelude.Nothing,
      $sel:description:HoursOfOperation' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:hoursOfOperationArn:HoursOfOperation' :: Maybe Text
hoursOfOperationArn = forall a. Maybe a
Prelude.Nothing,
      $sel:hoursOfOperationId:HoursOfOperation' :: Maybe Text
hoursOfOperationId = forall a. Maybe a
Prelude.Nothing,
      $sel:name:HoursOfOperation' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:HoursOfOperation' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:timeZone:HoursOfOperation' :: Maybe Text
timeZone = forall a. Maybe a
Prelude.Nothing
    }

-- | Configuration information for the hours of operation.
hoursOfOperation_config :: Lens.Lens' HoursOfOperation (Prelude.Maybe [HoursOfOperationConfig])
hoursOfOperation_config :: Lens' HoursOfOperation (Maybe [HoursOfOperationConfig])
hoursOfOperation_config = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoursOfOperation' {Maybe [HoursOfOperationConfig]
config :: Maybe [HoursOfOperationConfig]
$sel:config:HoursOfOperation' :: HoursOfOperation -> Maybe [HoursOfOperationConfig]
config} -> Maybe [HoursOfOperationConfig]
config) (\s :: HoursOfOperation
s@HoursOfOperation' {} Maybe [HoursOfOperationConfig]
a -> HoursOfOperation
s {$sel:config:HoursOfOperation' :: Maybe [HoursOfOperationConfig]
config = Maybe [HoursOfOperationConfig]
a} :: HoursOfOperation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

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

-- | The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
hoursOfOperation_tags :: Lens.Lens' HoursOfOperation (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
hoursOfOperation_tags :: Lens' HoursOfOperation (Maybe (HashMap Text Text))
hoursOfOperation_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HoursOfOperation' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:HoursOfOperation' :: HoursOfOperation -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: HoursOfOperation
s@HoursOfOperation' {} Maybe (HashMap Text Text)
a -> HoursOfOperation
s {$sel:tags:HoursOfOperation' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: HoursOfOperation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Data.FromJSON HoursOfOperation where
  parseJSON :: Value -> Parser HoursOfOperation
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"HoursOfOperation"
      ( \Object
x ->
          Maybe [HoursOfOperationConfig]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> HoursOfOperation
HoursOfOperation'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Config" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HoursOfOperationArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HoursOfOperationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"TimeZone")
      )

instance Prelude.Hashable HoursOfOperation where
  hashWithSalt :: Int -> HoursOfOperation -> Int
hashWithSalt Int
_salt HoursOfOperation' {Maybe [HoursOfOperationConfig]
Maybe Text
Maybe (HashMap Text Text)
timeZone :: Maybe Text
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
hoursOfOperationId :: Maybe Text
hoursOfOperationArn :: Maybe Text
description :: Maybe Text
config :: Maybe [HoursOfOperationConfig]
$sel:timeZone:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:tags:HoursOfOperation' :: HoursOfOperation -> Maybe (HashMap Text Text)
$sel:name:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:hoursOfOperationId:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:hoursOfOperationArn:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:description:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:config:HoursOfOperation' :: HoursOfOperation -> Maybe [HoursOfOperationConfig]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [HoursOfOperationConfig]
config
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hoursOfOperationArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hoursOfOperationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
timeZone

instance Prelude.NFData HoursOfOperation where
  rnf :: HoursOfOperation -> ()
rnf HoursOfOperation' {Maybe [HoursOfOperationConfig]
Maybe Text
Maybe (HashMap Text Text)
timeZone :: Maybe Text
tags :: Maybe (HashMap Text Text)
name :: Maybe Text
hoursOfOperationId :: Maybe Text
hoursOfOperationArn :: Maybe Text
description :: Maybe Text
config :: Maybe [HoursOfOperationConfig]
$sel:timeZone:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:tags:HoursOfOperation' :: HoursOfOperation -> Maybe (HashMap Text Text)
$sel:name:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:hoursOfOperationId:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:hoursOfOperationArn:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:description:HoursOfOperation' :: HoursOfOperation -> Maybe Text
$sel:config:HoursOfOperation' :: HoursOfOperation -> Maybe [HoursOfOperationConfig]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [HoursOfOperationConfig]
config
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hoursOfOperationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hoursOfOperationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
timeZone