{-# 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.Athena.ListApplicationDPUSizes -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Returns the supported DPU sizes for the supported application runtimes -- (for example, @Jupyter 1.0@). module Amazonka.Athena.ListApplicationDPUSizes ( -- * Creating a Request ListApplicationDPUSizes (..), newListApplicationDPUSizes, -- * Request Lenses listApplicationDPUSizes_maxResults, listApplicationDPUSizes_nextToken, -- * Destructuring the Response ListApplicationDPUSizesResponse (..), newListApplicationDPUSizesResponse, -- * Response Lenses listApplicationDPUSizesResponse_applicationDPUSizes, listApplicationDPUSizesResponse_nextToken, listApplicationDPUSizesResponse_httpStatus, ) where import Amazonka.Athena.Types 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 -- | /See:/ 'newListApplicationDPUSizes' smart constructor. data ListApplicationDPUSizes = ListApplicationDPUSizes' { -- | Specifies the maximum number of results to return. maxResults :: Prelude.Maybe Prelude.Natural, -- | A token generated by the Athena service that specifies where to continue -- pagination if a previous request was truncated. nextToken :: Prelude.Maybe Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ListApplicationDPUSizes' 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: -- -- 'maxResults', 'listApplicationDPUSizes_maxResults' - Specifies the maximum number of results to return. -- -- 'nextToken', 'listApplicationDPUSizes_nextToken' - A token generated by the Athena service that specifies where to continue -- pagination if a previous request was truncated. newListApplicationDPUSizes :: ListApplicationDPUSizes newListApplicationDPUSizes = ListApplicationDPUSizes' { maxResults = Prelude.Nothing, nextToken = Prelude.Nothing } -- | Specifies the maximum number of results to return. listApplicationDPUSizes_maxResults :: Lens.Lens' ListApplicationDPUSizes (Prelude.Maybe Prelude.Natural) listApplicationDPUSizes_maxResults = Lens.lens (\ListApplicationDPUSizes' {maxResults} -> maxResults) (\s@ListApplicationDPUSizes' {} a -> s {maxResults = a} :: ListApplicationDPUSizes) -- | A token generated by the Athena service that specifies where to continue -- pagination if a previous request was truncated. listApplicationDPUSizes_nextToken :: Lens.Lens' ListApplicationDPUSizes (Prelude.Maybe Prelude.Text) listApplicationDPUSizes_nextToken = Lens.lens (\ListApplicationDPUSizes' {nextToken} -> nextToken) (\s@ListApplicationDPUSizes' {} a -> s {nextToken = a} :: ListApplicationDPUSizes) instance Core.AWSRequest ListApplicationDPUSizes where type AWSResponse ListApplicationDPUSizes = ListApplicationDPUSizesResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveJSON ( \s h x -> ListApplicationDPUSizesResponse' Prelude.<$> ( x Data..?> "ApplicationDPUSizes" Core..!@ Prelude.mempty ) Prelude.<*> (x Data..?> "NextToken") Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable ListApplicationDPUSizes where hashWithSalt _salt ListApplicationDPUSizes' {..} = _salt `Prelude.hashWithSalt` maxResults `Prelude.hashWithSalt` nextToken instance Prelude.NFData ListApplicationDPUSizes where rnf ListApplicationDPUSizes' {..} = Prelude.rnf maxResults `Prelude.seq` Prelude.rnf nextToken instance Data.ToHeaders ListApplicationDPUSizes where toHeaders = Prelude.const ( Prelude.mconcat [ "X-Amz-Target" Data.=# ( "AmazonAthena.ListApplicationDPUSizes" :: Prelude.ByteString ), "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON ListApplicationDPUSizes where toJSON ListApplicationDPUSizes' {..} = Data.object ( Prelude.catMaybes [ ("MaxResults" Data..=) Prelude.<$> maxResults, ("NextToken" Data..=) Prelude.<$> nextToken ] ) instance Data.ToPath ListApplicationDPUSizes where toPath = Prelude.const "/" instance Data.ToQuery ListApplicationDPUSizes where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newListApplicationDPUSizesResponse' smart constructor. data ListApplicationDPUSizesResponse = ListApplicationDPUSizesResponse' { -- | A list of the supported DPU sizes that the application runtime supports. applicationDPUSizes :: Prelude.Maybe [ApplicationDPUSizes], -- | A token generated by the Athena service that specifies where to continue -- pagination if a previous request was truncated. To obtain the next set -- of pages, pass in the @NextToken@ from the response object of the -- previous page call. nextToken :: Prelude.Maybe Prelude.Text, -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'ListApplicationDPUSizesResponse' 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: -- -- 'applicationDPUSizes', 'listApplicationDPUSizesResponse_applicationDPUSizes' - A list of the supported DPU sizes that the application runtime supports. -- -- 'nextToken', 'listApplicationDPUSizesResponse_nextToken' - A token generated by the Athena service that specifies where to continue -- pagination if a previous request was truncated. To obtain the next set -- of pages, pass in the @NextToken@ from the response object of the -- previous page call. -- -- 'httpStatus', 'listApplicationDPUSizesResponse_httpStatus' - The response's http status code. newListApplicationDPUSizesResponse :: -- | 'httpStatus' Prelude.Int -> ListApplicationDPUSizesResponse newListApplicationDPUSizesResponse pHttpStatus_ = ListApplicationDPUSizesResponse' { applicationDPUSizes = Prelude.Nothing, nextToken = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | A list of the supported DPU sizes that the application runtime supports. listApplicationDPUSizesResponse_applicationDPUSizes :: Lens.Lens' ListApplicationDPUSizesResponse (Prelude.Maybe [ApplicationDPUSizes]) listApplicationDPUSizesResponse_applicationDPUSizes = Lens.lens (\ListApplicationDPUSizesResponse' {applicationDPUSizes} -> applicationDPUSizes) (\s@ListApplicationDPUSizesResponse' {} a -> s {applicationDPUSizes = a} :: ListApplicationDPUSizesResponse) Prelude.. Lens.mapping Lens.coerced -- | A token generated by the Athena service that specifies where to continue -- pagination if a previous request was truncated. To obtain the next set -- of pages, pass in the @NextToken@ from the response object of the -- previous page call. listApplicationDPUSizesResponse_nextToken :: Lens.Lens' ListApplicationDPUSizesResponse (Prelude.Maybe Prelude.Text) listApplicationDPUSizesResponse_nextToken = Lens.lens (\ListApplicationDPUSizesResponse' {nextToken} -> nextToken) (\s@ListApplicationDPUSizesResponse' {} a -> s {nextToken = a} :: ListApplicationDPUSizesResponse) -- | The response's http status code. listApplicationDPUSizesResponse_httpStatus :: Lens.Lens' ListApplicationDPUSizesResponse Prelude.Int listApplicationDPUSizesResponse_httpStatus = Lens.lens (\ListApplicationDPUSizesResponse' {httpStatus} -> httpStatus) (\s@ListApplicationDPUSizesResponse' {} a -> s {httpStatus = a} :: ListApplicationDPUSizesResponse) instance Prelude.NFData ListApplicationDPUSizesResponse where rnf ListApplicationDPUSizesResponse' {..} = Prelude.rnf applicationDPUSizes `Prelude.seq` Prelude.rnf nextToken `Prelude.seq` Prelude.rnf httpStatus