{-# 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.AlexaBusiness.GetInvitationConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the configured values for the user enrollment invitation email
-- template.
module Amazonka.AlexaBusiness.GetInvitationConfiguration
  ( -- * Creating a Request
    GetInvitationConfiguration (..),
    newGetInvitationConfiguration,

    -- * Destructuring the Response
    GetInvitationConfigurationResponse (..),
    newGetInvitationConfigurationResponse,

    -- * Response Lenses
    getInvitationConfigurationResponse_contactEmail,
    getInvitationConfigurationResponse_organizationName,
    getInvitationConfigurationResponse_privateSkillIds,
    getInvitationConfigurationResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetInvitationConfiguration' smart constructor.
data GetInvitationConfiguration = GetInvitationConfiguration'
  {
  }
  deriving (GetInvitationConfiguration -> GetInvitationConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInvitationConfiguration -> GetInvitationConfiguration -> Bool
$c/= :: GetInvitationConfiguration -> GetInvitationConfiguration -> Bool
== :: GetInvitationConfiguration -> GetInvitationConfiguration -> Bool
$c== :: GetInvitationConfiguration -> GetInvitationConfiguration -> Bool
Prelude.Eq, ReadPrec [GetInvitationConfiguration]
ReadPrec GetInvitationConfiguration
Int -> ReadS GetInvitationConfiguration
ReadS [GetInvitationConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInvitationConfiguration]
$creadListPrec :: ReadPrec [GetInvitationConfiguration]
readPrec :: ReadPrec GetInvitationConfiguration
$creadPrec :: ReadPrec GetInvitationConfiguration
readList :: ReadS [GetInvitationConfiguration]
$creadList :: ReadS [GetInvitationConfiguration]
readsPrec :: Int -> ReadS GetInvitationConfiguration
$creadsPrec :: Int -> ReadS GetInvitationConfiguration
Prelude.Read, Int -> GetInvitationConfiguration -> ShowS
[GetInvitationConfiguration] -> ShowS
GetInvitationConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInvitationConfiguration] -> ShowS
$cshowList :: [GetInvitationConfiguration] -> ShowS
show :: GetInvitationConfiguration -> String
$cshow :: GetInvitationConfiguration -> String
showsPrec :: Int -> GetInvitationConfiguration -> ShowS
$cshowsPrec :: Int -> GetInvitationConfiguration -> ShowS
Prelude.Show, forall x.
Rep GetInvitationConfiguration x -> GetInvitationConfiguration
forall x.
GetInvitationConfiguration -> Rep GetInvitationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInvitationConfiguration x -> GetInvitationConfiguration
$cfrom :: forall x.
GetInvitationConfiguration -> Rep GetInvitationConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'GetInvitationConfiguration' 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.
newGetInvitationConfiguration ::
  GetInvitationConfiguration
newGetInvitationConfiguration :: GetInvitationConfiguration
newGetInvitationConfiguration =
  GetInvitationConfiguration
GetInvitationConfiguration'

instance Core.AWSRequest GetInvitationConfiguration where
  type
    AWSResponse GetInvitationConfiguration =
      GetInvitationConfigurationResponse
  request :: (Service -> Service)
-> GetInvitationConfiguration -> Request GetInvitationConfiguration
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetInvitationConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetInvitationConfiguration)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Int
-> GetInvitationConfigurationResponse
GetInvitationConfigurationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ContactEmail")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"OrganizationName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"PrivateSkillIds"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetInvitationConfiguration where
  hashWithSalt :: Int -> GetInvitationConfiguration -> Int
hashWithSalt Int
_salt GetInvitationConfiguration
_ =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ()

instance Prelude.NFData GetInvitationConfiguration where
  rnf :: GetInvitationConfiguration -> ()
rnf GetInvitationConfiguration
_ = ()

instance Data.ToHeaders GetInvitationConfiguration where
  toHeaders :: GetInvitationConfiguration -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AlexaForBusiness.GetInvitationConfiguration" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetInvitationConfiguration where
  toJSON :: GetInvitationConfiguration -> Value
toJSON = forall a b. a -> b -> a
Prelude.const (Object -> Value
Data.Object forall a. Monoid a => a
Prelude.mempty)

instance Data.ToPath GetInvitationConfiguration where
  toPath :: GetInvitationConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newGetInvitationConfigurationResponse' smart constructor.
data GetInvitationConfigurationResponse = GetInvitationConfigurationResponse'
  { -- | The email ID of the organization or individual contact that the enrolled
    -- user can use.
    GetInvitationConfigurationResponse -> Maybe Text
contactEmail :: Prelude.Maybe Prelude.Text,
    -- | The name of the organization sending the enrollment invite to a user.
    GetInvitationConfigurationResponse -> Maybe Text
organizationName :: Prelude.Maybe Prelude.Text,
    -- | The list of private skill IDs that you want to recommend to the user to
    -- enable in the invitation.
    GetInvitationConfigurationResponse -> Maybe [Text]
privateSkillIds :: Prelude.Maybe [Prelude.Text],
    -- | The response's http status code.
    GetInvitationConfigurationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetInvitationConfigurationResponse
-> GetInvitationConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInvitationConfigurationResponse
-> GetInvitationConfigurationResponse -> Bool
$c/= :: GetInvitationConfigurationResponse
-> GetInvitationConfigurationResponse -> Bool
== :: GetInvitationConfigurationResponse
-> GetInvitationConfigurationResponse -> Bool
$c== :: GetInvitationConfigurationResponse
-> GetInvitationConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetInvitationConfigurationResponse]
ReadPrec GetInvitationConfigurationResponse
Int -> ReadS GetInvitationConfigurationResponse
ReadS [GetInvitationConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInvitationConfigurationResponse]
$creadListPrec :: ReadPrec [GetInvitationConfigurationResponse]
readPrec :: ReadPrec GetInvitationConfigurationResponse
$creadPrec :: ReadPrec GetInvitationConfigurationResponse
readList :: ReadS [GetInvitationConfigurationResponse]
$creadList :: ReadS [GetInvitationConfigurationResponse]
readsPrec :: Int -> ReadS GetInvitationConfigurationResponse
$creadsPrec :: Int -> ReadS GetInvitationConfigurationResponse
Prelude.Read, Int -> GetInvitationConfigurationResponse -> ShowS
[GetInvitationConfigurationResponse] -> ShowS
GetInvitationConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInvitationConfigurationResponse] -> ShowS
$cshowList :: [GetInvitationConfigurationResponse] -> ShowS
show :: GetInvitationConfigurationResponse -> String
$cshow :: GetInvitationConfigurationResponse -> String
showsPrec :: Int -> GetInvitationConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetInvitationConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep GetInvitationConfigurationResponse x
-> GetInvitationConfigurationResponse
forall x.
GetInvitationConfigurationResponse
-> Rep GetInvitationConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInvitationConfigurationResponse x
-> GetInvitationConfigurationResponse
$cfrom :: forall x.
GetInvitationConfigurationResponse
-> Rep GetInvitationConfigurationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetInvitationConfigurationResponse' 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:
--
-- 'contactEmail', 'getInvitationConfigurationResponse_contactEmail' - The email ID of the organization or individual contact that the enrolled
-- user can use.
--
-- 'organizationName', 'getInvitationConfigurationResponse_organizationName' - The name of the organization sending the enrollment invite to a user.
--
-- 'privateSkillIds', 'getInvitationConfigurationResponse_privateSkillIds' - The list of private skill IDs that you want to recommend to the user to
-- enable in the invitation.
--
-- 'httpStatus', 'getInvitationConfigurationResponse_httpStatus' - The response's http status code.
newGetInvitationConfigurationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetInvitationConfigurationResponse
newGetInvitationConfigurationResponse :: Int -> GetInvitationConfigurationResponse
newGetInvitationConfigurationResponse Int
pHttpStatus_ =
  GetInvitationConfigurationResponse'
    { $sel:contactEmail:GetInvitationConfigurationResponse' :: Maybe Text
contactEmail =
        forall a. Maybe a
Prelude.Nothing,
      $sel:organizationName:GetInvitationConfigurationResponse' :: Maybe Text
organizationName = forall a. Maybe a
Prelude.Nothing,
      $sel:privateSkillIds:GetInvitationConfigurationResponse' :: Maybe [Text]
privateSkillIds = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetInvitationConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The email ID of the organization or individual contact that the enrolled
-- user can use.
getInvitationConfigurationResponse_contactEmail :: Lens.Lens' GetInvitationConfigurationResponse (Prelude.Maybe Prelude.Text)
getInvitationConfigurationResponse_contactEmail :: Lens' GetInvitationConfigurationResponse (Maybe Text)
getInvitationConfigurationResponse_contactEmail = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInvitationConfigurationResponse' {Maybe Text
contactEmail :: Maybe Text
$sel:contactEmail:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Maybe Text
contactEmail} -> Maybe Text
contactEmail) (\s :: GetInvitationConfigurationResponse
s@GetInvitationConfigurationResponse' {} Maybe Text
a -> GetInvitationConfigurationResponse
s {$sel:contactEmail:GetInvitationConfigurationResponse' :: Maybe Text
contactEmail = Maybe Text
a} :: GetInvitationConfigurationResponse)

-- | The name of the organization sending the enrollment invite to a user.
getInvitationConfigurationResponse_organizationName :: Lens.Lens' GetInvitationConfigurationResponse (Prelude.Maybe Prelude.Text)
getInvitationConfigurationResponse_organizationName :: Lens' GetInvitationConfigurationResponse (Maybe Text)
getInvitationConfigurationResponse_organizationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInvitationConfigurationResponse' {Maybe Text
organizationName :: Maybe Text
$sel:organizationName:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Maybe Text
organizationName} -> Maybe Text
organizationName) (\s :: GetInvitationConfigurationResponse
s@GetInvitationConfigurationResponse' {} Maybe Text
a -> GetInvitationConfigurationResponse
s {$sel:organizationName:GetInvitationConfigurationResponse' :: Maybe Text
organizationName = Maybe Text
a} :: GetInvitationConfigurationResponse)

-- | The list of private skill IDs that you want to recommend to the user to
-- enable in the invitation.
getInvitationConfigurationResponse_privateSkillIds :: Lens.Lens' GetInvitationConfigurationResponse (Prelude.Maybe [Prelude.Text])
getInvitationConfigurationResponse_privateSkillIds :: Lens' GetInvitationConfigurationResponse (Maybe [Text])
getInvitationConfigurationResponse_privateSkillIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInvitationConfigurationResponse' {Maybe [Text]
privateSkillIds :: Maybe [Text]
$sel:privateSkillIds:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Maybe [Text]
privateSkillIds} -> Maybe [Text]
privateSkillIds) (\s :: GetInvitationConfigurationResponse
s@GetInvitationConfigurationResponse' {} Maybe [Text]
a -> GetInvitationConfigurationResponse
s {$sel:privateSkillIds:GetInvitationConfigurationResponse' :: Maybe [Text]
privateSkillIds = Maybe [Text]
a} :: GetInvitationConfigurationResponse) 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 response's http status code.
getInvitationConfigurationResponse_httpStatus :: Lens.Lens' GetInvitationConfigurationResponse Prelude.Int
getInvitationConfigurationResponse_httpStatus :: Lens' GetInvitationConfigurationResponse Int
getInvitationConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInvitationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetInvitationConfigurationResponse
s@GetInvitationConfigurationResponse' {} Int
a -> GetInvitationConfigurationResponse
s {$sel:httpStatus:GetInvitationConfigurationResponse' :: Int
httpStatus = Int
a} :: GetInvitationConfigurationResponse)

instance
  Prelude.NFData
    GetInvitationConfigurationResponse
  where
  rnf :: GetInvitationConfigurationResponse -> ()
rnf GetInvitationConfigurationResponse' {Int
Maybe [Text]
Maybe Text
httpStatus :: Int
privateSkillIds :: Maybe [Text]
organizationName :: Maybe Text
contactEmail :: Maybe Text
$sel:httpStatus:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Int
$sel:privateSkillIds:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Maybe [Text]
$sel:organizationName:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Maybe Text
$sel:contactEmail:GetInvitationConfigurationResponse' :: GetInvitationConfigurationResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactEmail
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
organizationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
privateSkillIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus