Skip to content

Commit ff81515

Browse files
author
Phrase
committed
1 parent cab21d3 commit ff81515

9 files changed

+205
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ Class | Method | HTTP request | Description
157157
*AutomationsApi* | [**automation_deactivate**](docs/AutomationsApi.md#automation_deactivate) | **POST** /accounts/{account_id}/automations/{automation_id}/deactivate | Deactivate an automation
158158
*AutomationsApi* | [**automation_delete**](docs/AutomationsApi.md#automation_delete) | **DELETE** /accounts/{account_id}/automations/{automation_id} | Destroy automation
159159
*AutomationsApi* | [**automation_show**](docs/AutomationsApi.md#automation_show) | **GET** /accounts/{account_id}/automations/{automation_id} | Get a single automation
160+
*AutomationsApi* | [**automation_trigger**](docs/AutomationsApi.md#automation_trigger) | **POST** /accounts/{account_id}/automations/{automation_id}/trigger | Trigger an automation
160161
*AutomationsApi* | [**automation_update**](docs/AutomationsApi.md#automation_update) | **PATCH** /accounts/{account_id}/automations/{automation_id} | Update an automation
161162
*AutomationsApi* | [**automations_list**](docs/AutomationsApi.md#automations_list) | **GET** /accounts/{account_id}/automations | List automations
162163
*BlacklistedKeysApi* | [**blacklisted_key_create**](docs/BlacklistedKeysApi.md#blacklisted_key_create) | **POST** /projects/{project_id}/blacklisted_keys | Create a blocked key

docs/AutomationsApi.md

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

@@ -353,6 +354,73 @@ Name | Type | Description | Notes
353354

354355
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
355356

357+
# **automation_trigger**
358+
> automation_trigger(account_id, id, x_phrase_app_otp=x_phrase_app_otp)
359+
360+
Trigger an automation
361+
362+
Trigger an automation.
363+
364+
### Example
365+
366+
```python
367+
from __future__ import print_function
368+
import time
369+
import phrase_api
370+
from phrase_api.rest import ApiException
371+
from pprint import pprint
372+
373+
configuration = phrase_api.Configuration()
374+
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
375+
configuration.api_key_prefix['Authorization'] = 'token'
376+
377+
# Enter a context with an instance of the API client
378+
with phrase_api.ApiClient(configuration) as api_client:
379+
# Create an instance of the API class
380+
api_instance = phrase_api.AutomationsApi(api_client)
381+
account_id = 'account_id_example' # str | Account ID (required)
382+
id = 'id_example' # str | ID (required)
383+
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
384+
385+
try:
386+
# Trigger an automation
387+
api_instance.automation_trigger(account_id, id, x_phrase_app_otp=x_phrase_app_otp)
388+
except ApiException as e:
389+
print("Exception when calling AutomationsApi->automation_trigger: %s\n" % e)
390+
```
391+
392+
393+
### Parameters
394+
395+
Name | Type | Description | Notes
396+
------------- | ------------- | ------------- | -------------
397+
**account_id** | **str**| Account ID |
398+
**id** | **str**| ID |
399+
**x_phrase_app_otp** | **str**| Two-Factor-Authentication token (optional) | [optional]
400+
401+
### Return type
402+
403+
void (empty response body)
404+
405+
### Authorization
406+
407+
[Basic](../README.md#Basic), [Token](../README.md#Token)
408+
409+
### HTTP request headers
410+
411+
- **Content-Type**: Not defined
412+
- **Accept**: Not defined
413+
414+
### HTTP response details
415+
| Status code | Description | Response headers |
416+
|-------------|-------------|------------------|
417+
**204** | The resource was deleted successfully. | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
418+
**400** | Bad request | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
419+
**404** | Not Found | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
420+
**429** | Rate Limiting | * X-Rate-Limit-Limit - <br> * X-Rate-Limit-Remaining - <br> * X-Rate-Limit-Reset - <br> |
421+
422+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
423+
356424
# **automation_update**
357425
> Automation automation_update(account_id, id, automations_create_parameters1, x_phrase_app_otp=x_phrase_app_otp)
358426

phrase_api/api/automations_api.py

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,130 @@ def automation_show_with_http_info(self, account_id, id, **kwargs): # noqa: E50
675675
_request_timeout=local_var_params.get('_request_timeout'),
676676
collection_formats=collection_formats)
677677

678+
def automation_trigger(self, account_id, id, **kwargs): # noqa: E501
679+
"""Trigger an automation # noqa: E501
680+
681+
Trigger an automation. # noqa: E501
682+
This method makes a synchronous HTTP request by default. To make an
683+
asynchronous HTTP request, please pass async_req=True
684+
>>> thread = api.automation_trigger(account_id, id, async_req=True)
685+
>>> result = thread.get()
686+
687+
:param async_req bool: execute request asynchronously
688+
:param str account_id: Account ID (required)
689+
:param str id: ID (required)
690+
:param str x_phrase_app_otp: Two-Factor-Authentication token (optional)
691+
:param _preload_content: if False, the urllib3.HTTPResponse object will
692+
be returned without reading/decoding response
693+
data. Default is True.
694+
:param _request_timeout: timeout setting for this request. If one
695+
number provided, it will be total request
696+
timeout. It can also be a pair (tuple) of
697+
(connection, read) timeouts.
698+
:return: None
699+
If the method is called asynchronously,
700+
returns the request thread.
701+
"""
702+
kwargs['_return_http_data_only'] = True
703+
return self.automation_trigger_with_http_info(account_id, id, **kwargs) # noqa: E501
704+
705+
def automation_trigger_with_http_info(self, account_id, id, **kwargs): # noqa: E501
706+
"""Trigger an automation # noqa: E501
707+
708+
Trigger an automation. # noqa: E501
709+
This method makes a synchronous HTTP request by default. To make an
710+
asynchronous HTTP request, please pass async_req=True
711+
>>> thread = api.automation_trigger_with_http_info(account_id, id, async_req=True)
712+
>>> result = thread.get()
713+
714+
:param async_req bool: execute request asynchronously
715+
:param str account_id: Account ID (required)
716+
:param str id: ID (required)
717+
:param str x_phrase_app_otp: Two-Factor-Authentication token (optional)
718+
:param _return_http_data_only: response data without head status code
719+
and headers
720+
:param _preload_content: if False, the urllib3.HTTPResponse object will
721+
be returned without reading/decoding response
722+
data. Default is True.
723+
:param _request_timeout: timeout setting for this request. If one
724+
number provided, it will be total request
725+
timeout. It can also be a pair (tuple) of
726+
(connection, read) timeouts.
727+
:return: None
728+
If the method is called asynchronously,
729+
returns the request thread.
730+
"""
731+
732+
local_var_params = locals()
733+
734+
all_params = [
735+
'account_id',
736+
'id',
737+
'x_phrase_app_otp'
738+
]
739+
all_params.extend(
740+
[
741+
'async_req',
742+
'_return_http_data_only',
743+
'_preload_content',
744+
'_request_timeout'
745+
]
746+
)
747+
748+
for key, val in six.iteritems(local_var_params['kwargs']):
749+
if key not in all_params:
750+
raise ApiTypeError(
751+
"Got an unexpected keyword argument '%s'"
752+
" to method automation_trigger" % key
753+
)
754+
local_var_params[key] = val
755+
del local_var_params['kwargs']
756+
# verify the required parameter 'account_id' is set
757+
if self.api_client.client_side_validation and ('account_id' not in local_var_params or # noqa: E501
758+
local_var_params['account_id'] is None): # noqa: E501
759+
raise ApiValueError("Missing the required parameter `account_id` when calling `automation_trigger`") # noqa: E501
760+
# verify the required parameter 'id' is set
761+
if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
762+
local_var_params['id'] is None): # noqa: E501
763+
raise ApiValueError("Missing the required parameter `id` when calling `automation_trigger`") # noqa: E501
764+
765+
collection_formats = {}
766+
767+
path_params = {}
768+
if 'account_id' in local_var_params:
769+
path_params['account_id'] = local_var_params['account_id'] # noqa: E501
770+
if 'id' in local_var_params:
771+
path_params['id'] = local_var_params['id'] # noqa: E501
772+
773+
query_params = []
774+
775+
header_params = {}
776+
if 'x_phrase_app_otp' in local_var_params:
777+
header_params['X-PhraseApp-OTP'] = local_var_params['x_phrase_app_otp'] # noqa: E501
778+
779+
form_params = []
780+
local_var_files = {}
781+
782+
body_params = None
783+
# Authentication setting
784+
auth_settings = ['Basic', 'Token'] # noqa: E501
785+
786+
return self.api_client.call_api(
787+
'/accounts/{account_id}/automations/{automation_id}/trigger', 'POST',
788+
path_params,
789+
query_params,
790+
header_params,
791+
body=body_params,
792+
post_params=form_params,
793+
files=local_var_files,
794+
response_type=None, # noqa: E501
795+
auth_settings=auth_settings,
796+
async_req=local_var_params.get('async_req'),
797+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
798+
_preload_content=local_var_params.get('_preload_content', True),
799+
_request_timeout=local_var_params.get('_request_timeout'),
800+
collection_formats=collection_formats)
801+
678802
def automation_update(self, account_id, id, automations_create_parameters1, **kwargs): # noqa: E501
679803
"""Update an automation # noqa: E501
680804

test/test_automations_api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ def test_automation_show(self):
6262
"""
6363
pass
6464

65+
def test_automation_trigger(self):
66+
"""Test case for automation_trigger
67+
68+
Trigger an automation # noqa: E501
69+
"""
70+
pass
71+
6572
def test_automation_update(self):
6673
"""Test case for automation_update
6774

test/test_key_create_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def make_instance(self, include_optional):
4646
data_type = 'number',
4747
tags = 'awesome-feature,needs-proofreading',
4848
max_characters_allowed = 140,
49-
screenshot = '[B@17b1f9a7',
49+
screenshot = '[B@53de637a',
5050
remove_screenshot = True,
5151
unformatted = True,
5252
default_translation_content = 'Default translation content',

test/test_key_update_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def make_instance(self, include_optional):
4646
data_type = 'number',
4747
tags = 'awesome-feature,needs-proofreading',
4848
max_characters_allowed = 140,
49-
screenshot = '[B@460306ab',
49+
screenshot = '[B@48667fd3',
5050
remove_screenshot = True,
5151
unformatted = True,
5252
xml_space_preserve = True,

test/test_project_create_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def make_instance(self, include_optional):
4141
main_format = 'yml',
4242
media = 'Python',
4343
shares_translation_memory = True,
44-
project_image = '[B@5b936410',
44+
project_image = '[B@5bd93106',
4545
remove_project_image = True,
4646
account_id = 'abcd1234',
4747
point_of_contact = 'abcd1234',

test/test_project_update_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def make_instance(self, include_optional):
4343
main_format = 'yml',
4444
media = 'Python',
4545
shares_translation_memory = True,
46-
project_image = '[B@70143ee4',
46+
project_image = '[B@5b481d77',
4747
remove_project_image = False,
4848
workflow = 'review',
4949
machine_translation_enabled = True,

test/test_screenshot_update_parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def make_instance(self, include_optional):
4040
branch = 'my-feature-branch',
4141
name = 'A screenshot name',
4242
description = 'A screenshot description',
43-
filename = '[B@5742a4bb'
43+
filename = '[B@411d3b5e'
4444
)
4545
else :
4646
return ScreenshotUpdateParameters(

0 commit comments

Comments
 (0)