{-# 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.SSM.UpdateAssociation
-- 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 an association. You can update the association name and version,
-- the document version, schedule, parameters, and Amazon Simple Storage
-- Service (Amazon S3) output. When you call @UpdateAssociation@, the
-- system removes all optional parameters from the request and overwrites
-- the association with null values for those parameters. This is by
-- design. You must specify all optional parameters in the call, even if
-- you are not changing the parameters. This includes the @Name@ parameter.
-- Before calling this API action, we recommend that you call the
-- DescribeAssociation API operation and make a note of all optional
-- parameters required for your @UpdateAssociation@ call.
--
-- In order to call this API operation, your Identity and Access Management
-- (IAM) user account, group, or role must be configured with permission to
-- call the DescribeAssociation API operation. If you don\'t have
-- permission to call @DescribeAssociation@, then you receive the following
-- error:
-- @An error occurred (AccessDeniedException) when calling the UpdateAssociation operation: User: \<user_arn> isn\'t authorized to perform: ssm:DescribeAssociation on resource: \<resource_arn>@
--
-- When you update an association, the association immediately runs against
-- the specified targets. You can add the @ApplyOnlyAtCronInterval@
-- parameter to run the association during the next schedule run.
module Amazonka.SSM.UpdateAssociation
  ( -- * Creating a Request
    UpdateAssociation (..),
    newUpdateAssociation,

    -- * Request Lenses
    updateAssociation_alarmConfiguration,
    updateAssociation_applyOnlyAtCronInterval,
    updateAssociation_associationName,
    updateAssociation_associationVersion,
    updateAssociation_automationTargetParameterName,
    updateAssociation_calendarNames,
    updateAssociation_complianceSeverity,
    updateAssociation_documentVersion,
    updateAssociation_maxConcurrency,
    updateAssociation_maxErrors,
    updateAssociation_name,
    updateAssociation_outputLocation,
    updateAssociation_parameters,
    updateAssociation_scheduleExpression,
    updateAssociation_scheduleOffset,
    updateAssociation_syncCompliance,
    updateAssociation_targetLocations,
    updateAssociation_targetMaps,
    updateAssociation_targets,
    updateAssociation_associationId,

    -- * Destructuring the Response
    UpdateAssociationResponse (..),
    newUpdateAssociationResponse,

    -- * Response Lenses
    updateAssociationResponse_associationDescription,
    updateAssociationResponse_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.SSM.Types

-- | /See:/ 'newUpdateAssociation' smart constructor.
data UpdateAssociation = UpdateAssociation'
  { UpdateAssociation -> Maybe AlarmConfiguration
alarmConfiguration :: Prelude.Maybe AlarmConfiguration,
    -- | By default, when you update an association, the system runs it
    -- immediately after it is updated and then according to the schedule you
    -- specified. Specify this option if you don\'t want an association to run
    -- immediately after you update it. This parameter isn\'t supported for
    -- rate expressions.
    --
    -- If you chose this option when you created an association and later you
    -- edit that association or you make changes to the SSM document on which
    -- that association is based (by using the Documents page in the console),
    -- State Manager applies the association at the next specified cron
    -- interval. For example, if you chose the @Latest@ version of an SSM
    -- document when you created an association and you edit the association by
    -- choosing a different document version on the Documents page, State
    -- Manager applies the association at the next specified cron interval if
    -- you previously selected this option. If this option wasn\'t selected,
    -- State Manager immediately runs the association.
    --
    -- You can reset this option. To do so, specify the
    -- @no-apply-only-at-cron-interval@ parameter when you update the
    -- association from the command line. This parameter forces the association
    -- to run immediately after updating it and according to the interval
    -- specified.
    UpdateAssociation -> Maybe Bool
applyOnlyAtCronInterval :: Prelude.Maybe Prelude.Bool,
    -- | The name of the association that you want to update.
    UpdateAssociation -> Maybe Text
associationName :: Prelude.Maybe Prelude.Text,
    -- | This parameter is provided for concurrency control purposes. You must
    -- specify the latest association version in the service. If you want to
    -- ensure that this request succeeds, either specify @$LATEST@, or omit
    -- this parameter.
    UpdateAssociation -> Maybe Text
associationVersion :: Prelude.Maybe Prelude.Text,
    -- | Choose the parameter that will define how your automation will branch
    -- out. This target is required for associations that use an Automation
    -- runbook and target resources by using rate controls. Automation is a
    -- capability of Amazon Web Services Systems Manager.
    UpdateAssociation -> Maybe Text
automationTargetParameterName :: Prelude.Maybe Prelude.Text,
    -- | The names or Amazon Resource Names (ARNs) of the Change Calendar type
    -- documents you want to gate your associations under. The associations
    -- only run when that change calendar is open. For more information, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar Amazon Web Services Systems Manager Change Calendar>.
    UpdateAssociation -> Maybe [Text]
calendarNames :: Prelude.Maybe [Prelude.Text],
    -- | The severity level to assign to the association.
    UpdateAssociation -> Maybe AssociationComplianceSeverity
complianceSeverity :: Prelude.Maybe AssociationComplianceSeverity,
    -- | The document version you want update for the association.
    --
    -- State Manager doesn\'t support running associations that use a new
    -- version of a document if that document is shared from another account.
    -- State Manager always runs the @default@ version of a document if shared
    -- from another account, even though the Systems Manager console shows that
    -- a new version was processed. If you want to run an association using a
    -- new version of a document shared form another account, you must set the
    -- document version to @default@.
    UpdateAssociation -> Maybe Text
documentVersion :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of targets allowed to run the association at the same
    -- time. You can specify a number, for example 10, or a percentage of the
    -- target set, for example 10%. The default value is 100%, which means all
    -- targets run the association at the same time.
    --
    -- If a new managed node starts and attempts to run an association while
    -- Systems Manager is running @MaxConcurrency@ associations, the
    -- association is allowed to run. During the next association interval, the
    -- new managed node will process its association within the limit specified
    -- for @MaxConcurrency@.
    UpdateAssociation -> Maybe Text
maxConcurrency :: Prelude.Maybe Prelude.Text,
    -- | The number of errors that are allowed before the system stops sending
    -- requests to run the association on additional targets. You can specify
    -- either an absolute number of errors, for example 10, or a percentage of
    -- the target set, for example 10%. If you specify 3, for example, the
    -- system stops sending requests when the fourth error is received. If you
    -- specify 0, then the system stops sending requests after the first error
    -- is returned. If you run an association on 50 managed nodes and set
    -- @MaxError@ to 10%, then the system stops sending the request when the
    -- sixth error is received.
    --
    -- Executions that are already running an association when @MaxErrors@ is
    -- reached are allowed to complete, but some of these executions may fail
    -- as well. If you need to ensure that there won\'t be more than max-errors
    -- failed executions, set @MaxConcurrency@ to 1 so that executions proceed
    -- one at a time.
    UpdateAssociation -> Maybe Text
maxErrors :: Prelude.Maybe Prelude.Text,
    -- | The name of the SSM Command document or Automation runbook that contains
    -- the configuration information for the managed node.
    --
    -- You can specify Amazon Web Services-predefined documents, documents you
    -- created, or a document that is shared with you from another account.
    --
    -- For Systems Manager document (SSM document) that are shared with you
    -- from other Amazon Web Services accounts, you must specify the complete
    -- SSM document ARN, in the following format:
    --
    -- @arn:aws:ssm:@/@region@/@:@/@account-id@/@:document\/@/@document-name@/@ @
    --
    -- For example:
    --
    -- @arn:aws:ssm:us-east-2:12345678912:document\/My-Shared-Document@
    --
    -- For Amazon Web Services-predefined documents and SSM documents you
    -- created in your account, you only need to specify the document name. For
    -- example, @AWS-ApplyPatchBaseline@ or @My-Document@.
    UpdateAssociation -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | An S3 bucket where you want to store the results of this request.
    UpdateAssociation -> Maybe InstanceAssociationOutputLocation
outputLocation :: Prelude.Maybe InstanceAssociationOutputLocation,
    -- | The parameters you want to update for the association. If you create a
    -- parameter using Parameter Store, a capability of Amazon Web Services
    -- Systems Manager, you can reference the parameter using
    -- @{{ssm:parameter-name}}@.
    UpdateAssociation -> Maybe (Sensitive (HashMap Text [Text]))
parameters :: Prelude.Maybe (Data.Sensitive (Prelude.HashMap Prelude.Text [Prelude.Text])),
    -- | The cron expression used to schedule the association that you want to
    -- update.
    UpdateAssociation -> Maybe Text
scheduleExpression :: Prelude.Maybe Prelude.Text,
    -- | Number of days to wait after the scheduled day to run an association.
    -- For example, if you specified a cron schedule of
    -- @cron(0 0 ? * THU#2 *)@, you could specify an offset of 3 to run the
    -- association each Sunday after the second Thursday of the month. For more
    -- information about cron schedules for associations, see
    -- <https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html Reference: Cron and rate expressions for Systems Manager>
    -- in the /Amazon Web Services Systems Manager User Guide/.
    --
    -- To use offsets, you must specify the @ApplyOnlyAtCronInterval@
    -- parameter. This option tells the system not to run an association
    -- immediately after you create it.
    UpdateAssociation -> Maybe Natural
scheduleOffset :: Prelude.Maybe Prelude.Natural,
    -- | The mode for generating association compliance. You can specify @AUTO@
    -- or @MANUAL@. In @AUTO@ mode, the system uses the status of the
    -- association execution to determine the compliance status. If the
    -- association execution runs successfully, then the association is
    -- @COMPLIANT@. If the association execution doesn\'t run successfully, the
    -- association is @NON-COMPLIANT@.
    --
    -- In @MANUAL@ mode, you must specify the @AssociationId@ as a parameter
    -- for the PutComplianceItems API operation. In this case, compliance data
    -- isn\'t managed by State Manager, a capability of Amazon Web Services
    -- Systems Manager. It is managed by your direct call to the
    -- PutComplianceItems API operation.
    --
    -- By default, all associations use @AUTO@ mode.
    UpdateAssociation -> Maybe AssociationSyncCompliance
syncCompliance :: Prelude.Maybe AssociationSyncCompliance,
    -- | A location is a combination of Amazon Web Services Regions and Amazon
    -- Web Services accounts where you want to run the association. Use this
    -- action to update an association in multiple Regions and multiple
    -- accounts.
    UpdateAssociation -> Maybe (NonEmpty TargetLocation)
targetLocations :: Prelude.Maybe (Prelude.NonEmpty TargetLocation),
    -- | A key-value mapping of document parameters to target resources. Both
    -- Targets and TargetMaps can\'t be specified together.
    UpdateAssociation -> Maybe [HashMap Text [Text]]
targetMaps :: Prelude.Maybe [Prelude.HashMap Prelude.Text [Prelude.Text]],
    -- | The targets of the association.
    UpdateAssociation -> Maybe [Target]
targets :: Prelude.Maybe [Target],
    -- | The ID of the association you want to update.
    UpdateAssociation -> Text
associationId :: Prelude.Text
  }
  deriving (UpdateAssociation -> UpdateAssociation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssociation -> UpdateAssociation -> Bool
$c/= :: UpdateAssociation -> UpdateAssociation -> Bool
== :: UpdateAssociation -> UpdateAssociation -> Bool
$c== :: UpdateAssociation -> UpdateAssociation -> Bool
Prelude.Eq, Int -> UpdateAssociation -> ShowS
[UpdateAssociation] -> ShowS
UpdateAssociation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssociation] -> ShowS
$cshowList :: [UpdateAssociation] -> ShowS
show :: UpdateAssociation -> String
$cshow :: UpdateAssociation -> String
showsPrec :: Int -> UpdateAssociation -> ShowS
$cshowsPrec :: Int -> UpdateAssociation -> ShowS
Prelude.Show, forall x. Rep UpdateAssociation x -> UpdateAssociation
forall x. UpdateAssociation -> Rep UpdateAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAssociation x -> UpdateAssociation
$cfrom :: forall x. UpdateAssociation -> Rep UpdateAssociation x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAssociation' 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:
--
-- 'alarmConfiguration', 'updateAssociation_alarmConfiguration' - Undocumented member.
--
-- 'applyOnlyAtCronInterval', 'updateAssociation_applyOnlyAtCronInterval' - By default, when you update an association, the system runs it
-- immediately after it is updated and then according to the schedule you
-- specified. Specify this option if you don\'t want an association to run
-- immediately after you update it. This parameter isn\'t supported for
-- rate expressions.
--
-- If you chose this option when you created an association and later you
-- edit that association or you make changes to the SSM document on which
-- that association is based (by using the Documents page in the console),
-- State Manager applies the association at the next specified cron
-- interval. For example, if you chose the @Latest@ version of an SSM
-- document when you created an association and you edit the association by
-- choosing a different document version on the Documents page, State
-- Manager applies the association at the next specified cron interval if
-- you previously selected this option. If this option wasn\'t selected,
-- State Manager immediately runs the association.
--
-- You can reset this option. To do so, specify the
-- @no-apply-only-at-cron-interval@ parameter when you update the
-- association from the command line. This parameter forces the association
-- to run immediately after updating it and according to the interval
-- specified.
--
-- 'associationName', 'updateAssociation_associationName' - The name of the association that you want to update.
--
-- 'associationVersion', 'updateAssociation_associationVersion' - This parameter is provided for concurrency control purposes. You must
-- specify the latest association version in the service. If you want to
-- ensure that this request succeeds, either specify @$LATEST@, or omit
-- this parameter.
--
-- 'automationTargetParameterName', 'updateAssociation_automationTargetParameterName' - Choose the parameter that will define how your automation will branch
-- out. This target is required for associations that use an Automation
-- runbook and target resources by using rate controls. Automation is a
-- capability of Amazon Web Services Systems Manager.
--
-- 'calendarNames', 'updateAssociation_calendarNames' - The names or Amazon Resource Names (ARNs) of the Change Calendar type
-- documents you want to gate your associations under. The associations
-- only run when that change calendar is open. For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar Amazon Web Services Systems Manager Change Calendar>.
--
-- 'complianceSeverity', 'updateAssociation_complianceSeverity' - The severity level to assign to the association.
--
-- 'documentVersion', 'updateAssociation_documentVersion' - The document version you want update for the association.
--
-- State Manager doesn\'t support running associations that use a new
-- version of a document if that document is shared from another account.
-- State Manager always runs the @default@ version of a document if shared
-- from another account, even though the Systems Manager console shows that
-- a new version was processed. If you want to run an association using a
-- new version of a document shared form another account, you must set the
-- document version to @default@.
--
-- 'maxConcurrency', 'updateAssociation_maxConcurrency' - The maximum number of targets allowed to run the association at the same
-- time. You can specify a number, for example 10, or a percentage of the
-- target set, for example 10%. The default value is 100%, which means all
-- targets run the association at the same time.
--
-- If a new managed node starts and attempts to run an association while
-- Systems Manager is running @MaxConcurrency@ associations, the
-- association is allowed to run. During the next association interval, the
-- new managed node will process its association within the limit specified
-- for @MaxConcurrency@.
--
-- 'maxErrors', 'updateAssociation_maxErrors' - The number of errors that are allowed before the system stops sending
-- requests to run the association on additional targets. You can specify
-- either an absolute number of errors, for example 10, or a percentage of
-- the target set, for example 10%. If you specify 3, for example, the
-- system stops sending requests when the fourth error is received. If you
-- specify 0, then the system stops sending requests after the first error
-- is returned. If you run an association on 50 managed nodes and set
-- @MaxError@ to 10%, then the system stops sending the request when the
-- sixth error is received.
--
-- Executions that are already running an association when @MaxErrors@ is
-- reached are allowed to complete, but some of these executions may fail
-- as well. If you need to ensure that there won\'t be more than max-errors
-- failed executions, set @MaxConcurrency@ to 1 so that executions proceed
-- one at a time.
--
-- 'name', 'updateAssociation_name' - The name of the SSM Command document or Automation runbook that contains
-- the configuration information for the managed node.
--
-- You can specify Amazon Web Services-predefined documents, documents you
-- created, or a document that is shared with you from another account.
--
-- For Systems Manager document (SSM document) that are shared with you
-- from other Amazon Web Services accounts, you must specify the complete
-- SSM document ARN, in the following format:
--
-- @arn:aws:ssm:@/@region@/@:@/@account-id@/@:document\/@/@document-name@/@ @
--
-- For example:
--
-- @arn:aws:ssm:us-east-2:12345678912:document\/My-Shared-Document@
--
-- For Amazon Web Services-predefined documents and SSM documents you
-- created in your account, you only need to specify the document name. For
-- example, @AWS-ApplyPatchBaseline@ or @My-Document@.
--
-- 'outputLocation', 'updateAssociation_outputLocation' - An S3 bucket where you want to store the results of this request.
--
-- 'parameters', 'updateAssociation_parameters' - The parameters you want to update for the association. If you create a
-- parameter using Parameter Store, a capability of Amazon Web Services
-- Systems Manager, you can reference the parameter using
-- @{{ssm:parameter-name}}@.
--
-- 'scheduleExpression', 'updateAssociation_scheduleExpression' - The cron expression used to schedule the association that you want to
-- update.
--
-- 'scheduleOffset', 'updateAssociation_scheduleOffset' - Number of days to wait after the scheduled day to run an association.
-- For example, if you specified a cron schedule of
-- @cron(0 0 ? * THU#2 *)@, you could specify an offset of 3 to run the
-- association each Sunday after the second Thursday of the month. For more
-- information about cron schedules for associations, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html Reference: Cron and rate expressions for Systems Manager>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- To use offsets, you must specify the @ApplyOnlyAtCronInterval@
-- parameter. This option tells the system not to run an association
-- immediately after you create it.
--
-- 'syncCompliance', 'updateAssociation_syncCompliance' - The mode for generating association compliance. You can specify @AUTO@
-- or @MANUAL@. In @AUTO@ mode, the system uses the status of the
-- association execution to determine the compliance status. If the
-- association execution runs successfully, then the association is
-- @COMPLIANT@. If the association execution doesn\'t run successfully, the
-- association is @NON-COMPLIANT@.
--
-- In @MANUAL@ mode, you must specify the @AssociationId@ as a parameter
-- for the PutComplianceItems API operation. In this case, compliance data
-- isn\'t managed by State Manager, a capability of Amazon Web Services
-- Systems Manager. It is managed by your direct call to the
-- PutComplianceItems API operation.
--
-- By default, all associations use @AUTO@ mode.
--
-- 'targetLocations', 'updateAssociation_targetLocations' - A location is a combination of Amazon Web Services Regions and Amazon
-- Web Services accounts where you want to run the association. Use this
-- action to update an association in multiple Regions and multiple
-- accounts.
--
-- 'targetMaps', 'updateAssociation_targetMaps' - A key-value mapping of document parameters to target resources. Both
-- Targets and TargetMaps can\'t be specified together.
--
-- 'targets', 'updateAssociation_targets' - The targets of the association.
--
-- 'associationId', 'updateAssociation_associationId' - The ID of the association you want to update.
newUpdateAssociation ::
  -- | 'associationId'
  Prelude.Text ->
  UpdateAssociation
newUpdateAssociation :: Text -> UpdateAssociation
newUpdateAssociation Text
pAssociationId_ =
  UpdateAssociation'
    { $sel:alarmConfiguration:UpdateAssociation' :: Maybe AlarmConfiguration
alarmConfiguration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:applyOnlyAtCronInterval:UpdateAssociation' :: Maybe Bool
applyOnlyAtCronInterval = forall a. Maybe a
Prelude.Nothing,
      $sel:associationName:UpdateAssociation' :: Maybe Text
associationName = forall a. Maybe a
Prelude.Nothing,
      $sel:associationVersion:UpdateAssociation' :: Maybe Text
associationVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:automationTargetParameterName:UpdateAssociation' :: Maybe Text
automationTargetParameterName = forall a. Maybe a
Prelude.Nothing,
      $sel:calendarNames:UpdateAssociation' :: Maybe [Text]
calendarNames = forall a. Maybe a
Prelude.Nothing,
      $sel:complianceSeverity:UpdateAssociation' :: Maybe AssociationComplianceSeverity
complianceSeverity = forall a. Maybe a
Prelude.Nothing,
      $sel:documentVersion:UpdateAssociation' :: Maybe Text
documentVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:maxConcurrency:UpdateAssociation' :: Maybe Text
maxConcurrency = forall a. Maybe a
Prelude.Nothing,
      $sel:maxErrors:UpdateAssociation' :: Maybe Text
maxErrors = forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateAssociation' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:outputLocation:UpdateAssociation' :: Maybe InstanceAssociationOutputLocation
outputLocation = forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:UpdateAssociation' :: Maybe (Sensitive (HashMap Text [Text]))
parameters = forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleExpression:UpdateAssociation' :: Maybe Text
scheduleExpression = forall a. Maybe a
Prelude.Nothing,
      $sel:scheduleOffset:UpdateAssociation' :: Maybe Natural
scheduleOffset = forall a. Maybe a
Prelude.Nothing,
      $sel:syncCompliance:UpdateAssociation' :: Maybe AssociationSyncCompliance
syncCompliance = forall a. Maybe a
Prelude.Nothing,
      $sel:targetLocations:UpdateAssociation' :: Maybe (NonEmpty TargetLocation)
targetLocations = forall a. Maybe a
Prelude.Nothing,
      $sel:targetMaps:UpdateAssociation' :: Maybe [HashMap Text [Text]]
targetMaps = forall a. Maybe a
Prelude.Nothing,
      $sel:targets:UpdateAssociation' :: Maybe [Target]
targets = forall a. Maybe a
Prelude.Nothing,
      $sel:associationId:UpdateAssociation' :: Text
associationId = Text
pAssociationId_
    }

-- | Undocumented member.
updateAssociation_alarmConfiguration :: Lens.Lens' UpdateAssociation (Prelude.Maybe AlarmConfiguration)
updateAssociation_alarmConfiguration :: Lens' UpdateAssociation (Maybe AlarmConfiguration)
updateAssociation_alarmConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe AlarmConfiguration
alarmConfiguration :: Maybe AlarmConfiguration
$sel:alarmConfiguration:UpdateAssociation' :: UpdateAssociation -> Maybe AlarmConfiguration
alarmConfiguration} -> Maybe AlarmConfiguration
alarmConfiguration) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe AlarmConfiguration
a -> UpdateAssociation
s {$sel:alarmConfiguration:UpdateAssociation' :: Maybe AlarmConfiguration
alarmConfiguration = Maybe AlarmConfiguration
a} :: UpdateAssociation)

-- | By default, when you update an association, the system runs it
-- immediately after it is updated and then according to the schedule you
-- specified. Specify this option if you don\'t want an association to run
-- immediately after you update it. This parameter isn\'t supported for
-- rate expressions.
--
-- If you chose this option when you created an association and later you
-- edit that association or you make changes to the SSM document on which
-- that association is based (by using the Documents page in the console),
-- State Manager applies the association at the next specified cron
-- interval. For example, if you chose the @Latest@ version of an SSM
-- document when you created an association and you edit the association by
-- choosing a different document version on the Documents page, State
-- Manager applies the association at the next specified cron interval if
-- you previously selected this option. If this option wasn\'t selected,
-- State Manager immediately runs the association.
--
-- You can reset this option. To do so, specify the
-- @no-apply-only-at-cron-interval@ parameter when you update the
-- association from the command line. This parameter forces the association
-- to run immediately after updating it and according to the interval
-- specified.
updateAssociation_applyOnlyAtCronInterval :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Bool)
updateAssociation_applyOnlyAtCronInterval :: Lens' UpdateAssociation (Maybe Bool)
updateAssociation_applyOnlyAtCronInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Bool
applyOnlyAtCronInterval :: Maybe Bool
$sel:applyOnlyAtCronInterval:UpdateAssociation' :: UpdateAssociation -> Maybe Bool
applyOnlyAtCronInterval} -> Maybe Bool
applyOnlyAtCronInterval) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Bool
a -> UpdateAssociation
s {$sel:applyOnlyAtCronInterval:UpdateAssociation' :: Maybe Bool
applyOnlyAtCronInterval = Maybe Bool
a} :: UpdateAssociation)

-- | The name of the association that you want to update.
updateAssociation_associationName :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_associationName :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_associationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
associationName :: Maybe Text
$sel:associationName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
associationName} -> Maybe Text
associationName) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:associationName:UpdateAssociation' :: Maybe Text
associationName = Maybe Text
a} :: UpdateAssociation)

-- | This parameter is provided for concurrency control purposes. You must
-- specify the latest association version in the service. If you want to
-- ensure that this request succeeds, either specify @$LATEST@, or omit
-- this parameter.
updateAssociation_associationVersion :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_associationVersion :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_associationVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
associationVersion :: Maybe Text
$sel:associationVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
associationVersion} -> Maybe Text
associationVersion) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:associationVersion:UpdateAssociation' :: Maybe Text
associationVersion = Maybe Text
a} :: UpdateAssociation)

-- | Choose the parameter that will define how your automation will branch
-- out. This target is required for associations that use an Automation
-- runbook and target resources by using rate controls. Automation is a
-- capability of Amazon Web Services Systems Manager.
updateAssociation_automationTargetParameterName :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_automationTargetParameterName :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_automationTargetParameterName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
automationTargetParameterName :: Maybe Text
$sel:automationTargetParameterName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
automationTargetParameterName} -> Maybe Text
automationTargetParameterName) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:automationTargetParameterName:UpdateAssociation' :: Maybe Text
automationTargetParameterName = Maybe Text
a} :: UpdateAssociation)

-- | The names or Amazon Resource Names (ARNs) of the Change Calendar type
-- documents you want to gate your associations under. The associations
-- only run when that change calendar is open. For more information, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar Amazon Web Services Systems Manager Change Calendar>.
updateAssociation_calendarNames :: Lens.Lens' UpdateAssociation (Prelude.Maybe [Prelude.Text])
updateAssociation_calendarNames :: Lens' UpdateAssociation (Maybe [Text])
updateAssociation_calendarNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe [Text]
calendarNames :: Maybe [Text]
$sel:calendarNames:UpdateAssociation' :: UpdateAssociation -> Maybe [Text]
calendarNames} -> Maybe [Text]
calendarNames) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe [Text]
a -> UpdateAssociation
s {$sel:calendarNames:UpdateAssociation' :: Maybe [Text]
calendarNames = Maybe [Text]
a} :: UpdateAssociation) 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 severity level to assign to the association.
updateAssociation_complianceSeverity :: Lens.Lens' UpdateAssociation (Prelude.Maybe AssociationComplianceSeverity)
updateAssociation_complianceSeverity :: Lens' UpdateAssociation (Maybe AssociationComplianceSeverity)
updateAssociation_complianceSeverity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe AssociationComplianceSeverity
complianceSeverity :: Maybe AssociationComplianceSeverity
$sel:complianceSeverity:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationComplianceSeverity
complianceSeverity} -> Maybe AssociationComplianceSeverity
complianceSeverity) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe AssociationComplianceSeverity
a -> UpdateAssociation
s {$sel:complianceSeverity:UpdateAssociation' :: Maybe AssociationComplianceSeverity
complianceSeverity = Maybe AssociationComplianceSeverity
a} :: UpdateAssociation)

-- | The document version you want update for the association.
--
-- State Manager doesn\'t support running associations that use a new
-- version of a document if that document is shared from another account.
-- State Manager always runs the @default@ version of a document if shared
-- from another account, even though the Systems Manager console shows that
-- a new version was processed. If you want to run an association using a
-- new version of a document shared form another account, you must set the
-- document version to @default@.
updateAssociation_documentVersion :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_documentVersion :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_documentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
documentVersion :: Maybe Text
$sel:documentVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
documentVersion} -> Maybe Text
documentVersion) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:documentVersion:UpdateAssociation' :: Maybe Text
documentVersion = Maybe Text
a} :: UpdateAssociation)

-- | The maximum number of targets allowed to run the association at the same
-- time. You can specify a number, for example 10, or a percentage of the
-- target set, for example 10%. The default value is 100%, which means all
-- targets run the association at the same time.
--
-- If a new managed node starts and attempts to run an association while
-- Systems Manager is running @MaxConcurrency@ associations, the
-- association is allowed to run. During the next association interval, the
-- new managed node will process its association within the limit specified
-- for @MaxConcurrency@.
updateAssociation_maxConcurrency :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_maxConcurrency :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_maxConcurrency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
maxConcurrency :: Maybe Text
$sel:maxConcurrency:UpdateAssociation' :: UpdateAssociation -> Maybe Text
maxConcurrency} -> Maybe Text
maxConcurrency) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:maxConcurrency:UpdateAssociation' :: Maybe Text
maxConcurrency = Maybe Text
a} :: UpdateAssociation)

-- | The number of errors that are allowed before the system stops sending
-- requests to run the association on additional targets. You can specify
-- either an absolute number of errors, for example 10, or a percentage of
-- the target set, for example 10%. If you specify 3, for example, the
-- system stops sending requests when the fourth error is received. If you
-- specify 0, then the system stops sending requests after the first error
-- is returned. If you run an association on 50 managed nodes and set
-- @MaxError@ to 10%, then the system stops sending the request when the
-- sixth error is received.
--
-- Executions that are already running an association when @MaxErrors@ is
-- reached are allowed to complete, but some of these executions may fail
-- as well. If you need to ensure that there won\'t be more than max-errors
-- failed executions, set @MaxConcurrency@ to 1 so that executions proceed
-- one at a time.
updateAssociation_maxErrors :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_maxErrors :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_maxErrors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
maxErrors :: Maybe Text
$sel:maxErrors:UpdateAssociation' :: UpdateAssociation -> Maybe Text
maxErrors} -> Maybe Text
maxErrors) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:maxErrors:UpdateAssociation' :: Maybe Text
maxErrors = Maybe Text
a} :: UpdateAssociation)

-- | The name of the SSM Command document or Automation runbook that contains
-- the configuration information for the managed node.
--
-- You can specify Amazon Web Services-predefined documents, documents you
-- created, or a document that is shared with you from another account.
--
-- For Systems Manager document (SSM document) that are shared with you
-- from other Amazon Web Services accounts, you must specify the complete
-- SSM document ARN, in the following format:
--
-- @arn:aws:ssm:@/@region@/@:@/@account-id@/@:document\/@/@document-name@/@ @
--
-- For example:
--
-- @arn:aws:ssm:us-east-2:12345678912:document\/My-Shared-Document@
--
-- For Amazon Web Services-predefined documents and SSM documents you
-- created in your account, you only need to specify the document name. For
-- example, @AWS-ApplyPatchBaseline@ or @My-Document@.
updateAssociation_name :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_name :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
name :: Maybe Text
$sel:name:UpdateAssociation' :: UpdateAssociation -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:name:UpdateAssociation' :: Maybe Text
name = Maybe Text
a} :: UpdateAssociation)

-- | An S3 bucket where you want to store the results of this request.
updateAssociation_outputLocation :: Lens.Lens' UpdateAssociation (Prelude.Maybe InstanceAssociationOutputLocation)
updateAssociation_outputLocation :: Lens' UpdateAssociation (Maybe InstanceAssociationOutputLocation)
updateAssociation_outputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe InstanceAssociationOutputLocation
outputLocation :: Maybe InstanceAssociationOutputLocation
$sel:outputLocation:UpdateAssociation' :: UpdateAssociation -> Maybe InstanceAssociationOutputLocation
outputLocation} -> Maybe InstanceAssociationOutputLocation
outputLocation) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe InstanceAssociationOutputLocation
a -> UpdateAssociation
s {$sel:outputLocation:UpdateAssociation' :: Maybe InstanceAssociationOutputLocation
outputLocation = Maybe InstanceAssociationOutputLocation
a} :: UpdateAssociation)

-- | The parameters you want to update for the association. If you create a
-- parameter using Parameter Store, a capability of Amazon Web Services
-- Systems Manager, you can reference the parameter using
-- @{{ssm:parameter-name}}@.
updateAssociation_parameters :: Lens.Lens' UpdateAssociation (Prelude.Maybe (Prelude.HashMap Prelude.Text [Prelude.Text]))
updateAssociation_parameters :: Lens' UpdateAssociation (Maybe (HashMap Text [Text]))
updateAssociation_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe (Sensitive (HashMap Text [Text]))
parameters :: Maybe (Sensitive (HashMap Text [Text]))
$sel:parameters:UpdateAssociation' :: UpdateAssociation -> Maybe (Sensitive (HashMap Text [Text]))
parameters} -> Maybe (Sensitive (HashMap Text [Text]))
parameters) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe (Sensitive (HashMap Text [Text]))
a -> UpdateAssociation
s {$sel:parameters:UpdateAssociation' :: Maybe (Sensitive (HashMap Text [Text]))
parameters = Maybe (Sensitive (HashMap Text [Text]))
a} :: UpdateAssociation) 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 a. Iso' (Sensitive a) a
Data._Sensitive forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced)

-- | The cron expression used to schedule the association that you want to
-- update.
updateAssociation_scheduleExpression :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Text)
updateAssociation_scheduleExpression :: Lens' UpdateAssociation (Maybe Text)
updateAssociation_scheduleExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Text
scheduleExpression :: Maybe Text
$sel:scheduleExpression:UpdateAssociation' :: UpdateAssociation -> Maybe Text
scheduleExpression} -> Maybe Text
scheduleExpression) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Text
a -> UpdateAssociation
s {$sel:scheduleExpression:UpdateAssociation' :: Maybe Text
scheduleExpression = Maybe Text
a} :: UpdateAssociation)

-- | Number of days to wait after the scheduled day to run an association.
-- For example, if you specified a cron schedule of
-- @cron(0 0 ? * THU#2 *)@, you could specify an offset of 3 to run the
-- association each Sunday after the second Thursday of the month. For more
-- information about cron schedules for associations, see
-- <https://docs.aws.amazon.com/systems-manager/latest/userguide/reference-cron-and-rate-expressions.html Reference: Cron and rate expressions for Systems Manager>
-- in the /Amazon Web Services Systems Manager User Guide/.
--
-- To use offsets, you must specify the @ApplyOnlyAtCronInterval@
-- parameter. This option tells the system not to run an association
-- immediately after you create it.
updateAssociation_scheduleOffset :: Lens.Lens' UpdateAssociation (Prelude.Maybe Prelude.Natural)
updateAssociation_scheduleOffset :: Lens' UpdateAssociation (Maybe Natural)
updateAssociation_scheduleOffset = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe Natural
scheduleOffset :: Maybe Natural
$sel:scheduleOffset:UpdateAssociation' :: UpdateAssociation -> Maybe Natural
scheduleOffset} -> Maybe Natural
scheduleOffset) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe Natural
a -> UpdateAssociation
s {$sel:scheduleOffset:UpdateAssociation' :: Maybe Natural
scheduleOffset = Maybe Natural
a} :: UpdateAssociation)

-- | The mode for generating association compliance. You can specify @AUTO@
-- or @MANUAL@. In @AUTO@ mode, the system uses the status of the
-- association execution to determine the compliance status. If the
-- association execution runs successfully, then the association is
-- @COMPLIANT@. If the association execution doesn\'t run successfully, the
-- association is @NON-COMPLIANT@.
--
-- In @MANUAL@ mode, you must specify the @AssociationId@ as a parameter
-- for the PutComplianceItems API operation. In this case, compliance data
-- isn\'t managed by State Manager, a capability of Amazon Web Services
-- Systems Manager. It is managed by your direct call to the
-- PutComplianceItems API operation.
--
-- By default, all associations use @AUTO@ mode.
updateAssociation_syncCompliance :: Lens.Lens' UpdateAssociation (Prelude.Maybe AssociationSyncCompliance)
updateAssociation_syncCompliance :: Lens' UpdateAssociation (Maybe AssociationSyncCompliance)
updateAssociation_syncCompliance = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe AssociationSyncCompliance
syncCompliance :: Maybe AssociationSyncCompliance
$sel:syncCompliance:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationSyncCompliance
syncCompliance} -> Maybe AssociationSyncCompliance
syncCompliance) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe AssociationSyncCompliance
a -> UpdateAssociation
s {$sel:syncCompliance:UpdateAssociation' :: Maybe AssociationSyncCompliance
syncCompliance = Maybe AssociationSyncCompliance
a} :: UpdateAssociation)

-- | A location is a combination of Amazon Web Services Regions and Amazon
-- Web Services accounts where you want to run the association. Use this
-- action to update an association in multiple Regions and multiple
-- accounts.
updateAssociation_targetLocations :: Lens.Lens' UpdateAssociation (Prelude.Maybe (Prelude.NonEmpty TargetLocation))
updateAssociation_targetLocations :: Lens' UpdateAssociation (Maybe (NonEmpty TargetLocation))
updateAssociation_targetLocations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe (NonEmpty TargetLocation)
targetLocations :: Maybe (NonEmpty TargetLocation)
$sel:targetLocations:UpdateAssociation' :: UpdateAssociation -> Maybe (NonEmpty TargetLocation)
targetLocations} -> Maybe (NonEmpty TargetLocation)
targetLocations) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe (NonEmpty TargetLocation)
a -> UpdateAssociation
s {$sel:targetLocations:UpdateAssociation' :: Maybe (NonEmpty TargetLocation)
targetLocations = Maybe (NonEmpty TargetLocation)
a} :: UpdateAssociation) 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

-- | A key-value mapping of document parameters to target resources. Both
-- Targets and TargetMaps can\'t be specified together.
updateAssociation_targetMaps :: Lens.Lens' UpdateAssociation (Prelude.Maybe [Prelude.HashMap Prelude.Text [Prelude.Text]])
updateAssociation_targetMaps :: Lens' UpdateAssociation (Maybe [HashMap Text [Text]])
updateAssociation_targetMaps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe [HashMap Text [Text]]
targetMaps :: Maybe [HashMap Text [Text]]
$sel:targetMaps:UpdateAssociation' :: UpdateAssociation -> Maybe [HashMap Text [Text]]
targetMaps} -> Maybe [HashMap Text [Text]]
targetMaps) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe [HashMap Text [Text]]
a -> UpdateAssociation
s {$sel:targetMaps:UpdateAssociation' :: Maybe [HashMap Text [Text]]
targetMaps = Maybe [HashMap Text [Text]]
a} :: UpdateAssociation) 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 targets of the association.
updateAssociation_targets :: Lens.Lens' UpdateAssociation (Prelude.Maybe [Target])
updateAssociation_targets :: Lens' UpdateAssociation (Maybe [Target])
updateAssociation_targets = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Maybe [Target]
targets :: Maybe [Target]
$sel:targets:UpdateAssociation' :: UpdateAssociation -> Maybe [Target]
targets} -> Maybe [Target]
targets) (\s :: UpdateAssociation
s@UpdateAssociation' {} Maybe [Target]
a -> UpdateAssociation
s {$sel:targets:UpdateAssociation' :: Maybe [Target]
targets = Maybe [Target]
a} :: UpdateAssociation) 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 ID of the association you want to update.
updateAssociation_associationId :: Lens.Lens' UpdateAssociation Prelude.Text
updateAssociation_associationId :: Lens' UpdateAssociation Text
updateAssociation_associationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociation' {Text
associationId :: Text
$sel:associationId:UpdateAssociation' :: UpdateAssociation -> Text
associationId} -> Text
associationId) (\s :: UpdateAssociation
s@UpdateAssociation' {} Text
a -> UpdateAssociation
s {$sel:associationId:UpdateAssociation' :: Text
associationId = Text
a} :: UpdateAssociation)

instance Core.AWSRequest UpdateAssociation where
  type
    AWSResponse UpdateAssociation =
      UpdateAssociationResponse
  request :: (Service -> Service)
-> UpdateAssociation -> Request UpdateAssociation
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAssociation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateAssociation)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe AssociationDescription -> Int -> UpdateAssociationResponse
UpdateAssociationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"AssociationDescription")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable UpdateAssociation where
  hashWithSalt :: Int -> UpdateAssociation -> Int
hashWithSalt Int
_salt UpdateAssociation' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [HashMap Text [Text]]
Maybe [Target]
Maybe (NonEmpty TargetLocation)
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe AlarmConfiguration
Maybe AssociationComplianceSeverity
Maybe AssociationSyncCompliance
Maybe InstanceAssociationOutputLocation
Text
associationId :: Text
targets :: Maybe [Target]
targetMaps :: Maybe [HashMap Text [Text]]
targetLocations :: Maybe (NonEmpty TargetLocation)
syncCompliance :: Maybe AssociationSyncCompliance
scheduleOffset :: Maybe Natural
scheduleExpression :: Maybe Text
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputLocation :: Maybe InstanceAssociationOutputLocation
name :: Maybe Text
maxErrors :: Maybe Text
maxConcurrency :: Maybe Text
documentVersion :: Maybe Text
complianceSeverity :: Maybe AssociationComplianceSeverity
calendarNames :: Maybe [Text]
automationTargetParameterName :: Maybe Text
associationVersion :: Maybe Text
associationName :: Maybe Text
applyOnlyAtCronInterval :: Maybe Bool
alarmConfiguration :: Maybe AlarmConfiguration
$sel:associationId:UpdateAssociation' :: UpdateAssociation -> Text
$sel:targets:UpdateAssociation' :: UpdateAssociation -> Maybe [Target]
$sel:targetMaps:UpdateAssociation' :: UpdateAssociation -> Maybe [HashMap Text [Text]]
$sel:targetLocations:UpdateAssociation' :: UpdateAssociation -> Maybe (NonEmpty TargetLocation)
$sel:syncCompliance:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationSyncCompliance
$sel:scheduleOffset:UpdateAssociation' :: UpdateAssociation -> Maybe Natural
$sel:scheduleExpression:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:parameters:UpdateAssociation' :: UpdateAssociation -> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputLocation:UpdateAssociation' :: UpdateAssociation -> Maybe InstanceAssociationOutputLocation
$sel:name:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:maxErrors:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:maxConcurrency:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:documentVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:complianceSeverity:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationComplianceSeverity
$sel:calendarNames:UpdateAssociation' :: UpdateAssociation -> Maybe [Text]
$sel:automationTargetParameterName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:associationVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:associationName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:applyOnlyAtCronInterval:UpdateAssociation' :: UpdateAssociation -> Maybe Bool
$sel:alarmConfiguration:UpdateAssociation' :: UpdateAssociation -> Maybe AlarmConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlarmConfiguration
alarmConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
applyOnlyAtCronInterval
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
associationVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
automationTargetParameterName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
calendarNames
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssociationComplianceSeverity
complianceSeverity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
documentVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxConcurrency
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxErrors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceAssociationOutputLocation
outputLocation
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive (HashMap Text [Text]))
parameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
scheduleExpression
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
scheduleOffset
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AssociationSyncCompliance
syncCompliance
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty TargetLocation)
targetLocations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [HashMap Text [Text]]
targetMaps
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Target]
targets
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
associationId

instance Prelude.NFData UpdateAssociation where
  rnf :: UpdateAssociation -> ()
rnf UpdateAssociation' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [HashMap Text [Text]]
Maybe [Target]
Maybe (NonEmpty TargetLocation)
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe AlarmConfiguration
Maybe AssociationComplianceSeverity
Maybe AssociationSyncCompliance
Maybe InstanceAssociationOutputLocation
Text
associationId :: Text
targets :: Maybe [Target]
targetMaps :: Maybe [HashMap Text [Text]]
targetLocations :: Maybe (NonEmpty TargetLocation)
syncCompliance :: Maybe AssociationSyncCompliance
scheduleOffset :: Maybe Natural
scheduleExpression :: Maybe Text
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputLocation :: Maybe InstanceAssociationOutputLocation
name :: Maybe Text
maxErrors :: Maybe Text
maxConcurrency :: Maybe Text
documentVersion :: Maybe Text
complianceSeverity :: Maybe AssociationComplianceSeverity
calendarNames :: Maybe [Text]
automationTargetParameterName :: Maybe Text
associationVersion :: Maybe Text
associationName :: Maybe Text
applyOnlyAtCronInterval :: Maybe Bool
alarmConfiguration :: Maybe AlarmConfiguration
$sel:associationId:UpdateAssociation' :: UpdateAssociation -> Text
$sel:targets:UpdateAssociation' :: UpdateAssociation -> Maybe [Target]
$sel:targetMaps:UpdateAssociation' :: UpdateAssociation -> Maybe [HashMap Text [Text]]
$sel:targetLocations:UpdateAssociation' :: UpdateAssociation -> Maybe (NonEmpty TargetLocation)
$sel:syncCompliance:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationSyncCompliance
$sel:scheduleOffset:UpdateAssociation' :: UpdateAssociation -> Maybe Natural
$sel:scheduleExpression:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:parameters:UpdateAssociation' :: UpdateAssociation -> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputLocation:UpdateAssociation' :: UpdateAssociation -> Maybe InstanceAssociationOutputLocation
$sel:name:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:maxErrors:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:maxConcurrency:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:documentVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:complianceSeverity:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationComplianceSeverity
$sel:calendarNames:UpdateAssociation' :: UpdateAssociation -> Maybe [Text]
$sel:automationTargetParameterName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:associationVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:associationName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:applyOnlyAtCronInterval:UpdateAssociation' :: UpdateAssociation -> Maybe Bool
$sel:alarmConfiguration:UpdateAssociation' :: UpdateAssociation -> Maybe AlarmConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AlarmConfiguration
alarmConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
applyOnlyAtCronInterval
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associationVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
automationTargetParameterName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
calendarNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AssociationComplianceSeverity
complianceSeverity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
documentVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxConcurrency
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxErrors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceAssociationOutputLocation
outputLocation
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive (HashMap Text [Text]))
parameters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
scheduleExpression
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
scheduleOffset
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AssociationSyncCompliance
syncCompliance
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty TargetLocation)
targetLocations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [HashMap Text [Text]]
targetMaps
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Target]
targets
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
associationId

instance Data.ToHeaders UpdateAssociation where
  toHeaders :: UpdateAssociation -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonSSM.UpdateAssociation" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateAssociation where
  toJSON :: UpdateAssociation -> Value
toJSON UpdateAssociation' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe [HashMap Text [Text]]
Maybe [Target]
Maybe (NonEmpty TargetLocation)
Maybe Text
Maybe (Sensitive (HashMap Text [Text]))
Maybe AlarmConfiguration
Maybe AssociationComplianceSeverity
Maybe AssociationSyncCompliance
Maybe InstanceAssociationOutputLocation
Text
associationId :: Text
targets :: Maybe [Target]
targetMaps :: Maybe [HashMap Text [Text]]
targetLocations :: Maybe (NonEmpty TargetLocation)
syncCompliance :: Maybe AssociationSyncCompliance
scheduleOffset :: Maybe Natural
scheduleExpression :: Maybe Text
parameters :: Maybe (Sensitive (HashMap Text [Text]))
outputLocation :: Maybe InstanceAssociationOutputLocation
name :: Maybe Text
maxErrors :: Maybe Text
maxConcurrency :: Maybe Text
documentVersion :: Maybe Text
complianceSeverity :: Maybe AssociationComplianceSeverity
calendarNames :: Maybe [Text]
automationTargetParameterName :: Maybe Text
associationVersion :: Maybe Text
associationName :: Maybe Text
applyOnlyAtCronInterval :: Maybe Bool
alarmConfiguration :: Maybe AlarmConfiguration
$sel:associationId:UpdateAssociation' :: UpdateAssociation -> Text
$sel:targets:UpdateAssociation' :: UpdateAssociation -> Maybe [Target]
$sel:targetMaps:UpdateAssociation' :: UpdateAssociation -> Maybe [HashMap Text [Text]]
$sel:targetLocations:UpdateAssociation' :: UpdateAssociation -> Maybe (NonEmpty TargetLocation)
$sel:syncCompliance:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationSyncCompliance
$sel:scheduleOffset:UpdateAssociation' :: UpdateAssociation -> Maybe Natural
$sel:scheduleExpression:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:parameters:UpdateAssociation' :: UpdateAssociation -> Maybe (Sensitive (HashMap Text [Text]))
$sel:outputLocation:UpdateAssociation' :: UpdateAssociation -> Maybe InstanceAssociationOutputLocation
$sel:name:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:maxErrors:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:maxConcurrency:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:documentVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:complianceSeverity:UpdateAssociation' :: UpdateAssociation -> Maybe AssociationComplianceSeverity
$sel:calendarNames:UpdateAssociation' :: UpdateAssociation -> Maybe [Text]
$sel:automationTargetParameterName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:associationVersion:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:associationName:UpdateAssociation' :: UpdateAssociation -> Maybe Text
$sel:applyOnlyAtCronInterval:UpdateAssociation' :: UpdateAssociation -> Maybe Bool
$sel:alarmConfiguration:UpdateAssociation' :: UpdateAssociation -> Maybe AlarmConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AlarmConfiguration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AlarmConfiguration
alarmConfiguration,
            (Key
"ApplyOnlyAtCronInterval" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
applyOnlyAtCronInterval,
            (Key
"AssociationName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
associationName,
            (Key
"AssociationVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
associationVersion,
            (Key
"AutomationTargetParameterName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
automationTargetParameterName,
            (Key
"CalendarNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
calendarNames,
            (Key
"ComplianceSeverity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssociationComplianceSeverity
complianceSeverity,
            (Key
"DocumentVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
documentVersion,
            (Key
"MaxConcurrency" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maxConcurrency,
            (Key
"MaxErrors" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
maxErrors,
            (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Key
"OutputLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstanceAssociationOutputLocation
outputLocation,
            (Key
"Parameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive (HashMap Text [Text]))
parameters,
            (Key
"ScheduleExpression" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
scheduleExpression,
            (Key
"ScheduleOffset" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
scheduleOffset,
            (Key
"SyncCompliance" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssociationSyncCompliance
syncCompliance,
            (Key
"TargetLocations" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty TargetLocation)
targetLocations,
            (Key
"TargetMaps" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [HashMap Text [Text]]
targetMaps,
            (Key
"Targets" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Target]
targets,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"AssociationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
associationId)
          ]
      )

instance Data.ToPath UpdateAssociation where
  toPath :: UpdateAssociation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery UpdateAssociation where
  toQuery :: UpdateAssociation -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateAssociationResponse' smart constructor.
data UpdateAssociationResponse = UpdateAssociationResponse'
  { -- | The description of the association that was updated.
    UpdateAssociationResponse -> Maybe AssociationDescription
associationDescription :: Prelude.Maybe AssociationDescription,
    -- | The response's http status code.
    UpdateAssociationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateAssociationResponse -> UpdateAssociationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssociationResponse -> UpdateAssociationResponse -> Bool
$c/= :: UpdateAssociationResponse -> UpdateAssociationResponse -> Bool
== :: UpdateAssociationResponse -> UpdateAssociationResponse -> Bool
$c== :: UpdateAssociationResponse -> UpdateAssociationResponse -> Bool
Prelude.Eq, Int -> UpdateAssociationResponse -> ShowS
[UpdateAssociationResponse] -> ShowS
UpdateAssociationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssociationResponse] -> ShowS
$cshowList :: [UpdateAssociationResponse] -> ShowS
show :: UpdateAssociationResponse -> String
$cshow :: UpdateAssociationResponse -> String
showsPrec :: Int -> UpdateAssociationResponse -> ShowS
$cshowsPrec :: Int -> UpdateAssociationResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateAssociationResponse x -> UpdateAssociationResponse
forall x.
UpdateAssociationResponse -> Rep UpdateAssociationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAssociationResponse x -> UpdateAssociationResponse
$cfrom :: forall x.
UpdateAssociationResponse -> Rep UpdateAssociationResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateAssociationResponse' 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:
--
-- 'associationDescription', 'updateAssociationResponse_associationDescription' - The description of the association that was updated.
--
-- 'httpStatus', 'updateAssociationResponse_httpStatus' - The response's http status code.
newUpdateAssociationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateAssociationResponse
newUpdateAssociationResponse :: Int -> UpdateAssociationResponse
newUpdateAssociationResponse Int
pHttpStatus_ =
  UpdateAssociationResponse'
    { $sel:associationDescription:UpdateAssociationResponse' :: Maybe AssociationDescription
associationDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateAssociationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The description of the association that was updated.
updateAssociationResponse_associationDescription :: Lens.Lens' UpdateAssociationResponse (Prelude.Maybe AssociationDescription)
updateAssociationResponse_associationDescription :: Lens' UpdateAssociationResponse (Maybe AssociationDescription)
updateAssociationResponse_associationDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociationResponse' {Maybe AssociationDescription
associationDescription :: Maybe AssociationDescription
$sel:associationDescription:UpdateAssociationResponse' :: UpdateAssociationResponse -> Maybe AssociationDescription
associationDescription} -> Maybe AssociationDescription
associationDescription) (\s :: UpdateAssociationResponse
s@UpdateAssociationResponse' {} Maybe AssociationDescription
a -> UpdateAssociationResponse
s {$sel:associationDescription:UpdateAssociationResponse' :: Maybe AssociationDescription
associationDescription = Maybe AssociationDescription
a} :: UpdateAssociationResponse)

-- | The response's http status code.
updateAssociationResponse_httpStatus :: Lens.Lens' UpdateAssociationResponse Prelude.Int
updateAssociationResponse_httpStatus :: Lens' UpdateAssociationResponse Int
updateAssociationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssociationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAssociationResponse' :: UpdateAssociationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAssociationResponse
s@UpdateAssociationResponse' {} Int
a -> UpdateAssociationResponse
s {$sel:httpStatus:UpdateAssociationResponse' :: Int
httpStatus = Int
a} :: UpdateAssociationResponse)

instance Prelude.NFData UpdateAssociationResponse where
  rnf :: UpdateAssociationResponse -> ()
rnf UpdateAssociationResponse' {Int
Maybe AssociationDescription
httpStatus :: Int
associationDescription :: Maybe AssociationDescription
$sel:httpStatus:UpdateAssociationResponse' :: UpdateAssociationResponse -> Int
$sel:associationDescription:UpdateAssociationResponse' :: UpdateAssociationResponse -> Maybe AssociationDescription
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AssociationDescription
associationDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus