{-# 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.CloudHSMV2.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 the specified tag or tags from the specified AWS CloudHSM -- cluster. module Amazonka.CloudHSMV2.UntagResource ( -- * Creating a Request UntagResource (..), newUntagResource, -- * Request Lenses untagResource_resourceId, untagResource_tagKeyList, -- * Destructuring the Response UntagResourceResponse (..), newUntagResourceResponse, -- * Response Lenses untagResourceResponse_httpStatus, ) where import Amazonka.CloudHSMV2.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 cluster identifier (ID) for the cluster whose tags you are removing. -- To find the cluster ID, use DescribeClusters. resourceId :: Prelude.Text, -- | A list of one or more tag keys for the tags that you are removing. -- Specify only the tag keys, not the tag values. tagKeyList :: Prelude.NonEmpty 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: -- -- 'resourceId', 'untagResource_resourceId' - The cluster identifier (ID) for the cluster whose tags you are removing. -- To find the cluster ID, use DescribeClusters. -- -- 'tagKeyList', 'untagResource_tagKeyList' - A list of one or more tag keys for the tags that you are removing. -- Specify only the tag keys, not the tag values. newUntagResource :: -- | 'resourceId' Prelude.Text -> -- | 'tagKeyList' Prelude.NonEmpty Prelude.Text -> UntagResource newUntagResource pResourceId_ pTagKeyList_ = UntagResource' { resourceId = pResourceId_, tagKeyList = Lens.coerced Lens.# pTagKeyList_ } -- | The cluster identifier (ID) for the cluster whose tags you are removing. -- To find the cluster ID, use DescribeClusters. untagResource_resourceId :: Lens.Lens' UntagResource Prelude.Text untagResource_resourceId = Lens.lens (\UntagResource' {resourceId} -> resourceId) (\s@UntagResource' {} a -> s {resourceId = a} :: UntagResource) -- | A list of one or more tag keys for the tags that you are removing. -- Specify only the tag keys, not the tag values. untagResource_tagKeyList :: Lens.Lens' UntagResource (Prelude.NonEmpty Prelude.Text) untagResource_tagKeyList = Lens.lens (\UntagResource' {tagKeyList} -> tagKeyList) (\s@UntagResource' {} a -> s {tagKeyList = a} :: UntagResource) Prelude.. Lens.coerced instance Core.AWSRequest UntagResource where type AWSResponse UntagResource = UntagResourceResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveEmpty ( \s h x -> UntagResourceResponse' Prelude.<$> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable UntagResource where hashWithSalt _salt UntagResource' {..} = _salt `Prelude.hashWithSalt` resourceId `Prelude.hashWithSalt` tagKeyList instance Prelude.NFData UntagResource where rnf UntagResource' {..} = Prelude.rnf resourceId `Prelude.seq` Prelude.rnf tagKeyList instance Data.ToHeaders UntagResource where toHeaders = Prelude.const ( Prelude.mconcat [ "X-Amz-Target" Data.=# ( "BaldrApiService.UntagResource" :: Prelude.ByteString ), "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON UntagResource where toJSON UntagResource' {..} = Data.object ( Prelude.catMaybes [ Prelude.Just ("ResourceId" Data..= resourceId), Prelude.Just ("TagKeyList" Data..= tagKeyList) ] ) instance Data.ToPath UntagResource where toPath = Prelude.const "/" instance Data.ToQuery UntagResource where toQuery = Prelude.const Prelude.mempty -- | /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