# 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::Redis module Models # # Parameters supplied to CreateOrUpdate redis operation. # class RedisProperties include MsRestAzure # @return [String] RedisVersion parameter has been deprecated. As such, # it is no longer necessary to provide this parameter and any value # specified is ignored. attr_accessor :redis_version # @return [Sku] What sku of redis cache to deploy. attr_accessor :sku # @return [Hash{String => String}] All Redis Settings. Few possible # keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,maxmemory-policy,notify-keyspace-events,maxmemory-samples,slowlog-log-slower-than,slowlog-max-len,list-max-ziplist-entries,list-max-ziplist-value,hash-max-ziplist-entries,hash-max-ziplist-value,set-max-intset-entries,zset-max-ziplist-entries,zset-max-ziplist-value # etc. attr_accessor :redis_configuration # @return [Boolean] If the value is true, then the non-ssl redis server # port (6379) will be enabled. attr_accessor :enable_non_ssl_port # @return [Hash{String => String}] tenantSettings attr_accessor :tenant_settings # @return [Integer] The number of shards to be created on a Premium # Cluster Cache. attr_accessor :shard_count # @return [String] The exact ARM resource ID of the virtual network to # deploy the redis cache in. Example format: # /subscriptions/{subid}/resourceGroups/{resourceGroupName}/Microsoft.ClassicNetwork/VirtualNetworks/vnet1 attr_accessor :virtual_network # @return [String] Required when deploying a redis cache inside an # existing Azure Virtual Network. attr_accessor :subnet # @return [String] Required when deploying a redis cache inside an # existing Azure Virtual Network. attr_accessor :static_ip # # Validate the object. Throws ValidationError if validation fails. # def validate fail MsRest::ValidationError, 'property sku is nil' if @sku.nil? @sku.validate unless @sku.nil? @redis_configuration.each{ |e| e.validate if e.respond_to?(:validate) } unless @redis_configuration.nil? @tenant_settings.each{ |e| e.validate if e.respond_to?(:validate) } unless @tenant_settings.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.sku unless serialized_property.nil? serialized_property = Sku.serialize_object(serialized_property) end output_object['sku'] = serialized_property unless serialized_property.nil? serialized_property = object.redis_version output_object['redisVersion'] = serialized_property unless serialized_property.nil? serialized_property = object.redis_configuration output_object['redisConfiguration'] = serialized_property unless serialized_property.nil? serialized_property = object.enable_non_ssl_port output_object['enableNonSslPort'] = serialized_property unless serialized_property.nil? serialized_property = object.tenant_settings output_object['tenantSettings'] = serialized_property unless serialized_property.nil? serialized_property = object.shard_count output_object['shardCount'] = serialized_property unless serialized_property.nil? serialized_property = object.virtual_network output_object['virtualNetwork'] = serialized_property unless serialized_property.nil? serialized_property = object.subnet output_object['subnet'] = serialized_property unless serialized_property.nil? serialized_property = object.static_ip output_object['staticIP'] = 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 [RedisProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = RedisProperties.new deserialized_property = object['sku'] unless deserialized_property.nil? deserialized_property = Sku.deserialize_object(deserialized_property) end output_object.sku = deserialized_property deserialized_property = object['redisVersion'] output_object.redis_version = deserialized_property deserialized_property = object['redisConfiguration'] output_object.redis_configuration = deserialized_property deserialized_property = object['enableNonSslPort'] output_object.enable_non_ssl_port = deserialized_property deserialized_property = object['tenantSettings'] output_object.tenant_settings = deserialized_property deserialized_property = object['shardCount'] deserialized_property = Integer(deserialized_property) unless deserialized_property.to_s.empty? output_object.shard_count = deserialized_property deserialized_property = object['virtualNetwork'] output_object.virtual_network = deserialized_property deserialized_property = object['subnet'] output_object.subnet = deserialized_property deserialized_property = object['staticIP'] output_object.static_ip = deserialized_property output_object end end end end