Skip to content

Commit

Permalink
Adds a serires of helpers to the internal endpoints package for inspe…
Browse files Browse the repository at this point in the history
…cting the endpoint model (#1149)

* Refactor EndpointGenerator, Allow for generating model helpers.
* Regenerated Clients
* Add changelog entry
  • Loading branch information
skmcgrail authored Apr 1, 2021
1 parent fa490ee commit eb5129c
Show file tree
Hide file tree
Showing 269 changed files with 5,801 additions and 1,375 deletions.
267 changes: 267 additions & 0 deletions .changes/next-release/service.wildcard-bugfix-1617228709351413000.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
{
"ID": "service.wildcard-bugfix-1617228709351413000",
"SchemaVersion": 1,
"Module": "service/...",
"Type": "bugfix",
"Description": "Refactored internal endpoints model for accessors",
"MinVersion": "",
"AffectedModules": [
"service/accessanalyzer",
"service/acm",
"service/acmpca",
"service/alexaforbusiness",
"service/amp",
"service/amplify",
"service/amplifybackend",
"service/apigateway",
"service/apigatewaymanagementapi",
"service/apigatewayv2",
"service/appconfig",
"service/appflow",
"service/appintegrations",
"service/applicationautoscaling",
"service/applicationdiscoveryservice",
"service/applicationinsights",
"service/appmesh",
"service/appstream",
"service/appsync",
"service/athena",
"service/auditmanager",
"service/autoscaling",
"service/autoscalingplans",
"service/backup",
"service/batch",
"service/braket",
"service/budgets",
"service/chime",
"service/cloud9",
"service/clouddirectory",
"service/cloudformation",
"service/cloudfront",
"service/cloudhsm",
"service/cloudhsmv2",
"service/cloudsearch",
"service/cloudsearchdomain",
"service/cloudtrail",
"service/cloudwatch",
"service/cloudwatchevents",
"service/cloudwatchlogs",
"service/codeartifact",
"service/codebuild",
"service/codecommit",
"service/codedeploy",
"service/codeguruprofiler",
"service/codegurureviewer",
"service/codepipeline",
"service/codestar",
"service/codestarconnections",
"service/codestarnotifications",
"service/cognitoidentity",
"service/cognitoidentityprovider",
"service/cognitosync",
"service/comprehend",
"service/comprehendmedical",
"service/computeoptimizer",
"service/configservice",
"service/connect",
"service/connectcontactlens",
"service/connectparticipant",
"service/costandusagereportservice",
"service/costexplorer",
"service/customerprofiles",
"service/databasemigrationservice",
"service/databrew",
"service/dataexchange",
"service/datapipeline",
"service/datasync",
"service/dax",
"service/detective",
"service/devicefarm",
"service/devopsguru",
"service/directconnect",
"service/directoryservice",
"service/dlm",
"service/docdb",
"service/dynamodb",
"service/dynamodbstreams",
"service/ebs",
"service/ec2",
"service/ec2instanceconnect",
"service/ecr",
"service/ecrpublic",
"service/ecs",
"service/efs",
"service/eks",
"service/elasticache",
"service/elasticbeanstalk",
"service/elasticinference",
"service/elasticloadbalancing",
"service/elasticloadbalancingv2",
"service/elasticsearchservice",
"service/elastictranscoder",
"service/emr",
"service/emrcontainers",
"service/eventbridge",
"service/firehose",
"service/fis",
"service/fms",
"service/forecast",
"service/forecastquery",
"service/frauddetector",
"service/fsx",
"service/gamelift",
"service/glacier",
"service/globalaccelerator",
"service/glue",
"service/greengrass",
"service/greengrassv2",
"service/groundstation",
"service/guardduty",
"service/health",
"service/healthlake",
"service/honeycode",
"service/iam",
"service/identitystore",
"service/imagebuilder",
"service/inspector",
"service/iot",
"service/iot1clickdevicesservice",
"service/iot1clickprojects",
"service/iotanalytics",
"service/iotdataplane",
"service/iotdeviceadvisor",
"service/iotevents",
"service/ioteventsdata",
"service/iotfleethub",
"service/iotjobsdataplane",
"service/iotsecuretunneling",
"service/iotsitewise",
"service/iotthingsgraph",
"service/iotwireless",
"service/ivs",
"service/kafka",
"service/kendra",
"service/kinesis",
"service/kinesisanalytics",
"service/kinesisanalyticsv2",
"service/kinesisvideo",
"service/kinesisvideoarchivedmedia",
"service/kinesisvideomedia",
"service/kinesisvideosignaling",
"service/kms",
"service/lakeformation",
"service/lambda",
"service/lexmodelbuildingservice",
"service/lexmodelsv2",
"service/lexruntimeservice",
"service/lexruntimev2",
"service/licensemanager",
"service/lightsail",
"service/lookoutvision",
"service/machinelearning",
"service/macie",
"service/macie2",
"service/managedblockchain",
"service/marketplacecatalog",
"service/marketplacecommerceanalytics",
"service/marketplaceentitlementservice",
"service/marketplacemetering",
"service/mediaconnect",
"service/mediaconvert",
"service/medialive",
"service/mediapackage",
"service/mediapackagevod",
"service/mediastore",
"service/mediastoredata",
"service/mediatailor",
"service/migrationhub",
"service/migrationhubconfig",
"service/mobile",
"service/mq",
"service/mturk",
"service/mwaa",
"service/neptune",
"service/networkfirewall",
"service/networkmanager",
"service/opsworks",
"service/opsworkscm",
"service/organizations",
"service/outposts",
"service/personalize",
"service/personalizeevents",
"service/personalizeruntime",
"service/pi",
"service/pinpoint",
"service/pinpointemail",
"service/pinpointsmsvoice",
"service/polly",
"service/pricing",
"service/qldb",
"service/qldbsession",
"service/quicksight",
"service/ram",
"service/rds",
"service/rdsdata",
"service/redshift",
"service/redshiftdata",
"service/rekognition",
"service/resourcegroups",
"service/resourcegroupstaggingapi",
"service/robomaker",
"service/route53",
"service/route53domains",
"service/route53resolver",
"service/s3",
"service/s3control",
"service/s3control/internal/endpoints/s3/endpoints.go",
"service/s3outposts",
"service/sagemaker",
"service/sagemakera2iruntime",
"service/sagemakeredge",
"service/sagemakerfeaturestoreruntime",
"service/sagemakerruntime",
"service/savingsplans",
"service/schemas",
"service/secretsmanager",
"service/securityhub",
"service/serverlessapplicationrepository",
"service/servicecatalog",
"service/servicecatalogappregistry",
"service/servicediscovery",
"service/servicequotas",
"service/ses",
"service/sesv2",
"service/sfn",
"service/shield",
"service/signer",
"service/sms",
"service/snowball",
"service/sns",
"service/sqs",
"service/ssm",
"service/sso",
"service/ssoadmin",
"service/ssooidc",
"service/storagegateway",
"service/sts",
"service/support",
"service/swf",
"service/synthetics",
"service/textract",
"service/timestreamquery",
"service/timestreamwrite",
"service/transcribe",
"service/transfer",
"service/translate",
"service/waf",
"service/wafregional",
"service/wafv2",
"service/wellarchitected",
"service/workdocs",
"service/worklink",
"service/workmail",
"service/workmailmessageflow",
"service/workspaces",
"service/xray"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.List;
import java.util.function.Consumer;
import software.amazon.smithy.aws.traits.ServiceTrait;
import software.amazon.smithy.codegen.core.SymbolProvider;
import software.amazon.smithy.go.codegen.GoSettings;
import software.amazon.smithy.go.codegen.GoWriter;
Expand All @@ -43,7 +44,16 @@ public void writeAdditionalFiles(
SymbolProvider symbolProvider,
TriConsumer<String, String, Consumer<GoWriter>> writerFactory
) {
new EndpointGenerator(settings, model, writerFactory).run();
String serviceId = settings.getService(model).expectTrait(ServiceTrait.class).getSdkId();
boolean generateQueryHelpers = serviceId.equalsIgnoreCase("S3");

EndpointGenerator.builder()
.settings(settings)
.model(model)
.writerFactory(writerFactory)
.modelQueryHelpers(generateQueryHelpers)
.build()
.run();
}

@Override
Expand Down
Loading

0 comments on commit eb5129c

Please sign in to comment.