Skip to content

Latest commit

 

History

History
370 lines (271 loc) · 16.7 KB

File metadata and controls

370 lines (271 loc) · 16.7 KB

phrase_api.JobCommentsApi

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

Method HTTP request Description
job_comment_create POST /projects/{project_id}/jobs/{job_id}/comments Create a job comment
job_comment_delete DELETE /projects/{project_id}/jobs/{job_id}/comments/{id} Delete a job comment
job_comment_show GET /projects/{project_id}/jobs/{job_id}/comments/{id} Get a single job comment
job_comment_update PATCH /projects/{project_id}/jobs/{job_id}/comments/{id} Update a job comment
job_comments_list GET /projects/{project_id}/jobs/{job_id}/comments List job comments

job_comment_create

JobComment job_comment_create(project_id, job_id, job_comment_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Create a job comment

Create a new comment for 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.JobCommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    job_id = 'job_id_example' # str | Job ID (required)
    job_comment_create_parameters = phrase_api.JobCommentCreateParameters() # JobCommentCreateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Create a job comment
        api_response = api_instance.job_comment_create(project_id, job_id, job_comment_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobCommentsApi->job_comment_create: %s\n" % e)

Parameters

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

Return type

JobComment

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_comment_delete

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

Delete a job comment

Delete an existing job comment.

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.JobCommentsApi(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:
        # Delete a job comment
        api_instance.job_comment_delete(project_id, job_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
    except ApiException as e:
        print("Exception when calling JobCommentsApi->job_comment_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_comment_show

JobComment job_comment_show(project_id, job_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)

Get a single job comment

Get details on a single job comment.

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.JobCommentsApi(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:
        # Get a single job comment
        api_response = api_instance.job_comment_show(project_id, job_id, id, x_phrase_app_otp=x_phrase_app_otp, branch=branch)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobCommentsApi->job_comment_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]

Return type

JobComment

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_comment_update

JobComment job_comment_update(project_id, key_id, id, job_comment_update_parameters, x_phrase_app_otp=x_phrase_app_otp)

Update a job comment

Update an existing job comment.

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.JobCommentsApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    key_id = 'key_id_example' # str | Translation Key ID (required)
    id = 'id_example' # str | ID (required)
    job_comment_update_parameters = phrase_api.JobCommentUpdateParameters() # JobCommentUpdateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Update a job comment
        api_response = api_instance.job_comment_update(project_id, key_id, id, job_comment_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobCommentsApi->job_comment_update: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
key_id str Translation Key ID
id str ID
job_comment_update_parameters JobCommentUpdateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

JobComment

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_comments_list

List[JobComment] job_comments_list(project_id, job_id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, order=order)

List job comments

List all comments for 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.JobCommentsApi(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)
    branch = 'my-feature-branch' # str | Branch to use
    order = 'desc' # str | Order direction. Can be one of: asc, desc.

    try:
        # List job comments
        api_response = api_instance.job_comments_list(project_id, job_id, x_phrase_app_otp=x_phrase_app_otp, branch=branch, order=order)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling JobCommentsApi->job_comments_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]
branch str Branch to use [optional]
order str Order direction. Can be one of: asc, desc. [optional]

Return type

List[JobComment]

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]