Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs were reversed 🤦🏻 #177

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions coveo-arnparse/coveo_arnparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,29 +41,29 @@ 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]

@property
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]

Expand Down
Loading