Skip to content

Commit

Permalink
http-client-java, fix bug on service version in client constructor (#…
Browse files Browse the repository at this point in the history
…5616)

code change
039787f

later it is unified with branded DPG logic
fc5eb95
  • Loading branch information
weidongxu-microsoft authored Jan 15, 2025
1 parent 1381733 commit 658553b
Show file tree
Hide file tree
Showing 47 changed files with 90 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public ApiKeyClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(ApiKeyClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public CustomClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(CustomClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public PropertiesImpl getProperties() {
* @param endpoint Service host.
*/
public NumericClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.properties = new PropertiesImpl(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public ImplicitBodiesImpl getImplicitBodies() {
* @param endpoint Service host.
*/
public BasicClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.explicitBodies = new ExplicitBodiesImpl(this);
this.implicitBodies = new ImplicitBodiesImpl(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ public OptionalExplicitsImpl getOptionalExplicits() {
* @param endpoint Service host.
*/
public BodyOptionalityClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.optionalExplicits = new OptionalExplicitsImpl(this);
this.service = RestProxy.create(BodyOptionalityClientService.class, this.httpPipeline);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public HeadersImpl getHeaders() {
* @param endpoint Service host.
*/
public CollectionFormatClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.queries = new QueriesImpl(this);
this.headers = new HeadersImpl(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public AliasImpl getAlias() {
* @param endpoint Service host.
*/
public SpreadClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.models = new ModelsImpl(this);
this.alias = new AliasImpl(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public DifferentBodiesImpl getDifferentBodies() {
* @param endpoint Service host.
*/
public ContentNegotiationClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.sameBodies = new SameBodiesImpl(this);
this.differentBodies = new DifferentBodiesImpl(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public JsonMergePatchClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(JsonMergePatchClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public StringBodiesImpl getStringBodies() {
* @param endpoint Service host.
*/
public MediaTypeClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.stringBodies = new StringBodiesImpl(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public FormDataHttpPartsNonStringsImpl getFormDataHttpPartsNonStrings() {
* @param endpoint Service host.
*/
public MultiPartClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.formDatas = new FormDatasImpl(this);
this.formDataHttpParts = new FormDataHttpPartsImpl(this);
this.formDataHttpPartsContentTypes = new FormDataHttpPartsContentTypesImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public ServerDrivenPaginationsImpl getServerDrivenPaginations() {
* @param endpoint Service host.
*/
public PageableClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.serverDrivenPaginations = new ServerDrivenPaginationsImpl(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ public InInterfacesImpl getInInterfaces() {
* @param endpoint Service host.
*/
public RoutesClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.pathParameters = new PathParametersImpl(this);
this.pathParametersReservedExpansions = new PathParametersReservedExpansionsImpl(this);
this.pathParametersSimpleExpansionStandards = new PathParametersSimpleExpansionStandardsImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public PropertiesImpl getProperties() {
* @param endpoint Service host.
*/
public JsonClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.properties = new PropertiesImpl(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public NotDefinedClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = endpoint;
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(NotDefinedClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ public HttpPipeline getHttpPipeline() {
* @param serviceVersion Service version.
*/
public MultipleClientImpl(HttpPipeline httpPipeline, String endpoint, MultipleServiceVersion serviceVersion) {
this.endpoint = endpoint;
this.serviceVersion = MultipleServiceVersion.getLatest();
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.serviceVersion = serviceVersion;
this.service = RestProxy.create(MultipleClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Need to be set as 'http://localhost:3000' in client.
*/
public SingleClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = endpoint;
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(SingleClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Need to be set as 'http://localhost:3000' in client.
*/
public NotVersionedClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = endpoint;
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(NotVersionedClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public HttpPipeline getHttpPipeline() {
* @param serviceVersion Service version.
*/
public VersionedClientImpl(HttpPipeline httpPipeline, String endpoint, VersionedServiceVersion serviceVersion) {
this.endpoint = endpoint;
this.serviceVersion = VersionedServiceVersion.getLatest();
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.serviceVersion = serviceVersion;
this.service = RestProxy.create(VersionedClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public ParametersImpl getParameters() {
* @param endpoint Service host.
*/
public SpecialWordsClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.models = new ModelsImpl(this);
this.modelProperties = new ModelPropertiesImpl(this);
this.operations = new OperationsImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ public NullableModelValuesImpl getNullableModelValues() {
* @param endpoint Service host.
*/
public ArrayClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.int32Values = new Int32ValuesImpl(this);
this.int64Values = new Int64ValuesImpl(this);
this.booleanValues = new BooleanValuesImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ public NullableFloatValuesImpl getNullableFloatValues() {
* @param endpoint Service host.
*/
public DictionaryClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.int32Values = new Int32ValuesImpl(this);
this.int64Values = new Int64ValuesImpl(this);
this.booleanValues = new BooleanValuesImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public StringOperationsImpl getStringOperations() {
* @param endpoint Service host.
*/
public ExtensibleClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.stringOperations = new StringOperationsImpl(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public StringOperationsImpl getStringOperations() {
* @param endpoint Service host.
*/
public FixedClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.stringOperations = new StringOperationsImpl(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public EmptyClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(EmptyClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public EnumDiscriminatorClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(EnumDiscriminatorClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public NestedDiscriminatorClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(NestedDiscriminatorClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public NotDiscriminatedClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(NotDiscriminatedClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public RecursiveClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(RecursiveClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public SingleDiscriminatorClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(SingleDiscriminatorClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public UsageClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(UsageClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public HttpPipeline getHttpPipeline() {
* @param endpoint Service host.
*/
public VisibilityClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.service = RestProxy.create(VisibilityClientService.class, this.httpPipeline);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ public SpreadRecordNonDiscriminatedUnion3sImpl getSpreadRecordNonDiscriminatedUn
* @param endpoint Service host.
*/
public AdditionalPropertiesClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.extendsUnknowns = new ExtendsUnknownsImpl(this);
this.extendsUnknownDeriveds = new ExtendsUnknownDerivedsImpl(this);
this.extendsUnknownDiscriminateds = new ExtendsUnknownDiscriminatedsImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ public CollectionsStringsImpl getCollectionsStrings() {
* @param endpoint Service host.
*/
public NullableClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.stringOperations = new StringOperationsImpl(this);
this.bytes = new BytesImpl(this);
this.datetimeOperations = new DatetimeOperationsImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ public RequiredAndOptionalsImpl getRequiredAndOptionals() {
* @param endpoint Service host.
*/
public OptionalClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.stringOperations = new StringOperationsImpl(this);
this.bytes = new BytesImpl(this);
this.datetimeOperations = new DatetimeOperationsImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,8 @@ public UnionEnumValuesImpl getUnionEnumValues() {
* @param endpoint Service host.
*/
public ValueTypesClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.booleanOperations = new BooleanOperationsImpl(this);
this.stringOperations = new StringOperationsImpl(this);
this.bytes = new BytesImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ public Decimal128VerifiesImpl getDecimal128Verifies() {
* @param endpoint Service host.
*/
public ScalarClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.stringOperations = new StringOperationsImpl(this);
this.booleanOperations = new BooleanOperationsImpl(this);
this.unknowns = new UnknownsImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ public MixedTypesImpl getMixedTypes() {
* @param endpoint Service host.
*/
public UnionClientImpl(HttpPipeline httpPipeline, String endpoint) {
this.endpoint = "http://localhost:3000";
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.stringsOnlies = new StringsOnliesImpl(this);
this.stringExtensibles = new StringExtensiblesImpl(this);
this.stringExtensibleNameds = new StringExtensibleNamedsImpl(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ public InterfaceV2sImpl getInterfaceV2s() {
*/
public AddedClientImpl(HttpPipeline httpPipeline, String endpoint, Versions version,
AddedServiceVersion serviceVersion) {
this.httpPipeline = httpPipeline;
this.endpoint = endpoint;
this.version = version;
this.serviceVersion = AddedServiceVersion.getLatest();
this.httpPipeline = httpPipeline;
this.serviceVersion = serviceVersion;
this.interfaceV2s = new InterfaceV2sImpl(this);
this.service = RestProxy.create(AddedClientService.class, this.httpPipeline);
}
Expand Down
Loading

0 comments on commit 658553b

Please sign in to comment.