# 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::Web module Models # # Model object. # class RestoreRequestProperties include MsRestAzure # @return [String] SAS URL to the container attr_accessor :storage_account_url # @return [String] Name of a blob which contains the backup attr_accessor :blob_name # @return [Boolean] True if the restore operation can overwrite target # site. "True" needed if trying to restore over an existing site. attr_accessor :overwrite # @return [String] Name of a site (Web App) attr_accessor :site_name # @return [Array] Collection of databses which # should be restored. This list has to match the list of databases # included in the backup. attr_accessor :databases # @return [Boolean] Changes a logic when restoring a site with custom # domains. If "true", custom domains are removed automatically. If # "false", custom domains are added to # the site object when it is being restored, but that might # fail due to conflicts during the operation. attr_accessor :ignore_conflicting_host_names # @return [BackupRestoreOperationType] Operation type. Possible values # include: 'Default', 'Clone', 'Relocation' attr_accessor :operation_type # @return [Boolean] Gets or sets a flag showing if # SiteConfig.ConnectionStrings should be set in new site attr_accessor :adjust_connection_strings # @return [String] App Service Environment name, if needed (only when # restoring a site to an App Service Environment) attr_accessor :hosting_environment # # Validate the object. Throws ValidationError if validation fails. # def validate @databases.each{ |e| e.validate if e.respond_to?(:validate) } unless @databases.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.storage_account_url output_object['storageAccountUrl'] = serialized_property unless serialized_property.nil? serialized_property = object.blob_name output_object['blobName'] = serialized_property unless serialized_property.nil? serialized_property = object.overwrite output_object['overwrite'] = serialized_property unless serialized_property.nil? serialized_property = object.site_name output_object['siteName'] = serialized_property unless serialized_property.nil? serialized_property = object.databases unless serialized_property.nil? serializedArray = [] serialized_property.each do |element| unless element.nil? element = DatabaseBackupSetting.serialize_object(element) end serializedArray.push(element) end serialized_property = serializedArray end output_object['databases'] = serialized_property unless serialized_property.nil? serialized_property = object.ignore_conflicting_host_names output_object['ignoreConflictingHostNames'] = serialized_property unless serialized_property.nil? serialized_property = object.operation_type output_object['operationType'] = serialized_property unless serialized_property.nil? serialized_property = object.adjust_connection_strings output_object['adjustConnectionStrings'] = serialized_property unless serialized_property.nil? serialized_property = object.hosting_environment output_object['hostingEnvironment'] = 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 [RestoreRequestProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = RestoreRequestProperties.new deserialized_property = object['storageAccountUrl'] output_object.storage_account_url = deserialized_property deserialized_property = object['blobName'] output_object.blob_name = deserialized_property deserialized_property = object['overwrite'] output_object.overwrite = deserialized_property deserialized_property = object['siteName'] output_object.site_name = deserialized_property deserialized_property = object['databases'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element1| unless element1.nil? element1 = DatabaseBackupSetting.deserialize_object(element1) end deserialized_array.push(element1) end deserialized_property = deserialized_array end output_object.databases = deserialized_property deserialized_property = object['ignoreConflictingHostNames'] output_object.ignore_conflicting_host_names = deserialized_property deserialized_property = object['operationType'] if (!deserialized_property.nil? && !deserialized_property.empty?) enum_is_valid = BackupRestoreOperationType.constants.any? { |e| BackupRestoreOperationType.const_get(e).to_s.downcase == deserialized_property.downcase } warn 'Enum BackupRestoreOperationType does not contain ' + deserialized_property.downcase + ', but was received from the server.' unless enum_is_valid end output_object.operation_type = deserialized_property deserialized_property = object['adjustConnectionStrings'] output_object.adjust_connection_strings = deserialized_property deserialized_property = object['hostingEnvironment'] output_object.hosting_environment = deserialized_property output_object end end end end