-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix-parameter-name-issue
- Loading branch information
Showing
81 changed files
with
1,502 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: internal | ||
packages: | ||
- typespec-vscode | ||
--- | ||
|
||
remove vscode settings for code generation |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@typespec/compiler" | ||
- typespec-vscode | ||
--- | ||
|
||
Support Emitters section in Init Template when creating TypeSpec project in vscode |
This file was deleted.
Oops, something went wrong.
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
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
...ttp-client-generator-clientcore-test/src/main/java/authentication/oauth2/InvalidAuth.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 authentication.oauth2; | ||
|
||
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 InvalidAuth model. | ||
*/ | ||
@Metadata(conditions = { TypeConditions.IMMUTABLE }) | ||
public final class InvalidAuth implements JsonSerializable<InvalidAuth> { | ||
/* | ||
* The error property. | ||
*/ | ||
@Metadata(generated = true) | ||
private final String error; | ||
|
||
/** | ||
* Creates an instance of InvalidAuth class. | ||
* | ||
* @param error the error value to set. | ||
*/ | ||
@Metadata(generated = true) | ||
private InvalidAuth(String error) { | ||
this.error = error; | ||
} | ||
|
||
/** | ||
* Get the error property: The error property. | ||
* | ||
* @return the error value. | ||
*/ | ||
@Metadata(generated = true) | ||
public String getError() { | ||
return this.error; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Metadata(generated = true) | ||
@Override | ||
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { | ||
jsonWriter.writeStartObject(); | ||
jsonWriter.writeStringField("error", this.error); | ||
return jsonWriter.writeEndObject(); | ||
} | ||
|
||
/** | ||
* Reads an instance of InvalidAuth from the JsonReader. | ||
* | ||
* @param jsonReader The JsonReader being read. | ||
* @return An instance of InvalidAuth 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 InvalidAuth. | ||
*/ | ||
@Metadata(generated = true) | ||
public static InvalidAuth fromJson(JsonReader jsonReader) throws IOException { | ||
return jsonReader.readObject(reader -> { | ||
String error = null; | ||
while (reader.nextToken() != JsonToken.END_OBJECT) { | ||
String fieldName = reader.getFieldName(); | ||
reader.nextToken(); | ||
|
||
if ("error".equals(fieldName)) { | ||
error = reader.getString(); | ||
} else { | ||
reader.skipChildren(); | ||
} | ||
} | ||
return new InvalidAuth(error); | ||
}); | ||
} | ||
} |
79 changes: 79 additions & 0 deletions
79
...tp-client-generator-clientcore-test/src/main/java/authentication/oauth2/OAuth2Client.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,79 @@ | ||
// Code generated by Microsoft (R) TypeSpec Code Generator. | ||
|
||
package authentication.oauth2; | ||
|
||
import authentication.oauth2.implementation.OAuth2ClientImpl; | ||
import io.clientcore.core.annotation.Metadata; | ||
import io.clientcore.core.annotation.ServiceClient; | ||
import io.clientcore.core.http.exception.HttpResponseException; | ||
import io.clientcore.core.http.models.RequestOptions; | ||
import io.clientcore.core.http.models.Response; | ||
|
||
/** | ||
* Initializes a new instance of the synchronous OAuth2Client type. | ||
*/ | ||
@ServiceClient(builder = OAuth2ClientBuilder.class) | ||
public final class OAuth2Client { | ||
@Metadata(generated = true) | ||
private final OAuth2ClientImpl serviceClient; | ||
|
||
/** | ||
* Initializes an instance of OAuth2Client class. | ||
* | ||
* @param serviceClient the service client implementation. | ||
*/ | ||
@Metadata(generated = true) | ||
OAuth2Client(OAuth2ClientImpl serviceClient) { | ||
this.serviceClient = serviceClient; | ||
} | ||
|
||
/** | ||
* Check whether client is authenticated. | ||
* | ||
* @param requestOptions The options to configure the HTTP request before HTTP client sends it. | ||
* @throws HttpResponseException thrown if the service returns an error. | ||
* @return the response. | ||
*/ | ||
@Metadata(generated = true) | ||
public Response<Void> validWithResponse(RequestOptions requestOptions) { | ||
return this.serviceClient.validWithResponse(requestOptions); | ||
} | ||
|
||
/** | ||
* Check whether client is authenticated. Will return an invalid bearer error. | ||
* | ||
* @param requestOptions The options to configure the HTTP request before HTTP client sends it. | ||
* @throws HttpResponseException thrown if the service returns an error. | ||
* @return the response. | ||
*/ | ||
@Metadata(generated = true) | ||
public Response<Void> invalidWithResponse(RequestOptions requestOptions) { | ||
return this.serviceClient.invalidWithResponse(requestOptions); | ||
} | ||
|
||
/** | ||
* Check whether client is authenticated. | ||
* | ||
* @throws HttpResponseException thrown if the service returns an error. | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. | ||
*/ | ||
@Metadata(generated = true) | ||
public void valid() { | ||
// Generated convenience method for validWithResponse | ||
RequestOptions requestOptions = new RequestOptions(); | ||
validWithResponse(requestOptions).getValue(); | ||
} | ||
|
||
/** | ||
* Check whether client is authenticated. Will return an invalid bearer error. | ||
* | ||
* @throws HttpResponseException thrown if the service returns an error. | ||
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. | ||
*/ | ||
@Metadata(generated = true) | ||
public void invalid() { | ||
// Generated convenience method for invalidWithResponse | ||
RequestOptions requestOptions = new RequestOptions(); | ||
invalidWithResponse(requestOptions).getValue(); | ||
} | ||
} |
Oops, something went wrong.