# 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::Resources module Models # # Deployment properties. # class DeploymentProperties include MsRestAzure # @return Gets or sets the template content. Use only one of Template or # TemplateLink. attr_accessor :template # @return [TemplateLink] Gets or sets the URI referencing the template. # Use only one of Template or TemplateLink. attr_accessor :template_link # @return Deployment parameters. Use only one of Parameters or # ParametersLink. attr_accessor :parameters # @return [ParametersLink] Gets or sets the URI referencing the # parameters. Use only one of Parameters or ParametersLink. attr_accessor :parameters_link # @return [DeploymentMode] Gets or sets the deployment mode. Possible # values include: 'Incremental', 'Complete' attr_accessor :mode # @return [DebugSetting] Gets or sets the debug setting of the # deployment. attr_accessor :debug_setting # # Validate the object. Throws ValidationError if validation fails. # def validate @template_link.validate unless @template_link.nil? @parameters_link.validate unless @parameters_link.nil? @debug_setting.validate unless @debug_setting.nil? 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.template output_object['template'] = serialized_property unless serialized_property.nil? serialized_property = object.template_link unless serialized_property.nil? serialized_property = TemplateLink.serialize_object(serialized_property) end output_object['templateLink'] = serialized_property unless serialized_property.nil? serialized_property = object.parameters output_object['parameters'] = serialized_property unless serialized_property.nil? serialized_property = object.parameters_link unless serialized_property.nil? serialized_property = ParametersLink.serialize_object(serialized_property) end output_object['parametersLink'] = serialized_property unless serialized_property.nil? serialized_property = object.mode output_object['mode'] = serialized_property unless serialized_property.nil? serialized_property = object.debug_setting unless serialized_property.nil? serialized_property = DebugSetting.serialize_object(serialized_property) end output_object['debugSetting'] = 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 [DeploymentProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = DeploymentProperties.new deserialized_property = object['template'] output_object.template = deserialized_property deserialized_property = object['templateLink'] unless deserialized_property.nil? deserialized_property = TemplateLink.deserialize_object(deserialized_property) end output_object.template_link = deserialized_property deserialized_property = object['parameters'] output_object.parameters = deserialized_property deserialized_property = object['parametersLink'] unless deserialized_property.nil? deserialized_property = ParametersLink.deserialize_object(deserialized_property) end output_object.parameters_link = deserialized_property deserialized_property = object['mode'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = DeploymentMode.constants.any? { |e| DeploymentMode.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum DeploymentMode does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.mode = deserialized_property deserialized_property = object['debugSetting'] unless deserialized_property.nil? deserialized_property = DebugSetting.deserialize_object(deserialized_property) end output_object.debug_setting = deserialized_property output_object end end end end