Class: PhraseApp::RequestParams::LocaleParams

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

Overview

LocaleParams

Parameters:

code

Locale ISO code

default

Indicates whether locale is the default locale. If set to true, the previous default locale the project is no longer the default locale.

main

Indicates whether locale is a main locale.

name

Locale name

rtl

Indicates whether locale is a RTL (Right-to-Left) locale.

source_locale_id

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

unverify_new_translations

Indicates that new translations for this locale should be marked as unverified.

unverify_updated_translations

Indicates that updated translations for this locale should be marked as unverified.

Instance Method Summary collapse

Instance Method Details

#code=(val) ⇒ Object



695
696
697
# File 'lib/phraseapp-ruby.rb', line 695

def code=(val)
  super(val)
end

#default=(val) ⇒ Object



699
700
701
702
703
704
705
706
707
# File 'lib/phraseapp-ruby.rb', line 699

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

#main=(val) ⇒ Object



709
710
711
712
713
714
715
716
717
# File 'lib/phraseapp-ruby.rb', line 709

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

#name=(val) ⇒ Object



719
720
721
# File 'lib/phraseapp-ruby.rb', line 719

def name=(val)
  super(val)
end

#rtl=(val) ⇒ Object



723
724
725
726
727
728
729
730
731
# File 'lib/phraseapp-ruby.rb', line 723

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

#source_locale_id=(val) ⇒ Object



733
734
735
# File 'lib/phraseapp-ruby.rb', line 733

def source_locale_id=(val)
  super(val)
end

#unverify_new_translations=(val) ⇒ Object



737
738
739
740
741
742
743
744
745
# File 'lib/phraseapp-ruby.rb', line 737

def unverify_new_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

#unverify_updated_translations=(val) ⇒ Object



747
748
749
750
751
752
753
754
755
# File 'lib/phraseapp-ruby.rb', line 747

def unverify_updated_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



757
758
759
760
761
762
763
764
765
# File 'lib/phraseapp-ruby.rb', line 757

def validate
  
  if code == nil || code == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"code\" of \"LocaleParams\" not set")
  end
  if name == nil || name == "" 
    raise PhraseApp::ParamsHelpers::ParamsValidationError.new("Required parameter \"name\" of \"LocaleParams\" not set")
  end
end