# encoding: utf-8 # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0 # Changes may cause incorrect behavior and will be lost if the code is # regenerated. module Azure::ARM::Compute module Models # # Gets or sets additional XML formatted information that can be included # in the Unattend.xml file, which is used by Windows Setup. Contents are # defined by setting name, component name, and the pass in which the # content is a applied. # class AdditionalUnattendContent include MsRestAzure # @return [PassNames] Gets or sets the pass name. Currently, the only # allowable value is oobeSystem. Possible values include: 'oobeSystem' attr_accessor :pass_name # @return [ComponentNames] Gets or sets the component name. Currently, # the only allowable value is Microsoft-Windows-Shell-Setup. Possible # values include: 'Microsoft-Windows-Shell-Setup' attr_accessor :component_name # @return [SettingNames] Gets or sets setting name (e.g. # FirstLogonCommands, AutoLogon ). Possible values include: # 'AutoLogon', 'FirstLogonCommands' attr_accessor :setting_name # @return [String] Gets or sets XML formatted content that is added to # the unattend.xml file in the specified pass and component.The XML # must be less than 4 KB and must include the root element for the # setting or feature that is being inserted. attr_accessor :content # # Validate the object. Throws ValidationError if validation fails. # def validate end # # Serializes given Model object into Ruby Hash. # @param object Model object to serialize. # @return [Hash] Serialized object in form of Ruby Hash. # def self.serialize_object(object) object.validate output_object = {} serialized_property = object.pass_name output_object['passName'] = serialized_property unless serialized_property.nil? serialized_property = object.component_name output_object['componentName'] = serialized_property unless serialized_property.nil? serialized_property = object.setting_name output_object['settingName'] = serialized_property unless serialized_property.nil? serialized_property = object.content output_object['content'] = serialized_property unless serialized_property.nil? output_object end # # Deserializes given Ruby Hash into Model object. # @param object [Hash] Ruby Hash object to deserialize. # @return [AdditionalUnattendContent] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = AdditionalUnattendContent.new deserialized_property = object['passName'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = PassNames.constants.any? { |e| PassNames.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum PassNames does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.pass_name = deserialized_property deserialized_property = object['componentName'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = ComponentNames.constants.any? { |e| ComponentNames.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum ComponentNames does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.component_name = deserialized_property deserialized_property = object['settingName'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = SettingNames.constants.any? { |e| SettingNames.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum SettingNames does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.setting_name = deserialized_property deserialized_property = object['content'] output_object.content = deserialized_property output_object end end end end