Class: PhraseApp::RequestParams::TranslationParams

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

Overview

TranslationParams

Parameters:

content

Translation content

excluded

Indicates whether translation is excluded.

key_id

Key

locale_id

Locale. Can be the name or public id of the locale. Preferred is the public id.

plural_suffix

Plural suffix. Can be one of: zero, one, two, few, many, other.

unverified

Indicates whether translation is unverified.

Instance Method Summary collapse

Instance Method Details

#content=(val) ⇒ Object



1085
1086
1087
# File 'lib/phraseapp-ruby.rb', line 1085

def content=(val)
  super(val)
end

#excluded=(val) ⇒ Object



1089
1090
1091
1092
1093
1094
1095
1096
1097
# File 'lib/phraseapp-ruby.rb', line 1089

def excluded=(val)
  if val.is_a?(TrueClass)
    super(true)
  elsif val.is_a?(FalseClass)
    return
  else
    PhraseApp::ParamsHelpers::ParamsValidationError.new("invalid value #{val}")
  end
end

#key_id=(val) ⇒ Object



1099
1100
1101
# File 'lib/phraseapp-ruby.rb', line 1099

def key_id=(val)
  super(val)
end

#locale_id=(val) ⇒ Object



1103
1104
1105
# File 'lib/phraseapp-ruby.rb', line 1103

def locale_id=(val)
  super(val)
end

#plural_suffix=(val) ⇒ Object



1107
1108
1109
# File 'lib/phraseapp-ruby.rb', line 1107

def plural_suffix=(val)
  super(val)
end

#unverified=(val) ⇒ Object



1111
1112
1113
1114
1115
1116
1117
1118
1119
# File 'lib/phraseapp-ruby.rb', line 1111

def unverified=(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



1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
# File 'lib/phraseapp-ruby.rb', line 1121

def validate
  
  if content == nil || content == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"content\" of \"TranslationParams\" not set")
  end
  if key_id == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"key_id\" of \"TranslationParams\" not set")
  end
  if locale_id == nil
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"locale_id\" of \"TranslationParams\" not set")
  end
end