Skip to content

Commit

Permalink
Addresses issue #1087 (#1110)
Browse files Browse the repository at this point in the history
Adds CustomInitialize() to Azure service client
  • Loading branch information
jhancock93 authored and fearthecowboy committed Jun 10, 2016
1 parent 623601d commit 89362bb
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ public AutoRestDurationTestService(Uri baseUri, ServiceClientCredentials credent
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -299,6 +303,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ public AzureCompositeModel(Uri baseUri, ServiceClientCredentials credentials, Ht
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -350,6 +354,7 @@ private void Initialize()
};
SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter<Fish>("fishtype"));
DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<Fish>("fishtype"));
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ public AutoRestParameterGroupingTestService(Uri baseUri, ServiceClientCredential
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -299,6 +303,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ public AutoRestReportServiceForAzure(Uri baseUri, ServiceClientCredentials crede
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -293,6 +297,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ public AutoRestResourceFlatteningTestService(Uri baseUri, ServiceClientCredentia
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -294,6 +298,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new TransformationJsonConverter());
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@ public AutoRestAzureSpecialParametersTestClient(Uri baseUri, ServiceClientCreden
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -354,6 +358,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ public AutoRestParameterizedHostTestClient(ServiceClientCredentials credentials,
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -191,6 +195,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ public AutoRestHeadTestService(Uri baseUri, ServiceClientCredentials credentials
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -298,6 +302,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ public AutoRestHeadExceptionTestService(Uri baseUri, ServiceClientCredentials cr
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -298,6 +302,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ public AutoRestLongRunningOperationTestService(Uri baseUri, ServiceClientCredent
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -318,6 +322,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new TransformationJsonConverter());
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ public AutoRestPagingTestService(Uri baseUri, ServiceClientCredentials credentia
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -299,6 +303,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ public MicrosoftAzureTestUrl(Uri baseUri, ServiceClientCredentials credentials,
}
}

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();
/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -310,6 +314,7 @@ private void Initialize()
new Iso8601TimeSpanConverter()
}
};
CustomInitialize();
DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ namespace @Settings.Namespace
{
@(Include(new ServiceClientBodyTemplate(), (ServiceClientTemplateModel)Model))

/// <summary>
/// An optional partial-method to perform custom initialization.
/// </summary>
partial void CustomInitialize();

/// <summary>
/// Initializes client properties.
/// </summary>
Expand Down Expand Up @@ -97,6 +102,8 @@ namespace @Settings.Namespace
@:DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter<@(polymorphicType.Name)>("@(polymorphicType.PolymorphicDiscriminator)"));
}

CustomInitialize();

@if (Model.NeedsTransformationConverter)
{
@:DeserializationSettings.Converters.Add(new TransformationJsonConverter());
Expand Down

0 comments on commit 89362bb

Please sign in to comment.