{-# 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.CloudWatch.UntagResource -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Removes one or more tags from the specified resource. module Amazonka.CloudWatch.UntagResource ( -- * Creating a Request UntagResource (..), newUntagResource, -- * Request Lenses untagResource_resourceARN, untagResource_tagKeys, -- * Destructuring the Response UntagResourceResponse (..), newUntagResourceResponse, -- * Response Lenses untagResourceResponse_httpStatus, ) where import Amazonka.CloudWatch.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:/ 'newUntagResource' smart constructor. data UntagResource = UntagResource' { -- | The ARN of the CloudWatch resource that you\'re removing tags from. -- -- The ARN format of an alarm is -- @arn:aws:cloudwatch:@/@Region@/@:@/@account-id@/@:alarm:@/@alarm-name@/@ @ -- -- The ARN format of a Contributor Insights rule is -- @arn:aws:cloudwatch:@/@Region@/@:@/@account-id@/@:insight-rule:@/@insight-rule-name@/@ @ -- -- For more information about ARN format, see -- -- in the /Amazon Web Services General Reference/. resourceARN :: Prelude.Text, -- | The list of tag keys to remove from the resource. tagKeys :: [Prelude.Text] } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'UntagResource' 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: -- -- 'resourceARN', 'untagResource_resourceARN' - The ARN of the CloudWatch resource that you\'re removing tags from. -- -- The ARN format of an alarm is -- @arn:aws:cloudwatch:@/@Region@/@:@/@account-id@/@:alarm:@/@alarm-name@/@ @ -- -- The ARN format of a Contributor Insights rule is -- @arn:aws:cloudwatch:@/@Region@/@:@/@account-id@/@:insight-rule:@/@insight-rule-name@/@ @ -- -- For more information about ARN format, see -- -- in the /Amazon Web Services General Reference/. -- -- 'tagKeys', 'untagResource_tagKeys' - The list of tag keys to remove from the resource. newUntagResource :: -- | 'resourceARN' Prelude.Text -> UntagResource newUntagResource pResourceARN_ = UntagResource' { resourceARN = pResourceARN_, tagKeys = Prelude.mempty } -- | The ARN of the CloudWatch resource that you\'re removing tags from. -- -- The ARN format of an alarm is -- @arn:aws:cloudwatch:@/@Region@/@:@/@account-id@/@:alarm:@/@alarm-name@/@ @ -- -- The ARN format of a Contributor Insights rule is -- @arn:aws:cloudwatch:@/@Region@/@:@/@account-id@/@:insight-rule:@/@insight-rule-name@/@ @ -- -- For more information about ARN format, see -- -- in the /Amazon Web Services General Reference/. untagResource_resourceARN :: Lens.Lens' UntagResource Prelude.Text untagResource_resourceARN = Lens.lens (\UntagResource' {resourceARN} -> resourceARN) (\s@UntagResource' {} a -> s {resourceARN = a} :: UntagResource) -- | The list of tag keys to remove from the resource. untagResource_tagKeys :: Lens.Lens' UntagResource [Prelude.Text] untagResource_tagKeys = Lens.lens (\UntagResource' {tagKeys} -> tagKeys) (\s@UntagResource' {} a -> s {tagKeys = a} :: UntagResource) Prelude.. Lens.coerced instance Core.AWSRequest UntagResource where type AWSResponse UntagResource = UntagResourceResponse request overrides = Request.postQuery (overrides defaultService) response = Response.receiveXMLWrapper "UntagResourceResult" ( \s h x -> UntagResourceResponse' Prelude.<$> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable UntagResource where hashWithSalt _salt UntagResource' {..} = _salt `Prelude.hashWithSalt` resourceARN `Prelude.hashWithSalt` tagKeys instance Prelude.NFData UntagResource where rnf UntagResource' {..} = Prelude.rnf resourceARN `Prelude.seq` Prelude.rnf tagKeys instance Data.ToHeaders UntagResource where toHeaders = Prelude.const Prelude.mempty instance Data.ToPath UntagResource where toPath = Prelude.const "/" instance Data.ToQuery UntagResource where toQuery UntagResource' {..} = Prelude.mconcat [ "Action" Data.=: ("UntagResource" :: Prelude.ByteString), "Version" Data.=: ("2010-08-01" :: Prelude.ByteString), "ResourceARN" Data.=: resourceARN, "TagKeys" Data.=: Data.toQueryList "member" tagKeys ] -- | /See:/ 'newUntagResourceResponse' smart constructor. data UntagResourceResponse = UntagResourceResponse' { -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'UntagResourceResponse' 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: -- -- 'httpStatus', 'untagResourceResponse_httpStatus' - The response's http status code. newUntagResourceResponse :: -- | 'httpStatus' Prelude.Int -> UntagResourceResponse newUntagResourceResponse pHttpStatus_ = UntagResourceResponse' {httpStatus = pHttpStatus_} -- | The response's http status code. untagResourceResponse_httpStatus :: Lens.Lens' UntagResourceResponse Prelude.Int untagResourceResponse_httpStatus = Lens.lens (\UntagResourceResponse' {httpStatus} -> httpStatus) (\s@UntagResourceResponse' {} a -> s {httpStatus = a} :: UntagResourceResponse) instance Prelude.NFData UntagResourceResponse where rnf UntagResourceResponse' {..} = Prelude.rnf httpStatus