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



1031
1032
1033
1034
1035
1036
1037
1038
1039
# File 'lib/phraseapp-ruby.rb', line 1031

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



1041
1042
1043
# File 'lib/phraseapp-ruby.rb', line 1041

def file=(val)
  super(val)
end

#file_encoding=(val) ⇒ Object



1045
1046
1047
# File 'lib/phraseapp-ruby.rb', line 1045

def file_encoding=(val)
  super(val)
end

#file_format=(val) ⇒ Object



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

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



1053
1054
1055
# File 'lib/phraseapp-ruby.rb', line 1053

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

#locale_id=(val) ⇒ Object



1057
1058
1059
# File 'lib/phraseapp-ruby.rb', line 1057

def locale_id=(val)
  super(val)
end

#skip_unverification=(val) ⇒ Object



1061
1062
1063
1064
1065
1066
1067
1068
1069
# File 'lib/phraseapp-ruby.rb', line 1061

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



1071
1072
1073
1074
1075
1076
1077
1078
1079
# File 'lib/phraseapp-ruby.rb', line 1071

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



1081
1082
1083
# File 'lib/phraseapp-ruby.rb', line 1081

def tags=(val)
  super(val)
end

#update_translations=(val) ⇒ Object



1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'lib/phraseapp-ruby.rb', line 1085

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



1095
1096
1097
1098
1099
1100
# File 'lib/phraseapp-ruby.rb', line 1095

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