From 87d0953c0eaf34de0f09fe8bfcaf3c56204fd8e2 Mon Sep 17 00:00:00 2001 From: gitnexbot Date: Fri, 29 Mar 2024 00:03:56 +0000 Subject: [PATCH] Synchronizing API and documentation updates --- docs/ActionVariable.md | 9 + docs/CreateVariableOption.md | 6 + docs/OrganizationApi.md | 456 +++++++++++++++++ docs/RepositoryApi.md | 466 ++++++++++++++++++ docs/UpdateVariableOption.md | 7 + docs/UserApi.md | 446 +++++++++++++++++ .../gitnex/tea4j/v2/apis/OrganizationApi.java | 71 +++ .../gitnex/tea4j/v2/apis/RepositoryApi.java | 81 +++ .../org/gitnex/tea4j/v2/apis/UserApi.java | 58 +++ .../tea4j/v2/models/ActionVariable.java | 155 ++++++ .../tea4j/v2/models/CreateVariableOption.java | 83 ++++ .../tea4j/v2/models/UpdateVariableOption.java | 109 ++++ 12 files changed, 1947 insertions(+) create mode 100644 docs/ActionVariable.md create mode 100644 docs/CreateVariableOption.md create mode 100644 docs/UpdateVariableOption.md create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/ActionVariable.java create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/CreateVariableOption.java create mode 100644 src/main/java/org/gitnex/tea4j/v2/models/UpdateVariableOption.java diff --git a/docs/ActionVariable.md b/docs/ActionVariable.md new file mode 100644 index 0000000..51dd12b --- /dev/null +++ b/docs/ActionVariable.md @@ -0,0 +1,9 @@ +# ActionVariable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **String** | the value of the variable | [optional] +**name** | **String** | the name of the variable | [optional] +**ownerId** | **Long** | the owner to which the variable belongs | [optional] +**repoId** | **Long** | the repository to which the variable belongs | [optional] diff --git a/docs/CreateVariableOption.md b/docs/CreateVariableOption.md new file mode 100644 index 0000000..4bc49e1 --- /dev/null +++ b/docs/CreateVariableOption.md @@ -0,0 +1,6 @@ +# CreateVariableOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **String** | Value of the variable to create | diff --git a/docs/OrganizationApi.md b/docs/OrganizationApi.md index 081bef7..24ce659 100644 --- a/docs/OrganizationApi.md +++ b/docs/OrganizationApi.md @@ -6,7 +6,11 @@ Method | HTTP request | Description ------------- | ------------- | ------------- [**createOrgRepo**](OrganizationApi.md#createOrgRepo) | **POST** orgs/{org}/repos | Create a repository in an organization [**createOrgRepoDeprecated**](OrganizationApi.md#createOrgRepoDeprecated) | **POST** org/{org}/repos | Create a repository in an organization +[**createOrgVariable**](OrganizationApi.md#createOrgVariable) | **POST** orgs/{org}/actions/variables/{variablename} | Create an org-level variable [**deleteOrgSecret**](OrganizationApi.md#deleteOrgSecret) | **DELETE** orgs/{org}/actions/secrets/{secretname} | Delete a secret in an organization +[**deleteOrgVariable**](OrganizationApi.md#deleteOrgVariable) | **DELETE** orgs/{org}/actions/variables/{variablename} | Delete an org-level variable +[**getOrgVariable**](OrganizationApi.md#getOrgVariable) | **GET** orgs/{org}/actions/variables/{variablename} | Get an org-level variable +[**getOrgVariablesList**](OrganizationApi.md#getOrgVariablesList) | **GET** orgs/{org}/actions/variables | Get an org-level variables list [**orgAddTeamMember**](OrganizationApi.md#orgAddTeamMember) | **PUT** teams/{id}/members/{username} | Add a team member [**orgAddTeamRepository**](OrganizationApi.md#orgAddTeamRepository) | **PUT** teams/{id}/repos/{org}/{repo} | Add a repository to a team [**orgConcealMember**](OrganizationApi.md#orgConcealMember) | **DELETE** orgs/{org}/public_members/{username} | Conceal a user's membership @@ -58,6 +62,7 @@ Method | HTTP request | Description [**organizationUnblockUser**](OrganizationApi.md#organizationUnblockUser) | **DELETE** orgs/{org}/blocks/{username} | Unblock a user [**teamSearch**](OrganizationApi.md#teamSearch) | **GET** orgs/{org}/teams/search | Search for teams within an organization [**updateOrgSecret**](OrganizationApi.md#updateOrgSecret) | **PUT** orgs/{org}/actions/secrets/{secretname} | Create or Update a secret value in an organization +[**updateOrgVariable**](OrganizationApi.md#updateOrgVariable) | **PUT** orgs/{org}/actions/variables/{variablename} | Update an org-level variable # **createOrgRepo** @@ -237,6 +242,97 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + +# **createOrgVariable** +> Void createOrgVariable(org, variablename, body) + +Create an org-level variable + +### 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.OrganizationApi; + +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"); + +OrganizationApi apiInstance = new OrganizationApi(); +String org = "org_example"; // String | name of the organization +String variablename = "variablename_example"; // String | name of the variable +CreateVariableOption body = new CreateVariableOption(); // CreateVariableOption | +try { + Void result = apiInstance.createOrgVariable(org, variablename, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#createOrgVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **variablename** | **String**| name of the variable | + **body** | [**CreateVariableOption**](CreateVariableOption.md)| | [optional] + +### 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**: application/json + - **Accept**: Not defined + # **deleteOrgSecret** > Void deleteOrgSecret(org, secretname) @@ -326,6 +422,275 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: Not defined + +# **deleteOrgVariable** +> ActionVariable deleteOrgVariable(org, variablename) + +Delete an org-level variable + +### 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.OrganizationApi; + +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"); + +OrganizationApi apiInstance = new OrganizationApi(); +String org = "org_example"; // String | name of the organization +String variablename = "variablename_example"; // String | name of the variable +try { + ActionVariable result = apiInstance.deleteOrgVariable(org, variablename); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#deleteOrgVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **variablename** | **String**| name of the variable | + +### Return type + +[**ActionVariable**](ActionVariable.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 + + +# **getOrgVariable** +> ActionVariable getOrgVariable(org, variablename) + +Get an org-level variable + +### 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.OrganizationApi; + +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"); + +OrganizationApi apiInstance = new OrganizationApi(); +String org = "org_example"; // String | name of the organization +String variablename = "variablename_example"; // String | name of the variable +try { + ActionVariable result = apiInstance.getOrgVariable(org, variablename); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#getOrgVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **variablename** | **String**| name of the variable | + +### Return type + +[**ActionVariable**](ActionVariable.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 + + +# **getOrgVariablesList** +> List<ActionVariable> getOrgVariablesList(org, page, limit) + +Get an org-level variables list + +### 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.OrganizationApi; + +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"); + +OrganizationApi apiInstance = new OrganizationApi(); +String org = "org_example"; // String | name of the organization +Integer page = 56; // Integer | page number of results to return (1-based) +Integer limit = 56; // Integer | page size of results +try { + List result = apiInstance.getOrgVariablesList(org, page, limit); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#getOrgVariablesList"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **page** | **Integer**| page number of results to return (1-based) | [optional] + **limit** | **Integer**| page size of results | [optional] + +### Return type + +[**List<ActionVariable>**](ActionVariable.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 + # **orgAddTeamMember** > Void orgAddTeamMember(id, username) @@ -4903,3 +5268,94 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: Not defined + +# **updateOrgVariable** +> Void updateOrgVariable(org, variablename, body) + +Update an org-level variable + +### 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.OrganizationApi; + +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"); + +OrganizationApi apiInstance = new OrganizationApi(); +String org = "org_example"; // String | name of the organization +String variablename = "variablename_example"; // String | name of the variable +UpdateVariableOption body = new UpdateVariableOption(); // UpdateVariableOption | +try { + Void result = apiInstance.updateOrgVariable(org, variablename, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling OrganizationApi#updateOrgVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **String**| name of the organization | + **variablename** | **String**| name of the variable | + **body** | [**UpdateVariableOption**](UpdateVariableOption.md)| | [optional] + +### 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**: application/json + - **Accept**: Not defined + diff --git a/docs/RepositoryApi.md b/docs/RepositoryApi.md index a794d2c..0b655dd 100644 --- a/docs/RepositoryApi.md +++ b/docs/RepositoryApi.md @@ -7,10 +7,14 @@ Method | HTTP request | Description [**acceptRepoTransfer**](RepositoryApi.md#acceptRepoTransfer) | **POST** repos/{owner}/{repo}/transfer/accept | Accept a repo transfer [**createCurrentUserRepo**](RepositoryApi.md#createCurrentUserRepo) | **POST** user/repos | Create a repository [**createFork**](RepositoryApi.md#createFork) | **POST** repos/{owner}/{repo}/forks | Fork a repository +[**createRepoVariable**](RepositoryApi.md#createRepoVariable) | **POST** repos/{owner}/{repo}/actions/variables/{variablename} | Create a repo-level variable [**deleteRepoSecret**](RepositoryApi.md#deleteRepoSecret) | **DELETE** repos/{owner}/{repo}/actions/secrets/{secretname} | Delete a secret in a repository +[**deleteRepoVariable**](RepositoryApi.md#deleteRepoVariable) | **DELETE** repos/{owner}/{repo}/actions/variables/{variablename} | Delete a repo-level variable [**generateRepo**](RepositoryApi.md#generateRepo) | **POST** repos/{template_owner}/{template_repo}/generate | Create a repository using a template [**getAnnotatedTag**](RepositoryApi.md#getAnnotatedTag) | **GET** repos/{owner}/{repo}/git/tags/{sha} | Gets the tag object of an annotated tag (not lightweight tags) [**getBlob**](RepositoryApi.md#getBlob) | **GET** repos/{owner}/{repo}/git/blobs/{sha} | Gets the blob of a repository. +[**getRepoVariable**](RepositoryApi.md#getRepoVariable) | **GET** repos/{owner}/{repo}/actions/variables/{variablename} | Get a repo-level variable +[**getRepoVariablesList**](RepositoryApi.md#getRepoVariablesList) | **GET** repos/{owner}/{repo}/actions/variables | Get repo-level variables list [**getTree**](RepositoryApi.md#getTree) | **GET** repos/{owner}/{repo}/git/trees/{sha} | Gets the tree of a repository. [**listForks**](RepositoryApi.md#listForks) | **GET** repos/{owner}/{repo}/forks | List a repository's forks [**rejectRepoTransfer**](RepositoryApi.md#rejectRepoTransfer) | **POST** repos/{owner}/{repo}/transfer/reject | Reject a repo transfer @@ -149,6 +153,7 @@ Method | HTTP request | Description [**repoValidateIssueConfig**](RepositoryApi.md#repoValidateIssueConfig) | **GET** repos/{owner}/{repo}/issue_config/validate | Returns the validation information for a issue config [**topicSearch**](RepositoryApi.md#topicSearch) | **GET** topics/search | search topics via keyword [**updateRepoSecret**](RepositoryApi.md#updateRepoSecret) | **PUT** repos/{owner}/{repo}/actions/secrets/{secretname} | Create or Update a secret value in a repository +[**updateRepoVariable**](RepositoryApi.md#updateRepoVariable) | **PUT** repos/{owner}/{repo}/actions/variables/{variablename} | Update a repo-level variable [**userCurrentCheckSubscription**](RepositoryApi.md#userCurrentCheckSubscription) | **GET** repos/{owner}/{repo}/subscription | Check if the current user is watching a repo [**userCurrentDeleteSubscription**](RepositoryApi.md#userCurrentDeleteSubscription) | **DELETE** repos/{owner}/{repo}/subscription | Unwatch a repo [**userCurrentPutSubscription**](RepositoryApi.md#userCurrentPutSubscription) | **PUT** repos/{owner}/{repo}/subscription | Watch a repo @@ -421,6 +426,99 @@ Name | Type | Description | Notes - **Content-Type**: application/json, text/plain - **Accept**: application/json + +# **createRepoVariable** +> Void createRepoVariable(owner, repo, variablename, body) + +Create a repo-level variable + +### 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.RepositoryApi; + +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"); + +RepositoryApi apiInstance = new RepositoryApi(); +String owner = "owner_example"; // String | name of the owner +String repo = "repo_example"; // String | name of the repository +String variablename = "variablename_example"; // String | name of the variable +CreateVariableOption body = new CreateVariableOption(); // CreateVariableOption | +try { + Void result = apiInstance.createRepoVariable(owner, repo, variablename, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#createRepoVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| name of the owner | + **repo** | **String**| name of the repository | + **variablename** | **String**| name of the variable | + **body** | [**CreateVariableOption**](CreateVariableOption.md)| | [optional] + +### 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**: application/json, text/plain + - **Accept**: Not defined + # **deleteRepoSecret** > Void deleteRepoSecret(owner, repo, secretname) @@ -512,6 +610,97 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: Not defined + +# **deleteRepoVariable** +> ActionVariable deleteRepoVariable(owner, repo, variablename) + +Delete a repo-level variable + +### 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.RepositoryApi; + +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"); + +RepositoryApi apiInstance = new RepositoryApi(); +String owner = "owner_example"; // String | name of the owner +String repo = "repo_example"; // String | name of the repository +String variablename = "variablename_example"; // String | name of the variable +try { + ActionVariable result = apiInstance.deleteRepoVariable(owner, repo, variablename); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#deleteRepoVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| name of the owner | + **repo** | **String**| name of the repository | + **variablename** | **String**| name of the variable | + +### Return type + +[**ActionVariable**](ActionVariable.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 + # **generateRepo** > Repository generateRepo(templateOwner, templateRepo, body) @@ -780,6 +969,190 @@ Name | Type | Description | Notes [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 + + +# **getRepoVariable** +> ActionVariable getRepoVariable(owner, repo, variablename) + +Get a repo-level variable + +### 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.RepositoryApi; + +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"); + +RepositoryApi apiInstance = new RepositoryApi(); +String owner = "owner_example"; // String | name of the owner +String repo = "repo_example"; // String | name of the repository +String variablename = "variablename_example"; // String | name of the variable +try { + ActionVariable result = apiInstance.getRepoVariable(owner, repo, variablename); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#getRepoVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| name of the owner | + **repo** | **String**| name of the repository | + **variablename** | **String**| name of the variable | + +### Return type + +[**ActionVariable**](ActionVariable.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 + + +# **getRepoVariablesList** +> List<ActionVariable> getRepoVariablesList(owner, repo, page, limit) + +Get repo-level variables list + +### 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.RepositoryApi; + +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"); + +RepositoryApi apiInstance = new RepositoryApi(); +String owner = "owner_example"; // String | name of the owner +String repo = "repo_example"; // String | name of the repository +Integer page = 56; // Integer | page number of results to return (1-based) +Integer limit = 56; // Integer | page size of results +try { + List result = apiInstance.getRepoVariablesList(owner, repo, page, limit); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#getRepoVariablesList"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| name of the owner | + **repo** | **String**| name of the repository | + **page** | **Integer**| page number of results to return (1-based) | [optional] + **limit** | **Integer**| page size of results | [optional] + +### Return type + +[**List<ActionVariable>**](ActionVariable.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 @@ -13620,6 +13993,99 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: Not defined + +# **updateRepoVariable** +> Void updateRepoVariable(owner, repo, variablename, body) + +Update a repo-level variable + +### 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.RepositoryApi; + +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"); + +RepositoryApi apiInstance = new RepositoryApi(); +String owner = "owner_example"; // String | name of the owner +String repo = "repo_example"; // String | name of the repository +String variablename = "variablename_example"; // String | name of the variable +UpdateVariableOption body = new UpdateVariableOption(); // UpdateVariableOption | +try { + Void result = apiInstance.updateRepoVariable(owner, repo, variablename, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling RepositoryApi#updateRepoVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **owner** | **String**| name of the owner | + **repo** | **String**| name of the repository | + **variablename** | **String**| name of the variable | + **body** | [**UpdateVariableOption**](UpdateVariableOption.md)| | [optional] + +### 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**: application/json, text/plain + - **Accept**: Not defined + # **userCurrentCheckSubscription** > WatchInfo userCurrentCheckSubscription(owner, repo) diff --git a/docs/UpdateVariableOption.md b/docs/UpdateVariableOption.md new file mode 100644 index 0000000..0929dbe --- /dev/null +++ b/docs/UpdateVariableOption.md @@ -0,0 +1,7 @@ +# UpdateVariableOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | New name for the variable. If the field is empty, the variable name won't be updated. | [optional] +**value** | **String** | Value of the variable to update | diff --git a/docs/UserApi.md b/docs/UserApi.md index 50ae15e..306fbc8 100644 --- a/docs/UserApi.md +++ b/docs/UserApi.md @@ -5,11 +5,16 @@ All URIs are relative to *https://{{AppSubUrl | JSEscape}}/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**createCurrentUserRepo**](UserApi.md#createCurrentUserRepo) | **POST** user/repos | Create a repository +[**createUserVariable**](UserApi.md#createUserVariable) | **POST** user/actions/variables/{variablename} | Create a user-level variable [**deleteUserSecret**](UserApi.md#deleteUserSecret) | **DELETE** user/actions/secrets/{secretname} | Delete a secret in a user scope +[**deleteUserVariable**](UserApi.md#deleteUserVariable) | **DELETE** user/actions/variables/{variablename} | Delete a user-level variable which is created by current doer [**getUserSettings**](UserApi.md#getUserSettings) | **GET** user/settings | Get user settings +[**getUserVariable**](UserApi.md#getUserVariable) | **GET** user/actions/variables/{variablename} | Get a user-level variable which is created by current doer +[**getUserVariablesList**](UserApi.md#getUserVariablesList) | **GET** user/actions/variables | Get the user-level list of variables which is created by current doer [**getVerificationToken**](UserApi.md#getVerificationToken) | **GET** user/gpg_key_token | Get a Token to verify [**updateUserSecret**](UserApi.md#updateUserSecret) | **PUT** user/actions/secrets/{secretname} | Create or Update a secret value in a user scope [**updateUserSettings**](UserApi.md#updateUserSettings) | **PATCH** user/settings | Update user settings +[**updateUserVariable**](UserApi.md#updateUserVariable) | **PUT** user/actions/variables/{variablename} | Update a user-level variable which is created by current doer [**userAddEmail**](UserApi.md#userAddEmail) | **POST** user/emails | Add email addresses [**userBlockUser**](UserApi.md#userBlockUser) | **PUT** user/blocks/{username} | Block a user [**userCheckFollowing**](UserApi.md#userCheckFollowing) | **GET** users/{username}/following/{target} | Check if one user is following another user @@ -157,6 +162,95 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + +# **createUserVariable** +> Void createUserVariable(variablename, body) + +Create a user-level variable + +### 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.UserApi; + +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"); + +UserApi apiInstance = new UserApi(); +String variablename = "variablename_example"; // String | name of the variable +CreateVariableOption body = new CreateVariableOption(); // CreateVariableOption | +try { + Void result = apiInstance.createUserVariable(variablename, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#createUserVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **variablename** | **String**| name of the variable | + **body** | [**CreateVariableOption**](CreateVariableOption.md)| | [optional] + +### 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**: application/json + - **Accept**: Not defined + # **deleteUserSecret** > Void deleteUserSecret(secretname) @@ -239,6 +333,93 @@ Name | Type | Description | Notes [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 + + +# **deleteUserVariable** +> Void deleteUserVariable(variablename) + +Delete a user-level variable which is created by current doer + +### 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.UserApi; + +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"); + +UserApi apiInstance = new UserApi(); +String variablename = "variablename_example"; // String | name of the variable +try { + Void result = apiInstance.deleteUserVariable(variablename); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#deleteUserVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **variablename** | **String**| name of the variable | + +### 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 @@ -322,6 +503,182 @@ This endpoint does not need any parameter. [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 + + +# **getUserVariable** +> ActionVariable getUserVariable(variablename) + +Get a user-level variable which is created by current doer + +### 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.UserApi; + +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"); + +UserApi apiInstance = new UserApi(); +String variablename = "variablename_example"; // String | name of the variable +try { + ActionVariable result = apiInstance.getUserVariable(variablename); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **variablename** | **String**| name of the variable | + +### Return type + +[**ActionVariable**](ActionVariable.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 + + +# **getUserVariablesList** +> List<ActionVariable> getUserVariablesList(page, limit) + +Get the user-level list of variables which is created by current doer + +### 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.UserApi; + +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"); + +UserApi apiInstance = new UserApi(); +Integer page = 56; // Integer | page number of results to return (1-based) +Integer limit = 56; // Integer | page size of results +try { + List result = apiInstance.getUserVariablesList(page, limit); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#getUserVariablesList"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **Integer**| page number of results to return (1-based) | [optional] + **limit** | **Integer**| page size of results | [optional] + +### Return type + +[**List<ActionVariable>**](ActionVariable.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 @@ -586,6 +943,95 @@ Name | Type | Description | Notes - **Content-Type**: application/json, text/plain - **Accept**: application/json + +# **updateUserVariable** +> Void updateUserVariable(variablename, body) + +Update a user-level variable which is created by current doer + +### 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.UserApi; + +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"); + +UserApi apiInstance = new UserApi(); +String variablename = "variablename_example"; // String | name of the variable +UpdateVariableOption body = new UpdateVariableOption(); // UpdateVariableOption | +try { + Void result = apiInstance.updateUserVariable(variablename, body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling UserApi#updateUserVariable"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **variablename** | **String**| name of the variable | + **body** | [**UpdateVariableOption**](UpdateVariableOption.md)| | [optional] + +### 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**: application/json + - **Accept**: Not defined + # **userAddEmail** > List<Email> userAddEmail(body) diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java index 3ee360e..7b03162 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/OrganizationApi.java @@ -3,6 +3,7 @@ package org.gitnex.tea4j.v2.apis; import java.util.Date; import java.util.List; import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.ActionVariable; import org.gitnex.tea4j.v2.models.Activity; import org.gitnex.tea4j.v2.models.CreateHookOption; import org.gitnex.tea4j.v2.models.CreateLabelOption; @@ -10,6 +11,7 @@ import org.gitnex.tea4j.v2.models.CreateOrUpdateSecretOption; import org.gitnex.tea4j.v2.models.CreateOrgOption; import org.gitnex.tea4j.v2.models.CreateRepoOption; import org.gitnex.tea4j.v2.models.CreateTeamOption; +import org.gitnex.tea4j.v2.models.CreateVariableOption; import org.gitnex.tea4j.v2.models.EditHookOption; import org.gitnex.tea4j.v2.models.EditLabelOption; import org.gitnex.tea4j.v2.models.EditOrgOption; @@ -23,6 +25,7 @@ import org.gitnex.tea4j.v2.models.Repository; import org.gitnex.tea4j.v2.models.Secret; import org.gitnex.tea4j.v2.models.Team; import org.gitnex.tea4j.v2.models.UpdateUserAvatarOption; +import org.gitnex.tea4j.v2.models.UpdateVariableOption; import org.gitnex.tea4j.v2.models.User; import retrofit2.Call; import retrofit2.http.*; @@ -52,6 +55,21 @@ public interface OrganizationApi { Call createOrgRepoDeprecated( @retrofit2.http.Path("org") String org, @retrofit2.http.Body CreateRepoOption body); + /** + * Create an org-level variable + * + * @param org name of the organization (required) + * @param variablename name of the variable (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @POST("orgs/{org}/actions/variables/{variablename}") + Call createOrgVariable( + @retrofit2.http.Path("org") String org, + @retrofit2.http.Path("variablename") String variablename, + @retrofit2.http.Body CreateVariableOption body); + /** * Delete a secret in an organization * @@ -63,6 +81,44 @@ public interface OrganizationApi { Call deleteOrgSecret( @retrofit2.http.Path("org") String org, @retrofit2.http.Path("secretname") String secretname); + /** + * Delete an org-level variable + * + * @param org name of the organization (required) + * @param variablename name of the variable (required) + * @return Call<ActionVariable> + */ + @DELETE("orgs/{org}/actions/variables/{variablename}") + Call deleteOrgVariable( + @retrofit2.http.Path("org") String org, + @retrofit2.http.Path("variablename") String variablename); + + /** + * Get an org-level variable + * + * @param org name of the organization (required) + * @param variablename name of the variable (required) + * @return Call<ActionVariable> + */ + @GET("orgs/{org}/actions/variables/{variablename}") + Call getOrgVariable( + @retrofit2.http.Path("org") String org, + @retrofit2.http.Path("variablename") String variablename); + + /** + * Get an org-level variables list + * + * @param org name of the organization (required) + * @param page page number of results to return (1-based) (optional) + * @param limit page size of results (optional) + * @return Call<List<ActionVariable>> + */ + @GET("orgs/{org}/actions/variables") + Call> getOrgVariablesList( + @retrofit2.http.Path("org") String org, + @retrofit2.http.Query("page") Integer page, + @retrofit2.http.Query("limit") Integer limit); + /** * Add a team member * @@ -690,4 +746,19 @@ public interface OrganizationApi { @retrofit2.http.Path("org") String org, @retrofit2.http.Path("secretname") String secretname, @retrofit2.http.Body CreateOrUpdateSecretOption body); + + /** + * Update an org-level variable + * + * @param org name of the organization (required) + * @param variablename name of the variable (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @PUT("orgs/{org}/actions/variables/{variablename}") + Call updateOrgVariable( + @retrofit2.http.Path("org") String org, + @retrofit2.http.Path("variablename") String variablename, + @retrofit2.http.Body UpdateVariableOption body); } diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java index a0e12c6..c83bd47 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/RepositoryApi.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; import okhttp3.RequestBody; import org.gitnex.tea4j.v2.CollectionFormats.*; +import org.gitnex.tea4j.v2.models.ActionVariable; import org.gitnex.tea4j.v2.models.Activity; import org.gitnex.tea4j.v2.models.AddCollaboratorOption; import org.gitnex.tea4j.v2.models.AnnotatedTag; @@ -31,6 +32,7 @@ import org.gitnex.tea4j.v2.models.CreateReleaseOption; import org.gitnex.tea4j.v2.models.CreateRepoOption; import org.gitnex.tea4j.v2.models.CreateStatusOption; import org.gitnex.tea4j.v2.models.CreateTagOption; +import org.gitnex.tea4j.v2.models.CreateVariableOption; import org.gitnex.tea4j.v2.models.CreateWikiPageOptions; import org.gitnex.tea4j.v2.models.DeleteFileOptions; import org.gitnex.tea4j.v2.models.DeployKey; @@ -79,6 +81,7 @@ import org.gitnex.tea4j.v2.models.TrackedTime; import org.gitnex.tea4j.v2.models.TransferRepoOption; import org.gitnex.tea4j.v2.models.UpdateFileOptions; import org.gitnex.tea4j.v2.models.UpdateRepoAvatarOption; +import org.gitnex.tea4j.v2.models.UpdateVariableOption; import org.gitnex.tea4j.v2.models.User; import org.gitnex.tea4j.v2.models.WatchInfo; import org.gitnex.tea4j.v2.models.WikiCommitList; @@ -124,6 +127,23 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Body CreateForkOption body); + /** + * Create a repo-level variable + * + * @param owner name of the owner (required) + * @param repo name of the repository (required) + * @param variablename name of the variable (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @POST("repos/{owner}/{repo}/actions/variables/{variablename}") + Call createRepoVariable( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("variablename") String variablename, + @retrofit2.http.Body CreateVariableOption body); + /** * Delete a secret in a repository * @@ -138,6 +158,20 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("secretname") String secretname); + /** + * Delete a repo-level variable + * + * @param owner name of the owner (required) + * @param repo name of the repository (required) + * @param variablename name of the variable (required) + * @return Call<ActionVariable> + */ + @DELETE("repos/{owner}/{repo}/actions/variables/{variablename}") + Call deleteRepoVariable( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("variablename") String variablename); + /** * Create a repository using a template * @@ -182,6 +216,36 @@ public interface RepositoryApi { @retrofit2.http.Path("repo") String repo, @retrofit2.http.Path("sha") String sha); + /** + * Get a repo-level variable + * + * @param owner name of the owner (required) + * @param repo name of the repository (required) + * @param variablename name of the variable (required) + * @return Call<ActionVariable> + */ + @GET("repos/{owner}/{repo}/actions/variables/{variablename}") + Call getRepoVariable( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("variablename") String variablename); + + /** + * Get repo-level variables list + * + * @param owner name of the owner (required) + * @param repo name of the repository (required) + * @param page page number of results to return (1-based) (optional) + * @param limit page size of results (optional) + * @return Call<List<ActionVariable>> + */ + @GET("repos/{owner}/{repo}/actions/variables") + Call> getRepoVariablesList( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Query("page") Integer page, + @retrofit2.http.Query("limit") Integer limit); + /** * Gets the tree of a repository. * @@ -2361,6 +2425,23 @@ public interface RepositoryApi { @retrofit2.http.Path("secretname") String secretname, @retrofit2.http.Body CreateOrUpdateSecretOption body); + /** + * Update a repo-level variable + * + * @param owner name of the owner (required) + * @param repo name of the repository (required) + * @param variablename name of the variable (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @PUT("repos/{owner}/{repo}/actions/variables/{variablename}") + Call updateRepoVariable( + @retrofit2.http.Path("owner") String owner, + @retrofit2.http.Path("repo") String repo, + @retrofit2.http.Path("variablename") String variablename, + @retrofit2.http.Body UpdateVariableOption body); + /** * Check if the current user is watching a repo * diff --git a/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java b/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java index df38c89..f63afca 100644 --- a/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java +++ b/src/main/java/org/gitnex/tea4j/v2/apis/UserApi.java @@ -4,6 +4,7 @@ import java.util.Date; import java.util.List; import org.gitnex.tea4j.v2.CollectionFormats.*; import org.gitnex.tea4j.v2.models.AccessToken; +import org.gitnex.tea4j.v2.models.ActionVariable; import org.gitnex.tea4j.v2.models.Activity; import org.gitnex.tea4j.v2.models.CreateAccessTokenOption; import org.gitnex.tea4j.v2.models.CreateEmailOption; @@ -13,6 +14,7 @@ import org.gitnex.tea4j.v2.models.CreateKeyOption; import org.gitnex.tea4j.v2.models.CreateOAuth2ApplicationOptions; import org.gitnex.tea4j.v2.models.CreateOrUpdateSecretOption; import org.gitnex.tea4j.v2.models.CreateRepoOption; +import org.gitnex.tea4j.v2.models.CreateVariableOption; import org.gitnex.tea4j.v2.models.DeleteEmailOption; import org.gitnex.tea4j.v2.models.EditHookOption; import org.gitnex.tea4j.v2.models.Email; @@ -26,6 +28,7 @@ import org.gitnex.tea4j.v2.models.StopWatch; import org.gitnex.tea4j.v2.models.Team; import org.gitnex.tea4j.v2.models.TrackedTime; import org.gitnex.tea4j.v2.models.UpdateUserAvatarOption; +import org.gitnex.tea4j.v2.models.UpdateVariableOption; import org.gitnex.tea4j.v2.models.User; import org.gitnex.tea4j.v2.models.UserHeatmapData; import org.gitnex.tea4j.v2.models.UserSettings; @@ -44,6 +47,19 @@ public interface UserApi { @POST("user/repos") Call createCurrentUserRepo(@retrofit2.http.Body CreateRepoOption body); + /** + * Create a user-level variable + * + * @param variablename name of the variable (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @POST("user/actions/variables/{variablename}") + Call createUserVariable( + @retrofit2.http.Path("variablename") String variablename, + @retrofit2.http.Body CreateVariableOption body); + /** * Delete a secret in a user scope * @@ -53,6 +69,15 @@ public interface UserApi { @DELETE("user/actions/secrets/{secretname}") Call deleteUserSecret(@retrofit2.http.Path("secretname") String secretname); + /** + * Delete a user-level variable which is created by current doer + * + * @param variablename name of the variable (required) + * @return Call<Void> + */ + @DELETE("user/actions/variables/{variablename}") + Call deleteUserVariable(@retrofit2.http.Path("variablename") String variablename); + /** * Get user settings * @@ -61,6 +86,26 @@ public interface UserApi { @GET("user/settings") Call> getUserSettings(); + /** + * Get a user-level variable which is created by current doer + * + * @param variablename name of the variable (required) + * @return Call<ActionVariable> + */ + @GET("user/actions/variables/{variablename}") + Call getUserVariable(@retrofit2.http.Path("variablename") String variablename); + + /** + * Get the user-level list of variables which is created by current doer + * + * @param page page number of results to return (1-based) (optional) + * @param limit page size of results (optional) + * @return Call<List<ActionVariable>> + */ + @GET("user/actions/variables") + Call> getUserVariablesList( + @retrofit2.http.Query("page") Integer page, @retrofit2.http.Query("limit") Integer limit); + /** * Get a Token to verify * @@ -92,6 +137,19 @@ public interface UserApi { @PATCH("user/settings") Call> updateUserSettings(@retrofit2.http.Body UserSettingsOptions body); + /** + * Update a user-level variable which is created by current doer + * + * @param variablename name of the variable (required) + * @param body (optional) + * @return Call<Void> + */ + @Headers({"Content-Type:application/json"}) + @PUT("user/actions/variables/{variablename}") + Call updateUserVariable( + @retrofit2.http.Path("variablename") String variablename, + @retrofit2.http.Body UpdateVariableOption body); + /** * Add email addresses * diff --git a/src/main/java/org/gitnex/tea4j/v2/models/ActionVariable.java b/src/main/java/org/gitnex/tea4j/v2/models/ActionVariable.java new file mode 100644 index 0000000..67d6ac0 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/ActionVariable.java @@ -0,0 +1,155 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape}} + * + * + * 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; + +/** ActionVariable return value of the query API */ +@Schema(description = "ActionVariable return value of the query API") +public class ActionVariable implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("data") + private String data = null; + + @SerializedName("name") + private String name = null; + + @SerializedName("owner_id") + private Long ownerId = null; + + @SerializedName("repo_id") + private Long repoId = null; + + public ActionVariable data(String data) { + this.data = data; + return this; + } + + /** + * the value of the variable + * + * @return data + */ + @Schema(description = "the value of the variable") + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + + public ActionVariable name(String name) { + this.name = name; + return this; + } + + /** + * the name of the variable + * + * @return name + */ + @Schema(description = "the name of the variable") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ActionVariable ownerId(Long ownerId) { + this.ownerId = ownerId; + return this; + } + + /** + * the owner to which the variable belongs + * + * @return ownerId + */ + @Schema(description = "the owner to which the variable belongs") + public Long getOwnerId() { + return ownerId; + } + + public void setOwnerId(Long ownerId) { + this.ownerId = ownerId; + } + + public ActionVariable repoId(Long repoId) { + this.repoId = repoId; + return this; + } + + /** + * the repository to which the variable belongs + * + * @return repoId + */ + @Schema(description = "the repository to which the variable belongs") + public Long getRepoId() { + return repoId; + } + + public void setRepoId(Long repoId) { + this.repoId = repoId; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActionVariable actionVariable = (ActionVariable) o; + return Objects.equals(this.data, actionVariable.data) + && Objects.equals(this.name, actionVariable.name) + && Objects.equals(this.ownerId, actionVariable.ownerId) + && Objects.equals(this.repoId, actionVariable.repoId); + } + + @Override + public int hashCode() { + return Objects.hash(data, name, ownerId, repoId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActionVariable {\n"); + + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" ownerId: ").append(toIndentedString(ownerId)).append("\n"); + sb.append(" repoId: ").append(toIndentedString(repoId)).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 "); + } +} diff --git a/src/main/java/org/gitnex/tea4j/v2/models/CreateVariableOption.java b/src/main/java/org/gitnex/tea4j/v2/models/CreateVariableOption.java new file mode 100644 index 0000000..6e5a414 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/CreateVariableOption.java @@ -0,0 +1,83 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape}} + * + * + * 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; + +/** CreateVariableOption the option when creating variable */ +@Schema(description = "CreateVariableOption the option when creating variable") +public class CreateVariableOption implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("value") + private String value = null; + + public CreateVariableOption value(String value) { + this.value = value; + return this; + } + + /** + * Value of the variable to create + * + * @return value + */ + @Schema(required = true, description = "Value of the variable to create") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateVariableOption createVariableOption = (CreateVariableOption) o; + return Objects.equals(this.value, createVariableOption.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateVariableOption {\n"); + + sb.append(" value: ").append(toIndentedString(value)).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 "); + } +} diff --git a/src/main/java/org/gitnex/tea4j/v2/models/UpdateVariableOption.java b/src/main/java/org/gitnex/tea4j/v2/models/UpdateVariableOption.java new file mode 100644 index 0000000..fa49dd3 --- /dev/null +++ b/src/main/java/org/gitnex/tea4j/v2/models/UpdateVariableOption.java @@ -0,0 +1,109 @@ +/* + * Gitea API + * This documentation describes the Gitea API. + * + * OpenAPI spec version: {{AppVer | JSEscape}} + * + * + * 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; + +/** UpdateVariableOption the option when updating variable */ +@Schema(description = "UpdateVariableOption the option when updating variable") +public class UpdateVariableOption implements Serializable { + private static final long serialVersionUID = 1L; + + @SerializedName("name") + private String name = null; + + @SerializedName("value") + private String value = null; + + public UpdateVariableOption name(String name) { + this.name = name; + return this; + } + + /** + * New name for the variable. If the field is empty, the variable name won't be updated. + * + * @return name + */ + @Schema( + description = + "New name for the variable. If the field is empty, the variable name won't be updated.") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public UpdateVariableOption value(String value) { + this.value = value; + return this; + } + + /** + * Value of the variable to update + * + * @return value + */ + @Schema(required = true, description = "Value of the variable to update") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateVariableOption updateVariableOption = (UpdateVariableOption) o; + return Objects.equals(this.name, updateVariableOption.name) + && Objects.equals(this.value, updateVariableOption.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateVariableOption {\n"); + + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } +}