{-# 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.NetworkManager.Types.Link
-- 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)
module Amazonka.NetworkManager.Types.Link where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkManager.Types.Bandwidth
import Amazonka.NetworkManager.Types.LinkState
import Amazonka.NetworkManager.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes a link.
--
-- /See:/ 'newLink' smart constructor.
data Link = Link'
  { -- | The state of the link.
    Link -> Maybe LinkState
state :: Prelude.Maybe LinkState,
    -- | The Amazon Resource Name (ARN) of the link.
    Link -> Maybe Text
linkArn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the link was created.
    Link -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The ID of the global network.
    Link -> Maybe Text
globalNetworkId :: Prelude.Maybe Prelude.Text,
    -- | The bandwidth for the link.
    Link -> Maybe Bandwidth
bandwidth :: Prelude.Maybe Bandwidth,
    -- | The ID of the link.
    Link -> Maybe Text
linkId :: Prelude.Maybe Prelude.Text,
    -- | The type of the link.
    Link -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | The ID of the site.
    Link -> Maybe Text
siteId :: Prelude.Maybe Prelude.Text,
    -- | The description of the link.
    Link -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The provider of the link.
    Link -> Maybe Text
provider :: Prelude.Maybe Prelude.Text,
    -- | The tags for the link.
    Link -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (Link -> Link -> Bool
(Link -> Link -> Bool) -> (Link -> Link -> Bool) -> Eq Link
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Link -> Link -> Bool
$c/= :: Link -> Link -> Bool
== :: Link -> Link -> Bool
$c== :: Link -> Link -> Bool
Prelude.Eq, ReadPrec [Link]
ReadPrec Link
Int -> ReadS Link
ReadS [Link]
(Int -> ReadS Link)
-> ReadS [Link] -> ReadPrec Link -> ReadPrec [Link] -> Read Link
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Link]
$creadListPrec :: ReadPrec [Link]
readPrec :: ReadPrec Link
$creadPrec :: ReadPrec Link
readList :: ReadS [Link]
$creadList :: ReadS [Link]
readsPrec :: Int -> ReadS Link
$creadsPrec :: Int -> ReadS Link
Prelude.Read, Int -> Link -> ShowS
[Link] -> ShowS
Link -> String
(Int -> Link -> ShowS)
-> (Link -> String) -> ([Link] -> ShowS) -> Show Link
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Link] -> ShowS
$cshowList :: [Link] -> ShowS
show :: Link -> String
$cshow :: Link -> String
showsPrec :: Int -> Link -> ShowS
$cshowsPrec :: Int -> Link -> ShowS
Prelude.Show, (forall x. Link -> Rep Link x)
-> (forall x. Rep Link x -> Link) -> Generic Link
forall x. Rep Link x -> Link
forall x. Link -> Rep Link x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Link x -> Link
$cfrom :: forall x. Link -> Rep Link x
Prelude.Generic)

-- |
-- Create a value of 'Link' 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:
--
-- 'state', 'link_state' - The state of the link.
--
-- 'linkArn', 'link_linkArn' - The Amazon Resource Name (ARN) of the link.
--
-- 'createdAt', 'link_createdAt' - The date and time that the link was created.
--
-- 'globalNetworkId', 'link_globalNetworkId' - The ID of the global network.
--
-- 'bandwidth', 'link_bandwidth' - The bandwidth for the link.
--
-- 'linkId', 'link_linkId' - The ID of the link.
--
-- 'type'', 'link_type' - The type of the link.
--
-- 'siteId', 'link_siteId' - The ID of the site.
--
-- 'description', 'link_description' - The description of the link.
--
-- 'provider', 'link_provider' - The provider of the link.
--
-- 'tags', 'link_tags' - The tags for the link.
newLink ::
  Link
newLink :: Link
newLink =
  Link' :: Maybe LinkState
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bandwidth
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Link
Link'
    { $sel:state:Link' :: Maybe LinkState
state = Maybe LinkState
forall a. Maybe a
Prelude.Nothing,
      $sel:linkArn:Link' :: Maybe Text
linkArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Link' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:Link' :: Maybe Text
globalNetworkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bandwidth:Link' :: Maybe Bandwidth
bandwidth = Maybe Bandwidth
forall a. Maybe a
Prelude.Nothing,
      $sel:linkId:Link' :: Maybe Text
linkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Link' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:siteId:Link' :: Maybe Text
siteId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Link' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:provider:Link' :: Maybe Text
provider = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Link' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The state of the link.
link_state :: Lens.Lens' Link (Prelude.Maybe LinkState)
link_state :: (Maybe LinkState -> f (Maybe LinkState)) -> Link -> f Link
link_state = (Link -> Maybe LinkState)
-> (Link -> Maybe LinkState -> Link)
-> Lens Link Link (Maybe LinkState) (Maybe LinkState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe LinkState
state :: Maybe LinkState
$sel:state:Link' :: Link -> Maybe LinkState
state} -> Maybe LinkState
state) (\s :: Link
s@Link' {} Maybe LinkState
a -> Link
s {$sel:state:Link' :: Maybe LinkState
state = Maybe LinkState
a} :: Link)

-- | The Amazon Resource Name (ARN) of the link.
link_linkArn :: Lens.Lens' Link (Prelude.Maybe Prelude.Text)
link_linkArn :: (Maybe Text -> f (Maybe Text)) -> Link -> f Link
link_linkArn = (Link -> Maybe Text)
-> (Link -> Maybe Text -> Link)
-> Lens Link Link (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe Text
linkArn :: Maybe Text
$sel:linkArn:Link' :: Link -> Maybe Text
linkArn} -> Maybe Text
linkArn) (\s :: Link
s@Link' {} Maybe Text
a -> Link
s {$sel:linkArn:Link' :: Maybe Text
linkArn = Maybe Text
a} :: Link)

-- | The date and time that the link was created.
link_createdAt :: Lens.Lens' Link (Prelude.Maybe Prelude.UTCTime)
link_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Link -> f Link
link_createdAt = (Link -> Maybe POSIX)
-> (Link -> Maybe POSIX -> Link)
-> Lens Link Link (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Link' :: Link -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Link
s@Link' {} Maybe POSIX
a -> Link
s {$sel:createdAt:Link' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Link) ((Maybe POSIX -> f (Maybe POSIX)) -> Link -> f Link)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Link
-> f Link
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The ID of the global network.
link_globalNetworkId :: Lens.Lens' Link (Prelude.Maybe Prelude.Text)
link_globalNetworkId :: (Maybe Text -> f (Maybe Text)) -> Link -> f Link
link_globalNetworkId = (Link -> Maybe Text)
-> (Link -> Maybe Text -> Link)
-> Lens Link Link (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe Text
globalNetworkId :: Maybe Text
$sel:globalNetworkId:Link' :: Link -> Maybe Text
globalNetworkId} -> Maybe Text
globalNetworkId) (\s :: Link
s@Link' {} Maybe Text
a -> Link
s {$sel:globalNetworkId:Link' :: Maybe Text
globalNetworkId = Maybe Text
a} :: Link)

-- | The bandwidth for the link.
link_bandwidth :: Lens.Lens' Link (Prelude.Maybe Bandwidth)
link_bandwidth :: (Maybe Bandwidth -> f (Maybe Bandwidth)) -> Link -> f Link
link_bandwidth = (Link -> Maybe Bandwidth)
-> (Link -> Maybe Bandwidth -> Link)
-> Lens Link Link (Maybe Bandwidth) (Maybe Bandwidth)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe Bandwidth
bandwidth :: Maybe Bandwidth
$sel:bandwidth:Link' :: Link -> Maybe Bandwidth
bandwidth} -> Maybe Bandwidth
bandwidth) (\s :: Link
s@Link' {} Maybe Bandwidth
a -> Link
s {$sel:bandwidth:Link' :: Maybe Bandwidth
bandwidth = Maybe Bandwidth
a} :: Link)

-- | The ID of the link.
link_linkId :: Lens.Lens' Link (Prelude.Maybe Prelude.Text)
link_linkId :: (Maybe Text -> f (Maybe Text)) -> Link -> f Link
link_linkId = (Link -> Maybe Text)
-> (Link -> Maybe Text -> Link)
-> Lens Link Link (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe Text
linkId :: Maybe Text
$sel:linkId:Link' :: Link -> Maybe Text
linkId} -> Maybe Text
linkId) (\s :: Link
s@Link' {} Maybe Text
a -> Link
s {$sel:linkId:Link' :: Maybe Text
linkId = Maybe Text
a} :: Link)

-- | The type of the link.
link_type :: Lens.Lens' Link (Prelude.Maybe Prelude.Text)
link_type :: (Maybe Text -> f (Maybe Text)) -> Link -> f Link
link_type = (Link -> Maybe Text)
-> (Link -> Maybe Text -> Link)
-> Lens Link Link (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe Text
type' :: Maybe Text
$sel:type':Link' :: Link -> Maybe Text
type'} -> Maybe Text
type') (\s :: Link
s@Link' {} Maybe Text
a -> Link
s {$sel:type':Link' :: Maybe Text
type' = Maybe Text
a} :: Link)

-- | The ID of the site.
link_siteId :: Lens.Lens' Link (Prelude.Maybe Prelude.Text)
link_siteId :: (Maybe Text -> f (Maybe Text)) -> Link -> f Link
link_siteId = (Link -> Maybe Text)
-> (Link -> Maybe Text -> Link)
-> Lens Link Link (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe Text
siteId :: Maybe Text
$sel:siteId:Link' :: Link -> Maybe Text
siteId} -> Maybe Text
siteId) (\s :: Link
s@Link' {} Maybe Text
a -> Link
s {$sel:siteId:Link' :: Maybe Text
siteId = Maybe Text
a} :: Link)

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

-- | The provider of the link.
link_provider :: Lens.Lens' Link (Prelude.Maybe Prelude.Text)
link_provider :: (Maybe Text -> f (Maybe Text)) -> Link -> f Link
link_provider = (Link -> Maybe Text)
-> (Link -> Maybe Text -> Link)
-> Lens Link Link (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe Text
provider :: Maybe Text
$sel:provider:Link' :: Link -> Maybe Text
provider} -> Maybe Text
provider) (\s :: Link
s@Link' {} Maybe Text
a -> Link
s {$sel:provider:Link' :: Maybe Text
provider = Maybe Text
a} :: Link)

-- | The tags for the link.
link_tags :: Lens.Lens' Link (Prelude.Maybe [Tag])
link_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> Link -> f Link
link_tags = (Link -> Maybe [Tag])
-> (Link -> Maybe [Tag] -> Link)
-> Lens Link Link (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Link' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Link' :: Link -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Link
s@Link' {} Maybe [Tag]
a -> Link
s {$sel:tags:Link' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Link) ((Maybe [Tag] -> f (Maybe [Tag])) -> Link -> f Link)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Link
-> f Link
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Link where
  parseJSON :: Value -> Parser Link
parseJSON =
    String -> (Object -> Parser Link) -> Value -> Parser Link
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Link"
      ( \Object
x ->
          Maybe LinkState
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bandwidth
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Link
Link'
            (Maybe LinkState
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Bandwidth
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Tag]
 -> Link)
-> Parser (Maybe LinkState)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bandwidth
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Link)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe LinkState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bandwidth
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Link)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Bandwidth
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LinkArn")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Bandwidth
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Link)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Bandwidth
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatedAt")
            Parser
  (Maybe Text
   -> Maybe Bandwidth
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Link)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bandwidth
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GlobalNetworkId")
            Parser
  (Maybe Bandwidth
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Link)
-> Parser (Maybe Bandwidth)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bandwidth)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Bandwidth")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Link)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LinkId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Link)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Link)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SiteId")
            Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> Link)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser (Maybe Text -> Maybe [Tag] -> Link)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> Link)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Provider")
            Parser (Maybe [Tag] -> Link) -> Parser (Maybe [Tag]) -> Parser Link
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Link

instance Prelude.NFData Link