Class: PhraseApp::RequestParams::UploadParams

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

Overview

UploadParams

Parameters:

autotranslate

If set, translations for the uploaded language will be fetched automatically.

branch

specify the branch to use

convert_emoji

Indicates whether the file contains Emoji symbols that should be converted. <a href=“help.phraseapp.com/manage-translations-and-languages/work-with-emojis/working-with-emojis”>Working with Emojis</a>.

file

File to be imported

file_encoding

Enforces a specific encoding on the file contents. Valid options are “UTF-8”, “UTF-16” and “ISO-8859-1”.

file_format

File format. Auto-detected when possible and not specified.

format_options

Additional options available for specific formats. See our format guide for complete list.

locale_id

Locale of the file’s content. Can be the name or public id of the locale. Preferred is the public id.

locale_mapping

Optional, format specific mapping between locale names and the columns the translations to those locales are contained in.

mark_reviewed

Indicated whether the imported translations should be marked as reviewed. This setting is available if the review workflow (currently beta) is enabled for the project.

skip_unverification

Indicates whether the upload should unverify updated translations.

skip_upload_tags

Indicates whether the upload should not create upload tags.

tags

List of tags separated by comma to be associated with the new keys contained in the upload.

update_descriptions

Existing key descriptions will be updated with the file content. Empty descriptions overwrite existing descriptions.

update_translations

Indicates whether existing translations should be updated with the file content.

Instance Method Summary collapse

Instance Method Details

#autotranslate=(val) ⇒ Object



1648
1649
1650
1651
1652
1653
1654
1655
1656
# File 'lib/phraseapp-ruby.rb', line 1648

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

#branch=(val) ⇒ Object



1658
1659
1660
# File 'lib/phraseapp-ruby.rb', line 1658

def branch=(val)
  super(val)
end

#convert_emoji=(val) ⇒ Object



1662
1663
1664
1665
1666
1667
1668
1669
1670
# File 'lib/phraseapp-ruby.rb', line 1662

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

#file=(val) ⇒ Object



1672
1673
1674
# File 'lib/phraseapp-ruby.rb', line 1672

def file=(val)
  super(val)
end

#file_encoding=(val) ⇒ Object



1676
1677
1678
# File 'lib/phraseapp-ruby.rb', line 1676

def file_encoding=(val)
  super(val)
end

#file_format=(val) ⇒ Object



1680
1681
1682
# File 'lib/phraseapp-ruby.rb', line 1680

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



1684
1685
1686
# File 'lib/phraseapp-ruby.rb', line 1684

def format_options=(val)
  super(JSON.load(val))
end

#locale_id=(val) ⇒ Object



1688
1689
1690
# File 'lib/phraseapp-ruby.rb', line 1688

def locale_id=(val)
  super(val)
end

#locale_mapping=(val) ⇒ Object



1692
1693
1694
# File 'lib/phraseapp-ruby.rb', line 1692

def locale_mapping=(val)
  super(JSON.load(val))
end

#mark_reviewed=(val) ⇒ Object



1696
1697
1698
1699
1700
1701
1702
1703
1704
# File 'lib/phraseapp-ruby.rb', line 1696

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

#skip_unverification=(val) ⇒ Object



1706
1707
1708
1709
1710
1711
1712
1713
1714
# File 'lib/phraseapp-ruby.rb', line 1706

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

#skip_upload_tags=(val) ⇒ Object



1716
1717
1718
1719
1720
1721
1722
1723
1724
# File 'lib/phraseapp-ruby.rb', line 1716

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

#tags=(val) ⇒ Object



1726
1727
1728
# File 'lib/phraseapp-ruby.rb', line 1726

def tags=(val)
  super(val)
end

#update_descriptions=(val) ⇒ Object



1730
1731
1732
1733
1734
1735
1736
1737
1738
# File 'lib/phraseapp-ruby.rb', line 1730

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

#update_translations=(val) ⇒ Object



1740
1741
1742
1743
1744
1745
1746
1747
1748
# File 'lib/phraseapp-ruby.rb', line 1740

def update_translations=(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



1750
1751
1752
1753
1754
1755
# File 'lib/phraseapp-ruby.rb', line 1750

def validate
  
  if file == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"file\" of \"UploadParams\" not set")
  end
end