Skip to content

Latest commit

 

History

History
358 lines (259 loc) · 14.2 KB

BlacklistedKeysApi.md

File metadata and controls

358 lines (259 loc) · 14.2 KB

phrase_api.BlacklistedKeysApi

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

Method HTTP request Description
blacklisted_key_create POST /projects/{project_id}/blacklisted_keys Create a blocked key
blacklisted_key_delete DELETE /projects/{project_id}/blacklisted_keys/{id} Delete a blocked key
blacklisted_key_show GET /projects/{project_id}/blacklisted_keys/{id} Get a single blocked key
blacklisted_key_update PATCH /projects/{project_id}/blacklisted_keys/{id} Update a blocked key
blacklisted_keys_list GET /projects/{project_id}/blacklisted_keys List blocked keys

blacklisted_key_create

BlacklistedKey blacklisted_key_create(project_id, blacklisted_key_create_parameters, x_phrase_app_otp=x_phrase_app_otp)

Create a blocked key

Create a new rule for blocking keys.

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

    try:
        # Create a blocked key
        api_response = api_instance.blacklisted_key_create(project_id, blacklisted_key_create_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BlacklistedKeysApi->blacklisted_key_create: %s\n" % e)

Parameters

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

Return type

BlacklistedKey

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]

blacklisted_key_delete

blacklisted_key_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp)

Delete a blocked key

Delete an existing rule for blocking keys.

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

    try:
        # Delete a blocked key
        api_instance.blacklisted_key_delete(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
    except ApiException as e:
        print("Exception when calling BlacklistedKeysApi->blacklisted_key_delete: %s\n" % e)

Parameters

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

blacklisted_key_show

BlacklistedKey blacklisted_key_show(project_id, id, x_phrase_app_otp=x_phrase_app_otp)

Get a single blocked key

Get details on a single rule for blocking keys 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.BlacklistedKeysApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    id = 'id_example' # str | ID (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Get a single blocked key
        api_response = api_instance.blacklisted_key_show(project_id, id, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BlacklistedKeysApi->blacklisted_key_show: %s\n" % e)

Parameters

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

Return type

BlacklistedKey

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]

blacklisted_key_update

BlacklistedKey blacklisted_key_update(project_id, id, blacklisted_key_update_parameters, x_phrase_app_otp=x_phrase_app_otp)

Update a blocked key

Update an existing rule for blocking keys.

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.BlacklistedKeysApi(api_client)
    project_id = 'project_id_example' # str | Project ID (required)
    id = 'id_example' # str | ID (required)
    blacklisted_key_update_parameters = phrase_api.BlacklistedKeyUpdateParameters() # BlacklistedKeyUpdateParameters |  (required)
    x_phrase_app_otp = 'x_phrase_app_otp_example' # str | Two-Factor-Authentication token (optional)

    try:
        # Update a blocked key
        api_response = api_instance.blacklisted_key_update(project_id, id, blacklisted_key_update_parameters, x_phrase_app_otp=x_phrase_app_otp)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BlacklistedKeysApi->blacklisted_key_update: %s\n" % e)

Parameters

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

Return type

BlacklistedKey

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]

blacklisted_keys_list

List[BlacklistedKey] blacklisted_keys_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch)

List blocked keys

List all rules for blocking keys for the 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.BlacklistedKeysApi(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
    branch = 'my-feature-branch' # str | specify the branch to use

    try:
        # List blocked keys
        api_response = api_instance.blacklisted_keys_list(project_id, x_phrase_app_otp=x_phrase_app_otp, page=page, per_page=per_page, branch=branch)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling BlacklistedKeysApi->blacklisted_keys_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]
branch str specify the branch to use [optional]

Return type

List[BlacklistedKey]

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]