{-# 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.WAF.ListSqlInjectionMatchSets -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- This is __AWS WAF Classic__ documentation. For more information, see -- -- in the developer guide. -- -- __For the latest version of AWS WAF__, use the AWS WAFV2 API and see the -- . -- With the latest version, AWS WAF has a single set of endpoints for -- regional and global use. -- -- Returns an array of SqlInjectionMatchSet objects. -- -- This operation returns paginated results. module Amazonka.WAF.ListSqlInjectionMatchSets ( -- * Creating a Request ListSqlInjectionMatchSets (..), newListSqlInjectionMatchSets, -- * Request Lenses listSqlInjectionMatchSets_limit, listSqlInjectionMatchSets_nextMarker, -- * Destructuring the Response ListSqlInjectionMatchSetsResponse (..), newListSqlInjectionMatchSetsResponse, -- * Response Lenses listSqlInjectionMatchSetsResponse_nextMarker, listSqlInjectionMatchSetsResponse_sqlInjectionMatchSets, listSqlInjectionMatchSetsResponse_httpStatus, ) 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 qualified Amazonka.Request as Request import qualified Amazonka.Response as Response import Amazonka.WAF.Types -- | A request to list the SqlInjectionMatchSet objects created by the -- current AWS account. -- -- /See:/ 'newListSqlInjectionMatchSets' smart constructor. data ListSqlInjectionMatchSets = ListSqlInjectionMatchSets' { -- | Specifies the number of SqlInjectionMatchSet objects that you want AWS -- WAF to return for this request. If you have more @SqlInjectionMatchSet@ -- objects than the number you specify for @Limit@, the response includes a -- @NextMarker@ value that you can use to get another batch of @Rules@. limit :: Prelude.Maybe Prelude.Natural, -- | If you specify a value for @Limit@ and you have more -- SqlInjectionMatchSet objects than the value of @Limit@, AWS WAF returns -- a @NextMarker@ value in the response that allows you to list another -- group of @SqlInjectionMatchSets@. For the second and subsequent -- @ListSqlInjectionMatchSets@ requests, specify the value of @NextMarker@ -- from the previous response to get information about another batch of -- @SqlInjectionMatchSets@. nextMarker :: Prelude.Maybe Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ListSqlInjectionMatchSets' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'limit', 'listSqlInjectionMatchSets_limit' - Specifies the number of SqlInjectionMatchSet objects that you want AWS -- WAF to return for this request. If you have more @SqlInjectionMatchSet@ -- objects than the number you specify for @Limit@, the response includes a -- @NextMarker@ value that you can use to get another batch of @Rules@. -- -- 'nextMarker', 'listSqlInjectionMatchSets_nextMarker' - If you specify a value for @Limit@ and you have more -- SqlInjectionMatchSet objects than the value of @Limit@, AWS WAF returns -- a @NextMarker@ value in the response that allows you to list another -- group of @SqlInjectionMatchSets@. For the second and subsequent -- @ListSqlInjectionMatchSets@ requests, specify the value of @NextMarker@ -- from the previous response to get information about another batch of -- @SqlInjectionMatchSets@. newListSqlInjectionMatchSets :: ListSqlInjectionMatchSets newListSqlInjectionMatchSets = ListSqlInjectionMatchSets' { limit = Prelude.Nothing, nextMarker = Prelude.Nothing } -- | Specifies the number of SqlInjectionMatchSet objects that you want AWS -- WAF to return for this request. If you have more @SqlInjectionMatchSet@ -- objects than the number you specify for @Limit@, the response includes a -- @NextMarker@ value that you can use to get another batch of @Rules@. listSqlInjectionMatchSets_limit :: Lens.Lens' ListSqlInjectionMatchSets (Prelude.Maybe Prelude.Natural) listSqlInjectionMatchSets_limit = Lens.lens (\ListSqlInjectionMatchSets' {limit} -> limit) (\s@ListSqlInjectionMatchSets' {} a -> s {limit = a} :: ListSqlInjectionMatchSets) -- | If you specify a value for @Limit@ and you have more -- SqlInjectionMatchSet objects than the value of @Limit@, AWS WAF returns -- a @NextMarker@ value in the response that allows you to list another -- group of @SqlInjectionMatchSets@. For the second and subsequent -- @ListSqlInjectionMatchSets@ requests, specify the value of @NextMarker@ -- from the previous response to get information about another batch of -- @SqlInjectionMatchSets@. listSqlInjectionMatchSets_nextMarker :: Lens.Lens' ListSqlInjectionMatchSets (Prelude.Maybe Prelude.Text) listSqlInjectionMatchSets_nextMarker = Lens.lens (\ListSqlInjectionMatchSets' {nextMarker} -> nextMarker) (\s@ListSqlInjectionMatchSets' {} a -> s {nextMarker = a} :: ListSqlInjectionMatchSets) instance Core.AWSPager ListSqlInjectionMatchSets where page rq rs | Core.stop ( rs Lens.^? listSqlInjectionMatchSetsResponse_nextMarker Prelude.. Lens._Just ) = Prelude.Nothing | Core.stop ( rs Lens.^? listSqlInjectionMatchSetsResponse_sqlInjectionMatchSets Prelude.. Lens._Just ) = Prelude.Nothing | Prelude.otherwise = Prelude.Just Prelude.$ rq Prelude.& listSqlInjectionMatchSets_nextMarker Lens..~ rs Lens.^? listSqlInjectionMatchSetsResponse_nextMarker Prelude.. Lens._Just instance Core.AWSRequest ListSqlInjectionMatchSets where type AWSResponse ListSqlInjectionMatchSets = ListSqlInjectionMatchSetsResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveJSON ( \s h x -> ListSqlInjectionMatchSetsResponse' Prelude.<$> (x Data..?> "NextMarker") Prelude.<*> ( x Data..?> "SqlInjectionMatchSets" Core..!@ Prelude.mempty ) Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable ListSqlInjectionMatchSets where hashWithSalt _salt ListSqlInjectionMatchSets' {..} = _salt `Prelude.hashWithSalt` limit `Prelude.hashWithSalt` nextMarker instance Prelude.NFData ListSqlInjectionMatchSets where rnf ListSqlInjectionMatchSets' {..} = Prelude.rnf limit `Prelude.seq` Prelude.rnf nextMarker instance Data.ToHeaders ListSqlInjectionMatchSets where toHeaders = Prelude.const ( Prelude.mconcat [ "X-Amz-Target" Data.=# ( "AWSWAF_20150824.ListSqlInjectionMatchSets" :: Prelude.ByteString ), "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON ListSqlInjectionMatchSets where toJSON ListSqlInjectionMatchSets' {..} = Data.object ( Prelude.catMaybes [ ("Limit" Data..=) Prelude.<$> limit, ("NextMarker" Data..=) Prelude.<$> nextMarker ] ) instance Data.ToPath ListSqlInjectionMatchSets where toPath = Prelude.const "/" instance Data.ToQuery ListSqlInjectionMatchSets where toQuery = Prelude.const Prelude.mempty -- | The response to a ListSqlInjectionMatchSets request. -- -- /See:/ 'newListSqlInjectionMatchSetsResponse' smart constructor. data ListSqlInjectionMatchSetsResponse = ListSqlInjectionMatchSetsResponse' { -- | If you have more SqlInjectionMatchSet objects than the number that you -- specified for @Limit@ in the request, the response includes a -- @NextMarker@ value. To list more @SqlInjectionMatchSet@ objects, submit -- another @ListSqlInjectionMatchSets@ request, and specify the -- @NextMarker@ value from the response in the @NextMarker@ value in the -- next request. nextMarker :: Prelude.Maybe Prelude.Text, -- | An array of SqlInjectionMatchSetSummary objects. sqlInjectionMatchSets :: Prelude.Maybe [SqlInjectionMatchSetSummary], -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ListSqlInjectionMatchSetsResponse' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'nextMarker', 'listSqlInjectionMatchSetsResponse_nextMarker' - If you have more SqlInjectionMatchSet objects than the number that you -- specified for @Limit@ in the request, the response includes a -- @NextMarker@ value. To list more @SqlInjectionMatchSet@ objects, submit -- another @ListSqlInjectionMatchSets@ request, and specify the -- @NextMarker@ value from the response in the @NextMarker@ value in the -- next request. -- -- 'sqlInjectionMatchSets', 'listSqlInjectionMatchSetsResponse_sqlInjectionMatchSets' - An array of SqlInjectionMatchSetSummary objects. -- -- 'httpStatus', 'listSqlInjectionMatchSetsResponse_httpStatus' - The response's http status code. newListSqlInjectionMatchSetsResponse :: -- | 'httpStatus' Prelude.Int -> ListSqlInjectionMatchSetsResponse newListSqlInjectionMatchSetsResponse pHttpStatus_ = ListSqlInjectionMatchSetsResponse' { nextMarker = Prelude.Nothing, sqlInjectionMatchSets = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | If you have more SqlInjectionMatchSet objects than the number that you -- specified for @Limit@ in the request, the response includes a -- @NextMarker@ value. To list more @SqlInjectionMatchSet@ objects, submit -- another @ListSqlInjectionMatchSets@ request, and specify the -- @NextMarker@ value from the response in the @NextMarker@ value in the -- next request. listSqlInjectionMatchSetsResponse_nextMarker :: Lens.Lens' ListSqlInjectionMatchSetsResponse (Prelude.Maybe Prelude.Text) listSqlInjectionMatchSetsResponse_nextMarker = Lens.lens (\ListSqlInjectionMatchSetsResponse' {nextMarker} -> nextMarker) (\s@ListSqlInjectionMatchSetsResponse' {} a -> s {nextMarker = a} :: ListSqlInjectionMatchSetsResponse) -- | An array of SqlInjectionMatchSetSummary objects. listSqlInjectionMatchSetsResponse_sqlInjectionMatchSets :: Lens.Lens' ListSqlInjectionMatchSetsResponse (Prelude.Maybe [SqlInjectionMatchSetSummary]) listSqlInjectionMatchSetsResponse_sqlInjectionMatchSets = Lens.lens (\ListSqlInjectionMatchSetsResponse' {sqlInjectionMatchSets} -> sqlInjectionMatchSets) (\s@ListSqlInjectionMatchSetsResponse' {} a -> s {sqlInjectionMatchSets = a} :: ListSqlInjectionMatchSetsResponse) Prelude.. Lens.mapping Lens.coerced -- | The response's http status code. listSqlInjectionMatchSetsResponse_httpStatus :: Lens.Lens' ListSqlInjectionMatchSetsResponse Prelude.Int listSqlInjectionMatchSetsResponse_httpStatus = Lens.lens (\ListSqlInjectionMatchSetsResponse' {httpStatus} -> httpStatus) (\s@ListSqlInjectionMatchSetsResponse' {} a -> s {httpStatus = a} :: ListSqlInjectionMatchSetsResponse) instance Prelude.NFData ListSqlInjectionMatchSetsResponse where rnf ListSqlInjectionMatchSetsResponse' {..} = Prelude.rnf nextMarker `Prelude.seq` Prelude.rnf sqlInjectionMatchSets `Prelude.seq` Prelude.rnf httpStatus