Skip to content

Commit

Permalink
Deploying from phrase/openapi@e201d136
Browse files Browse the repository at this point in the history
  • Loading branch information
Phrase committed Nov 20, 2024
1 parent 0baf949 commit 32b1b41
Show file tree
Hide file tree
Showing 20 changed files with 334 additions and 51 deletions.
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ docs/BranchUpdateParameters.md
docs/BranchesApi.md
docs/Comment.md
docs/CommentCreateParameters.md
docs/CommentCreateParameters1.md
docs/CommentMarkReadParameters.md
docs/CommentReaction.md
docs/CommentReactionsApi.md
Expand Down Expand Up @@ -370,6 +371,7 @@ lib/phrase/models/branch_name.rb
lib/phrase/models/branch_update_parameters.rb
lib/phrase/models/comment.rb
lib/phrase/models/comment_create_parameters.rb
lib/phrase/models/comment_create_parameters1.rb
lib/phrase/models/comment_mark_read_parameters.rb
lib/phrase/models/comment_reaction.rb
lib/phrase/models/comment_update_parameters.rb
Expand Down Expand Up @@ -649,6 +651,7 @@ spec/models/branch_merge_parameters_spec.rb
spec/models/branch_name_spec.rb
spec/models/branch_spec.rb
spec/models/branch_update_parameters_spec.rb
spec/models/comment_create_parameters1_spec.rb
spec/models/comment_create_parameters_spec.rb
spec/models/comment_mark_read_parameters_spec.rb
spec/models/comment_reaction_spec.rb
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ Class | Method | HTTP request | Description
- [Phrase::BranchUpdateParameters](docs/BranchUpdateParameters.md)
- [Phrase::Comment](docs/Comment.md)
- [Phrase::CommentCreateParameters](docs/CommentCreateParameters.md)
- [Phrase::CommentCreateParameters1](docs/CommentCreateParameters1.md)
- [Phrase::CommentMarkReadParameters](docs/CommentMarkReadParameters.md)
- [Phrase::CommentReaction](docs/CommentReaction.md)
- [Phrase::CommentUpdateParameters](docs/CommentUpdateParameters.md)
Expand Down
8 changes: 5 additions & 3 deletions docs/CommentCreateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **String** | Comment message |
**branch** | **String** | specify the branch to use | [optional]
**message** | **String** | Comment message | [optional]
**locale_ids** | **Array<String>** | specify the locales for the comment | [optional]

## Code Sample

```ruby
require 'Phrase'

instance = Phrase::CommentCreateParameters.new(branch: my-feature-branch,
message: Some message...)
instance = Phrase::CommentCreateParameters.new(message: Some message...,
branch: my-feature-branch,
locale_ids: ["someId","someOtherId"])
```


19 changes: 19 additions & 0 deletions docs/CommentCreateParameters1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Phrase::CommentCreateParameters1

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **String** | Reply message body |
**branch** | **String** | Specify the branch to use | [optional]

## Code Sample

```ruby
require 'Phrase'

instance = Phrase::CommentCreateParameters1.new(message: Some message...,
branch: my-feature-branch)
```


14 changes: 6 additions & 8 deletions docs/CommentRepliesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Response<([**Array&lt;Comment&gt;**](Comment.md))>

## reply_create

> Comment reply_create(project_id, key_id, comment_id, opts)
> Comment reply_create(project_id, key_id, comment_id, comment_create_parameters1, opts)
Create a reply

Expand All @@ -120,15 +120,14 @@ api_instance = Phrase::CommentRepliesApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
comment_id = 'comment_id_example' # String | Comment ID
comment_create_parameters1 = Phrase::CommentCreateParameters1.new({message: 'Some message...'}) # CommentCreateParameters1 |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
branch: 'my-feature-branch', # String | specify the branch to use
message: 'some message...' # String | specify the message for the comment
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
#Create a reply
result = api_instance.reply_create(project_id, key_id, comment_id, opts)
result = api_instance.reply_create(project_id, key_id, comment_id, comment_create_parameters1, opts)
pp result
rescue Phrase::ApiError => e
puts "Exception when calling CommentRepliesApi->reply_create: #{e}"
Expand All @@ -143,9 +142,8 @@ Name | Type | Description | Notes
**project_id** | **String**| Project ID |
**key_id** | **String**| Translation Key ID |
**comment_id** | **String**| Comment ID |
**comment_create_parameters1** | [**CommentCreateParameters1**](CommentCreateParameters1.md)| |
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
**branch** | **String**| specify the branch to use | [optional]
**message** | **String**| specify the message for the comment | [optional]

### Return type

Expand All @@ -157,7 +155,7 @@ Response<([**Comment**](Comment.md))>

### HTTP request headers

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


Expand Down
8 changes: 2 additions & 6 deletions docs/CommentsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ end
api_instance = Phrase::CommentsApi.new
project_id = 'project_id_example' # String | Project ID
key_id = 'key_id_example' # String | Translation Key ID
comment_create_parameters = Phrase::CommentCreateParameters.new # CommentCreateParameters |
comment_create_parameters = Phrase::CommentCreateParameters.new({message: 'Some message...'}) # CommentCreateParameters |
opts = {
x_phrase_app_otp: 'x_phrase_app_otp_example', # String | Two-Factor-Authentication token (optional)
message: 'some message...', # String | specify the message for the comment
locale_ids: ['inner_example'] # Array<String> | specify the locales for the comment
x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional)
}

begin
Expand All @@ -67,8 +65,6 @@ Name | Type | Description | Notes
**key_id** | **String**| Translation Key ID |
**comment_create_parameters** | [**CommentCreateParameters**](CommentCreateParameters.md)| |
**x_phrase_app_otp** | **String**| Two-Factor-Authentication token (optional) | [optional]
**message** | **String**| specify the message for the comment | [optional]
**locale_ids** | [**Array&lt;String&gt;**](String.md)| specify the locales for the comment | [optional]

### Return type

Expand Down
2 changes: 1 addition & 1 deletion docs/KeyCreateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ instance = Phrase::KeyCreateParameters.new(branch: my-feature-branch,
data_type: number,
tags: awesome-feature,needs-proofreading,
max_characters_allowed: 140,
screenshot: [B@3c32105c,
screenshot: [B@38b65eb9,
remove_screenshot: null,
unformatted: null,
default_translation_content: Default translation content,
Expand Down
2 changes: 1 addition & 1 deletion docs/KeyUpdateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ instance = Phrase::KeyUpdateParameters.new(branch: my-feature-branch,
data_type: number,
tags: awesome-feature,needs-proofreading,
max_characters_allowed: 140,
screenshot: [B@39a54d70,
screenshot: [B@3c32105c,
remove_screenshot: null,
unformatted: null,
xml_space_preserve: null,
Expand Down
2 changes: 1 addition & 1 deletion docs/ProjectCreateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ instance = Phrase::ProjectCreateParameters.new(name: My Android Project,
main_format: yml,
media: Python,
shares_translation_memory: true,
project_image: [B@4c49193a,
project_image: [B@2bd89b8e,
remove_project_image: null,
account_id: abcd1234,
point_of_contact: abcd1234,
Expand Down
2 changes: 1 addition & 1 deletion docs/ProjectUpdateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ instance = Phrase::ProjectUpdateParameters.new(account_id: abcd1234,
main_format: yml,
media: Python,
shares_translation_memory: true,
project_image: [B@b51d862,
project_image: [B@4c49193a,
remove_project_image: false,
workflow: review,
machine_translation_enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion docs/ScreenshotUpdateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ require 'Phrase'
instance = Phrase::ScreenshotUpdateParameters.new(branch: my-feature-branch,
name: A screenshot name,
description: A screenshot description,
filename: [B@38b65eb9)
filename: [B@575dab37)
```


1 change: 1 addition & 0 deletions lib/phrase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
require 'phrase/models/branch_update_parameters'
require 'phrase/models/comment'
require 'phrase/models/comment_create_parameters'
require 'phrase/models/comment_create_parameters1'
require 'phrase/models/comment_mark_read_parameters'
require 'phrase/models/comment_reaction'
require 'phrase/models/comment_update_parameters'
Expand Down
22 changes: 12 additions & 10 deletions lib/phrase/api/comment_replies_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ def replies_list_with_http_info(project_id, key_id, comment_id, replies_list_par
# @param project_id [String] Project ID
# @param key_id [String] Translation Key ID
# @param comment_id [String] Comment ID
# @param comment_create_parameters1 [CommentCreateParameters1]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [String] :branch specify the branch to use
# @option opts [String] :message specify the message for the comment
# @return [Comment]
def reply_create(project_id, key_id, comment_id, opts = {})
data, _status_code, _headers = reply_create_with_http_info(project_id, key_id, comment_id, opts)
def reply_create(project_id, key_id, comment_id, comment_create_parameters1, opts = {})
data, _status_code, _headers = reply_create_with_http_info(project_id, key_id, comment_id, comment_create_parameters1, opts)
data
end

Expand All @@ -131,12 +130,11 @@ def reply_create(project_id, key_id, comment_id, opts = {})
# @param project_id [String] Project ID
# @param key_id [String] Translation Key ID
# @param comment_id [String] Comment ID
# @param comment_create_parameters1 [CommentCreateParameters1]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [String] :branch specify the branch to use
# @option opts [String] :message specify the message for the comment
# @return [Array<(Response<(Comment)>, Integer, Hash)>] Response<(Comment)> data, response status code and response headers
def reply_create_with_http_info(project_id, key_id, comment_id, opts = {})
def reply_create_with_http_info(project_id, key_id, comment_id, comment_create_parameters1, opts = {})
if @api_client.config.debugging
@api_client.config.logger.debug 'Calling API: CommentRepliesApi.reply_create ...'
end
Expand All @@ -152,25 +150,29 @@ def reply_create_with_http_info(project_id, key_id, comment_id, opts = {})
if @api_client.config.client_side_validation && comment_id.nil?
fail ArgumentError, "Missing the required parameter 'comment_id' when calling CommentRepliesApi.reply_create"
end
# verify the required parameter 'comment_create_parameters1' is set
if @api_client.config.client_side_validation && comment_create_parameters1.nil?
fail ArgumentError, "Missing the required parameter 'comment_create_parameters1' when calling CommentRepliesApi.reply_create"
end
# resource path
local_var_path = '/projects/{project_id}/keys/{key_id}/comments/{comment_id}/replies'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'key_id' + '}', CGI.escape(key_id.to_s)).sub('{' + 'comment_id' + '}', CGI.escape(comment_id.to_s))

# query parameters
query_params = opts[:query_params] || {}
query_params[:'branch'] = opts[:'branch'] if !opts[:'branch'].nil?
query_params[:'message'] = opts[:'message'] if !opts[:'message'].nil?

# header parameters
header_params = opts[:header_params] || {}
# HTTP header 'Accept' (if needed)
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
# HTTP header 'Content-Type'
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?

# form parameters
form_params = opts[:form_params] || {}

# http body (model)
post_body = opts[:body]
post_body = opts[:body] || @api_client.object_to_http_body(comment_create_parameters1)

# return_type
return_type = opts[:return_type] || 'Comment'
Expand Down
6 changes: 0 additions & 6 deletions lib/phrase/api/comments_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ def initialize(api_client = ApiClient.default)
# @param comment_create_parameters [CommentCreateParameters]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [String] :message specify the message for the comment
# @option opts [Array<String>] :locale_ids specify the locales for the comment
# @return [Comment]
def comment_create(project_id, key_id, comment_create_parameters, opts = {})
data, _status_code, _headers = comment_create_with_http_info(project_id, key_id, comment_create_parameters, opts)
Expand All @@ -29,8 +27,6 @@ def comment_create(project_id, key_id, comment_create_parameters, opts = {})
# @param comment_create_parameters [CommentCreateParameters]
# @param [Hash] opts the optional parameters
# @option opts [String] :x_phrase_app_otp Two-Factor-Authentication token (optional)
# @option opts [String] :message specify the message for the comment
# @option opts [Array<String>] :locale_ids specify the locales for the comment
# @return [Array<(Response<(Comment)>, Integer, Hash)>] Response<(Comment)> data, response status code and response headers
def comment_create_with_http_info(project_id, key_id, comment_create_parameters, opts = {})
if @api_client.config.debugging
Expand All @@ -53,8 +49,6 @@ def comment_create_with_http_info(project_id, key_id, comment_create_parameters,

# query parameters
query_params = opts[:query_params] || {}
query_params[:'message'] = opts[:'message'] if !opts[:'message'].nil?
query_params[:'locale_ids'] = @api_client.build_collection_param(opts[:'locale_ids'], :multi) if !opts[:'locale_ids'].nil?

# header parameters
header_params = opts[:header_params] || {}
Expand Down
33 changes: 25 additions & 8 deletions lib/phrase/models/comment_create_parameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,30 @@

module Phrase
class CommentCreateParameters
# Comment message
attr_accessor :message

# specify the branch to use
attr_accessor :branch

# Comment message
attr_accessor :message
# specify the locales for the comment
attr_accessor :locale_ids

# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'message' => :'message',
:'branch' => :'branch',
:'message' => :'message'
:'locale_ids' => :'locale_ids'
}
end

# Attribute type mapping.
def self.openapi_types
{
:'message' => :'String',
:'branch' => :'String',
:'message' => :'String'
:'locale_ids' => :'Array<String>'
}
end

Expand All @@ -45,25 +50,36 @@ def initialize(attributes = {})
h[k.to_sym] = v
}

if attributes.key?(:'message')
self.message = attributes[:'message']
end

if attributes.key?(:'branch')
self.branch = attributes[:'branch']
end

if attributes.key?(:'message')
self.message = attributes[:'message']
if attributes.key?(:'locale_ids')
if (value = attributes[:'locale_ids']).is_a?(Array)
self.locale_ids = value
end
end
end

# Show invalid properties with the reasons. Usually used together with valid?
# @return Array for valid properties with the reasons
def list_invalid_properties
invalid_properties = Array.new
if @message.nil?
invalid_properties.push('invalid value for "message", message cannot be nil.')
end

invalid_properties
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
return false if @message.nil?
true
end

Expand All @@ -72,8 +88,9 @@ def valid?
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
message == o.message &&
branch == o.branch &&
message == o.message
locale_ids == o.locale_ids
end

# @see the `==` method
Expand All @@ -85,7 +102,7 @@ def eql?(o)
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
[branch, message].hash
[message, branch, locale_ids].hash
end

# Builds the object from hash
Expand Down
Loading

0 comments on commit 32b1b41

Please sign in to comment.