diff --git a/sdk/cognitiveservices/azure-cognitiveservices-face/CHANGELOG.md b/sdk/cognitiveservices/azure-cognitiveservices-face/CHANGELOG.md new file mode 100644 index 0000000000000..d291b773784bc --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-face/CHANGELOG.md @@ -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 diff --git a/sdk/cognitiveservices/azure-cognitiveservices-face/README.md b/sdk/cognitiveservices/azure-cognitiveservices-face/README.md new file mode 100644 index 0000000000000..6df080a259f76 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-face/README.md @@ -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 + + com.azure + azure-cognitiveservices-face + 1.0.0-beta.1 + +``` +[//]: # ({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 + + +[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 diff --git a/sdk/cognitiveservices/azure-cognitiveservices-face/pom.xml b/sdk/cognitiveservices/azure-cognitiveservices-face/pom.xml new file mode 100644 index 0000000000000..d796d76bbbd72 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-face/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-cognitiveservices-face + 1.0.0-beta.1 + jar + + Microsoft Azure SDK for FaceClient Management + This package contains Microsoft Azure FaceClient client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.25.0 + + + com.azure + azure-core-http-netty + 1.11.7 + + + org.junit.jupiter + junit-jupiter-engine + 5.8.2 + test + + + com.azure + azure-core-test + 1.7.8 + test + + + com.azure + azure-identity + 1.4.4 + test + + + diff --git a/sdk/cognitiveservices/azure-cognitiveservices-face/src/samples/java/com/azure/cognitiveservices/face/ReadmeSamples.java b/sdk/cognitiveservices/azure-cognitiveservices-face/src/samples/java/com/azure/cognitiveservices/face/ReadmeSamples.java new file mode 100644 index 0000000000000..122da82b617c9 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-face/src/samples/java/com/azure/cognitiveservices/face/ReadmeSamples.java @@ -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 + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-face/src/test/java/com/azure/cognitiveservices/face/ClientTests.java b/sdk/cognitiveservices/azure-cognitiveservices-face/src/test/java/com/azure/cognitiveservices/face/ClientTests.java new file mode 100644 index 0000000000000..c3bae94996ea9 --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-face/src/test/java/com/azure/cognitiveservices/face/ClientTests.java @@ -0,0 +1,152 @@ +// 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; + +import com.azure.core.http.HttpClient; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestBase; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.DoNotRecord; +import com.azure.core.util.Configuration; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +public final class ClientTests extends TestBase { + private FaceClient faceClient; + + private PersonGroupPersonClient personGroupPersonClient; + + private PersonGroupClient personGroupClient; + + private FaceListClient faceListClient; + + private LargePersonGroupPersonClient largePersonGroupPersonClient; + + private LargePersonGroupClient largePersonGroupClient; + + private LargeFaceListClient largeFaceListClient; + + private SnapshotClient snapshotClient; + + private PersonDirectoryClient personDirectoryClient; + + @BeforeEach + public void setup() { + FaceClientBuilder faceClientbuilder = + new FaceClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + faceClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + faceClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + faceClient = faceClientbuilder.buildClient(); + + PersonGroupPersonClientBuilder personGroupPersonClientbuilder = + new PersonGroupPersonClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + personGroupPersonClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + personGroupPersonClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + personGroupPersonClient = personGroupPersonClientbuilder.buildClient(); + + PersonGroupClientBuilder personGroupClientbuilder = + new PersonGroupClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + personGroupClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + personGroupClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + personGroupClient = personGroupClientbuilder.buildClient(); + + FaceListClientBuilder faceListClientbuilder = + new FaceListClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + faceListClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + faceListClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + faceListClient = faceListClientbuilder.buildClient(); + + LargePersonGroupPersonClientBuilder largePersonGroupPersonClientbuilder = + new LargePersonGroupPersonClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + largePersonGroupPersonClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + largePersonGroupPersonClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + largePersonGroupPersonClient = largePersonGroupPersonClientbuilder.buildClient(); + + LargePersonGroupClientBuilder largePersonGroupClientbuilder = + new LargePersonGroupClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + largePersonGroupClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + largePersonGroupClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + largePersonGroupClient = largePersonGroupClientbuilder.buildClient(); + + LargeFaceListClientBuilder largeFaceListClientbuilder = + new LargeFaceListClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + largeFaceListClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + largeFaceListClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + largeFaceListClient = largeFaceListClientbuilder.buildClient(); + + SnapshotClientBuilder snapshotClientbuilder = + new SnapshotClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + snapshotClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + snapshotClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + snapshotClient = snapshotClientbuilder.buildClient(); + + PersonDirectoryClientBuilder personDirectoryClientbuilder = + new PersonDirectoryClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT")) + .httpClient(HttpClient.createDefault()) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + personDirectoryClientbuilder.httpClient(interceptorManager.getPlaybackClient()); + } else if (getTestMode() == TestMode.RECORD) { + personDirectoryClientbuilder.addPolicy(interceptorManager.getRecordPolicy()); + } + personDirectoryClient = personDirectoryClientbuilder.buildClient(); + } + + @Test + @DoNotRecord(skipInPlayback = true) + public void testClient() { + // use the builder to create client + } +} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-face/swagger/README_SPEC.md b/sdk/cognitiveservices/azure-cognitiveservices-face/swagger/README_SPEC.md new file mode 100644 index 0000000000000..7356f61db6b9d --- /dev/null +++ b/sdk/cognitiveservices/azure-cognitiveservices-face/swagger/README_SPEC.md @@ -0,0 +1,27 @@ +## Generate autorest code + +```yaml +input-files: + - /home/vsts/work/1/s/azure-rest-api-specs/specification/cognitiveservices/data-plane/Face/preview/v1.0-preview/Face.json +output-folder: ../ +java: true +regenerate-pom: false +partial-update: true +generate-sync-async-clients: true +generate-client-as-impl: true +generate-client-interfaces: false +generate-builder-per-client: true +add-context-parameter: true +artifact-id: azure-cognitiveservices-face +low-level-client: true +sync-methods: all +generate-samples: true +license-header: MICROSOFT_MIT_SMALL +namespace: com.azure.cognitiveservices.face +context-client-method-parameter: true +azure-arm: false +service-versions: + - 1.0-preview +input-file: + - ../azure-rest-api-specs/specification/cognitiveservices/data-plane/Face/stable/v1.0/Face.json +```