{-# 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.WellArchitected.CreateWorkloadShare
-- 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)
--
-- Create a workload share.
--
-- The owner of a workload can share it with other AWS accounts and IAM
-- users in the same AWS Region. Shared access to a workload is not removed
-- until the workload invitation is deleted.
--
-- For more information, see
-- <https://docs.aws.amazon.com/wellarchitected/latest/userguide/workloads-sharing.html Sharing a Workload>
-- in the /AWS Well-Architected Tool User Guide/.
module Amazonka.WellArchitected.CreateWorkloadShare
  ( -- * Creating a Request
    CreateWorkloadShare (..),
    newCreateWorkloadShare,

    -- * Request Lenses
    createWorkloadShare_workloadId,
    createWorkloadShare_sharedWith,
    createWorkloadShare_permissionType,
    createWorkloadShare_clientRequestToken,

    -- * Destructuring the Response
    CreateWorkloadShareResponse (..),
    newCreateWorkloadShareResponse,

    -- * Response Lenses
    createWorkloadShareResponse_workloadId,
    createWorkloadShareResponse_shareId,
    createWorkloadShareResponse_httpStatus,
  )
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.WellArchitected.Types

-- | Input for Create Workload Share
--
-- /See:/ 'newCreateWorkloadShare' smart constructor.
data CreateWorkloadShare = CreateWorkloadShare'
  { CreateWorkloadShare -> Text
workloadId :: Prelude.Text,
    CreateWorkloadShare -> Text
sharedWith :: Prelude.Text,
    CreateWorkloadShare -> PermissionType
permissionType :: PermissionType,
    CreateWorkloadShare -> Text
clientRequestToken :: Prelude.Text
  }
  deriving (CreateWorkloadShare -> CreateWorkloadShare -> Bool
(CreateWorkloadShare -> CreateWorkloadShare -> Bool)
-> (CreateWorkloadShare -> CreateWorkloadShare -> Bool)
-> Eq CreateWorkloadShare
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkloadShare -> CreateWorkloadShare -> Bool
$c/= :: CreateWorkloadShare -> CreateWorkloadShare -> Bool
== :: CreateWorkloadShare -> CreateWorkloadShare -> Bool
$c== :: CreateWorkloadShare -> CreateWorkloadShare -> Bool
Prelude.Eq, ReadPrec [CreateWorkloadShare]
ReadPrec CreateWorkloadShare
Int -> ReadS CreateWorkloadShare
ReadS [CreateWorkloadShare]
(Int -> ReadS CreateWorkloadShare)
-> ReadS [CreateWorkloadShare]
-> ReadPrec CreateWorkloadShare
-> ReadPrec [CreateWorkloadShare]
-> Read CreateWorkloadShare
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkloadShare]
$creadListPrec :: ReadPrec [CreateWorkloadShare]
readPrec :: ReadPrec CreateWorkloadShare
$creadPrec :: ReadPrec CreateWorkloadShare
readList :: ReadS [CreateWorkloadShare]
$creadList :: ReadS [CreateWorkloadShare]
readsPrec :: Int -> ReadS CreateWorkloadShare
$creadsPrec :: Int -> ReadS CreateWorkloadShare
Prelude.Read, Int -> CreateWorkloadShare -> ShowS
[CreateWorkloadShare] -> ShowS
CreateWorkloadShare -> String
(Int -> CreateWorkloadShare -> ShowS)
-> (CreateWorkloadShare -> String)
-> ([CreateWorkloadShare] -> ShowS)
-> Show CreateWorkloadShare
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkloadShare] -> ShowS
$cshowList :: [CreateWorkloadShare] -> ShowS
show :: CreateWorkloadShare -> String
$cshow :: CreateWorkloadShare -> String
showsPrec :: Int -> CreateWorkloadShare -> ShowS
$cshowsPrec :: Int -> CreateWorkloadShare -> ShowS
Prelude.Show, (forall x. CreateWorkloadShare -> Rep CreateWorkloadShare x)
-> (forall x. Rep CreateWorkloadShare x -> CreateWorkloadShare)
-> Generic CreateWorkloadShare
forall x. Rep CreateWorkloadShare x -> CreateWorkloadShare
forall x. CreateWorkloadShare -> Rep CreateWorkloadShare x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWorkloadShare x -> CreateWorkloadShare
$cfrom :: forall x. CreateWorkloadShare -> Rep CreateWorkloadShare x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkloadShare' 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:
--
-- 'workloadId', 'createWorkloadShare_workloadId' - Undocumented member.
--
-- 'sharedWith', 'createWorkloadShare_sharedWith' - Undocumented member.
--
-- 'permissionType', 'createWorkloadShare_permissionType' - Undocumented member.
--
-- 'clientRequestToken', 'createWorkloadShare_clientRequestToken' - Undocumented member.
newCreateWorkloadShare ::
  -- | 'workloadId'
  Prelude.Text ->
  -- | 'sharedWith'
  Prelude.Text ->
  -- | 'permissionType'
  PermissionType ->
  -- | 'clientRequestToken'
  Prelude.Text ->
  CreateWorkloadShare
newCreateWorkloadShare :: Text -> Text -> PermissionType -> Text -> CreateWorkloadShare
newCreateWorkloadShare
  Text
pWorkloadId_
  Text
pSharedWith_
  PermissionType
pPermissionType_
  Text
pClientRequestToken_ =
    CreateWorkloadShare' :: Text -> Text -> PermissionType -> Text -> CreateWorkloadShare
CreateWorkloadShare'
      { $sel:workloadId:CreateWorkloadShare' :: Text
workloadId = Text
pWorkloadId_,
        $sel:sharedWith:CreateWorkloadShare' :: Text
sharedWith = Text
pSharedWith_,
        $sel:permissionType:CreateWorkloadShare' :: PermissionType
permissionType = PermissionType
pPermissionType_,
        $sel:clientRequestToken:CreateWorkloadShare' :: Text
clientRequestToken = Text
pClientRequestToken_
      }

-- | Undocumented member.
createWorkloadShare_workloadId :: Lens.Lens' CreateWorkloadShare Prelude.Text
createWorkloadShare_workloadId :: (Text -> f Text) -> CreateWorkloadShare -> f CreateWorkloadShare
createWorkloadShare_workloadId = (CreateWorkloadShare -> Text)
-> (CreateWorkloadShare -> Text -> CreateWorkloadShare)
-> Lens CreateWorkloadShare CreateWorkloadShare Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkloadShare' {Text
workloadId :: Text
$sel:workloadId:CreateWorkloadShare' :: CreateWorkloadShare -> Text
workloadId} -> Text
workloadId) (\s :: CreateWorkloadShare
s@CreateWorkloadShare' {} Text
a -> CreateWorkloadShare
s {$sel:workloadId:CreateWorkloadShare' :: Text
workloadId = Text
a} :: CreateWorkloadShare)

-- | Undocumented member.
createWorkloadShare_sharedWith :: Lens.Lens' CreateWorkloadShare Prelude.Text
createWorkloadShare_sharedWith :: (Text -> f Text) -> CreateWorkloadShare -> f CreateWorkloadShare
createWorkloadShare_sharedWith = (CreateWorkloadShare -> Text)
-> (CreateWorkloadShare -> Text -> CreateWorkloadShare)
-> Lens CreateWorkloadShare CreateWorkloadShare Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkloadShare' {Text
sharedWith :: Text
$sel:sharedWith:CreateWorkloadShare' :: CreateWorkloadShare -> Text
sharedWith} -> Text
sharedWith) (\s :: CreateWorkloadShare
s@CreateWorkloadShare' {} Text
a -> CreateWorkloadShare
s {$sel:sharedWith:CreateWorkloadShare' :: Text
sharedWith = Text
a} :: CreateWorkloadShare)

-- | Undocumented member.
createWorkloadShare_permissionType :: Lens.Lens' CreateWorkloadShare PermissionType
createWorkloadShare_permissionType :: (PermissionType -> f PermissionType)
-> CreateWorkloadShare -> f CreateWorkloadShare
createWorkloadShare_permissionType = (CreateWorkloadShare -> PermissionType)
-> (CreateWorkloadShare -> PermissionType -> CreateWorkloadShare)
-> Lens
     CreateWorkloadShare
     CreateWorkloadShare
     PermissionType
     PermissionType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkloadShare' {PermissionType
permissionType :: PermissionType
$sel:permissionType:CreateWorkloadShare' :: CreateWorkloadShare -> PermissionType
permissionType} -> PermissionType
permissionType) (\s :: CreateWorkloadShare
s@CreateWorkloadShare' {} PermissionType
a -> CreateWorkloadShare
s {$sel:permissionType:CreateWorkloadShare' :: PermissionType
permissionType = PermissionType
a} :: CreateWorkloadShare)

-- | Undocumented member.
createWorkloadShare_clientRequestToken :: Lens.Lens' CreateWorkloadShare Prelude.Text
createWorkloadShare_clientRequestToken :: (Text -> f Text) -> CreateWorkloadShare -> f CreateWorkloadShare
createWorkloadShare_clientRequestToken = (CreateWorkloadShare -> Text)
-> (CreateWorkloadShare -> Text -> CreateWorkloadShare)
-> Lens CreateWorkloadShare CreateWorkloadShare Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkloadShare' {Text
clientRequestToken :: Text
$sel:clientRequestToken:CreateWorkloadShare' :: CreateWorkloadShare -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: CreateWorkloadShare
s@CreateWorkloadShare' {} Text
a -> CreateWorkloadShare
s {$sel:clientRequestToken:CreateWorkloadShare' :: Text
clientRequestToken = Text
a} :: CreateWorkloadShare)

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

instance Prelude.NFData CreateWorkloadShare

instance Core.ToHeaders CreateWorkloadShare where
  toHeaders :: CreateWorkloadShare -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateWorkloadShare -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateWorkloadShare where
  toJSON :: CreateWorkloadShare -> Value
toJSON CreateWorkloadShare' {Text
PermissionType
clientRequestToken :: Text
permissionType :: PermissionType
sharedWith :: Text
workloadId :: Text
$sel:clientRequestToken:CreateWorkloadShare' :: CreateWorkloadShare -> Text
$sel:permissionType:CreateWorkloadShare' :: CreateWorkloadShare -> PermissionType
$sel:sharedWith:CreateWorkloadShare' :: CreateWorkloadShare -> Text
$sel:workloadId:CreateWorkloadShare' :: CreateWorkloadShare -> 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
"SharedWith" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
sharedWith),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PermissionType" Text -> PermissionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PermissionType
permissionType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientRequestToken)
          ]
      )

instance Core.ToPath CreateWorkloadShare where
  toPath :: CreateWorkloadShare -> ByteString
toPath CreateWorkloadShare' {Text
PermissionType
clientRequestToken :: Text
permissionType :: PermissionType
sharedWith :: Text
workloadId :: Text
$sel:clientRequestToken:CreateWorkloadShare' :: CreateWorkloadShare -> Text
$sel:permissionType:CreateWorkloadShare' :: CreateWorkloadShare -> PermissionType
$sel:sharedWith:CreateWorkloadShare' :: CreateWorkloadShare -> Text
$sel:workloadId:CreateWorkloadShare' :: CreateWorkloadShare -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/workloads/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workloadId, ByteString
"/shares"]

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

-- | Input for Create Workload Share
--
-- /See:/ 'newCreateWorkloadShareResponse' smart constructor.
data CreateWorkloadShareResponse = CreateWorkloadShareResponse'
  { CreateWorkloadShareResponse -> Maybe Text
workloadId :: Prelude.Maybe Prelude.Text,
    CreateWorkloadShareResponse -> Maybe Text
shareId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWorkloadShareResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWorkloadShareResponse -> CreateWorkloadShareResponse -> Bool
(CreateWorkloadShareResponse
 -> CreateWorkloadShareResponse -> Bool)
-> (CreateWorkloadShareResponse
    -> CreateWorkloadShareResponse -> Bool)
-> Eq CreateWorkloadShareResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWorkloadShareResponse -> CreateWorkloadShareResponse -> Bool
$c/= :: CreateWorkloadShareResponse -> CreateWorkloadShareResponse -> Bool
== :: CreateWorkloadShareResponse -> CreateWorkloadShareResponse -> Bool
$c== :: CreateWorkloadShareResponse -> CreateWorkloadShareResponse -> Bool
Prelude.Eq, ReadPrec [CreateWorkloadShareResponse]
ReadPrec CreateWorkloadShareResponse
Int -> ReadS CreateWorkloadShareResponse
ReadS [CreateWorkloadShareResponse]
(Int -> ReadS CreateWorkloadShareResponse)
-> ReadS [CreateWorkloadShareResponse]
-> ReadPrec CreateWorkloadShareResponse
-> ReadPrec [CreateWorkloadShareResponse]
-> Read CreateWorkloadShareResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWorkloadShareResponse]
$creadListPrec :: ReadPrec [CreateWorkloadShareResponse]
readPrec :: ReadPrec CreateWorkloadShareResponse
$creadPrec :: ReadPrec CreateWorkloadShareResponse
readList :: ReadS [CreateWorkloadShareResponse]
$creadList :: ReadS [CreateWorkloadShareResponse]
readsPrec :: Int -> ReadS CreateWorkloadShareResponse
$creadsPrec :: Int -> ReadS CreateWorkloadShareResponse
Prelude.Read, Int -> CreateWorkloadShareResponse -> ShowS
[CreateWorkloadShareResponse] -> ShowS
CreateWorkloadShareResponse -> String
(Int -> CreateWorkloadShareResponse -> ShowS)
-> (CreateWorkloadShareResponse -> String)
-> ([CreateWorkloadShareResponse] -> ShowS)
-> Show CreateWorkloadShareResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWorkloadShareResponse] -> ShowS
$cshowList :: [CreateWorkloadShareResponse] -> ShowS
show :: CreateWorkloadShareResponse -> String
$cshow :: CreateWorkloadShareResponse -> String
showsPrec :: Int -> CreateWorkloadShareResponse -> ShowS
$cshowsPrec :: Int -> CreateWorkloadShareResponse -> ShowS
Prelude.Show, (forall x.
 CreateWorkloadShareResponse -> Rep CreateWorkloadShareResponse x)
-> (forall x.
    Rep CreateWorkloadShareResponse x -> CreateWorkloadShareResponse)
-> Generic CreateWorkloadShareResponse
forall x.
Rep CreateWorkloadShareResponse x -> CreateWorkloadShareResponse
forall x.
CreateWorkloadShareResponse -> Rep CreateWorkloadShareResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWorkloadShareResponse x -> CreateWorkloadShareResponse
$cfrom :: forall x.
CreateWorkloadShareResponse -> Rep CreateWorkloadShareResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWorkloadShareResponse' 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:
--
-- 'workloadId', 'createWorkloadShareResponse_workloadId' - Undocumented member.
--
-- 'shareId', 'createWorkloadShareResponse_shareId' - Undocumented member.
--
-- 'httpStatus', 'createWorkloadShareResponse_httpStatus' - The response's http status code.
newCreateWorkloadShareResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWorkloadShareResponse
newCreateWorkloadShareResponse :: Int -> CreateWorkloadShareResponse
newCreateWorkloadShareResponse Int
pHttpStatus_ =
  CreateWorkloadShareResponse' :: Maybe Text -> Maybe Text -> Int -> CreateWorkloadShareResponse
CreateWorkloadShareResponse'
    { $sel:workloadId:CreateWorkloadShareResponse' :: Maybe Text
workloadId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shareId:CreateWorkloadShareResponse' :: Maybe Text
shareId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWorkloadShareResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
createWorkloadShareResponse_workloadId :: Lens.Lens' CreateWorkloadShareResponse (Prelude.Maybe Prelude.Text)
createWorkloadShareResponse_workloadId :: (Maybe Text -> f (Maybe Text))
-> CreateWorkloadShareResponse -> f CreateWorkloadShareResponse
createWorkloadShareResponse_workloadId = (CreateWorkloadShareResponse -> Maybe Text)
-> (CreateWorkloadShareResponse
    -> Maybe Text -> CreateWorkloadShareResponse)
-> Lens
     CreateWorkloadShareResponse
     CreateWorkloadShareResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkloadShareResponse' {Maybe Text
workloadId :: Maybe Text
$sel:workloadId:CreateWorkloadShareResponse' :: CreateWorkloadShareResponse -> Maybe Text
workloadId} -> Maybe Text
workloadId) (\s :: CreateWorkloadShareResponse
s@CreateWorkloadShareResponse' {} Maybe Text
a -> CreateWorkloadShareResponse
s {$sel:workloadId:CreateWorkloadShareResponse' :: Maybe Text
workloadId = Maybe Text
a} :: CreateWorkloadShareResponse)

-- | Undocumented member.
createWorkloadShareResponse_shareId :: Lens.Lens' CreateWorkloadShareResponse (Prelude.Maybe Prelude.Text)
createWorkloadShareResponse_shareId :: (Maybe Text -> f (Maybe Text))
-> CreateWorkloadShareResponse -> f CreateWorkloadShareResponse
createWorkloadShareResponse_shareId = (CreateWorkloadShareResponse -> Maybe Text)
-> (CreateWorkloadShareResponse
    -> Maybe Text -> CreateWorkloadShareResponse)
-> Lens
     CreateWorkloadShareResponse
     CreateWorkloadShareResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWorkloadShareResponse' {Maybe Text
shareId :: Maybe Text
$sel:shareId:CreateWorkloadShareResponse' :: CreateWorkloadShareResponse -> Maybe Text
shareId} -> Maybe Text
shareId) (\s :: CreateWorkloadShareResponse
s@CreateWorkloadShareResponse' {} Maybe Text
a -> CreateWorkloadShareResponse
s {$sel:shareId:CreateWorkloadShareResponse' :: Maybe Text
shareId = Maybe Text
a} :: CreateWorkloadShareResponse)

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

instance Prelude.NFData CreateWorkloadShareResponse