1212package com .segment .publicapi .models ;
1313
1414import com .google .gson .Gson ;
15+ import com .google .gson .JsonArray ;
1516import com .google .gson .JsonElement ;
1617import com .google .gson .JsonObject ;
1718import com .google .gson .TypeAdapter ;
2223import com .google .gson .stream .JsonWriter ;
2324import com .segment .publicapi .JSON ;
2425import java .io .IOException ;
26+ import java .util .ArrayList ;
2527import java .util .HashSet ;
28+ import java .util .List ;
2629import java .util .Map ;
2730import java .util .Objects ;
2831import java .util .Set ;
@@ -34,6 +37,11 @@ public class AddDestinationToAudienceAlphaOutput {
3437 @ SerializedName (SERIALIZED_NAME_CONNECTION )
3538 private Connection connection ;
3639
40+ public static final String SERIALIZED_NAME_ID_SYNC_CONFIGURATION = "idSyncConfiguration" ;
41+
42+ @ SerializedName (SERIALIZED_NAME_ID_SYNC_CONFIGURATION )
43+ private List <IDSyncConfigurationInput > idSyncConfiguration = new ArrayList <>();
44+
3745 public AddDestinationToAudienceAlphaOutput () {}
3846
3947 public AddDestinationToAudienceAlphaOutput connection (Connection connection ) {
@@ -56,6 +64,36 @@ public void setConnection(Connection connection) {
5664 this .connection = connection ;
5765 }
5866
67+ public AddDestinationToAudienceAlphaOutput idSyncConfiguration (
68+ List <IDSyncConfigurationInput > idSyncConfiguration ) {
69+
70+ this .idSyncConfiguration = idSyncConfiguration ;
71+ return this ;
72+ }
73+
74+ public AddDestinationToAudienceAlphaOutput addIdSyncConfigurationItem (
75+ IDSyncConfigurationInput idSyncConfigurationItem ) {
76+ if (this .idSyncConfiguration == null ) {
77+ this .idSyncConfiguration = new ArrayList <>();
78+ }
79+ this .idSyncConfiguration .add (idSyncConfigurationItem );
80+ return this ;
81+ }
82+
83+ /**
84+ * The id sync configuration for the Destination - array of external ids with their strategies.
85+ *
86+ * @return idSyncConfiguration
87+ */
88+ @ javax .annotation .Nonnull
89+ public List <IDSyncConfigurationInput > getIdSyncConfiguration () {
90+ return idSyncConfiguration ;
91+ }
92+
93+ public void setIdSyncConfiguration (List <IDSyncConfigurationInput > idSyncConfiguration ) {
94+ this .idSyncConfiguration = idSyncConfiguration ;
95+ }
96+
5997 @ Override
6098 public boolean equals (Object o ) {
6199 if (this == o ) {
@@ -66,19 +104,25 @@ public boolean equals(Object o) {
66104 }
67105 AddDestinationToAudienceAlphaOutput addDestinationToAudienceAlphaOutput =
68106 (AddDestinationToAudienceAlphaOutput ) o ;
69- return Objects .equals (this .connection , addDestinationToAudienceAlphaOutput .connection );
107+ return Objects .equals (this .connection , addDestinationToAudienceAlphaOutput .connection )
108+ && Objects .equals (
109+ this .idSyncConfiguration ,
110+ addDestinationToAudienceAlphaOutput .idSyncConfiguration );
70111 }
71112
72113 @ Override
73114 public int hashCode () {
74- return Objects .hash (connection );
115+ return Objects .hash (connection , idSyncConfiguration );
75116 }
76117
77118 @ Override
78119 public String toString () {
79120 StringBuilder sb = new StringBuilder ();
80121 sb .append ("class AddDestinationToAudienceAlphaOutput {\n " );
81122 sb .append (" connection: " ).append (toIndentedString (connection )).append ("\n " );
123+ sb .append (" idSyncConfiguration: " )
124+ .append (toIndentedString (idSyncConfiguration ))
125+ .append ("\n " );
82126 sb .append ("}" );
83127 return sb .toString ();
84128 }
@@ -101,10 +145,12 @@ private String toIndentedString(Object o) {
101145 // a set of all properties/fields (JSON key names)
102146 openapiFields = new HashSet <String >();
103147 openapiFields .add ("connection" );
148+ openapiFields .add ("idSyncConfiguration" );
104149
105150 // a set of required properties/fields (JSON key names)
106151 openapiRequiredFields = new HashSet <String >();
107152 openapiRequiredFields .add ("connection" );
153+ openapiRequiredFields .add ("idSyncConfiguration" );
108154 }
109155
110156 /**
@@ -151,6 +197,21 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
151197 JsonObject jsonObj = jsonElement .getAsJsonObject ();
152198 // validate the required field `connection`
153199 Connection .validateJsonElement (jsonObj .get ("connection" ));
200+ // ensure the json data is an array
201+ if (!jsonObj .get ("idSyncConfiguration" ).isJsonArray ()) {
202+ throw new IllegalArgumentException (
203+ String .format (
204+ "Expected the field `idSyncConfiguration` to be an array in the JSON"
205+ + " string but got `%s`" ,
206+ jsonObj .get ("idSyncConfiguration" ).toString ()));
207+ }
208+
209+ JsonArray jsonArrayidSyncConfiguration = jsonObj .getAsJsonArray ("idSyncConfiguration" );
210+ // validate the required field `idSyncConfiguration` (array)
211+ for (int i = 0 ; i < jsonArrayidSyncConfiguration .size (); i ++) {
212+ IDSyncConfigurationInput .validateJsonElement (jsonArrayidSyncConfiguration .get (i ));
213+ }
214+ ;
154215 }
155216
156217 public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
0 commit comments