Skip to content

Latest commit

 

History

History
595 lines (439 loc) · 27.9 KB

File metadata and controls

595 lines (439 loc) · 27.9 KB

phrase_api.JobLocalesApi

All URIs are relative to https://api.phrase.com/v2

Method HTTP request Description
job_locale_complete POST /projects/{project_id}/jobs/{job_id}/locales/{id}/complete Complete a job locale
job_locale_complete_review POST /projects/{project_id}/jobs/{job_id}/locales/{id}/complete_review Review a job locale
job_locale_delete DELETE /projects/{project_id}/jobs/{job_id}/locales/{id} Remove a target locale from a job
job_locale_reopen POST /projects/{project_id}/jobs/{job_id}/locales/{id}/reopen Reopen a job locale
job_locale_show GET /projects/{project_id}/jobs/{job_id}/locales/{id} Show single job target locale
job_locale_update PATCH /projects/{project_id}/jobs/{job_id}/locales/{id} Update a job target locale
job_locales_create POST /projects/{project_id}/jobs/{job_id}/locales Add a target locale to a job
job_locales_list GET /projects/{project_id}/jobs/{job_id}/locales List job target locales

job_locale_complete

JobLocale job_locale_complete(project_id, job_id, id, job_locale_complete_parameters, x_phrase_app_otp=x_phrase_app_otp)

Complete a job locale

Mark a job locale as completed.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    id = 'id_example' # str | ID (required)
    job_locale_complete_parameters = phrase_api.JobLocaleCompleteParameters() # JobLocaleCompleteParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Complete a job locale
        api_response = api_instance.job_locale_complete(project_id, job_id, id, job_locale_complete_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locale_complete: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
id str ID
job_locale_complete_parameters JobLocaleCompleteParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

JobLocale

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

job_locale_complete_review

JobLocale job_locale_complete_review(project_id, job_id, id, job_locale_complete_review_parameters, x_phrase_app_otp=x_phrase_app_otp)

Review a job locale

Mark job locale as reviewed.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    id = 'id_example' # str | ID (required)
    job_locale_complete_review_parameters = phrase_api.JobLocaleCompleteReviewParameters() # JobLocaleCompleteReviewParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Review a job locale
        api_response = api_instance.job_locale_complete_review(project_id, job_id, id, job_locale_complete_review_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locale_complete_review: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
id str ID
job_locale_complete_review_parameters JobLocaleCompleteReviewParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

JobLocale

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

job_locale_delete

job_locale_delete(project_id, job_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Remove a target locale from a job

Removes a target locale from a job.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    branch = 'my-feature-branch' # str | Branch to use

    try:
        # Remove a target locale from a job
        api_instance.job_locale_delete(project_id, job_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locale_delete: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
id str ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]
branch str Branch to use [optional]

Return type

void (empty response body)

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 The resource was deleted successfully. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

job_locale_reopen

JobLocale job_locale_reopen(project_id, job_id, id, job_locale_reopen_parameters, x_phrase_app_otp=x_phrase_app_otp)

Reopen a job locale

Mark a job locale as uncompleted.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    id = 'id_example' # str | ID (required)
    job_locale_reopen_parameters = phrase_api.JobLocaleReopenParameters() # JobLocaleReopenParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Reopen a job locale
        api_response = api_instance.job_locale_reopen(project_id, job_id, id, job_locale_reopen_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locale_reopen: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
id str ID
job_locale_reopen_parameters JobLocaleReopenParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

JobLocale

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

job_locale_show

JobLocale job_locale_show(project_id, job_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, include_annotations=include_annotations)

Show single job target locale

Get a single target locale for a given job.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    branch = 'my-feature-branch' # str | Branch to use
    include_annotations = False # bool | Include job-locale annotations in the response (default to False)

    try:
        # Show single job target locale
        api_response = api_instance.job_locale_show(project_id, job_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, include_annotations=include_annotations)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locale_show: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
id str ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]
branch str Branch to use [optional]
include_annotations bool Include job-locale annotations in the response [optional] [default to False]

Return type

JobLocale

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

job_locale_update

JobLocale job_locale_update(project_id, job_id, id, job_locale_update_parameters, x_phrase_app_otp=x_phrase_app_otp)

Update a job target locale

Update an existing job target locale.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    id = 'id_example' # str | ID (required)
    job_locale_update_parameters = phrase_api.JobLocaleUpdateParameters() # JobLocaleUpdateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Update a job target locale
        api_response = api_instance.job_locale_update(project_id, job_id, id, job_locale_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locale_update: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
id str ID
job_locale_update_parameters JobLocaleUpdateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

JobLocale

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

job_locales_create

JobLocale job_locales_create(project_id, job_id, job_locales_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Add a target locale to a job

Adds a target locale to a job.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    job_locales_create_parameters = phrase_api.JobLocalesCreateParameters() # JobLocalesCreateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Add a target locale to a job
        api_response = api_instance.job_locales_create(project_id, job_id, job_locales_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locales_create: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
job_locales_create_parameters JobLocalesCreateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

JobLocale

Authorization

Basic, Token

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Created * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

job_locales_list

List[JobLocale] job_locales_list(project_id, job_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch, include_annotations=include_annotations)

List job target locales

List all target locales for a given job.

Example

from __future__ import print_function
import time
import phrase_api
from phrase_api.rest import ApiException
from pprint import pprint

configuration = phrase_api.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
configuration.api_key_prefix['Authorization'] = 'token'

# Enter a context with an instance of the API client
with phrase_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = phrase_api.JobLocalesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)
    page = 1 # int | Page number
    per_page = 25 # int | Limit on the number of objects to be returned, between 1 and 100. 25 by default
    branch = 'my-feature-branch' # str | Branch to use
    include_annotations = False # bool | Include job-locale annotations in the response (default to False)

    try:
        # List job target locales
        api_response = api_instance.job_locales_list(project_id, job_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch, include_annotations=include_annotations)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobLocalesApi->job_locales_list: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
job_id str Job ID
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]
page int Page number [optional]
per_page int Limit on the number of objects to be returned, between 1 and 100. 25 by default [optional]
branch str Branch to use [optional]
include_annotations bool Include job-locale annotations in the response [optional] [default to False]

Return type

List[JobLocale]

Authorization

Basic, Token

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 OK * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
* Link -
* Pagination -
400 Bad request. The request could not be parsed or a parameter failed validation. Verify the request body, the content type, and the parameter types, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not found. The requested resource does not exist or is not visible to the authenticated user. Verify the identifiers in the request path and that the token has access to them, then retry. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Too many requests. The rate limit has been exceeded. Wait until the time indicated by the `X-Rate-Limit-Reset` response header before retrying. * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -

[Back to top] [Back to API list] [Back to Model list] [Back to README]