{-# 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.ApiGatewayV2.GetTags -- Copyright : (c) 2013-2023 Brendan Hay -- License : Mozilla Public License, v. 2.0. -- Maintainer : Brendan Hay -- Stability : auto-generated -- Portability : non-portable (GHC extensions) -- -- Gets a collection of Tag resources. module Amazonka.ApiGatewayV2.GetTags ( -- * Creating a Request GetTags (..), newGetTags, -- * Request Lenses getTags_resourceArn, -- * Destructuring the Response GetTagsResponse (..), newGetTagsResponse, -- * Response Lenses getTagsResponse_tags, getTagsResponse_httpStatus, ) where import Amazonka.ApiGatewayV2.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:/ 'newGetTags' smart constructor. data GetTags = GetTags' { -- | The resource ARN for the tag. resourceArn :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'GetTags' 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', 'getTags_resourceArn' - The resource ARN for the tag. newGetTags :: -- | 'resourceArn' Prelude.Text -> GetTags newGetTags pResourceArn_ = GetTags' {resourceArn = pResourceArn_} -- | The resource ARN for the tag. getTags_resourceArn :: Lens.Lens' GetTags Prelude.Text getTags_resourceArn = Lens.lens (\GetTags' {resourceArn} -> resourceArn) (\s@GetTags' {} a -> s {resourceArn = a} :: GetTags) instance Core.AWSRequest GetTags where type AWSResponse GetTags = GetTagsResponse request overrides = Request.get (overrides defaultService) response = Response.receiveJSON ( \s h x -> GetTagsResponse' Prelude.<$> (x Data..?> "tags" Core..!@ Prelude.mempty) Prelude.<*> (Prelude.pure (Prelude.fromEnum s)) ) instance Prelude.Hashable GetTags where hashWithSalt _salt GetTags' {..} = _salt `Prelude.hashWithSalt` resourceArn instance Prelude.NFData GetTags where rnf GetTags' {..} = Prelude.rnf resourceArn instance Data.ToHeaders GetTags where toHeaders = Prelude.const ( Prelude.mconcat [ "Content-Type" Data.=# ( "application/x-amz-json-1.1" :: Prelude.ByteString ) ] ) instance Data.ToPath GetTags where toPath GetTags' {..} = Prelude.mconcat ["/v2/tags/", Data.toBS resourceArn] instance Data.ToQuery GetTags where toQuery = Prelude.const Prelude.mempty -- | /See:/ 'newGetTagsResponse' smart constructor. data GetTagsResponse = GetTagsResponse' { tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text), -- | The response's http status code. httpStatus :: Prelude.Int } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'GetTagsResponse' 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: -- -- 'tags', 'getTagsResponse_tags' - Undocumented member. -- -- 'httpStatus', 'getTagsResponse_httpStatus' - The response's http status code. newGetTagsResponse :: -- | 'httpStatus' Prelude.Int -> GetTagsResponse newGetTagsResponse pHttpStatus_ = GetTagsResponse' { tags = Prelude.Nothing, httpStatus = pHttpStatus_ } -- | Undocumented member. getTagsResponse_tags :: Lens.Lens' GetTagsResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)) getTagsResponse_tags = Lens.lens (\GetTagsResponse' {tags} -> tags) (\s@GetTagsResponse' {} a -> s {tags = a} :: GetTagsResponse) Prelude.. Lens.mapping Lens.coerced -- | The response's http status code. getTagsResponse_httpStatus :: Lens.Lens' GetTagsResponse Prelude.Int getTagsResponse_httpStatus = Lens.lens (\GetTagsResponse' {httpStatus} -> httpStatus) (\s@GetTagsResponse' {} a -> s {httpStatus = a} :: GetTagsResponse) instance Prelude.NFData GetTagsResponse where rnf GetTagsResponse' {..} = Prelude.rnf tags `Prelude.seq` Prelude.rnf httpStatus