{-# 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.IAM.GenerateCredentialReport -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Generates a credential report for the Amazon Web Services account. For -- more information about the credential report, see -- -- in the /IAM User Guide/. module Amazonka.IAM.GenerateCredentialReport ( -- * Creating a Request GenerateCredentialReport (..), newGenerateCredentialReport, -- * Destructuring the Response GenerateCredentialReportResponse (..), newGenerateCredentialReportResponse, -- * Response Lenses generateCredentialReportResponse_description, generateCredentialReportResponse_state, generateCredentialReportResponse_httpStatus, ) where import qualified Amazonka.Core as Core import qualified Amazonka.Core.Lens.Internal as Lens import qualified Amazonka.Data as Data import Amazonka.IAM.Types import qualified Amazonka.Prelude as Prelude import qualified Amazonka.Request as Request import qualified Amazonka.Response as Response -- | /See:/ 'newGenerateCredentialReport' smart constructor. data GenerateCredentialReport = GenerateCredentialReport' { } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'GenerateCredentialReport' with all optional fields omitted. -- -- Use or to modify other optional fields. newGenerateCredentialReport :: GenerateCredentialReport newGenerateCredentialReport = GenerateCredentialReport' instance Core.AWSRequest GenerateCredentialReport where type AWSResponse GenerateCredentialReport = GenerateCredentialReportResponse request overrides = Request.postQuery (overrides defaultService) response = Response.receiveXMLWrapper "GenerateCredentialReportResult" ( \s h x -> GenerateCredentialReportResponse' Prelude.<$> (x Data..@? "Description") Prelude.<*> (x Data..@? "State") Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable GenerateCredentialReport where hashWithSalt _salt _ = _salt `Prelude.hashWithSalt` () instance Prelude.NFData GenerateCredentialReport where rnf _ = () instance Data.ToHeaders GenerateCredentialReport where toHeaders = Prelude.const Prelude.mempty instance Data.ToPath GenerateCredentialReport where toPath = Prelude.const "/" instance Data.ToQuery GenerateCredentialReport where toQuery = Prelude.const ( Prelude.mconcat [ "Action" Data.=: ("GenerateCredentialReport" :: Prelude.ByteString), "Version" Data.=: ("2010-05-08" :: Prelude.ByteString) ] ) -- | Contains the response to a successful GenerateCredentialReport request. -- -- /See:/ 'newGenerateCredentialReportResponse' smart constructor. data GenerateCredentialReportResponse = GenerateCredentialReportResponse' { -- | Information about the credential report. description :: Prelude.Maybe Prelude.Text, -- | Information about the state of the credential report. state :: Prelude.Maybe ReportStateType, -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'GenerateCredentialReportResponse' 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: -- -- 'description', 'generateCredentialReportResponse_description' - Information about the credential report. -- -- 'state', 'generateCredentialReportResponse_state' - Information about the state of the credential report. -- -- 'httpStatus', 'generateCredentialReportResponse_httpStatus' - The response's http status code. newGenerateCredentialReportResponse :: -- | 'httpStatus' Prelude.Int -> GenerateCredentialReportResponse newGenerateCredentialReportResponse pHttpStatus_ = GenerateCredentialReportResponse' { description = Prelude.Nothing, state = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | Information about the credential report. generateCredentialReportResponse_description :: Lens.Lens' GenerateCredentialReportResponse (Prelude.Maybe Prelude.Text) generateCredentialReportResponse_description = Lens.lens (\GenerateCredentialReportResponse' {description} -> description) (\s@GenerateCredentialReportResponse' {} a -> s {description = a} :: GenerateCredentialReportResponse) -- | Information about the state of the credential report. generateCredentialReportResponse_state :: Lens.Lens' GenerateCredentialReportResponse (Prelude.Maybe ReportStateType) generateCredentialReportResponse_state = Lens.lens (\GenerateCredentialReportResponse' {state} -> state) (\s@GenerateCredentialReportResponse' {} a -> s {state = a} :: GenerateCredentialReportResponse) -- | The response's http status code. generateCredentialReportResponse_httpStatus :: Lens.Lens' GenerateCredentialReportResponse Prelude.Int generateCredentialReportResponse_httpStatus = Lens.lens (\GenerateCredentialReportResponse' {httpStatus} -> httpStatus) (\s@GenerateCredentialReportResponse' {} a -> s {httpStatus = a} :: GenerateCredentialReportResponse) instance Prelude.NFData GenerateCredentialReportResponse where rnf GenerateCredentialReportResponse' {..} = Prelude.rnf description `Prelude.seq` Prelude.rnf state `Prelude.seq` Prelude.rnf httpStatus