Skip to content

Commit 2389c99

Browse files
author
Phrase
committed
1 parent 54f04f1 commit 2389c99

File tree

230 files changed

+545
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+545
-225
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ Class | Method | HTTP request | Description
123123
*AutomationsApi* | [**automationDeactivate**](docs/AutomationsApi.md#automationDeactivate) | **POST** /accounts/{account_id}/automations/{automation_id}/deactivate | Deactivate an automation
124124
*AutomationsApi* | [**automationDelete**](docs/AutomationsApi.md#automationDelete) | **DELETE** /accounts/{account_id}/automations/{automation_id} | Destroy automation
125125
*AutomationsApi* | [**automationShow**](docs/AutomationsApi.md#automationShow) | **GET** /accounts/{account_id}/automations/{automation_id} | Get a single automation
126+
*AutomationsApi* | [**automationTrigger**](docs/AutomationsApi.md#automationTrigger) | **POST** /accounts/{account_id}/automations/{automation_id}/trigger | Trigger an automation
126127
*AutomationsApi* | [**automationUpdate**](docs/AutomationsApi.md#automationUpdate) | **PATCH** /accounts/{account_id}/automations/{automation_id} | Update an automation
127128
*AutomationsApi* | [**automationsList**](docs/AutomationsApi.md#automationsList) | **GET** /accounts/{account_id}/automations | List automations
128129
*BlacklistedKeysApi* | [**blacklistedKeyCreate**](docs/BlacklistedKeysApi.md#blacklistedKeyCreate) | **POST** /projects/{project_id}/blacklisted_keys | Create a blocked key

api/openapi.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28474,6 +28474,90 @@ paths:
2847428474
--id <id> \
2847528475
--access_token <token>
2847628476
x-accepts: application/json
28477+
/accounts/{account_id}/automations/{automation_id}/trigger:
28478+
post:
28479+
description: |
28480+
Trigger an automation.
28481+
operationId: automation/trigger
28482+
parameters:
28483+
- description: Two-Factor-Authentication token (optional)
28484+
explode: false
28485+
in: header
28486+
name: X-PhraseApp-OTP
28487+
required: false
28488+
schema:
28489+
type: string
28490+
style: simple
28491+
- description: Account ID
28492+
explode: false
28493+
in: path
28494+
name: account_id
28495+
required: true
28496+
schema:
28497+
type: string
28498+
style: simple
28499+
- description: ID
28500+
explode: false
28501+
in: path
28502+
name: id
28503+
required: true
28504+
schema:
28505+
type: string
28506+
style: simple
28507+
responses:
28508+
"204":
28509+
description: The resource was deleted successfully.
28510+
headers:
28511+
X-Rate-Limit-Limit:
28512+
$ref: '#/components/headers/X-Rate-Limit-Limit'
28513+
X-Rate-Limit-Remaining:
28514+
$ref: '#/components/headers/X-Rate-Limit-Remaining'
28515+
X-Rate-Limit-Reset:
28516+
$ref: '#/components/headers/X-Rate-Limit-Reset'
28517+
"400":
28518+
description: Bad request
28519+
headers:
28520+
X-Rate-Limit-Limit:
28521+
$ref: '#/components/headers/X-Rate-Limit-Limit'
28522+
X-Rate-Limit-Remaining:
28523+
$ref: '#/components/headers/X-Rate-Limit-Remaining'
28524+
X-Rate-Limit-Reset:
28525+
$ref: '#/components/headers/X-Rate-Limit-Reset'
28526+
"404":
28527+
description: Not Found
28528+
headers:
28529+
X-Rate-Limit-Limit:
28530+
$ref: '#/components/headers/X-Rate-Limit-Limit'
28531+
X-Rate-Limit-Remaining:
28532+
$ref: '#/components/headers/X-Rate-Limit-Remaining'
28533+
X-Rate-Limit-Reset:
28534+
$ref: '#/components/headers/X-Rate-Limit-Reset'
28535+
"429":
28536+
description: Rate Limiting
28537+
headers:
28538+
X-Rate-Limit-Limit:
28539+
$ref: '#/components/headers/X-Rate-Limit-Limit'
28540+
X-Rate-Limit-Remaining:
28541+
$ref: '#/components/headers/X-Rate-Limit-Remaining'
28542+
X-Rate-Limit-Reset:
28543+
$ref: '#/components/headers/X-Rate-Limit-Reset'
28544+
summary: Trigger an automation
28545+
tags:
28546+
- Automations
28547+
x-code-samples:
28548+
- lang: Curl
28549+
source: |-
28550+
curl "https://api.phrase.com/v2/accounts/:account_id/automations/:id/trigger" \
28551+
-u USERNAME_OR_ACCESS_TOKEN
28552+
-X POST
28553+
-H 'Content-Type: application/json'
28554+
- lang: CLI v2
28555+
source: |-
28556+
phrase automations trigger \
28557+
--account_id <account_id> \
28558+
--id <id> \
28559+
--access_token <token>
28560+
x-accepts: application/json
2847728561
components:
2847828562
headers:
2847928563
Link:

docs/AutomationsApi.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Method | HTTP request | Description
99
[**automationDeactivate**](AutomationsApi.md#automationDeactivate) | **POST** /accounts/{account_id}/automations/{automation_id}/deactivate | Deactivate an automation
1010
[**automationDelete**](AutomationsApi.md#automationDelete) | **DELETE** /accounts/{account_id}/automations/{automation_id} | Destroy automation
1111
[**automationShow**](AutomationsApi.md#automationShow) | **GET** /accounts/{account_id}/automations/{automation_id} | Get a single automation
12+
[**automationTrigger**](AutomationsApi.md#automationTrigger) | **POST** /accounts/{account_id}/automations/{automation_id}/trigger | Trigger an automation
1213
[**automationUpdate**](AutomationsApi.md#automationUpdate) | **PATCH** /accounts/{account_id}/automations/{automation_id} | Update an automation
1314
[**automationsList**](AutomationsApi.md#automationsList) | **GET** /accounts/{account_id}/automations | List automations
1415

@@ -413,6 +414,85 @@ Name | Type | Description | Notes
413414
**404** | Not Found | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
414415
**429** | Rate Limiting | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
415416

417+
<a name="automationTrigger"></a>
418+
# **automationTrigger**
419+
> automationTrigger(accountId, id, xPhraseAppOTP)
420+
421+
Trigger an automation
422+
423+
Trigger an automation.
424+
425+
### Example
426+
```java
427+
// Import classes:
428+
import com.phrase.client.ApiClient;
429+
import com.phrase.client.ApiException;
430+
import com.phrase.client.Configuration;
431+
import com.phrase.client.auth.*;
432+
import com.phrase.client.models.*;
433+
import com.phrase.client.api.AutomationsApi;
434+
435+
public class Example {
436+
public static void main(String[] args) {
437+
ApiClient defaultClient = Configuration.getDefaultApiClient();
438+
defaultClient.setBasePath("https://api.phrase.com/v2");
439+
440+
// Configure HTTP basic authorization: Basic
441+
HttpBasicAuth Basic = (HttpBasicAuth) defaultClient.getAuthentication("Basic");
442+
Basic.setUsername("YOUR USERNAME");
443+
Basic.setPassword("YOUR PASSWORD");
444+
445+
// Configure API key authorization: Token
446+
ApiKeyAuth Token = (ApiKeyAuth) defaultClient.getAuthentication("Token");
447+
Token.setApiKey("YOUR API KEY");
448+
Token.setApiKeyPrefix("token");
449+
450+
AutomationsApi apiInstance = new AutomationsApi(defaultClient);
451+
String accountId = "accountId_example"; // String | Account ID
452+
String id = "id_example"; // String | ID
453+
String xPhraseAppOTP = "xPhraseAppOTP_example"; // String | Two-Factor-Authentication token (optional)
454+
try {
455+
apiInstance.automationTrigger(accountId, id, xPhraseAppOTP);
456+
} catch (ApiException e) {
457+
System.err.println("Exception when calling AutomationsApi#automationTrigger");
458+
System.err.println("Status code: " + e.getCode());
459+
System.err.println("Reason: " + e.getResponseBody());
460+
System.err.println("Response headers: " + e.getResponseHeaders());
461+
e.printStackTrace();
462+
}
463+
}
464+
}
465+
```
466+
467+
### Parameters
468+
469+
Name | Type | Description | Notes
470+
------------- | ------------- | ------------- | -------------
471+
**accountId** | **String**| Account ID |
472+
**id** | **String**| ID |
473+
**xPhraseAppOTP** | **String**| Two-Factor-Authentication token (optional) | [optional]
474+
475+
### Return type
476+
477+
null (empty response body)
478+
479+
### Authorization
480+
481+
[Basic](../README.md#Basic), [Token](../README.md#Token)
482+
483+
### HTTP request headers
484+
485+
- **Content-Type**: Not defined
486+
- **Accept**: Not defined
487+
488+
### HTTP response details
489+
| Status code | Description | Response headers |
490+
|-------------|-------------|------------------|
491+
**204** | The resource was deleted successfully. | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
492+
**400** | Bad request | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
493+
**404** | Not Found | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
494+
**429** | Rate Limiting | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
495+
416496
<a name="automationUpdate"></a>
417497
# **automationUpdate**
418498
> Automation automationUpdate(accountId, id, automationsCreateParameters1, xPhraseAppOTP)

src/main/java/com/phrase/client/ApiException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.Map;
1616
import java.util.List;
1717

18-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-11T14:23:41.439766501Z[Etc/UTC]")
18+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-27T09:54:52.116167958Z[Etc/UTC]")
1919
public class ApiException extends Exception {
2020
private int code = 0;
2121
private Map<String, List<String>> responseHeaders = null;

src/main/java/com/phrase/client/Configuration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package com.phrase.client;
1414

15-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-11T14:23:41.439766501Z[Etc/UTC]")
15+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-27T09:54:52.116167958Z[Etc/UTC]")
1616
public class Configuration {
1717
private static ApiClient defaultApiClient = new ApiClient();
1818

src/main/java/com/phrase/client/Pair.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package com.phrase.client;
1414

15-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-11T14:23:41.439766501Z[Etc/UTC]")
15+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-27T09:54:52.116167958Z[Etc/UTC]")
1616
public class Pair {
1717
private String name = "";
1818
private String value = "";

src/main/java/com/phrase/client/StringUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package com.phrase.client;
1414

15-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-11T14:23:41.439766501Z[Etc/UTC]")
15+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-27T09:54:52.116167958Z[Etc/UTC]")
1616
public class StringUtil {
1717
/**
1818
* Check if the given array contains the given value (with case-insensitive comparison).

src/main/java/com/phrase/client/api/AutomationsApi.java

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,143 @@ public okhttp3.Call automationShowAsync(String accountId, String id, String xPhr
760760
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
761761
return localVarCall;
762762
}
763+
/**
764+
* Build call for automationTrigger
765+
* @param accountId Account ID (required)
766+
* @param id ID (required)
767+
* @param xPhraseAppOTP Two-Factor-Authentication token (optional) (optional)
768+
* @param _callback Callback for upload/download progress
769+
* @return Call to execute
770+
* @throws ApiException If fail to serialize the request body object
771+
* @http.response.details
772+
<table summary="Response Details" border="1">
773+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
774+
<tr><td> 204 </td><td> The resource was deleted successfully. </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
775+
<tr><td> 400 </td><td> Bad request </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
776+
<tr><td> 404 </td><td> Not Found </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
777+
<tr><td> 429 </td><td> Rate Limiting </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
778+
</table>
779+
*/
780+
public okhttp3.Call automationTriggerCall(String accountId, String id, String xPhraseAppOTP, final ApiCallback _callback) throws ApiException {
781+
Object localVarPostBody = null;
782+
783+
// create path and map variables
784+
String localVarPath = "/accounts/{account_id}/automations/{automation_id}/trigger"
785+
.replaceAll("\\{" + "account_id" + "\\}", localVarApiClient.escapeString(accountId.toString()))
786+
.replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString()));
787+
788+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
789+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
790+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
791+
if (xPhraseAppOTP != null) {
792+
localVarHeaderParams.put("X-PhraseApp-OTP", localVarApiClient.parameterToString(xPhraseAppOTP));
793+
}
794+
795+
Map<String, String> localVarCookieParams = new HashMap<String, String>();
796+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
797+
final String[] localVarAccepts = {
798+
799+
};
800+
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
801+
if (localVarAccept != null) {
802+
localVarHeaderParams.put("Accept", localVarAccept);
803+
}
804+
805+
final String[] localVarContentTypes = {
806+
807+
};
808+
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
809+
localVarHeaderParams.put("Content-Type", localVarContentType);
810+
811+
String[] localVarAuthNames = new String[] { "Basic", "Token" };
812+
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
813+
}
814+
815+
@SuppressWarnings("rawtypes")
816+
private okhttp3.Call automationTriggerValidateBeforeCall(String accountId, String id, String xPhraseAppOTP, final ApiCallback _callback) throws ApiException {
817+
818+
// verify the required parameter 'accountId' is set
819+
if (accountId == null) {
820+
throw new ApiException("Missing the required parameter 'accountId' when calling automationTrigger(Async)");
821+
}
822+
823+
// verify the required parameter 'id' is set
824+
if (id == null) {
825+
throw new ApiException("Missing the required parameter 'id' when calling automationTrigger(Async)");
826+
}
827+
828+
829+
okhttp3.Call localVarCall = automationTriggerCall(accountId, id, xPhraseAppOTP, _callback);
830+
return localVarCall;
831+
832+
}
833+
834+
/**
835+
* Trigger an automation
836+
* Trigger an automation.
837+
* @param accountId Account ID (required)
838+
* @param id ID (required)
839+
* @param xPhraseAppOTP Two-Factor-Authentication token (optional) (optional)
840+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
841+
* @http.response.details
842+
<table summary="Response Details" border="1">
843+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
844+
<tr><td> 204 </td><td> The resource was deleted successfully. </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
845+
<tr><td> 400 </td><td> Bad request </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
846+
<tr><td> 404 </td><td> Not Found </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
847+
<tr><td> 429 </td><td> Rate Limiting </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
848+
</table>
849+
*/
850+
public void automationTrigger(String accountId, String id, String xPhraseAppOTP) throws ApiException {
851+
automationTriggerWithHttpInfo(accountId, id, xPhraseAppOTP);
852+
}
853+
854+
/**
855+
* Trigger an automation
856+
* Trigger an automation.
857+
* @param accountId Account ID (required)
858+
* @param id ID (required)
859+
* @param xPhraseAppOTP Two-Factor-Authentication token (optional) (optional)
860+
* @return ApiResponse&lt;Void&gt;
861+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
862+
* @http.response.details
863+
<table summary="Response Details" border="1">
864+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
865+
<tr><td> 204 </td><td> The resource was deleted successfully. </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
866+
<tr><td> 400 </td><td> Bad request </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
867+
<tr><td> 404 </td><td> Not Found </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
868+
<tr><td> 429 </td><td> Rate Limiting </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
869+
</table>
870+
*/
871+
public ApiResponse<Void> automationTriggerWithHttpInfo(String accountId, String id, String xPhraseAppOTP) throws ApiException {
872+
okhttp3.Call localVarCall = automationTriggerValidateBeforeCall(accountId, id, xPhraseAppOTP, null);
873+
return localVarApiClient.execute(localVarCall);
874+
}
875+
876+
/**
877+
* Trigger an automation (asynchronously)
878+
* Trigger an automation.
879+
* @param accountId Account ID (required)
880+
* @param id ID (required)
881+
* @param xPhraseAppOTP Two-Factor-Authentication token (optional) (optional)
882+
* @param _callback The callback to be executed when the API call finishes
883+
* @return The request call
884+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
885+
* @http.response.details
886+
<table summary="Response Details" border="1">
887+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
888+
<tr><td> 204 </td><td> The resource was deleted successfully. </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
889+
<tr><td> 400 </td><td> Bad request </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
890+
<tr><td> 404 </td><td> Not Found </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
891+
<tr><td> 429 </td><td> Rate Limiting </td><td> * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> </td></tr>
892+
</table>
893+
*/
894+
public okhttp3.Call automationTriggerAsync(String accountId, String id, String xPhraseAppOTP, final ApiCallback<Void> _callback) throws ApiException {
895+
896+
okhttp3.Call localVarCall = automationTriggerValidateBeforeCall(accountId, id, xPhraseAppOTP, _callback);
897+
localVarApiClient.executeAsync(localVarCall, _callback);
898+
return localVarCall;
899+
}
763900
/**
764901
* Build call for automationUpdate
765902
* @param accountId Account ID (required)

src/main/java/com/phrase/client/auth/ApiKeyAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import java.util.Map;
1818
import java.util.List;
1919

20-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-11T14:23:41.439766501Z[Etc/UTC]")
20+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-27T09:54:52.116167958Z[Etc/UTC]")
2121
public class ApiKeyAuth implements Authentication {
2222
private final String location;
2323
private final String paramName;

src/main/java/com/phrase/client/auth/HttpBearerAuth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import java.util.Map;
1818
import java.util.List;
1919

20-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-11T14:23:41.439766501Z[Etc/UTC]")
20+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2025-11-27T09:54:52.116167958Z[Etc/UTC]")
2121
public class HttpBearerAuth implements Authentication {
2222
private final String scheme;
2323
private String bearerToken;

0 commit comments

Comments
 (0)