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_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

#convert_emoji=(val) ⇒ Object



1166
1167
1168
1169
1170
1171
1172
1173
1174
# File 'lib/phraseapp-ruby.rb', line 1166

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



1176
1177
1178
# File 'lib/phraseapp-ruby.rb', line 1176

def file=(val)
  super(val)
end

#file_encoding=(val) ⇒ Object



1180
1181
1182
# File 'lib/phraseapp-ruby.rb', line 1180

def file_encoding=(val)
  super(val)
end

#file_format=(val) ⇒ Object



1184
1185
1186
# File 'lib/phraseapp-ruby.rb', line 1184

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



1188
1189
1190
# File 'lib/phraseapp-ruby.rb', line 1188

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

#locale_id=(val) ⇒ Object



1192
1193
1194
# File 'lib/phraseapp-ruby.rb', line 1192

def locale_id=(val)
  super(val)
end

#skip_unverification=(val) ⇒ Object



1196
1197
1198
1199
1200
1201
1202
1203
1204
# File 'lib/phraseapp-ruby.rb', line 1196

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



1206
1207
1208
1209
1210
1211
1212
1213
1214
# File 'lib/phraseapp-ruby.rb', line 1206

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



1216
1217
1218
# File 'lib/phraseapp-ruby.rb', line 1216

def tags=(val)
  super(val)
end

#update_descriptions=(val) ⇒ Object



1220
1221
1222
1223
1224
1225
1226
1227
1228
# File 'lib/phraseapp-ruby.rb', line 1220

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



1230
1231
1232
1233
1234
1235
1236
1237
1238
# File 'lib/phraseapp-ruby.rb', line 1230

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



1240
1241
1242
1243
1244
1245
# File 'lib/phraseapp-ruby.rb', line 1240

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