{-# 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.SageMaker.DescribeSubscribedWorkteam
-- 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)
--
-- Gets information about a work team provided by a vendor. It returns
-- details about the subscription with a vendor in the Amazon Web Services
-- Marketplace.
module Amazonka.SageMaker.DescribeSubscribedWorkteam
  ( -- * Creating a Request
    DescribeSubscribedWorkteam (..),
    newDescribeSubscribedWorkteam,

    -- * Request Lenses
    describeSubscribedWorkteam_workteamArn,

    -- * Destructuring the Response
    DescribeSubscribedWorkteamResponse (..),
    newDescribeSubscribedWorkteamResponse,

    -- * Response Lenses
    describeSubscribedWorkteamResponse_httpStatus,
    describeSubscribedWorkteamResponse_subscribedWorkteam,
  )
where

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

-- | /See:/ 'newDescribeSubscribedWorkteam' smart constructor.
data DescribeSubscribedWorkteam = DescribeSubscribedWorkteam'
  { -- | The Amazon Resource Name (ARN) of the subscribed work team to describe.
    DescribeSubscribedWorkteam -> Text
workteamArn :: Prelude.Text
  }
  deriving (DescribeSubscribedWorkteam -> DescribeSubscribedWorkteam -> Bool
(DescribeSubscribedWorkteam -> DescribeSubscribedWorkteam -> Bool)
-> (DescribeSubscribedWorkteam
    -> DescribeSubscribedWorkteam -> Bool)
-> Eq DescribeSubscribedWorkteam
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSubscribedWorkteam -> DescribeSubscribedWorkteam -> Bool
$c/= :: DescribeSubscribedWorkteam -> DescribeSubscribedWorkteam -> Bool
== :: DescribeSubscribedWorkteam -> DescribeSubscribedWorkteam -> Bool
$c== :: DescribeSubscribedWorkteam -> DescribeSubscribedWorkteam -> Bool
Prelude.Eq, ReadPrec [DescribeSubscribedWorkteam]
ReadPrec DescribeSubscribedWorkteam
Int -> ReadS DescribeSubscribedWorkteam
ReadS [DescribeSubscribedWorkteam]
(Int -> ReadS DescribeSubscribedWorkteam)
-> ReadS [DescribeSubscribedWorkteam]
-> ReadPrec DescribeSubscribedWorkteam
-> ReadPrec [DescribeSubscribedWorkteam]
-> Read DescribeSubscribedWorkteam
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSubscribedWorkteam]
$creadListPrec :: ReadPrec [DescribeSubscribedWorkteam]
readPrec :: ReadPrec DescribeSubscribedWorkteam
$creadPrec :: ReadPrec DescribeSubscribedWorkteam
readList :: ReadS [DescribeSubscribedWorkteam]
$creadList :: ReadS [DescribeSubscribedWorkteam]
readsPrec :: Int -> ReadS DescribeSubscribedWorkteam
$creadsPrec :: Int -> ReadS DescribeSubscribedWorkteam
Prelude.Read, Int -> DescribeSubscribedWorkteam -> ShowS
[DescribeSubscribedWorkteam] -> ShowS
DescribeSubscribedWorkteam -> String
(Int -> DescribeSubscribedWorkteam -> ShowS)
-> (DescribeSubscribedWorkteam -> String)
-> ([DescribeSubscribedWorkteam] -> ShowS)
-> Show DescribeSubscribedWorkteam
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSubscribedWorkteam] -> ShowS
$cshowList :: [DescribeSubscribedWorkteam] -> ShowS
show :: DescribeSubscribedWorkteam -> String
$cshow :: DescribeSubscribedWorkteam -> String
showsPrec :: Int -> DescribeSubscribedWorkteam -> ShowS
$cshowsPrec :: Int -> DescribeSubscribedWorkteam -> ShowS
Prelude.Show, (forall x.
 DescribeSubscribedWorkteam -> Rep DescribeSubscribedWorkteam x)
-> (forall x.
    Rep DescribeSubscribedWorkteam x -> DescribeSubscribedWorkteam)
-> Generic DescribeSubscribedWorkteam
forall x.
Rep DescribeSubscribedWorkteam x -> DescribeSubscribedWorkteam
forall x.
DescribeSubscribedWorkteam -> Rep DescribeSubscribedWorkteam x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSubscribedWorkteam x -> DescribeSubscribedWorkteam
$cfrom :: forall x.
DescribeSubscribedWorkteam -> Rep DescribeSubscribedWorkteam x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSubscribedWorkteam' 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:
--
-- 'workteamArn', 'describeSubscribedWorkteam_workteamArn' - The Amazon Resource Name (ARN) of the subscribed work team to describe.
newDescribeSubscribedWorkteam ::
  -- | 'workteamArn'
  Prelude.Text ->
  DescribeSubscribedWorkteam
newDescribeSubscribedWorkteam :: Text -> DescribeSubscribedWorkteam
newDescribeSubscribedWorkteam Text
pWorkteamArn_ =
  DescribeSubscribedWorkteam' :: Text -> DescribeSubscribedWorkteam
DescribeSubscribedWorkteam'
    { $sel:workteamArn:DescribeSubscribedWorkteam' :: Text
workteamArn =
        Text
pWorkteamArn_
    }

-- | The Amazon Resource Name (ARN) of the subscribed work team to describe.
describeSubscribedWorkteam_workteamArn :: Lens.Lens' DescribeSubscribedWorkteam Prelude.Text
describeSubscribedWorkteam_workteamArn :: (Text -> f Text)
-> DescribeSubscribedWorkteam -> f DescribeSubscribedWorkteam
describeSubscribedWorkteam_workteamArn = (DescribeSubscribedWorkteam -> Text)
-> (DescribeSubscribedWorkteam
    -> Text -> DescribeSubscribedWorkteam)
-> Lens
     DescribeSubscribedWorkteam DescribeSubscribedWorkteam Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribedWorkteam' {Text
workteamArn :: Text
$sel:workteamArn:DescribeSubscribedWorkteam' :: DescribeSubscribedWorkteam -> Text
workteamArn} -> Text
workteamArn) (\s :: DescribeSubscribedWorkteam
s@DescribeSubscribedWorkteam' {} Text
a -> DescribeSubscribedWorkteam
s {$sel:workteamArn:DescribeSubscribedWorkteam' :: Text
workteamArn = Text
a} :: DescribeSubscribedWorkteam)

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

instance Prelude.Hashable DescribeSubscribedWorkteam

instance Prelude.NFData DescribeSubscribedWorkteam

instance Core.ToHeaders DescribeSubscribedWorkteam where
  toHeaders :: DescribeSubscribedWorkteam -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeSubscribedWorkteam -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"SageMaker.DescribeSubscribedWorkteam" ::
                          Prelude.ByteString
                      ),
            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 DescribeSubscribedWorkteam where
  toJSON :: DescribeSubscribedWorkteam -> Value
toJSON DescribeSubscribedWorkteam' {Text
workteamArn :: Text
$sel:workteamArn:DescribeSubscribedWorkteam' :: DescribeSubscribedWorkteam -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"WorkteamArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
workteamArn)]
      )

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

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

-- | /See:/ 'newDescribeSubscribedWorkteamResponse' smart constructor.
data DescribeSubscribedWorkteamResponse = DescribeSubscribedWorkteamResponse'
  { -- | The response's http status code.
    DescribeSubscribedWorkteamResponse -> Int
httpStatus :: Prelude.Int,
    -- | A @Workteam@ instance that contains information about the work team.
    DescribeSubscribedWorkteamResponse -> SubscribedWorkteam
subscribedWorkteam :: SubscribedWorkteam
  }
  deriving (DescribeSubscribedWorkteamResponse
-> DescribeSubscribedWorkteamResponse -> Bool
(DescribeSubscribedWorkteamResponse
 -> DescribeSubscribedWorkteamResponse -> Bool)
-> (DescribeSubscribedWorkteamResponse
    -> DescribeSubscribedWorkteamResponse -> Bool)
-> Eq DescribeSubscribedWorkteamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSubscribedWorkteamResponse
-> DescribeSubscribedWorkteamResponse -> Bool
$c/= :: DescribeSubscribedWorkteamResponse
-> DescribeSubscribedWorkteamResponse -> Bool
== :: DescribeSubscribedWorkteamResponse
-> DescribeSubscribedWorkteamResponse -> Bool
$c== :: DescribeSubscribedWorkteamResponse
-> DescribeSubscribedWorkteamResponse -> Bool
Prelude.Eq, ReadPrec [DescribeSubscribedWorkteamResponse]
ReadPrec DescribeSubscribedWorkteamResponse
Int -> ReadS DescribeSubscribedWorkteamResponse
ReadS [DescribeSubscribedWorkteamResponse]
(Int -> ReadS DescribeSubscribedWorkteamResponse)
-> ReadS [DescribeSubscribedWorkteamResponse]
-> ReadPrec DescribeSubscribedWorkteamResponse
-> ReadPrec [DescribeSubscribedWorkteamResponse]
-> Read DescribeSubscribedWorkteamResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSubscribedWorkteamResponse]
$creadListPrec :: ReadPrec [DescribeSubscribedWorkteamResponse]
readPrec :: ReadPrec DescribeSubscribedWorkteamResponse
$creadPrec :: ReadPrec DescribeSubscribedWorkteamResponse
readList :: ReadS [DescribeSubscribedWorkteamResponse]
$creadList :: ReadS [DescribeSubscribedWorkteamResponse]
readsPrec :: Int -> ReadS DescribeSubscribedWorkteamResponse
$creadsPrec :: Int -> ReadS DescribeSubscribedWorkteamResponse
Prelude.Read, Int -> DescribeSubscribedWorkteamResponse -> ShowS
[DescribeSubscribedWorkteamResponse] -> ShowS
DescribeSubscribedWorkteamResponse -> String
(Int -> DescribeSubscribedWorkteamResponse -> ShowS)
-> (DescribeSubscribedWorkteamResponse -> String)
-> ([DescribeSubscribedWorkteamResponse] -> ShowS)
-> Show DescribeSubscribedWorkteamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSubscribedWorkteamResponse] -> ShowS
$cshowList :: [DescribeSubscribedWorkteamResponse] -> ShowS
show :: DescribeSubscribedWorkteamResponse -> String
$cshow :: DescribeSubscribedWorkteamResponse -> String
showsPrec :: Int -> DescribeSubscribedWorkteamResponse -> ShowS
$cshowsPrec :: Int -> DescribeSubscribedWorkteamResponse -> ShowS
Prelude.Show, (forall x.
 DescribeSubscribedWorkteamResponse
 -> Rep DescribeSubscribedWorkteamResponse x)
-> (forall x.
    Rep DescribeSubscribedWorkteamResponse x
    -> DescribeSubscribedWorkteamResponse)
-> Generic DescribeSubscribedWorkteamResponse
forall x.
Rep DescribeSubscribedWorkteamResponse x
-> DescribeSubscribedWorkteamResponse
forall x.
DescribeSubscribedWorkteamResponse
-> Rep DescribeSubscribedWorkteamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSubscribedWorkteamResponse x
-> DescribeSubscribedWorkteamResponse
$cfrom :: forall x.
DescribeSubscribedWorkteamResponse
-> Rep DescribeSubscribedWorkteamResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSubscribedWorkteamResponse' 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:
--
-- 'httpStatus', 'describeSubscribedWorkteamResponse_httpStatus' - The response's http status code.
--
-- 'subscribedWorkteam', 'describeSubscribedWorkteamResponse_subscribedWorkteam' - A @Workteam@ instance that contains information about the work team.
newDescribeSubscribedWorkteamResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'subscribedWorkteam'
  SubscribedWorkteam ->
  DescribeSubscribedWorkteamResponse
newDescribeSubscribedWorkteamResponse :: Int -> SubscribedWorkteam -> DescribeSubscribedWorkteamResponse
newDescribeSubscribedWorkteamResponse
  Int
pHttpStatus_
  SubscribedWorkteam
pSubscribedWorkteam_ =
    DescribeSubscribedWorkteamResponse' :: Int -> SubscribedWorkteam -> DescribeSubscribedWorkteamResponse
DescribeSubscribedWorkteamResponse'
      { $sel:httpStatus:DescribeSubscribedWorkteamResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:subscribedWorkteam:DescribeSubscribedWorkteamResponse' :: SubscribedWorkteam
subscribedWorkteam =
          SubscribedWorkteam
pSubscribedWorkteam_
      }

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

-- | A @Workteam@ instance that contains information about the work team.
describeSubscribedWorkteamResponse_subscribedWorkteam :: Lens.Lens' DescribeSubscribedWorkteamResponse SubscribedWorkteam
describeSubscribedWorkteamResponse_subscribedWorkteam :: (SubscribedWorkteam -> f SubscribedWorkteam)
-> DescribeSubscribedWorkteamResponse
-> f DescribeSubscribedWorkteamResponse
describeSubscribedWorkteamResponse_subscribedWorkteam = (DescribeSubscribedWorkteamResponse -> SubscribedWorkteam)
-> (DescribeSubscribedWorkteamResponse
    -> SubscribedWorkteam -> DescribeSubscribedWorkteamResponse)
-> Lens
     DescribeSubscribedWorkteamResponse
     DescribeSubscribedWorkteamResponse
     SubscribedWorkteam
     SubscribedWorkteam
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSubscribedWorkteamResponse' {SubscribedWorkteam
subscribedWorkteam :: SubscribedWorkteam
$sel:subscribedWorkteam:DescribeSubscribedWorkteamResponse' :: DescribeSubscribedWorkteamResponse -> SubscribedWorkteam
subscribedWorkteam} -> SubscribedWorkteam
subscribedWorkteam) (\s :: DescribeSubscribedWorkteamResponse
s@DescribeSubscribedWorkteamResponse' {} SubscribedWorkteam
a -> DescribeSubscribedWorkteamResponse
s {$sel:subscribedWorkteam:DescribeSubscribedWorkteamResponse' :: SubscribedWorkteam
subscribedWorkteam = SubscribedWorkteam
a} :: DescribeSubscribedWorkteamResponse)

instance
  Prelude.NFData
    DescribeSubscribedWorkteamResponse