@@ -23,6 +23,10 @@ public final class ConfigProperty implements ToSmithyBuilder<ConfigProperty> {
2323 private final boolean nullable ;
2424 private final String documentation ;
2525 private final Consumer <PythonWriter > initialize ;
26+ private final Symbol validator ;
27+ private final Symbol customResolver ;
28+ private final boolean useDescriptor ;
29+ private final String defaultValue ;
2630
2731 /**
2832 * Constructor.
@@ -33,6 +37,10 @@ private ConfigProperty(Builder builder) {
3337 this .nullable = builder .nullable ;
3438 this .documentation = Objects .requireNonNull (builder .documentation );
3539 this .initialize = Objects .requireNonNull (builder .initialize );
40+ this .validator = builder .validator ;
41+ this .customResolver = builder .customResolver ;
42+ this .useDescriptor = builder .useDescriptor ;
43+ this .defaultValue = builder .defaultValue ;
3644 }
3745
3846 /**
@@ -63,6 +71,34 @@ public String documentation() {
6371 return documentation ;
6472 }
6573
74+ /**
75+ * @return Returns the validator symbol for this property, if any.
76+ */
77+ public java .util .Optional <Symbol > validator () {
78+ return java .util .Optional .ofNullable (validator );
79+ }
80+
81+ /**
82+ * @return Returns the custom resolver symbol for this property, if any.
83+ */
84+ public java .util .Optional <Symbol > customResolver () {
85+ return java .util .Optional .ofNullable (customResolver );
86+ }
87+
88+ /**
89+ * @return Returns whether this property uses the ConfigProperty descriptor.
90+ */
91+ public boolean useDescriptor () {
92+ return useDescriptor ;
93+ }
94+
95+ /**
96+ * @return Returns the default value for this property, if any.
97+ */
98+ public java .util .Optional <String > defaultValue () {
99+ return java .util .Optional .ofNullable (defaultValue );
100+ }
101+
66102 /**
67103 * Initializes the config field on the config object.
68104 *
@@ -94,7 +130,11 @@ public SmithyBuilder<ConfigProperty> toBuilder() {
94130 .type (type )
95131 .nullable (nullable )
96132 .documentation (documentation )
97- .initialize (initialize );
133+ .initialize (initialize )
134+ .validator (validator )
135+ .customResolver (customResolver )
136+ .useDescriptor (useDescriptor )
137+ .defaultValue (defaultValue );
98138 }
99139
100140 /**
@@ -107,6 +147,11 @@ public static final class Builder implements SmithyBuilder<ConfigProperty> {
107147 private String documentation ;
108148 private Consumer <PythonWriter > initialize = writer -> writer .write ("self.$1L = $1L" , name );
109149
150+ private Symbol validator ;
151+ private Symbol customResolver ;
152+ private boolean useDescriptor = false ;
153+ private String defaultValue ;
154+
110155 @ Override
111156 public ConfigProperty build () {
112157 return new ConfigProperty (this );
@@ -182,5 +227,49 @@ public Builder initialize(Consumer<PythonWriter> initialize) {
182227 this .initialize = initialize ;
183228 return this ;
184229 }
230+
231+ /**
232+ * Sets the validator symbol for the config property.
233+ *
234+ * @param validator The validator function symbol.
235+ * @return Returns the builder.
236+ */
237+ public Builder validator (Symbol validator ) {
238+ this .validator = validator ;
239+ return this ;
240+ }
241+
242+ /**
243+ * Sets the custom resolver symbol for the config property.
244+ *
245+ * @param customResolver The custom resolver function symbol.
246+ * @return Returns the builder.
247+ */
248+ public Builder customResolver (Symbol customResolver ) {
249+ this .customResolver = customResolver ;
250+ return this ;
251+ }
252+
253+ /**
254+ * Sets whether the config property uses the ConfigProperty descriptor.
255+ *
256+ * @param useDescriptor Whether to use the descriptor pattern.
257+ * @return Returns the builder.
258+ */
259+ public Builder useDescriptor (boolean useDescriptor ) {
260+ this .useDescriptor = useDescriptor ;
261+ return this ;
262+ }
263+
264+ /**
265+ * Sets the default value for the config property.
266+ *
267+ * @param defaultValue The default value as a Python expression string.
268+ * @return Returns the builder.
269+ */
270+ public Builder defaultValue (String defaultValue ) {
271+ this .defaultValue = defaultValue ;
272+ return this ;
273+ }
185274 }
186275}
0 commit comments