Skip to content

Commit

Permalink
Remove unused moduleDescription setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Yuan committed Nov 8, 2023
1 parent e737356 commit 391876c
Showing 1 changed file with 3 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@
import software.amazon.smithy.model.node.ObjectNode;
import software.amazon.smithy.model.shapes.ServiceShape;
import software.amazon.smithy.model.shapes.ShapeId;
import software.amazon.smithy.utils.SmithyInternalApi;

/**
* Settings used by {@link GoCodegenPlugin}.
*/
@SmithyInternalApi
public final class GoSettings {

private static final String SERVICE = "service";
private static final String MODULE_NAME = "module";
private static final String MODULE_DESCRIPTION = "moduleDescription";
private static final String MODULE_VERSION = "moduleVersion";
private static final String GENERATE_GO_MOD = "generateGoMod";
private static final String GO_DIRECTIVE = "goDirective";

private ShapeId service;
private String moduleName;
private String moduleDescription = "";
private String moduleVersion;
private Boolean generateGoMod = false;
private String goDirective = GoModuleInfo.DEFAULT_GO_DIRECTIVE;
Expand All @@ -55,12 +55,10 @@ public final class GoSettings {
public static GoSettings from(ObjectNode config) {
GoSettings settings = new GoSettings();
config.warnIfAdditionalProperties(
Arrays.asList(SERVICE, MODULE_NAME, MODULE_DESCRIPTION, MODULE_VERSION, GENERATE_GO_MOD, GO_DIRECTIVE));
Arrays.asList(SERVICE, MODULE_NAME, MODULE_VERSION, GENERATE_GO_MOD, GO_DIRECTIVE));

settings.setService(config.expectStringMember(SERVICE).expectShapeId());
settings.setModuleName(config.expectStringMember(MODULE_NAME).getValue());
settings.setModuleDescription(config.getStringMemberOrDefault(
MODULE_DESCRIPTION, settings.getModuleName() + " client"));
settings.setModuleVersion(config.getStringMemberOrDefault(MODULE_VERSION, null));
settings.setGenerateGoMod(config.getBooleanMemberOrDefault(GENERATE_GO_MOD, false));
settings.setGoDirective(config.getStringMemberOrDefault(GO_DIRECTIVE, GoModuleInfo.DEFAULT_GO_DIRECTIVE));
Expand Down Expand Up @@ -121,24 +119,6 @@ public void setModuleName(String moduleName) {
this.moduleName = Objects.requireNonNull(moduleName);
}

/**
* Gets the optional module description for the module that will be generated.
*
* @return Returns the module description.
*/
public String getModuleDescription() {
return moduleDescription;
}

/**
* Sets the description of the module to generate.
*
* @param moduleDescription The description of the module to generate.
*/
public void setModuleDescription(String moduleDescription) {
this.moduleDescription = Objects.requireNonNull(moduleDescription);
}

/**
* Gets the optional module version for the module that will be generated.
*
Expand Down

0 comments on commit 391876c

Please sign in to comment.