# 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::NotificationHubs module Models # # NotificationHub properties. # class NotificationHubProperties include MsRestAzure # @return [String] The NotificationHub name. attr_accessor :name # @return [String] The RegistrationTtl of the created NotificationHub attr_accessor :registration_ttl # @return [Array] The # AuthorizationRules of the created NotificationHub attr_accessor :authorization_rules # @return [ApnsCredential] The ApnsCredential of the created # NotificationHub attr_accessor :apns_credential # @return [WnsCredential] The WnsCredential of the created # NotificationHub attr_accessor :wns_credential # @return [GcmCredential] The GcmCredential of the created # NotificationHub attr_accessor :gcm_credential # @return [MpnsCredential] The MpnsCredential of the created # NotificationHub attr_accessor :mpns_credential # @return [AdmCredential] The AdmCredential of the created # NotificationHub attr_accessor :adm_credential # @return [BaiduCredential] The BaiduCredential of the created # NotificationHub attr_accessor :baidu_credential # # Validate the object. Throws ValidationError if validation fails. # def validate @authorization_rules.each{ |e| e.validate if e.respond_to?(:validate) } unless @authorization_rules.nil? @apns_credential.validate unless @apns_credential.nil? @wns_credential.validate unless @wns_credential.nil? @gcm_credential.validate unless @gcm_credential.nil? @mpns_credential.validate unless @mpns_credential.nil? @adm_credential.validate unless @adm_credential.nil? @baidu_credential.validate unless @baidu_credential.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.name output_object['name'] = serialized_property unless serialized_property.nil? serialized_property = object.registration_ttl output_object['registrationTtl'] = serialized_property unless serialized_property.nil? serialized_property = object.authorization_rules unless serialized_property.nil? serializedArray = [] serialized_property.each do |element| unless element.nil? element = SharedAccessAuthorizationRuleProperties.serialize_object(element) end serializedArray.push(element) end serialized_property = serializedArray end output_object['authorizationRules'] = serialized_property unless serialized_property.nil? serialized_property = object.apns_credential unless serialized_property.nil? serialized_property = ApnsCredential.serialize_object(serialized_property) end output_object['apnsCredential'] = serialized_property unless serialized_property.nil? serialized_property = object.wns_credential unless serialized_property.nil? serialized_property = WnsCredential.serialize_object(serialized_property) end output_object['wnsCredential'] = serialized_property unless serialized_property.nil? serialized_property = object.gcm_credential unless serialized_property.nil? serialized_property = GcmCredential.serialize_object(serialized_property) end output_object['gcmCredential'] = serialized_property unless serialized_property.nil? serialized_property = object.mpns_credential unless serialized_property.nil? serialized_property = MpnsCredential.serialize_object(serialized_property) end output_object['mpnsCredential'] = serialized_property unless serialized_property.nil? serialized_property = object.adm_credential unless serialized_property.nil? serialized_property = AdmCredential.serialize_object(serialized_property) end output_object['admCredential'] = serialized_property unless serialized_property.nil? serialized_property = object.baidu_credential unless serialized_property.nil? serialized_property = BaiduCredential.serialize_object(serialized_property) end output_object['baiduCredential'] = 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 [NotificationHubProperties] Deserialized object. # def self.deserialize_object(object) return if object.nil? output_object = NotificationHubProperties.new deserialized_property = object['name'] output_object.name = deserialized_property deserialized_property = object['registrationTtl'] output_object.registration_ttl = deserialized_property deserialized_property = object['authorizationRules'] unless deserialized_property.nil? deserialized_array = [] deserialized_property.each do |element1| unless element1.nil? element1 = SharedAccessAuthorizationRuleProperties.deserialize_object(element1) end deserialized_array.push(element1) end deserialized_property = deserialized_array end output_object.authorization_rules = deserialized_property deserialized_property = object['apnsCredential'] unless deserialized_property.nil? deserialized_property = ApnsCredential.deserialize_object(deserialized_property) end output_object.apns_credential = deserialized_property deserialized_property = object['wnsCredential'] unless deserialized_property.nil? deserialized_property = WnsCredential.deserialize_object(deserialized_property) end output_object.wns_credential = deserialized_property deserialized_property = object['gcmCredential'] unless deserialized_property.nil? deserialized_property = GcmCredential.deserialize_object(deserialized_property) end output_object.gcm_credential = deserialized_property deserialized_property = object['mpnsCredential'] unless deserialized_property.nil? deserialized_property = MpnsCredential.deserialize_object(deserialized_property) end output_object.mpns_credential = deserialized_property deserialized_property = object['admCredential'] unless deserialized_property.nil? deserialized_property = AdmCredential.deserialize_object(deserialized_property) end output_object.adm_credential = deserialized_property deserialized_property = object['baiduCredential'] unless deserialized_property.nil? deserialized_property = BaiduCredential.deserialize_object(deserialized_property) end output_object.baidu_credential = deserialized_property output_object end end end end