diff --git a/docs/ActivityPub.md b/docs/ActivityPub.md new file mode 100644 index 0000000..8b7e723 --- /dev/null +++ b/docs/ActivityPub.md @@ -0,0 +1,6 @@ +# ActivityPub + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_atContext** | **String** | | [optional] diff --git a/docs/ActivitypubApi.md b/docs/ActivitypubApi.md new file mode 100644 index 0000000..4e6cbfc --- /dev/null +++ b/docs/ActivitypubApi.md @@ -0,0 +1,183 @@ +# ActivitypubApi + +All URIs are relative to *http://{{AppSubUrl | JSEscape | Safe}}/api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**activitypubPerson**](ActivitypubApi.md#activitypubPerson) | **GET** activitypub/user/{username} | Returns the Person actor for a user +[**activitypubPersonInbox**](ActivitypubApi.md#activitypubPersonInbox) | **POST** activitypub/user/{username}/inbox | Send to the inbox + + +# **activitypubPerson** +> ActivityPub activitypubPerson(username) + +Returns the Person actor for a user + +### Example +```java +// Import classes: +//import org.gitnex.tea4j.v2.ApiClient; +//import org.gitnex.tea4j.v2.ApiException; +//import org.gitnex.tea4j.v2.Configuration; +//import org.gitnex.tea4j.v2.auth.*; +//import org.gitnex.tea4j.v2.apis.ActivitypubApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: AccessToken +ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken"); +AccessToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AccessToken.setApiKeyPrefix("Token"); + +// Configure API key authorization: AuthorizationHeaderToken +ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken"); +AuthorizationHeaderToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AuthorizationHeaderToken.setApiKeyPrefix("Token"); +// Configure HTTP basic authorization: BasicAuth +HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); +BasicAuth.setUsername("YOUR USERNAME"); +BasicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: SudoHeader +ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader"); +SudoHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: SudoParam +ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam"); +SudoParam.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoParam.setApiKeyPrefix("Token"); + +// Configure API key authorization: TOTPHeader +ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader"); +TOTPHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//TOTPHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: Token +ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token"); +Token.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//Token.setApiKeyPrefix("Token"); + +ActivitypubApi apiInstance = new ActivitypubApi(); +String username = "username_example"; // String | username of the user +try { + ActivityPub result = apiInstance.activitypubPerson(username); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ActivitypubApi#activitypubPerson"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of the user | + +### Return type + +[**ActivityPub**](ActivityPub.md) + +### Authorization + +[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **activitypubPersonInbox** +> Void activitypubPersonInbox(username) + +Send to the inbox + +### Example +```java +// Import classes: +//import org.gitnex.tea4j.v2.ApiClient; +//import org.gitnex.tea4j.v2.ApiException; +//import org.gitnex.tea4j.v2.Configuration; +//import org.gitnex.tea4j.v2.auth.*; +//import org.gitnex.tea4j.v2.apis.ActivitypubApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure API key authorization: AccessToken +ApiKeyAuth AccessToken = (ApiKeyAuth) defaultClient.getAuthentication("AccessToken"); +AccessToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AccessToken.setApiKeyPrefix("Token"); + +// Configure API key authorization: AuthorizationHeaderToken +ApiKeyAuth AuthorizationHeaderToken = (ApiKeyAuth) defaultClient.getAuthentication("AuthorizationHeaderToken"); +AuthorizationHeaderToken.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//AuthorizationHeaderToken.setApiKeyPrefix("Token"); +// Configure HTTP basic authorization: BasicAuth +HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth"); +BasicAuth.setUsername("YOUR USERNAME"); +BasicAuth.setPassword("YOUR PASSWORD"); + +// Configure API key authorization: SudoHeader +ApiKeyAuth SudoHeader = (ApiKeyAuth) defaultClient.getAuthentication("SudoHeader"); +SudoHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: SudoParam +ApiKeyAuth SudoParam = (ApiKeyAuth) defaultClient.getAuthentication("SudoParam"); +SudoParam.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//SudoParam.setApiKeyPrefix("Token"); + +// Configure API key authorization: TOTPHeader +ApiKeyAuth TOTPHeader = (ApiKeyAuth) defaultClient.getAuthentication("TOTPHeader"); +TOTPHeader.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//TOTPHeader.setApiKeyPrefix("Token"); + +// Configure API key authorization: Token +ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token"); +Token.setApiKey("YOUR API KEY"); +// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) +//Token.setApiKeyPrefix("Token"); + +ActivitypubApi apiInstance = new ActivitypubApi(); +String username = "username_example"; // String | username of the user +try { + Void result = apiInstance.activitypubPersonInbox(username); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling ActivitypubApi#activitypubPersonInbox"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **String**| username of the user | + +### Return type + +[**Void**](.md) + +### Authorization + +[AccessToken](../README.md#AccessToken)[AuthorizationHeaderToken](../README.md#AuthorizationHeaderToken)[BasicAuth](../README.md#BasicAuth)[SudoHeader](../README.md#SudoHeader)[SudoParam](../README.md#SudoParam)[TOTPHeader](../README.md#TOTPHeader)[Token](../README.md#Token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/ActivitypubApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/ActivitypubApi.java new file mode 100644 index 0000000..220b3c5 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/apis/ActivitypubApi.java @@ -0,0 +1,26 @@ +package org.gitnex.tea4j.v2.apis; + +import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.ActivityPub; +import retrofit2.Call; +import retrofit2.http.*; + +public interface ActivitypubApi { + /** + * Returns the Person actor for a user + * + * @param username username of the user (required) + * @return Call<ActivityPub> + */ + @GET("activitypub/user/{username}") + Call activitypubPerson(@retrofit2.http.Path("username") String username); + + /** + * Send to the inbox + * + * @param username username of the user (required) + * @return Call<Void> + */ + @POST("activitypub/user/{username}/inbox") + Call activitypubPersonInbox(@retrofit2.http.Path("username") String username); +} diff --git a/src/main/java/org/gitnex/tea4j/v2/models/ActivityPub.java b/src/main/java/org/gitnex/tea4j/v2/models/ActivityPub.java new file mode 100644 index 0000000..110a06c --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/ActivityPub.java @@ -0,0 +1,83 @@ +/* + * Gitea API. + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape | Safe}} + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package org.gitnex.tea4j.v2.models; + +import com.google.gson.annotations.SerializedName; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.Serializable; +import java.util.Objects; + +/** ActivityPub type */ +@Schema(description = "ActivityPub type") +public class ActivityPub implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("@context") + private String _atContext = null; + + public ActivityPub _atContext(String _atContext) { + this._atContext = _atContext; + return this; + } + + /** + * Get _atContext + * + * @return _atContext + */ + @Schema(description = "") + public String getAtContext() { + return _atContext; + } + + public void setAtContext(String _atContext) { + this._atContext = _atContext; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActivityPub activityPub = (ActivityPub) o; + return Objects.equals(this._atContext, activityPub._atContext); + } + + @Override + public int hashCode() { + return Objects.hash(_atContext); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActivityPub {\n"); + + sb.append(" _atContext: ").append(toIndentedString(_atContext)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +}