{-# 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.SageMaker.Types.WorkforceVpcConfigResponse
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SageMaker.Types.WorkforceVpcConfigResponse where

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

-- | A VpcConfig object that specifies the VPC that you want your workforce
-- to connect to.
--
-- /See:/ 'newWorkforceVpcConfigResponse' smart constructor.
data WorkforceVpcConfigResponse = WorkforceVpcConfigResponse'
  { -- | The IDs for the VPC service endpoints of your VPC workforce when it is
    -- created and updated.
    WorkforceVpcConfigResponse -> Maybe Text
vpcEndpointId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VPC that the workforce uses for communication.
    WorkforceVpcConfigResponse -> Text
vpcId :: Prelude.Text,
    -- | The VPC security group IDs, in the form sg-xxxxxxxx. The security groups
    -- must be for the same VPC as specified in the subnet.
    WorkforceVpcConfigResponse -> NonEmpty Text
securityGroupIds :: Prelude.NonEmpty Prelude.Text,
    -- | The ID of the subnets in the VPC that you want to connect.
    WorkforceVpcConfigResponse -> NonEmpty Text
subnets :: Prelude.NonEmpty Prelude.Text
  }
  deriving (WorkforceVpcConfigResponse -> WorkforceVpcConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkforceVpcConfigResponse -> WorkforceVpcConfigResponse -> Bool
$c/= :: WorkforceVpcConfigResponse -> WorkforceVpcConfigResponse -> Bool
== :: WorkforceVpcConfigResponse -> WorkforceVpcConfigResponse -> Bool
$c== :: WorkforceVpcConfigResponse -> WorkforceVpcConfigResponse -> Bool
Prelude.Eq, ReadPrec [WorkforceVpcConfigResponse]
ReadPrec WorkforceVpcConfigResponse
Int -> ReadS WorkforceVpcConfigResponse
ReadS [WorkforceVpcConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkforceVpcConfigResponse]
$creadListPrec :: ReadPrec [WorkforceVpcConfigResponse]
readPrec :: ReadPrec WorkforceVpcConfigResponse
$creadPrec :: ReadPrec WorkforceVpcConfigResponse
readList :: ReadS [WorkforceVpcConfigResponse]
$creadList :: ReadS [WorkforceVpcConfigResponse]
readsPrec :: Int -> ReadS WorkforceVpcConfigResponse
$creadsPrec :: Int -> ReadS WorkforceVpcConfigResponse
Prelude.Read, Int -> WorkforceVpcConfigResponse -> ShowS
[WorkforceVpcConfigResponse] -> ShowS
WorkforceVpcConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkforceVpcConfigResponse] -> ShowS
$cshowList :: [WorkforceVpcConfigResponse] -> ShowS
show :: WorkforceVpcConfigResponse -> String
$cshow :: WorkforceVpcConfigResponse -> String
showsPrec :: Int -> WorkforceVpcConfigResponse -> ShowS
$cshowsPrec :: Int -> WorkforceVpcConfigResponse -> ShowS
Prelude.Show, forall x.
Rep WorkforceVpcConfigResponse x -> WorkforceVpcConfigResponse
forall x.
WorkforceVpcConfigResponse -> Rep WorkforceVpcConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep WorkforceVpcConfigResponse x -> WorkforceVpcConfigResponse
$cfrom :: forall x.
WorkforceVpcConfigResponse -> Rep WorkforceVpcConfigResponse x
Prelude.Generic)

-- |
-- Create a value of 'WorkforceVpcConfigResponse' 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:
--
-- 'vpcEndpointId', 'workforceVpcConfigResponse_vpcEndpointId' - The IDs for the VPC service endpoints of your VPC workforce when it is
-- created and updated.
--
-- 'vpcId', 'workforceVpcConfigResponse_vpcId' - The ID of the VPC that the workforce uses for communication.
--
-- 'securityGroupIds', 'workforceVpcConfigResponse_securityGroupIds' - The VPC security group IDs, in the form sg-xxxxxxxx. The security groups
-- must be for the same VPC as specified in the subnet.
--
-- 'subnets', 'workforceVpcConfigResponse_subnets' - The ID of the subnets in the VPC that you want to connect.
newWorkforceVpcConfigResponse ::
  -- | 'vpcId'
  Prelude.Text ->
  -- | 'securityGroupIds'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'subnets'
  Prelude.NonEmpty Prelude.Text ->
  WorkforceVpcConfigResponse
newWorkforceVpcConfigResponse :: Text
-> NonEmpty Text -> NonEmpty Text -> WorkforceVpcConfigResponse
newWorkforceVpcConfigResponse
  Text
pVpcId_
  NonEmpty Text
pSecurityGroupIds_
  NonEmpty Text
pSubnets_ =
    WorkforceVpcConfigResponse'
      { $sel:vpcEndpointId:WorkforceVpcConfigResponse' :: Maybe Text
vpcEndpointId =
          forall a. Maybe a
Prelude.Nothing,
        $sel:vpcId:WorkforceVpcConfigResponse' :: Text
vpcId = Text
pVpcId_,
        $sel:securityGroupIds:WorkforceVpcConfigResponse' :: NonEmpty Text
securityGroupIds =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSecurityGroupIds_,
        $sel:subnets:WorkforceVpcConfigResponse' :: NonEmpty Text
subnets = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pSubnets_
      }

-- | The IDs for the VPC service endpoints of your VPC workforce when it is
-- created and updated.
workforceVpcConfigResponse_vpcEndpointId :: Lens.Lens' WorkforceVpcConfigResponse (Prelude.Maybe Prelude.Text)
workforceVpcConfigResponse_vpcEndpointId :: Lens' WorkforceVpcConfigResponse (Maybe Text)
workforceVpcConfigResponse_vpcEndpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkforceVpcConfigResponse' {Maybe Text
vpcEndpointId :: Maybe Text
$sel:vpcEndpointId:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> Maybe Text
vpcEndpointId} -> Maybe Text
vpcEndpointId) (\s :: WorkforceVpcConfigResponse
s@WorkforceVpcConfigResponse' {} Maybe Text
a -> WorkforceVpcConfigResponse
s {$sel:vpcEndpointId:WorkforceVpcConfigResponse' :: Maybe Text
vpcEndpointId = Maybe Text
a} :: WorkforceVpcConfigResponse)

-- | The ID of the VPC that the workforce uses for communication.
workforceVpcConfigResponse_vpcId :: Lens.Lens' WorkforceVpcConfigResponse Prelude.Text
workforceVpcConfigResponse_vpcId :: Lens' WorkforceVpcConfigResponse Text
workforceVpcConfigResponse_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkforceVpcConfigResponse' {Text
vpcId :: Text
$sel:vpcId:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> Text
vpcId} -> Text
vpcId) (\s :: WorkforceVpcConfigResponse
s@WorkforceVpcConfigResponse' {} Text
a -> WorkforceVpcConfigResponse
s {$sel:vpcId:WorkforceVpcConfigResponse' :: Text
vpcId = Text
a} :: WorkforceVpcConfigResponse)

-- | The VPC security group IDs, in the form sg-xxxxxxxx. The security groups
-- must be for the same VPC as specified in the subnet.
workforceVpcConfigResponse_securityGroupIds :: Lens.Lens' WorkforceVpcConfigResponse (Prelude.NonEmpty Prelude.Text)
workforceVpcConfigResponse_securityGroupIds :: Lens' WorkforceVpcConfigResponse (NonEmpty Text)
workforceVpcConfigResponse_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkforceVpcConfigResponse' {NonEmpty Text
securityGroupIds :: NonEmpty Text
$sel:securityGroupIds:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> NonEmpty Text
securityGroupIds} -> NonEmpty Text
securityGroupIds) (\s :: WorkforceVpcConfigResponse
s@WorkforceVpcConfigResponse' {} NonEmpty Text
a -> WorkforceVpcConfigResponse
s {$sel:securityGroupIds:WorkforceVpcConfigResponse' :: NonEmpty Text
securityGroupIds = NonEmpty Text
a} :: WorkforceVpcConfigResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The ID of the subnets in the VPC that you want to connect.
workforceVpcConfigResponse_subnets :: Lens.Lens' WorkforceVpcConfigResponse (Prelude.NonEmpty Prelude.Text)
workforceVpcConfigResponse_subnets :: Lens' WorkforceVpcConfigResponse (NonEmpty Text)
workforceVpcConfigResponse_subnets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkforceVpcConfigResponse' {NonEmpty Text
subnets :: NonEmpty Text
$sel:subnets:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> NonEmpty Text
subnets} -> NonEmpty Text
subnets) (\s :: WorkforceVpcConfigResponse
s@WorkforceVpcConfigResponse' {} NonEmpty Text
a -> WorkforceVpcConfigResponse
s {$sel:subnets:WorkforceVpcConfigResponse' :: NonEmpty Text
subnets = NonEmpty Text
a} :: WorkforceVpcConfigResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON WorkforceVpcConfigResponse where
  parseJSON :: Value -> Parser WorkforceVpcConfigResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"WorkforceVpcConfigResponse"
      ( \Object
x ->
          Maybe Text
-> Text
-> NonEmpty Text
-> NonEmpty Text
-> WorkforceVpcConfigResponse
WorkforceVpcConfigResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VpcEndpointId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"VpcId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"SecurityGroupIds")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Subnets")
      )

instance Prelude.Hashable WorkforceVpcConfigResponse where
  hashWithSalt :: Int -> WorkforceVpcConfigResponse -> Int
hashWithSalt Int
_salt WorkforceVpcConfigResponse' {Maybe Text
NonEmpty Text
Text
subnets :: NonEmpty Text
securityGroupIds :: NonEmpty Text
vpcId :: Text
vpcEndpointId :: Maybe Text
$sel:subnets:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> NonEmpty Text
$sel:securityGroupIds:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> NonEmpty Text
$sel:vpcId:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> Text
$sel:vpcEndpointId:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcEndpointId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
vpcId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
securityGroupIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
subnets

instance Prelude.NFData WorkforceVpcConfigResponse where
  rnf :: WorkforceVpcConfigResponse -> ()
rnf WorkforceVpcConfigResponse' {Maybe Text
NonEmpty Text
Text
subnets :: NonEmpty Text
securityGroupIds :: NonEmpty Text
vpcId :: Text
vpcEndpointId :: Maybe Text
$sel:subnets:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> NonEmpty Text
$sel:securityGroupIds:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> NonEmpty Text
$sel:vpcId:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> Text
$sel:vpcEndpointId:WorkforceVpcConfigResponse' :: WorkforceVpcConfigResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcEndpointId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
vpcId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
securityGroupIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
subnets