Class: Phrase::ProjectUpdateParameters
- Inherits:
-
Object
- Object
- Phrase::ProjectUpdateParameters
- Defined in:
- lib/phrase/models/project_update_parameters.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
(Optional) ID of an account the requesting user belongs to.
-
#autocomplete_job_enabled ⇒ Object
(Optional) Enable autocomplete-job behavior so that newly created keys and locales are automatically added to in-progress jobs.
-
#autotranslate_check_new_locales ⇒ Object
(Optional) Requires autotranslate_enabled to be true.
-
#autotranslate_check_new_translation_keys ⇒ Object
(Optional) Requires autotranslate_enabled to be true.
-
#autotranslate_check_new_uploads ⇒ Object
(Optional) Requires autotranslate_enabled to be true.
-
#autotranslate_enabled ⇒ Object
(Optional) Autopilot, requires machine_translation_enabled.
-
#autotranslate_mark_as_unverified ⇒ Object
(Optional) Requires autotranslate_enabled to be true.
-
#autotranslate_overwrite_unverified_translations ⇒ Object
(Optional) Requires autotranslate_enabled to be true.
-
#autotranslate_use_machine_translation ⇒ Object
(Optional) Requires autotranslate_enabled to be true.
-
#autotranslate_use_translation_memory ⇒ Object
(Optional) Requires autotranslate_enabled to be true.
-
#cldr_version ⇒ Object
(Optional) CLDR plural-rule version used by the project.
-
#default_encoding ⇒ Object
(Optional) Sets the default encoding for Uploads.
-
#enable_all_data_type_translation_keys_for_translators ⇒ Object
(Optional) Otherwise, translators are not allowed to edit translations other than strings.
-
#enable_branching ⇒ Object
(Optional) Enable branching in the project.
-
#enable_icu_message_format ⇒ Object
(Optional) We can validate and highlight your ICU messages.
-
#fallback_for_unverified_translations ⇒ Object
(Optional) When enabled, the fallback locale's translation is used on export for unverified translations in addition to empty ones.
-
#job_locking_enabled ⇒ Object
(Optional) When enabled, translations are locked once a job moves into review.
-
#machine_translation_enabled ⇒ Object
(Optional) Enable machine translation support in the project.
-
#main_format ⇒ Object
(Optional) Main file format specified by its API Extension name.
-
#media ⇒ Object
(Optional) Main technology stack used in the project.
-
#name ⇒ Object
(Optional) Name of the project.
-
#placeholder_styles ⇒ Object
(Optional) List of placeholder styles enabled for the project.
-
#point_of_contact ⇒ Object
(Optional) User ID of the point of contact for the project.
-
#project_image ⇒ Object
(Optional) Image to identify the project.
-
#protect_master_branch ⇒ Object
(Optional) Protect the master branch in project where branching is enabled.
-
#remove_project_image ⇒ Object
(Optional) Indicates whether the project image should be deleted.
-
#shares_translation_memory ⇒ Object
(Optional) Indicates whether the project should share the account's translation memory.
-
#smart_suggest_enabled ⇒ Object
(Optional) Enable Smart Suggest for the project.
-
#smart_suggest_use_glossary ⇒ Object
(Optional) Allow Smart Suggest to source suggestions from the project glossary.
-
#smart_suggest_use_machine_translation ⇒ Object
(Optional) Allow Smart Suggest to source suggestions from machine translation.
-
#term_base_ids ⇒ Object
List of TMS term base IDs, used to ensure consistent terminology for the AI translation agent.
-
#tm_ids ⇒ Object
List of TMS translation memory IDs, used to provide reference translations for the AI translation agent.
-
#translation_keys_sort_collation ⇒ Object
(Optional) Collation used when sorting translation keys alphabetically.
-
#workflow ⇒ Object
(Optional) Review Workflow.
-
#zero_plural_form_enabled ⇒ Object
(Optional) Displays the input fields for the 'ZERO' plural form for every key as well although only some languages require the 'ZERO' explicitly.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ProjectUpdateParameters
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ ProjectUpdateParameters
Initializes the object
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/phrase/models/project_update_parameters.rb', line 222 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Phrase::ProjectUpdateParameters` 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::ProjectUpdateParameters`. 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?(:'account_id') self.account_id = attributes[:'account_id'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'point_of_contact') self.point_of_contact = attributes[:'point_of_contact'] end if attributes.key?(:'main_format') self.main_format = attributes[:'main_format'] end if attributes.key?(:'media') self.media = attributes[:'media'] end if attributes.key?(:'shares_translation_memory') self.shares_translation_memory = attributes[:'shares_translation_memory'] end if attributes.key?(:'tm_ids') if (value = attributes[:'tm_ids']).is_a?(Array) self.tm_ids = value end end if attributes.key?(:'term_base_ids') if (value = attributes[:'term_base_ids']).is_a?(Array) self.term_base_ids = value end end if attributes.key?(:'project_image') self.project_image = attributes[:'project_image'] end if attributes.key?(:'remove_project_image') self.remove_project_image = attributes[:'remove_project_image'] end if attributes.key?(:'workflow') self.workflow = attributes[:'workflow'] end if attributes.key?(:'machine_translation_enabled') self.machine_translation_enabled = attributes[:'machine_translation_enabled'] end if attributes.key?(:'enable_branching') self.enable_branching = attributes[:'enable_branching'] end if attributes.key?(:'protect_master_branch') self.protect_master_branch = attributes[:'protect_master_branch'] end if attributes.key?(:'enable_all_data_type_translation_keys_for_translators') self.enable_all_data_type_translation_keys_for_translators = attributes[:'enable_all_data_type_translation_keys_for_translators'] end if attributes.key?(:'enable_icu_message_format') self. = attributes[:'enable_icu_message_format'] end if attributes.key?(:'zero_plural_form_enabled') self.zero_plural_form_enabled = attributes[:'zero_plural_form_enabled'] end if attributes.key?(:'autotranslate_enabled') self.autotranslate_enabled = attributes[:'autotranslate_enabled'] end if attributes.key?(:'autotranslate_check_new_translation_keys') self.autotranslate_check_new_translation_keys = attributes[:'autotranslate_check_new_translation_keys'] end if attributes.key?(:'autotranslate_check_new_uploads') self.autotranslate_check_new_uploads = attributes[:'autotranslate_check_new_uploads'] end if attributes.key?(:'autotranslate_check_new_locales') self.autotranslate_check_new_locales = attributes[:'autotranslate_check_new_locales'] end if attributes.key?(:'autotranslate_mark_as_unverified') self.autotranslate_mark_as_unverified = attributes[:'autotranslate_mark_as_unverified'] end if attributes.key?(:'autotranslate_use_machine_translation') self.autotranslate_use_machine_translation = attributes[:'autotranslate_use_machine_translation'] end if attributes.key?(:'autotranslate_use_translation_memory') self.autotranslate_use_translation_memory = attributes[:'autotranslate_use_translation_memory'] end if attributes.key?(:'autotranslate_overwrite_unverified_translations') self.autotranslate_overwrite_unverified_translations = attributes[:'autotranslate_overwrite_unverified_translations'] end if attributes.key?(:'fallback_for_unverified_translations') self.fallback_for_unverified_translations = attributes[:'fallback_for_unverified_translations'] end if attributes.key?(:'default_encoding') self.default_encoding = attributes[:'default_encoding'] end if attributes.key?(:'placeholder_styles') if (value = attributes[:'placeholder_styles']).is_a?(Array) self.placeholder_styles = value end end if attributes.key?(:'autocomplete_job_enabled') self.autocomplete_job_enabled = attributes[:'autocomplete_job_enabled'] end if attributes.key?(:'job_locking_enabled') self.job_locking_enabled = attributes[:'job_locking_enabled'] end if attributes.key?(:'smart_suggest_enabled') self.smart_suggest_enabled = attributes[:'smart_suggest_enabled'] end if attributes.key?(:'smart_suggest_use_glossary') self.smart_suggest_use_glossary = attributes[:'smart_suggest_use_glossary'] end if attributes.key?(:'smart_suggest_use_machine_translation') self.smart_suggest_use_machine_translation = attributes[:'smart_suggest_use_machine_translation'] end if attributes.key?(:'translation_keys_sort_collation') self.translation_keys_sort_collation = attributes[:'translation_keys_sort_collation'] end if attributes.key?(:'cldr_version') self.cldr_version = attributes[:'cldr_version'] end end |
Instance Attribute Details
#account_id ⇒ Object
(Optional) ID of an account the requesting user belongs to. Used only to disambiguate the request context; the project itself cannot be moved between accounts through this endpoint.
6 7 8 |
# File 'lib/phrase/models/project_update_parameters.rb', line 6 def account_id @account_id end |
#autocomplete_job_enabled ⇒ Object
(Optional) Enable autocomplete-job behavior so that newly created keys and locales are automatically added to in-progress jobs.
90 91 92 |
# File 'lib/phrase/models/project_update_parameters.rb', line 90 def autocomplete_job_enabled @autocomplete_job_enabled end |
#autotranslate_check_new_locales ⇒ Object
(Optional) Requires autotranslate_enabled to be true
66 67 68 |
# File 'lib/phrase/models/project_update_parameters.rb', line 66 def autotranslate_check_new_locales @autotranslate_check_new_locales end |
#autotranslate_check_new_translation_keys ⇒ Object
(Optional) Requires autotranslate_enabled to be true
60 61 62 |
# File 'lib/phrase/models/project_update_parameters.rb', line 60 def autotranslate_check_new_translation_keys @autotranslate_check_new_translation_keys end |
#autotranslate_check_new_uploads ⇒ Object
(Optional) Requires autotranslate_enabled to be true
63 64 65 |
# File 'lib/phrase/models/project_update_parameters.rb', line 63 def autotranslate_check_new_uploads @autotranslate_check_new_uploads end |
#autotranslate_enabled ⇒ Object
(Optional) Autopilot, requires machine_translation_enabled. Read more
57 58 59 |
# File 'lib/phrase/models/project_update_parameters.rb', line 57 def autotranslate_enabled @autotranslate_enabled end |
#autotranslate_mark_as_unverified ⇒ Object
(Optional) Requires autotranslate_enabled to be true
69 70 71 |
# File 'lib/phrase/models/project_update_parameters.rb', line 69 def autotranslate_mark_as_unverified @autotranslate_mark_as_unverified end |
#autotranslate_overwrite_unverified_translations ⇒ Object
(Optional) Requires autotranslate_enabled to be true
78 79 80 |
# File 'lib/phrase/models/project_update_parameters.rb', line 78 def autotranslate_overwrite_unverified_translations @autotranslate_overwrite_unverified_translations end |
#autotranslate_use_machine_translation ⇒ Object
(Optional) Requires autotranslate_enabled to be true
72 73 74 |
# File 'lib/phrase/models/project_update_parameters.rb', line 72 def autotranslate_use_machine_translation @autotranslate_use_machine_translation end |
#autotranslate_use_translation_memory ⇒ Object
(Optional) Requires autotranslate_enabled to be true
75 76 77 |
# File 'lib/phrase/models/project_update_parameters.rb', line 75 def autotranslate_use_translation_memory @autotranslate_use_translation_memory end |
#cldr_version ⇒ Object
(Optional) CLDR plural-rule version used by the project.
108 109 110 |
# File 'lib/phrase/models/project_update_parameters.rb', line 108 def cldr_version @cldr_version end |
#default_encoding ⇒ Object
(Optional) Sets the default encoding for Uploads. If you leave it empty, we will try to guess it automatically for you when you Upload a file. You can still override this value by setting the file_encoding parameter for Uploads.
84 85 86 |
# File 'lib/phrase/models/project_update_parameters.rb', line 84 def default_encoding @default_encoding end |
#enable_all_data_type_translation_keys_for_translators ⇒ Object
(Optional) Otherwise, translators are not allowed to edit translations other than strings
48 49 50 |
# File 'lib/phrase/models/project_update_parameters.rb', line 48 def enable_all_data_type_translation_keys_for_translators @enable_all_data_type_translation_keys_for_translators end |
#enable_branching ⇒ Object
(Optional) Enable branching in the project
42 43 44 |
# File 'lib/phrase/models/project_update_parameters.rb', line 42 def enable_branching @enable_branching end |
#enable_icu_message_format ⇒ Object
(Optional) We can validate and highlight your ICU messages. Read more
51 52 53 |
# File 'lib/phrase/models/project_update_parameters.rb', line 51 def @enable_icu_message_format end |
#fallback_for_unverified_translations ⇒ Object
(Optional) When enabled, the fallback locale's translation is used on export for unverified translations in addition to empty ones. Requires a fallback locale to be configured on the locale.
81 82 83 |
# File 'lib/phrase/models/project_update_parameters.rb', line 81 def fallback_for_unverified_translations @fallback_for_unverified_translations end |
#job_locking_enabled ⇒ Object
(Optional) When enabled, translations are locked once a job moves into review.
93 94 95 |
# File 'lib/phrase/models/project_update_parameters.rb', line 93 def job_locking_enabled @job_locking_enabled end |
#machine_translation_enabled ⇒ Object
(Optional) Enable machine translation support in the project. Required for Pre-Translation
39 40 41 |
# File 'lib/phrase/models/project_update_parameters.rb', line 39 def machine_translation_enabled @machine_translation_enabled end |
#main_format ⇒ Object
(Optional) Main file format specified by its API Extension name. Used for locale downloads if no format is specified. For API Extension names of available file formats see Format Guide or our Formats API Endpoint.
15 16 17 |
# File 'lib/phrase/models/project_update_parameters.rb', line 15 def main_format @main_format end |
#media ⇒ Object
(Optional) Main technology stack used in the project. It affects for example the suggested placeholder style. Predefined values include: Ruby, JavaScript, AngularJS, React, iOS, Android, Python, PHP, Java, Go, Windows Phone, Rails, Node.js, .NET, Django, Symfony, Yii Framework, Zend Framework, Apple App Store Description, Google Play Description, but it can also take any other value.
18 19 20 |
# File 'lib/phrase/models/project_update_parameters.rb', line 18 def media @media end |
#name ⇒ Object
(Optional) Name of the project
9 10 11 |
# File 'lib/phrase/models/project_update_parameters.rb', line 9 def name @name end |
#placeholder_styles ⇒ Object
(Optional) List of placeholder styles enabled for the project.
87 88 89 |
# File 'lib/phrase/models/project_update_parameters.rb', line 87 def placeholder_styles @placeholder_styles end |
#point_of_contact ⇒ Object
(Optional) User ID of the point of contact for the project. Pass null to unset.
12 13 14 |
# File 'lib/phrase/models/project_update_parameters.rb', line 12 def point_of_contact @point_of_contact end |
#project_image ⇒ Object
(Optional) Image to identify the project
30 31 32 |
# File 'lib/phrase/models/project_update_parameters.rb', line 30 def project_image @project_image end |
#protect_master_branch ⇒ Object
(Optional) Protect the master branch in project where branching is enabled
45 46 47 |
# File 'lib/phrase/models/project_update_parameters.rb', line 45 def protect_master_branch @protect_master_branch end |
#remove_project_image ⇒ Object
(Optional) Indicates whether the project image should be deleted.
33 34 35 |
# File 'lib/phrase/models/project_update_parameters.rb', line 33 def remove_project_image @remove_project_image end |
#shares_translation_memory ⇒ Object
(Optional) Indicates whether the project should share the account's translation memory
21 22 23 |
# File 'lib/phrase/models/project_update_parameters.rb', line 21 def shares_translation_memory @shares_translation_memory end |
#smart_suggest_enabled ⇒ Object
(Optional) Enable Smart Suggest for the project.
96 97 98 |
# File 'lib/phrase/models/project_update_parameters.rb', line 96 def smart_suggest_enabled @smart_suggest_enabled end |
#smart_suggest_use_glossary ⇒ Object
(Optional) Allow Smart Suggest to source suggestions from the project glossary.
99 100 101 |
# File 'lib/phrase/models/project_update_parameters.rb', line 99 def smart_suggest_use_glossary @smart_suggest_use_glossary end |
#smart_suggest_use_machine_translation ⇒ Object
(Optional) Allow Smart Suggest to source suggestions from machine translation.
102 103 104 |
# File 'lib/phrase/models/project_update_parameters.rb', line 102 def smart_suggest_use_machine_translation @smart_suggest_use_machine_translation end |
#term_base_ids ⇒ Object
List of TMS term base IDs, used to ensure consistent terminology for the AI translation agent.
27 28 29 |
# File 'lib/phrase/models/project_update_parameters.rb', line 27 def term_base_ids @term_base_ids end |
#tm_ids ⇒ Object
List of TMS translation memory IDs, used to provide reference translations for the AI translation agent.
24 25 26 |
# File 'lib/phrase/models/project_update_parameters.rb', line 24 def tm_ids @tm_ids end |
#translation_keys_sort_collation ⇒ Object
(Optional) Collation used when sorting translation keys alphabetically.
105 106 107 |
# File 'lib/phrase/models/project_update_parameters.rb', line 105 def translation_keys_sort_collation @translation_keys_sort_collation end |
#workflow ⇒ Object
(Optional) Review Workflow. "simple" / "review". Read more
36 37 38 |
# File 'lib/phrase/models/project_update_parameters.rb', line 36 def workflow @workflow end |
#zero_plural_form_enabled ⇒ Object
(Optional) Displays the input fields for the 'ZERO' plural form for every key as well although only some languages require the 'ZERO' explicitly.
54 55 56 |
# File 'lib/phrase/models/project_update_parameters.rb', line 54 def zero_plural_form_enabled @zero_plural_form_enabled end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/phrase/models/project_update_parameters.rb', line 133 def self.attribute_map { :'account_id' => :'account_id', :'name' => :'name', :'point_of_contact' => :'point_of_contact', :'main_format' => :'main_format', :'media' => :'media', :'shares_translation_memory' => :'shares_translation_memory', :'tm_ids' => :'tm_ids', :'term_base_ids' => :'term_base_ids', :'project_image' => :'project_image', :'remove_project_image' => :'remove_project_image', :'workflow' => :'workflow', :'machine_translation_enabled' => :'machine_translation_enabled', :'enable_branching' => :'enable_branching', :'protect_master_branch' => :'protect_master_branch', :'enable_all_data_type_translation_keys_for_translators' => :'enable_all_data_type_translation_keys_for_translators', :'enable_icu_message_format' => :'enable_icu_message_format', :'zero_plural_form_enabled' => :'zero_plural_form_enabled', :'autotranslate_enabled' => :'autotranslate_enabled', :'autotranslate_check_new_translation_keys' => :'autotranslate_check_new_translation_keys', :'autotranslate_check_new_uploads' => :'autotranslate_check_new_uploads', :'autotranslate_check_new_locales' => :'autotranslate_check_new_locales', :'autotranslate_mark_as_unverified' => :'autotranslate_mark_as_unverified', :'autotranslate_use_machine_translation' => :'autotranslate_use_machine_translation', :'autotranslate_use_translation_memory' => :'autotranslate_use_translation_memory', :'autotranslate_overwrite_unverified_translations' => :'autotranslate_overwrite_unverified_translations', :'fallback_for_unverified_translations' => :'fallback_for_unverified_translations', :'default_encoding' => :'default_encoding', :'placeholder_styles' => :'placeholder_styles', :'autocomplete_job_enabled' => :'autocomplete_job_enabled', :'job_locking_enabled' => :'job_locking_enabled', :'smart_suggest_enabled' => :'smart_suggest_enabled', :'smart_suggest_use_glossary' => :'smart_suggest_use_glossary', :'smart_suggest_use_machine_translation' => :'smart_suggest_use_machine_translation', :'translation_keys_sort_collation' => :'translation_keys_sort_collation', :'cldr_version' => :'cldr_version' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
464 465 466 |
# File 'lib/phrase/models/project_update_parameters.rb', line 464 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
215 216 217 218 |
# File 'lib/phrase/models/project_update_parameters.rb', line 215 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/phrase/models/project_update_parameters.rb', line 174 def self.openapi_types { :'account_id' => :'String', :'name' => :'String', :'point_of_contact' => :'String', :'main_format' => :'String', :'media' => :'String', :'shares_translation_memory' => :'Boolean', :'tm_ids' => :'Array<String>', :'term_base_ids' => :'Array<String>', :'project_image' => :'File', :'remove_project_image' => :'Boolean', :'workflow' => :'String', :'machine_translation_enabled' => :'Boolean', :'enable_branching' => :'Boolean', :'protect_master_branch' => :'Boolean', :'enable_all_data_type_translation_keys_for_translators' => :'Boolean', :'enable_icu_message_format' => :'Boolean', :'zero_plural_form_enabled' => :'Boolean', :'autotranslate_enabled' => :'Boolean', :'autotranslate_check_new_translation_keys' => :'Boolean', :'autotranslate_check_new_uploads' => :'Boolean', :'autotranslate_check_new_locales' => :'Boolean', :'autotranslate_mark_as_unverified' => :'Boolean', :'autotranslate_use_machine_translation' => :'Boolean', :'autotranslate_use_translation_memory' => :'Boolean', :'autotranslate_overwrite_unverified_translations' => :'Boolean', :'fallback_for_unverified_translations' => :'Boolean', :'default_encoding' => :'String', :'placeholder_styles' => :'Array<String>', :'autocomplete_job_enabled' => :'Boolean', :'job_locking_enabled' => :'Boolean', :'smart_suggest_enabled' => :'Boolean', :'smart_suggest_use_glossary' => :'Boolean', :'smart_suggest_use_machine_translation' => :'Boolean', :'translation_keys_sort_collation' => :'String', :'cldr_version' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/phrase/models/project_update_parameters.rb', line 409 def ==(o) return true if self.equal?(o) self.class == o.class && account_id == o.account_id && name == o.name && point_of_contact == o.point_of_contact && main_format == o.main_format && media == o.media && shares_translation_memory == o.shares_translation_memory && tm_ids == o.tm_ids && term_base_ids == o.term_base_ids && project_image == o.project_image && remove_project_image == o.remove_project_image && workflow == o.workflow && machine_translation_enabled == o.machine_translation_enabled && enable_branching == o.enable_branching && protect_master_branch == o.protect_master_branch && enable_all_data_type_translation_keys_for_translators == o.enable_all_data_type_translation_keys_for_translators && == o. && zero_plural_form_enabled == o.zero_plural_form_enabled && autotranslate_enabled == o.autotranslate_enabled && autotranslate_check_new_translation_keys == o.autotranslate_check_new_translation_keys && autotranslate_check_new_uploads == o.autotranslate_check_new_uploads && autotranslate_check_new_locales == o.autotranslate_check_new_locales && autotranslate_mark_as_unverified == o.autotranslate_mark_as_unverified && autotranslate_use_machine_translation == o.autotranslate_use_machine_translation && autotranslate_use_translation_memory == o.autotranslate_use_translation_memory && autotranslate_overwrite_unverified_translations == o.autotranslate_overwrite_unverified_translations && fallback_for_unverified_translations == o.fallback_for_unverified_translations && default_encoding == o.default_encoding && placeholder_styles == o.placeholder_styles && autocomplete_job_enabled == o.autocomplete_job_enabled && job_locking_enabled == o.job_locking_enabled && smart_suggest_enabled == o.smart_suggest_enabled && smart_suggest_use_glossary == o.smart_suggest_use_glossary && smart_suggest_use_machine_translation == o.smart_suggest_use_machine_translation && translation_keys_sort_collation == o.translation_keys_sort_collation && cldr_version == o.cldr_version end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 |
# File 'lib/phrase/models/project_update_parameters.rb', line 492 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<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\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 |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/phrase/models/project_update_parameters.rb', line 563 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/phrase/models/project_update_parameters.rb', line 471 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 |
#eql?(o) ⇒ Boolean
451 452 453 |
# File 'lib/phrase/models/project_update_parameters.rb', line 451 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
457 458 459 |
# File 'lib/phrase/models/project_update_parameters.rb', line 457 def hash [account_id, name, point_of_contact, main_format, media, shares_translation_memory, tm_ids, term_base_ids, project_image, remove_project_image, workflow, machine_translation_enabled, enable_branching, protect_master_branch, enable_all_data_type_translation_keys_for_translators, , zero_plural_form_enabled, autotranslate_enabled, autotranslate_check_new_translation_keys, autotranslate_check_new_uploads, autotranslate_check_new_locales, autotranslate_mark_as_unverified, autotranslate_use_machine_translation, autotranslate_use_translation_memory, autotranslate_overwrite_unverified_translations, fallback_for_unverified_translations, default_encoding, placeholder_styles, autocomplete_job_enabled, job_locking_enabled, smart_suggest_enabled, smart_suggest_use_glossary, smart_suggest_use_machine_translation, translation_keys_sort_collation, cldr_version].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
384 385 386 387 |
# File 'lib/phrase/models/project_update_parameters.rb', line 384 def list_invalid_properties invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
539 540 541 |
# File 'lib/phrase/models/project_update_parameters.rb', line 539 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/phrase/models/project_update_parameters.rb', line 545 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 |
#to_s ⇒ String
Returns the string representation of the object
533 534 535 |
# File 'lib/phrase/models/project_update_parameters.rb', line 533 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
391 392 393 394 395 |
# File 'lib/phrase/models/project_update_parameters.rb', line 391 def valid? default_encoding_validator = EnumAttributeValidator.new('String', ["UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE", "ISO-8859-1"]) return false unless default_encoding_validator.valid?(@default_encoding) true end |