From ea8a9e1420adaee7b070f99c9502b709e320dae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Pich=C3=A9?= Date: Fri, 8 Dec 2023 14:25:20 -0500 Subject: [PATCH] docs were reversed :shrug: --- coveo-arnparse/coveo_arnparse/__init__.py | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/coveo-arnparse/coveo_arnparse/__init__.py b/coveo-arnparse/coveo_arnparse/__init__.py index 19eeae21..9e907fcf 100644 --- a/coveo-arnparse/coveo_arnparse/__init__.py +++ b/coveo-arnparse/coveo_arnparse/__init__.py @@ -41,14 +41,14 @@ class Arn: def resource_type(self) -> str: """ Some services provide 2 components in the resource, split on `:` or `/`. - Return the suffix, or an empty string otherwise. + Return the prefix, or an empty string otherwise. E.g.: - - "arn:aws:ssm:::parameter/some-param-folder/some-param -> some-param-folder/some-param - - "arn:aws:s3:::my-bucket/folder/file.jpg -> folder/file.jpg - - "arn:aws:cloudwatch:::alarm:some-alarm -> some-alarm - - "arn:aws:ec2:::vpc/vpc-12345 -> vpc-12345 - - 'arn:aws:sns:::my_sns_topic -> "" + - arn:aws:ssm:::parameter/some-param-folder/some-param -> parameter + - arn:aws:s3:::my-bucket/folder/file.jpg -> my-bucket + - arn:aws:cloudwatch:::alarm:some-alarm -> alarm + - arn:aws:ec2:::vpc/vpc-12345 -> vpc + - arn:aws:sns:::my_sns_topic -> "" """ return _split_resource_type_and_id(self.resource)[0] @@ -56,14 +56,14 @@ def resource_type(self) -> str: def resource_id(self) -> str: """ Some services provide 2 components in the resource, split on `:` or `/`. - Return the prefix, or an empty string otherwise. + Return the suffix, or an empty string otherwise. E.g.: - - arn:aws:ssm:::parameter/some-param-folder/some-param -> parameter - - arn:aws:s3:::my-bucket/folder/file.jpg -> my-bucket - - arn:aws:cloudwatch:::alarm:some-alarm -> alarm - - arn:aws:ec2:::vpc/vpc-12345 -> vpc - - arn:aws:sns:::my_sns_topic -> "" + - "arn:aws:ssm:::parameter/some-param-folder/some-param -> some-param-folder/some-param + - "arn:aws:s3:::my-bucket/folder/file.jpg -> folder/file.jpg + - "arn:aws:cloudwatch:::alarm:some-alarm -> some-alarm + - "arn:aws:ec2:::vpc/vpc-12345 -> vpc-12345 + - 'arn:aws:sns:::my_sns_topic -> "" """ return _split_resource_type_and_id(self.resource)[1]