{-# 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.Account.PutContactInformation -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Updates the primary contact information of an Amazon Web Services -- account. -- -- For complete details about how to use the primary contact operations, -- see -- . module Amazonka.Account.PutContactInformation ( -- * Creating a Request PutContactInformation (..), newPutContactInformation, -- * Request Lenses putContactInformation_accountId, putContactInformation_contactInformation, -- * Destructuring the Response PutContactInformationResponse (..), newPutContactInformationResponse, ) where import Amazonka.Account.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:/ 'newPutContactInformation' smart constructor. data PutContactInformation = PutContactInformation' { -- | Specifies the 12-digit account ID number of the Amazon Web Services -- account that you want to access or modify with this operation. If you -- don\'t specify this parameter, it defaults to the Amazon Web Services -- account of the identity used to call the operation. To use this -- parameter, the caller must be an identity in the -- -- or a delegated administrator account. The specified account ID must also -- be a member account in the same organization. The organization must have -- , -- and the organization must have -- -- enabled for the Account Management service, and optionally a -- -- account assigned. -- -- The management account can\'t specify its own @AccountId@. It must call -- the operation in standalone context by not including the @AccountId@ -- parameter. -- -- To call this operation on an account that is not a member of an -- organization, don\'t specify this parameter. Instead, call the operation -- using an identity belonging to the account whose contacts you wish to -- retrieve or modify. accountId :: Prelude.Maybe Prelude.Text, -- | Contains the details of the primary contact information associated with -- an Amazon Web Services account. contactInformation :: ContactInformation } deriving (Prelude.Eq, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'PutContactInformation' 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: -- -- 'accountId', 'putContactInformation_accountId' - Specifies the 12-digit account ID number of the Amazon Web Services -- account that you want to access or modify with this operation. If you -- don\'t specify this parameter, it defaults to the Amazon Web Services -- account of the identity used to call the operation. To use this -- parameter, the caller must be an identity in the -- -- or a delegated administrator account. The specified account ID must also -- be a member account in the same organization. The organization must have -- , -- and the organization must have -- -- enabled for the Account Management service, and optionally a -- -- account assigned. -- -- The management account can\'t specify its own @AccountId@. It must call -- the operation in standalone context by not including the @AccountId@ -- parameter. -- -- To call this operation on an account that is not a member of an -- organization, don\'t specify this parameter. Instead, call the operation -- using an identity belonging to the account whose contacts you wish to -- retrieve or modify. -- -- 'contactInformation', 'putContactInformation_contactInformation' - Contains the details of the primary contact information associated with -- an Amazon Web Services account. newPutContactInformation :: -- | 'contactInformation' ContactInformation -> PutContactInformation newPutContactInformation pContactInformation_ = PutContactInformation' { accountId = Prelude.Nothing, contactInformation = pContactInformation_ } -- | Specifies the 12-digit account ID number of the Amazon Web Services -- account that you want to access or modify with this operation. If you -- don\'t specify this parameter, it defaults to the Amazon Web Services -- account of the identity used to call the operation. To use this -- parameter, the caller must be an identity in the -- -- or a delegated administrator account. The specified account ID must also -- be a member account in the same organization. The organization must have -- , -- and the organization must have -- -- enabled for the Account Management service, and optionally a -- -- account assigned. -- -- The management account can\'t specify its own @AccountId@. It must call -- the operation in standalone context by not including the @AccountId@ -- parameter. -- -- To call this operation on an account that is not a member of an -- organization, don\'t specify this parameter. Instead, call the operation -- using an identity belonging to the account whose contacts you wish to -- retrieve or modify. putContactInformation_accountId :: Lens.Lens' PutContactInformation (Prelude.Maybe Prelude.Text) putContactInformation_accountId = Lens.lens (\PutContactInformation' {accountId} -> accountId) (\s@PutContactInformation' {} a -> s {accountId = a} :: PutContactInformation) -- | Contains the details of the primary contact information associated with -- an Amazon Web Services account. putContactInformation_contactInformation :: Lens.Lens' PutContactInformation ContactInformation putContactInformation_contactInformation = Lens.lens (\PutContactInformation' {contactInformation} -> contactInformation) (\s@PutContactInformation' {} a -> s {contactInformation = a} :: PutContactInformation) instance Core.AWSRequest PutContactInformation where type AWSResponse PutContactInformation = PutContactInformationResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveNull PutContactInformationResponse' instance Prelude.Hashable PutContactInformation where hashWithSalt _salt PutContactInformation' {..} = _salt `Prelude.hashWithSalt` accountId `Prelude.hashWithSalt` contactInformation instance Prelude.NFData PutContactInformation where rnf PutContactInformation' {..} = Prelude.rnf accountId `Prelude.seq` Prelude.rnf contactInformation instance Data.ToHeaders PutContactInformation where toHeaders = Prelude.const ( Prelude.mconcat [ "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON PutContactInformation where toJSON PutContactInformation' {..} = Data.object ( Prelude.catMaybes [ ("AccountId" Data..=) Prelude.<$> accountId, Prelude.Just ("ContactInformation" Data..= contactInformation) ] ) instance Data.ToPath PutContactInformation where toPath = Prelude.const "/putContactInformation" instance Data.ToQuery PutContactInformation where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newPutContactInformationResponse' smart constructor. data PutContactInformationResponse = PutContactInformationResponse' { } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'PutContactInformationResponse' with all optional fields omitted. -- -- Use or to modify other optional fields. newPutContactInformationResponse :: PutContactInformationResponse newPutContactInformationResponse = PutContactInformationResponse' instance Prelude.NFData PutContactInformationResponse where rnf _ = ()