From 32b1b4111382a59a46bffb908cb25ac193e29e7e Mon Sep 17 00:00:00 2001 From: Phrase Date: Wed, 20 Nov 2024 11:04:51 +0000 Subject: [PATCH] Deploying from phrase/openapi@e201d136 --- .openapi-generator/FILES | 3 + README.md | 1 + docs/CommentCreateParameters.md | 8 +- docs/CommentCreateParameters1.md | 19 ++ docs/CommentRepliesApi.md | 14 +- docs/CommentsApi.md | 8 +- docs/KeyCreateParameters.md | 2 +- docs/KeyUpdateParameters.md | 2 +- docs/ProjectCreateParameters.md | 2 +- docs/ProjectUpdateParameters.md | 2 +- docs/ScreenshotUpdateParameters.md | 2 +- lib/phrase.rb | 1 + lib/phrase/api/comment_replies_api.rb | 22 +- lib/phrase/api/comments_api.rb | 6 - .../models/comment_create_parameters.rb | 33 ++- .../models/comment_create_parameters1.rb | 212 ++++++++++++++++++ spec/api/comment_replies_api_spec.rb | 3 +- spec/api/comments_api_spec.rb | 2 - .../models/comment_create_parameters1_spec.rb | 35 +++ spec/models/comment_create_parameters_spec.rb | 8 +- 20 files changed, 334 insertions(+), 51 deletions(-) create mode 100644 docs/CommentCreateParameters1.md create mode 100644 lib/phrase/models/comment_create_parameters1.rb create mode 100644 spec/models/comment_create_parameters1_spec.rb diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7ce95cc..50d56ba 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -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 @@ -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 @@ -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 diff --git a/README.md b/README.md index 15d0c82..11ba7e0 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docs/CommentCreateParameters.md b/docs/CommentCreateParameters.md index 34c70ac..226ee54 100644 --- a/docs/CommentCreateParameters.md +++ b/docs/CommentCreateParameters.md @@ -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"]) ``` diff --git a/docs/CommentCreateParameters1.md b/docs/CommentCreateParameters1.md new file mode 100644 index 0000000..70febeb --- /dev/null +++ b/docs/CommentCreateParameters1.md @@ -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) +``` + + diff --git a/docs/CommentRepliesApi.md b/docs/CommentRepliesApi.md index 8baa94d..42b00cc 100644 --- a/docs/CommentRepliesApi.md +++ b/docs/CommentRepliesApi.md @@ -94,7 +94,7 @@ Response<([**Array<Comment>**](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 @@ -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}" @@ -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 @@ -157,7 +155,7 @@ Response<([**Comment**](Comment.md))> ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json diff --git a/docs/CommentsApi.md b/docs/CommentsApi.md index 98ebb50..da7f0c7 100644 --- a/docs/CommentsApi.md +++ b/docs/CommentsApi.md @@ -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 | specify the locales for the comment + x_phrase_app_otp: 'x_phrase_app_otp_example' # String | Two-Factor-Authentication token (optional) } begin @@ -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<String>**](String.md)| specify the locales for the comment | [optional] ### Return type diff --git a/docs/KeyCreateParameters.md b/docs/KeyCreateParameters.md index ec279fc..6687174 100644 --- a/docs/KeyCreateParameters.md +++ b/docs/KeyCreateParameters.md @@ -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, diff --git a/docs/KeyUpdateParameters.md b/docs/KeyUpdateParameters.md index d0c2523..73e66c4 100644 --- a/docs/KeyUpdateParameters.md +++ b/docs/KeyUpdateParameters.md @@ -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, diff --git a/docs/ProjectCreateParameters.md b/docs/ProjectCreateParameters.md index b32791d..2255fed 100644 --- a/docs/ProjectCreateParameters.md +++ b/docs/ProjectCreateParameters.md @@ -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, diff --git a/docs/ProjectUpdateParameters.md b/docs/ProjectUpdateParameters.md index 266751f..dc8b74d 100644 --- a/docs/ProjectUpdateParameters.md +++ b/docs/ProjectUpdateParameters.md @@ -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, diff --git a/docs/ScreenshotUpdateParameters.md b/docs/ScreenshotUpdateParameters.md index 2e1794b..9baf845 100644 --- a/docs/ScreenshotUpdateParameters.md +++ b/docs/ScreenshotUpdateParameters.md @@ -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) ``` diff --git a/lib/phrase.rb b/lib/phrase.rb index 7992bc4..7b6cbe6 100644 --- a/lib/phrase.rb +++ b/lib/phrase.rb @@ -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' diff --git a/lib/phrase/api/comment_replies_api.rb b/lib/phrase/api/comment_replies_api.rb index 78e02cb..2ccc134 100644 --- a/lib/phrase/api/comment_replies_api.rb +++ b/lib/phrase/api/comment_replies_api.rb @@ -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 @@ -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 @@ -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' diff --git a/lib/phrase/api/comments_api.rb b/lib/phrase/api/comments_api.rb index 3369d24..f7c2291 100644 --- a/lib/phrase/api/comments_api.rb +++ b/lib/phrase/api/comments_api.rb @@ -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] :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) @@ -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] :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 @@ -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] || {} diff --git a/lib/phrase/models/comment_create_parameters.rb b/lib/phrase/models/comment_create_parameters.rb index 82c7040..e2d3da2 100644 --- a/lib/phrase/models/comment_create_parameters.rb +++ b/lib/phrase/models/comment_create_parameters.rb @@ -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' } end @@ -45,12 +50,18 @@ 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 @@ -58,12 +69,17 @@ def initialize(attributes = {}) # @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 @@ -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 @@ -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 diff --git a/lib/phrase/models/comment_create_parameters1.rb b/lib/phrase/models/comment_create_parameters1.rb new file mode 100644 index 0000000..2f092aa --- /dev/null +++ b/lib/phrase/models/comment_create_parameters1.rb @@ -0,0 +1,212 @@ +require 'date' + +module Phrase + class CommentCreateParameters1 + # Reply message body + attr_accessor :message + + # Specify the branch to use + attr_accessor :branch + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message', + :'branch' => :'branch' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String', + :'branch' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::CommentCreateParameters1` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `Phrase::CommentCreateParameters1`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'branch') + self.branch = attributes[:'branch'] + 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 + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + branch == o.branch + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message, branch].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(value) + when :Date + Date.parse(value) + when :Time + Time.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + Phrase.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + end +end diff --git a/spec/api/comment_replies_api_spec.rb b/spec/api/comment_replies_api_spec.rb index 728764a..f2138e0 100644 --- a/spec/api/comment_replies_api_spec.rb +++ b/spec/api/comment_replies_api_spec.rb @@ -48,10 +48,9 @@ # @param project_id Project ID # @param key_id Translation Key ID # @param comment_id Comment ID + # @param comment_create_parameters1 # @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] describe 'reply_create test' do it 'should work' do diff --git a/spec/api/comments_api_spec.rb b/spec/api/comments_api_spec.rb index c2d1966..d0fce24 100644 --- a/spec/api/comments_api_spec.rb +++ b/spec/api/comments_api_spec.rb @@ -28,8 +28,6 @@ # @param comment_create_parameters # @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] :locale_ids specify the locales for the comment # @return [Comment] describe 'comment_create test' do it 'should work' do diff --git a/spec/models/comment_create_parameters1_spec.rb b/spec/models/comment_create_parameters1_spec.rb new file mode 100644 index 0000000..9a2a5b7 --- /dev/null +++ b/spec/models/comment_create_parameters1_spec.rb @@ -0,0 +1,35 @@ +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for Phrase::CommentCreateParameters1 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'CommentCreateParameters1' do + before do + # run before each test + @instance = Phrase::CommentCreateParameters1.new + end + + after do + # run after each test + end + + describe 'test an instance of CommentCreateParameters1' do + it 'should create an instance of CommentCreateParameters1' do + expect(@instance).to be_instance_of(Phrase::CommentCreateParameters1) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "branch"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/comment_create_parameters_spec.rb b/spec/models/comment_create_parameters_spec.rb index d6cb5dd..74d73ca 100644 --- a/spec/models/comment_create_parameters_spec.rb +++ b/spec/models/comment_create_parameters_spec.rb @@ -20,13 +20,19 @@ expect(@instance).to be_instance_of(Phrase::CommentCreateParameters) end end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + describe 'test attribute "branch"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end - describe 'test attribute "message"' do + describe 'test attribute "locale_ids"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end