From 57d7da24a3771934b4d6b24b213d967572a48235 Mon Sep 17 00:00:00 2001 From: Corey Pyle Date: Thu, 18 Apr 2024 11:58:56 -0400 Subject: [PATCH] Add new services and sdks; make title/title_abbrev optional. (#21) * Add new services and sdks; make title/title_abbrev optional. --- aws_doc_sdk_examples_tools/config/sdks.yaml | 13 +++++++------ aws_doc_sdk_examples_tools/config/services.yaml | 15 +++++++++++++++ aws_doc_sdk_examples_tools/metadata.py | 8 ++++---- aws_doc_sdk_examples_tools/metadata_test.py | 10 ---------- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/aws_doc_sdk_examples_tools/config/sdks.yaml b/aws_doc_sdk_examples_tools/config/sdks.yaml index 58cc597..50ec16d 100644 --- a/aws_doc_sdk_examples_tools/config/sdks.yaml +++ b/aws_doc_sdk_examples_tools/config/sdks.yaml @@ -147,16 +147,17 @@ PowerShell: property: powershell sdk: 4: - long: "&PowerShelllong;" - short: "&PowerShell;" + long: "&TWPALLlong;" + short: "&TWPALL;" expanded: long: "AWS Tools for PowerShell" - short: "AWS Tools for PowerShell" + short: "Tools for PowerShell" guide: "powershell/latest/userguide/pstools-welcome.html" api_ref: - uid: "ToolsForPowerShellV4" - name: "&guide-powershell-api;" - guide: "&guide-powershell-dev;" + uid: "ToolsForPowerShell4" + name: "&guide-twp-ref;" + link_template: "https://docs.aws.amazon.com/powershell/latest/reference" + guide: "&guide-twp-ug;" Python: property: python sdk: diff --git a/aws_doc_sdk_examples_tools/config/services.yaml b/aws_doc_sdk_examples_tools/config/services.yaml index 8acf411..d0abc33 100644 --- a/aws_doc_sdk_examples_tools/config/services.yaml +++ b/aws_doc_sdk_examples_tools/config/services.yaml @@ -1,3 +1,18 @@ +accessanalyzer: + long: '&iam-citadel-long;' + short: '&iam-citadel;' + sort: IAM Access Analyzer + expanded: + long: AWS Identity and Access Management Access Analyzer + short: IAM Access Analyzer + blurb: helps you identify the resources in your organization and accounts, such as Amazon S3 buckets or IAM roles, shared with an external entity. + guide: + subtitle: User Guide + url: IAM/latest/UserGuide/what-is-access-analyzer.html + api_ref: access-analyzer/latest/APIReference/Welcome.html + tags: + product_categories: {'Security, Identity, & Compliance'} + version: accessanalyzer-2019-11-01 acm: long: '&ACMlong; (&ACM;)' short: '&ACM;' diff --git a/aws_doc_sdk_examples_tools/metadata.py b/aws_doc_sdk_examples_tools/metadata.py index 027a5a9..9627118 100755 --- a/aws_doc_sdk_examples_tools/metadata.py +++ b/aws_doc_sdk_examples_tools/metadata.py @@ -206,9 +206,9 @@ class Example: id: str file: str # Human readable title. TODO: Defaults to slug-to-title of the ID if not provided. - title: str + title: Optional[str] # Used in the TOC. TODO: Defaults to slug-to-title of the ID if not provided. - title_abbrev: str + title_abbrev: Optional[str] synopsis: str languages: Dict[str, Language] # String label categories. Categories inferred by cross-service with multiple services, and can be whatever else it wants. Controls where in the TOC it appears. @@ -262,8 +262,8 @@ def from_yaml( ) -> tuple[Example, MetadataErrors]: errors = MetadataErrors() - title = get_with_valid_entities("title", yaml, errors) - title_abbrev = get_with_valid_entities("title_abbrev", yaml, errors) + title = get_with_valid_entities("title", yaml, errors, True) + title_abbrev = get_with_valid_entities("title_abbrev", yaml, errors, True) synopsis = get_with_valid_entities("synopsis", yaml, errors, opt=True) synopsis_list = [str(syn) for syn in yaml.get("synopsis_list", [])] diff --git a/aws_doc_sdk_examples_tools/metadata_test.py b/aws_doc_sdk_examples_tools/metadata_test.py index 13199c1..17fff82 100644 --- a/aws_doc_sdk_examples_tools/metadata_test.py +++ b/aws_doc_sdk_examples_tools/metadata_test.py @@ -331,16 +331,6 @@ def test_verify_load_successful(): ( "empty_metadata.yaml", [ - metadata_errors.MissingField( - field="title", - file="empty_metadata.yaml", - id="sns_EmptyExample", - ), - metadata_errors.MissingField( - field="title_abbrev", - file="empty_metadata.yaml", - id="sns_EmptyExample", - ), metadata_errors.MissingField( field="languages", file="empty_metadata.yaml",