{-# 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.Route53RecoveryReadiness.Types.ResourceSetOutput
-- 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.Route53RecoveryReadiness.Types.ResourceSetOutput 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
import Amazonka.Route53RecoveryReadiness.Types.Resource

-- | A collection of resources of the same type.
--
-- /See:/ 'newResourceSetOutput' smart constructor.
data ResourceSetOutput = ResourceSetOutput'
  { ResourceSetOutput -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The resource type of the resources in the resource set. Enter one of the
    -- following values for resource type:
    --
    -- AWS::ApiGateway::Stage, AWS::ApiGatewayV2::Stage,
    -- AWS::AutoScaling::AutoScalingGroup, AWS::CloudWatch::Alarm,
    -- AWS::EC2::CustomerGateway, AWS::DynamoDB::Table, AWS::EC2::Volume,
    -- AWS::ElasticLoadBalancing::LoadBalancer,
    -- AWS::ElasticLoadBalancingV2::LoadBalancer, AWS::Lambda::Function,
    -- AWS::MSK::Cluster, AWS::RDS::DBCluster, AWS::Route53::HealthCheck,
    -- AWS::SQS::Queue, AWS::SNS::Topic, AWS::SNS::Subscription, AWS::EC2::VPC,
    -- AWS::EC2::VPNConnection, AWS::EC2::VPNGateway,
    -- AWS::Route53RecoveryReadiness::DNSTargetResource
    ResourceSetOutput -> Text
resourceSetType :: Prelude.Text,
    -- | The name of the resource set.
    ResourceSetOutput -> Text
resourceSetName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) for the resource set.
    ResourceSetOutput -> Text
resourceSetArn :: Prelude.Text,
    -- | A list of resource objects.
    ResourceSetOutput -> [Resource]
resources :: [Resource]
  }
  deriving (ResourceSetOutput -> ResourceSetOutput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceSetOutput -> ResourceSetOutput -> Bool
$c/= :: ResourceSetOutput -> ResourceSetOutput -> Bool
== :: ResourceSetOutput -> ResourceSetOutput -> Bool
$c== :: ResourceSetOutput -> ResourceSetOutput -> Bool
Prelude.Eq, ReadPrec [ResourceSetOutput]
ReadPrec ResourceSetOutput
Int -> ReadS ResourceSetOutput
ReadS [ResourceSetOutput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceSetOutput]
$creadListPrec :: ReadPrec [ResourceSetOutput]
readPrec :: ReadPrec ResourceSetOutput
$creadPrec :: ReadPrec ResourceSetOutput
readList :: ReadS [ResourceSetOutput]
$creadList :: ReadS [ResourceSetOutput]
readsPrec :: Int -> ReadS ResourceSetOutput
$creadsPrec :: Int -> ReadS ResourceSetOutput
Prelude.Read, Int -> ResourceSetOutput -> ShowS
[ResourceSetOutput] -> ShowS
ResourceSetOutput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceSetOutput] -> ShowS
$cshowList :: [ResourceSetOutput] -> ShowS
show :: ResourceSetOutput -> String
$cshow :: ResourceSetOutput -> String
showsPrec :: Int -> ResourceSetOutput -> ShowS
$cshowsPrec :: Int -> ResourceSetOutput -> ShowS
Prelude.Show, forall x. Rep ResourceSetOutput x -> ResourceSetOutput
forall x. ResourceSetOutput -> Rep ResourceSetOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceSetOutput x -> ResourceSetOutput
$cfrom :: forall x. ResourceSetOutput -> Rep ResourceSetOutput x
Prelude.Generic)

-- |
-- Create a value of 'ResourceSetOutput' 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:
--
-- 'tags', 'resourceSetOutput_tags' - Undocumented member.
--
-- 'resourceSetType', 'resourceSetOutput_resourceSetType' - The resource type of the resources in the resource set. Enter one of the
-- following values for resource type:
--
-- AWS::ApiGateway::Stage, AWS::ApiGatewayV2::Stage,
-- AWS::AutoScaling::AutoScalingGroup, AWS::CloudWatch::Alarm,
-- AWS::EC2::CustomerGateway, AWS::DynamoDB::Table, AWS::EC2::Volume,
-- AWS::ElasticLoadBalancing::LoadBalancer,
-- AWS::ElasticLoadBalancingV2::LoadBalancer, AWS::Lambda::Function,
-- AWS::MSK::Cluster, AWS::RDS::DBCluster, AWS::Route53::HealthCheck,
-- AWS::SQS::Queue, AWS::SNS::Topic, AWS::SNS::Subscription, AWS::EC2::VPC,
-- AWS::EC2::VPNConnection, AWS::EC2::VPNGateway,
-- AWS::Route53RecoveryReadiness::DNSTargetResource
--
-- 'resourceSetName', 'resourceSetOutput_resourceSetName' - The name of the resource set.
--
-- 'resourceSetArn', 'resourceSetOutput_resourceSetArn' - The Amazon Resource Name (ARN) for the resource set.
--
-- 'resources', 'resourceSetOutput_resources' - A list of resource objects.
newResourceSetOutput ::
  -- | 'resourceSetType'
  Prelude.Text ->
  -- | 'resourceSetName'
  Prelude.Text ->
  -- | 'resourceSetArn'
  Prelude.Text ->
  ResourceSetOutput
newResourceSetOutput :: Text -> Text -> Text -> ResourceSetOutput
newResourceSetOutput
  Text
pResourceSetType_
  Text
pResourceSetName_
  Text
pResourceSetArn_ =
    ResourceSetOutput'
      { $sel:tags:ResourceSetOutput' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:resourceSetType:ResourceSetOutput' :: Text
resourceSetType = Text
pResourceSetType_,
        $sel:resourceSetName:ResourceSetOutput' :: Text
resourceSetName = Text
pResourceSetName_,
        $sel:resourceSetArn:ResourceSetOutput' :: Text
resourceSetArn = Text
pResourceSetArn_,
        $sel:resources:ResourceSetOutput' :: [Resource]
resources = forall a. Monoid a => a
Prelude.mempty
      }

-- | Undocumented member.
resourceSetOutput_tags :: Lens.Lens' ResourceSetOutput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
resourceSetOutput_tags :: Lens' ResourceSetOutput (Maybe (HashMap Text Text))
resourceSetOutput_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetOutput' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ResourceSetOutput' :: ResourceSetOutput -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ResourceSetOutput
s@ResourceSetOutput' {} Maybe (HashMap Text Text)
a -> ResourceSetOutput
s {$sel:tags:ResourceSetOutput' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ResourceSetOutput) 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 resource type of the resources in the resource set. Enter one of the
-- following values for resource type:
--
-- AWS::ApiGateway::Stage, AWS::ApiGatewayV2::Stage,
-- AWS::AutoScaling::AutoScalingGroup, AWS::CloudWatch::Alarm,
-- AWS::EC2::CustomerGateway, AWS::DynamoDB::Table, AWS::EC2::Volume,
-- AWS::ElasticLoadBalancing::LoadBalancer,
-- AWS::ElasticLoadBalancingV2::LoadBalancer, AWS::Lambda::Function,
-- AWS::MSK::Cluster, AWS::RDS::DBCluster, AWS::Route53::HealthCheck,
-- AWS::SQS::Queue, AWS::SNS::Topic, AWS::SNS::Subscription, AWS::EC2::VPC,
-- AWS::EC2::VPNConnection, AWS::EC2::VPNGateway,
-- AWS::Route53RecoveryReadiness::DNSTargetResource
resourceSetOutput_resourceSetType :: Lens.Lens' ResourceSetOutput Prelude.Text
resourceSetOutput_resourceSetType :: Lens' ResourceSetOutput Text
resourceSetOutput_resourceSetType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetOutput' {Text
resourceSetType :: Text
$sel:resourceSetType:ResourceSetOutput' :: ResourceSetOutput -> Text
resourceSetType} -> Text
resourceSetType) (\s :: ResourceSetOutput
s@ResourceSetOutput' {} Text
a -> ResourceSetOutput
s {$sel:resourceSetType:ResourceSetOutput' :: Text
resourceSetType = Text
a} :: ResourceSetOutput)

-- | The name of the resource set.
resourceSetOutput_resourceSetName :: Lens.Lens' ResourceSetOutput Prelude.Text
resourceSetOutput_resourceSetName :: Lens' ResourceSetOutput Text
resourceSetOutput_resourceSetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetOutput' {Text
resourceSetName :: Text
$sel:resourceSetName:ResourceSetOutput' :: ResourceSetOutput -> Text
resourceSetName} -> Text
resourceSetName) (\s :: ResourceSetOutput
s@ResourceSetOutput' {} Text
a -> ResourceSetOutput
s {$sel:resourceSetName:ResourceSetOutput' :: Text
resourceSetName = Text
a} :: ResourceSetOutput)

-- | The Amazon Resource Name (ARN) for the resource set.
resourceSetOutput_resourceSetArn :: Lens.Lens' ResourceSetOutput Prelude.Text
resourceSetOutput_resourceSetArn :: Lens' ResourceSetOutput Text
resourceSetOutput_resourceSetArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetOutput' {Text
resourceSetArn :: Text
$sel:resourceSetArn:ResourceSetOutput' :: ResourceSetOutput -> Text
resourceSetArn} -> Text
resourceSetArn) (\s :: ResourceSetOutput
s@ResourceSetOutput' {} Text
a -> ResourceSetOutput
s {$sel:resourceSetArn:ResourceSetOutput' :: Text
resourceSetArn = Text
a} :: ResourceSetOutput)

-- | A list of resource objects.
resourceSetOutput_resources :: Lens.Lens' ResourceSetOutput [Resource]
resourceSetOutput_resources :: Lens' ResourceSetOutput [Resource]
resourceSetOutput_resources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceSetOutput' {[Resource]
resources :: [Resource]
$sel:resources:ResourceSetOutput' :: ResourceSetOutput -> [Resource]
resources} -> [Resource]
resources) (\s :: ResourceSetOutput
s@ResourceSetOutput' {} [Resource]
a -> ResourceSetOutput
s {$sel:resources:ResourceSetOutput' :: [Resource]
resources = [Resource]
a} :: ResourceSetOutput) 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 ResourceSetOutput where
  parseJSON :: Value -> Parser ResourceSetOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ResourceSetOutput"
      ( \Object
x ->
          Maybe (HashMap Text Text)
-> Text -> Text -> Text -> [Resource] -> ResourceSetOutput
ResourceSetOutput'
            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
"tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"resourceSetType")
            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
"resourceSetName")
            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
"resourceSetArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resources" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ResourceSetOutput where
  hashWithSalt :: Int -> ResourceSetOutput -> Int
hashWithSalt Int
_salt ResourceSetOutput' {[Resource]
Maybe (HashMap Text Text)
Text
resources :: [Resource]
resourceSetArn :: Text
resourceSetName :: Text
resourceSetType :: Text
tags :: Maybe (HashMap Text Text)
$sel:resources:ResourceSetOutput' :: ResourceSetOutput -> [Resource]
$sel:resourceSetArn:ResourceSetOutput' :: ResourceSetOutput -> Text
$sel:resourceSetName:ResourceSetOutput' :: ResourceSetOutput -> Text
$sel:resourceSetType:ResourceSetOutput' :: ResourceSetOutput -> Text
$sel:tags:ResourceSetOutput' :: ResourceSetOutput -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceSetType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceSetName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceSetArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Resource]
resources

instance Prelude.NFData ResourceSetOutput where
  rnf :: ResourceSetOutput -> ()
rnf ResourceSetOutput' {[Resource]
Maybe (HashMap Text Text)
Text
resources :: [Resource]
resourceSetArn :: Text
resourceSetName :: Text
resourceSetType :: Text
tags :: Maybe (HashMap Text Text)
$sel:resources:ResourceSetOutput' :: ResourceSetOutput -> [Resource]
$sel:resourceSetArn:ResourceSetOutput' :: ResourceSetOutput -> Text
$sel:resourceSetName:ResourceSetOutput' :: ResourceSetOutput -> Text
$sel:resourceSetType:ResourceSetOutput' :: ResourceSetOutput -> Text
$sel:tags:ResourceSetOutput' :: ResourceSetOutput -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceSetType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceSetName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceSetArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Resource]
resources