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



1163
1164
1165
1166
1167
1168
1169
1170
1171
# File 'lib/phraseapp-ruby.rb', line 1163

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



1173
1174
1175
# File 'lib/phraseapp-ruby.rb', line 1173

def file=(val)
  super(val)
end

#file_encoding=(val) ⇒ Object



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

def file_encoding=(val)
  super(val)
end

#file_format=(val) ⇒ Object



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

def file_format=(val)
  super(val)
end

#format_options=(val) ⇒ Object



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

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

#locale_id=(val) ⇒ Object



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

def locale_id=(val)
  super(val)
end

#skip_unverification=(val) ⇒ Object



1193
1194
1195
1196
1197
1198
1199
1200
1201
# File 'lib/phraseapp-ruby.rb', line 1193

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



1203
1204
1205
1206
1207
1208
1209
1210
1211
# File 'lib/phraseapp-ruby.rb', line 1203

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



1213
1214
1215
# File 'lib/phraseapp-ruby.rb', line 1213

def tags=(val)
  super(val)
end

#update_translations=(val) ⇒ Object



1217
1218
1219
1220
1221
1222
1223
1224
1225
# File 'lib/phraseapp-ruby.rb', line 1217

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



1227
1228
1229
1230
1231
1232
# File 'lib/phraseapp-ruby.rb', line 1227

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