{-# 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.WorkSpaces.DescribeTags -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Describes the specified tags for the specified WorkSpaces resource. module Amazonka.WorkSpaces.DescribeTags ( -- * Creating a Request DescribeTags (..), newDescribeTags, -- * Request Lenses describeTags_resourceId, -- * Destructuring the Response DescribeTagsResponse (..), newDescribeTagsResponse, -- * Response Lenses describeTagsResponse_tagList, describeTagsResponse_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.WorkSpaces.Types -- | /See:/ 'newDescribeTags' smart constructor. data DescribeTags = DescribeTags' { -- | The identifier of the WorkSpaces resource. The supported resource types -- are WorkSpaces, registered directories, images, custom bundles, IP -- access control groups, and connection aliases. resourceId :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DescribeTags' 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', 'describeTags_resourceId' - The identifier of the WorkSpaces resource. The supported resource types -- are WorkSpaces, registered directories, images, custom bundles, IP -- access control groups, and connection aliases. newDescribeTags :: -- | 'resourceId' Prelude.Text -> DescribeTags newDescribeTags pResourceId_ = DescribeTags' {resourceId = pResourceId_} -- | The identifier of the WorkSpaces resource. The supported resource types -- are WorkSpaces, registered directories, images, custom bundles, IP -- access control groups, and connection aliases. describeTags_resourceId :: Lens.Lens' DescribeTags Prelude.Text describeTags_resourceId = Lens.lens (\DescribeTags' {resourceId} -> resourceId) (\s@DescribeTags' {} a -> s {resourceId = a} :: DescribeTags) instance Core.AWSRequest DescribeTags where type AWSResponse DescribeTags = DescribeTagsResponse request overrides = Request.postJSON (overrides defaultService) response = Response.receiveJSON ( \s h x -> DescribeTagsResponse' Prelude.<$> (x Data..?> "TagList" Core..!@ Prelude.mempty) Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable DescribeTags where hashWithSalt _salt DescribeTags' {..} = _salt `Prelude.hashWithSalt` resourceId instance Prelude.NFData DescribeTags where rnf DescribeTags' {..} = Prelude.rnf resourceId instance Data.ToHeaders DescribeTags where toHeaders = Prelude.const ( Prelude.mconcat [ "X-Amz-Target" Data.=# ( "WorkspacesService.DescribeTags" :: Prelude.ByteString ), "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToJSON DescribeTags where toJSON DescribeTags' {..} = Data.object ( Prelude.catMaybes [Prelude.Just ("ResourceId" Data..= resourceId)] ) instance Data.ToPath DescribeTags where toPath = Prelude.const "/" instance Data.ToQuery DescribeTags where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newDescribeTagsResponse' smart constructor. data DescribeTagsResponse = DescribeTagsResponse' { -- | The tags. tagList :: Prelude.Maybe [Tag], -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'DescribeTagsResponse' 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: -- -- 'tagList', 'describeTagsResponse_tagList' - The tags. -- -- 'httpStatus', 'describeTagsResponse_httpStatus' - The response's http status code. newDescribeTagsResponse :: -- | 'httpStatus' Prelude.Int -> DescribeTagsResponse newDescribeTagsResponse pHttpStatus_ = DescribeTagsResponse' { tagList = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | The tags. describeTagsResponse_tagList :: Lens.Lens' DescribeTagsResponse (Prelude.Maybe [Tag]) describeTagsResponse_tagList = Lens.lens (\DescribeTagsResponse' {tagList} -> tagList) (\s@DescribeTagsResponse' {} a -> s {tagList = a} :: DescribeTagsResponse) Prelude.. Lens.mapping Lens.coerced -- | The response's http status code. describeTagsResponse_httpStatus :: Lens.Lens' DescribeTagsResponse Prelude.Int describeTagsResponse_httpStatus = Lens.lens (\DescribeTagsResponse' {httpStatus} -> httpStatus) (\s@DescribeTagsResponse' {} a -> s {httpStatus = a} :: DescribeTagsResponse) instance Prelude.NFData DescribeTagsResponse where rnf DescribeTagsResponse' {..} = Prelude.rnf tagList `Prelude.seq` Prelude.rnf httpStatus