Class: PhraseApp::RequestParams::TranslationParams

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/phraseapp-ruby.rb

Overview

TranslationParams

Parameters:

branch

specify the branch to use

content

Translation content

excluded

Indicates whether translation is excluded.

key_id

Key

locale_id

Locale. Can be the name or public id of the locale. Preferred is the public id.

plural_suffix

Plural suffix. Can be one of: zero, one, two, few, many, other. Must be specified if the key associated to the translation is pluralized.

unverified

Indicates whether translation is unverified. Part of the <a href=“help.phraseapp.com/translate-website-and-app-content/verify-and-proofread-translations/verification-and-proofreading” target=“_blank”>Advanced Workflows</a> feature.

Instance Method Summary collapse

Instance Method Details

#branch=(val) ⇒ Object



1556
1557
1558
# File 'lib/phraseapp-ruby.rb', line 1556

def branch=(val)
  super(val)
end

#content=(val) ⇒ Object



1560
1561
1562
# File 'lib/phraseapp-ruby.rb', line 1560

def content=(val)
  super(val)
end

#excluded=(val) ⇒ Object



1564
1565
1566
1567
1568
1569
1570
1571
1572
# File 'lib/phraseapp-ruby.rb', line 1564

def excluded=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#key_id=(val) ⇒ Object



1574
1575
1576
# File 'lib/phraseapp-ruby.rb', line 1574

def key_id=(val)
  super(val)
end

#locale_id=(val) ⇒ Object



1578
1579
1580
# File 'lib/phraseapp-ruby.rb', line 1578

def locale_id=(val)
  super(val)
end

#plural_suffix=(val) ⇒ Object



1582
1583
1584
# File 'lib/phraseapp-ruby.rb', line 1582

def plural_suffix=(val)
  super(val)
end

#unverified=(val) ⇒ Object



1586
1587
1588
1589
1590
1591
1592
1593
1594
# File 'lib/phraseapp-ruby.rb', line 1586

def unverified=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#validateObject



1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
# File 'lib/phraseapp-ruby.rb', line 1596

def validate
  
  if content == nil || content == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"content\" of \"TranslationParams\" not set")
  end
  if key_id == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"key_id\" of \"TranslationParams\" not set")
  end
  if locale_id == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"locale_id\" of \"TranslationParams\" not set")
  end
end