lib/jss/api_object/extension_attribute.rb
def validate_for_save
      case @input_type
      when INPUT_TYPE_POPUP
        raise MissingDataError, "No popup_choices set for input type: #{INPUT_TYPE_POPUP}" unless @popup_choices.is_a?(Array) && !@popup_choices.empty?
      when INPUT_TYPE_LDAP
        raise MissingDataError, "No attribute_mapping set for input type: #{INPUT_TYPE_LDAP}" if @attribute_mapping.to_s.empty?
      when INPUT_TYPE_SCRIPT
        raise MissingDataError, "No script set for input_type: #{INPUT_TYPE_SCRIPT}" unless @script

        # Next two lines DEPRECATED
        @platform ||= 'Mac'
        raise MissingDataError, "No scripting_language set for Windows '#{INPUT_TYPE_SCRIPT}' input_type." if @platform == 'Windows' && !@scripting_language
      end
    end
# make sure things are OK for saving to Jamf
make sure things are OK for saving to Jamf
make sure things are OK for saving to Jamf
def validate_for_save
      case @input_type
      when INPUT_TYPE_POPUP
        raise MissingDataError, "No popup_choices set for input type: #{INPUT_TYPE_POPUP}" unless @popup_choices.is_a?(Array) && !@popup_choices.empty?
      when INPUT_TYPE_LDAP
        raise MissingDataError, "No attribute_mapping set for input type: #{INPUT_TYPE_LDAP}" if @attribute_mapping.to_s.empty?
      when INPUT_TYPE_SCRIPT
        raise MissingDataError, "No script set for input_type: #{INPUT_TYPE_SCRIPT}" unless @script
        @platform ||= 'Mac'
        raise MissingDataError, "No scripting_language set for Windows '#{INPUT_TYPE_SCRIPT}' input_type." if @platform == 'Windows' && !@scripting_language
      end
    end
def validate_for_save case @input_type when INPUT_TYPE_POPUP raise MissingDataError , "No popup_choices set for input type: #{INPUT_TYPE_POPUP}" unless @popup_choices . is_a? ( Array ) && ! @popup_choices . empty? when INPUT_TYPE_LDAP raise MissingDataError , "No attribute_mapping set for input type: #{INPUT_TYPE_LDAP}" if @attribute_mapping . to_s . empty? when INPUT_TYPE_SCRIPT raise MissingDataError , "No script set for input_type: #{INPUT_TYPE_SCRIPT}" unless @script @platform ||= 'Mac' raise MissingDataError , "No scripting_language set for Windows '#{INPUT_TYPE_SCRIPT}' input_type." if @platform == 'Windows' && ! @scripting_language end end
make sure things are OK for saving to Jamf
make sure things are OK for saving to Jamf
# Next two lines DEPRECATED