forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 16846 in Azure/azure-rest-api-specs
Fix flipped order in Face generated models (Azure#16846) * Fix flipped order in Face generated models The recent change changing a nested parameter from optional to required caused the AutoRest generated model to have a reversed order of two string arguments. Expanding the nesting for affected models to avoid breaking changes. * Fix malformatted examples
- Loading branch information
SDKAuto
committed
Jan 5, 2022
1 parent
524055c
commit caab409
Showing
82 changed files
with
2,233 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
sdk/cognitiveservices/azure-cognitiveservices-Face/CHANGELOG.md
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,13 @@ | ||
# Release History | ||
|
||
## 1.0.0-beta.1 (Unreleased) | ||
|
||
- Azure FaceClient client library for Java. This package contains Microsoft Azure FaceClient client library. | ||
|
||
### Features Added | ||
|
||
### Breaking Changes | ||
|
||
### Bugs Fixed | ||
|
||
### Other Changes |
63 changes: 63 additions & 0 deletions
63
sdk/cognitiveservices/azure-cognitiveservices-Face/README.md
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,63 @@ | ||
# Azure FaceClient client library for Java | ||
|
||
Azure FaceClient client library for Java. | ||
|
||
This package contains Microsoft Azure FaceClient client library. | ||
|
||
## Documentation | ||
|
||
Various documentation is available to help you get started | ||
|
||
- [API reference documentation][docs] | ||
- [Product documentation][product_documentation] | ||
|
||
## Getting started | ||
|
||
### Prerequisites | ||
|
||
- [Java Development Kit (JDK)][jdk] with version 8 or above | ||
- [Azure Subscription][azure_subscription] | ||
|
||
### Adding the package to your product | ||
|
||
[//]: # ({x-version-update-start;com.azure:azure-cognitiveservices-Face;current}) | ||
```xml | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-cognitiveservices-Face</artifactId> | ||
<version>1.0.0-beta.1</version> | ||
</dependency> | ||
``` | ||
[//]: # ({x-version-update-end}) | ||
|
||
### Authentication | ||
|
||
[Azure Identity][azure_identity] package provides the default implementation for authenticating the client. | ||
|
||
## Key concepts | ||
|
||
## Examples | ||
|
||
```java com.azure.cognitiveservices.face.readme | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
## Next steps | ||
|
||
## Contributing | ||
|
||
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). | ||
|
||
1. Fork it | ||
1. Create your feature branch (`git checkout -b my-new-feature`) | ||
1. Commit your changes (`git commit -am 'Add some feature'`) | ||
1. Push to the branch (`git push origin my-new-feature`) | ||
1. Create new Pull Request | ||
|
||
<!-- LINKS --> | ||
[product_documentation]: https://azure.microsoft.com/services/ | ||
[docs]: https://azure.github.io/azure-sdk-for-java/ | ||
[jdk]: https://docs.microsoft.com/java/azure/jdk/ | ||
[azure_subscription]: https://azure.microsoft.com/free/ | ||
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity |
76 changes: 76 additions & 0 deletions
76
sdk/cognitiveservices/azure-cognitiveservices-Face/pom.xml
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,76 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-client-sdk-parent</artifactId> | ||
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} --> | ||
<relativePath>../../parents/azure-client-sdk-parent</relativePath> | ||
</parent> | ||
|
||
<groupId>com.azure</groupId> | ||
<artifactId>azure-cognitiveservices-Face</artifactId> | ||
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-cognitiveservices-Face;current} --> | ||
<packaging>jar</packaging> | ||
|
||
<name>Microsoft Azure SDK for FaceClient Management</name> | ||
<description>This package contains Microsoft Azure FaceClient client library.</description> | ||
<url>https://github.com/Azure/azure-sdk-for-java</url> | ||
|
||
<licenses> | ||
<license> | ||
<name>The MIT License (MIT)</name> | ||
<url>http://opensource.org/licenses/MIT</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<scm> | ||
<url>https://github.com/Azure/azure-sdk-for-java</url> | ||
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection> | ||
<developerConnection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</developerConnection> | ||
<tag>HEAD</tag> | ||
</scm> | ||
<developers> | ||
<developer> | ||
<id>microsoft</id> | ||
<name>Microsoft</name> | ||
</developer> | ||
</developers> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<jacoco.skip>true</jacoco.skip> | ||
<codesnippet.skip>false</codesnippet.skip> | ||
<javadocDoclet></javadocDoclet> | ||
<javadocDocletOptions></javadocDocletOptions> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-core</artifactId> | ||
<version>1.23.1</version> <!-- {x-version-update;com.azure:azure-core;dependency} --> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-core-http-netty</artifactId> | ||
<version>1.11.4</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} --> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.junit.jupiter</groupId> | ||
<artifactId>junit-jupiter-engine</artifactId> | ||
<version>5.8.1</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} --> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-core-test</artifactId> | ||
<version>1.7.5</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} --> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.azure</groupId> | ||
<artifactId>azure-identity</artifactId> | ||
<version>1.4.2</version> <!-- {x-version-update;com.azure:azure-identity;dependency} --> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
12 changes: 12 additions & 0 deletions
12
...gnitiveservices-Face/src/samples/java/com/azure/cognitiveservices/face/ReadmeSamples.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,12 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face; | ||
|
||
public final class ReadmeSamples { | ||
public void readmeSamples() { | ||
// BEGIN: com.azure.cognitiveservices.face.readme | ||
// END: com.azure.cognitiveservices.face.readme | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...s/java/com/azure/cognitiveservices/face/generated/AddFaceToFaceListFromStreamExample.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,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face.generated; | ||
|
||
import com.azure.cognitiveservices.face.FaceClientBuilder; | ||
import com.azure.cognitiveservices.face.FaceListClient; | ||
import com.azure.core.http.rest.RequestOptions; | ||
import com.azure.core.http.rest.Response; | ||
import com.azure.core.util.BinaryData; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class AddFaceToFaceListFromStreamExample { | ||
public static void main(String[] args) { | ||
FaceListClient client = | ||
new FaceClientBuilder() | ||
.credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint("{Endpoint}") | ||
.buildFaceListClient(); | ||
BinaryData Image = BinaryData.fromString("\"{Image stream in base 64 encoded format}\""); | ||
RequestOptions requestOptions = new RequestOptions(); | ||
requestOptions.addQueryParam("userData", "{Customized user data}"); | ||
requestOptions.addQueryParam("targetFace", "10,10,100,100"); | ||
requestOptions.addQueryParam("detectionModel", "detection_01"); | ||
Response<BinaryData> response = client.addFaceFromStreamWithResponse("sample_face_list", Image, requestOptions); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...a/com/azure/cognitiveservices/face/generated/AddFaceToLargeFaceListFromStreamExample.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,28 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face.generated; | ||
|
||
import com.azure.cognitiveservices.face.FaceClientBuilder; | ||
import com.azure.cognitiveservices.face.LargeFaceListClient; | ||
import com.azure.core.http.rest.RequestOptions; | ||
import com.azure.core.http.rest.Response; | ||
import com.azure.core.util.BinaryData; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class AddFaceToLargeFaceListFromStreamExample { | ||
public static void main(String[] args) { | ||
LargeFaceListClient client = | ||
new FaceClientBuilder() | ||
.credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint("{Endpoint}") | ||
.buildLargeFaceListClient(); | ||
BinaryData Image = BinaryData.fromString("\"{Image stream in base 64 encoded format}\""); | ||
RequestOptions requestOptions = new RequestOptions(); | ||
requestOptions.addQueryParam("userData", "{Customized user data}"); | ||
requestOptions.addQueryParam("targetFace", "10,10,100,100"); | ||
requestOptions.addQueryParam("detectionModel", "detection_01"); | ||
Response<BinaryData> response = client.addFaceFromStreamWithResponse("sample_face_list", Image, requestOptions); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ure/cognitiveservices/face/generated/AddFaceToPersonDirectoryPersonWithStreamExample.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,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face.generated; | ||
|
||
import com.azure.cognitiveservices.face.FaceClientBuilder; | ||
import com.azure.cognitiveservices.face.PersonDirectoryClient; | ||
import com.azure.core.http.rest.RequestOptions; | ||
import com.azure.core.http.rest.Response; | ||
import com.azure.core.util.BinaryData; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class AddFaceToPersonDirectoryPersonWithStreamExample { | ||
public static void main(String[] args) { | ||
PersonDirectoryClient client = | ||
new FaceClientBuilder() | ||
.credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint("{Endpoint}") | ||
.buildPersonDirectoryClient(); | ||
BinaryData Image = BinaryData.fromString("\"{Image stream in base 64 encoded format}\""); | ||
RequestOptions requestOptions = new RequestOptions(); | ||
requestOptions.addQueryParam("userData", "{customized User data}"); | ||
requestOptions.addQueryParam("targetFace", "[10, 10, 100, 100]"); | ||
requestOptions.addQueryParam("detectionModel", "detection_01"); | ||
Response<BinaryData> response = | ||
client.addPersonFaceFromStreamWithResponse( | ||
"4caa25ee-3bc6-4e88-adf8-12455ce7aab0", "recognition_02", Image, requestOptions); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
...a/com/azure/cognitiveservices/face/generated/AddFaceToPersonInPersonDirectoryExample.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,29 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face.generated; | ||
|
||
import com.azure.cognitiveservices.face.FaceClientBuilder; | ||
import com.azure.cognitiveservices.face.PersonDirectoryClient; | ||
import com.azure.core.http.rest.RequestOptions; | ||
import com.azure.core.http.rest.Response; | ||
import com.azure.core.util.BinaryData; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class AddFaceToPersonInPersonDirectoryExample { | ||
public static void main(String[] args) { | ||
PersonDirectoryClient client = | ||
new FaceClientBuilder() | ||
.credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint("{Endpoint}") | ||
.buildPersonDirectoryClient(); | ||
RequestOptions requestOptions = new RequestOptions(); | ||
requestOptions.addQueryParam("userData", "{customized User data}"); | ||
requestOptions.addQueryParam("targetFace", "[10, 10, 100, 100]"); | ||
requestOptions.addQueryParam("detectionModel", "detection_01"); | ||
Response<BinaryData> response = | ||
client.addPersonFaceWithResponse( | ||
"4caa25ee-3bc6-4e88-adf8-12455ce7aab0", "recognition_02", requestOptions); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...les/java/com/azure/cognitiveservices/face/generated/AddFaceToPersonWithStreamExample.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,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face.generated; | ||
|
||
import com.azure.cognitiveservices.face.FaceClientBuilder; | ||
import com.azure.cognitiveservices.face.PersonGroupPersonClient; | ||
import com.azure.core.http.rest.RequestOptions; | ||
import com.azure.core.http.rest.Response; | ||
import com.azure.core.util.BinaryData; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class AddFaceToPersonWithStreamExample { | ||
public static void main(String[] args) { | ||
PersonGroupPersonClient client = | ||
new FaceClientBuilder() | ||
.credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint("{Endpoint}") | ||
.buildPersonGroupPersonClient(); | ||
BinaryData Image = BinaryData.fromString("\"{Image stream in base 64 encoded format}\""); | ||
RequestOptions requestOptions = new RequestOptions(); | ||
requestOptions.addQueryParam("userData", "{customized User data}"); | ||
requestOptions.addQueryParam("targetFace", "10,10,100,100"); | ||
requestOptions.addQueryParam("detectionModel", "detection_01"); | ||
Response<BinaryData> response = | ||
client.addFaceFromStreamWithResponse( | ||
"abc", "4caa25ee-3bc6-4e88-adf8-12455ce7aab0", Image, requestOptions); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ace/src/samples/java/com/azure/cognitiveservices/face/generated/AddPersonFaceExample.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,30 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face.generated; | ||
|
||
import com.azure.cognitiveservices.face.FaceClientBuilder; | ||
import com.azure.cognitiveservices.face.PersonGroupPersonClient; | ||
import com.azure.core.http.rest.RequestOptions; | ||
import com.azure.core.http.rest.Response; | ||
import com.azure.core.util.BinaryData; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class AddPersonFaceExample { | ||
public static void main(String[] args) { | ||
PersonGroupPersonClient client = | ||
new FaceClientBuilder() | ||
.credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint("{Endpoint}") | ||
.buildPersonGroupPersonClient(); | ||
BinaryData ImageUrl = BinaryData.fromString("{\"url\":\"{Image Url here}\"}"); | ||
RequestOptions requestOptions = new RequestOptions(); | ||
requestOptions.addQueryParam("userData", "{customized User data}"); | ||
requestOptions.addQueryParam("targetFace", "10,10,100,100"); | ||
requestOptions.addQueryParam("detectionModel", "detection_01"); | ||
Response<BinaryData> response = | ||
client.addFaceFromUrlWithResponse( | ||
"abc", "4caa25ee-3bc6-4e88-adf8-12455ce7aab0", ImageUrl, requestOptions); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ace/src/samples/java/com/azure/cognitiveservices/face/generated/ApplySnapshotExample.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,26 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
// Code generated by Microsoft (R) AutoRest Code Generator. | ||
|
||
package com.azure.cognitiveservices.face.generated; | ||
|
||
import com.azure.cognitiveservices.face.FaceClientBuilder; | ||
import com.azure.cognitiveservices.face.SnapshotClient; | ||
import com.azure.core.http.rest.RequestOptions; | ||
import com.azure.core.http.rest.Response; | ||
import com.azure.core.util.BinaryData; | ||
import com.azure.identity.DefaultAzureCredentialBuilder; | ||
|
||
public class ApplySnapshotExample { | ||
public static void main(String[] args) { | ||
SnapshotClient client = | ||
new FaceClientBuilder() | ||
.credential(new DefaultAzureCredentialBuilder().build()) | ||
.endpoint("{Endpoint}") | ||
.buildSnapshotClient(); | ||
BinaryData body = BinaryData.fromString("{\"mode\":\"CreateNew\",\"objectId\":\"target-face-list-id\"}"); | ||
RequestOptions requestOptions = new RequestOptions(); | ||
Response<Void> response = | ||
client.applyWithResponse("e58b3f08-1e8b-4165-81df-aa9858f233dc", body, requestOptions); | ||
} | ||
} |
Oops, something went wrong.