Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-cognitiveservices-face] Dev/markonikolic/aliasswagger #12913

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions sdk/cognitiveservices/azure-cognitiveservices-face/CHANGELOG.md
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 sdk/cognitiveservices/azure-cognitiveservices-face/README.md
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
73 changes: 73 additions & 0 deletions sdk/cognitiveservices/azure-cognitiveservices-face/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<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:git@github.com:Azure/azure-sdk-for-java.git</connection>
<developerConnection>scm:git:git@github.com: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>
</properties>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.25.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.11.7</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.2</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.8</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.4</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
<scope>test</scope>
</dependency>
</dependencies>
</project>
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
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
Original file line number Diff line number Diff line change
@@ -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
```