forked from microsoft/typespec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http-client-java, compiler 0.65 (microsoft#5966)
update for 0.65/0.51 added some tests microsoft@fc614b9 improve handling of `ApiVersion` when it is not named as `api-version` microsoft@0b24fa4 integration PR Azure/autorest.java#3025
- Loading branch information
1 parent
da4cfd5
commit f71a98c
Showing
272 changed files
with
7,579 additions
and
1,478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
...client-generator-clientcore-test/src/main/java/response/statuscoderange/DefaultError.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package response.statuscoderange; | ||
|
||
import io.clientcore.core.annotation.Metadata; | ||
import io.clientcore.core.annotation.TypeConditions; | ||
import io.clientcore.core.serialization.json.JsonReader; | ||
import io.clientcore.core.serialization.json.JsonSerializable; | ||
import io.clientcore.core.serialization.json.JsonToken; | ||
import io.clientcore.core.serialization.json.JsonWriter; | ||
import java.io.IOException; | ||
|
||
/** | ||
* The DefaultError model. | ||
*/ | ||
@Metadata(conditions = { TypeConditions.IMMUTABLE }) | ||
public final class DefaultError implements JsonSerializable<DefaultError> { | ||
/* | ||
* The code property. | ||
*/ | ||
@Metadata(generated = true) | ||
private final String code; | ||
|
||
/** | ||
* Creates an instance of DefaultError class. | ||
* | ||
* @param code the code value to set. | ||
*/ | ||
@Metadata(generated = true) | ||
private DefaultError(String code) { | ||
this.code = code; | ||
} | ||
|
||
/** | ||
* Get the code property: The code property. | ||
* | ||
* @return the code value. | ||
*/ | ||
@Metadata(generated = true) | ||
public String getCode() { | ||
return this.code; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Metadata(generated = true) | ||
@Override | ||
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { | ||
jsonWriter.writeStartObject(); | ||
jsonWriter.writeStringField("code", this.code); | ||
return jsonWriter.writeEndObject(); | ||
} | ||
|
||
/** | ||
* Reads an instance of DefaultError from the JsonReader. | ||
* | ||
* @param jsonReader The JsonReader being read. | ||
* @return An instance of DefaultError if the JsonReader was pointing to an instance of it, or null if it was | ||
* pointing to JSON null. | ||
* @throws IllegalStateException If the deserialized JSON object was missing any required properties. | ||
* @throws IOException If an error occurs while reading the DefaultError. | ||
*/ | ||
@Metadata(generated = true) | ||
public static DefaultError fromJson(JsonReader jsonReader) throws IOException { | ||
return jsonReader.readObject(reader -> { | ||
String code = null; | ||
while (reader.nextToken() != JsonToken.END_OBJECT) { | ||
String fieldName = reader.getFieldName(); | ||
reader.nextToken(); | ||
|
||
if ("code".equals(fieldName)) { | ||
code = reader.getString(); | ||
} else { | ||
reader.skipChildren(); | ||
} | ||
} | ||
return new DefaultError(code); | ||
}); | ||
} | ||
} |
Oops, something went wrong.