{-# 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.CloudDirectory.GetLinkAttributes
-- 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)
--
-- Retrieves attributes that are associated with a typed link.
module Amazonka.CloudDirectory.GetLinkAttributes
  ( -- * Creating a Request
    GetLinkAttributes (..),
    newGetLinkAttributes,

    -- * Request Lenses
    getLinkAttributes_consistencyLevel,
    getLinkAttributes_directoryArn,
    getLinkAttributes_typedLinkSpecifier,
    getLinkAttributes_attributeNames,

    -- * Destructuring the Response
    GetLinkAttributesResponse (..),
    newGetLinkAttributesResponse,

    -- * Response Lenses
    getLinkAttributesResponse_attributes,
    getLinkAttributesResponse_httpStatus,
  )
where

import Amazonka.CloudDirectory.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:/ 'newGetLinkAttributes' smart constructor.
data GetLinkAttributes = GetLinkAttributes'
  { -- | The consistency level at which to retrieve the attributes on a typed
    -- link.
    GetLinkAttributes -> Maybe ConsistencyLevel
consistencyLevel :: Prelude.Maybe ConsistencyLevel,
    -- | The Amazon Resource Name (ARN) that is associated with the Directory
    -- where the typed link resides. For more information, see arns or
    -- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
    GetLinkAttributes -> Text
directoryArn :: Prelude.Text,
    -- | Allows a typed link specifier to be accepted as input.
    GetLinkAttributes -> TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier,
    -- | A list of attribute names whose values will be retrieved.
    GetLinkAttributes -> [Text]
attributeNames :: [Prelude.Text]
  }
  deriving (GetLinkAttributes -> GetLinkAttributes -> Bool
(GetLinkAttributes -> GetLinkAttributes -> Bool)
-> (GetLinkAttributes -> GetLinkAttributes -> Bool)
-> Eq GetLinkAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLinkAttributes -> GetLinkAttributes -> Bool
$c/= :: GetLinkAttributes -> GetLinkAttributes -> Bool
== :: GetLinkAttributes -> GetLinkAttributes -> Bool
$c== :: GetLinkAttributes -> GetLinkAttributes -> Bool
Prelude.Eq, ReadPrec [GetLinkAttributes]
ReadPrec GetLinkAttributes
Int -> ReadS GetLinkAttributes
ReadS [GetLinkAttributes]
(Int -> ReadS GetLinkAttributes)
-> ReadS [GetLinkAttributes]
-> ReadPrec GetLinkAttributes
-> ReadPrec [GetLinkAttributes]
-> Read GetLinkAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLinkAttributes]
$creadListPrec :: ReadPrec [GetLinkAttributes]
readPrec :: ReadPrec GetLinkAttributes
$creadPrec :: ReadPrec GetLinkAttributes
readList :: ReadS [GetLinkAttributes]
$creadList :: ReadS [GetLinkAttributes]
readsPrec :: Int -> ReadS GetLinkAttributes
$creadsPrec :: Int -> ReadS GetLinkAttributes
Prelude.Read, Int -> GetLinkAttributes -> ShowS
[GetLinkAttributes] -> ShowS
GetLinkAttributes -> String
(Int -> GetLinkAttributes -> ShowS)
-> (GetLinkAttributes -> String)
-> ([GetLinkAttributes] -> ShowS)
-> Show GetLinkAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLinkAttributes] -> ShowS
$cshowList :: [GetLinkAttributes] -> ShowS
show :: GetLinkAttributes -> String
$cshow :: GetLinkAttributes -> String
showsPrec :: Int -> GetLinkAttributes -> ShowS
$cshowsPrec :: Int -> GetLinkAttributes -> ShowS
Prelude.Show, (forall x. GetLinkAttributes -> Rep GetLinkAttributes x)
-> (forall x. Rep GetLinkAttributes x -> GetLinkAttributes)
-> Generic GetLinkAttributes
forall x. Rep GetLinkAttributes x -> GetLinkAttributes
forall x. GetLinkAttributes -> Rep GetLinkAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetLinkAttributes x -> GetLinkAttributes
$cfrom :: forall x. GetLinkAttributes -> Rep GetLinkAttributes x
Prelude.Generic)

-- |
-- Create a value of 'GetLinkAttributes' 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:
--
-- 'consistencyLevel', 'getLinkAttributes_consistencyLevel' - The consistency level at which to retrieve the attributes on a typed
-- link.
--
-- 'directoryArn', 'getLinkAttributes_directoryArn' - The Amazon Resource Name (ARN) that is associated with the Directory
-- where the typed link resides. For more information, see arns or
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
--
-- 'typedLinkSpecifier', 'getLinkAttributes_typedLinkSpecifier' - Allows a typed link specifier to be accepted as input.
--
-- 'attributeNames', 'getLinkAttributes_attributeNames' - A list of attribute names whose values will be retrieved.
newGetLinkAttributes ::
  -- | 'directoryArn'
  Prelude.Text ->
  -- | 'typedLinkSpecifier'
  TypedLinkSpecifier ->
  GetLinkAttributes
newGetLinkAttributes :: Text -> TypedLinkSpecifier -> GetLinkAttributes
newGetLinkAttributes
  Text
pDirectoryArn_
  TypedLinkSpecifier
pTypedLinkSpecifier_ =
    GetLinkAttributes' :: Maybe ConsistencyLevel
-> Text -> TypedLinkSpecifier -> [Text] -> GetLinkAttributes
GetLinkAttributes'
      { $sel:consistencyLevel:GetLinkAttributes' :: Maybe ConsistencyLevel
consistencyLevel =
          Maybe ConsistencyLevel
forall a. Maybe a
Prelude.Nothing,
        $sel:directoryArn:GetLinkAttributes' :: Text
directoryArn = Text
pDirectoryArn_,
        $sel:typedLinkSpecifier:GetLinkAttributes' :: TypedLinkSpecifier
typedLinkSpecifier = TypedLinkSpecifier
pTypedLinkSpecifier_,
        $sel:attributeNames:GetLinkAttributes' :: [Text]
attributeNames = [Text]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The consistency level at which to retrieve the attributes on a typed
-- link.
getLinkAttributes_consistencyLevel :: Lens.Lens' GetLinkAttributes (Prelude.Maybe ConsistencyLevel)
getLinkAttributes_consistencyLevel :: (Maybe ConsistencyLevel -> f (Maybe ConsistencyLevel))
-> GetLinkAttributes -> f GetLinkAttributes
getLinkAttributes_consistencyLevel = (GetLinkAttributes -> Maybe ConsistencyLevel)
-> (GetLinkAttributes
    -> Maybe ConsistencyLevel -> GetLinkAttributes)
-> Lens
     GetLinkAttributes
     GetLinkAttributes
     (Maybe ConsistencyLevel)
     (Maybe ConsistencyLevel)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLinkAttributes' {Maybe ConsistencyLevel
consistencyLevel :: Maybe ConsistencyLevel
$sel:consistencyLevel:GetLinkAttributes' :: GetLinkAttributes -> Maybe ConsistencyLevel
consistencyLevel} -> Maybe ConsistencyLevel
consistencyLevel) (\s :: GetLinkAttributes
s@GetLinkAttributes' {} Maybe ConsistencyLevel
a -> GetLinkAttributes
s {$sel:consistencyLevel:GetLinkAttributes' :: Maybe ConsistencyLevel
consistencyLevel = Maybe ConsistencyLevel
a} :: GetLinkAttributes)

-- | The Amazon Resource Name (ARN) that is associated with the Directory
-- where the typed link resides. For more information, see arns or
-- <https://docs.aws.amazon.com/clouddirectory/latest/developerguide/directory_objects_links.html#directory_objects_links_typedlink Typed Links>.
getLinkAttributes_directoryArn :: Lens.Lens' GetLinkAttributes Prelude.Text
getLinkAttributes_directoryArn :: (Text -> f Text) -> GetLinkAttributes -> f GetLinkAttributes
getLinkAttributes_directoryArn = (GetLinkAttributes -> Text)
-> (GetLinkAttributes -> Text -> GetLinkAttributes)
-> Lens GetLinkAttributes GetLinkAttributes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLinkAttributes' {Text
directoryArn :: Text
$sel:directoryArn:GetLinkAttributes' :: GetLinkAttributes -> Text
directoryArn} -> Text
directoryArn) (\s :: GetLinkAttributes
s@GetLinkAttributes' {} Text
a -> GetLinkAttributes
s {$sel:directoryArn:GetLinkAttributes' :: Text
directoryArn = Text
a} :: GetLinkAttributes)

-- | Allows a typed link specifier to be accepted as input.
getLinkAttributes_typedLinkSpecifier :: Lens.Lens' GetLinkAttributes TypedLinkSpecifier
getLinkAttributes_typedLinkSpecifier :: (TypedLinkSpecifier -> f TypedLinkSpecifier)
-> GetLinkAttributes -> f GetLinkAttributes
getLinkAttributes_typedLinkSpecifier = (GetLinkAttributes -> TypedLinkSpecifier)
-> (GetLinkAttributes -> TypedLinkSpecifier -> GetLinkAttributes)
-> Lens
     GetLinkAttributes
     GetLinkAttributes
     TypedLinkSpecifier
     TypedLinkSpecifier
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLinkAttributes' {TypedLinkSpecifier
typedLinkSpecifier :: TypedLinkSpecifier
$sel:typedLinkSpecifier:GetLinkAttributes' :: GetLinkAttributes -> TypedLinkSpecifier
typedLinkSpecifier} -> TypedLinkSpecifier
typedLinkSpecifier) (\s :: GetLinkAttributes
s@GetLinkAttributes' {} TypedLinkSpecifier
a -> GetLinkAttributes
s {$sel:typedLinkSpecifier:GetLinkAttributes' :: TypedLinkSpecifier
typedLinkSpecifier = TypedLinkSpecifier
a} :: GetLinkAttributes)

-- | A list of attribute names whose values will be retrieved.
getLinkAttributes_attributeNames :: Lens.Lens' GetLinkAttributes [Prelude.Text]
getLinkAttributes_attributeNames :: ([Text] -> f [Text]) -> GetLinkAttributes -> f GetLinkAttributes
getLinkAttributes_attributeNames = (GetLinkAttributes -> [Text])
-> (GetLinkAttributes -> [Text] -> GetLinkAttributes)
-> Lens GetLinkAttributes GetLinkAttributes [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLinkAttributes' {[Text]
attributeNames :: [Text]
$sel:attributeNames:GetLinkAttributes' :: GetLinkAttributes -> [Text]
attributeNames} -> [Text]
attributeNames) (\s :: GetLinkAttributes
s@GetLinkAttributes' {} [Text]
a -> GetLinkAttributes
s {$sel:attributeNames:GetLinkAttributes' :: [Text]
attributeNames = [Text]
a} :: GetLinkAttributes) (([Text] -> f [Text]) -> GetLinkAttributes -> f GetLinkAttributes)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GetLinkAttributes
-> f GetLinkAttributes
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest GetLinkAttributes where
  type
    AWSResponse GetLinkAttributes =
      GetLinkAttributesResponse
  request :: GetLinkAttributes -> Request GetLinkAttributes
request = Service -> GetLinkAttributes -> Request GetLinkAttributes
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetLinkAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetLinkAttributes)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetLinkAttributes))
-> Logger
-> Service
-> Proxy GetLinkAttributes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetLinkAttributes)))
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 [AttributeKeyAndValue] -> Int -> GetLinkAttributesResponse
GetLinkAttributesResponse'
            (Maybe [AttributeKeyAndValue] -> Int -> GetLinkAttributesResponse)
-> Either String (Maybe [AttributeKeyAndValue])
-> Either String (Int -> GetLinkAttributesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [AttributeKeyAndValue]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Attributes" Either String (Maybe (Maybe [AttributeKeyAndValue]))
-> Maybe [AttributeKeyAndValue]
-> Either String (Maybe [AttributeKeyAndValue])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AttributeKeyAndValue]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> GetLinkAttributesResponse)
-> Either String Int -> Either String GetLinkAttributesResponse
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 GetLinkAttributes

instance Prelude.NFData GetLinkAttributes

instance Core.ToHeaders GetLinkAttributes where
  toHeaders :: GetLinkAttributes -> ResponseHeaders
toHeaders GetLinkAttributes' {[Text]
Maybe ConsistencyLevel
Text
TypedLinkSpecifier
attributeNames :: [Text]
typedLinkSpecifier :: TypedLinkSpecifier
directoryArn :: Text
consistencyLevel :: Maybe ConsistencyLevel
$sel:attributeNames:GetLinkAttributes' :: GetLinkAttributes -> [Text]
$sel:typedLinkSpecifier:GetLinkAttributes' :: GetLinkAttributes -> TypedLinkSpecifier
$sel:directoryArn:GetLinkAttributes' :: GetLinkAttributes -> Text
$sel:consistencyLevel:GetLinkAttributes' :: GetLinkAttributes -> Maybe ConsistencyLevel
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [HeaderName
"x-amz-data-partition" HeaderName -> Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Text
directoryArn]

instance Core.ToJSON GetLinkAttributes where
  toJSON :: GetLinkAttributes -> Value
toJSON GetLinkAttributes' {[Text]
Maybe ConsistencyLevel
Text
TypedLinkSpecifier
attributeNames :: [Text]
typedLinkSpecifier :: TypedLinkSpecifier
directoryArn :: Text
consistencyLevel :: Maybe ConsistencyLevel
$sel:attributeNames:GetLinkAttributes' :: GetLinkAttributes -> [Text]
$sel:typedLinkSpecifier:GetLinkAttributes' :: GetLinkAttributes -> TypedLinkSpecifier
$sel:directoryArn:GetLinkAttributes' :: GetLinkAttributes -> Text
$sel:consistencyLevel:GetLinkAttributes' :: GetLinkAttributes -> Maybe ConsistencyLevel
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ConsistencyLevel" Text -> ConsistencyLevel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ConsistencyLevel -> Pair) -> Maybe ConsistencyLevel -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConsistencyLevel
consistencyLevel,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TypedLinkSpecifier" Text -> TypedLinkSpecifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TypedLinkSpecifier
typedLinkSpecifier),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AttributeNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
attributeNames)
          ]
      )

instance Core.ToPath GetLinkAttributes where
  toPath :: GetLinkAttributes -> ByteString
toPath =
    ByteString -> GetLinkAttributes -> ByteString
forall a b. a -> b -> a
Prelude.const
      ByteString
"/amazonclouddirectory/2017-01-11/typedlink/attributes/get"

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

-- | /See:/ 'newGetLinkAttributesResponse' smart constructor.
data GetLinkAttributesResponse = GetLinkAttributesResponse'
  { -- | The attributes that are associated with the typed link.
    GetLinkAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes :: Prelude.Maybe [AttributeKeyAndValue],
    -- | The response's http status code.
    GetLinkAttributesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetLinkAttributesResponse -> GetLinkAttributesResponse -> Bool
(GetLinkAttributesResponse -> GetLinkAttributesResponse -> Bool)
-> (GetLinkAttributesResponse -> GetLinkAttributesResponse -> Bool)
-> Eq GetLinkAttributesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLinkAttributesResponse -> GetLinkAttributesResponse -> Bool
$c/= :: GetLinkAttributesResponse -> GetLinkAttributesResponse -> Bool
== :: GetLinkAttributesResponse -> GetLinkAttributesResponse -> Bool
$c== :: GetLinkAttributesResponse -> GetLinkAttributesResponse -> Bool
Prelude.Eq, ReadPrec [GetLinkAttributesResponse]
ReadPrec GetLinkAttributesResponse
Int -> ReadS GetLinkAttributesResponse
ReadS [GetLinkAttributesResponse]
(Int -> ReadS GetLinkAttributesResponse)
-> ReadS [GetLinkAttributesResponse]
-> ReadPrec GetLinkAttributesResponse
-> ReadPrec [GetLinkAttributesResponse]
-> Read GetLinkAttributesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLinkAttributesResponse]
$creadListPrec :: ReadPrec [GetLinkAttributesResponse]
readPrec :: ReadPrec GetLinkAttributesResponse
$creadPrec :: ReadPrec GetLinkAttributesResponse
readList :: ReadS [GetLinkAttributesResponse]
$creadList :: ReadS [GetLinkAttributesResponse]
readsPrec :: Int -> ReadS GetLinkAttributesResponse
$creadsPrec :: Int -> ReadS GetLinkAttributesResponse
Prelude.Read, Int -> GetLinkAttributesResponse -> ShowS
[GetLinkAttributesResponse] -> ShowS
GetLinkAttributesResponse -> String
(Int -> GetLinkAttributesResponse -> ShowS)
-> (GetLinkAttributesResponse -> String)
-> ([GetLinkAttributesResponse] -> ShowS)
-> Show GetLinkAttributesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLinkAttributesResponse] -> ShowS
$cshowList :: [GetLinkAttributesResponse] -> ShowS
show :: GetLinkAttributesResponse -> String
$cshow :: GetLinkAttributesResponse -> String
showsPrec :: Int -> GetLinkAttributesResponse -> ShowS
$cshowsPrec :: Int -> GetLinkAttributesResponse -> ShowS
Prelude.Show, (forall x.
 GetLinkAttributesResponse -> Rep GetLinkAttributesResponse x)
-> (forall x.
    Rep GetLinkAttributesResponse x -> GetLinkAttributesResponse)
-> Generic GetLinkAttributesResponse
forall x.
Rep GetLinkAttributesResponse x -> GetLinkAttributesResponse
forall x.
GetLinkAttributesResponse -> Rep GetLinkAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLinkAttributesResponse x -> GetLinkAttributesResponse
$cfrom :: forall x.
GetLinkAttributesResponse -> Rep GetLinkAttributesResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetLinkAttributesResponse' 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:
--
-- 'attributes', 'getLinkAttributesResponse_attributes' - The attributes that are associated with the typed link.
--
-- 'httpStatus', 'getLinkAttributesResponse_httpStatus' - The response's http status code.
newGetLinkAttributesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetLinkAttributesResponse
newGetLinkAttributesResponse :: Int -> GetLinkAttributesResponse
newGetLinkAttributesResponse Int
pHttpStatus_ =
  GetLinkAttributesResponse' :: Maybe [AttributeKeyAndValue] -> Int -> GetLinkAttributesResponse
GetLinkAttributesResponse'
    { $sel:attributes:GetLinkAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes =
        Maybe [AttributeKeyAndValue]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetLinkAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The attributes that are associated with the typed link.
getLinkAttributesResponse_attributes :: Lens.Lens' GetLinkAttributesResponse (Prelude.Maybe [AttributeKeyAndValue])
getLinkAttributesResponse_attributes :: (Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
-> GetLinkAttributesResponse -> f GetLinkAttributesResponse
getLinkAttributesResponse_attributes = (GetLinkAttributesResponse -> Maybe [AttributeKeyAndValue])
-> (GetLinkAttributesResponse
    -> Maybe [AttributeKeyAndValue] -> GetLinkAttributesResponse)
-> Lens
     GetLinkAttributesResponse
     GetLinkAttributesResponse
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLinkAttributesResponse' {Maybe [AttributeKeyAndValue]
attributes :: Maybe [AttributeKeyAndValue]
$sel:attributes:GetLinkAttributesResponse' :: GetLinkAttributesResponse -> Maybe [AttributeKeyAndValue]
attributes} -> Maybe [AttributeKeyAndValue]
attributes) (\s :: GetLinkAttributesResponse
s@GetLinkAttributesResponse' {} Maybe [AttributeKeyAndValue]
a -> GetLinkAttributesResponse
s {$sel:attributes:GetLinkAttributesResponse' :: Maybe [AttributeKeyAndValue]
attributes = Maybe [AttributeKeyAndValue]
a} :: GetLinkAttributesResponse) ((Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
 -> GetLinkAttributesResponse -> f GetLinkAttributesResponse)
-> ((Maybe [AttributeKeyAndValue]
     -> f (Maybe [AttributeKeyAndValue]))
    -> Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> (Maybe [AttributeKeyAndValue]
    -> f (Maybe [AttributeKeyAndValue]))
-> GetLinkAttributesResponse
-> f GetLinkAttributesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
-> Iso
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
     (Maybe [AttributeKeyAndValue])
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
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
  [AttributeKeyAndValue]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData GetLinkAttributesResponse