File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
.generator/templates/libraries/jersey2
src/main/java/com/datadog/api/v2/client/model Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -111,9 +111,14 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
111111 { {/requiredVars} }
112112 ) {
113113 {{#requiredVars} }
114- this.{ {name} } = { {name} };{ {#allowableValues} }
114+ this.{ {name} } = { {name} };{ {#isNullable} }
115+ if ({ {name} } != null) {
116+ {{/isNullable} }{ {#allowableValues} }
115117 this.unparsed |= !{ {name} }.isValid();{ {/allowableValues} }{ {#isModel} }{ {^isPrimitiveType} }
116118 this.unparsed |= { {name} }.unparsed;{ {/isPrimitiveType} }{ {/isModel} }
119+ { {#isNullable} }
120+ }
121+ { {/isNullable} }
117122 { {/requiredVars} }
118123 }
119124 { {/hasRequired} }
@@ -139,6 +144,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
139144 { {^vendorExtensions.x-is-jackson-optional-nullable} }
140145 this.{ {name} } = { {name} };
141146 { {^isArray} }
147+ { {#isNullable} }
148+ if ({ {name} } != null) {
149+ {{/isNullable} }
142150 { {#allowableValues} }
143151 { {^isPrimitiveType} }
144152 this.unparsed |= !{ {name} }.isValid();
@@ -149,6 +157,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
149157 this.unparsed |= { {name} }.unparsed;
150158 { {/isPrimitiveType} }
151159 { {/isModel} }
160+ { {#isNullable} }
161+ }
162+ { {/isNullable} }
152163 { {/isArray} }
153164 { {#isArray} }
154165 { {#items.isModel} }
Original file line number Diff line number Diff line change @@ -61,14 +61,19 @@ public LogsArchiveAttributes(
6161 @ JsonProperty (required = true , value = JSON_PROPERTY_NAME ) String name ,
6262 @ JsonProperty (required = true , value = JSON_PROPERTY_QUERY ) String query ) {
6363 this .destination = destination ;
64- this .unparsed |= destination .unparsed ;
64+ if (destination != null ) {
65+
66+ this .unparsed |= destination .unparsed ;
67+ }
6568 this .name = name ;
6669 this .query = query ;
6770 }
6871
6972 public LogsArchiveAttributes destination (LogsArchiveDestination destination ) {
7073 this .destination = destination ;
71- this .unparsed |= destination .unparsed ;
74+ if (destination != null ) {
75+ this .unparsed |= destination .unparsed ;
76+ }
7277 return this ;
7378 }
7479
You can’t perform that action at this time.
0 commit comments