Skip to content

Commit 505047d

Browse files
author
Phrase
committed
Deploying from phrase/openapi@f670e276
1 parent dbcca37 commit 505047d

14 files changed

+252
-29
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ docs/JobCompleteParameters.md
8787
docs/JobCreateParameters.md
8888
docs/JobDetails.md
8989
docs/JobKeysCreateParameters.md
90+
docs/JobKeysDeleteParameters.md
9091
docs/JobLocale.md
9192
docs/JobLocaleCompleteParameters.md
9293
docs/JobLocaleCompleteReviewParameters.md
@@ -396,6 +397,7 @@ phrase_api/models/job_complete_parameters.py
396397
phrase_api/models/job_create_parameters.py
397398
phrase_api/models/job_details.py
398399
phrase_api/models/job_keys_create_parameters.py
400+
phrase_api/models/job_keys_delete_parameters.py
399401
phrase_api/models/job_locale.py
400402
phrase_api/models/job_locale_complete_parameters.py
401403
phrase_api/models/job_locale_complete_review_parameters.py
@@ -633,6 +635,7 @@ test/test_job_complete_parameters.py
633635
test/test_job_create_parameters.py
634636
test/test_job_details.py
635637
test/test_job_keys_create_parameters.py
638+
test/test_job_keys_delete_parameters.py
636639
test/test_job_locale.py
637640
test/test_job_locale_complete_parameters.py
638641
test/test_job_locale_complete_review_parameters.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ Class | Method | HTTP request | Description
481481
- [JobCreateParameters](docs/JobCreateParameters.md)
482482
- [JobDetails](docs/JobDetails.md)
483483
- [JobKeysCreateParameters](docs/JobKeysCreateParameters.md)
484+
- [JobKeysDeleteParameters](docs/JobKeysDeleteParameters.md)
484485
- [JobLocale](docs/JobLocale.md)
485486
- [JobLocaleCompleteParameters](docs/JobLocaleCompleteParameters.md)
486487
- [JobLocaleCompleteReviewParameters](docs/JobLocaleCompleteReviewParameters.md)

docs/JobKeysDeleteParameters.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# JobKeysDeleteParameters
2+
3+
## Properties
4+
Name | Type | Description | Notes
5+
------------ | ------------- | ------------- | -------------
6+
**branch** | **str** | specify the branch to use | [optional]
7+
**translation_key_ids** | **List[str]** | ids of keys that should be deleted from the job |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+

docs/JobsApi.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Name | Type | Description | Notes
297297
[[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)
298298

299299
# **job_keys_delete**
300-
> job_keys_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, translation_key_ids=translation_key_ids)
300+
> job_keys_delete(project_id, id, job_keys_delete_parameters, x_phrase_app_otp=x_phrase_app_otp)
301301
302302
Remove keys from job
303303

@@ -322,13 +322,12 @@ with phrase_api.ApiClient(configuration) as api_client:
322322
api_instance = phrase_api.JobsApi(api_client)
323323
project_id = 'project_id_example' # str | Project ID (required)
324324
id = 'id_example' # str | ID (required)
325+
job_keys_delete_parameters = phrase_api.JobKeysDeleteParameters() # JobKeysDeleteParameters | (required)
325326
x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
326-
branch = 'my-feature-branch' # str | specify the branch to use
327-
translation_key_ids = ['[\"abcd1234cdef1234abcd1234cdef1234\"]'] # List[str] | ids of keys that should be removed from the job
328327

329328
try:
330329
# Remove keys from job
331-
api_instance.job_keys_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, translation_key_ids=translation_key_ids)
330+
api_instance.job_keys_delete(project_id, id, job_keys_delete_parameters, x_phrase_app_otp=x_phrase_app_otp)
332331
except ApiException as e:
333332
print("Exception when calling JobsApi->job_keys_delete: %s\n" % e)
334333
```
@@ -340,9 +339,8 @@ Name | Type | Description | Notes
340339
------------- | ------------- | ------------- | -------------
341340
**project_id** | **str**| Project ID |
342341
**id** | **str**| ID |
342+
**job_keys_delete_parameters** | [**JobKeysDeleteParameters**](JobKeysDeleteParameters.md)| |
343343
**x_phrase_app_otp** | **str**| Two-Factor-Authentication token (optional) | [optional]
344-
**branch** | **str**| specify the branch to use | [optional]
345-
**translation_key_ids** | [**List[str]**](str.md)| ids of keys that should be removed from the job | [optional]
346344

347345
### Return type
348346

@@ -354,7 +352,7 @@ void (empty response body)
354352

355353
### HTTP request headers
356354

357-
- **Content-Type**: Not defined
355+
- **Content-Type**: application/json
358356
- **Accept**: Not defined
359357

360358
### HTTP response details

phrase_api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
from phrase_api.models.job_create_parameters import JobCreateParameters
146146
from phrase_api.models.job_details import JobDetails
147147
from phrase_api.models.job_keys_create_parameters import JobKeysCreateParameters
148+
from phrase_api.models.job_keys_delete_parameters import JobKeysDeleteParameters
148149
from phrase_api.models.job_locale import JobLocale
149150
from phrase_api.models.job_locale_complete_parameters import JobLocaleCompleteParameters
150151
from phrase_api.models.job_locale_complete_review_parameters import JobLocaleCompleteReviewParameters

phrase_api/api/jobs_api.py

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -578,21 +578,20 @@ def job_keys_create_with_http_info(self, project_id, id, job_keys_create_paramet
578578
_request_timeout=local_var_params.get('_request_timeout'),
579579
collection_formats=collection_formats)
580580

581-
def job_keys_delete(self, project_id, id, **kwargs): # noqa: E501
581+
def job_keys_delete(self, project_id, id, job_keys_delete_parameters, **kwargs): # noqa: E501
582582
"""Remove keys from job # noqa: E501
583583
584584
Remove multiple keys from existing job. # noqa: E501
585585
This method makes a synchronous HTTP request by default. To make an
586586
asynchronous HTTP request, please pass async_req=True
587-
>>> thread = api.job_keys_delete(project_id, id, async_req=True)
587+
>>> thread = api.job_keys_delete(project_id, id, job_keys_delete_parameters, async_req=True)
588588
>>> result = thread.get()
589589
590590
:param async_req bool: execute request asynchronously
591591
:param str project_id: Project ID (required)
592592
:param str id: ID (required)
593+
:param JobKeysDeleteParameters job_keys_delete_parameters: (required)
593594
:param str x_phrase_app_otp: Two-Factor-Authentication token (optional)
594-
:param str branch: specify the branch to use
595-
:param List[str] translation_key_ids: ids of keys that should be removed from the job
596595
:param _preload_content: if False, the urllib3.HTTPResponse object will
597596
be returned without reading/decoding response
598597
data. Default is True.
@@ -605,23 +604,22 @@ def job_keys_delete(self, project_id, id, **kwargs): # noqa: E501
605604
returns the request thread.
606605
"""
607606
kwargs['_return_http_data_only'] = True
608-
return self.job_keys_delete_with_http_info(project_id, id, **kwargs) # noqa: E501
607+
return self.job_keys_delete_with_http_info(project_id, id, job_keys_delete_parameters, **kwargs) # noqa: E501
609608

610-
def job_keys_delete_with_http_info(self, project_id, id, **kwargs): # noqa: E501
609+
def job_keys_delete_with_http_info(self, project_id, id, job_keys_delete_parameters, **kwargs): # noqa: E501
611610
"""Remove keys from job # noqa: E501
612611
613612
Remove multiple keys from existing job. # noqa: E501
614613
This method makes a synchronous HTTP request by default. To make an
615614
asynchronous HTTP request, please pass async_req=True
616-
>>> thread = api.job_keys_delete_with_http_info(project_id, id, async_req=True)
615+
>>> thread = api.job_keys_delete_with_http_info(project_id, id, job_keys_delete_parameters, async_req=True)
617616
>>> result = thread.get()
618617
619618
:param async_req bool: execute request asynchronously
620619
:param str project_id: Project ID (required)
621620
:param str id: ID (required)
621+
:param JobKeysDeleteParameters job_keys_delete_parameters: (required)
622622
:param str x_phrase_app_otp: Two-Factor-Authentication token (optional)
623-
:param str branch: specify the branch to use
624-
:param List[str] translation_key_ids: ids of keys that should be removed from the job
625623
:param _return_http_data_only: response data without head status code
626624
and headers
627625
:param _preload_content: if False, the urllib3.HTTPResponse object will
@@ -641,9 +639,8 @@ def job_keys_delete_with_http_info(self, project_id, id, **kwargs): # noqa: E50
641639
all_params = [
642640
'project_id',
643641
'id',
644-
'x_phrase_app_otp',
645-
'branch',
646-
'translation_key_ids'
642+
'job_keys_delete_parameters',
643+
'x_phrase_app_otp'
647644
]
648645
all_params.extend(
649646
[
@@ -670,6 +667,10 @@ def job_keys_delete_with_http_info(self, project_id, id, **kwargs): # noqa: E50
670667
if self.api_client.client_side_validation and ('id' not in local_var_params or # noqa: E501
671668
local_var_params['id'] is None): # noqa: E501
672669
raise ApiValueError("Missing the required parameter `id` when calling `job_keys_delete`") # noqa: E501
670+
# verify the required parameter 'job_keys_delete_parameters' is set
671+
if self.api_client.client_side_validation and ('job_keys_delete_parameters' not in local_var_params or # noqa: E501
672+
local_var_params['job_keys_delete_parameters'] is None): # noqa: E501
673+
raise ApiValueError("Missing the required parameter `job_keys_delete_parameters` when calling `job_keys_delete`") # noqa: E501
673674

674675
collection_formats = {}
675676

@@ -680,11 +681,6 @@ def job_keys_delete_with_http_info(self, project_id, id, **kwargs): # noqa: E50
680681
path_params['id'] = local_var_params['id'] # noqa: E501
681682

682683
query_params = []
683-
if 'branch' in local_var_params and local_var_params['branch'] is not None: # noqa: E501
684-
query_params.append(('branch', local_var_params['branch'])) # noqa: E501
685-
if 'translation_key_ids' in local_var_params and local_var_params['translation_key_ids'] is not None: # noqa: E501
686-
query_params.append(('translation_key_ids', local_var_params['translation_key_ids'])) # noqa: E501
687-
collection_formats['translation_key_ids'] = 'multi' # noqa: E501
688684

689685
header_params = {}
690686
if 'x_phrase_app_otp' in local_var_params:
@@ -694,6 +690,12 @@ def job_keys_delete_with_http_info(self, project_id, id, **kwargs): # noqa: E50
694690
local_var_files = {}
695691

696692
body_params = None
693+
if 'job_keys_delete_parameters' in local_var_params:
694+
body_params = local_var_params['job_keys_delete_parameters']
695+
# HTTP header `Content-Type`
696+
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
697+
['application/json']) # noqa: E501
698+
697699
# Authentication setting
698700
auth_settings = ['Basic', 'Token'] # noqa: E501
699701

phrase_api/models/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
from phrase_api.models.job_create_parameters import JobCreateParameters
7979
from phrase_api.models.job_details import JobDetails
8080
from phrase_api.models.job_keys_create_parameters import JobKeysCreateParameters
81+
from phrase_api.models.job_keys_delete_parameters import JobKeysDeleteParameters
8182
from phrase_api.models.job_locale import JobLocale
8283
from phrase_api.models.job_locale_complete_parameters import JobLocaleCompleteParameters
8384
from phrase_api.models.job_locale_complete_review_parameters import JobLocaleCompleteReviewParameters
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# coding: utf-8
2+
3+
"""
4+
Phrase Strings API Reference
5+
6+
The version of the OpenAPI document: 2.0.0
7+
8+
Generated by: https://openapi-generator.tech
9+
"""
10+
11+
12+
import pprint
13+
import re # noqa: F401
14+
15+
import six
16+
17+
from phrase_api.configuration import Configuration
18+
19+
20+
class JobKeysDeleteParameters(object):
21+
"""NOTE: This class is auto generated by OpenAPI Generator.
22+
Ref: https://openapi-generator.tech
23+
24+
Do not edit the class manually.
25+
"""
26+
27+
"""
28+
Attributes:
29+
openapi_types (dict): The key is attribute name
30+
and the value is attribute type.
31+
attribute_map (dict): The key is attribute name
32+
and the value is json key in definition.
33+
"""
34+
openapi_types = {
35+
'branch': 'str',
36+
'translation_key_ids': 'List[str]'
37+
}
38+
39+
attribute_map = {
40+
'branch': 'branch',
41+
'translation_key_ids': 'translation_key_ids'
42+
}
43+
44+
def __init__(self, branch=None, translation_key_ids=None, local_vars_configuration=None): # noqa: E501
45+
"""JobKeysDeleteParameters - a model defined in OpenAPI""" # noqa: E501
46+
if local_vars_configuration is None:
47+
local_vars_configuration = Configuration()
48+
self.local_vars_configuration = local_vars_configuration
49+
50+
self._branch = None
51+
self._translation_key_ids = None
52+
self.discriminator = None
53+
54+
if branch is not None:
55+
self.branch = branch
56+
self.translation_key_ids = translation_key_ids
57+
58+
@property
59+
def branch(self):
60+
"""Gets the branch of this JobKeysDeleteParameters. # noqa: E501
61+
62+
specify the branch to use # noqa: E501
63+
64+
:return: The branch of this JobKeysDeleteParameters. # noqa: E501
65+
:rtype: str
66+
"""
67+
return self._branch
68+
69+
@branch.setter
70+
def branch(self, branch):
71+
"""Sets the branch of this JobKeysDeleteParameters.
72+
73+
specify the branch to use # noqa: E501
74+
75+
:param branch: The branch of this JobKeysDeleteParameters. # noqa: E501
76+
:type: str
77+
"""
78+
79+
self._branch = branch
80+
81+
@property
82+
def translation_key_ids(self):
83+
"""Gets the translation_key_ids of this JobKeysDeleteParameters. # noqa: E501
84+
85+
ids of keys that should be deleted from the job # noqa: E501
86+
87+
:return: The translation_key_ids of this JobKeysDeleteParameters. # noqa: E501
88+
:rtype: List[str]
89+
"""
90+
return self._translation_key_ids
91+
92+
@translation_key_ids.setter
93+
def translation_key_ids(self, translation_key_ids):
94+
"""Sets the translation_key_ids of this JobKeysDeleteParameters.
95+
96+
ids of keys that should be deleted from the job # noqa: E501
97+
98+
:param translation_key_ids: The translation_key_ids of this JobKeysDeleteParameters. # noqa: E501
99+
:type: List[str]
100+
"""
101+
if self.local_vars_configuration.client_side_validation and translation_key_ids is None: # noqa: E501
102+
raise ValueError("Invalid value for `translation_key_ids`, must not be `None`") # noqa: E501
103+
104+
self._translation_key_ids = translation_key_ids
105+
106+
def to_dict(self):
107+
"""Returns the model properties as a dict"""
108+
result = {}
109+
110+
for attr, _ in six.iteritems(self.openapi_types):
111+
value = getattr(self, attr)
112+
if isinstance(value, list):
113+
result[attr] = list(map(
114+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
115+
value
116+
))
117+
elif hasattr(value, "to_dict"):
118+
result[attr] = value.to_dict()
119+
elif isinstance(value, dict):
120+
result[attr] = dict(map(
121+
lambda item: (item[0], item[1].to_dict())
122+
if hasattr(item[1], "to_dict") else item,
123+
value.items()
124+
))
125+
else:
126+
result[attr] = value
127+
128+
return result
129+
130+
def to_str(self):
131+
"""Returns the string representation of the model"""
132+
return pprint.pformat(self.to_dict())
133+
134+
def __repr__(self):
135+
"""For `print` and `pprint`"""
136+
return self.to_str()
137+
138+
def __eq__(self, other):
139+
"""Returns true if both objects are equal"""
140+
if not isinstance(other, JobKeysDeleteParameters):
141+
return False
142+
143+
return self.to_dict() == other.to_dict()
144+
145+
def __ne__(self, other):
146+
"""Returns true if both objects are not equal"""
147+
if not isinstance(other, JobKeysDeleteParameters):
148+
return True
149+
150+
return self.to_dict() != other.to_dict()

0 commit comments

Comments
 (0)