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

chore(codegen): include default value comment for service id #4147

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ public void addConfigInterfaceFields(
TypeScriptWriter writer
) {
if (isAwsService(settings, model)) {
writer.writeDocs("Unique service identifier.\n@internal")
ServiceShape service = settings.getService(model);
String sdkId = service.getTrait(ServiceTrait.class).map(ServiceTrait::getSdkId)
.orElse("");
writer.writeDocs(String.format("Unique service identifier.%n@internal%n@default \"%s\"", sdkId))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you run the codegen (yarn generate-clients) for this and commit it, or want us to do it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that was done in a separate process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the generate-clients script now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i reverted the clients update in order to get this merged

.write("serviceId?: string;\n");
}
if (isSigV4Service(settings, model)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public void addConfigInterfaceFields(
writer.writeDocs(
"Whether to override the request region with the region inferred from requested resource's ARN."
+ " Defaults to false.")
.addImport("Provider", "Provider", TypeScriptDependency.AWS_SDK_TYPES.packageName)
.write("useArnRegion?: boolean | Provider<boolean>;");
.addImport("Provider", "__Provider", TypeScriptDependency.AWS_SDK_TYPES.packageName)
.write("useArnRegion?: boolean | __Provider<boolean>;");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ public void addConfigInterfaceFields(
SymbolProvider symbolProvider,
TypeScriptWriter writer
) {
writer.addImport("Provider", "Provider", TypeScriptDependency.AWS_SDK_TYPES.packageName);
writer.addImport("Provider", "__Provider", TypeScriptDependency.AWS_SDK_TYPES.packageName);
writer.addImport("UserAgent", "__UserAgent", TypeScriptDependency.AWS_SDK_TYPES.packageName);
writer.writeDocs("The provider populating default tracking information to be sent with `user-agent`, "
+ "`x-amz-user-agent` header\n@internal");
writer.write("defaultUserAgentProvider?: Provider<__UserAgent>;\n");
writer.write("defaultUserAgentProvider?: __Provider<__UserAgent>;\n");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ public void addConfigInterfaceFields(
writer.addImport("EndpointV2", "__EndpointV2", TypeScriptDependency.AWS_SDK_TYPES.packageName);
} else {
writer.addImport(
"RegionInfoProvider", null, TypeScriptDependency.AWS_SDK_TYPES.packageName
"RegionInfoProvider", "__RegionInfoProvider", TypeScriptDependency.AWS_SDK_TYPES.packageName
);
writer.writeDocs("Fetch related hostname, signing name or signing region with given region.\n"
+ "@internal");
writer.write("regionInfoProvider?: RegionInfoProvider;\n");
writer.write("regionInfoProvider?: __RegionInfoProvider;\n");
}
}

Expand Down