{-# 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.AutoScaling.Types.Filter -- 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.AutoScaling.Types.Filter 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 -- | Describes a filter that is used to return a more specific list of -- results from a describe operation. -- -- If you specify multiple filters, the filters are automatically logically -- joined with an @AND@, and the request returns only the results that -- match all of the specified filters. -- -- For more information, see -- <https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html Tag Auto Scaling groups and instances> -- in the /Amazon EC2 Auto Scaling User Guide/. -- -- /See:/ 'newFilter' smart constructor. data Filter = Filter' { -- | One or more filter values. Filter values are case-sensitive. -- -- If you specify multiple values for a filter, the values are -- automatically logically joined with an @OR@, and the request returns all -- results that match any of the specified values. For example, specify -- \"tag:environment\" for the filter name and \"production,development\" -- for the filter values to find Auto Scaling groups with the tag -- \"environment=production\" or \"environment=development\". Filter -> Maybe [Text] values :: Prelude.Maybe [Prelude.Text], -- | The name of the filter. -- -- The valid values for @Name@ depend on which API operation you\'re using -- with the filter (DescribeAutoScalingGroups or DescribeTags). -- -- __DescribeAutoScalingGroups__ -- -- Valid values for @Name@ include the following: -- -- - @tag-key@ - Accepts tag keys. The results only include information -- about the Auto Scaling groups associated with these tag keys. -- -- - @tag-value@ - Accepts tag values. The results only include -- information about the Auto Scaling groups associated with these tag -- values. -- -- - @tag:\<key>@ - Accepts the key\/value combination of the tag. Use -- the tag key in the filter name and the tag value as the filter -- value. The results only include information about the Auto Scaling -- groups associated with the specified key\/value combination. -- -- __DescribeTags__ -- -- Valid values for @Name@ include the following: -- -- - @auto-scaling-group@ - Accepts the names of Auto Scaling groups. The -- results only include information about the tags associated with -- these Auto Scaling groups. -- -- - @key@ - Accepts tag keys. The results only include information about -- the tags associated with these tag keys. -- -- - @value@ - Accepts tag values. The results only include information -- about the tags associated with these tag values. -- -- - @propagate-at-launch@ - Accepts a Boolean value, which specifies -- whether tags propagate to instances at launch. The results only -- include information about the tags associated with the specified -- Boolean value. Filter -> Text name :: Prelude.Text } deriving (Filter -> Filter -> Bool forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: Filter -> Filter -> Bool $c/= :: Filter -> Filter -> Bool == :: Filter -> Filter -> Bool $c== :: Filter -> Filter -> Bool Prelude.Eq, ReadPrec [Filter] ReadPrec Filter Int -> ReadS Filter ReadS [Filter] forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a readListPrec :: ReadPrec [Filter] $creadListPrec :: ReadPrec [Filter] readPrec :: ReadPrec Filter $creadPrec :: ReadPrec Filter readList :: ReadS [Filter] $creadList :: ReadS [Filter] readsPrec :: Int -> ReadS Filter $creadsPrec :: Int -> ReadS Filter Prelude.Read, Int -> Filter -> ShowS [Filter] -> ShowS Filter -> String forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [Filter] -> ShowS $cshowList :: [Filter] -> ShowS show :: Filter -> String $cshow :: Filter -> String showsPrec :: Int -> Filter -> ShowS $cshowsPrec :: Int -> Filter -> ShowS Prelude.Show, forall x. Rep Filter x -> Filter forall x. Filter -> Rep Filter x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep Filter x -> Filter $cfrom :: forall x. Filter -> Rep Filter x Prelude.Generic) -- | -- Create a value of 'Filter' 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: -- -- 'values', 'filter_values' - One or more filter values. Filter values are case-sensitive. -- -- If you specify multiple values for a filter, the values are -- automatically logically joined with an @OR@, and the request returns all -- results that match any of the specified values. For example, specify -- \"tag:environment\" for the filter name and \"production,development\" -- for the filter values to find Auto Scaling groups with the tag -- \"environment=production\" or \"environment=development\". -- -- 'name', 'filter_name' - The name of the filter. -- -- The valid values for @Name@ depend on which API operation you\'re using -- with the filter (DescribeAutoScalingGroups or DescribeTags). -- -- __DescribeAutoScalingGroups__ -- -- Valid values for @Name@ include the following: -- -- - @tag-key@ - Accepts tag keys. The results only include information -- about the Auto Scaling groups associated with these tag keys. -- -- - @tag-value@ - Accepts tag values. The results only include -- information about the Auto Scaling groups associated with these tag -- values. -- -- - @tag:\<key>@ - Accepts the key\/value combination of the tag. Use -- the tag key in the filter name and the tag value as the filter -- value. The results only include information about the Auto Scaling -- groups associated with the specified key\/value combination. -- -- __DescribeTags__ -- -- Valid values for @Name@ include the following: -- -- - @auto-scaling-group@ - Accepts the names of Auto Scaling groups. The -- results only include information about the tags associated with -- these Auto Scaling groups. -- -- - @key@ - Accepts tag keys. The results only include information about -- the tags associated with these tag keys. -- -- - @value@ - Accepts tag values. The results only include information -- about the tags associated with these tag values. -- -- - @propagate-at-launch@ - Accepts a Boolean value, which specifies -- whether tags propagate to instances at launch. The results only -- include information about the tags associated with the specified -- Boolean value. newFilter :: -- | 'name' Prelude.Text -> Filter newFilter :: Text -> Filter newFilter Text pName_ = Filter' {$sel:values:Filter' :: Maybe [Text] values = forall a. Maybe a Prelude.Nothing, $sel:name:Filter' :: Text name = Text pName_} -- | One or more filter values. Filter values are case-sensitive. -- -- If you specify multiple values for a filter, the values are -- automatically logically joined with an @OR@, and the request returns all -- results that match any of the specified values. For example, specify -- \"tag:environment\" for the filter name and \"production,development\" -- for the filter values to find Auto Scaling groups with the tag -- \"environment=production\" or \"environment=development\". filter_values :: Lens.Lens' Filter (Prelude.Maybe [Prelude.Text]) filter_values :: Lens' Filter (Maybe [Text]) filter_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\Filter' {Maybe [Text] values :: Maybe [Text] $sel:values:Filter' :: Filter -> Maybe [Text] values} -> Maybe [Text] values) (\s :: Filter s@Filter' {} Maybe [Text] a -> Filter s {$sel:values:Filter' :: Maybe [Text] values = Maybe [Text] a} :: Filter) 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 name of the filter. -- -- The valid values for @Name@ depend on which API operation you\'re using -- with the filter (DescribeAutoScalingGroups or DescribeTags). -- -- __DescribeAutoScalingGroups__ -- -- Valid values for @Name@ include the following: -- -- - @tag-key@ - Accepts tag keys. The results only include information -- about the Auto Scaling groups associated with these tag keys. -- -- - @tag-value@ - Accepts tag values. The results only include -- information about the Auto Scaling groups associated with these tag -- values. -- -- - @tag:\<key>@ - Accepts the key\/value combination of the tag. Use -- the tag key in the filter name and the tag value as the filter -- value. The results only include information about the Auto Scaling -- groups associated with the specified key\/value combination. -- -- __DescribeTags__ -- -- Valid values for @Name@ include the following: -- -- - @auto-scaling-group@ - Accepts the names of Auto Scaling groups. The -- results only include information about the tags associated with -- these Auto Scaling groups. -- -- - @key@ - Accepts tag keys. The results only include information about -- the tags associated with these tag keys. -- -- - @value@ - Accepts tag values. The results only include information -- about the tags associated with these tag values. -- -- - @propagate-at-launch@ - Accepts a Boolean value, which specifies -- whether tags propagate to instances at launch. The results only -- include information about the tags associated with the specified -- Boolean value. filter_name :: Lens.Lens' Filter Prelude.Text filter_name :: Lens' Filter Text filter_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b Lens.lens (\Filter' {Text name :: Text $sel:name:Filter' :: Filter -> Text name} -> Text name) (\s :: Filter s@Filter' {} Text a -> Filter s {$sel:name:Filter' :: Text name = Text a} :: Filter) instance Prelude.Hashable Filter where hashWithSalt :: Int -> Filter -> Int hashWithSalt Int _salt Filter' {Maybe [Text] Text name :: Text values :: Maybe [Text] $sel:name:Filter' :: Filter -> Text $sel:values:Filter' :: Filter -> Maybe [Text] ..} = Int _salt forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Maybe [Text] values forall a. Hashable a => Int -> a -> Int `Prelude.hashWithSalt` Text name instance Prelude.NFData Filter where rnf :: Filter -> () rnf Filter' {Maybe [Text] Text name :: Text values :: Maybe [Text] $sel:name:Filter' :: Filter -> Text $sel:values:Filter' :: Filter -> Maybe [Text] ..} = forall a. NFData a => a -> () Prelude.rnf Maybe [Text] values seq :: forall a b. a -> b -> b `Prelude.seq` forall a. NFData a => a -> () Prelude.rnf Text name instance Data.ToQuery Filter where toQuery :: Filter -> QueryString toQuery Filter' {Maybe [Text] Text name :: Text values :: Maybe [Text] $sel:name:Filter' :: Filter -> Text $sel:values:Filter' :: Filter -> Maybe [Text] ..} = forall a. Monoid a => [a] -> a Prelude.mconcat [ ByteString "Values" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: forall a. ToQuery a => a -> QueryString Data.toQuery (forall a. (IsList a, ToQuery (Item a)) => ByteString -> a -> QueryString Data.toQueryList ByteString "member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b Prelude.<$> Maybe [Text] values), ByteString "Name" forall a. ToQuery a => ByteString -> a -> QueryString Data.=: Text name ]