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_format

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

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



967
968
969
970
971
972
973
974
975
# File 'lib/phraseapp-ruby.rb', line 967

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

#file=(val) ⇒ Object



977
978
979
# File 'lib/phraseapp-ruby.rb', line 977

def file=(val)
  self.file = val
end

#file_format=(val) ⇒ Object



981
982
983
# File 'lib/phraseapp-ruby.rb', line 981

def file_format=(val)
  self.file_format = val
end

#locale_id=(val) ⇒ Object



985
986
987
# File 'lib/phraseapp-ruby.rb', line 985

def locale_id=(val)
  self.locale_id = val
end

#skip_unverification=(val) ⇒ Object



989
990
991
992
993
994
995
996
997
# File 'lib/phraseapp-ruby.rb', line 989

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

#skip_upload_tags=(val) ⇒ Object



999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/phraseapp-ruby.rb', line 999

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

#tags=(val) ⇒ Object



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

def tags=(val)
  self.tags = val
end

#to_hObject



1029
1030
1031
# File 'lib/phraseapp-ruby.rb', line 1029

def to_h
  @table.dup
end

#update_translations=(val) ⇒ Object



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

def update_translations=(val)
  if val.is_a?(TrueClass)
    self.update_translations = true
  elsif val.is_a?(FalseClass) #ignore
    self.update_translations = b
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#validateObject



1023
1024
1025
1026
1027
# File 'lib/phraseapp-ruby.rb', line 1023

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