Class: PhraseApp::RequestParams::UploadParams

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

Overview

UploadParams

Parameters:

convert_emoji

Indicates whether the file contains Emoji symbols that should be converted. <a href=“guides/working-with-phraseapp/emoji-support/”>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.

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_translations

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

Instance Method Summary collapse

Instance Method Details

#convert_emoji=(val) ⇒ Object



984
985
986
987
988
989
990
991
992
# File 'lib/phraseapp-ruby.rb', line 984

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



994
995
996
# File 'lib/phraseapp-ruby.rb', line 994

def file=(val)
  super(val)
end

#file_encoding=(val) ⇒ Object



998
999
1000
# File 'lib/phraseapp-ruby.rb', line 998

def file_encoding=(val)
  super(val)
end

#file_format=(val) ⇒ Object



1002
1003
1004
# File 'lib/phraseapp-ruby.rb', line 1002

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



1006
1007
1008
# File 'lib/phraseapp-ruby.rb', line 1006

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

#locale_id=(val) ⇒ Object



1010
1011
1012
# File 'lib/phraseapp-ruby.rb', line 1010

def locale_id=(val)
  super(val)
end

#skip_unverification=(val) ⇒ Object



1014
1015
1016
1017
1018
1019
1020
1021
1022
# File 'lib/phraseapp-ruby.rb', line 1014

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



1024
1025
1026
1027
1028
1029
1030
1031
1032
# File 'lib/phraseapp-ruby.rb', line 1024

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



1034
1035
1036
# File 'lib/phraseapp-ruby.rb', line 1034

def tags=(val)
  super(val)
end

#update_translations=(val) ⇒ Object



1038
1039
1040
1041
1042
1043
1044
1045
1046
# File 'lib/phraseapp-ruby.rb', line 1038

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



1048
1049
1050
1051
1052
1053
# File 'lib/phraseapp-ruby.rb', line 1048

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