Skip to content

Latest commit

 

History

History
321 lines (222 loc) · 8.34 KB

AuthorizationsApi.md

File metadata and controls

321 lines (222 loc) · 8.34 KB

Phrase::AuthorizationsApi

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

Method HTTP request Description
authorization_create POST /authorizations Create an authorization
authorization_delete DELETE /authorizations/{id} Delete an authorization
authorization_show GET /authorizations/{id} Get a single authorization
authorization_update PATCH /authorizations/{id} Update an authorization
authorizations_list GET /authorizations List authorizations

authorization_create

AuthorizationWithToken authorization_create(authorization_create_parameters, opts)

Create an authorization

Create a new authorization.

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::AuthorizationsApi.new
authorization_create_parameters = Phrase::AuthorizationCreateParameters.new({note: 'My Deploy Script'}) # AuthorizationCreateParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Create an authorization
  result = api_instance.authorization_create(authorization_create_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling AuthorizationsApi->authorization_create: #{e}"
end

Parameters

Name Type Description Notes
authorization_create_parameters AuthorizationCreateParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(AuthorizationWithToken)>

Authorization

Basic, Token

HTTP request headers

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

authorization_delete

authorization_delete(id, opts)

Delete an authorization

Delete an existing authorization. API calls using that token will stop working.

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::AuthorizationsApi.new
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Delete an authorization
  api_instance.authorization_delete(id, opts)
rescue Phrase::ApiError => e
  puts "Exception when calling AuthorizationsApi->authorization_delete: #{e}"
end

Parameters

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

Return type

Response<(nil (empty response body))>

Authorization

Basic, Token

HTTP request headers

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

authorization_show

Authorization authorization_show(id, opts)

Get a single authorization

Get details on a single authorization.

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::AuthorizationsApi.new
id = 'id_example' # String | ID
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Get a single authorization
  result = api_instance.authorization_show(id, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling AuthorizationsApi->authorization_show: #{e}"
end

Parameters

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

Return type

Response<(Authorization)>

Authorization

Basic, Token

HTTP request headers

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

authorization_update

Authorization authorization_update(id, authorization_update_parameters, opts)

Update an authorization

Update an existing authorization.

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::AuthorizationsApi.new
id = 'id_example' # String | ID
authorization_update_parameters = Phrase::AuthorizationUpdateParameters.new # AuthorizationUpdateParameters | 
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
  #Update an authorization
  result = api_instance.authorization_update(id, authorization_update_parameters, opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling AuthorizationsApi->authorization_update: #{e}"
end

Parameters

Name Type Description Notes
id String ID
authorization_update_parameters AuthorizationUpdateParameters
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]

Return type

Response<(Authorization)>

Authorization

Basic, Token

HTTP request headers

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

authorizations_list

Array<Authorization> authorizations_list(opts)

List authorizations

List all your authorizations.

Example

# load the gem
require 'phrase'
# setup authorization
Phrase.configure do |config|
  # Configure HTTP basic authorization: Basic
  config.username = 'YOUR USERNAME'
  config.password = 'YOUR PASSWORD'

  # Configure API key authorization: Token
  config.api_key['Authorization'] = 'YOUR API KEY'
  config.api_key_prefix['Authorization'] = 'token'
end

api_instance = Phrase::AuthorizationsApi.new
opts = {
  x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
  page: 1, # Integer | Page number
  per_page: 25 # Integer | Limit on the number of objects to be returned, between 1 and 100. 25 by default
}

begin
  #List authorizations
  result = api_instance.authorizations_list(opts)
  pp result
rescue Phrase::ApiError => e
  puts "Exception when calling AuthorizationsApi->authorizations_list: #{e}"
end

Parameters

Name Type Description Notes
x_phrase_app_otp String Two-Factor-Authentication token (optional) [optional]
page Integer Page number [optional]
per_page Integer Limit on the number of objects to be returned, between 1 and 100. 25 by default [optional]

Return type

Response<(Array<Authorization>)>

Authorization

Basic, Token

HTTP request headers

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