Class: PhraseApp::RequestParams::DistributionsParams

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

Overview

DistributionsParams

Parameters:

fallback_to_default_locale

Indicates whether to fallback to projects default locale when locale can not be found

fallback_to_non_regional_locale

Indicates whether to fallback to non regional locale when locale can not be found

name

Name of the distribution

platforms

List of platforms the distribution should support.

project_id

Project id the distribution should be assigned to.

Instance Method Summary collapse

Instance Method Details

#fallback_to_default_locale=(val) ⇒ Object



616
617
618
619
620
621
622
623
624
# File 'lib/phraseapp-ruby.rb', line 616

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

#fallback_to_non_regional_locale=(val) ⇒ Object



626
627
628
629
630
631
632
633
634
# File 'lib/phraseapp-ruby.rb', line 626

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



636
637
638
# File 'lib/phraseapp-ruby.rb', line 636

def name=(val)
  super(val)
end

#platforms=(val) ⇒ Object



640
641
642
# File 'lib/phraseapp-ruby.rb', line 640

def platforms=(val)
  super(val.split(','))
end

#project_id=(val) ⇒ Object



644
645
646
# File 'lib/phraseapp-ruby.rb', line 644

def project_id=(val)
  super(val)
end

#validateObject



648
649
650
651
652
653
654
655
656
657
658
659
# File 'lib/phraseapp-ruby.rb', line 648

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