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



953
954
955
# File 'lib/phraseapp-ruby.rb', line 953

def content=(val)
  super(val)
end

#excluded=(val) ⇒ Object



957
958
959
960
961
962
963
964
965
# File 'lib/phraseapp-ruby.rb', line 957

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



967
968
969
# File 'lib/phraseapp-ruby.rb', line 967

def key_id=(val)
  super(val)
end

#locale_id=(val) ⇒ Object



971
972
973
# File 'lib/phraseapp-ruby.rb', line 971

def locale_id=(val)
  super(val)
end

#plural_suffix=(val) ⇒ Object



975
976
977
# File 'lib/phraseapp-ruby.rb', line 975

def plural_suffix=(val)
  super(val)
end

#unverified=(val) ⇒ Object



979
980
981
982
983
984
985
986
987
# File 'lib/phraseapp-ruby.rb', line 979

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



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

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