Skip to content

Latest commit

 

History

History
356 lines (257 loc) · 13.5 KB

VariablesApi.md

File metadata and controls

356 lines (257 loc) · 13.5 KB

phrase_api.VariablesApi

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

Method HTTP request Description
variable_create POST /projects/{project_id}/variables Create a variable
variable_delete DELETE /projects/{project_id}/variables/{name} Delete a variable
variable_show GET /projects/{project_id}/variables/{name} Get a single variable
variable_update PATCH /projects/{project_id}/variables/{name} Update a variable
variables_list GET /projects/{project_id}/variables List variables

variable_create

Variable variable_create(project_id, variable_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Create a variable

Create a new variable.

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.VariablesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    variable_create_parameters = phrase_api.VariableCreateParameters() # VariableCreateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Create a variable
        api_response = api_instance.variable_create(project_id, variable_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling VariablesApi->variable_create: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
variable_create_parameters VariableCreateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

Variable

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 * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * 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]

variable_delete

variable_delete(project_id, name, x_phrase_app_otp=x_phrase_app_otp)

Delete a variable

Delete an existing variable.

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.VariablesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    name = 'name_example' # str | name (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Delete a variable
        api_instance.variable_delete(project_id, name, x_phrase_app_otp=x_phrase_app_otp)
    except ApiException as e:
        print("Exception when calling VariablesApi->variable_delete: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
name str name
x_phrase_app_otp str Two-Factor-Authentication token (optional) [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 * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * 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]

variable_show

Variable variable_show(project_id, name, x_phrase_app_otp=x_phrase_app_otp)

Get a single variable

Get details on a single variable for a given project.

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.VariablesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    name = 'name_example' # str | name (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Get a single variable
        api_response = api_instance.variable_show(project_id, name, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling VariablesApi->variable_show: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
name str name
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

Variable

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 * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * 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]

variable_update

Variable variable_update(project_id, name, variable_update_parameters, x_phrase_app_otp=x_phrase_app_otp)

Update a variable

Update an existing variable.

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.VariablesApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    name = 'name_example' # str | name (required)
    variable_update_parameters = phrase_api.VariableUpdateParameters() # VariableUpdateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Update a variable
        api_response = api_instance.variable_update(project_id, name, variable_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling VariablesApi->variable_update: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project ID
name str name
variable_update_parameters VariableUpdateParameters
x_phrase_app_otp str Two-Factor-Authentication token (optional) [optional]

Return type

Variable

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 * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * 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]

variables_list

List[Variable] variables_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page)

List variables

List all variables for the current project.

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.VariablesApi(api_client)
    project_id = 'project_id_example' # str | Project 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

    try:
        # List variables
        api_response = api_instance.variables_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling VariablesApi->variables_list: %s\n" % e)

Parameters

Name Type Description Notes
project_id str Project 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]

Return type

List[Variable]

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 * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
404 Not Found * X-Rate-Limit-Limit -
* X-Rate-Limit-Remaining -
* X-Rate-Limit-Reset -
429 Rate Limiting * 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]