def serialize(self,writer: SerializationWriter) -> None:
        """
        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        """
        if writer is None:
            raise TypeError("writer cannot be null.")
        super().serialize(writer)
        writer.write_str_value("nameTarget", self.name_target)
        writer.write_int_value("port", self.port)
        writer.write_int_value("priority", self.priority)
        writer.write_str_value("protocol", self.protocol)
        writer.write_str_value("service", self.service)
        writer.write_int_value("weight", self.weight)

        Serializes information the current object
        param writer: Serialization writer to use to serialize this model
        Returns: None
        
msgraph/generated/models/domain_dns_srv_record.py